forked from AppImageCommunity/pkg2appimage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Recipe
75 lines (55 loc) · 2 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
#!/bin/bash -x
#################################################################
# THIS IS A WORK IN PROGRESS - NOT WORKING AS INTENDED YET
#################################################################
set +e
URL="https://sourceforge.net/projects/platformio-storage/files/ide-bundles/platformio-atom-linux-amd64.deb/download"
echo $URL
URL2="http://downloads.sourceforge.net/project/platformio-storage/ide-bundles/platformio-atom-ide-deps.tar.gz"
echo $URL2
APP=PlatformIO
mkdir -p ./$APP/$APP.AppDir/usr/bin
cd ./$APP
wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
. ./functions.sh
wget -c --trust-server-names "$URL" "$URL2" "$URL3"
cd $APP.AppDir/
dpkg -x ../platformio*deb .
mkdir ./packages
( cd packages/ , tar xf ../../platformio-atom-ide-deps.tar.gz )
# Write a custom AppRun file that does things slightly differently
cat > AppRun <<\EOF
#!/bin/sh
HERE=$(dirname $(readlink -f "${0}"))
export ATOM_HOME="$HOME/.platformio_ide"
export PATH="$HERE/packages/platformio-ide/penv/bin/":$PATH
if [ ! -d "$ATOM_HOME/packages" ]; then
mkdir -p "$ATOM_HOME/packages/"
fi
ln -sf "$HERE/packages"/* "$ATOM_HOME/packages/"
"$HERE/usr/bin/atom" $@
# TODO: Remove the symlinks created above
EOF
chmod a+x AppRun
# Move icon into place so that AppImageAssistant finds them
cp ./usr/share/pixmaps/atom.png .
# TODO: Get appdata
# mkdir -p ./usr/share/metainfo/
# wget -q "..." -O ./usr/share/metainfo/atom.appdata.xml
# Get desktop file
cp ./usr/share/applications/atom.desktop .
sed -i -e "s|/usr/share/atom/||g" atom.desktop
# Remove launcher and move in place
# TODO: Replace this by something cleaner
rm usr/bin/atom
mv usr/share/atom/* usr/bin/
# Add desktop integration
get_desktopintegration $XAPP
./usr/bin/resources/app/apm/bin/apm install platformio-ide
mv $HOME/.atom/packages/platformio-ide ./packages/
# Figure out $VERSION
VERSION=$(grep -r "atom@" ./usr/share/doc/atom/copyright | cut -d " " -f 2 | cut -d "@" -f 2)
echo $VERSION
# Go out of AppImage
cd ..
generate_appimage