Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
fornwall committed Jun 28, 2024
2 parents 15dc52d + 6ba1bdc commit df70785
Show file tree
Hide file tree
Showing 10 changed files with 138 additions and 74 deletions.
4 changes: 2 additions & 2 deletions packages/algernon/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://algernon.roboticoverlords.org/
TERMUX_PKG_DESCRIPTION="Small self-contained web server with Lua, Markdown, QUIC, Redis and PostgreSQL support"
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.16.0"
TERMUX_PKG_VERSION="1.17.0"
TERMUX_PKG_SRCURL="https://github.com/xyproto/algernon/archive/v${TERMUX_PKG_VERSION}.tar.gz"
TERMUX_PKG_SHA256=68a14413df39f78d8e3baeffdac4e3829f0a49f4f32af5efa4a233d7dd25eaa7
TERMUX_PKG_SHA256=520ded9f63e901401c86b35ae52abc2fd114f1162884114df9aac060e73f7789
TERMUX_PKG_AUTO_UPDATE=true

termux_step_make() {
Expand Down
56 changes: 19 additions & 37 deletions packages/algernon/fix-hardcoded-paths.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
diff -uNr algernon-1.15.2/engine/config.go algernon-1.15.2.mod/engine/config.go
--- algernon-1.15.2/engine/config.go 2023-06-03 20:37:01.000000000 +0800
+++ algernon-1.15.2.mod/engine/config.go 2023-06-04 12:39:16.650131453 +0800
--- a/engine/config.go
+++ b/engine/config.go
@@ -154,7 +154,7 @@

// New creates a new server configuration based using the default values
Expand All @@ -19,9 +18,17 @@ diff -uNr algernon-1.15.2/engine/config.go algernon-1.15.2.mod/engine/config.go

// Compression speed over compactness
cacheCompressionSpeed: true,
diff -uNr algernon-1.15.2/engine/flags.go algernon-1.15.2.mod/engine/flags.go
--- algernon-1.15.2/engine/flags.go 2023-06-03 20:37:01.000000000 +0800
+++ algernon-1.15.2.mod/engine/flags.go 2023-06-04 12:40:02.810131436 +0800
@@ -218,7 +218,7 @@
return nil, err
}
// Read in the mimetype information from the system. Set UTF-8 when setting Content-Type.
- ac.mimereader = mime.New("/etc/mime.types", true)
+ ac.mimereader = mime.New("@TERMUX_PREFIX@/etc/mime.types", true)
ac.setupLogging()

