forked from AppImageCommunity/pkg2appimage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Recipe
183 lines (136 loc) · 4.4 KB
/
Recipe
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
# In this example, we use a trusty PPA - keep providing these!
# Based on the Stellarium and Wireshark recipes
# Here some desktop, icon, and binary files are uppercase, is this non-debian-standard?
APP=FBReader
LOWERAPP=${APP,,}
mkdir -p ./$APP/$APP.AppDir/usr/lib
cd ./$APP/
wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
. ./functions.sh
# We get this app and almost all its dependencies via apt-get
# but not using the host system's information about what is
# installed on the system but our own assumptions instead
cat > status <<EOF
Package: libglib2.0-0
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libgtk2.0-0
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libegl1-mesa
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libgbm1
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libdrm2
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libdbm2
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libgl1-mesa-glx
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libgcc1
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: lsb-base
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libc6
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libstdc++6
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: debconf
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: dpkg
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libcups2
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: dbus
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libfontconfig1
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: fontconfig-config
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: passwd
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: uuid-runtime
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Package: libgl1-mesa
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
Comment: Draws in 100 MB of dependencies
Package: mime-support
Status: install ok installed
Architecture: all
Version: 9:9999.9999.9999
EOF
echo "deb http://archive.ubuntu.com/ubuntu/ trusty main universe
deb http://ppa.launchpad.net/wireshark-dev/stable/ubuntu trusty main
" > sources.list
apt-get $OPTIONS update
URLS=$(apt-get $OPTIONS -y install --print-uris libbz2-1.0 libexpat1 libfribidi0 libqt4-network libqtcore4 libqtgui4 libsqlite3-0 zlib1g | cut -d "'" -f 2 | grep -e "^http")
wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
. ./functions.sh
wget -c $URLS
wget -c https://fbreader.org/files/desktop/fbreader_0.99.4-1_amd64.deb
wget -c https://fbreader.org/files/desktop/libunibreak1_1.0-1_amd64.deb
cd ./$APP.AppDir/
find ../*.deb -exec dpkg -x {} . \; || true
# cp ./usr/share/applications/$LOWERAPP.desktop .
cp ./usr/share/applications/$APP.desktop . # Is this non-debian-standard?
rm -rf ./usr/share/icons/48x48/apps || true
find ./usr/share/icons -path *256* -name $LOWERAPP.png -exec cp {} . \; || true
find ./usr/share/icons -path *512* -name $LOWERAPP.png -exec cp {} . \; || true
cp ./usr/share/pixmaps/FBReader.png .
get_apprun
# Copy in the indirect dependencies
# copy_deps # not needed here due to the way we use apt to download everything
move_lib
mv ./usr/lib/x86_64-linux-gnu/* ./usr/lib/ # AppRun sets Qt env here
delete_blacklisted
rm -rf ./etc/ ./home/ || true
# patch_usr
# Patching only the executable files seems not to be enough for some apps
find usr/ -type f -exec sed -i -e "s|/usr|././|g" {} \;
VERSION=$(find ../*.deb -name $LOWERAPP"_*" | head -n 1 | cut -d "~" -f 1 | cut -d "_" -f 2 | cut -d "-" -f 1 | sed -e 's|1%3a||g' )
echo $VERSION
mv usr/bin/FBReader usr/bin/fbreader # Is this non-debian-standard?
sed -i -e 's|Exec=FBReader|Exec=fbreader|g' FBReader.desktop # Is this non-debian-standard?
mv FBReader.desktop fbreader.desktop # Is this non-debian-standard?
get_desktopintegration $LOWERAPP
# Go out of AppImage
cd ..
generate_appimage