From d6461633849ca4ee6775ac753042c09510b22101 Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Wed, 6 Sep 2017 18:01:36 +0200 Subject: [PATCH] Add i686 support and dockerfile --- appimage/build.sh | 19 ++++++++++--------- docker/Dockerfile-32bit | 22 ++++++++++++++++++++++ docker/build.sh | 3 +-- flatpak/build.sh | 8 +++++--- snap/build.sh | 8 +++++--- 5 files changed, 43 insertions(+), 17 deletions(-) create mode 100644 docker/Dockerfile-32bit diff --git a/appimage/build.sh b/appimage/build.sh index 08a91e1..8c8ab48 100755 --- a/appimage/build.sh +++ b/appimage/build.sh @@ -1,16 +1,17 @@ #!/bin/bash -CURRENT_APPIMAGEKIT_RELEASE=9 - set -eo >/dev/null +CURRENT_APPIMAGEKIT_RELEASE=9 +ARCH="$(uname -m)" + if [[ $# -lt 1 ]]; then echo "Usage: $0 " exit 0 fi VERSION="$1" -if ! test -f ../tarball/love-${VERSION}-amd64.tar.gz; then +if ! test -f ../tarball/love-${VERSION}-${ARCH}.tar.gz; then echo "No tarball found for $VERSION" exit 1 fi @@ -26,19 +27,19 @@ download_if_needed() { fi } -download_if_needed appimagetool-x86_64.AppImage -download_if_needed AppRun-x86_64 +download_if_needed appimagetool-${ARCH}.AppImage +download_if_needed AppRun-${ARCH} # Extract the tarball build into a folder rm -rf love-prepared mkdir love-prepared -tar xf ../tarball/love-${VERSION}-amd64.tar.gz -C love-prepared --strip-components=1 +tar xf ../tarball/love-${VERSION}-${ARCH}.tar.gz -C love-prepared --strip-components=1 cd love-prepared # Add our small wrapper script (yay, more wrappers), and AppRun cp ../wrapper usr/bin/wrapper-love -cp ../AppRun-x86_64 AppRun +cp ../AppRun-${ARCH} AppRun # Add our desktop file sed -e 's/%BINPREFIX%/wrapper-/' -e 's/%ICONPREFIX%//' love.desktop.in > love.desktop @@ -51,5 +52,5 @@ cp love.svg .DirIcon cd .. # Work around missing FUSE/docker -./appimagetool-x86_64.AppImage --appimage-extract -./squashfs-root/AppRun love-prepared love-${VERSION}-x86_64.AppImage +./appimagetool-${ARCH}.AppImage --appimage-extract +./squashfs-root/AppRun love-prepared love-${VERSION}-${ARCH}.AppImage diff --git a/docker/Dockerfile-32bit b/docker/Dockerfile-32bit new file mode 100644 index 0000000..3d484a1 --- /dev/null +++ b/docker/Dockerfile-32bit @@ -0,0 +1,22 @@ +FROM i386/debian:wheezy + +# Install all sdl, love (build) deps and love-linux-builder deps +RUN apt-get update && apt-get install -y build-essential libgl1-mesa-glx libgles2-mesa-dev libxrandr-dev libdbus-1-dev libxi-dev libxcursor-dev libxinerama-dev libgl1-mesa-dev libibus-1.0-dev libasound2-dev libpulse-dev libwayland-dev libfreetype6-dev libopenal-dev libmodplug-dev libvorbis-dev libtheora-dev libphysfs-dev libmpg123-dev squashfs-tools curl mercurial libfuse2 autotools-dev automake libtool pkg-config + +# Now build sdl +ADD SDL2-2.0.5.tar.gz /tmp/ +RUN cd /tmp/SDL2-2.0.5 && ./configure --prefix=/usr && make all install + +# And build luajit +ADD LuaJIT-2.0.5.tar.gz /tmp/ +RUN cd /tmp/LuaJIT-2.0.5 && make all install + +# Add the build script +ADD build.sh /build/ + +# Add the volumes, the first the love-linux-builder (mandatory), the second the love source (optional) +RUN mkdir -p /build/love-linux-builder /build/love +VOLUME /build/love-linux-builder /build/love + +# Finally, set the build script as entrypoint +ENTRYPOINT ["/usr/bin/setarch", "i686", "/build/build.sh"] diff --git a/docker/build.sh b/docker/build.sh index 8a9b54a..9436e77 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -6,8 +6,7 @@ if [ $# -lt 1 ]; then fi VERSION="$1" -#ARCH="$(uname -m)" -ARCH="amd64" +ARCH="$(uname -m)" cd /build/love-linux-builder diff --git a/flatpak/build.sh b/flatpak/build.sh index 087e9db..9d8eb8b 100755 --- a/flatpak/build.sh +++ b/flatpak/build.sh @@ -2,13 +2,15 @@ set -eo >/dev/null +ARCH="$(uname -m)" + if [[ $# -lt 1 ]]; then echo "Usage: $0 " exit 0 fi VERSION="$1" -if ! test -f ../tarball/love-${VERSION}-amd64.tar.gz; then +if ! test -f ../tarball/love-${VERSION}-${ARCH}.tar.gz; then echo "No tarball found for $VERSION" exit 1 fi @@ -21,7 +23,7 @@ fi # Extract the tarball build into a folder rm -rf files mkdir files -tar xf ../tarball/love-${VERSION}-amd64.tar.gz -C files --strip-components=1 +tar xf ../tarball/love-${VERSION}-${ARCH}.tar.gz -C files --strip-components=1 cd files @@ -43,4 +45,4 @@ mkdir -p lib/GL cd .. #rm -rf repo flatpak build-export repo . ${VERSION} -flatpak build-bundle repo love-${VERSION}-x86_64.flatpak org.love2d.love $VERSION +flatpak build-bundle repo love-${VERSION}-${ARCH}.flatpak org.love2d.love $VERSION diff --git a/snap/build.sh b/snap/build.sh index 1c60ec0..da875ef 100755 --- a/snap/build.sh +++ b/snap/build.sh @@ -2,13 +2,15 @@ set -eo >/dev/null +ARCH="$(uname -m)" + if [[ $# -lt 1 ]]; then echo "Usage: $0 " exit 0 fi VERSION="$1" -if ! test -f ../tarball/love-${VERSION}-amd64.tar.gz; then +if ! test -f ../tarball/love-${VERSION}-${ARCH}.tar.gz; then echo "No tarball found for $VERSION" exit 1 fi @@ -16,7 +18,7 @@ fi # Extract the tarball build into a folder rm -rf love-prepared mkdir love-prepared -tar xf ../tarball/love-${VERSION}-amd64.tar.gz -C love-prepared --strip-components=1 +tar xf ../tarball/love-${VERSION}-${ARCH}.tar.gz -C love-prepared --strip-components=1 cd love-prepared @@ -32,4 +34,4 @@ sed -e "s/%VERSION%/$VERSION/" ../snap.yaml > meta/snap.yaml cp ../command-love.wrapper . # Finally, build it! -mksquashfs . ../love_${VERSION}_amd64.snap -noappend +mksquashfs . ../love_${VERSION}_${ARCH}.snap -noappend