// File stat cache
--- a/engine/flags.go
+++ b/engine/flags.go
@@ -206,9 +206,9 @@
switch {
case ac.productionMode:
Expand All @@ -35,19 +42,8 @@ diff -uNr algernon-1.15.2/engine/flags.go algernon-1.15.2.mod/engine/flags.go
ac.cacheMode = cachemode.Production
ac.serverMode = true
case ac.devMode:
diff -uNr algernon-1.15.2/engine/mime.go algernon-1.15.2.mod/engine/mime.go
--- algernon-1.15.2/engine/mime.go 2023-06-03 20:37:01.000000000 +0800
+++ algernon-1.15.2.mod/engine/mime.go 2023-06-04 12:40:20.450131429 +0800
@@ -6,5 +6,5 @@

func (ac *Config) initializeMime() {
// Read in the mimetype information from the system. Set UTF-8 when setting Content-Type.
- ac.mimereader = mime.New("/etc/mime.types", true)
+ ac.mimereader = mime.New("@TERMUX_PREFIX@/etc/mime.types", true)
}
diff -uNr algernon-1.15.2/engine/serve.go algernon-1.15.2.mod/engine/serve.go
--- algernon-1.15.2/engine/serve.go 2023-06-03 20:37:01.000000000 +0800
+++ algernon-1.15.2.mod/engine/serve.go 2023-06-04 12:40:42.770131420 +0800
--- a/engine/serve.go
+++ b/engine/serve.go
@@ -167,7 +167,7 @@
// If $XDG_CONFIG_DIR is not set, use $HOME.
// If $HOME is not set, use $TMPDIR.
Expand All @@ -57,30 +53,16 @@ diff -uNr algernon-1.15.2/engine/serve.go algernon-1.15.2.mod/engine/serve.go

defaultEmail := env.Str("LOGNAME", "root") + "@localhost"
if len(ac.certMagicDomains) > 0 {
diff -uNr algernon-1.15.2/vendor/github.com/caddyserver/certmagic/dnsutil.go algernon-1.15.2.mod/vendor/github.com/caddyserver/certmagic/dnsutil.go
--- algernon-1.15.2/vendor/github.com/caddyserver/certmagic/dnsutil.go 2023-06-03 20:37:01.000000000 +0800
+++ algernon-1.15.2.mod/vendor/github.com/caddyserver/certmagic/dnsutil.go 2023-06-04 12:42:21.670131383 +0800
--- a/vendor/github.com/caddyserver/certmagic/dnsutil.go
+++ b/vendor/github.com/caddyserver/certmagic/dnsutil.go
@@ -339,4 +339,4 @@
fqdnSOACacheMu sync.Mutex
)

-const defaultResolvConf = "/etc/resolv.conf"
+const defaultResolvConf = "@TERMUX_PREFIX@/etc/resolv.conf"
diff -uNr algernon-1.15.2/vendor/github.com/go-sql-driver/mysql/dsn.go algernon-1.15.2.mod/vendor/github.com/go-sql-driver/mysql/dsn.go
--- algernon-1.15.2/vendor/github.com/go-sql-driver/mysql/dsn.go 2023-06-03 20:37:01.000000000 +0800
+++ algernon-1.15.2.mod/vendor/github.com/go-sql-driver/mysql/dsn.go 2023-06-04 12:41:01.690131413 +0800
@@ -112,7 +112,7 @@
case "tcp":
cfg.Addr = "127.0.0.1:3306"
case "unix":
- cfg.Addr = "/tmp/mysql.sock"
+ cfg.Addr = "@TERMUX_PREFIX@/tmp/mysql.sock"
default:
return errors.New("default addr for network '" + cfg.Net + "' unknown")
}
diff -uNr algernon-1.15.2/vendor/github.com/xyproto/gopher-lua/utils.go algernon-1.15.2.mod/vendor/github.com/xyproto/gopher-lua/utils.go
--- algernon-1.15.2/vendor/github.com/xyproto/gopher-lua/utils.go 2023-06-03 20:37:01.000000000 +0800
+++ algernon-1.15.2.mod/vendor/github.com/xyproto/gopher-lua/utils.go 2023-06-04 12:41:20.570131406 +0800
--- a/vendor/github.com/xyproto/gopher-lua/utils.go
+++ b/vendor/github.com/xyproto/gopher-lua/utils.go
@@ -156,7 +156,7 @@
}

