-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRecipe.erb
More file actions
144 lines (130 loc) · 5.18 KB
/
Recipe.erb
File metadata and controls
144 lines (130 loc) · 5.18 KB
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
#!/bin/bash
#
# Copyright (C) 2016 Scarlett Clark <sgclark@kde.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) version 3, or any
# later version accepted by the membership of KDE e.V. (or its
# successor approved by the membership of KDE e.V.), which shall
# act as a proxy defined in Section 6 of version 3 of the license.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not, see <http://www.gnu.org/licenses/>.
cd /
# Get helper functions
wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
. ./functions.sh
rm -f functions.sh
mkdir /<%= name %>.AppDir/
cd /
wget https://github.com/probonopd/linuxdeployqt/releases/download/1/linuxdeployqt-1-x86_64.AppImage
chmod a+x linuxdeployqt-1-x86_64.AppImage
cd /<%= name %>.AppDir
#Move binary/desktop/icon into AppDir
mv /opt/usr/bin/<%= binary %> .
mv /opt/usr/share/applications/org.kde.<%= name %>.desktop <%= name %>.desktop
cp /opt/usr/share/icons/hicolor/48x48/apps/*<%= name %>* .
#All the plugins do not seem to be getting in. Manual copy.
mkdir -p ./plugins; cp -rfv /opt/usr/lib/qt5/plugins/phonon4qt5_backend $_
#mkdir -p ./usr/lib/qml/
mkdir -p ./usr/{share,bin,lib}
mkdir ./etc
rsync -aruxv --progress /opt/usr/plugins/ ./plugins/
rsync -aruxv --progress /opt/usr/share/ ./usr/share/
rsync -aruxv --progress /opt/etc/ ./etc/
rsync -aruxv --progress /opt/usr/qml/ ./qml
cp /usr/lib/x86_64-linux-gnu/pulseaudio/*.so* ./usr/lib/
ls /opt/usr/lib/libg*
cp /opt/usr/bin/gst* ./usr/bin/
mkdir ./lib
rm -rfv /opt/usr/lib/gstreamer-1.0/include
cp /opt/usr/lib/gstreamer-1.0/* ./lib/
cp /usr/lib/x86_64-linux-gnu/pulseaudio/*.so* ./lib/
cp -rfv /usr/share/mime ./usr/share/
cp /etc/mime.types ./etc/
update-mime-database ./usr/share/mime
strip -g $(find ./usr/bin) || true
strip -g $(find ./usr/lib) || true
mv /opt/usr/libexec/kf5/* ./usr/bin/ || true
mv /opt/usr/lib/x86_64-linux-gnu/libexec/kf5/* ./usr/bin/ || true
mv /opt/usr/libexec/gstreamer-1.0/* ./usr/bin || true
cp -rfv /opt/usr/lib/x86_64-linux-gnu/* /opt/usr/lib/
unset LD_LIBRARY_PATH
../linuxdeployqt-1-x86_64.AppImage <%= name %> -verbose=3 -bundle-non-qt-libs -qmldir=/opt/usr/qml
ls ./qml/
patch_usr
glibc_needed
delete_blacklisted
#Cleanup
# We don't bundle the developer stuff
rm -rf ./usr/include || true
rm -rf ./usr/lib/cmake || true
rm -rf ./lib/cmake || true
rm -rf ./usr/lib/pkgconfig || true
rm -rf ./usr/share/ECM/ || true
rm -rf ./usr/share/gettext || true
rm -rf ./usr/share/pkgconfig || true
rm -rf ./usr/mkspecs/ || true
rm -rf ./usr/gettext-* || true
rm -rf ./usr/autoconf-* || true
rm -rf ./usr/automake-* || true
rm -rf ./usr/libtool-* || true
rm -rf ./libexec || true
rm -rf ./usr/share/cmake-3.7 || true
rm -rf ./usr/share/man || true
rm -rf ./usr/share/doc/ECM || true
rm -rf ./usr/share/doc/libdbusmenu-qt5-doc || true
rm -rf ./usr/share/gtk-doc || true
rm -rf ./usr/share/wallpapers || true
ls /opt/usr/lib/libg*
find . -name '*.a' -exec rm {} \;
get_desktopintegration <%= name %>
cd /app/src
git clone git://anongit.kde.org/scratch/brauch/appimage-exec-wrapper
cd /app/src/appimage-exec-wrapper/
make clean
make
cp -v exec.so /<%= name %>.AppDir/exec_wrapper.so
rm -rfv /app/src/appimage-exec-wrapper
cd /<%= name %>.AppDir
rm AppRun
#Create AppRun
cat > AppRun << EOF
#!/bin/sh
DIR="\`dirname \"\$0\"\`"
HERE="\`( cd \"\$DIR\" && pwd )\`"
export LD_PRELOAD=\$HERE/exec_wrapper.so
export QML2_IMPORT_PATH=\$HERE/qml
export QT_PLUGIN_PATH=\$HERE/plugins
export PATH=\$HERE/usr/bin/:\$HERE/usr/sbin/:\$HERE/usr/games/:\$HERE/bin/:\$HERE/sbin/:$PATH
export LD_LIBRARY_PATH=\$HERE/usr/lib/:\$HERE/usr/lib/x86_64-linux-gnu/:\$HERE/usr/lib64/:\$HERE/lib/:\$HERE/lib/x86_64-linux-gnu/:\$HERE/lib64/:$LD_LIBRARY_PATH
export XDG_DATA_DIRS=\$HERE/usr/share:\$HOME/.local/share:/usr/local/share/:/usr/share:$XDG_DATA_DIRS
export XDG_DATA_HOME=\$HOME/.local/share
export XDG_CONFIG_DIRS=\$HERE/etc/xdg:$XDG_CONFIG_DIRS
export KDE_FORK_SLAVES=1
export GST_PLUGIN_PATH=\$HERE/lib
export GST_PLUGIN_SCANNER=\$HERE/bin
<%= binary %> $@
EOF
chmod +x AppRun
mv <%= binary %> ./usr/bin/
cp <%= name %>.desktop ./usr/share/applications/
cd /
wget "https://github.com/probonopd/AppImageKit/releases/download/knowngood/appimagetool-x86_64.AppImage"
chmod a+x appimagetool-x86_64.AppImage
ARCH=$(arch)
DATE=$(date +"%Y%m%d")
APPIMAGEFILENAME="<%= name %>-git$DATE-$ARCH.AppImage"
#Re set LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/usr/lib:/opt/usr/lib/x86_64-linux-gnu:/usr/lib:/usr/lib64
gpg2 --import /root/.gnupg/appimage.key
./appimagetool-x86_64.AppImage -v -s -u "zsync|$APPIMAGEFILENAME" /<%= name %>.AppDir /appimage/$APPIMAGEFILENAME
zsyncmake -u "https://s3-eu-central-1.amazonaws.com/ds9-apps/ark-appimage/master/$APPIMAGEFILENAME" -o /appimage/<%= name %>_latestversion.zsync /appimage/$APPIMAGEFILENAME
ls /appimage/