-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecipe
130 lines (110 loc) · 4.28 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
#!/bin/bash
# Create build dest directory
mkdir -p /AppDir/usr
# Install build deps
apt-get build-dep -y gnumeric goffice libgtk-3-dev perl
apt-get install -y wget xzip curl tar gtk-doc-tools itstool
apt-get remove -y libgsf*
apt-get remove -y goffice*
printf "Running AskUbuntu commands\n"
pkg-config --modversion gtk+-3.0
pkg-config --cflags gtk+-3.0
function version {
APP="$1"
UPPERAPP=${APP^^}
if [[ $APP == "gtk-doc" ]]; then
wget -q https://github.com/GNOME/${APP}/releases -O - | grep "\.tar\.gz" | cut -d '"' -f 2 | head -n 1 | cut -d '/' -f 5 | sed 's/\.[a-z.]*//g' | sed "s/$UPPERAPP\_//g" | sed 's/_/\./g' | sed 's|GTK\.DOC\.||g'
else
wget -q https://github.com/GNOME/${APP}/releases -O - | grep "\.tar\.gz" | cut -d '"' -f 2 | head -n 1 | cut -d '/' -f 5 | sed 's/\.[a-z.]*//g' | sed "s/$UPPERAPP\_//g" | sed 's/_/\./g'
fi
}
GOFFICE_VERSION=$(version goffice)
GSF_VERSION=$(version libgsf)
GNUMERIC_VERSION=$(version gnumeric)
GTK_DOC_VERSION=$(version gtk-doc)
PERL_VERSION=$(wget -q http://www.cpan.org/src/5.0/ -O - | grep "\.tar\.xz<" | cut -d '"' -f 8 | sed "s|\.tar\.xz||g" | sed "s|perl-||g" | grep "5.24" | tail -n 1)
GTK_VERSION=3.22.4
wget -cqO- https://ftp.acc.umu.se/pub/gnome/sources/libgsf/${GSF_VERSION%.*}/libgsf-${GSF_VERSION}.tar.xz | tar xJ
wget -cqO- https://ftp.acc.umu.se/pub/gnome/sources/goffice/${GOFFICE_VERSION%.*}/goffice-${GOFFICE_VERSION}.tar.xz | tar xJ
wget -cqO- https://ftp.acc.umu.se/pub/gnome/sources/gnumeric/${GNUMERIC_VERSION%.*}/gnumeric-${GNUMERIC_VERSION}.tar.xz | tar xJ
wget -cqO- https://github.com/GNOME/gtk/archive/${GTK_VERSION}.tar.gz | tar xz
wget -cqO- https://ftp.acc.umu.se/pub/gnome/sources/gtk-doc/${GTK_DOC_VERSION}/gtk-doc-${GTK_DOC_VERSION}.tar.xz | tar xJ
wget -cqO- https://ftp.gnu.org/pub/gnu/gettext/gettext-latest.tar.xz | tar xJ
wget -cqO- http://www.cpan.org/src/5.0/perl-${PERL_VERSION}.tar.xz | tar xJ
cd gettext*
./configure --prefix=/usr
make
make install
make install DESTDIR=/AppDir
cd ../perl*
./Configure -des -Dusethreads -Dvendorprefix=/usr -Dprefix=/usr
make
make install
make install DESTDIR=/AppDir
cd ../gtk-doc*
./configure --prefix=/usr
make
make install
make install DESTDIR=/AppDir
cd ../gtk-[0-9]*
./autogen.sh
./configure --prefix=/usr --disable-gtk-doc
make
make install
make install DESTDIR=/AppDir
cd ../libgsf*
./configure --prefix=/usr
make
make install
make install DESTDIR=/AppDir
cd ../goffice*
./configure --prefix=/usr
make
make install
make install DESTDIR=/AppDir
cd ../gnumeric*
./configure --prefix=/usr
make
make install
make install DESTDIR=/AppDir
cd /AppDir/
cp ./usr/share/applications/gnumeric.desktop .
cp ./usr/share/icons/hicolor/256x256/apps/gnumeric.png .
# Strip executables; greatly reduces AppImage size
find . -type f -executable -exec strip {} \;
# Copy dependency libraries
mkdir -p ./usr/lib
ldd usr/bin/gnumeric | grep "=>" | awk '{print $3}' | xargs -I '{}' cp -v '{}' ./usr/lib || true
# Delete blacklisted files; TODO: Move to a library function
BLACKLISTED_FILES=$(curl -sL https://github.com/fusion809/AppImages/raw/master/excludelist | sed '/^\s*$/d' | sed '/^#.*$/d')
for FILE in $BLACKLISTED_FILES ; do
FOUND=$(find . -type f -name "${FILE}" 2>/dev/null)
if [ ! -z "$FOUND" ] ; then
echo "Deleting blacklisted ${FOUND}"
rm -f "${FOUND}"
fi
done
curl -OL "https://github.com/probonopd/AppImageKit/releases/download/5/AppRun" # (64-bit)
chmod a+x ./AppRun
# Add desktop integration
XAPP=gnumeric
curl -L https://raw.githubusercontent.com/probonopd/AppImageKit/master/desktopintegration > ./usr/bin/$XAPP.wrapper
chmod a+x ./usr/bin/$XAPP.wrapper
sed -i -e "s|Exec=$XAPP|Exec=$XAPP.wrapper|g" $XAPP.desktop
# Go out of AppImage
cd ..
GLIBC_NEEDED=$(find . -type f -executable -exec strings {} \; | grep ^GLIBC_2 | sed s/GLIBC_//g | sort --version-sort | uniq | tail -n 1)
VERSION=${GNUMERIC_VERSION}.glibc${GLIBC_NEEDED}
ARCH=$(uname -m)
echo "VERSION is $VERSION"
if [[ "$ARCH" = "x86_64" ]] ; then
APPIMAGE=$APP"-"$VERSION"-x86_64.AppImage"
fi
if [[ "$ARCH" = "i686" ]] ; then
APPIMAGE=$APP"-"$VERSION"-i386.AppImage"
fi
mkdir -p /out
rm -f /out/*.AppImage || true
curl -sL "https://github.com/probonopd/AppImageKit/releases/download/6/AppImageAssistant_6-x86_64.AppImage" > AppImageAssistant
chmod a+x AppImageAssistant
./AppImageAssistant ./AppDir/ /out/$APP"-"$VERSION"-"$ARCH".AppImage"