Expand Down
4 changes: 2 additions & 2 deletions packages/fastfetch/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://github.com/fastfetch-cli/fastfetch
TERMUX_PKG_DESCRIPTION="A neofetch-like tool for fetching system information and displaying them in a pretty way"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="2.16.0"
TERMUX_PKG_VERSION="2.17.0"
TERMUX_PKG_SRCURL=https://github.com/fastfetch-cli/fastfetch/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=8c5d137e0439d70189fc267176840feaba5f3e06177d57c4be9a866595651803
TERMUX_PKG_SHA256=b108ecff62f4e834f639da8f24d332af7901376e3ace97ebfc6ec81114315556
TERMUX_PKG_DEPENDS="vulkan-loader"
TERMUX_PKG_BUILD_DEPENDS="freetype, libandroid-wordexp-static, vulkan-headers, vulkan-loader-android"
TERMUX_PKG_ANTI_BUILD_DEPENDS="vulkan-loader"
Expand Down
6 changes: 3 additions & 3 deletions packages/krb5/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ TERMUX_PKG_DESCRIPTION="The Kerberos network authentication system"
TERMUX_PKG_LICENSE="custom"
TERMUX_PKG_LICENSE_FILE="../NOTICE"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="1.21.2"
TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/krb5-$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=9560941a9d843c0243a71b17a7ac6fe31c7cebb5bce3983db79e52ae7e850491
TERMUX_PKG_VERSION="1.21.3"
TERMUX_PKG_SRCURL=https://kerberos.org/dist/krb5/$(grep -oP "^\d+\.\d+" <<< $TERMUX_PKG_VERSION)/krb5-$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=b7a4cd5ead67fb08b980b21abd150ff7217e85ea320c9ed0c6dadd304840ad35
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_DEPENDS="libresolv-wrapper, readline, openssl, libdb"
TERMUX_PKG_BREAKS="krb5-dev"
Expand Down
4 changes: 2 additions & 2 deletions packages/mold/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://github.com/rui314/mold
TERMUX_PKG_DESCRIPTION="mold: A Modern Linker"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="2.32.0"
TERMUX_PKG_VERSION="2.32.1"
TERMUX_PKG_SRCURL=https://github.com/rui314/mold/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=4b7e4146ea0f52be9adae8b417399f3676a041e65b55e3f25f088120d30a320b
TERMUX_PKG_SHA256=f3c9a527d884c635834fe7d79b3de959b00783bf9446280ea274d996f0335825
TERMUX_PKG_DEPENDS="libc++, openssl, zlib"
TERMUX_PKG_AUTO_UPDATE=true

Expand Down
98 changes: 98 additions & 0 deletions packages/mold/common-jobs-unix.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
--- a/common/jobs-unix.cc
+++ b/common/jobs-unix.cc
@@ -66,6 +66,68 @@ static bool do_lock() {
return false;
}

