-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathaurora_builder
executable file
·127 lines (96 loc) · 2.44 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
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
cp -rf $PWD/rpmbuild/* $HOME/build
arg=$1
arversion='0.0.0'
echo 77777home
echo uname
uname
echo $HOME
echo 7777777pwd
echo $PWD
ls
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 tree
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 --delete-conflicting-outputs
flutter build linux --verbose
ls
elf
getversion
if [ "$arg" == "deb" ]; then
builddeb
else
buildrpm
fi
}
elf(){
echo 777777lsinelf
ls
cd $PWD/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(){
tree
echo BUILDING RPM...
mkdir -p $HOME/build/SOURCES
cp -rf $PWD/build/linux/x64/release/bundle $HOME/build/SOURCES/
cp -rf $PWD/metadata/* $HOME/build/SOURCES/bundle
cp -rf $PWD/rpmbuild/* $HOME/build
rm -rf $HOME/build/SOURCES/bundle/snaps
cd $HOME/build/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 ..
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