From 31401d57a32f284c87767e0fb2163f30b0b87157 Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:14:54 +0800 Subject: [PATCH 01/20] disable package: libudev-zero --- disabled-packages/libudev-zero/build.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 disabled-packages/libudev-zero/build.sh diff --git a/disabled-packages/libudev-zero/build.sh b/disabled-packages/libudev-zero/build.sh new file mode 100644 index 00000000000000..d20b2801713359 --- /dev/null +++ b/disabled-packages/libudev-zero/build.sh @@ -0,0 +1,11 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/adriancable/8086tiny +TERMUX_PKG_DESCRIPTION="Daemonless replacement for libudev" +TERMUX_PKG_LICENSE="ISC" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=1.0.3 +TERMUX_PKG_SRCURL=https://github.com/illiliti/libudev-zero/archive/refs/tags/$TERMUX_PKG_VERSION.tar.gz +TERMUX_PKG_SHA256=0bd89b657d62d019598e6c7ed726ff8fed80e8ba092a83b484d66afb80b77da5 +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_EXTRA_MAKE_ARGS=" +PREFIX=$TERMUX_PREFIX +" From d1f3b3aae50bca30252b20bc33a669cace804ec3 Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:15:06 +0800 Subject: [PATCH 02/20] disable package: elogind --- disabled-packages/elogind/0001-polyfill.patch | 237 ++++++++++++++++++ .../elogind/0002-disable-shadow.patch | 100 ++++++++ disabled-packages/elogind/build.sh | 33 +++ 3 files changed, 370 insertions(+) create mode 100644 disabled-packages/elogind/0001-polyfill.patch create mode 100644 disabled-packages/elogind/0002-disable-shadow.patch create mode 100644 disabled-packages/elogind/build.sh diff --git a/disabled-packages/elogind/0001-polyfill.patch b/disabled-packages/elogind/0001-polyfill.patch new file mode 100644 index 00000000000000..7d12388e3df3b9 --- /dev/null +++ b/disabled-packages/elogind/0001-polyfill.patch @@ -0,0 +1,237 @@ +Bionic libc doesn't have the following symbols: +- `secure_getenv` +- `program_invocation[_short]_name` +- `get_current_dir_name` +- `RLIMIT_NLIMITS` +- `sigisemptyset` +- `malloc_trim` +- `semctl`/`msgctl` +- `exp10` +- `fputs_unlocked`/`fputc_unlocked` (Available from API 28) +- `syncfs` (Available from API 28) +- `pthread_setaffinity_np` + +--- a/src/basic/musl_missing.h ++++ b/src/basic/musl_missing.h +@@ -16,6 +16,10 @@ + * + ****************************************************************/ + ++#if HAVE_PROGRAM_INVOCATION_NAME == 0 ++extern char *program_invocation_name; ++extern char *program_invocation_short_name; ++#endif + + void elogind_set_program_name(const char* pcall); + +@@ -30,7 +30,9 @@ + #include + #include /* for pthread_atfork */ + ++#ifndef __ANDROID__ + #define strerror_r(e, m, k) (strerror_r(e, m, k) < 0 ? strdup("strerror_r() failed") : m); ++#endif + + /* + * Possibly TODO according to http://man7.org/linux/man-pages/man3/getenv.3.html +@@ -37,12 +37,18 @@ + * + test if the effective capability bit was set on the executable file + * + test if the process has a nonempty permitted capability set + */ ++#ifndef __ANDROID__ + #if ! HAVE_SECURE_GETENV && ! HAVE___SECURE_GETENV + # define secure_getenv(name) \ + (issetugid() ? NULL : getenv(name)) + # undef HAVE_SECURE_GETENV + # define HAVE_SECURE_GETENV 1 + #endif // HAVE_[__]SECURE_GETENV ++#else ++#define secure_getenv(name) getenv(name) ++#undef HAVE_SECURE_GETENV ++#define HAVE_SECURE_GETENV 1 ++#endif + + #if ! HAVE_BASENAME + /* Poor man's basename */ +--- a/src/basic/macro.h ++++ b/src/basic/macro.h +@@ -390,3 +390,4 @@ + _current_++) + + #include "log.h" ++#include "musl_missing.h" +--- a/src/basic/path-util.c ++++ b/src/basic/path-util.c +@@ -55,6 +55,17 @@ + return path_join(prefix, p); + } + ++#ifdef __ANDROID__ ++static char *get_current_dir_name(void) { ++ char pwd[PATH_MAX]; ++ char *ret = getcwd(pwd, sizeof(pwd)); ++ if (ret == NULL) { ++ return NULL; ++ } ++ return strdup(pwd); ++} ++#endif ++ + int safe_getcwd(char **ret) { + _cleanup_free_ char *cwd = NULL; + +--- a/src/basic/process-util.c ++++ b/src/basic/process-util.c +@@ -5,7 +5,7 @@ + //#include + //#include + #include +-#include ++// #include + #include + #include + #include +--- a/src/basic/missing_resource.h ++++ b/src/basic/missing_resource.h +@@ -7,5 +7,9 @@ + #define RLIMIT_RTTIME 15 + #endif + ++#ifndef RLIMIT_NLIMITS ++#define RLIMIT_NLIMITS RLIMIT_RTTIME ++#endif ++ + /* If RLIMIT_RTTIME is not defined, then we cannot use RLIMIT_NLIMITS as is */ + #define _RLIMIT_MAX (RLIMIT_RTTIME+1 > RLIMIT_NLIMITS ? RLIMIT_RTTIME+1 : RLIMIT_NLIMITS) +--- a/src/libelogind/sd-journal/journal-file.h ++++ b/src/libelogind/sd-journal/journal-file.h +@@ -4,6 +4,7 @@ + #include + #include + //#include ++#include + + #if HAVE_GCRYPT + # include +--- a/src/libelogind/sd-event/sd-event.c ++++ b/src/libelogind/sd-event/sd-event.c +@@ -790,6 +790,14 @@ + return r; + } + ++#ifdef __ANDROID__ ++static int sigisemptyset(sigset_t* __set) { ++ struct sigaction sact; ++ sigemptyset(&sact.sa_mask); ++ return memcmp(__set, &sact.sa_mask, sizeof(sigset_t)); ++} ++#endif ++ + static void event_unmask_signal_data(sd_event *e, struct signal_data *d, int sig) { + assert(e); + assert(d); +@@ -1873,6 +1881,10 @@ + return 0; + } + ++#ifdef __ANDROID__ ++#define malloc_trim(pad) (0) ++#endif ++ + _public_ int sd_event_trim_memory(void) { + int r; + +--- a/src/shared/clean-ipc.c ++++ b/src/shared/clean-ipc.c +@@ -8,8 +8,14 @@ + #include + #include + #include +-#include +-#include ++// #include ++// #include ++#ifdef __ANDROID__ ++// Doesn't work on Android, so just stub them. ++#define shmctl(...) (-1) ++#define semctl(...) (-1) ++#define msgctl(...) (-1) ++#endif + #include + #include + +--- a/src/shared/json.c ++++ b/src/shared/json.c +@@ -2712,6 +2712,10 @@ + + *p = c; + ++#ifdef __ANDROID__ ++#define exp10(x) (pow(10.0, x)) ++#endif ++ + if (is_real) { + ret->real = ((negative ? -1.0 : 1.0) * (x + (y / shift))) * exp10((exponent_negative ? -1.0 : 1.0) * exponent); + return JSON_TOKEN_REAL; +--- a/src/basic/string-table.h ++++ b/src/basic/string-table.h +@@ -102,6 +102,11 @@ + #define DEFINE_PRIVATE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max) \ + _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING_FALLBACK(name,type,max,static) + ++#if defined(__ANDROID__) && __ANDROID_API__ < 28 ++#define fputs_unlocked(c, f) (fputs(c, f)) ++#define fputc_unlocked(c, f) (fputc(c, f)) ++#endif ++ + #define DUMP_STRING_TABLE(name,type,max) \ + do { \ + flockfile(stdout); \ +--- a/src/shared/rm-rf.c ++++ b/src/shared/rm-rf.c +@@ -6,6 +6,11 @@ + #include + #include + ++#if defined __ANDROID__ && __ANDROID_API__ < 28 ++#include ++#define syncfs(fd) (syscall(SYS_syncfs, fd)) ++#endif ++ + #include "alloc-util.h" + #include "btrfs-util.h" + #include "cgroup-util.h" +@@ -20,6 +25,7 @@ + #include "stat-util.h" + #include "string-util.h" + ++ + /* We treat tmpfs/ramfs + cgroupfs as non-physical file systems. cgroupfs is similar to tmpfs in a way + * after all: we can create arbitrary directory hierarchies in it, and hence can also use rm_rf() on it + * to remove those again. */ +--- a/src/libelogind/sd-bus/test-bus-benchmark.c ++++ b/src/libelogind/sd-bus/test-bus-benchmark.c +@@ -290,7 +290,11 @@ + if (pid == 0) { + CPU_ZERO(&cpuset); + CPU_SET(0, &cpuset); ++#ifndef __ANDROID__ + pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); ++#else ++ sched_setaffinity(pthread_gettid_np(pthread_self()), sizeof(cpu_set_t), &cpuset); ++#endif + + safe_close(bus_ref); + sd_bus_unref(b); +@@ -310,7 +314,11 @@ + + CPU_ZERO(&cpuset); + CPU_SET(1, &cpuset); ++#ifndef __ANDROID__ + pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); ++#else ++ sched_setaffinity(pthread_gettid_np(pthread_self()), sizeof(cpu_set_t), &cpuset); ++#endif + + server(b, &result); + diff --git a/disabled-packages/elogind/0002-disable-shadow.patch b/disabled-packages/elogind/0002-disable-shadow.patch new file mode 100644 index 00000000000000..08664ae53bc685 --- /dev/null +++ b/disabled-packages/elogind/0002-disable-shadow.patch @@ -0,0 +1,100 @@ +--- a/src/shared/user-record-nss.h ++++ b/src/shared/user-record-nss.h +@@ -2,9 +2,15 @@ + #pragma once + + #include ++#ifdef ENABLE_GSHADOW + #include ++#endif + #include ++#ifndef __ANDROID__ + #include ++#else ++struct spwd {}; ++#endif + + //#include "group-record.h" + #include "user-record.h" +--- a/src/shared/user-record-nss.c ++++ b/src/shared/user-record-nss.c +@@ -50,8 +50,13 @@ + if (isempty(pwd->pw_name)) + return -EINVAL; + ++#ifndef __ANDROID__ + if (spwd && !streq_ptr(spwd->sp_namp, pwd->pw_name)) + return -EINVAL; ++#else ++ if (spwd) ++ return -EINVAL; ++#endif + + hr = user_record_new(); + if (!hr) +@@ -92,6 +97,7 @@ + hr->uid = pwd->pw_uid; + hr->gid = pwd->pw_gid; + ++#ifndef __ANDROID__ + if (spwd && + looks_like_hashed_password(utf8_only(spwd->sp_pwdp))) { /* Ignore locked, disabled, and mojibake passwords */ + strv_free_erase(hr->hashed_password); +@@ -137,6 +143,7 @@ + SET_IF(hr->password_change_inactive_usec, + spwd && spwd->sp_inact > 0 && (uint64_t) spwd->sp_inact <= (UINT64_MAX-1)/USEC_PER_DAY, + spwd->sp_inact * USEC_PER_DAY, UINT64_MAX); ++#endif + + hr->json = json_variant_unref(hr->json); + r = json_build(&hr->json, JSON_BUILD_OBJECT( +@@ -168,6 +175,9 @@ + } + + int nss_spwd_for_passwd(const struct passwd *pwd, struct spwd *ret_spwd, char **ret_buffer) { ++#ifdef __ANDROID__ ++ return -EIO; ++#else + size_t buflen = 4096; + int r; + +@@ -203,6 +213,7 @@ + buflen *= 2; + buf = mfree(buf); + } ++#endif + } + + int nss_user_record_by_name( +@@ -244,6 +255,7 @@ + buf = mfree(buf); + } + ++#ifndef __ANDROID__ + if (with_shadow) { + r = nss_spwd_for_passwd(result, &spwd, &sbuf); + if (r < 0) { +@@ -252,6 +264,7 @@ + } else + sresult = &spwd; + } else ++#endif + incomplete = true; + + r = nss_passwd_to_user_record(result, sresult, ret); +@@ -299,6 +312,7 @@ + buf = mfree(buf); + } + ++#ifndef __ANDROID__ + if (with_shadow) { + r = nss_spwd_for_passwd(result, &spwd, &sbuf); + if (r < 0) { +@@ -307,6 +321,7 @@ + } else + sresult = &spwd; + } else ++#endif + incomplete = true; + + r = nss_passwd_to_user_record(result, sresult, ret); diff --git a/disabled-packages/elogind/build.sh b/disabled-packages/elogind/build.sh new file mode 100644 index 00000000000000..9ba14bff158cdf --- /dev/null +++ b/disabled-packages/elogind/build.sh @@ -0,0 +1,33 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/elogind/elogind +TERMUX_PKG_DESCRIPTION="The systemd project's logind, extracted to a standalone package" +TERMUX_PKG_LICENSE="GPL-2.0-or-later, LGPL-2.1-or-later" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=255.17 +TERMUX_PKG_SRCURL=https://github.com/elogind/elogind/archive/refs/tags/v$TERMUX_PKG_VERSION.tar.gz +TERMUX_PKG_SHA256=a9725ae3f73f8d910de84c108bc11bfd4c782bef6a4190b2ec70c5d2f22344db +TERMUX_PKG_DEPENDS="libcap, libmount, libudev-zero" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dmode=release +-Dsysconfdir=$TERMUX_PREFIX/etc +-Dlocalstatedir=$TERMUX_PREFIX/var +-Dhalt-path=$TERMUX_PREFIX/bin/false +-Dpoweroff-path=$TERMUX_PREFIX/bin/false +-Dreboot-path=$TERMUX_PREFIX/bin/false +-Dkexec-path=$TERMUX_PREFIX/bin/false +-Dnologin-path=$TERMUX_PREFIX/bin/false +-Ddefault-user-shell=$TERMUX_PREFIX/bin/bash +-Duser-path=$TERMUX_PREFIX/bin:/system/bin +-Ddefault-kill-user-processes=false +-Dsplit-bin=false +-Dutmp=false +-Defi=false +" + +termux_step_post_get_source() { + # Prefer meson build + rm -f configure +} + +termux_step_pre_configure() { + termux_setup_meson +} From 85a12c25bbd74efc9a59abf745329a83bdf12abc Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:38:30 +0800 Subject: [PATCH 03/20] libical: enable glib --- packages/libical/build.sh | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/packages/libical/build.sh b/packages/libical/build.sh index 7f774d50bdd99c..6a973f918b16d3 100644 --- a/packages/libical/build.sh +++ b/packages/libical/build.sh @@ -3,14 +3,38 @@ TERMUX_PKG_DESCRIPTION="Libical is an Open Source implementation of the iCalenda TERMUX_PKG_LICENSE="LGPL-2.0" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="3.0.20" -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/libical/libical/releases/download/v$TERMUX_PKG_VERSION/libical-$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SHA256=e73de92f5a6ce84c1b00306446b290a2b08cdf0a80988eca0a2c9d5c3510b4c2 TERMUX_PKG_AUTO_UPDATE=true -TERMUX_PKG_DEPENDS="libc++, libicu" +TERMUX_PKG_DEPENDS="glib, libc++, libicu, libxml2" TERMUX_PKG_BREAKS="libical-dev" TERMUX_PKG_REPLACES="libical-dev" -TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DSHARED_ONLY=true -DICAL_GLIB=false -DUSE_BUILTIN_TZDATA=true -DPERL_EXECUTABLE=/usr/bin/perl" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-DSHARED_ONLY=true +-DUSE_BUILTIN_TZDATA=true +-DPERL_EXECUTABLE=/usr/bin/perl +-DICAL_GLIB=true +-DIMPORT_ICAL_GLIB_SRC_GENERATOR=$TERMUX_PKG_HOSTBUILD_DIR/host-prefix/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake +-DENABLE_GTK_DOC=false +" +TERMUX_PKG_HOSTBUILD=true + +termux_step_host_build() { + termux_setup_cmake + termux_setup_ninja + + mkdir -p "$TERMUX_PKG_HOSTBUILD_DIR"/host-prefix + + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="$TERMUX_PKG_HOSTBUILD_DIR"/host-prefix \ + -DENABLE_GTK_DOC=OFF \ + -G Ninja \ + "$TERMUX_PKG_SRCDIR" + cmake --build . + cmake --install . --prefix "$TERMUX_PKG_HOSTBUILD_DIR"/host-prefix +} termux_step_post_get_source() { # Do not forget to bump revision of reverse dependencies and rebuild them From af7c6a34ea3e1922c219fa429745e6408c3f77a5 Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:45:30 +0800 Subject: [PATCH 04/20] new package: evolution-data-server --- .../0001-use-pregenerated-iconv-detect.patch | 20 ++++++++ .../0002-do-not-run-configure-test.patch | 21 ++++++++ .../0003-decode-scheme-use-script.patch | 20 ++++++++ .../0004-use-host-tools.patch | 22 +++++++++ .../0005-do-not-use-db_load.patch | 14 ++++++ x11-packages/evolution-data-server/build.sh | 48 +++++++++++++++++++ .../google-scheme-decode.py | 14 ++++++ .../evolution-data-server/iconv-detect.h | 5 ++ 8 files changed, 164 insertions(+) create mode 100644 x11-packages/evolution-data-server/0001-use-pregenerated-iconv-detect.patch create mode 100644 x11-packages/evolution-data-server/0002-do-not-run-configure-test.patch create mode 100644 x11-packages/evolution-data-server/0003-decode-scheme-use-script.patch create mode 100644 x11-packages/evolution-data-server/0004-use-host-tools.patch create mode 100644 x11-packages/evolution-data-server/0005-do-not-use-db_load.patch create mode 100644 x11-packages/evolution-data-server/build.sh create mode 100755 x11-packages/evolution-data-server/google-scheme-decode.py create mode 100644 x11-packages/evolution-data-server/iconv-detect.h diff --git a/x11-packages/evolution-data-server/0001-use-pregenerated-iconv-detect.patch b/x11-packages/evolution-data-server/0001-use-pregenerated-iconv-detect.patch new file mode 100644 index 00000000000000..1868258dd18075 --- /dev/null +++ b/x11-packages/evolution-data-server/0001-use-pregenerated-iconv-detect.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -569,12 +569,17 @@ + message(FATAL_ERROR "You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv") + endif(NOT HAVE_ICONV) + ++if(CMAKE_CROSSCOMPILING) ++ file(COPY "$ENV{ICONV_DETECT_H}" DESTINATION "${CMAKE_BINARY_DIR}/") ++ set(_correct_iconv 1) ++else() + set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBS}) + file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/" _binary_dir_with_separator) + CHECK_C_SOURCE_RUNS("#define ICONV_DETECT_BUILD_DIR \"${_binary_dir_with_separator}\" + #include \"${CMAKE_SOURCE_DIR}/iconv-detect.c\"" _correct_iconv) + unset(_binary_dir_with_separator) + unset(CMAKE_REQUIRED_LIBRARIES) ++endif() + + if(NOT _correct_iconv) + message(FATAL_ERROR "You need to install a working iconv implementation, such as ftp://ftp.gnu.org/pub/gnu/libiconv") diff --git a/x11-packages/evolution-data-server/0002-do-not-run-configure-test.patch b/x11-packages/evolution-data-server/0002-do-not-run-configure-test.patch new file mode 100644 index 00000000000000..991ae8050b9ac4 --- /dev/null +++ b/x11-packages/evolution-data-server/0002-do-not-run-configure-test.patch @@ -0,0 +1,21 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -639,6 +639,10 @@ + # Check to see if strftime supports the use of %l and %k + # ******************************************************* + ++if(CMAKE_CROSSCOMPILING) ++ message(INFO "Cross compiling, assume HAVE_LKSTRFTIME is 0") ++ set(HAVE_LKSTRFTIME 0) ++else() + CHECK_C_SOURCE_RUNS(" + #include + #include +@@ -657,6 +661,7 @@ + return 1; + return 0; + }" HAVE_LKSTRFTIME) ++endif() + + # ****************************** + # system mail stuff diff --git a/x11-packages/evolution-data-server/0003-decode-scheme-use-script.patch b/x11-packages/evolution-data-server/0003-decode-scheme-use-script.patch new file mode 100644 index 00000000000000..30d1fbf40f5729 --- /dev/null +++ b/x11-packages/evolution-data-server/0003-decode-scheme-use-script.patch @@ -0,0 +1,20 @@ +--- a/data/CMakeLists.txt ++++ b/data/CMakeLists.txt +@@ -35,10 +35,17 @@ + set(CMAKE_REQUIRED_LIBRARIES ${DATA_SERVER_LDFLAGS}) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DG_LOG_DOMAIN=\"oauth2-value-helper\" -DBUILDING_VALUE_HELPER=1) + file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/oauth2-google-client-id" _binary_dir_to_file) ++if(CMAKE_CROSSCOMPILING) ++ execute_process( ++ COMMAND "$ENV{GOOGLE_OAUTH2_SCHEME_SCRIPT}" "${WITH_GOOGLE_CLIENT_ID}" "${_binary_dir_to_file}" ++ ) ++ set(_decoded 1) ++else() + CHECK_C_SOURCE_RUNS("#define DECODE_KEY \"${WITH_GOOGLE_CLIENT_ID}\" + #define DECODE_TO_FILE \"${_binary_dir_to_file}\" + #define DECODE_REVERSED 1 + #include \"${CMAKE_SOURCE_DIR}/src/libedataserver/e-oauth2-service.c\"" _decoded) ++endif() + file(READ ${_binary_dir_to_file} _google_oauth2_scheme) + unset(_binary_dir_to_file) + unset(_decoded) diff --git a/x11-packages/evolution-data-server/0004-use-host-tools.patch b/x11-packages/evolution-data-server/0004-use-host-tools.patch new file mode 100644 index 00000000000000..212d370390712c --- /dev/null +++ b/x11-packages/evolution-data-server/0004-use-host-tools.patch @@ -0,0 +1,22 @@ +--- a/src/camel/CMakeLists.txt ++++ b/src/camel/CMakeLists.txt +@@ -20,7 +20,7 @@ + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/camel-mime-tables.c +- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/camel-gen-tables >${CMAKE_CURRENT_BINARY_DIR}/camel-mime-tables.c ++ COMMAND camel-gen-tables >${CMAKE_CURRENT_BINARY_DIR}/camel-mime-tables.c + DEPENDS camel-gen-tables + ) + +--- a/src/addressbook/libebook-contacts/CMakeLists.txt ++++ b/src/addressbook/libebook-contacts/CMakeLists.txt +@@ -25,7 +25,7 @@ + + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/e-name-western-tables.h +- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gen-western-table "${CMAKE_CURRENT_SOURCE_DIR}/e-name-western-tables.h.in" >${CMAKE_CURRENT_BINARY_DIR}/e-name-western-tables.h ++ COMMAND gen-western-table "${CMAKE_CURRENT_SOURCE_DIR}/e-name-western-tables.h.in" >${CMAKE_CURRENT_BINARY_DIR}/e-name-western-tables.h + DEPENDS gen-western-table e-name-western-tables.h.in + ) + diff --git a/x11-packages/evolution-data-server/0005-do-not-use-db_load.patch b/x11-packages/evolution-data-server/0005-do-not-use-db_load.patch new file mode 100644 index 00000000000000..7a4291b4534cd6 --- /dev/null +++ b/x11-packages/evolution-data-server/0005-do-not-use-db_load.patch @@ -0,0 +1,14 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -335,7 +335,11 @@ + # db_load checking, it's optional + # ****************************** + ++if(ENABLE_TESTS) + find_program(DB_LOAD NAMES db_load db4_load db_load-4 db5_load db_load-5) ++else() ++set(DB_LOAD 0) ++endif() + if(DB_LOAD) + set(HAVE_DB_LOAD ON) + else(DB_LOAD) diff --git a/x11-packages/evolution-data-server/build.sh b/x11-packages/evolution-data-server/build.sh new file mode 100644 index 00000000000000..f76bccfca10e1d --- /dev/null +++ b/x11-packages/evolution-data-server/build.sh @@ -0,0 +1,48 @@ +TERMUX_PKG_HOMEPAGE=https://gitlab.gnome.org/GNOME/evolution/-/wikis/home +TERMUX_PKG_DESCRIPTION="Unified contacts, tasks and calendar backend" +TERMUX_PKG_LICENSE="LGPL-2.0-or-later" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="3.56.1" +TERMUX_PKG_SRCURL="https://download.gnome.org/sources/evolution-data-server/${TERMUX_PKG_VERSION%.*}/evolution-data-server-$TERMUX_PKG_VERSION.tar.xz" +TERMUX_PKG_SHA256=646cc0037da3f9f295794c637d95394ad76f8c9bee2268be2c4183e27720c137 +TERMUX_PKG_DEPENDS="glib, gtk3, gtk4, json-glib, krb5, libcanberra, libical, libicu, libnspr, libnss, libsecret, libsoup3, libsqlite, libuuid, libxml2, openldap" +TERMUX_PKG_BUILD_DEPENDS="glib-cross" +TERMUX_PKG_HOSTBUILD=true +TERMUX_PKG_VERSIONED_GIR=false + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-DCMAKE_SYSTEM_NAME=Linux +-DENABLE_TESTS=OFF +-DWITH_NSPR_INCLUDES=$TERMUX_PREFIX/include/nspr +-DWITH_NSS_INCLUDES=$TERMUX_PREFIX/include/nss +-DENABLE_OAUTH2_WEBKITGTK=OFF +-DENABLE_OAUTH2_WEBKITGTK4=OFF +-DENABLE_GOA=OFF +-DENABLE_WEATHER=OFF +-DWITH_LIBDB=OFF +-DENABLE_GTK_DOC=OFF +" + +termux_step_host_build() { + touch evolution-data-server-config.h + gcc -I. \ + "$TERMUX_PKG_SRCDIR"/src/camel/camel-gen-tables.c \ + -o camel-gen-tables + chmod +x camel-gen-tables + gcc -I. \ + $(pkg-config --cflags glib-2.0) \ + "$TERMUX_PKG_SRCDIR"/src/addressbook/libebook-contacts/gen-western-table.c \ + $(pkg-config --libs glib-2.0) \ + -o gen-western-table + chmod +x gen-western-table +} + +termux_step_pre_configure() { + export SENDMAIL_PATH="$TERMUX_PREFIX/bin/sendmail" + export GOOGLE_OAUTH2_SCHEME_SCRIPT="$TERMUX_PKG_BUILDER_DIR/google-scheme-decode.py" + export ICONV_DETECT_H="$TERMUX_PKG_BUILDER_DIR/iconv-detect.h" + + export PATH="$TERMUX_PKG_HOSTBUILD_DIR:$PATH" + + LDFLAGS="-Wl,-rpath=$TERMUX_PREFIX/lib/evolution-data-server $LDFLAGS" +} diff --git a/x11-packages/evolution-data-server/google-scheme-decode.py b/x11-packages/evolution-data-server/google-scheme-decode.py new file mode 100755 index 00000000000000..983434e7e01a8a --- /dev/null +++ b/x11-packages/evolution-data-server/google-scheme-decode.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 +import base64 +import sys + +if __name__ == '__main__': + enc = sys.argv[1] + out = sys.argv[2] + + t = base64.b64decode(enc) + t = bytes(map(lambda x: x^t[-1], t[:-1])) + t = b".".join(t.split(b".")[::-1]) + + with open(out, "wb") as fp: + fp.write(t + b"\n") diff --git a/x11-packages/evolution-data-server/iconv-detect.h b/x11-packages/evolution-data-server/iconv-detect.h new file mode 100644 index 00000000000000..6694b341c5f178 --- /dev/null +++ b/x11-packages/evolution-data-server/iconv-detect.h @@ -0,0 +1,5 @@ +/* This is an auto-generated header, DO NOT EDIT! */ + +#define ICONV_ISO_D_FORMAT "iso-%d-%d" +#define ICONV_ISO_S_FORMAT "iso-%d-%s" +#define ICONV_10646 "UCS-4BE" From 4ffa57bc2e05ee7d6705c626687480e6c3bbcd00 Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:45:40 +0800 Subject: [PATCH 05/20] new package: gjs --- x11-packages/gjs/0001-cross-build.patch | 41 +++++++++++++++++++++++++ x11-packages/gjs/0002-skip-tests.patch | 27 ++++++++++++++++ x11-packages/gjs/build.sh | 29 +++++++++++++++++ x11-packages/gjs/gir/GjsPrivate-1.0.xml | 28 +++++++++++++++++ 4 files changed, 125 insertions(+) create mode 100644 x11-packages/gjs/0001-cross-build.patch create mode 100644 x11-packages/gjs/0002-skip-tests.patch create mode 100644 x11-packages/gjs/build.sh create mode 100644 x11-packages/gjs/gir/GjsPrivate-1.0.xml diff --git a/x11-packages/gjs/0001-cross-build.patch b/x11-packages/gjs/0001-cross-build.patch new file mode 100644 index 00000000000000..3dbbd15d2390aa --- /dev/null +++ b/x11-packages/gjs/0001-cross-build.patch @@ -0,0 +1,41 @@ +--- a/meson.build ++++ b/meson.build +@@ -255,6 +255,14 @@ + # Check if a minimal SpiderMonkey program compiles, links, and runs. If not, + # it's most likely the case that SpiderMonkey was configured incorrectly, for + # example by building mozglue as a shared library. ++recommended_configuration = ''' Check the recommended configuration: ++https://github.com/spidermonkey-embedders/spidermonkey-embedding-examples/blob/esr91/docs/Building%20SpiderMonkey.md''' ++if meson.is_cross_build() ++ warning('''This is a cross build. A check that a minimal ++SpiderMonkey program executes will not be performed. Before shipping GJS, you ++should check that it does not crash on startup, since building SpiderMonkey with ++the wrong configuration may cause that.''' + recommended_configuration) ++else + minimal_program = cxx.run(''' + #include + int main(void) { +@@ -266,22 +274,16 @@ + args: debug_arg, dependencies: spidermonkey, + name: 'SpiderMonkey sanity check') + +-recommended_configuration = ''' Check the recommended configuration: +-https://github.com/spidermonkey-embedders/spidermonkey-embedding-examples/blob/esr91/docs/Building%20SpiderMonkey.md''' + if not minimal_program.compiled() + error('''A minimal SpiderMonkey program + could not be compiled or linked. Most likely you should build it with a + different configuration.''' + recommended_configuration) +-elif meson.is_cross_build() +- warning('''This is a cross build. A check that a minimal +-SpiderMonkey program executes will not be performed. Before shipping GJS, you +-should check that it does not crash on startup, since building SpiderMonkey with +-the wrong configuration may cause that.''' + recommended_configuration) + elif minimal_program.returncode() != 0 + error('''A minimal SpiderMonkey program + failed to execute. Most likely you should build it with a different + configuration.''' + recommended_configuration) + endif ++endif + + ### Check for external programs ################################################ + diff --git a/x11-packages/gjs/0002-skip-tests.patch b/x11-packages/gjs/0002-skip-tests.patch new file mode 100644 index 00000000000000..ad436941f282ad --- /dev/null +++ b/x11-packages/gjs/0002-skip-tests.patch @@ -0,0 +1,27 @@ +--- a/meson.build ++++ b/meson.build +@@ -644,6 +644,7 @@ + + ### Tests and test setups ###################################################### + ++if not get_option('skip_tests') + # External code should not error out even when building with -Werror + gi_tests = subproject('gobject-introspection-tests', + default_options: ['werror=false', 'cairo=true', +@@ -695,6 +696,8 @@ + zeal11_environment.set('JS_GC_ZEAL', '11') + add_test_setup('post_verify', timeout_multiplier: 2, env: zeal11_environment) + ++endif ++ + ### Warn about conditions that may affect runtime ############################## + + if tests_locale == 'C' or tests_locale == 'N/A' +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -24,3 +24,5 @@ + description: 'Skip tests that need a display connection') + option('verbose_logs', type: 'boolean', value: false, + description: 'Enable extra log messages that may decrease performance (not allowed in release builds)') ++option('skip_tests', type: 'boolean', value: false, ++ description: 'Skip all the tests') diff --git a/x11-packages/gjs/build.sh b/x11-packages/gjs/build.sh new file mode 100644 index 00000000000000..9ea5babca376cd --- /dev/null +++ b/x11-packages/gjs/build.sh @@ -0,0 +1,29 @@ +TERMUX_PKG_HOMEPAGE=https://wiki.gnome.org/Projects/Gjs/ +TERMUX_PKG_DESCRIPTION="JavaScript Bindings for GNOME" +TERMUX_PKG_LICENSE="MIT, LGPL-2.0-or-later" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="1.84.1" +TERMUX_PKG_SRCURL="https://download.gnome.org/sources/gjs/${TERMUX_PKG_VERSION%.*}/gjs-$TERMUX_PKG_VERSION.tar.xz" +TERMUX_PKG_SHA256=44796b91318dbbe221a13909f00fd872ef92f38c68603e0e3574e46bc6bac32c +TERMUX_PKG_DEPENDS="glib, gobject-introspection, libcairo, libffi, libx11, readline, spidermonkey" +TERMUX_PKG_BUILD_DEPENDS="g-ir-scanner, glib-cross" +TERMUX_PKG_VERSIONED_GIR=false +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Db_pch=false +-Dinstalled_tests=false +-Dskip_dbus_tests=true +-Dskip_gtk_tests=true +-Dskip_tests=true +" + +termux_step_post_get_source() { + # Do not use meson wrap projects + rm -f subprojects/*.wrap +} + +termux_step_pre_configure() { + termux_setup_gir + termux_setup_glib_cross_pkg_config_wrapper + + export TERMUX_MESON_ENABLE_SOVERSION=1 +} diff --git a/x11-packages/gjs/gir/GjsPrivate-1.0.xml b/x11-packages/gjs/gir/GjsPrivate-1.0.xml new file mode 100644 index 00000000000000..0b15c0cac10c1d --- /dev/null +++ b/x11-packages/gjs/gir/GjsPrivate-1.0.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 2e6499becde2abd66de24211341ead16678e9dbc Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:46:57 +0800 Subject: [PATCH 06/20] new package: gnome-session --- .../gnome-session/0001-no-logind.patch | 148 ++++++++++++++++++ x11-packages/gnome-session/0002-Werror.patch | 13 ++ x11-packages/gnome-session/build.sh | 25 +++ 3 files changed, 186 insertions(+) create mode 100644 x11-packages/gnome-session/0001-no-logind.patch create mode 100644 x11-packages/gnome-session/0002-Werror.patch create mode 100644 x11-packages/gnome-session/build.sh diff --git a/x11-packages/gnome-session/0001-no-logind.patch b/x11-packages/gnome-session/0001-no-logind.patch new file mode 100644 index 00000000000000..30cd94d131d2b3 --- /dev/null +++ b/x11-packages/gnome-session/0001-no-logind.patch @@ -0,0 +1,148 @@ +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -4,3 +4,4 @@ + option('docbook', type: 'boolean', value: true, description: 'build documentation') + option('man', type: 'boolean', value: true, description: 'build documentation (requires xmlto)') + option('x11', type: 'boolean', value: true, description: 'enable x11 session support') ++option('systemd', type: 'boolean', value: true, description: 'Use systemd') +--- a/meson.build ++++ b/meson.build +@@ -125,7 +125,12 @@ + pkgconfig_define: ['prefix', session_prefix]) + endif + ++if not get_option('systemd') ++libsystemd_dep = dependency('', required : false) ++else + libsystemd_dep = dependency('libsystemd', version: '>= 209', required: true) ++config_h.set(HAVE_SYSTEMD, true) ++endif + session_bin_deps += libsystemd_dep + + configure_file( +--- a/gnome-session/gsm-autostart-app.c ++++ b/gnome-session/gsm-autostart-app.c +@@ -31,8 +31,10 @@ + #define GNOME_DESKTOP_USE_UNSTABLE_API + #include + ++#ifdef HAVE_SYSTEMD + #include + #include ++#endif + + #include "gsm-autostart-app.h" + #include "gsm-util.h" +@@ -966,12 +968,16 @@ on_child_setup (GsmAutostartApp *app) + /* The FALSE means programs aren't expected to prefix each + * line with prefix to specify priority. + */ ++#ifdef HAVE_SYSTEMD + standard_output = sd_journal_stream_fd (priv->desktop_id, + LOG_INFO, + FALSE); + standard_error = sd_journal_stream_fd (priv->desktop_id, + LOG_WARNING, + FALSE); ++#else ++ standard_output = standard_error = -1; ++#endif + + if (standard_output >= 0) { + dup2 (standard_output, STDOUT_FILENO); +@@ -1033,10 +1040,12 @@ autostart_app_start_spawn (GsmAutostartApp *app, + g_app_launch_context_setenv (ctx, "DESKTOP_AUTOSTART_ID", startup_id); + } + ++#ifdef HAVE_SYSTEMD + if (sd_booted () > 0) { + child_setup_func = (GSpawnChildSetupFunc) on_child_setup; + child_setup_data = app; + } ++#endif + + handler = g_signal_connect (ctx, "launched", G_CALLBACK (app_launched), app); + success = g_desktop_app_info_launch_uris_as_manager (priv->app_info, +--- a/gnome-session/gsm-manager.c ++++ b/gnome-session/gsm-manager.c +@@ -40,9 +40,15 @@ + #include "gsm-manager.h" + #include "org.gnome.SessionManager.h" + ++#ifdef HAVE_SYSTEMD + #include + + #include ++#else ++#define sd_notify(...) ++#define sd_notifyf(...) ++#define sd_journal_send(...) ++#endif + + #include "gsm-store.h" + #include "gsm-inhibitor.h" +--- a/gnome-session/gsm-systemd.c ++++ b/gnome-session/gsm-systemd.c +@@ -28,6 +28,7 @@ + #include + #include + ++#ifdef HAVE_SYSTEMD + #include + + #include +@@ -1194,4 +1195,10 @@ sd_proxy_signal_cb (GDBusProxy *proxy, + } + } + +- ++#else ++GsmSystemd * ++gsm_systemd_new (void) ++{ ++ return NULL; ++} ++#endif +--- a/gnome-session/main.c ++++ b/gnome-session/main.c +@@ -43,7 +43,9 @@ + #include "gsm-system.h" + #include "gsm-fail-whale.h" + ++#ifdef HAVE_SYSTEMD + #include ++#endif + + #define GSM_DBUS_NAME "org.gnome.SessionManager" + +@@ -558,6 +560,7 @@ main (int argc, char **argv) + * journald picks ups the nicer "gnome-session" as the program + * name instead of whatever shell script GDM happened to use. + */ ++#ifdef HAVE_SYSTEMD + if (!debug) { + int journalfd; + +@@ -567,6 +570,7 @@ main (int argc, char **argv) + dup2(journalfd, 2); + } + } ++#endif + + gdm_log_init (); + gdm_log_set_debug (debug); +--- a/tools/gnome-session-ctl.c ++++ b/tools/gnome-session-ctl.c +@@ -28,7 +28,12 @@ + #include + #include + #include ++#ifdef HAVE_SYSTEMD + #include ++#else ++#define sd_notify(...) ++#define sd_notifyf(...) ++#endif + + #include + #include diff --git a/x11-packages/gnome-session/0002-Werror.patch b/x11-packages/gnome-session/0002-Werror.patch new file mode 100644 index 00000000000000..e06b3ff3d88c5d --- /dev/null +++ b/x11-packages/gnome-session/0002-Werror.patch @@ -0,0 +1,13 @@ +--- a/meson.build ++++ b/meson.build +@@ -76,6 +76,10 @@ + + compiler_flags += cc.get_supported_arguments(test_cflags) + endif ++compiler_flags += [ ++ '-Wno-format-nonliteral', ++ '-Wno-format-security' ++] + + add_project_arguments(common_flags + compiler_flags, language: 'c') + diff --git a/x11-packages/gnome-session/build.sh b/x11-packages/gnome-session/build.sh new file mode 100644 index 00000000000000..4f7d50671e9c68 --- /dev/null +++ b/x11-packages/gnome-session/build.sh @@ -0,0 +1,25 @@ +TERMUX_PKG_HOMEPAGE=https://gitlab.gnome.org/GNOME/gnome-session/ +TERMUX_PKG_DESCRIPTION="The GNOME session manager" +TERMUX_PKG_LICENSE="GPL-2.0-or-later" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="48.0" +TERMUX_PKG_SRCURL="https://download.gnome.org/sources/gnome-session/${TERMUX_PKG_VERSION%%.*}/gnome-session-$TERMUX_PKG_VERSION.tar.xz" +TERMUX_PKG_SHA256=dd909fbc5b22cdbdb2fc4df1a47d78d1b5943ccc5e61e6a20a1846246347c417 +TERMUX_PKG_DEPENDS="glib, gnome-desktop3, gtk3, json-glib, libice, libsm, libx11" +TERMUX_PKG_RECOMMENDS="gnome-shell" +TERMUX_PKG_BUILD_DEPENDS="glib-cross" +TERMUX_PKG_VERSIONED_GIR=false +# Should be bumped with gnome-shell +TERMUX_PKG_AUTO_UPDATE=false + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dsystemd=false +-Dsystemduserunitdir=$TERMUX_PKG_TMPDIR +" + +termux_step_pre_configure() { + termux_setup_gir + termux_setup_glib_cross_pkg_config_wrapper + + export TERMUX_MESON_ENABLE_SOVERSION=1 +} From 987425a22f960db6468955684bc7f14272036ac1 Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:47:43 +0800 Subject: [PATCH 07/20] new package: gnome-shell --- .../gnome-shell/0001-do-not-use-dlinfo.patch | 11 + .../gnome-shell/0002-use-gjs-option.patch | 37 +++ .../gnome-shell/0003-disable-polkit.patch | 95 ++++++ .../gnome-shell/0004-tagged-pointer.patch | 44 +++ .../gnome-shell/0101-disable-packagekit.patch | 23 ++ x11-packages/gnome-shell/build.sh | 36 +++ x11-packages/gnome-shell/gir/Gvc-1.0.xml | 129 ++++++++ x11-packages/gnome-shell/gir/Shell-16.xml | 216 +++++++++++++ x11-packages/gnome-shell/gir/Shew-0.xml | 9 + x11-packages/gnome-shell/gir/St-16.xml | 300 ++++++++++++++++++ 10 files changed, 900 insertions(+) create mode 100644 x11-packages/gnome-shell/0001-do-not-use-dlinfo.patch create mode 100644 x11-packages/gnome-shell/0002-use-gjs-option.patch create mode 100644 x11-packages/gnome-shell/0003-disable-polkit.patch create mode 100644 x11-packages/gnome-shell/0004-tagged-pointer.patch create mode 100644 x11-packages/gnome-shell/0101-disable-packagekit.patch create mode 100644 x11-packages/gnome-shell/build.sh create mode 100644 x11-packages/gnome-shell/gir/Gvc-1.0.xml create mode 100644 x11-packages/gnome-shell/gir/Shell-16.xml create mode 100644 x11-packages/gnome-shell/gir/Shew-0.xml create mode 100644 x11-packages/gnome-shell/gir/St-16.xml diff --git a/x11-packages/gnome-shell/0001-do-not-use-dlinfo.patch b/x11-packages/gnome-shell/0001-do-not-use-dlinfo.patch new file mode 100644 index 00000000000000..d5657d70d32f79 --- /dev/null +++ b/x11-packages/gnome-shell/0001-do-not-use-dlinfo.patch @@ -0,0 +1,11 @@ +--- a/meson.build ++++ b/meson.build +@@ -171,7 +171,7 @@ + cdata.set('HAVE_MALLINFO2', cc.has_function('mallinfo2')) + cdata.set('HAVE_SYS_RESOURCE_H', cc.has_header('sys/resource.h')) + cdata.set('HAVE_EXE_INTROSPECTION', +- cc.has_header('elf.h') and cc.has_header('link.h')) ++ cc.has_header('elf.h') and cc.has_header('link.h') and host_machine.system() != 'android') + cdata.set('HAVE__NL_TIME_FIRST_WEEKDAY', + cc.has_header_symbol('langinfo.h', '_NL_TIME_FIRST_WEEKDAY') + ) diff --git a/x11-packages/gnome-shell/0002-use-gjs-option.patch b/x11-packages/gnome-shell/0002-use-gjs-option.patch new file mode 100644 index 00000000000000..1124e7d36585ce --- /dev/null +++ b/x11-packages/gnome-shell/0002-use-gjs-option.patch @@ -0,0 +1,37 @@ +--- a/meson.build ++++ b/meson.build +@@ -145,7 +145,10 @@ + + mutter_typelibdir = mutter_dep.get_variable('typelibdir') + python = find_program('python3') +-gjs = find_program('gjs') ++gjs_path = get_option('gjs_path') ++if gjs_path == '' ++ gjs_path = find_program('gjs').full_path() ++endif + generate_app_list = find_program('meson/generate-app-list.py') + + cc = meson.get_compiler('c') +--- a/meson.options ++++ b/meson.options +@@ -51,3 +51,9 @@ + value: true, + description: 'Enable systemd integration' + ) ++ ++option('gjs_path', ++ type: 'string', ++ value: '', ++ description: 'The path to gjs' ++) +--- a/js/dbusServices/meson.build ++++ b/js/dbusServices/meson.build +@@ -22,7 +22,7 @@ + + serviceconf = configuration_data() + serviceconf.set('service', service) +- serviceconf.set('gjs', gjs.full_path()) ++ serviceconf.set('gjs', gjs_path) + serviceconf.set('pkgdatadir', pkgdatadir) + + configure_file( diff --git a/x11-packages/gnome-shell/0003-disable-polkit.patch b/x11-packages/gnome-shell/0003-disable-polkit.patch new file mode 100644 index 00000000000000..5694accbfb6e7e --- /dev/null +++ b/x11-packages/gnome-shell/0003-disable-polkit.patch @@ -0,0 +1,95 @@ +--- a/meson.options ++++ b/meson.options +@@ -57,3 +57,9 @@ + value: '', + description: 'The path to gjs' + ) ++ ++option('polkit', ++ type: 'boolean', ++ value: true, ++ description: 'Enable polkit support' ++) +--- a/meson.build ++++ b/meson.build +@@ -83,7 +83,11 @@ + mtk_dep = dependency(mtk_pc, version: mutter_req) + cogl_dep = dependency(cogl_pc, version: mutter_req) + mutter_dep = dependency(libmutter_pc, version: mutter_req) ++if get_option('polkit') + polkit_dep = dependency('polkit-agent-1', version: polkit_req) ++else ++polkit_dep = dependency('', required : false) ++endif + schemas_dep = dependency('gsettings-desktop-schemas', version: schemas_req) + gnome_desktop_dep = dependency('gnome-desktop-4', version: gnome_desktop_req) + pango_dep = dependency('pango', version: pango_req) +@@ -173,6 +177,7 @@ + cc.has_function('fdwalk') + ) + ++cdata.set('HAVE_POLKIT_SUPPORT', get_option('polkit')) + polkit_has_autocleanup = cc.compiles( + ''' + #define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE +--- a/config.h.meson ++++ b/config.h.meson +@@ -45,3 +45,6 @@ + + /* Whether GNOME Shell is built with X11 clients support */ + #mesondefine HAVE_X11_CLIENT ++ ++/* Whether GNOME Shell is built with polkit support */ ++#mesondefine HAVE_POLKIT_SUPPORT +--- a/src/shell-polkit-authentication-agent.h ++++ b/src/shell-polkit-authentication-agent.h +@@ -8,6 +8,9 @@ + + #pragma once + ++#include "config.h" ++#ifdef HAVE_POLKIT_SUPPORT ++ + #define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE + #include + #include +@@ -32,3 +35,5 @@ + void shell_polkit_authentication_agent_unregister (ShellPolkitAuthenticationAgent *agent); + + G_END_DECLS ++ ++#endif +--- a/src/shell-polkit-authentication-agent.c ++++ b/src/shell-polkit-authentication-agent.c +@@ -8,6 +8,8 @@ + + #include "config.h" + ++#ifdef HAVE_POLKIT_SUPPORT ++ + #include + + #include "shell-polkit-authentication-agent.h" +@@ -427,3 +429,5 @@ + + auth_request_complete (agent->current_request, dismissed); + } ++ ++#endif +--- a/src/meson.build ++++ b/src/meson.build +@@ -257,10 +257,13 @@ + 'Clutter-@0@'.format(mutter_api_version), + 'Meta-@0@'.format(mutter_api_version), + 'Gcr-4', +- 'PolkitAgent-1.0', + 'GdkPixbuf-2.0' + ] + ++if get_option('polkit') ++ libshell_gir_includes += ['PolkitAgent-1.0'] ++endif ++ + if have_networkmanager + libshell_gir_includes += ['NM-1.0'] + endif diff --git a/x11-packages/gnome-shell/0004-tagged-pointer.patch b/x11-packages/gnome-shell/0004-tagged-pointer.patch new file mode 100644 index 00000000000000..b7e0bda95f3f11 --- /dev/null +++ b/x11-packages/gnome-shell/0004-tagged-pointer.patch @@ -0,0 +1,44 @@ +--- a/src/main.c ++++ b/src/main.c +@@ -25,6 +25,32 @@ + #include + #endif + ++#ifdef __TERMUX__ ++#include ++#include ++static void android_disable_tags() { ++ void *lib_handle = dlopen("libc.so", RTLD_LAZY); ++ if (lib_handle) { ++ if (android_get_device_api_level() >= 31) { ++ int (*mallopt_func)(int, int) = dlsym(lib_handle, "mallopt"); ++ if (mallopt_func) { ++ mallopt_func(M_BIONIC_SET_HEAP_TAGGING_LEVEL, 0); ++ } ++ return; ++ } ++ /* android_get_device_api_level() < 31 */ ++ bool (*android_mallopt)(int opcode, void* arg, size_t arg_size) = dlsym(lib_handle, "android_mallopt"); ++ if (android_mallopt) { ++ int android_malloc_tag_level = 0; ++ android_mallopt(8, &android_malloc_tag_level, sizeof(android_malloc_tag_level)); ++ } ++ dlclose(lib_handle); ++ } ++} ++#else ++static void android_disable_tags(){} ++#endif ++ + #include "shell-global.h" + #include "shell-global-private.h" + #include "shell-perf-log.h" +@@ -598,6 +624,8 @@ + GError *error = NULL; + int ecode = EXIT_SUCCESS; + ++ android_disable_tags(); ++ + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); diff --git a/x11-packages/gnome-shell/0101-disable-packagekit.patch b/x11-packages/gnome-shell/0101-disable-packagekit.patch new file mode 100644 index 00000000000000..929c834ff69968 --- /dev/null +++ b/x11-packages/gnome-shell/0101-disable-packagekit.patch @@ -0,0 +1,23 @@ +It is much difficult to port packagekit to Termux + +--- a/js/ui/endSessionDialog.js ++++ b/js/ui/endSessionDialog.js +@@ -240,10 +240,14 @@ + this._user = this._userManager.get_user(GLib.get_user_name()); + this._updatesPermission = null; + +- this._pkOfflineProxy = new PkOfflineProxy(Gio.DBus.system, +- 'org.freedesktop.PackageKit', +- '/org/freedesktop/PackageKit', +- this._onPkOfflineProxyCreated.bind(this)); ++ try { ++ this._pkOfflineProxy = new PkOfflineProxy(Gio.DBus.system, ++ 'org.freedesktop.PackageKit', ++ '/org/freedesktop/PackageKit', ++ this._onPkOfflineProxyCreated.bind(this)); ++ } catch (error) { ++ log(`Failed to connect to PackageKit: ${error.message}`); ++ } + + this._powerProxy = new UPowerProxy(Gio.DBus.system, + 'org.freedesktop.UPower', diff --git a/x11-packages/gnome-shell/build.sh b/x11-packages/gnome-shell/build.sh new file mode 100644 index 00000000000000..dc9ea4c7ea4bed --- /dev/null +++ b/x11-packages/gnome-shell/build.sh @@ -0,0 +1,36 @@ +TERMUX_PKG_HOMEPAGE=https://wiki.gnome.org/Projects/GnomeShell +TERMUX_PKG_DESCRIPTION="GNOME shell" +TERMUX_PKG_LICENSE="GPL-2.0-or-later" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="48.1" +TERMUX_PKG_SRCURL="https://download.gnome.org/sources/gnome-shell/${TERMUX_PKG_VERSION%%.*}/gnome-shell-$TERMUX_PKG_VERSION.tar.xz" +TERMUX_PKG_SHA256=ba4f455afd6213f387545946e3cd9daa39c904f7ab16dd830ac77a73ff1002ca +TERMUX_PKG_DEPENDS="atk, evolution-data-server, gcr4, gdk-pixbuf, gjs, glib, gnome-desktop4, gnome-session, gobject-introspection, graphene, gsettings-desktop-schemas, libx11, libxfixes, libxml2, mutter, pango, pulseaudio" +TERMUX_PKG_BUILD_DEPENDS="g-ir-scanner, glib-cross" +TERMUX_PKG_VERSIONED_GIR=false + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dpolkit=false +-Dnetworkmanager=false +-Dportal_helper=false +-Dcamera_monitor=false +-Dsystemd=false +-Dgjs_path=$TERMUX_PREFIX/bin/gjs +-Dextensions_tool=false +-Dextensions_app=false +-Dtests=false +" + +termux_step_pre_configure() { + # Runtime deps through gobject-introspection + TERMUX_PKG_DEPENDS+=", accountsservice, gdm, ibus, libgweather, upower" + + # Runtime deps through dbus + # TODO: Port packagekit to Termux + # TERMUX_PKG_DEPENDS+=", packagekit" + + termux_setup_gir + termux_setup_glib_cross_pkg_config_wrapper + + export TERMUX_MESON_ENABLE_SOVERSION=1 +} diff --git a/x11-packages/gnome-shell/gir/Gvc-1.0.xml b/x11-packages/gnome-shell/gir/Gvc-1.0.xml new file mode 100644 index 00000000000000..0699b6b05d91bb --- /dev/null +++ b/x11-packages/gnome-shell/gir/Gvc-1.0.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x11-packages/gnome-shell/gir/Shell-16.xml b/x11-packages/gnome-shell/gir/Shell-16.xml new file mode 100644 index 00000000000000..312960a88f0bd1 --- /dev/null +++ b/x11-packages/gnome-shell/gir/Shell-16.xml @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x11-packages/gnome-shell/gir/Shew-0.xml b/x11-packages/gnome-shell/gir/Shew-0.xml new file mode 100644 index 00000000000000..2a0e86a431ac50 --- /dev/null +++ b/x11-packages/gnome-shell/gir/Shew-0.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/x11-packages/gnome-shell/gir/St-16.xml b/x11-packages/gnome-shell/gir/St-16.xml new file mode 100644 index 00000000000000..43b2ab02440cc5 --- /dev/null +++ b/x11-packages/gnome-shell/gir/St-16.xml @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From f3bea3eabdcf7f108ceff45423ec3d7a1e531081 Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:52:40 +0800 Subject: [PATCH 08/20] new package: consolekit2 --- .../consolekit2/0001-missing-macros.patch | 14 ++++++++ x11-packages/consolekit2/0002-setuid.patch | 34 +++++++++++++++++++ x11-packages/consolekit2/build.sh | 26 ++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 x11-packages/consolekit2/0001-missing-macros.patch create mode 100644 x11-packages/consolekit2/0002-setuid.patch create mode 100644 x11-packages/consolekit2/build.sh diff --git a/x11-packages/consolekit2/0001-missing-macros.patch b/x11-packages/consolekit2/0001-missing-macros.patch new file mode 100644 index 00000000000000..eec9961c9b9c68 --- /dev/null +++ b/x11-packages/consolekit2/0001-missing-macros.patch @@ -0,0 +1,14 @@ +--- a/src/ck-session.c ++++ b/src/ck-session.c +@@ -1591,9 +1591,11 @@ + g_warning ("failed to return control of vt handling"); + } + ++#if defined(KDSETMODE) && defined(KD_TEXT) + if (ioctl (session->priv->tty_fd, KDSETMODE, KD_TEXT) < 0) { + g_warning ("failed to return to text mode for the VT"); + } ++#endif + + g_source_remove (session->priv->sig_watch_s1); + session->priv->sig_watch_s1 = 0; diff --git a/x11-packages/consolekit2/0002-setuid.patch b/x11-packages/consolekit2/0002-setuid.patch new file mode 100644 index 00000000000000..597382a60d6347 --- /dev/null +++ b/x11-packages/consolekit2/0002-setuid.patch @@ -0,0 +1,34 @@ +--- a/tools/ck-collect-session-info.c ++++ b/tools/ck-collect-session-info.c +@@ -82,7 +82,15 @@ + + /* set the group */ + errno = 0; ++#ifdef __TERMUX__ ++ if (getuid() == 0) { ++ res = setgid (pwent->pw_gid); ++ } else { ++ res = (getgid() == pwent->pw_gid) ? 0 : -1; ++ } ++#else + res = setgid (pwent->pw_gid); ++#endif + if (res == -1) { + g_warning ("Error performing setgid: %s", g_strerror (errno)); + exit (1); +@@ -90,7 +98,15 @@ + + /* become the user */ + errno = 0; ++#ifdef __TERMUX__ ++ if (getuid() == 0) { ++ res = setuid (si->uid); ++ } else { ++ res = (getuid() == si->uid) ? 0 : -1; ++ } ++#else + res = setuid (si->uid); ++#endif + if (res == -1) { + g_warning ("Error performing setuid: %s", g_strerror (errno)); + exit (1); diff --git a/x11-packages/consolekit2/build.sh b/x11-packages/consolekit2/build.sh new file mode 100644 index 00000000000000..70d2c5d3c9c989 --- /dev/null +++ b/x11-packages/consolekit2/build.sh @@ -0,0 +1,26 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/ConsoleKit2/ConsoleKit2 +TERMUX_PKG_DESCRIPTION="A framework for defining and tracking users, login sessions, and seats" +TERMUX_PKG_LICENSE="GPL-2.0" +TERMUX_PKG_MAINTAINER="@termux" +# Need the compact layer of sd_login_monitor for accountsservice +_COMMIT=c5d4aa68c27171931e401e249a84d4d4d2ce8b3c +TERMUX_PKG_VERSION="2.0.0~dev" +TERMUX_PKG_SRCURL="https://github.com/ConsoleKit2/ConsoleKit2/archive/$_COMMIT.zip" +TERMUX_PKG_SHA256=4ddee267042537488ba8868b0336ddea5f9fada05bf276617d5cb3dfb1c7cdfc +TERMUX_PKG_DEPENDS="dbus, glib" +TERMUX_PKG_BUILD_DEPENDS="glib-cross" +TERMUX_PKG_AUTO_UPDATE=false +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +--with-rundir=$TERMUX_PREFIX/var/run +--disable-polkit +--disable-libdrm +--disable-libevdev +--disable-libudev +--enable-pam-module=no +ac_cv_file__sys_class_tty_tty0_active=no +--with-systemdsystemunitdir=no +" + +termux_step_pre_configure() { + autoreconf -fi +} From 43fe487fff02256952aecffb09456b5bae31d1cf Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:54:18 +0800 Subject: [PATCH 09/20] new package: polkit --- .../polkit/0001-disable-pidfd_open.patch | 11 +++ x11-packages/polkit/build.sh | 23 +++++ x11-packages/polkit/gir/Polkit-1.0.xml | 88 +++++++++++++++++++ x11-packages/polkit/gir/PolkitAgent-1.0.xml | 35 ++++++++ 4 files changed, 157 insertions(+) create mode 100644 x11-packages/polkit/0001-disable-pidfd_open.patch create mode 100644 x11-packages/polkit/build.sh create mode 100644 x11-packages/polkit/gir/Polkit-1.0.xml create mode 100644 x11-packages/polkit/gir/PolkitAgent-1.0.xml diff --git a/x11-packages/polkit/0001-disable-pidfd_open.patch b/x11-packages/polkit/0001-disable-pidfd_open.patch new file mode 100644 index 00000000000000..016e797aab64d7 --- /dev/null +++ b/x11-packages/polkit/0001-disable-pidfd_open.patch @@ -0,0 +1,11 @@ +--- a/meson.build ++++ b/meson.build +@@ -207,7 +207,7 @@ + endif + config_data.set('HAVE_LIBSYSTEMD', enable_logind) + +-config_data.set('HAVE_PIDFD_OPEN', cc.get_define('SYS_pidfd_open', prefix: '#include ') != '') ++config_data.set('HAVE_PIDFD_OPEN', cc.get_define('SYS_pidfd_open', prefix: '#include ') != '' and host_machine.system() != 'android') + + # systemd unit / sysuser / tmpfiles.d file installation directories + systemdsystemunitdir = get_option('systemdsystemunitdir') diff --git a/x11-packages/polkit/build.sh b/x11-packages/polkit/build.sh new file mode 100644 index 00000000000000..a00cb849571fce --- /dev/null +++ b/x11-packages/polkit/build.sh @@ -0,0 +1,23 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/polkit-org/polkit +TERMUX_PKG_DESCRIPTION="Toolkit for defining and handling authorizations" +TERMUX_PKG_LICENSE="GPL-2.0-or-later" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="126" +TERMUX_PKG_SRCURL="https://github.com/polkit-org/polkit/archive/refs/tags/$TERMUX_PKG_VERSION.tar.gz" +TERMUX_PKG_SHA256=2814a7281989f6baa9e57bd33bbc5e148827e2721ccef22aaf28ab2b376068e8 +TERMUX_PKG_DEPENDS="glib, gobject-introspection, libcrypt" +TERMUX_PKG_BUILD_DEPENDS="g-ir-scanner, glib-cross" +TERMUX_PKG_VERSIONED_GIR=false +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dintrospection=true +-Dlibs-only=true +-Dsession_tracking=ConsoleKit +-Dauthfw=shadow +" + +termux_step_pre_configure() { + termux_setup_gir + termux_setup_glib_cross_pkg_config_wrapper + + export TERMUX_MESON_ENABLE_SOVERSION=1 +} diff --git a/x11-packages/polkit/gir/Polkit-1.0.xml b/x11-packages/polkit/gir/Polkit-1.0.xml new file mode 100644 index 00000000000000..0ff4ab44901b65 --- /dev/null +++ b/x11-packages/polkit/gir/Polkit-1.0.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x11-packages/polkit/gir/PolkitAgent-1.0.xml b/x11-packages/polkit/gir/PolkitAgent-1.0.xml new file mode 100644 index 00000000000000..104813e5ef6ef2 --- /dev/null +++ b/x11-packages/polkit/gir/PolkitAgent-1.0.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 3071616b562f25ef98b0f91412edca98724465e8 Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:55:14 +0800 Subject: [PATCH 10/20] new package: accountsservice --- .../accountsservice/0001-option-tests.patch | 20 ++++ .../0002-get-wtmp-from-option.patch | 47 ++++++++ .../0003-option-install-policy.patch | 26 +++++ .../0004-use-consolekit2.patch | 66 +++++++++++ .../0005-shadow-struct-spwd.patch | 110 ++++++++++++++++++ x11-packages/accountsservice/build.sh | 32 +++++ .../gir/AccountsService-1.0.xml | 63 ++++++++++ 7 files changed, 364 insertions(+) create mode 100644 x11-packages/accountsservice/0001-option-tests.patch create mode 100644 x11-packages/accountsservice/0002-get-wtmp-from-option.patch create mode 100644 x11-packages/accountsservice/0003-option-install-policy.patch create mode 100644 x11-packages/accountsservice/0004-use-consolekit2.patch create mode 100644 x11-packages/accountsservice/0005-shadow-struct-spwd.patch create mode 100644 x11-packages/accountsservice/build.sh create mode 100644 x11-packages/accountsservice/gir/AccountsService-1.0.xml diff --git a/x11-packages/accountsservice/0001-option-tests.patch b/x11-packages/accountsservice/0001-option-tests.patch new file mode 100644 index 00000000000000..de25aed0d8e1cb --- /dev/null +++ b/x11-packages/accountsservice/0001-option-tests.patch @@ -0,0 +1,20 @@ +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -14,3 +14,5 @@ + + option('docbook', type: 'boolean', value: false, description: 'build documentation (requires xmlto)') + option('gtk_doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation') ++ ++option('tests', type: 'boolean', value: true, description: 'Enable tests') +--- a/meson.build ++++ b/meson.build +@@ -238,7 +238,9 @@ + subdir('doc/libaccountsservice') + endif + ++if get_option('tests') + subdir('tests') ++endif + + configure_file( + output: 'config.h', diff --git a/x11-packages/accountsservice/0002-get-wtmp-from-option.patch b/x11-packages/accountsservice/0002-get-wtmp-from-option.patch new file mode 100644 index 00000000000000..aa0b37e2585111 --- /dev/null +++ b/x11-packages/accountsservice/0002-get-wtmp-from-option.patch @@ -0,0 +1,47 @@ +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -15,3 +15,5 @@ + option('gtk_doc', type: 'boolean', value: false, description: 'use gtk-doc to build documentation') + + option('tests', type: 'boolean', value: true, description: 'Enable tests') ++ ++option('path_wtmp', type: 'string', value: '', description: 'The path to watch for wtmp changes') +--- a/meson.build ++++ b/meson.build +@@ -63,7 +63,9 @@ + ] + + foreach header: check_headers ++ if host_machine.system() != 'android' + config_h.set('HAVE_' + header.underscorify().to_upper(), cc.has_header(header)) ++ endif + endforeach + + # functions +@@ -77,7 +77,10 @@ + config_h.set('HAVE_' + func.underscorify().to_upper(), cc.has_function(func)) + endforeach + +-if cc.has_header_symbol('utmpx.h', 'WTMPX_FILENAME', prefix: '#define _GNU_SOURCE') ++path_wtmp = get_option('path_wtmp') ++if path_wtmp != '' ++ config_h.set_quoted('PATH_WTMP', path_wtmp) ++elif cc.has_header_symbol('utmpx.h', 'WTMPX_FILENAME', prefix: '#define _GNU_SOURCE') + code = '''#define _GNU_SOURCE + #include + #include +--- a/src/wtmp-helper.c ++++ b/src/wtmp-helper.c +@@ -215,6 +215,12 @@ + + #else /* HAVE_UTMPX_H */ + ++void ++wtmp_helper_update_login_frequencies (GHashTable *users) ++{ ++ // Stub it ++} ++ + const gchar * + wtmp_helper_get_path_for_monitor (void) + { diff --git a/x11-packages/accountsservice/0003-option-install-policy.patch b/x11-packages/accountsservice/0003-option-install-policy.patch new file mode 100644 index 00000000000000..1428961082e126 --- /dev/null +++ b/x11-packages/accountsservice/0003-option-install-policy.patch @@ -0,0 +1,26 @@ +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -18,3 +18,5 @@ + option('tests', type: 'boolean', value: true, description: 'Enable tests') + + option('path_wtmp', type: 'string', value: '', description: 'The path to watch for wtmp changes') ++ ++option('install_policy', type: 'boolean', value: true, description: 'Install policy file') +--- a/data/meson.build ++++ b/data/meson.build +@@ -32,6 +32,7 @@ + + policy = act_namespace.to_lower() + '.policy' + ++if get_option('install_policy') + i18n.merge_file( + input: policy + '.in', + output: policy, +@@ -39,6 +40,7 @@ + install: true, + install_dir: policy_dir, + ) ++endif + + if install_systemd_unit_dir + service = 'accounts-daemon.service' diff --git a/x11-packages/accountsservice/0004-use-consolekit2.patch b/x11-packages/accountsservice/0004-use-consolekit2.patch new file mode 100644 index 00000000000000..3d391390dd777a --- /dev/null +++ b/x11-packages/accountsservice/0004-use-consolekit2.patch @@ -0,0 +1,66 @@ +https://gitlab.freedesktop.org/arrowd/accountsservice/-/commit/ead069eb165f88d24426d9ec33fa5248ca4e4e4b + +--- a/meson.build ++++ b/meson.build +@@ -216,8 +216,11 @@ config_h.set_quoted('PATH_LIGHTDM_CONF', lightdm_conf_file) + + if get_option('elogind') + logind_dep = dependency('libelogind', version: '>= 229.4') ++elif get_option('consolekit') ++ logind_dep = dependency('libconsolekit', version: '>= 1.2.0') ++ config_h.set('CONSOLEKIT', 1) + else +- logind_dep = dependency('libsystemd', version: '>= 186') ++ logind_dep = dependency('libsystemd', version: '>= 186', required: false) + endif + + subdir('data') +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -6,7 +6,8 @@ option('admin_group', type: 'string', value: '', description: 'Set group for adm + option('extra_admin_groups', type: 'array', value: [], description: 'Comma-separated list of extra groups that administrator users are part of') + option('minimum_uid', type: 'integer', value: 1000, description: 'Set minimum uid for human users') + +-option('elogind', type: 'boolean', value: false, description: 'Use elogind') ++option('elogind', type: 'boolean', value: false, description: 'Use elogind as login manager') ++option('consolekit', type: 'boolean', value: false, description: 'Use consolekit as login manager') + + option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build') + option('vapi', type: 'boolean', value: true, description : 'Enable Vala bindings for this build') +--- a/src/libaccountsservice/act-user-manager.c ++++ b/src/libaccountsservice/act-user-manager.c +@@ -40,7 +40,21 @@ + #include + #include + #include ++ ++#ifndef CONSOLEKIT + #include ++#define LOGIN_SERVICE "org.freedesktop.login1" ++#define LOGIN_OBJECT "/org/freedesktop/login1" ++#define LOGIN_IFACE "org.freedesktop.login1.Manager" ++#else ++#include ++#define LOGIN_SERVICE "org.freedesktop.ConsoleKit" ++#define LOGIN_OBJECT "/org/freedesktop/ConsoleKit/Manager" ++#define LOGIN_IFACE "org.freedesktop.ConsoleKit.Manager" ++#ifndef ENODATA ++#define ENODATA 9919 ++#endif ++#endif + + #include "act-user-manager.h" + #include "act-user-private.h" +@@ -276,9 +290,9 @@ activate_systemd_session_id (ActUserManager *manager, + } + + reply = g_dbus_connection_call_sync (connection, +- "org.freedesktop.login1", +- "/org/freedesktop/login1", +- "org.freedesktop.login1.Manager", ++ LOGIN_SERVICE, ++ LOGIN_OBJECT, ++ LOGIN_IFACE, + "ActivateSessionOnSeat", + g_variant_new ("(ss)", + seat_id, diff --git a/x11-packages/accountsservice/0005-shadow-struct-spwd.patch b/x11-packages/accountsservice/0005-shadow-struct-spwd.patch new file mode 100644 index 00000000000000..716386e3179294 --- /dev/null +++ b/x11-packages/accountsservice/0005-shadow-struct-spwd.patch @@ -0,0 +1,110 @@ +--- a/src/user.h ++++ b/src/user.h +@@ -23,6 +23,8 @@ + #include + #ifdef HAVE_SHADOW_H + #include ++#else ++struct spwd {}; + #endif + + #include +--- a/src/user.c ++++ b/src/user.c +@@ -468,8 +468,10 @@ + accounts_user_set_shell (ACCOUNTS_USER (user), pwent->pw_shell); + + passwd = NULL; ++#ifdef HAVE_SHADOW_H + if (spent) + passwd = spent->sp_pwdp; ++#endif + + if (passwd && passwd[0] == '!') { + locked = TRUE; +@@ -485,6 +487,7 @@ + mode = PASSWORD_MODE_NONE; + } + ++#ifdef HAVE_SHADOW_H + if (spent) { + if (spent->sp_lstchg == 0) { + mode = PASSWORD_MODE_SET_AT_LOGIN; +@@ -504,6 +507,7 @@ + user->days_after_expiration_until_lock = spent->sp_inact; + user->account_expiration_policy_known = TRUE; + } ++#endif + + accounts_user_set_password_mode (ACCOUNTS_USER (user), mode); + is_system_account = !user_classify_is_human (accounts_user_get_uid (ACCOUNTS_USER (user)), +--- a/src/daemon.c ++++ b/src/daemon.c +@@ -262,11 +262,15 @@ + + shadow_entry_buffers = g_malloc0 (sizeof(*shadow_entry_buffers)); + ++#ifdef HAVE_SHADOW_H + ret = fgetspent_r (fp, &shadow_entry_buffers->spbuf, shadow_entry_buffers->buf, sizeof(shadow_entry_buffers->buf), &shadow_entry); + if (ret == 0) { + g_hash_table_insert (shadow_users, g_strdup (shadow_entry->sp_namp), shadow_entry_buffers); + g_hash_table_add (local_users, g_strdup (shadow_entry->sp_namp)); + } else { ++#else ++ if (1) { ++#endif + g_free (shadow_entry_buffers); + + if (errno != EINTR) { +@@ -376,7 +380,9 @@ + errno = 0; + pwent = getpwnam (name); + if (pwent != NULL) { ++#ifdef HAVE_SHADOW_H + *shadow_entry = getspnam (pwent->pw_name); ++#endif + + return pwent; + } else if (errno == 0) { +@@ -447,7 +453,9 @@ + if (pwent == NULL) { + g_debug ("user '%s' requested previously but not present on system", name); + } else { ++#ifdef HAVE_SHADOW_H + *shadow_entry = getspnam (pwent->pw_name); ++#endif + + return pwent; + } +@@ -1012,6 +1020,7 @@ + + user = g_hash_table_lookup (priv->users, pwent->pw_name); + ++#ifdef HAVE_SHADOW_H + if (user == NULL) { + struct spwd *spent; + spent = getspnam (pwent->pw_name); +@@ -1020,6 +1029,7 @@ + priv->explicitly_requested_users = g_list_append (priv->explicitly_requested_users, + g_strdup (pwent->pw_name)); + } ++#endif + + return user; + } +@@ -1040,6 +1050,7 @@ + + user = g_hash_table_lookup (priv->users, pwent->pw_name); + ++#ifdef HAVE_SHADOW_H + if (user == NULL) { + struct spwd *spent; + spent = getspnam (pwent->pw_name); +@@ -1048,6 +1059,7 @@ + priv->explicitly_requested_users = g_list_append (priv->explicitly_requested_users, + g_strdup (pwent->pw_name)); + } ++#endif + + return user; + } diff --git a/x11-packages/accountsservice/build.sh b/x11-packages/accountsservice/build.sh new file mode 100644 index 00000000000000..a3402dcb5dede6 --- /dev/null +++ b/x11-packages/accountsservice/build.sh @@ -0,0 +1,32 @@ +TERMUX_PKG_HOMEPAGE=https://gitlab.freedesktop.org/accountsservice/accountsservice/ +TERMUX_PKG_DESCRIPTION="D-Bus interface for user account query and manipulation" +TERMUX_PKG_LICENSE="GPL-3.0-only" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="23.13.9" +TERMUX_PKG_SRCURL="https://www.freedesktop.org/software/accountsservice/accountsservice-$TERMUX_PKG_VERSION.tar.xz" +TERMUX_PKG_SHA256=adda4cdeae24fa0992e7df3ffff9effa7090be3ac233a3edfdf69d5a9c9b924f +TERMUX_PKG_DEPENDS="consolekit2, dbus, glib, gobject-introspection, libcrypt, polkit" +TERMUX_PKG_BUILD_DEPENDS="g-ir-scanner, glib-cross" +TERMUX_PKG_VERSIONED_GIR=false +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dconsolekit=true +-Dintrospection=true +-Dvapi=false +-Dtests=false +-Dsystemdsystemunitdir=no +-Dpath_wtmp=/dev/null +-Dinstall_policy=false +" + +termux_step_post_get_source() { + echo "#!/usr/bin/env sh" > generate-version.sh + echo "echo \"$TERMUX_PKG_VERSION\"" >> generate-version.sh + chmod +x generate-version.sh +} + +termux_step_pre_configure() { + termux_setup_gir + termux_setup_glib_cross_pkg_config_wrapper + + export TERMUX_MESON_ENABLE_SOVERSION=1 +} diff --git a/x11-packages/accountsservice/gir/AccountsService-1.0.xml b/x11-packages/accountsservice/gir/AccountsService-1.0.xml new file mode 100644 index 00000000000000..3428e73813ec82 --- /dev/null +++ b/x11-packages/accountsservice/gir/AccountsService-1.0.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 1083b85f8a4524888d47f0ccfddba95062c98e40 Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:56:22 +0800 Subject: [PATCH 11/20] new package: gdm --- x11-packages/gdm/0001-udev-not-required.patch | 30 ++ x11-packages/gdm/0002-dummy-pam.patch | 118 +++++++ x11-packages/gdm/0003-dummy-logind.patch | 187 +++++++++++ x11-packages/gdm/0004-optional-dconf.patch | 11 + x11-packages/gdm/0004-sys-kd.patch | 42 +++ x11-packages/gdm/0005-no-setuid.patch | 11 + x11-packages/gdm/build.sh | 30 ++ x11-packages/gdm/gir/Gdm-1.0.xml | 291 ++++++++++++++++++ 8 files changed, 720 insertions(+) create mode 100644 x11-packages/gdm/0001-udev-not-required.patch create mode 100644 x11-packages/gdm/0002-dummy-pam.patch create mode 100644 x11-packages/gdm/0003-dummy-logind.patch create mode 100644 x11-packages/gdm/0004-optional-dconf.patch create mode 100644 x11-packages/gdm/0004-sys-kd.patch create mode 100644 x11-packages/gdm/0005-no-setuid.patch create mode 100644 x11-packages/gdm/build.sh create mode 100644 x11-packages/gdm/gir/Gdm-1.0.xml diff --git a/x11-packages/gdm/0001-udev-not-required.patch b/x11-packages/gdm/0001-udev-not-required.patch new file mode 100644 index 00000000000000..2e2de67f8c333d --- /dev/null +++ b/x11-packages/gdm/0001-udev-not-required.patch @@ -0,0 +1,30 @@ +--- a/meson.build ++++ b/meson.build +@@ -48,8 +48,8 @@ + endif + + # Dependencies +-udev_dep = dependency('udev') +-gudev_dep = dependency('gudev-1.0', version: '>= 232') ++udev_dep = dependency('udev', required: false) ++gudev_dep = dependency('gudev-1.0', version: '>= 232', required: false) + + # PAM + libpam_dep = cc.find_library('pam') + +--- a/daemon/gdm-local-display-factory.c ++++ b/daemon/gdm-local-display-factory.c +@@ -1455,11 +1455,13 @@ gdm_local_display_factory_start_monitor (GdmLocalDisplayFactory *factory) + static void + gdm_local_display_factory_stop_monitor (GdmLocalDisplayFactory *factory) + { ++#ifdef HAVE_UDEV + if (factory->uevent_handler_id) { + g_signal_handler_disconnect (factory->gudev_client, factory->uevent_handler_id); + factory->uevent_handler_id = 0; + } + g_clear_object (&factory->gudev_client); ++#endif + + if (factory->seat_new_id) { + g_dbus_connection_signal_unsubscribe (factory->connection, diff --git a/x11-packages/gdm/0002-dummy-pam.patch b/x11-packages/gdm/0002-dummy-pam.patch new file mode 100644 index 00000000000000..fa31cc1c8ba252 --- /dev/null +++ b/x11-packages/gdm/0002-dummy-pam.patch @@ -0,0 +1,118 @@ +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -15,6 +15,7 @@ + option('libaudit', type: 'feature', value: 'auto', description: 'Add Linux audit support.') + option('logind-provider', type: 'combo', choices: ['systemd', 'elogind'], value: 'systemd', description: 'Which logind library to use.') + option('log-dir', type: 'string', value: '/var/log/gdm', description: 'Log directory.') ++option('dummy-pam', type: 'boolean', value: false, description: 'Use PAM stubs.') + option('pam-mod-dir', type: 'string', value: '', description: 'Directory to install PAM modules in.') + option('pam-prefix', type: 'string', value: '', description: 'Specify where PAM files go.') + option('pid-file', type: 'string', value: '', description: 'Pid file.') +--- a/meson.build ++++ b/meson.build +@@ -52,7 +52,7 @@ + gudev_dep = dependency('gudev-1.0', version: '>= 232', required: false) + + # PAM +-libpam_dep = cc.find_library('pam') ++libpam_dep = cc.find_library('pam', required: not get_option('dummy-pam')) + pam_extensions_supported = cc.has_header_symbol( + 'security/pam_appl.h', 'PAM_BINARY_PROMPT', + dependencies: libpam_dep) +@@ -276,6 +276,7 @@ conf.set('HAVE_UPDWTMPX', cc.has_function('updwtmpx')) + conf.set('HAVE_LOGIN', cc.has_function('login', args: '-lutil')) + conf.set('HAVE_LOGOUT', cc.has_function('logout', args: '-lutil')) + conf.set('HAVE_LOGWTMP', cc.has_function('logwtmp', args: '-lutil')) ++conf.set('WITH_DUMMY_PAM', get_option('dummy-pam')) + conf.set('HAVE_PAM_SYSLOG', have_pam_syslog) + conf.set('HAVE_KEYUTILS', keyutils_dep.found()) + conf.set('SUPPORTS_PAM_EXTENSIONS', pam_extensions_supported) +@@ -319,7 +321,9 @@ + subdir('daemon') + subdir('libgdm') + subdir('utils') ++if not get_option('dummy-pam') + subdir('pam_gdm') ++endif + subdir('po') + if libcheck_dep.found() + subdir('tests') +--- a/daemon/gdm-session-worker.c ++++ b/daemon/gdm-session-worker.c +@@ -37,7 +37,60 @@ + #include + #include + ++#ifndef WITH_DUMMY_PAM + #include ++#else ++typedef int pam_handle_t; ++struct pam_message { ++ char *msg; ++ int msg_style; ++}; ++struct pam_response { ++ char *resp; ++ int resp_retcode; ++}; ++struct pam_conv { ++ void *conv; ++ void *appdata_ptr; ++}; ++#define pam_get_item(...) (-1) ++#define pam_strerror(...) ("") ++#define pam_start(...) (-1) ++#define pam_set_item(...) (-1) ++#define pam_authenticate(...) (-1) ++#define pam_acct_mgmt(...) (-1) ++#define pam_chauthtok(...) (-1) ++#define pam_putenv(...) (-1) ++#define pam_setcred(...) (-1) ++#define pam_open_session(...) (-1) ++#define pam_getenv(...) (NULL) ++#define pam_getenvlist(...) (NULL) ++#define pam_close_session(...) ++#define pam_end(...) ++#define PAM_PROMPT_ECHO_ON 1 ++#define PAM_PROMPT_ECHO_OFF 2 ++#define PAM_TEXT_INFO 3 ++#define PAM_ERROR_MSG 4 ++#define PAM_SUCCESS 5 ++#define PAM_IGNORE 6 ++#define PAM_ACCT_EXPIRED 7 ++#define PAM_AUTHTOK_EXPIRED 8 ++#define PAM_MAXTRIES 9 ++#define PAM_CONV_ERR 10 ++#define PAM_MAX_RESP_SIZE 11 ++#define PAM_TTY 12 ++#define PAM_DISALLOW_NULL_AUTHTOK 13 ++#define PAM_AUTHINFO_UNAVAIL 14 ++#define PAM_USER_UNKNOWN 15 ++#define PAM_AUTH_ERR 16 ++#define PAM_NEW_AUTHTOK_REQD 17 ++#define PAM_CHANGE_EXPIRED_AUTHTOK 18 ++#define PAM_SYSTEM_ERR 19 ++#define PAM_ABORT 20 ++#define PAM_SILENT 21 ++#define PAM_ESTABLISH_CRED 22 ++#define PAM_REINITIALIZE_CRED 23 ++#endif + + #ifdef HAVE_LOGINCAP + #include +@@ -3039,6 +3092,7 @@ filter_extensions (const char * const *extensions) + + array = g_ptr_array_new_with_free_func (g_free); + ++#ifdef SUPPORTS_PAM_EXTENSIONS + for (i = 0; extensions[i] != NULL; i++) { + for (j = 0; gdm_supported_pam_extensions[j] != NULL; j++) { + if (g_strcmp0 (extensions[i], gdm_supported_pam_extensions[j]) == 0) { +@@ -3047,6 +3101,7 @@ filter_extensions (const char * const *extensions) + } + } + } ++#endif + g_ptr_array_add (array, NULL); + + filtered_extensions = g_strdupv ((char **) array->pdata); diff --git a/x11-packages/gdm/0003-dummy-logind.patch b/x11-packages/gdm/0003-dummy-logind.patch new file mode 100644 index 00000000000000..9d375da8bc9c4d --- /dev/null +++ b/x11-packages/gdm/0003-dummy-logind.patch @@ -0,0 +1,187 @@ +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -13,7 +13,7 @@ + option('ipv6', type: 'boolean', value: false, description: 'Enables compilation of IPv6 code.') + option('lang-file', type: 'string', value: '', description: 'File containing default language settings.') + option('libaudit', type: 'feature', value: 'auto', description: 'Add Linux audit support.') +-option('logind-provider', type: 'combo', choices: ['systemd', 'elogind'], value: 'systemd', description: 'Which logind library to use.') ++option('logind-provider', type: 'combo', choices: ['systemd', 'elogind', 'dummy'], value: 'systemd', description: 'Which logind library to use.') + option('log-dir', type: 'string', value: '/var/log/gdm', description: 'Log directory.') + option('pam', type: 'feature', value: 'auto', description: 'Add PAM support.') + option('pam-mod-dir', type: 'string', value: '', description: 'Directory to install PAM modules in.') +--- a/meson.build ++++ b/meson.build +@@ -138,6 +138,9 @@ + '/usr/lib/systemd', + ]) + systemd_x_server = systemd_multiseat_x.found()? systemd_multiseat_x.path() : '/lib/systemd/systemd-multi-seat-x' ++elif logind_provider == 'dummy' ++ logind_dep = dependency('', required: false) ++ systemd_x_server = 'disabled' + else + elogind_dep = dependency('libelogind') + logind_dep = elogind_dep +@@ -311,6 +311,7 @@ + conf.set('HAVE_UT_UT_SYSLEN', utmp_has_syslen_field) + conf.set('ENABLE_IPV6', get_option('ipv6')) + conf.set('HAVE_SYS_SOCKIO_H', cc.has_header('sys/sockio.h')) ++conf.set('WITH_DUMMY_LOGIND', get_option('logind-provider') == 'dummy') + configure_file(output: 'config.h', configuration: conf) + + # Subdirs +--- a/common/gdm-log.c ++++ b/common/gdm-log.c +@@ -30,7 +30,9 @@ + #include + + #include ++#ifdef ENABLE_SYSTEMD_JOURNAL + #include ++#endif + + #include + #include +--- a/daemon/gdm-server.c ++++ b/daemon/gdm-server.c +@@ -43,9 +43,8 @@ + #include + #endif + +-#include +- + #ifdef ENABLE_SYSTEMD_JOURNAL ++#include + #include + #endif + +--- a/daemon/gdm-session-worker-job.c ++++ b/daemon/gdm-session-worker-job.c +@@ -36,9 +36,8 @@ + #include + #endif + +-#include +- + #ifdef ENABLE_SYSTEMD_JOURNAL ++#include + #include + #endif + +--- a/daemon/gdm-session-worker.c ++++ b/daemon/gdm-session-worker.c +@@ -70,10 +70,10 @@ + #include + #endif + +-#include + #include + + #ifdef ENABLE_SYSTEMD_JOURNAL ++#include + #include + #endif + +--- a/common/gdm-common.c ++++ b/common/gdm-common.c +@@ -36,7 +36,19 @@ + + #include "gdm-common.h" + ++#ifndef WITH_DUMMY_LOGIND + #include ++#else ++#define sd_seat_get_sessions(...) (-1) ++#define sd_uid_get_sessions(...) (-1) ++#define sd_pid_get_session(...) (-1) ++#define sd_session_get_class(...) (-1) ++#define sd_session_get_state(...) (-1) ++#define sd_session_get_service(...) (-1) ++#define sd_session_get_seat(...) (-1) ++#define sd_session_get_type(...) (-1) ++#define sd_session_get_state(...) (-1) ++#endif + + #define GDM_DBUS_NAME "org.gnome.DisplayManager" + #define GDM_DBUS_LOCAL_DISPLAY_FACTORY_PATH "/org/gnome/DisplayManager/LocalDisplayFactory" +--- a/daemon/gdm-local-display-factory.c ++++ b/daemon/gdm-local-display-factory.c +@@ -32,7 +32,14 @@ + #include + #endif + ++#ifndef WITH_DUMMY_LOGIND + #include ++#else ++#define sd_seat_get_active(...) (-1) ++#define sd_session_get_tty(...) (-1) ++#define sd_session_get_vt(...) (-1) ++#define sd_seat_can_graphical(...) (-1) ++#endif + + #include "gdm-common.h" + #include "gdm-manager.h" +--- a/daemon/gdm-manager.c ++++ b/daemon/gdm-manager.c +@@ -36,7 +36,16 @@ + + #include + ++#ifndef WITH_DUMMY_LOGIND + #include ++#else ++#define sd_pid_get_session(...) (-1) ++#define sd_session_get_uid(...) (-1) ++#define sd_session_get_class(...) (-1) ++#define sd_session_is_remote(...) (-1) ++#define sd_session_get_seat(...) (-1) ++#define sd_session_get_tty(...) (-1) ++#endif + + #include "gdm-common.h" + +--- a/daemon/gdm-session-worker.c ++++ b/daemon/gdm-session-worker.c +@@ -108,7 +108,12 @@ struct pam_conv { + #include + #endif + ++#ifndef WITH_DUMMY_LOGIND + #include ++#else ++#define sd_pid_get_cgroup(...) (-1) ++#define sd_seat_can_tty(...) (FALSE) ++#endif + + #ifdef ENABLE_SYSTEMD_JOURNAL + #include +--- a/daemon/gdm-session.c ++++ b/daemon/gdm-session.c +@@ -45,7 +45,11 @@ + + #include + ++#ifndef WITH_DUMMY_LOGIND + #include ++#else ++#define sd_pid_get_cgroup(...) (-1) ++#endif + + #include "gdm-session.h" + #include "gdm-session-glue.h" +--- a/libgdm/gdm-sessions.c ++++ b/libgdm/gdm-sessions.c +@@ -35,7 +35,14 @@ + #include + #include + ++#ifndef WITH_DUMMY_LOGIND + #include ++#else ++#define sd_pid_get_user_unit(...) (-1) ++#define sd_uid_get_display(...) (-1) ++#define sd_pid_get_session(...) (-1) ++#define sd_session_get_seat(...) (-1) ++#endif + + #include "gdm-sessions.h" + diff --git a/x11-packages/gdm/0004-optional-dconf.patch b/x11-packages/gdm/0004-optional-dconf.patch new file mode 100644 index 00000000000000..b20c5708f801ea --- /dev/null +++ b/x11-packages/gdm/0004-optional-dconf.patch @@ -0,0 +1,11 @@ +--- a/data/meson.build ++++ b/data/meson.build +@@ -1,6 +1,8 @@ + subdir('applications') + subdir('autostart') ++if dconf_dep.found() + subdir('dconf') ++endif + + # XPath configs + foreach file : [ 'Init', 'PreSession', 'PostSession' ] diff --git a/x11-packages/gdm/0004-sys-kd.patch b/x11-packages/gdm/0004-sys-kd.patch new file mode 100644 index 00000000000000..3ba8a6d5a882dd --- /dev/null +++ b/x11-packages/gdm/0004-sys-kd.patch @@ -0,0 +1,42 @@ +--- a/daemon/gdm-session-worker.c ++++ b/daemon/gdm-session-worker.c +@@ -30,7 +30,9 @@ + #include + #include + #include ++#ifndef __ANDROID__ + #include ++#endif + #include + #include + #include +@@ -1037,6 +1039,7 @@ + goto out; + } + ++#if defined(KDGETMODE) && defined(KD_TEXT) + if (ioctl (tty_fd, KDGETMODE, &kernel_display_mode) < 0) { + g_debug ("GdmSessionWorker: couldn't query kernel display mode: %m"); + succeeded = FALSE; +@@ -1045,6 +1048,7 @@ + if (kernel_display_mode == KD_TEXT) { + goto out; + } ++#endif + + /* VT is in the anti-social state of VT_AUTO + KD_GRAPHICS, + * fix it. +--- a/daemon/gdm-session-worker.c ++++ b/daemon/gdm-session-worker.c +@@ -1090,9 +1122,11 @@ jump_to_vt (GdmSessionWorker *worker, + handle_terminal_vt_switches (worker, fd); + + g_debug ("GdmSessionWorker: first setting graphics mode to prevent flicker"); ++#if defined(KDSETMODE) && defined(KD_GRAPHICS) + if (ioctl (fd, KDSETMODE, KD_GRAPHICS) < 0) { + g_debug ("GdmSessionWorker: couldn't set graphics mode: %m"); + } ++#endif + } else { + fd = active_vt_tty_fd; + } diff --git a/x11-packages/gdm/0005-no-setuid.patch b/x11-packages/gdm/0005-no-setuid.patch new file mode 100644 index 00000000000000..f2846a3c9f8ff6 --- /dev/null +++ b/x11-packages/gdm/0005-no-setuid.patch @@ -0,0 +1,11 @@ +--- a/daemon/gdm-session-worker.c ++++ b/daemon/gdm-session-worker.c +@@ -2132,7 +2274,7 @@ gdm_session_worker_start_session (GdmSessionWorker *worker, + passwd_entry->pw_name, g_strerror (errno)); + _exit (EXIT_FAILURE); + } +-#else ++#elif !defined(__TERMUX__) + if (setuid (worker->uid) < 0) { + g_debug ("GdmSessionWorker: could not reset uid: %s", g_strerror (errno)); + _exit (EXIT_FAILURE); diff --git a/x11-packages/gdm/build.sh b/x11-packages/gdm/build.sh new file mode 100644 index 00000000000000..8cae8a913c38a5 --- /dev/null +++ b/x11-packages/gdm/build.sh @@ -0,0 +1,30 @@ +TERMUX_PKG_HOMEPAGE=https://gitlab.gnome.org/GNOME/gdm +# XXX: This package actually doesn't WORK on Termux, because Android doesn't have Virtual Terminal. +# XXX: It is used by `gnome-terminal` and other GNOME apps through GObject-Introspection. +TERMUX_PKG_DESCRIPTION="GNOME display manager" +TERMUX_PKG_LICENSE="GPL-2.0-or-later" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="48.0" +TERMUX_PKG_SRCURL="https://download.gnome.org/sources/gdm/${TERMUX_PKG_VERSION%%.*}/gdm-$TERMUX_PKG_VERSION.tar.xz" +TERMUX_PKG_SHA256=1bc06daff093ec7b5e37ecb4f92e5da3474a1b1ba076edb9151ee967d1c30adf +TERMUX_PKG_DEPENDS="accountsservice, consolekit2, glib, gnome-desktop3, gtk3, json-glib, libice, libsm, libx11" +TERMUX_PKG_BUILD_DEPENDS="glib-cross" +TERMUX_PKG_VERSIONED_GIR=false +# Should be bumped with gnome-shell +TERMUX_PKG_AUTO_UPDATE=false + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dlog-dir=$TERMUX_PREFIX/var/log/gdm +-Ddummy-pam=true +-Dlogind-provider=dummy +-Dsystemd-journal=false +-Dsystemdsystemunitdir=no +-Dsystemduserunitdir=no +" + +termux_step_pre_configure() { + termux_setup_gir + termux_setup_glib_cross_pkg_config_wrapper + + export TERMUX_MESON_ENABLE_SOVERSION=1 +} diff --git a/x11-packages/gdm/gir/Gdm-1.0.xml b/x11-packages/gdm/gir/Gdm-1.0.xml new file mode 100644 index 00000000000000..2c99ea4619c0d3 --- /dev/null +++ b/x11-packages/gdm/gir/Gdm-1.0.xml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From c3ff5a0ddd97335472c0277eb0f1bb57204d854a Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Mon, 5 May 2025 00:04:00 +0800 Subject: [PATCH 12/20] new package: unicode-cldr-common --- packages/unicode-cldr-common/build.sh | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/unicode-cldr-common/build.sh diff --git a/packages/unicode-cldr-common/build.sh b/packages/unicode-cldr-common/build.sh new file mode 100644 index 00000000000000..47d59548269440 --- /dev/null +++ b/packages/unicode-cldr-common/build.sh @@ -0,0 +1,34 @@ +TERMUX_PKG_HOMEPAGE=http://cldr.unicode.org/ +TERMUX_PKG_DESCRIPTION="Unicode Common Locale Data Repository" +TERMUX_PKG_LICENSE="custom" +TERMUX_PKG_LICENSE_FILE="LICENSE" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="46.1" +TERMUX_PKG_SRCURL=( + https://unicode.org/Public/cldr/$TERMUX_PKG_VERSION/cldr-common-$TERMUX_PKG_VERSION.zip + https://unicode.org/Public/cldr/$TERMUX_PKG_VERSION/LICENSE +) +TERMUX_PKG_SHA256=( + c3828c9280c6b3bb921bc96baf53be2174b5416d72e740ec3915c1ff91a50a80 + f5062c9a188d81dfe66b56db4182dcf9e4b17c0d9b0d311a8e20b3a1b075c443 +) +TERMUX_PKG_PLATFORM_INDEPENDENT=true + +termux_step_get_source() { + local i + for i in $(seq 0 $(( ${#TERMUX_PKG_SRCURL[@]}-1 ))); do + local f="$(basename "${TERMUX_PKG_SRCURL[$i]}")" + termux_download \ + "${TERMUX_PKG_SRCURL[$i]}" \ + "$TERMUX_PKG_CACHEDIR/${f}" \ + "${TERMUX_PKG_SHA256[$i]}" + done + mkdir -p "$TERMUX_PKG_SRCDIR" + unzip -d "$TERMUX_PKG_SRCDIR" \ + "$TERMUX_PKG_CACHEDIR/cldr-common-$TERMUX_PKG_VERSION.zip" +} + +termux_step_make_install() { + install -dm755 $TERMUX_PREFIX/share/$TERMUX_PKG_NAME + cp -Rf $TERMUX_PKG_SRCDIR/common/* $TERMUX_PREFIX/share/$TERMUX_PKG_NAME/ +} From c95120de7c8111232c599ef9e7df91d59a419cf2 Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Mon, 5 May 2025 00:04:10 +0800 Subject: [PATCH 13/20] new package: unicode-emoji --- packages/unicode-emoji/build.sh | 42 ++++ packages/unicode-emoji/copyright.html | 293 ++++++++++++++++++++++++++ 2 files changed, 335 insertions(+) create mode 100644 packages/unicode-emoji/build.sh create mode 100644 packages/unicode-emoji/copyright.html diff --git a/packages/unicode-emoji/build.sh b/packages/unicode-emoji/build.sh new file mode 100644 index 00000000000000..49c54bda72c74e --- /dev/null +++ b/packages/unicode-emoji/build.sh @@ -0,0 +1,42 @@ +TERMUX_PKG_HOMEPAGE=https://unicode.org/emoji/ +TERMUX_PKG_DESCRIPTION="Unicode Emoji Data Files" +TERMUX_PKG_LICENSE="custom" +TERMUX_PKG_LICENSE_FILE="copyright.html" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="16.0" +TERMUX_PKG_SRCURL=( + https://www.unicode.org/Public/emoji/$TERMUX_PKG_VERSION/emoji-sequences.txt + https://www.unicode.org/Public/emoji/$TERMUX_PKG_VERSION/emoji-test.txt + https://www.unicode.org/Public/emoji/$TERMUX_PKG_VERSION/emoji-zwj-sequences.txt +) +TERMUX_PKG_SHA256=( + 3fe3c77e72e8f26df302dc7d99b106c5d08fd808ef7246fb5d4502d659fe659c + 24f0c534e86cf142e2496953e8f0e46a3e702392911eddcd29c6cced85139697 + 9423ec235474356f970a696506737e2d5d65453a67f45df66b8bbe920c3fab83 +) +TERMUX_PKG_PLATFORM_INDEPENDENT=true + +termux_step_get_source() { + mkdir -p $TERMUX_PKG_SRCDIR + local i + for i in $(seq 0 $(( ${#TERMUX_PKG_SRCURL[@]}-1 ))); do + local bn="$(basename "${TERMUX_PKG_SRCURL[$i]}")" + local f="${TERMUX_PKG_VERSION}-${bn}" + termux_download \ + "${TERMUX_PKG_SRCURL[$i]}" \ + "$TERMUX_PKG_CACHEDIR/${f}" \ + "${TERMUX_PKG_SHA256[$i]}" + cp "$TERMUX_PKG_CACHEDIR/${f}" "$TERMUX_PKG_SRCDIR/${bn}" + done +} + +termux_step_post_get_source() { + cp $TERMUX_PKG_BUILDER_DIR/copyright.html ./ +} + +termux_step_make_install() { + local f + for f in sequences test zwj-sequences; do + install -Dm644 $TERMUX_PKG_SRCDIR/emoji-$f.txt "$TERMUX_PREFIX/share/$TERMUX_PKG_NAME/emoji-$f.txt" + done +} diff --git a/packages/unicode-emoji/copyright.html b/packages/unicode-emoji/copyright.html new file mode 100644 index 00000000000000..2afca8f9cc532e --- /dev/null +++ b/packages/unicode-emoji/copyright.html @@ -0,0 +1,293 @@ + + + + + + + + + + + + +Unicode Terms of Use + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
[Unicode]  Terms of UseTech Site + | Site Map | + Search
+
 