+#ifdef __ANDROID__
+#include <alloca.h>
+static int shm_unlink(const char *name) {
+ size_t namelen;
+ char *fname;
+
+ /* Construct the filename. */
+ while (name[0] == '/') ++name;
+
+ if (name[0] == '\0') {
+ /* The name "/" is not supported. */
+ errno = EINVAL;
+ return -1;
+ }
+
+ namelen = strlen(name);
+ fname = (char *) alloca(sizeof("@TERMUX_PREFIX@/tmp/") - 1 + namelen + 1);
+ memcpy(fname, "@TERMUX_PREFIX@/tmp/", sizeof("@TERMUX_PREFIX@/tmp/") - 1);
+ memcpy(fname + sizeof("@TERMUX_PREFIX@/tmp/") - 1, name, namelen + 1);
+
+ return unlink(fname);
+}
+
+static int shm_open(const char *name, int oflag, mode_t mode) {
+ size_t namelen;
+ char *fname;
+ int fd;
+
+ /* Construct the filename. */
+ while (name[0] == '/') ++name;
+
+ if (name[0] == '\0') {
+ /* The name "/" is not supported. */
+ errno = EINVAL;
+ return -1;
+ }
+
+ namelen = strlen(name);
+ fname = (char *) alloca(sizeof("@TERMUX_PREFIX@/tmp/") - 1 + namelen + 1);
+ memcpy(fname, "@TERMUX_PREFIX@/tmp/", sizeof("@TERMUX_PREFIX@/tmp/") - 1);
+ memcpy(fname + sizeof("@TERMUX_PREFIX@/tmp/") - 1, name, namelen + 1);
+
+ fd = open(fname, oflag, mode);
+ if (fd != -1) {
+ /* We got a descriptor. Now set the FD_CLOEXEC bit. */
+ int flags = fcntl(fd, F_GETFD, 0);
+ flags |= FD_CLOEXEC;
+ flags = fcntl(fd, F_SETFD, flags);
+
+ if (flags == -1) {
+ /* Something went wrong. We cannot return the descriptor. */
+ int save_errno = errno;
+ close(fd);
+ fd = -1;
+ errno = save_errno;
+ }
+ }
+
+ return fd;
+}
+#endif
+
static SharedData *get_shared_data() {
// Create a shared memory object and mmap it
std::string name = "/mold-signal-" + std::to_string(getuid());
@@ -91,7 +153,7 @@ static SharedData *get_shared_data() {
pthread_mutexattr_init(&mu_attr);
pthread_mutexattr_setpshared(&mu_attr, PTHREAD_PROCESS_SHARED);

-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__ANDROID__)
pthread_mutexattr_setrobust(&mu_attr, PTHREAD_MUTEX_ROBUST);
#endif

@@ -116,7 +178,7 @@ void acquire_global_lock() {
if (char *dir = getenv("XDG_RUNTIME_DIR"))
path = dir + "/mold.lock"s;
else
- path = "/tmp/mold-" + std::to_string(getuid()) + ".lock";
+ path = "@TERMUX_PREFIX@/tmp/mold-" + std::to_string(getuid()) + ".lock";

lock_fd = open(path.c_str(), O_WRONLY | O_CREAT | O_CLOEXEC, 0600);
if (lock_fd == -1 || do_lock())
@@ -126,7 +188,7 @@ void acquire_global_lock() {
pthread_cond_t *cond = &shared_data->cond;
int r = pthread_mutex_lock(mu);

-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__ANDROID__)
// If the previous process got killed while holding the mutex, the
// mutex has became inconsistent. We need to fix it in that case.
if (r == EOWNERDEAD)
4 changes: 2 additions & 2 deletions packages/oh-my-posh/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://ohmyposh.dev
TERMUX_PKG_DESCRIPTION="A prompt theme engine for any shell."
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="21.16.2"
TERMUX_PKG_VERSION="21.17.0"
TERMUX_PKG_SRCURL=https://github.com/JanDeDobbeleer/oh-my-posh/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=f26c6038a1d510ea443fbf712a364a54f1dcf1675b378544ff31b2e26f93b408
TERMUX_PKG_SHA256=7de5561679b4a1cc05abe9d9002049060cd470c53aca9a961348e5a169afc5d4
TERMUX_PKG_AUTO_UPDATE=true

termux_step_pre_configure() {
Expand Down
6 changes: 3 additions & 3 deletions packages/ruff/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ TERMUX_PKG_DESCRIPTION="An extremely fast Python linter, written in Rust"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_LICENSE_FILE="../../LICENSE"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="0.4.10"
TERMUX_PKG_SRCURL="https://github.com/charliermarsh/ruff/archive/refs/tags/v$TERMUX_PKG_VERSION.tar.gz"
TERMUX_PKG_SHA256=cd3212c8e44c0c2c92eba10c44df0ed4073c77b2cff669563b37a56a090c9e74
TERMUX_PKG_VERSION="0.5.0"
TERMUX_PKG_SRCURL="https://github.com/charliermarsh/ruff/archive/refs/tags/$TERMUX_PKG_VERSION.tar.gz"
TERMUX_PKG_SHA256=d82f44f45fc310345cb7d4ce3fc5c9a39556515062002804bb4ae9f6e191c2b2
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BUILD_IN_SRC=true

Expand Down
11 changes: 7 additions & 4 deletions packages/xmlto/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ TERMUX_PKG_HOMEPAGE=https://pagure.io/xmlto/
TERMUX_PKG_DESCRIPTION="Convert xml to many other formats"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.0.28
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://releases.pagure.org/xmlto/xmlto-${TERMUX_PKG_VERSION}.tar.bz2
TERMUX_PKG_SHA256=1130df3a7957eb9f6f0d29e4aa1c75732a7dfb6d639be013859b5c7ec5421276
TERMUX_PKG_VERSION="0.0.29"
TERMUX_PKG_SRCURL=https://www.pagure.io/xmlto/archive/${TERMUX_PKG_VERSION}/xmlto-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=40504db68718385a4eaa9154a28f59e51e59d006d1aa14f5bc9d6fded1d6017a
TERMUX_PKG_DEPENDS="xsltproc"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_UPDATE_METHOD=repology

termux_step_pre_configure() {
autoreconf -fi
}
19 changes: 0 additions & 19 deletions packages/xmlto/xmlif-xmlif.c.patch

This file was deleted.

0 comments on commit df70785

Please sign in to comment.