-
Notifications
You must be signed in to change notification settings - Fork 8
/
build-dist
executable file
·45 lines (36 loc) · 1.38 KB
/
build-dist
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
#!/usr/bin/env bash
set -eu
APART_CORE_VERSION="0.3.15"
APART_CORE_SHA256='a3ced019b1e7d1b07f3dd94d2827af53bcab7c97f5b6103be063a1d440b233ff'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR"
rm -rf target
mkdir -p "$DIR"/target/lib/apart-gtk/src
echo "Building apart-core $APART_CORE_VERSION"
cd "$DIR"/target
curl -o core.tar.gz -L https://github.com/alexheretic/apart-core/archive/refs/tags/v$APART_CORE_VERSION.tar.gz
sha256sum core.tar.gz
echo "$APART_CORE_SHA256 core.tar.gz" | sha256sum -c
tar xf core.tar.gz
(cd apart-core-$APART_CORE_VERSION && cargo build --release)
cp "${CARGO_TARGET_DIR:-"apart-core-$APART_CORE_VERSION/target"}/release/apart-core" lib/apart-gtk/
strip lib/apart-gtk/apart-core
rm core.tar.gz
rm -rf apart-core-$APART_CORE_VERSION
echo 'Copy & compile sources'
cd "$DIR"/target/lib/apart-gtk/src
cp -r "$DIR"/src/* ./
python3 -m compileall ./
echo 'Copy misc & icons'
cd "$DIR"/target
mkdir -p share/applications
cp "$DIR"/misc/*.desktop share/applications/
mkdir -p share/icons/hicolor/scalable/apps/
cp "$DIR"/icon/apart.svg share/icons/hicolor/scalable/apps/
mkdir -p share/icons/hicolor/48x48/apps/
cp "$DIR"/icon/apart.png share/icons/hicolor/48x48/apps/
mkdir -p share/polkit-1/actions
cp "$DIR"/misc/*.policy share/polkit-1/actions/
mkdir -p bin
ln -s ../lib/apart-gtk/src/app.py bin/apart-gtk
command -v tree >/dev/null 2>&1 && tree "$DIR"/target || true