+ +
+

Unicode® Copyright and Terms of Use

+ +

For the general privacy policy governing access to this site, see + the  + + Unicode Privacy Policy.

+ +
    +
  1. Unicode Copyright +
      +
    1. Copyright © 1991-2023 Unicode, Inc. All rights reserved.
    2. +
    +
  2. + +
  3. Definitions +
    +Unicode Data Files ("DATA FILES") include all data files under the directories:
    +https://www.unicode.org/Public/
    +https://www.unicode.org/reports/
    +https://www.unicode.org/ivd/data/
    +
    +Unicode Data Files do not include PDF online code charts under the directory:
    +https://www.unicode.org/Public/
    +
    +Unicode Software ("SOFTWARE") includes any source code published in the Unicode Standard
    +or any source code or compiled code under the directories:
    +https://www.unicode.org/Public/PROGRAMS/
    +https://www.unicode.org/Public/cldr/
    +http://site.icu-project.org/download/
    +
    +
  4. + +
  5. Terms of Use +
      + +
    1. Certain documents and files on this website contain a legend + indicating that "Modification is permitted." Any person is + hereby authorized, without fee, to modify such documents and + files to create derivative works conforming to the Unicode® + Standard, subject to Terms and Conditions herein.
    2. +
    3. Any person is hereby authorized, without fee, to view, use, + reproduce, and distribute all documents and files, subject to the Terms and Conditions + herein.
    4. +
    5. Further specifications of rights and restrictions pertaining + to the use of the Unicode DATA FILES and SOFTWARE can be found in the + Unicode Data Files and Software License.
    6. +
    7. Each version of the Unicode Standard has further + specifications of rights and restrictions of use. For the book + editions (Unicode 5.0 and earlier), these are found on the back + of the + title page.
    8. +
    9. + The Unicode PDF online code charts carry specific restrictions. Those restrictions are incorporated as the + first page of each PDF code chart.
    10. +
    11. All other files, including online documentation of the core specification for Unicode 6.0 and later, are covered under these general Terms of Use.
    12. +
    13. No license is granted to "mirror" the Unicode website where + a fee is charged for access to the "mirror" site.
    14. +
    15. Modification is not permitted with respect to this document. + All copies of this document must be verbatim.
    16. +
    +
  6. +
  7. Restricted Rights Legend +
      +
    1. Any technical + data or software which is licensed to the United States of + America, its agencies and/or instrumentalities under this + Agreement is commercial technical data or commercial computer + software developed exclusively at private expense as defined in + FAR 2.101, or DFARS 252.227-7014 (June 1995), as applicable. For + technical data, use, duplication, or disclosure by the Government + is subject to restrictions as set forth in DFARS 202.227-7015 + Technical Data, Commercial and Items (Nov 1995) and this + Agreement. For Software, in accordance with FAR 12-212 or DFARS + 227-7202, as applicable, use, duplication or disclosure by the + Government is subject to the restrictions set forth in this + Agreement.
    2. +
    +
  8. +
  9. Warranties and Disclaimers +
      +
    1. This publication and/or website may include technical or + typographical errors or other inaccuracies. Changes are + periodically added to the information herein; these changes will + be incorporated in new editions of the publication and/or + website. Unicode, Inc. may make improvements and/or changes in the + product(s) and/or program(s) described in this publication + and/or website at any time.
    2. +
    3. If this file has been purchased on magnetic or optical media + from Unicode, Inc. the sole and exclusive remedy for any claim + will be exchange of the defective media within ninety (90) days + of original purchase.
    4. +
    5. EXCEPT AS PROVIDED IN SECTION E.2, THIS PUBLICATION AND/OR + SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER + EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, + ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE, OR NON-INFRINGEMENT. UNICODE, INC. AND ITS LICENSORS ASSUME + NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS PUBLICATION + AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR + LINKED TO THIS PUBLICATION OR THE UNICODE WEBSITE.
    6. +
    +
  10. +
  11. Waiver of Damages +
      +
    1. In no event shall + Unicode, Inc. or its licensors be liable for any special, incidental, + indirect or consequential damages of any kind, or any damages + whatsoever, whether or not Unicode, Inc. was advised of the possibility + of the damage, including, without limitation, those resulting from + the following: loss of use, data or profits, in connection with + the use, modification or distribution of this information or its + derivatives.
    2. +
    +
  12. +
  13. Trademarks & Logos +
      +
    1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of Unicode, Inc. Use of the information and materials found on this website indicates your acknowledgement of Unicode, Inc.’s exclusive worldwide rights in the Unicode Word Mark, the Unicode Logo, and the Unicode trade names.
    2. +
    3. The Unicode Consortium Name and Trademark Usage Policy (“Trademark Policy”) are incorporated herein by reference and you agree to abide by the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc.
    4. +
    5. All third party trademarks referenced herein are the property of their respective owners.
    6. +
    +
  14. + +
  15. Miscellaneous +
      +
    1. Jurisdiction and Venue. This website is operated from + a location in the State of California, United States of America. + Unicode, Inc. makes no representation that the materials are + appropriate for use in other locations. If you access this + website from other locations, you are responsible for compliance + with local laws. This Agreement, all use of this website and any + claims and damages resulting from use of this website are governed + solely by the laws of the State of California without regard to + any principles which would apply the laws of a different + jurisdiction. The user agrees that any disputes regarding this + website shall be resolved solely in the courts located in Santa + Clara County, California. The user agrees said courts have + personal jurisdiction and agree to waive any right to transfer + the dispute to any other forum.
    2. +
    3. Modification by Unicode, Inc. Unicode, Inc. shall have the right + to modify this Agreement at any time by posting it to this website. + The user may not assign any part of this Agreement without + Unicode, Inc.’s prior written consent.
    4. +
    5. Taxes. The user agrees to pay any taxes arising from + access to this website or use of the information herein, except + for those based on Unicode’s net income.
    6. +
    7. Severability.  If any provision of this + Agreement is declared invalid or unenforceable, the remaining + provisions of this Agreement shall remain in effect.
    8. +
    9. Entire Agreement. This Agreement constitutes the + entire agreement between the parties. 
    10. +
    +
  16. +
