-
Notifications
You must be signed in to change notification settings - Fork 3
/
aurora_builder
executable file
·115 lines (85 loc) · 2.2 KB
/
aurora_builder
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
#!/bin/bash
arg=$1
arversion='0.0.0'
checkFlutter() {
if command -v flutter &> /dev/null
then
echo installed
buildAurora
else
installFlutter
fi
}
installFlutter(){
echo installing flutter
dnf -y install patchelf rpmdevtools rpmlint gtk3-devel xz-libs git cmake ninja-build clang desktop-file-utils glibc
git clone https://github.com/flutter/flutter.git ~/flutter
export PATH=$HOME/.pub-cache/bin:$HOME/flutter/bin:$PATH
flutter config --enable-linux-desktop
sed -i "s/BuildType.debug/BuildType.rpm/g" lib/utility/constants.dart
buildAurora
}
buildAurora(){
echo building aurora
flutter clean
flutter pub get
dart run build_runner build
flutter build linux
elf
getversion
if [ "$arg" == "deb" ]; then
builddeb
else
buildrpm
fi
}
elf(){
cd build/linux/x64/release/bundle/lib
patchelf --set-rpath '$ORIGIN' libscreen_retriever_plugin.so
patchelf --set-rpath '$ORIGIN' libwindow_manager_plugin.so
patchelf --set-rpath '$ORIGIN' liburl_launcher_linux_plugin.so
patchelf --set-rpath '$ORIGIN' libbitsdojo_window_linux_plugin.so
patchelf --set-rpath '$ORIGIN' libisar_flutter_libs_plugin.so
cd ../../../../../../
}
getversion(){
flutter pub global activate cider
arversion=$(cut -d- -f 1 <<< $(cider version))
}
builddeb(){
echo BUILDING DEB...
rm -rf debian/opt
rm -rf debian/usr
mkdir -p debian/opt
mkdir -p debian/usr/bin/
mkdir -p debian/usr/share/applications
cp -rf build/linux/x64/release/bundle debian/opt
cp metadata/exec debian/usr/bin/aurora
cp metadata/aurora.desktop debian/usr/share/applications/
mv debian/opt/bundle debian/opt/aurora
sed -i "s/aurora_ver/$arversion/g" debian/DEBIAN/control
dpkg-deb --build --root-owner-group debian
}
buildrpm(){
echo BUILDING RPM...
mkdir -p rpmbuild/SOURCES
cp -rf build/linux/x64/release/bundle rpmbuild/SOURCES/
cp metadata/* rpmbuild/SOURCES/bundle
cd rpmbuild/SOURCES
mv bundle aurora-$arversion
tar --create --file aurora-"$arversion".tar.gz aurora-$arversion
cd ..
sed -i "s/aurora_ver/$arversion/g" SPECS/aurora.spec
cd ..
rm -rf build
mv rpmbuild build
cp -rf build ~/
rpmbuild -bs build/SPECS/aurora.spec
cp -r $HOME/build/SRPMS/* $arg
}
if [ $# -eq 0 ]
then
echo "Nop. that's not how it works"
else
checkFlutter
fi