forked from michaelrsweet/htmldoc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
93 lines (69 loc) · 3.64 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
sudo: required # needed for trusty beta
dist: trusty # needed for HarfBuzz
language: c
compiler:
- clang
- gcc
before_script:
- env | grep -i travis
- sudo add-apt-repository -y ppa:ximion/packagekit # Need to install appstreamcli
- sudo apt-key update -q -y
- sudo apt-get update -q -y
# HTMLDOC requires FLTK-1.3
- sudo apt-get install -y appstream libfltk1.3-dev libpng-dev zlib1g-dev libopenjpeg-dev libjpeg-dev
script:
# Debug settings
#- set -e
#- set -x
# Build settings
- export OMP_NUM_THREADS=1
- export CFLAGS="-Wno-deprecated-declarations -Wdeclaration-after-statement -Wno-error=unused-variable"
# Prepare Freedesktop/AppStream stuff
- mkdir -p appdir/usr/share/applications/ ; cp ./desktop/htmldoc.desktop ./appdir/usr/share/applications/
- mkdir -p appdir/usr/share/icons/hicolor/256x256/apps/ ; cp ./desktop/htmldoc-256.png ./appdir/usr/share/icons/hicolor/256x256/apps/htmldoc.png
- mkdir -p appdir/usr/share/metainfo/ ; cp ./desktop/htmldoc.appdata.xml ./appdir/usr/share/metainfo/
- echo "$(appstreamcli --version)"
- echo "$(appstreamcli validate --verbose ./desktop/htmldoc.appdata.xml 2>&1)"
# Configure step
- ./configure --prefix=/usr
# --enable-localjpeg --enable-localzlib --enable-localpng
# Make & install
- make
- make install DESTDIR=$(readlink -f appdir)
# Get linuxdeployqt to check prepare the AppDir
- wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
# linuxdeployqt is not executable after download
- chmod a+x linuxdeployqt*.AppImage
# Prepare to check + set up the AppDir ( = install-dir)
- unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
# Now let linuxdeployqt do its work (but do not use its '-appimage' param...)
- ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/htmldoc.desktop -bundle-non-qt-libs
# Extract the linuxdeployqt AppImage, because it contains 'appimagetool',
# which we prefer to run under our own settings instead of the defaults
- ./linuxdeployqt*.AppImage --appimage-extract
# Now run 'appimagetool' with our settings:
- PATH=./squashfs-root/usr/bin:$PATH ./squashfs-root/usr/bin/appimagetool -v -u 'gh-releases-zsync|KurtPfeifle|htmldoc|continuous|htmldoc-*x86_64.AppImage.zsync' ./appdir/
# See if there are any libs left which point to the wrong directories:
- find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
# Set a version string
- _version=$(./htmldoc*.AppImage --version)
- export VERSION="v${_version}-travisbuild.$TRAVIS_BUILD_NUMBER-travisbranch.$TRAVIS_BRANCH-git.$(git rev-parse --short HEAD)"
# See in Travis log what we've got:
- find . -name "*.AppImage*"
- echo $(find . -iname "*htmldoc*" 2>&1)
# Rename our AppImage to include a version string
- cp htmldoc*.AppImage htmldoc-$VERSION-x86_64.AppImage
- cp htmldoc*.AppImage.zsync htmldoc-$VERSION-x86_64.AppImage.zsync
- echo "$(find . -iname "*.zsync")"
- echo "$(find . -iname "*.AppImage")"
# Fetch probono's upload tool:
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
# Upload our AppImage to the GitHub releases page:
- bash upload.sh htmldoc-$VERSION-x86_64.AppImage
- bash upload.sh htmldoc-$VERSION-x86_64.AppImage.zsync
- bash upload.sh htmldoc-x86_64.AppImage
- bash upload.sh htmldoc-x86_64.AppImage.zsync
# Also upload to transfer.sh
- curl --upload-file ./htmldoc-$VERSION-x86_64.AppImage https://transfer.sh/htmldoc-$VERSION-x86_64.AppImage
after_success:
# Do nothing for now