+ + +
+ + +
+
+
+ + + + +
+ Access to Copyright and terms of use
+ + + +
+
+ +
+ + From d4f47cc396eba9b3041b92dff72e3ba2fea37bba Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Mon, 5 May 2025 00:05:34 +0800 Subject: [PATCH 14/20] setup-ubuntu.sh: add dconf-cli --- scripts/setup-ubuntu.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index bf64c8ce437315..d355abeffaeb7f 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -302,6 +302,9 @@ PACKAGES+=" libexpat1:i386" # Required by wine-stable PACKAGES+=" libfreetype-dev:i386" +# Required by ibus +PACKAGES+=" dconf-cli" + # Required by CGCT PACKAGES+=" libdebuginfod-dev" From f3cb3114b8f64e5bbc0471b572e38b832f3a9ac4 Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Sun, 4 May 2025 23:57:57 +0800 Subject: [PATCH 15/20] new package: ibus --- x11-packages/ibus/0001-bcopy.patch | 14 + x11-packages/ibus/0002-hardcoded-path.patch | 21 + x11-packages/ibus/build.sh | 46 ++ x11-packages/ibus/gir/IBus-1.0.xml | 542 ++++++++++++++++++++ x11-packages/ibus/gir/IBusIMModule-1.0.xml | 3 + x11-packages/ibus/gir/IBusWaylandIM-1.0.xml | 15 + x11-packages/ibus/ibus-data.subpackage.sh | 3 + 7 files changed, 644 insertions(+) create mode 100644 x11-packages/ibus/0001-bcopy.patch create mode 100644 x11-packages/ibus/0002-hardcoded-path.patch create mode 100644 x11-packages/ibus/build.sh create mode 100644 x11-packages/ibus/gir/IBus-1.0.xml create mode 100644 x11-packages/ibus/gir/IBusIMModule-1.0.xml create mode 100644 x11-packages/ibus/gir/IBusWaylandIM-1.0.xml create mode 100644 x11-packages/ibus/ibus-data.subpackage.sh diff --git a/x11-packages/ibus/0001-bcopy.patch b/x11-packages/ibus/0001-bcopy.patch new file mode 100644 index 00000000000000..d4f7ac497bda28 --- /dev/null +++ b/x11-packages/ibus/0001-bcopy.patch @@ -0,0 +1,14 @@ +--- a/util/IMdkit/FrameMgr.c ++++ b/util/IMdkit/FrameMgr.c +@@ -31,6 +31,11 @@ + #include + #include "FrameMgr.h" + ++#ifdef __ANDROID__ ++#include ++#define bcopy(src,dest,n) memmove(dest,src,n) ++#endif ++ + /* Convenient macro */ + + #define _UNIT(n) ((int)(n) & 0xFF) diff --git a/x11-packages/ibus/0002-hardcoded-path.patch b/x11-packages/ibus/0002-hardcoded-path.patch new file mode 100644 index 00000000000000..67d0c8d7e73291 --- /dev/null +++ b/x11-packages/ibus/0002-hardcoded-path.patch @@ -0,0 +1,21 @@ +--- a/src/ibusshare.c ++++ b/src/ibusshare.c +@@ -46,15 +46,15 @@ + + if (machine_id == NULL) { + GError *error = NULL; +- if (!g_file_get_contents ("/var/lib/dbus/machine-id", ++ if (!g_file_get_contents ("@TERMUX_PREFIX@/var/lib/dbus/machine-id", + &machine_id, + NULL, + &error) && +- !g_file_get_contents ("/etc/machine-id", ++ !g_file_get_contents ("@TERMUX_PREFIX@/etc/machine-id", + &machine_id, + NULL, + NULL)) { +- g_warning ("Unable to load /var/lib/dbus/machine-id: %s", error->message); ++ g_warning ("Unable to load @TERMUX_PREFIX@/var/lib/dbus/machine-id: %s", error->message); + machine_id = "machine-id"; + } + else { diff --git a/x11-packages/ibus/build.sh b/x11-packages/ibus/build.sh new file mode 100644 index 00000000000000..9b4e35c2be54ad --- /dev/null +++ b/x11-packages/ibus/build.sh @@ -0,0 +1,46 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/ibus/ibus +TERMUX_PKG_DESCRIPTION="Intelligent Input Bus for Linux/Unix" +TERMUX_PKG_LICENSE="LGPL-2.1" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="1.5.32" +TERMUX_PKG_SRCURL="https://github.com/ibus/ibus/releases/download/$TERMUX_PKG_VERSION/ibus-$TERMUX_PKG_VERSION.tar.gz" +TERMUX_PKG_SHA256=b24f41ae38b236b254c09f1a8f53c2354b69b0789e89cea888d0494b09d15d67 +TERMUX_PKG_DEPENDS="dconf, glib, gobject-introspection, gtk3, gtk4, libdbusmenu, libnotify, libwayland, libx11, libxfixes, libxi, libxkbcommon" +TERMUX_PKG_BUILD_DEPENDS="g-ir-scanner, glib-cross, libdbusmenu-static, unicode-cldr-common, unicode-data, unicode-emoji" +TERMUX_PKG_VERSIONED_GIR=false + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +--disable-tests +--enable-introspection +--disable-vala +--disable-gtk2 +--enable-gtk4 +--disable-memconf +--enable-ui +--disable-python2 +--disable-python-library +--disable-systemd-services +--with-emoji-annotation-dir=$TERMUX_PREFIX/share/unicode-cldr-common/annotations +--with-unicode-emoji-dir=$TERMUX_PREFIX/share/unicode-emoji +--with-ucd-dir=$TERMUX_PREFIX/share/unicode-data +" + +termux_step_pre_configure() { + TERMUX_PKG_DEPENDS+=", ibus-data" + + termux_setup_gir + termux_setup_glib_cross_pkg_config_wrapper + + if [ "$TERMUX_ON_DEVICE_BUILD" = false ]; then + # Create host pkg-config wrapper + mkdir -p "$TERMUX_PKG_TMPDIR"/host-pkg-config + cat > "$TERMUX_PKG_TMPDIR"/host-pkg-config/pkg-config <<-HERE + #!/bin/sh + unset PKG_CONFIG_DIR + unset PKG_CONFIG_LIBDIR + exec /usr/bin/pkg-config "\$@" + HERE + chmod +x "$TERMUX_PKG_TMPDIR"/host-pkg-config/pkg-config + export PKG_CONFIG_FOR_BUILD="$TERMUX_PKG_TMPDIR"/host-pkg-config/pkg-config + fi +} diff --git a/x11-packages/ibus/gir/IBus-1.0.xml b/x11-packages/ibus/gir/IBus-1.0.xml new file mode 100644 index 00000000000000..2a336db2b4c640 --- /dev/null +++ b/x11-packages/ibus/gir/IBus-1.0.xml @@ -0,0 +1,542 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/x11-packages/ibus/gir/IBusIMModule-1.0.xml b/x11-packages/ibus/gir/IBusIMModule-1.0.xml new file mode 100644 index 00000000000000..87ec2e15747e53 --- /dev/null +++ b/x11-packages/ibus/gir/IBusIMModule-1.0.xml @@ -0,0 +1,3 @@ + + + diff --git a/x11-packages/ibus/gir/IBusWaylandIM-1.0.xml b/x11-packages/ibus/gir/IBusWaylandIM-1.0.xml new file mode 100644 index 00000000000000..3e4b4ddddecaac --- /dev/null +++ b/x11-packages/ibus/gir/IBusWaylandIM-1.0.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/x11-packages/ibus/ibus-data.subpackage.sh b/x11-packages/ibus/ibus-data.subpackage.sh new file mode 100644 index 00000000000000..131d0d7f7c5800 --- /dev/null +++ b/x11-packages/ibus/ibus-data.subpackage.sh @@ -0,0 +1,3 @@ +TERMUX_SUBPKG_DESCRIPTION="Platform-independent data for ibus" +TERMUX_SUBPKG_PLATFORM_INDEPENDENT=true +TERMUX_SUBPKG_INCLUDE="share/ibus/" From 37d1ba3263d224767a925f60c2fc7ecbeb2f389c Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Mon, 5 May 2025 00:00:13 +0800 Subject: [PATCH 16/20] new package: geocode-glib --- x11-packages/geocode-glib/build.sh | 22 ++++ .../geocode-glib/gir/GeocodeGlib-2.0.xml | 109 ++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 x11-packages/geocode-glib/build.sh create mode 100644 x11-packages/geocode-glib/gir/GeocodeGlib-2.0.xml diff --git a/x11-packages/geocode-glib/build.sh b/x11-packages/geocode-glib/build.sh new file mode 100644 index 00000000000000..8019dacc05cc2a --- /dev/null +++ b/x11-packages/geocode-glib/build.sh @@ -0,0 +1,22 @@ +TERMUX_PKG_HOMEPAGE=https://git.gnome.org/browse/geocode-glib +TERMUX_PKG_DESCRIPTION="Convenience library for the geocoding and reverse geocoding" +TERMUX_PKG_LICENSE="GPL-2.0-only" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="3.26.4" +TERMUX_PKG_SRCURL="https://download.gnome.org/sources/geocode-glib/${TERMUX_PKG_VERSION%.*}/geocode-glib-$TERMUX_PKG_VERSION.tar.xz" +TERMUX_PKG_SHA256=2d9a6826d158470449a173871221596da0f83ebdcff98b90c7049089056a37aa +TERMUX_PKG_DEPENDS="glib, json-glib, libsoup3" +TERMUX_PKG_BUILD_DEPENDS="g-ir-scanner, glib-cross" +TERMUX_PKG_VERSIONED_GIR=false +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Denable-installed-tests=false +-Denable-gtk-doc=false +-Dsoup2=false +" + +termux_step_pre_configure() { + termux_setup_gir + termux_setup_glib_cross_pkg_config_wrapper + + export TERMUX_MESON_ENABLE_SOVERSION=1 +} diff --git a/x11-packages/geocode-glib/gir/GeocodeGlib-2.0.xml b/x11-packages/geocode-glib/gir/GeocodeGlib-2.0.xml new file mode 100644 index 00000000000000..e98a0811f66a60 --- /dev/null +++ b/x11-packages/geocode-glib/gir/GeocodeGlib-2.0.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 5f1638e6bd304f24c7235303ee11c575f6447aaa Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Mon, 5 May 2025 00:01:33 +0800 Subject: [PATCH 17/20] new package: libgweather --- .../libgweather/0001-enable-cross-gir.patch | 11 ++ x11-packages/libgweather/build.sh | 23 +++ x11-packages/libgweather/gir/GWeather-4.0.xml | 136 ++++++++++++++++++ 3 files changed, 170 insertions(+) create mode 100644 x11-packages/libgweather/0001-enable-cross-gir.patch create mode 100644 x11-packages/libgweather/build.sh create mode 100644 x11-packages/libgweather/gir/GWeather-4.0.xml diff --git a/x11-packages/libgweather/0001-enable-cross-gir.patch b/x11-packages/libgweather/0001-enable-cross-gir.patch new file mode 100644 index 00000000000000..ede30b73a3a0fb --- /dev/null +++ b/x11-packages/libgweather/0001-enable-cross-gir.patch @@ -0,0 +1,11 @@ +--- a/meson.build ++++ b/meson.build +@@ -51,7 +51,7 @@ + gen_locations_variant = find_program('build-aux/meson/gen_locations_variant.py') + + g_ir_scanner = find_program('g-ir-scanner', required: get_option('introspection')) +-build_gir = get_option('introspection') and g_ir_scanner.found() and not meson.is_cross_build() ++build_gir = get_option('introspection') and g_ir_scanner.found() + build_docs = get_option('gtk_doc') and build_gir + + schemas_srcdir = meson.project_source_root() / 'schemas' diff --git a/x11-packages/libgweather/build.sh b/x11-packages/libgweather/build.sh new file mode 100644 index 00000000000000..4d567ef09af330 --- /dev/null +++ b/x11-packages/libgweather/build.sh @@ -0,0 +1,23 @@ +TERMUX_PKG_HOMEPAGE=https://wiki.gnome.org/Projects/LibGWeather +TERMUX_PKG_DESCRIPTION="Location and timezone database and weather-lookup library" +TERMUX_PKG_LICENSE="GPL-2.0-or-later" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="4.4.4" +TERMUX_PKG_SRCURL="https://download.gnome.org/sources/libgweather/${TERMUX_PKG_VERSION%.*}/libgweather-$TERMUX_PKG_VERSION.tar.xz" +TERMUX_PKG_SHA256=7017677753cdf7d1fdc355e4bfcdb1eba8369793a8df24d241427a939cbf4283 +TERMUX_PKG_DEPENDS="geocode-glib, glib, gobject-introspection, json-glib, libsoup3, libxml2" +TERMUX_PKG_BUILD_DEPENDS="g-ir-scanner, glib-cross" +TERMUX_PKG_VERSIONED_GIR=false + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dintrospection=true +-Denable_vala=false +-Dgtk_doc=false +" + +termux_step_pre_configure() { + termux_setup_gir + termux_setup_glib_cross_pkg_config_wrapper + + export TERMUX_MESON_ENABLE_SOVERSION=1 +} diff --git a/x11-packages/libgweather/gir/GWeather-4.0.xml b/x11-packages/libgweather/gir/GWeather-4.0.xml new file mode 100644 index 00000000000000..f553b7274b6598 --- /dev/null +++ b/x11-packages/libgweather/gir/GWeather-4.0.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 5fd1555598e8d2ff09a7a5565bef1fcb3250b5ed Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Mon, 5 May 2025 00:02:20 +0800 Subject: [PATCH 18/20] new package: upower --- x11-packages/upower/build.sh | 26 +++++++++ x11-packages/upower/gir/UPowerGlib-1.0.xml | 62 ++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 x11-packages/upower/build.sh create mode 100644 x11-packages/upower/gir/UPowerGlib-1.0.xml diff --git a/x11-packages/upower/build.sh b/x11-packages/upower/build.sh new file mode 100644 index 00000000000000..a3da05a79b8d0d --- /dev/null +++ b/x11-packages/upower/build.sh @@ -0,0 +1,26 @@ +TERMUX_PKG_HOMEPAGE=https://upower.freedesktop.org/ +TERMUX_PKG_DESCRIPTION="Power management support for DeviceKit" +TERMUX_PKG_LICENSE="GPL-2.0-or-later" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="1.90.9" +TERMUX_PKG_SRCURL="https://gitlab.freedesktop.org/upower/upower/-/archive/v$TERMUX_PKG_VERSION/upower-v$TERMUX_PKG_VERSION.tar.gz" +TERMUX_PKG_SHA256=fffd45c50d29ed73ecdcfb11c3a7bb042ef14e84b14b0c2d5fdb78c7b4435d6c +TERMUX_PKG_DEPENDS="glib, gobject-introspection" +TERMUX_PKG_BUILD_DEPENDS="g-ir-scanner, glib-cross" +TERMUX_PKG_VERSIONED_GIR=false + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dintrospection=enabled +-Dos_backend=dummy +-Dpolkit=disabled +-Dsystemdsystemunitdir=no +-Dgtk-doc=false +-Dman=false +" + +termux_step_pre_configure() { + termux_setup_gir + termux_setup_glib_cross_pkg_config_wrapper + + export TERMUX_MESON_ENABLE_SOVERSION=1 +} diff --git a/x11-packages/upower/gir/UPowerGlib-1.0.xml b/x11-packages/upower/gir/UPowerGlib-1.0.xml new file mode 100644 index 00000000000000..daa34046485a6f --- /dev/null +++ b/x11-packages/upower/gir/UPowerGlib-1.0.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 7210e4bef71c8ed621c83fa1d9bee56a0c97a29f Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Mon, 5 May 2025 00:07:21 +0800 Subject: [PATCH 19/20] new package: geoclue --- x11-packages/geoclue/build.sh | 27 +++++++ x11-packages/geoclue/gir/Geoclue-2.0.xml | 99 ++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 x11-packages/geoclue/build.sh create mode 100644 x11-packages/geoclue/gir/Geoclue-2.0.xml diff --git a/x11-packages/geoclue/build.sh b/x11-packages/geoclue/build.sh new file mode 100644 index 00000000000000..24edde9d88a6b7 --- /dev/null +++ b/x11-packages/geoclue/build.sh @@ -0,0 +1,27 @@ +TERMUX_PKG_HOMEPAGE=https://gitlab.freedesktop.org/geoclue/geoclue/ +TERMUX_PKG_DESCRIPTION="Modular geoinformation service built on the D-Bus messaging system" +TERMUX_PKG_LICENSE="GPL-2.0-or-later, LGPL-2.1-only" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="2.7.2" +TERMUX_PKG_SRCURL="https://gitlab.freedesktop.org/geoclue/geoclue/-/archive/$TERMUX_PKG_VERSION/geoclue-$TERMUX_PKG_VERSION.tar.gz" +TERMUX_PKG_SHA256=9c2f3626e3131abc037955cb38a8c0f28a29b4d6cc9992a067fe04be46e37fbe +TERMUX_PKG_DEPENDS="glib, json-glib" +TERMUX_PKG_BUILD_DEPENDS="g-ir-scanner, glib-cross" +TERMUX_PKG_VERSIONED_GIR=false +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dintrospection=true +-Dgtk-doc=false +-D3g-source=false +-Dcdma-source=false +-Dmodem-gps-source=false +-Dnmea-source=false +-Denable-backend=false +-Ddemo-agent=false +" + +termux_step_pre_configure() { + termux_setup_gir + termux_setup_glib_cross_pkg_config_wrapper + + export TERMUX_MESON_ENABLE_SOVERSION=1 +} diff --git a/x11-packages/geoclue/gir/Geoclue-2.0.xml b/x11-packages/geoclue/gir/Geoclue-2.0.xml new file mode 100644 index 00000000000000..76ddf18b9db702 --- /dev/null +++ b/x11-packages/geoclue/gir/Geoclue-2.0.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 77ae9db667103a2ea7575c8f23a497754796951a Mon Sep 17 00:00:00 2001 From: Chongyun Lee Date: Mon, 5 May 2025 00:09:57 +0800 Subject: [PATCH 20/20] new package: gnome-settings-daemon --- .../gnome-settings-daemon/0001-no-gudev.patch | 65 +++++++++++++++++++ x11-packages/gnome-settings-daemon/build.sh | 46 +++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 x11-packages/gnome-settings-daemon/0001-no-gudev.patch create mode 100644 x11-packages/gnome-settings-daemon/build.sh diff --git a/x11-packages/gnome-settings-daemon/0001-no-gudev.patch b/x11-packages/gnome-settings-daemon/0001-no-gudev.patch new file mode 100644 index 00000000000000..d478c13cb27cbf --- /dev/null +++ b/x11-packages/gnome-settings-daemon/0001-no-gudev.patch @@ -0,0 +1,65 @@ +--- a/plugins/power/gsd-backlight.c ++++ b/plugins/power/gsd-backlight.c +@@ -27,7 +27,7 @@ + #include "gsd-power-constants.h" + #include "gsd-power-manager.h" + +-#ifdef __linux__ ++#if defined(__linux__) && defined(HAVE_GUDEV) && HAVE_GUDEV + #include + #endif /* __linux__ */ + +@@ -53,7 +53,7 @@ + + BacklightBackend backend; + +-#ifdef __linux__ ++#if defined(__linux__) && defined(HAVE_GUDEV) && HAVE_GUDEV + GDBusProxy *logind_proxy; + + GUdevClient *udev; +@@ -93,7 +93,7 @@ + G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, + gsd_backlight_initable_iface_init);) + +-#ifdef __linux__ ++#if defined(__linux__) && defined(HAVE_GUDEV) && HAVE_GUDEV + static GUdevDevice* + gsd_backlight_udev_get_type (GList *devices, const gchar *type) + { +@@ -511,7 +511,7 @@ + return; + } + +-#ifdef __linux__ ++#if defined(__linux__) && defined(HAVE_GUDEV) && HAVE_GUDEV + if (backlight->backend == BACKLIGHT_BACKEND_UDEV) { + BacklightHelperData *task_data; + +@@ -915,7 +915,7 @@ + G_CONNECT_SWAPPED); + maybe_update_mutter_backlight (backlight); + +-#ifdef __linux__ ++#if defined(__linux__) && defined(HAVE_GUDEV) && HAVE_GUDEV + backlight->logind_proxy = + g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM, + 0, +@@ -987,7 +987,7 @@ + { + GsdBacklight *backlight = GSD_BACKLIGHT (object); + +-#ifdef __linux__ ++#if defined(__linux__) && defined(HAVE_GUDEV) && HAVE_GUDEV + g_assert (backlight->active_task == NULL); + g_assert (g_queue_is_empty (&backlight->tasks)); + g_clear_object (&backlight->logind_proxy); +@@ -1033,7 +1033,7 @@ + backlight->brightness_val = -1; + backlight->brightness_step = 1; + +-#ifdef __linux__ ++#if defined(__linux__) && defined(HAVE_GUDEV) && HAVE_GUDEV + backlight->active_task = NULL; + g_queue_init (&backlight->tasks); + #endif /* __linux__ */ diff --git a/x11-packages/gnome-settings-daemon/build.sh b/x11-packages/gnome-settings-daemon/build.sh new file mode 100644 index 00000000000000..84da5679b0d0a0 --- /dev/null +++ b/x11-packages/gnome-settings-daemon/build.sh @@ -0,0 +1,46 @@ +TERMUX_PKG_HOMEPAGE=https://gitlab.gnome.org/GNOME/gnome-settings-daemon +TERMUX_PKG_DESCRIPTION="GNOME Settings Daemon" +TERMUX_PKG_LICENSE="GPL-2.0-or-later, LGPL-2.1-only" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION="48.1" +TERMUX_PKG_SRCURL="https://download.gnome.org/sources/gnome-settings-daemon/${TERMUX_PKG_VERSION%%.*}/gnome-settings-daemon-$TERMUX_PKG_VERSION.tar.xz" +TERMUX_PKG_SHA256=3860a2ea214dcbcb6600ae7a1e3358a5389215087bc3e4a47cee3f87baee062e +TERMUX_PKG_DEPENDS="glib, geoclue, geocode-glib, gnome-desktop3, gtk3, libcanberra, libcolord, libgweather, libnotify, libx11, libxfixes, pango, polkit, pulseaudio-glib, upower" +TERMUX_PKG_BUILD_DEPENDS="glib-cross" + +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-Dsystemd=false +-Delogind=false +-Dalsa=false +-Dgudev=false +-Dwayland=false +-Dsmartcard=false +-Dcups=false +-Drfkill=false +-Dwwan=false +-Dnetwork_manager=false +" + +termux_step_pre_configure() { + termux_setup_glib_cross_pkg_config_wrapper + + if [ "$TERMUX_ON_DEVICE_BUILD" = false ]; then + # Create host pkg-config wrapper + mkdir -p "$TERMUX_PKG_TMPDIR"/host-pkg-config + cat > "$TERMUX_PKG_TMPDIR"/host-pkg-config/pkg-config <<-HERE + #!/bin/sh + unset PKG_CONFIG_DIR + unset PKG_CONFIG_LIBDIR + exec /usr/bin/pkg-config "\$@" + HERE + chmod +x "$TERMUX_PKG_TMPDIR"/host-pkg-config/pkg-config + + # Use it in meson + local _native_file="$TERMUX_PKG_TMPDIR"/native-file.ini + echo "[binaries]" > $_native_file + echo "pkg-config = '$TERMUX_PKG_TMPDIR/host-pkg-config/pkg-config'" >> $_native_file + TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--native-file $_native_file $TERMUX_PKG_EXTRA_CONFIGURE_ARGS" + fi + + export TERMUX_MESON_ENABLE_SOVERSION=1 +}