termux-x11/build_termux_package

96 lines
3.2 KiB
Plaintext
Raw Normal View History

#!/bin/bash
set -e
cd "$(dirname "$0")"
TERMUX_PKG_NAME="termux-x11-nightly"
Implementing experimental X11 client. * [EXPERIMENTAL] Experimental X11 client. * Moving fake compositor to CmdEntryPoint, getting rid of background service, making MainActivity work as X11 client... * Reconnecting to existing session. * Basic multiple layout support (using setxkbmap). * ExtraKeys support * Added toggling ExtraKeys bar with triple finger swipe down. * Adding an ability to output logcat of `com.termux.x11` via TERMUX_X11_DEBUG=1 environment variable. * Initial changes to use separate lookup table for external keyboard. * Input of custom unicode characters. * Optimized starting logcat in com.termux.x11 userspace. * Reducing apk size. * Fixed broken logging, appearing of extra keys with `--no-xwayland-start`. * Initial Xvfb support. * Improving drawing speed by using NEON on arm devices. * Making session reconnect if it is fault for some reason. * Updating README.md and adding option to disable horizontal scrolling. * fix: shortcut icon color. * fix shortcut icon color in dark mode * restore cache (#259) * Experimental virtual resolution feature. Settings screen is updated. * Initial uploading keyboard to Android feature. * Added memfd support (for server needs). * Added the ability to change extra keys list. --------- Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: Arvind Kaushik <61283438+ask9027@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: polkaulfield <mr.tamuraa@gmail.com> Co-authored-by: Ivan Max <mixython@gmail.com> Co-authored-by: Wisest_wizard <12suhangp34@gmail.com> Co-authored-by: agnostic-apollo <agnosticapollo@gmail.com>
2023-03-09 00:31:15 +00:00
TERMUX_PKG_HOMEPAGE="https://github.com/termux/termux-x11"
TERMUX_PKG_DESCRIPTION="Companion package for termux-x11 app"
TERMUX_PKG_MAINTAINER="Twaik Yont @twaik"
TERMUX_PKG_REVISION=0
TERMUX_PKG_VERSION=$(grep versionName app/build.gradle | cut -d '"' -f 2)
TERMUX_PKG_DEPENDS="xkeyboard-config"
Implementing experimental X11 client. * [EXPERIMENTAL] Experimental X11 client. * Moving fake compositor to CmdEntryPoint, getting rid of background service, making MainActivity work as X11 client... * Reconnecting to existing session. * Basic multiple layout support (using setxkbmap). * ExtraKeys support * Added toggling ExtraKeys bar with triple finger swipe down. * Adding an ability to output logcat of `com.termux.x11` via TERMUX_X11_DEBUG=1 environment variable. * Initial changes to use separate lookup table for external keyboard. * Input of custom unicode characters. * Optimized starting logcat in com.termux.x11 userspace. * Reducing apk size. * Fixed broken logging, appearing of extra keys with `--no-xwayland-start`. * Initial Xvfb support. * Improving drawing speed by using NEON on arm devices. * Making session reconnect if it is fault for some reason. * Updating README.md and adding option to disable horizontal scrolling. * fix: shortcut icon color. * fix shortcut icon color in dark mode * restore cache (#259) * Experimental virtual resolution feature. Settings screen is updated. * Initial uploading keyboard to Android feature. * Added memfd support (for server needs). * Added the ability to change extra keys list. --------- Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: Arvind Kaushik <61283438+ask9027@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: polkaulfield <mr.tamuraa@gmail.com> Co-authored-by: Ivan Max <mixython@gmail.com> Co-authored-by: Wisest_wizard <12suhangp34@gmail.com> Co-authored-by: agnostic-apollo <agnosticapollo@gmail.com>
2023-03-09 00:31:15 +00:00
TERMUX_PKG_FULLVERSION="$TERMUX_PKG_VERSION-$TERMUX_PKG_REVISION"
TERMUX_APT_ARCH=all
TERMUX_PACMAN_ARCH=any
### Deploy .deb package
DEB_PACKAGE_PATH=app/build/outputs/apk/debug/${TERMUX_PKG_NAME}-${TERMUX_PKG_FULLVERSION}-${TERMUX_APT_ARCH}.deb
PACMAN_PACKAGE_PATH=app/build/outputs/apk/debug/${TERMUX_PKG_NAME}-${TERMUX_PKG_FULLVERSION}-${TERMUX_PACMAN_ARCH}.pkg.tar.xz
INTERMEDIATES=shell-loader/build/intermediates
DATA_DIR=$INTERMEDIATES/data
CONTROL_DIR=$INTERMEDIATES/control
PACKAGE_DIR=$INTERMEDIATES/package
PREFIX=$DATA_DIR/data/data/com.termux/files/usr
Implementing experimental X11 client. * [EXPERIMENTAL] Experimental X11 client. * Moving fake compositor to CmdEntryPoint, getting rid of background service, making MainActivity work as X11 client... * Reconnecting to existing session. * Basic multiple layout support (using setxkbmap). * ExtraKeys support * Added toggling ExtraKeys bar with triple finger swipe down. * Adding an ability to output logcat of `com.termux.x11` via TERMUX_X11_DEBUG=1 environment variable. * Initial changes to use separate lookup table for external keyboard. * Input of custom unicode characters. * Optimized starting logcat in com.termux.x11 userspace. * Reducing apk size. * Fixed broken logging, appearing of extra keys with `--no-xwayland-start`. * Initial Xvfb support. * Improving drawing speed by using NEON on arm devices. * Making session reconnect if it is fault for some reason. * Updating README.md and adding option to disable horizontal scrolling. * fix: shortcut icon color. * fix shortcut icon color in dark mode * restore cache (#259) * Experimental virtual resolution feature. Settings screen is updated. * Initial uploading keyboard to Android feature. * Added memfd support (for server needs). * Added the ability to change extra keys list. --------- Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: Arvind Kaushik <61283438+ask9027@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: polkaulfield <mr.tamuraa@gmail.com> Co-authored-by: Ivan Max <mixython@gmail.com> Co-authored-by: Wisest_wizard <12suhangp34@gmail.com> Co-authored-by: agnostic-apollo <agnosticapollo@gmail.com>
2023-03-09 00:31:15 +00:00
rm -rf $DEB_PACKAGE_PATH $PACMAN_PACKAGE_PATH $DATA_DIR $CONTROL_DIR $PACKAGE_DIR $INTERMEDIATES/.PKGINFO $INTERMEDIATES/.BUILDINFO $INTERMEDIATES/.MTREE
mkdir -p $PREFIX/bin/
mkdir -p $PREFIX/libexec/termux-x11
Implementing experimental X11 client. * [EXPERIMENTAL] Experimental X11 client. * Moving fake compositor to CmdEntryPoint, getting rid of background service, making MainActivity work as X11 client... * Reconnecting to existing session. * Basic multiple layout support (using setxkbmap). * ExtraKeys support * Added toggling ExtraKeys bar with triple finger swipe down. * Adding an ability to output logcat of `com.termux.x11` via TERMUX_X11_DEBUG=1 environment variable. * Initial changes to use separate lookup table for external keyboard. * Input of custom unicode characters. * Optimized starting logcat in com.termux.x11 userspace. * Reducing apk size. * Fixed broken logging, appearing of extra keys with `--no-xwayland-start`. * Initial Xvfb support. * Improving drawing speed by using NEON on arm devices. * Making session reconnect if it is fault for some reason. * Updating README.md and adding option to disable horizontal scrolling. * fix: shortcut icon color. * fix shortcut icon color in dark mode * restore cache (#259) * Experimental virtual resolution feature. Settings screen is updated. * Initial uploading keyboard to Android feature. * Added memfd support (for server needs). * Added the ability to change extra keys list. --------- Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: Arvind Kaushik <61283438+ask9027@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: polkaulfield <mr.tamuraa@gmail.com> Co-authored-by: Ivan Max <mixython@gmail.com> Co-authored-by: Wisest_wizard <12suhangp34@gmail.com> Co-authored-by: agnostic-apollo <agnosticapollo@gmail.com>
2023-03-09 00:31:15 +00:00
mkdir -p "$(dirname $DEB_PACKAGE_PATH)"
cp termux-x11 $PREFIX/bin/
cp shell-loader/build/outputs/apk/debug/shell-loader-debug.apk \
$PREFIX/libexec/termux-x11/loader.apk
mkdir -p $CONTROL_DIR
cat <<EOF > $CONTROL_DIR/control
Implementing experimental X11 client. * [EXPERIMENTAL] Experimental X11 client. * Moving fake compositor to CmdEntryPoint, getting rid of background service, making MainActivity work as X11 client... * Reconnecting to existing session. * Basic multiple layout support (using setxkbmap). * ExtraKeys support * Added toggling ExtraKeys bar with triple finger swipe down. * Adding an ability to output logcat of `com.termux.x11` via TERMUX_X11_DEBUG=1 environment variable. * Initial changes to use separate lookup table for external keyboard. * Input of custom unicode characters. * Optimized starting logcat in com.termux.x11 userspace. * Reducing apk size. * Fixed broken logging, appearing of extra keys with `--no-xwayland-start`. * Initial Xvfb support. * Improving drawing speed by using NEON on arm devices. * Making session reconnect if it is fault for some reason. * Updating README.md and adding option to disable horizontal scrolling. * fix: shortcut icon color. * fix shortcut icon color in dark mode * restore cache (#259) * Experimental virtual resolution feature. Settings screen is updated. * Initial uploading keyboard to Android feature. * Added memfd support (for server needs). * Added the ability to change extra keys list. --------- Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: Arvind Kaushik <61283438+ask9027@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: polkaulfield <mr.tamuraa@gmail.com> Co-authored-by: Ivan Max <mixython@gmail.com> Co-authored-by: Wisest_wizard <12suhangp34@gmail.com> Co-authored-by: agnostic-apollo <agnosticapollo@gmail.com>
2023-03-09 00:31:15 +00:00
Package: $TERMUX_PKG_NAME
Architecture: $TERMUX_APT_ARCH
Maintainer: $TERMUX_PKG_MAINTAINER
Version: $TERMUX_PKG_FULLVERSION
Homepage: $TERMUX_PKG_HOMEPAGE
Depends: $TERMUX_PKG_DEPENDS
Implementing experimental X11 client. * [EXPERIMENTAL] Experimental X11 client. * Moving fake compositor to CmdEntryPoint, getting rid of background service, making MainActivity work as X11 client... * Reconnecting to existing session. * Basic multiple layout support (using setxkbmap). * ExtraKeys support * Added toggling ExtraKeys bar with triple finger swipe down. * Adding an ability to output logcat of `com.termux.x11` via TERMUX_X11_DEBUG=1 environment variable. * Initial changes to use separate lookup table for external keyboard. * Input of custom unicode characters. * Optimized starting logcat in com.termux.x11 userspace. * Reducing apk size. * Fixed broken logging, appearing of extra keys with `--no-xwayland-start`. * Initial Xvfb support. * Improving drawing speed by using NEON on arm devices. * Making session reconnect if it is fault for some reason. * Updating README.md and adding option to disable horizontal scrolling. * fix: shortcut icon color. * fix shortcut icon color in dark mode * restore cache (#259) * Experimental virtual resolution feature. Settings screen is updated. * Initial uploading keyboard to Android feature. * Added memfd support (for server needs). * Added the ability to change extra keys list. --------- Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: Arvind Kaushik <61283438+ask9027@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: polkaulfield <mr.tamuraa@gmail.com> Co-authored-by: Ivan Max <mixython@gmail.com> Co-authored-by: Wisest_wizard <12suhangp34@gmail.com> Co-authored-by: agnostic-apollo <agnosticapollo@gmail.com>
2023-03-09 00:31:15 +00:00
Description: $TERMUX_PKG_DESCRIPTION
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 .
Implementing experimental X11 client. * [EXPERIMENTAL] Experimental X11 client. * Moving fake compositor to CmdEntryPoint, getting rid of background service, making MainActivity work as X11 client... * Reconnecting to existing session. * Basic multiple layout support (using setxkbmap). * ExtraKeys support * Added toggling ExtraKeys bar with triple finger swipe down. * Adding an ability to output logcat of `com.termux.x11` via TERMUX_X11_DEBUG=1 environment variable. * Initial changes to use separate lookup table for external keyboard. * Input of custom unicode characters. * Optimized starting logcat in com.termux.x11 userspace. * Reducing apk size. * Fixed broken logging, appearing of extra keys with `--no-xwayland-start`. * Initial Xvfb support. * Improving drawing speed by using NEON on arm devices. * Making session reconnect if it is fault for some reason. * Updating README.md and adding option to disable horizontal scrolling. * fix: shortcut icon color. * fix shortcut icon color in dark mode * restore cache (#259) * Experimental virtual resolution feature. Settings screen is updated. * Initial uploading keyboard to Android feature. * Added memfd support (for server needs). * Added the ability to change extra keys list. --------- Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: Arvind Kaushik <61283438+ask9027@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: polkaulfield <mr.tamuraa@gmail.com> Co-authored-by: Ivan Max <mixython@gmail.com> Co-authored-by: Wisest_wizard <12suhangp34@gmail.com> Co-authored-by: agnostic-apollo <agnosticapollo@gmail.com>
2023-03-09 00:31:15 +00:00
ar -rsc $DEB_PACKAGE_PATH \
$PACKAGE_DIR/debian-binary \
$PACKAGE_DIR/control.tar.gz \
$PACKAGE_DIR/data.tar.xz
### Deploy pacman package
BUILD_DATE=$(date +%s)
{
echo "pkgname = $TERMUX_PKG_NAME"
echo "pkgbase = $TERMUX_PKG_NAME"
echo "pkgver = $TERMUX_PKG_FULLVERSION"
echo "pkgdesc = $(echo "$TERMUX_PKG_DESCRIPTION" | tr '\n' ' ')"
echo "url = $TERMUX_PKG_HOMEPAGE"
echo "builddate = $BUILD_DATE"
echo "packager = $TERMUX_PKG_MAINTAINER"
echo "arch = $TERMUX_PACMAN_ARCH"
echo "license = TERMUX_PKG_LICENSE"
tr ',' '\n' <<< "$TERMUX_PKG_DEPENDS" | sed 's|(||g; s|)||g; s| ||g; s|>>|>|g; s|<<|<|g' | awk '{ printf "depend = " $1; if ( ($1 ~ /</ || $1 ~ />/ || $1 ~ /=/) && $1 !~ /-/ ) printf "-0"; printf "\n" }' | sed 's/|.*//'
Implementing experimental X11 client. * [EXPERIMENTAL] Experimental X11 client. * Moving fake compositor to CmdEntryPoint, getting rid of background service, making MainActivity work as X11 client... * Reconnecting to existing session. * Basic multiple layout support (using setxkbmap). * ExtraKeys support * Added toggling ExtraKeys bar with triple finger swipe down. * Adding an ability to output logcat of `com.termux.x11` via TERMUX_X11_DEBUG=1 environment variable. * Initial changes to use separate lookup table for external keyboard. * Input of custom unicode characters. * Optimized starting logcat in com.termux.x11 userspace. * Reducing apk size. * Fixed broken logging, appearing of extra keys with `--no-xwayland-start`. * Initial Xvfb support. * Improving drawing speed by using NEON on arm devices. * Making session reconnect if it is fault for some reason. * Updating README.md and adding option to disable horizontal scrolling. * fix: shortcut icon color. * fix shortcut icon color in dark mode * restore cache (#259) * Experimental virtual resolution feature. Settings screen is updated. * Initial uploading keyboard to Android feature. * Added memfd support (for server needs). * Added the ability to change extra keys list. --------- Signed-off-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: Arvind Kaushik <61283438+ask9027@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: gradle-update-robot <gradle-update-robot@regolo.cc> Co-authored-by: polkaulfield <mr.tamuraa@gmail.com> Co-authored-by: Ivan Max <mixython@gmail.com> Co-authored-by: Wisest_wizard <12suhangp34@gmail.com> Co-authored-by: agnostic-apollo <agnosticapollo@gmail.com>
2023-03-09 00:31:15 +00:00
} > $DATA_DIR/.PKGINFO
{
echo "format = 2"
echo "pkgname = $TERMUX_PKG_NAME"
echo "pkgbase = $TERMUX_PKG_NAME"
echo "pkgver = $TERMUX_PKG_FULLVERSION"
echo "pkgarch = $TERMUX_PACMAN_ARCH"
echo "packager = $TERMUX_PKG_MAINTAINER"
echo "builddate = $BUILD_DATE"
} > $DATA_DIR/.BUILDINFO
PACMAN_PACKAGE_PATH=`realpath $PACMAN_PACKAGE_PATH`
cd $DATA_DIR
shopt -s dotglob globstar
printf '%s\0' data/**/* .BUILDINFO .PKGINFO | bsdtar -cnf - --format=mtree \
--options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' \
--null --files-from - | gzip -c -f -n > .MTREE
printf '%s\0' data/**/* .BUILDINFO .PKGINFO .MTREE | bsdtar --no-fflags -cnf - --null --files-from - | xz > "$PACMAN_PACKAGE_PATH"
shopt -u dotglob globstar
cd -