Skip to content
This repository was archived by the owner on Apr 11, 2018. It is now read-only.

Commit dc4962c

Browse files
committed
Add safeguards and automate MD installation from flatpak (fixes #1)
1 parent 34e0f1f commit dc4962c

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The installer will add "MonoDevelop Stable" application launcher, as well as the
1818

1919
## Building installer from source
2020

21-
To build from source, simply download and install monodevelop from flatpak, and than just call the generate script:
21+
To build from source, simply download and install `flatpak`, and after than just call the generate script (it will automatically download and update MonoDevelop for you):
2222
```
2323
./generate.sh
2424
```

generate.sh

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,40 @@
11
#!/bin/bash
22
# https://github.com/fusion809/PKGBUILDs/releases
33

4+
# Check flatpak installed
5+
if ! type "flatpak" &> /dev/null
6+
then
7+
echo "'flatpak' command not found :("
8+
exit 1
9+
fi
10+
11+
# Locate (and update) Monodevelop
412
MDFDIR="$HOME/.local/share/flatpak/app/com.xamarin.MonoDevelop/current/active/files"
13+
MDU="$(flatpak list | grep com.xamarin.MonoDevelop | grep user)"
14+
MDS="$(flatpak list | grep com.xamarin.MonoDevelop | grep system)"
15+
16+
if [ -n "$MDS" ]
17+
then
18+
MDFDIR="/var/lib/flatpak/app/com.xamarin.MonoDevelop/current/active/files"
19+
flatpak update com.xamarin.MonoDevelop
20+
elif [ -n "$MDU" ]
21+
then
22+
flatpak update --user com.xamarin.MonoDevelop
23+
else
24+
flatpak install --user --from https://download.mono-project.com/repo/monodevelop.flatpakref
25+
fi
26+
27+
if [ ! -d $MDFDIR ]
28+
then
29+
echo "Could not locate MonoDevelop from flatpak, please make sure it is installed."
30+
exit 1
31+
fi
532

633
mkdir tmp
734
cd tmp
835

9-
echo "Copying installer data..."
10-
1136
# Copy installer source
37+
echo "Copying installer data..."
1238
mkdir installer
1339
cp -rf ../src/. installer
1440

@@ -19,7 +45,7 @@ cp -rf $MDFDIR/lib/monodevelop/. installer/MonoDevelop
1945
rm -rf installer/MonoDevelop/AddIns/VersionControl/MonoDevelop.VersionControl.Git.dll
2046

2147
echo "Building the Installer..."
22-
rm -f ../bin
48+
rm -rf ../bin
2349
mkdir ../bin
2450
../makeself/makeself.sh installer/ ../bin/monodevelop.run "MonoDevelop .run installer" ./postinstall.sh
2551

0 commit comments

Comments
 (0)