-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
245 lines (190 loc) · 17.1 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
language: cpp
compiler: gcc
sudo: require
dist: trusty
before_install:
- sudo add-apt-repository -y ppa:ximion/packagekit
- sudo apt-key update -y -q
- sudo apt-get update -y -q
install:
- sudo apt-get -y install coreutils less busybox-static appstream man-db
before_script:
script:
# Create an empty AppDir structure:
- mkdir -p ./appdir/usr/{bin,lib{,/x86_64-linux-gnu},share/{doc,applications,metainfo,man/man{1,7},icons/hicolor/512x512/apps}}
- find ./appdir -type d
# Populate the AppDir with custom AppRun, icon, .desktop file, README.md and AppStream metadata:
- cp -a ./appimage/AppRun ./appdir/AppRun
- cp -a ./appimage/README.{md,epub,html,pdf} ./appdir/
- cp -a ./appimage/appimagekit-toolbox.png ./appdir/usr/share/icons/hicolor/512x512/apps/ # linuxdeployqt wants it here...
- cp -a ./appimage/appimagekit-toolbox.png ./appdir/ # appimagetool wants it here!
- cp -a ./appimage/org.toolbox.appimagekit.desktop ./appdir/usr/share/applications/ # linuxdeployqt wants it here...
- cp -a ./appimage/org.toolbox.appimagekit.desktop ./appdir/ # appimagetool wants it here!
- cp -a ./appimage/org.toolbox.appimagekit.appdata.xml ./appdir/usr/share/metainfo/
# Copy the (stub) `appimagekit-toolbox` script to its location:
- cp -a ./appimage/appimagekit-toolbox-usage.sh ./appdir/usr/bin/
# Create and deploy internal version message:
- bash ./appimage/mkversionfile ; cp ./versionfile ./appdir/versionfile
- cat ./versionfile
# Add debugging tools to toolbox:
- cp -a /usr/bin/env ./appdir/usr/bin/
- cp -a /bin/busybox ./appdir/usr/bin/
- cp -a /bin/less ./appdir/usr/bin/
# Add manpage tools+libs to toolbox:
- cp -a /usr/bin/man ./appdir/usr/bin/
- cp -a /usr/bin/whatis ./appdir/usr/bin/
- cp -a /usr/bin/apropos ./appdir/usr/bin/
- cp -a /usr/lib/man-db/libman* ./appdir/usr/lib/
- cp -a /usr/lib/x86_64-linux-gnu/libpipeline* ./appdir/usr/lib/x86_64-linux-gnu/
- cp -a /usr/lib/x86_64-linux-gnu/libgdbm* ./appdir/usr/lib/x86_64-linux-gnu/
# Add man pages to toolbox:
#- cp -a ./usr/share/man/* ./appdir/usr/share/man/
#- cp -a ./usr/share/doc/* ./appdir/usr/share/doc/
- cp -a /usr/share/man/man1/busybox.1* ./appdir/usr/share/man/man1/
- cp -a /usr/share/man/man1/env.1* ./appdir/usr/share/man/man1/
#- find ./appdir/usr/share/man -type f
#- find ./appdir/usr/share/doc -type f
# Download the AppImage manpage+docs tarball:
- _tarball="AppImage-manpages-59-git.de8b259-2018-03-08.tar.gz" # This changes every now and then
- wget -c "https://transfer.sh/14bjUq/$_tarball" # <== Same-same! ^^^^
# Unpack the manpage+docs tarball:
- tar xvzf $_tarball
# Copy files from manpage+docs tarball into AppDir:
- cp -a ./AppImage-manpages/man/* ./appdir/usr/share/man/
- cp -a ./AppImage-manpages/pdf ./appdir/usr/share/doc/
- cp -a ./AppImage-manpages/epub ./appdir/usr/share/doc/
- cp -a ./AppImage-manpages/html ./appdir/usr/share/doc/
- rm -rf ./appdir/usr/share/man/cat*
# Add selftest.sh and sub-tests:
- cp -a ./tests ./appdir/usr/share/
- cp -a ./appimage/selftests*.sh ./appdir/usr/bin/
# Add AppImageKit binaries (as AppImages!) to toolbox and rename them at the same time:
- wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimaged-i686.AppImage" -O ./appdir/usr/bin/appimaged-i686
- wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimaged-x86_64.AppImage" -O ./appdir/usr/bin/appimaged
- wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-i686.AppImage" -O ./appdir/usr/bin/appimagetool-i686
- wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -O ./appdir/usr/bin/appimagetool
- wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -O ./appdir/usr/bin/linuxdeployqt
# AppImageUpdate and appimageupdatetool don't follow a "neutral" naming convention and are in a separate repo:
- aiut=$(curl https://github.com/AppImage/AppImageUpdate/releases/ | grep href= | grep -E "appimageupdatetool-" | grep "x86_64.AppImage" | grep -v AppImage.zsync | sort | tail -n 1 | awk -F'=' '{print $2}' | awk '{print $1}' | sed 's#"##g' | awk -F'/' '{print $7}')
- AIU=$(curl https://github.com/AppImage/AppImageUpdate/releases/ | grep href= | grep -E "AppImageUpdate-" | grep -v Qt | grep "x86_64.AppImage" | grep -v AppImage.zsync | sort | tail -n 1 | awk -F'=' '{print $2}' | awk '{print $1}' | sed 's#"##g' | awk -F'/' '{print $7}')
# zsync2 and zsyncmake2 don't follow a "neutral" naming convention:
- zs2=$(curl https://github.com/AppImage/zsync2/releases/ | grep href= | grep -E "zsync2-" | grep "x86_64.AppImage" | head -n 1 | awk -F'=' '{print $2}' | awk '{print $1}' | sed 's#"##g' | awk -F'/' '{print $7}')
- zsm2=$(curl https://github.com/AppImage/zsync2/releases/ | grep href= | grep -E "zsyncmake2-" | grep "x86_64.AppImage" | head -n 1 | awk -F'=' '{print $2}' | awk '{print $1}' | sed 's#"##g' | awk -F'/' '{print $7}')
- wget -c "https://github.com/AppImage/AppImageUpdate/releases/download/continuous/$AIU" -O ./appdir/usr/bin/AppImageUpdate
- wget -c "https://github.com/AppImage/AppImageUpdate/releases/download/continuous/$aiut" -O ./appdir/usr/bin/appimageupdatetool
- wget -c "https://github.com/AppImage/zsync2/releases/download/continuous/$zs2" -O ./appdir/usr/bin/zsync2
- wget -c "https://github.com/AppImage/zsync2/releases/download/continuous/$zsm2" -O ./appdir/usr/bin/zsyncmake2
# Add other binaries (default 'AppRun' and 'runtime' for x86_64):
- wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-x86_64" -O ./appdir/usr/bin/runtime-x86_64
- wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-x86_64" -O ./appdir/usr/bin/AppRun-x86_64
- wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-i686" -O ./appdir/usr/bin/runtime-i686
- wget -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-i686" -O ./appdir/usr/bin/AppRun-i686
# Add some useful shell scripts too:
- wget -c "https://raw.githubusercontent.com/AppImage/AppImageKit/appimagetool/master/testappimage" -O ./appdir/usr/bin/testappimage.sh
- wget -c "https://raw.githubusercontent.com/AppImage/AppImageKit/appimagetool/master/test-appimagetool.sh" -O ./appdir/usr/bin/test-appimagetool.sh
- wget -c "https://raw.githubusercontent.com/probonopd/uploadtool/master/upload.sh" -O ./appdir/usr/bin/upload.sh
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/pkg2appimage" -O ./appdir/usr/bin/pkg2appimage.sh
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/functions.sh" -O ./appdir/usr/bin/functions.sh
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/appdir-lint.sh" -O ./appdir/usr/bin/appdir-lint.sh
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/bintray-tidy.sh" -O ./appdir/usr/bin/bintray-tidy.sh
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/bintray.sh" -O ./appdir/usr/bin/bintray.sh
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/set-up-ppas.sh" -O ./appdir/usr/bin/set-up-ppas.sh
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/test.sh" -O ./appdir/usr/bin/test-appimage-on-many-live-isos.sh
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/travis.sh" -O ./appdir/usr/bin/travisbuild-with-without-docker.sh
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/trigger.sh" -O ./appdir/usr/bin/travistriggerbuilds.sh
# Run a few selftests (to be evaluated by reading Travis' log):
- cd ./appdir/usr/bin
- for i in * ; do chmod +x ./$i ; done
- ls -l AppImageUpdate* # Why is AppImageUpdate-Qt not executable?
- for i in appimaged appimagetool appimageupdatetool AppImageUpdate linuxdeployqt zsync2 ; do ./$i --version ; done
# zsyncmake2 doesn't support '--version' yet -- avoid an 'exited with 1' condition for Travis:
- for i in zsyncmake2 ; do ./$i --version || echo "" ; done
- for i in appimaged appimagetool appimageupdatetool AppImageUpdate linuxdeployqt zsync2 zsyncmake2 ; do ./$i --appimage-version ; done
- for i in appimaged appimagetool appimageupdatetool AppImageUpdate linuxdeployqt zsync2 zsyncmake2 ; do ./$i --appimage-offset ; done
- for i in appimaged appimagetool appimageupdatetool AppImageUpdate linuxdeployqt zsync2 zsyncmake2 ; do ./$i --appimage-updateinfo ; done
- cd -
# Download READMEs, MDs and other texts:
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/excludedeblist" -O ./appdir/excludedeblist.txt
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/excludesuselist" -O ./appdir/excludesuselist.txt
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/excludelist" -O ./appdir/excludelist.txt
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/YML.md" -O ./appdir/YML.md
- wget -c "https://raw.githubusercontent.com/AppImage/AppImageKit/appimagetool/master/README.md" -O ./appdir/README.appimagetool
- wget -c "https://raw.githubusercontent.com/AppImage/AppImageUpdate/rewrite/README.md" -O ./appdir/README.appimageupdate
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/README.md" -O ./appdir/README.appimages
- wget -c "https://raw.githubusercontent.com/probonopd/uploadtool/master/README.md" -O ./appdir/README.uploadtool
- wget -c "https://raw.githubusercontent.com/AppImage/zsync2/master/README.md" -O ./appdir/README.zsync2
#- wget -c "http://portablelinuxapps.org/docs/1.0/AppImageKit.pdf" # Website seems to have become unavailable -O ./appdir/README-historical-WhitePaper-AppImageKit---outdated.pdf
# Download license info texts:
- wget -c "https://raw.githubusercontent.com/probonopd/uploadtool/master/LICENSE" -O ./appdir/LICENSE.MIT.uploadtool
- wget -c "https://raw.githubusercontent.com/AppImage/AppImageKit/appimagetool/master/LICENSE" -O ./appdir/LICENSE.MIT.appimagekit
- wget -c "https://raw.githubusercontent.com/AppImage/AppImages/master/LICENSE" -O ./appdir/LICENSE.MIT.appimages
# In the interest of complete transparency, download the .travis.yml file which built this AppImage :-) :
- wget -c "https://raw.githubusercontent.com/KurtPfeifle/AppImageKit-Toolbox/master/.travis.yml" -O ./appdir/YML-README.travis-yml
# Make AppImages, binaries and scripts executable:
- chmod a+x ./appdir/usr/bin/*
- chmod a-x ./appdir/usr/bin/*-i686 # We don't want these to be executable in x86_64 environment!
- chmod a-x ./appdir/usr/bin/functions.sh # ...and neither this.
# Prepare for tests following later:
- sudo mkdir -p $HOME/.local/bin
- cd $HOME/.local/bin # change dir
- sudo ln -s $OLDPWD/appdir/usr/bin/{AppImage,zsync,appimage,linuxdeploy}* . # create symlinks
- ls -l # show symlinks
- cd - # change dir back
# Let `linuxdeployqt` check if libs need to be bundled with the AppDir and do it if needed:
#- ./appdir/usr/bin/linuxdeployqt ./appdir/usr/bin/busybox -bundle-non-qt-libs -verbose=2 # Don't check busybox_static!
- ./appdir/usr/bin/linuxdeployqt ./appdir/usr/bin/env -bundle-non-qt-libs -verbose=2
# Set up a VERSION string to be used for the toolbox AppImage name:
- VERSION=$TRAVIS_BUILD_NUMBER-$(date "+%Y%m%d")-git.$(git rev-parse --short HEAD)
# Extract the AppImage that is in ./appdir/usr/bin/linuxdeployqt:
- ./appdir/usr/bin/linuxdeployqt --appimage-extract
# Check for consistency/inconsistency in appimagetool(s)
- ls -l ./squashfs-root/usr/bin/appimagetool ./appdir/usr/bin/appimagetool
- md5sum ./squashfs-root/usr/bin/appimagetool ./appdir/usr/bin/appimagetool
- ./squashfs-root/usr/bin/appimagetool --version
- ./appdir/usr/bin/appimagetool --version
# Check what we have:
#- ls -l ./appdir/AppRun ./squashfs-root/AppRun
# Remove the symlinked AppRun and copy custom AppRun in place (dunno why line 20 didn't prevail):
- rm -rf ./appdir/AppRun
- cp -a ./appimage/AppRun ./appdir/
# Let `appimagetool` downloaded into ./appdir/usr/bin create the AppImage:
- PATH=./appdir/usr/bin:./squashfs-root/usr/bin:$PATH ARCH=x86_64 ./appdir/usr/bin/appimagetool -g -v ./appdir ./appimagekit-toolbox-continuous-$VERSION-x86_64.AppImage
# See what we got (just for Travis' build log):
- find . -name "*.AppImage" -ls
# Create symlinks to the AppImage(s)
- ln -s ./appimagekit-toolbox-continuous-$VERSION-x86_64.AppImage aiktb
# Check how many AppImages we have (if named with suffix .AppImage):
- find . -name "*.AppImage" -ls
# Debugging: find all files recursively from where we are:
# echo pwd=$(pwd)
#- find . -ls
#- file ./appdir/AppRun ./appimage/AppRun
#after_success:
# Check if we have binaries which link to libraries outside of the AppImage:
- find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
# Rename the appdir
- mv appdir appimagekit-toolbox-appdir
# Create a tarball from renamed appdir:
- tar cvzf ./appimagekit-toolbox-appdir-$VERSION.tar.gz ./appimagekit-toolbox-appdir
# Make a copy of the AppImage with a standard name
- cp ./appimagekit-toolbox-continuous-$VERSION-x86_64.AppImage ./appimagekit-toolbox-continuous-x86_64.AppImage
# Upload AppImages to `transfer.sh`:
- curl --upload-file ./appimagekit-toolbox-continuous-$VERSION-x86_64.AppImage https://transfer.sh/appimagekit-toolbox-continuous-$VERSION-x86_64.AppImage
- curl --upload-file ./appimagekit-toolbox-continuous-x86_64.AppImage https://transfer.sh/appimagekit-toolbox-continuous-x86_64.AppImage
# Upload the renamed appdir to `transfer.sh`:
- curl --upload-file ./appimagekit-toolbox-appdir-$VERSION.tar.gz https://transfer.sh/appimagekit-toolbox-appdir-$VERSION.tar.gz
# Get probono's upload tool/script:
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
# Upload AppImages to GitHub's release page:
#- bash ./upload.sh ./appimagekit-toolbox-continuous-$VERSION-x86_64.AppImage
#- bash ./upload.sh ./appimagekit-toolbox-continuous-$VERSION-x86_64.AppImage
after_script:
before_cache:
after_failure:
after_success:
before_deploy:
deploy:
after_deploy:
branches:
only:
master