From f7fd10b8159d3caf6ddb4517c711f9301128ba0d Mon Sep 17 00:00:00 2001 From: Ulrich Huber Date: Fri, 14 Jun 2019 17:11:17 +0200 Subject: [PATCH] Add build script for lua --- readme/WindowsBuild.md | 20 ++++----- windows-setup/build-lua.sh | 90 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 10 deletions(-) create mode 100644 windows-setup/build-lua.sh diff --git a/readme/WindowsBuild.md b/readme/WindowsBuild.md index 012422a1..3d7354b9 100644 --- a/readme/WindowsBuild.md +++ b/readme/WindowsBuild.md @@ -53,14 +53,18 @@ pacman -S mingw-w64-x86_64-libsndfile \ pacman -S mingw-w64-x86_64-libzip ``` -TODO: Lua 5.3 is missing for MSYS2? - -### sndfile / PortAudio +### PortAudio Build/Install portaudio with ```bash windows-setup/build-portaudio.sh ``` +### Lua +Build/Install lua with +```bash +windows-setup/build-lua.sh +``` + ## Get sources and build ```bash @@ -76,13 +80,9 @@ make ``` ## Packaging and Setup -go to the folder +Create the installer with ```bash -cd windows-setup +windows-setup/build-setup.sh ``` -and execute -```bash -./build-setup.sh -``` - +The installer will be located at `windows-setup/xournalpp-setup.exe` diff --git a/windows-setup/build-lua.sh b/windows-setup/build-lua.sh new file mode 100644 index 00000000..68ac995d --- /dev/null +++ b/windows-setup/build-lua.sh @@ -0,0 +1,90 @@ +#!/bin/bash + +## Edit the following lines to update the version of Lua +LUA_MAJOR=5.3 +LUA_VERSION=5.3.5 +LUA_CHECKSUM=112eb10ff04d1b4c9898e121d6bdf54a81482447 + +PREFIX=/mingw64 + +printf "Downloading Lua ${LUA_VERSION}\n" +rm -f lua-${LUA_VERSION}.tar.gz +rm -rf lua-${LUA_VERSION} +wget -q https://www.lua.org/ftp/lua-${LUA_VERSION}.tar.gz + +#Check the checksum of the downloaded archive +printf "Checking integrity of downloaded files..." +printf "${LUA_CHECKSUM} *lua-${LUA_VERSION}.tar.gz" | sha1sum -c --strict - +if [ $? != 0 ]; then + exit 1 +fi + +echo "Unpacking Lua..." +tar -xzf lua-${LUA_VERSION}.tar.gz +rm lua-${LUA_VERSION}.tar.gz +cd lua-${LUA_VERSION} + +echo "" +echo "Patching Lua..." +FILE="./lua_makefile.patch" +/bin/cat >$FILE <$FILE +V=${LUA_MAJOR} +R=$LUA_VERSION} + +prefix=${PREFIX} +exec_prefix=${prefix} +lib_name=lua${LUA_MAJOR} +libdir=${prefix}/lib/ +includedir=${prefix}/include + +# +# The following are intended to be used via "pkg-config --variable". + +# Install paths for Lua modules. For example, if a package wants to install +# Lua source modules to the /usr/local tree, call pkg-config with +# "--define-variable=prefix=/usr/local" and "--variable=INSTALL_LMOD". +INSTALL_LMOD=${prefix}/share/lua/${LUA_MAJOR} +INSTALL_CMOD=${prefix}/lib/lua/${LUA_MAJOR} + +Name: Lua +Description: Lua language engine +Version: ${LUA_VERSION} +Libs: -L${libdir} -llua +Libs.private: -lm -ldl +Cflags: -I${includedir} +EOM + +echo "" +echo "Installation of Lua was successful"