6 Commits

Author SHA1 Message Date
TheAssassin 3919cb0eba Make AppImageUpdate work 2019-09-28 17:03:06 +02:00
TheAssassin 59430de4d1 Fix travis config, mk. 1 2019-09-28 16:48:12 +02:00
TheAssassin a716e088e5 Build on CentOS 6 2019-09-28 16:41:16 +02:00
TheAssassin bed665d924 Fix variable escaping 2019-09-28 16:40:41 +02:00
TheAssassin 17beb503b0 Update ignore patterns 2019-09-28 16:40:33 +02:00
TheAssassin ed38c45be4 Merge pull request #49 from linuxdeploy/restructuring
Big restructuring
2019-09-27 13:57:02 +02:00
8 changed files with 190 additions and 40 deletions
+1
View File
@@ -1,2 +1,3 @@
*build*/
.idea/
*.AppImage
+42 -38
View File
@@ -1,10 +1,37 @@
language: cpp
sudo: required
dist: xenial
matrix:
include:
- env: ARCH=x86_64
- name: Build x86_64 AppImage on CentOS 6
services:
- docker
env: ARCH=x86_64 BUILD_TYPE=centos6
script: travis/build-centos6-docker.sh
after_success:
- ls -lh
# make sure only pushes to rewrite create a new release, otherwise pretend PR and upload to transfer.sh
- if [ "$TRAVIS_TAG" != "$TRAVIS_BRANCH" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh linuxdeploy*.AppImage*
- name: Build i386 AppImage on CentOS 6
services:
- docker
env: ARCH=i386 BUILD_TYPE=centos6
script: travis/build-centos6-docker.sh
after_success:
- ls -lh
# make sure only pushes to rewrite create a new release, otherwise pretend PR and upload to transfer.sh
- if [ "$TRAVIS_TAG" != "$TRAVIS_BRANCH" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh linuxdeploy*.AppImage*
# TODO: build and test on i386 as well!
- name: Build and test on Ubuntu xenial (no binaries uploaded)
dist: xenial
sudo: required
env: ARCH=x86_64 BUILD_TYPE=test
addons:
apt:
update: true
@@ -25,42 +52,19 @@ matrix:
- mesa-common-dev
- libgl1-mesa-dev # <-- that's for xenial to provide the x86_64-linux-gnu/libGL.so symlink
- # libglvnd-dev # <-- that's for bionic to provide aforementioned symlink
- env: ARCH=i386
addons:
apt:
update: true
packages:
- libmagic-dev:i386
- libjpeg-dev:i386
- libpng-dev:i386
- automake # required for patchelf
- libfuse2:i386
- libcairo2:i386
- gcc-multilib
- g++-multilib
install:
- git clone https://github.com/NixOS/patchelf.git -b 0.8
- cd patchelf
- ./bootstrap.sh
- if [ "$ARCH" == "i386" ]; then export EXTRA_CONFIGURE_ARGS=("--build=i686-pc-linux-gnu" "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"); fi
- ./configure --prefix=/usr "${EXTRA_CONFIGURE_ARGS[@]}"
- make -j$(nproc)
- sudo make install
- cd ..
- rm -rf patchelf
script:
- bash -xe travis/build.sh
# TODO: allow for cross-compiling the test projects and install i386 packages for build dependencies, then remove $ARCH check
- if [ "$ARCH" == "x86_64" ]; then bash -xe travis/test.sh linuxdeploy-plugin-qt-"$ARCH".AppImage; fi
after_success:
- ls -lh
# make sure only pushes to rewrite create a new release, otherwise pretend PR and upload to transfer.sh
- if [ "$TRAVIS_TAG" != "$TRAVIS_BRANCH" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh linuxdeploy*.AppImage*
install:
- git clone https://github.com/NixOS/patchelf.git -b 0.8
- cd patchelf
- ./bootstrap.sh
- if [ "$ARCH" == "i386" ]; then export EXTRA_CONFIGURE_ARGS=("--build=i686-pc-linux-gnu" "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"); fi
- ./configure --prefix=/usr "${EXTRA_CONFIGURE_ARGS[@]}"
- make -j$(nproc)
- sudo make install
- cd ..
- rm -rf patchelf
script:
- bash -xe travis/build.sh
- bash -xe travis/test.sh linuxdeploy-plugin-qt-"$ARCH".AppImage
branches:
except:
+24
View File
@@ -0,0 +1,24 @@
FROM centos:6
RUN yum install -y centos-release-scl-rh && \
yum install -y devtoolset-7 wget curl patchelf vim-common fuse libfuse2 libtool autoconf automake zlib-devel libjpeg-devel libpng-devel nano git && \
wget https://artifacts.assassinate-you.net/artifactory/cmake-centos6/cmake-v3.15.3-x86_64.tar.gz -O- | tar xz --strip-components=1 -C/usr/local
ENV ARCH=x86_64
COPY entrypoint.sh /
SHELL ["/entrypoint.sh", "bash", "-x", "-c"]
ENTRYPOINT ["/entrypoint.sh"]
RUN yum install -y gcc-c++ && \
git clone https://github.com/NixOS/patchelf.git && \
pushd patchelf && \
# cannot use -b since it's not supported in really old versions of git
git checkout 0.8 && \
./bootstrap.sh && \
./configure --prefix=/usr/local && \
make -j $(nproc) && \
make install && \
popd && \
rm -r patchelf/
CMD ["bash"]
+35
View File
@@ -0,0 +1,35 @@
FROM i386/centos:6
SHELL ["/bin/bash", "-x", "-c"]
# during Docker build, yum doesn't detect it's an i386 environment on x86_64 machines, and tries to install x86_64 packages, which can't work
# this little command fixes this
RUN sed -i 's/$basearch/i386/g' /etc/yum.repos.d/CentOS-Base.repo
# thanks CloudLinux, you're really helping us poor AppImage creators seeking for maximum compatibility by providing devtoolset i386 builds
RUN yum install -y yum-utils && \
rpm --import https://repo.cloudlinux.com/cloudlinux/security/RPM-GPG-KEY-CloudLinux && \
yum-config-manager --add-repo https://www.repo.cloudlinux.com/cloudlinux/6/sclo/devtoolset-7/i386/ && \
yum install -y devtoolset-7 wget curl patchelf vim-common fuse libfuse2 libtool autoconf automake zlib-devel libjpeg-devel libpng-devel nano git
# the shell wrapper takes care of enabling devtoolset and running a shell properly
# unfortunately this is the easiest and most solid workaround to the limitations of the scl command
COPY entrypoint.sh /
ENV ARCH=i386
ENTRYPOINT ["/entrypoint.sh"]
SHELL ["/entrypoint.sh", "bash", "-x", "-c"]
RUN wget https://artifacts.assassinate-you.net/artifactory/cmake-centos6/cmake-v3.15.3-i386.tar.gz -O- | tar xz --strip-components=1 -C/usr/local
RUN git clone https://github.com/NixOS/patchelf.git && \
pushd patchelf && \
# cannot use -b since it's not supported in really old versions of git
git checkout 0.8 && \
./bootstrap.sh && \
./configure --prefix=/usr/local && \
make -j $(nproc) && \
make install && \
popd && \
rm -r patchelf/
CMD ["bash"]
+18
View File
@@ -0,0 +1,18 @@
#! /bin/bash
set -xe
old_cwd=$(readlink -f .)
here=$(readlink -f $(dirname "$0"))
DOCKERFILE="$here"/Dockerfile.centos6
IMAGE=linuxdeploy-build-centos6
if [ "$ARCH" == "i386" ]; then
DOCKERFILE="$DOCKERFILE"-i386
IMAGE="$IMAGE"-i386
fi
(cd "$here" && docker build -f "$DOCKERFILE" -t "$IMAGE" .)
docker run --rm -it -v "$here"/..:/ws:ro -v "$old_cwd":/out -e CI=1 -e OUTDIR_OWNER=$(id -u) "$IMAGE" /bin/bash -xe -c "cd /out && /ws/travis/build-centos6.sh"
+59
View File
@@ -0,0 +1,59 @@
#! /bin/bash
set -e
set -x
if [ "$ARCH" == "" ]; then
echo 'Error: $ARCH is not set'
exit 1
fi
# use RAM disk if possible
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
TEMP_BASE=/dev/shm
else
TEMP_BASE=/tmp
fi
BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" linuxdeploy-plugin-qt-build-XXXXXX)
cleanup () {
if [ -d "$BUILD_DIR" ]; then
rm -rf "$BUILD_DIR"
fi
}
trap cleanup EXIT
# store repo root as variable
REPO_ROOT=$(readlink -f $(dirname $(dirname "$0")))
OLD_CWD=$(readlink -f .)
pushd "$BUILD_DIR"
cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo "${EXTRA_CMAKE_ARGS[@]}" -DUSE_SYSTEM_CIMG=Off
make -j$(nproc)
ctest -V
make install DESTDIR=AppDir
strip_path=$(which strip)
export UPD_INFO="gh-releases-zsync|linuxdeploy|linuxdeploy-plugin-qt|continuous|linuxdeploy-plugin-qt-$ARCH.AppImage"
# we're in Docker...
export APPIMAGE_EXTRACT_AND_RUN=1
wget https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-"$ARCH".AppImage
chmod +x linuxdeploy*.AppImage
sed -i 's|AI\x02|\x00\x00\x00|' *.AppImage
./linuxdeploy-"$ARCH".AppImage --appdir AppDir \
-d "$REPO_ROOT"/resources/linuxdeploy-plugin-qt.desktop \
-i "$REPO_ROOT"/resources/linuxdeploy-plugin-qt.svg \
-e $(which patchelf) \
-e "$strip_path" \
--output appimage
mv linuxdeploy-plugin-qt-"$ARCH".AppImage* "$OLD_CWD"/
+2 -2
View File
@@ -26,7 +26,7 @@ cleanup () {
trap cleanup EXIT
# store repo root as variable
REPO_ROOT=$(readlink -f $(dirname $(dirname $0)))
REPO_ROOT=$(readlink -f $(dirname $(dirname "$0")))
OLD_CWD=$(readlink -f .)
pushd "$BUILD_DIR"
@@ -70,4 +70,4 @@ chmod +x linuxdeploy*.AppImage
-e "$strip_path" \
--output appimage
mv linuxdeploy-plugin-qt-"$ARCH".AppImage "$OLD_CWD"/
mv linuxdeploy-plugin-qt-"$ARCH".AppImage* "$OLD_CWD"/
+9
View File
@@ -0,0 +1,9 @@
#! /bin/bash
# get a compiler that allows for using modern-ish C++ (>= 11) on a distro that doesn't normally support it
# before you ask: yes, the binaries will work on CentOS 6 even without devtoolset (they somehow partially link C++
# things statically while using others from the system...)
# so, basically, it's magic!
source /opt/rh/devtoolset-*/enable
exec "$@"