Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cca5ad2

Browse files
authored
Merge pull request #96 from linuxdeploy/completely-switch-to-centos6
Build all binaries on CentOS 6
2 parents 8252503 + 0588326 commit cca5ad2

6 files changed

+88
-91
lines changed

.travis.yml

+29-64
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,31 @@ sudo: required
33

44
matrix:
55
include:
6-
- env: ARCH=x86_64
7-
addons:
8-
apt:
9-
update: true
10-
packages:
11-
- libmagic-dev
12-
- libjpeg-dev
13-
- libpng-dev
14-
- cimg-dev
15-
- automake # required for patchelf
16-
- env: ARCH=i386
17-
addons:
18-
apt:
19-
update: true
20-
packages:
21-
- libmagic-dev:i386
22-
- libjpeg-dev:i386
23-
- libpng-dev:i386
24-
- gcc-multilib
25-
- g++-multilib
26-
- automake # required for patchelf
27-
- libfuse2:i386
28-
- libcairo2:i386
29-
- env: ARCH=x86_64 BUILD_TYPE=coverage
6+
- name: CentOS 6 x86_64 build
7+
env: ARCH=x86_64 BUILD_TYPE=centos6
8+
install: true
9+
services:
10+
- docker
11+
script: travis/build-centos6-docker.sh
12+
after_success:
13+
- if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
14+
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
15+
- bash upload.sh linuxdeploy-"$ARCH".AppImage*
16+
17+
- name: CentOS 6 i386 build
18+
env: ARCH=i386 BUILD_TYPE=centos6
19+
install: true
20+
services:
21+
- docker
22+
script: travis/build-centos6-docker.sh
23+
after_success:
24+
- if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
25+
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
26+
- bash upload.sh linuxdeploy-"$ARCH".AppImage*
27+
28+
- name: Ubuntu xenial x86_64 coverage build (no binaries uploaded)
29+
env: ARCH=x86_64 BUILD_TYPE=coverage
30+
dist: xenial
3031
addons:
3132
apt:
3233
update: true
@@ -39,7 +40,10 @@ matrix:
3940
- sudo pip install gcovr
4041
script: travis/test-coverage.sh
4142
after_success: true # also, we don't intend to upload release binaries
42-
- env: ARCH=i386 BUILD_TYPE=coverage
43+
44+
- name: Ubuntu xenial i386 coverage build (no binaries uploaded)
45+
env: ARCH=i386 BUILD_TYPE=coverage
46+
dist: xenial
4347
addons:
4448
apt:
4549
update: true
@@ -55,45 +59,6 @@ matrix:
5559
- sudo pip install gcovr
5660
script: travis/test-coverage.sh
5761
after_success: true # also, we don't intend to upload release binaries
58-
- env: ARCH=x86_64 BUILD_TYPE=centos6
59-
install: true
60-
services:
61-
- docker
62-
script: travis/build-centos6-docker.sh
63-
after_success:
64-
- if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
65-
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
66-
- bash upload.sh linuxdeploy-centos6-"$ARCH".AppImage*
67-
- env: ARCH=i386 BUILD_TYPE=centos6
68-
install: true
69-
services:
70-
- docker
71-
script: travis/build-centos6-docker.sh
72-
after_success:
73-
- if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
74-
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
75-
- bash upload.sh linuxdeploy-centos6-"$ARCH".AppImage*
76-
77-
install:
78-
- git clone https://github.com/NixOS/patchelf.git -b 0.8
79-
- cd patchelf
80-
- ./bootstrap.sh
81-
- if [ "$ARCH" == "i386" ]; then ./configure --prefix=/usr --build=i686-pc-linux-gnu CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32; fi
82-
- if [ "$ARCH" == "x86_64" ]; then ./configure --prefix=/usr; fi
83-
- make -j$(nproc)
84-
- sudo make install
85-
- cd ..
86-
- rm -rf patchelf
87-
88-
script:
89-
- travis/build.sh
90-
91-
after_success:
92-
- ls -lh
93-
# make sure only pushes to rewrite create a new release, otherwise pretend PR and upload to transfer.sh
94-
- if [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
95-
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
96-
- bash upload.sh linuxdeploy-"$ARCH".AppImage*
9762

9863
branches:
9964
except:

travis/Dockerfile.centos6

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ RUN yum install -y gcc-c++ && \
2020
make install && \
2121
popd && \
2222
rm -r patchelf/
23+
24+
CMD ["bash"]

travis/Dockerfile.centos6-i386

+1-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ RUN git clone https://github.com/Kitware/CMake && \
2828
make install && \
2929
cd .. && \
3030
rm -r CMake/
31-
# wget https://github.com/Kitware/CMake/releases/download/v3.13.4/cmake-3.13.4-Linux-x86_64.tar.gz -O- | tar xz --strip-components=1 -C/usr/local
32-
33-
#RUN wget http://springdale.math.ias.edu/data/puias/computational/6/x86_64//patchelf-0.8-2.sdl6.x86_64.rpm && \
34-
# echo "3d746306f5f7958b9487e6d08f53bb13 patchelf-0.8-2.sdl6.x86_64.rpm" || md5sum -c && \
35-
# rpm -i patchelf-0.8-2.sdl6.x86_64.rpm
3631

3732
RUN yum install -y gcc-c++ && \
3833
git clone https://github.com/NixOS/patchelf.git && \
@@ -46,3 +41,4 @@ RUN yum install -y gcc-c++ && \
4641
popd && \
4742
rm -r patchelf/
4843

44+
CMD ["bash"]

travis/build-centos6-docker.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ fi
1515

1616
(cd "$here" && docker build -f "$DOCKERFILE" -t "$IMAGE" .)
1717

18-
docker run --rm -i -v "$here"/..:/ws:ro -v "$old_cwd":/out -e OUTDIR_OWNER=$(id -u) "$IMAGE" /bin/bash -xe /ws/travis/build-centos6.sh
18+
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"

travis/build-centos6.sh

+52-19
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,34 @@
11
#! /bin/bash
22

3-
set -xe
3+
set -e
4+
set -x
45

5-
mkdir build
6-
cd build
6+
# use RAM disk if possible
7+
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
8+
TEMP_BASE=/dev/shm
9+
else
10+
TEMP_BASE=/tmp
11+
fi
712

8-
cmake /ws -DCMAKE_INSTALL_PREFIX=/usr -DUSE_SYSTEM_CIMG=Off
13+
BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" linuxdeploy-build-XXXXXX)
914

10-
make -j8
15+
cleanup () {
16+
if [ -d "$BUILD_DIR" ]; then
17+
rm -rf "$BUILD_DIR"
18+
fi
19+
}
20+
21+
trap cleanup EXIT
22+
23+
# store repo root as variable
24+
REPO_ROOT=$(readlink -f $(dirname $(dirname "$0")))
25+
OLD_CWD=$(readlink -f .)
26+
27+
pushd "$BUILD_DIR"
28+
29+
cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DUSE_SYSTEM_CIMG=Off -DUSE_CCACHE=Off
30+
31+
make -j$(nproc)
1132

1233
ctest -V
1334

@@ -17,23 +38,35 @@ LINUXDEPLOY_ARGS=("--appdir" "AppDir" "-e" "bin/linuxdeploy" "-i" "/ws/resources
1738
# deploy patchelf which is a dependency of linuxdeploy
1839
bin/linuxdeploy "${LINUXDEPLOY_ARGS[@]}"
1940

20-
tar cfvz /out/appdir.tgz AppDir
41+
# bundle AppImage plugin
42+
mkdir -p AppDir/plugins
43+
44+
wget https://github.com/TheAssassin/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-"$ARCH".AppImage
45+
chmod +x linuxdeploy-plugin-appimage-"$ARCH".AppImage
46+
sed -i 's|AI\x02|\x00\x00\x00|' linuxdeploy*.AppImage
47+
./linuxdeploy-plugin-appimage-"$ARCH".AppImage --appimage-extract
48+
mv squashfs-root/ AppDir/plugins/linuxdeploy-plugin-appimage
49+
50+
ln -s ../../plugins/linuxdeploy-plugin-appimage/AppRun AppDir/usr/bin/linuxdeploy-plugin-appimage
51+
52+
export UPD_INFO="gh-releases-zsync|linuxdeploy|linuxdeploy|continuous|linuxdeploy-$ARCH.AppImage"
53+
export OUTPUT=linuxdeploy-"$ARCH".AppImage
54+
55+
# build AppImage using plugin
56+
AppDir/usr/bin/linuxdeploy-plugin-appimage --appdir AppDir/
2157

22-
# cannot add appimage plugin yet, since it won't work on CentOS 6 (at least for now)
23-
# therefore we also need to use appimagetool directly to build an AppImage
24-
# but we can still prepare the AppDir
25-
APPIMAGETOOL_ARCH="$ARCH"
26-
if [ "$APPIMAGETOOL_ARCH" == "i386" ]; then APPIMAGETOOL_ARCH="i686"; fi
58+
# rename AppImage to avoid "Text file busy" issues when using it to create another one
59+
mv "$OUTPUT" test.AppImage
60+
# also have to patch our test AppImage, but we can leave the newly produced one untouched
61+
sed -i 's|AI\x02|\x00\x00\x00|' test.AppImage
2762

28-
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-"$APPIMAGETOOL_ARCH".AppImage
29-
chmod +x appimagetool-"$APPIMAGETOOL_ARCH".AppImage
30-
sed -i 's/AI\x02/\x00\x00\x00/' appimagetool*.AppImage
63+
# verify that the resulting AppImage works
64+
./test.AppImage --appimage-extract-and-run "${LINUXDEPLOY_ARGS[@]}"
3165

32-
appimage=linuxdeploy-centos6-"$ARCH".AppImage
33-
./appimagetool-"$APPIMAGETOOL_ARCH".AppImage --appimage-extract
34-
squashfs-root/AppRun AppDir "$appimage" 2>&1
66+
# check whether AppImage plugin is found and works
67+
./test.AppImage --appimage-extract-and-run "${LINUXDEPLOY_ARGS[@]}" --output appimage
3568

36-
chown "$OUTDIR_OWNER" "$appimage"
69+
chown "$OUTDIR_OWNER" "$OUTPUT"
3770

38-
mv "$appimage" /out
71+
mv "$OUTPUT"* "$OLD_CWD"/
3972

travis/build.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,18 @@ mv squashfs-root/ AppDir/plugins/linuxdeploy-plugin-appimage
7575
ln -s ../../plugins/linuxdeploy-plugin-appimage/AppRun AppDir/usr/bin/linuxdeploy-plugin-appimage
7676

7777
export UPD_INFO="gh-releases-zsync|linuxdeploy|linuxdeploy|continuous|linuxdeploy-$ARCH.AppImage"
78+
export OUTPUT="linuxdeploy-devbuild-$ARCH.AppImage"
7879

7980
# build AppImage using plugin
8081
AppDir/usr/bin/linuxdeploy-plugin-appimage --appdir AppDir/
8182

8283
# rename AppImage to avoid "Text file busy" issues when using it to create another one
83-
mv ./linuxdeploy-"$ARCH".AppImage test.AppImage
84+
mv "$OUTPUT" test.AppImage
8485

8586
# verify that the resulting AppImage works
8687
./test.AppImage "${LINUXDEPLOY_ARGS[@]}"
8788

8889
# check whether AppImage plugin is found and works
8990
./test.AppImage "${LINUXDEPLOY_ARGS[@]}" --output appimage
9091

91-
mv linuxdeploy-"$ARCH".AppImage* "$OLD_CWD"
92+
mv "$OUTPUT"* "$OLD_CWD"/

0 commit comments

Comments
 (0)