forked from termux/termux-x11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_termux_package
executable file
·48 lines (40 loc) · 1.32 KB
/
build_termux_package
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
#!/bin/bash
set -e
cd "$(dirname "$0")"
PACKAGE_PATH=app/build/outputs/apk/debug/termux-x11.deb
INTERMEDIATES=starter/build/intermediates
NDKBUILD_DIR=starter/build/intermediates/ndkBuild/debug/obj/local
DATA_DIR=$INTERMEDIATES/data
CONTROL_DIR=$INTERMEDIATES/control
PACKAGE_DIR=$INTERMEDIATES/package
PREFIX=$DATA_DIR/data/data/com.termux/files/usr
rm -rf $PACKAGE_PATH $DATA_DIR $CONTROL_DIR $PACKAGE_DIR
mkdir -p $PREFIX/bin/
mkdir -p $PREFIX/libexec/termux-x11
cp termux-x11 $PREFIX/bin/
cp termux-startx11 $PREFIX/libexec/termux-x11
cp starter/build/outputs/apk/debug/starter-debug.apk \
$PREFIX/libexec/termux-x11/starter.apk
for arch in armeabi-v7a arm64-v8a x86 x86_64; do
mkdir -p $PREFIX/libexec/termux-x11/$arch/
cp $NDKBUILD_DIR/$arch/libstarter.so \
$PREFIX/libexec/termux-x11/$arch/
done
mkdir -p $CONTROL_DIR
cat <<EOF > $CONTROL_DIR/control
Package: termux-x11
Architecture: all
Maintainer: Twaik Yont @twaik
Version: 1.02.06
Homepage: https://github.com/termux/termux-x11
Depends: xwayland
Description: Companion package for termux-x11 app
EOF
mkdir -p $PACKAGE_DIR
echo 2.0 > $PACKAGE_DIR/debian-binary
tar -cJf $PACKAGE_DIR/data.tar.xz -C $DATA_DIR .
tar -czf $PACKAGE_DIR/control.tar.gz -C $CONTROL_DIR .
ar -rsc $PACKAGE_PATH \
$PACKAGE_DIR/debian-binary \
$PACKAGE_DIR/control.tar.gz \
$PACKAGE_DIR/data.tar.xz