From 01069ecb737ac3e7868c0be91bbf958bdc9f66dc Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Fri, 25 Feb 2022 00:50:24 +0900 Subject: [PATCH] new package: make-guile --- packages/make-guile/build.sh | 45 ++++++++++++++++++++++++++ packages/make-guile/src-job.c.patch | 12 +++++++ packages/make-guile/src-output.c.patch | 15 +++++++++ packages/make/build.sh | 19 +++++++---- 4 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 packages/make-guile/build.sh create mode 100644 packages/make-guile/src-job.c.patch create mode 100644 packages/make-guile/src-output.c.patch diff --git a/packages/make-guile/build.sh b/packages/make-guile/build.sh new file mode 100644 index 000000000..47d3af134 --- /dev/null +++ b/packages/make-guile/build.sh @@ -0,0 +1,45 @@ +TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/make/ +TERMUX_PKG_DESCRIPTION="Tool to control the generation of non-source files from source files" +TERMUX_PKG_LICENSE="GPL-3.0" +TERMUX_PKG_MAINTAINER="@termux" +# Update both make and make-guile to the same version in one PR. +TERMUX_PKG_VERSION=4.3 +TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/make/make-${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19 +TERMUX_PKG_DEPENDS="guile" +TERMUX_PKG_BREAKS="make-dev" +TERMUX_PKG_REPLACES="make-dev" +TERMUX_PKG_GROUPS="base-devel" +# Prevent linking against libelf: +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_lib_elf_elf_begin=no" +# Prevent linking against libiconv: +TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" am_cv_func_iconv=no" + +# make-guile: +TERMUX_PKG_CONFLICTS="make" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-guile" + +termux_step_pre_configure() { + if [ "$TERMUX_ARCH" = arm ]; then + # Fix issue with make on arm hanging at least under cmake: + # https://github.com/termux/termux-packages/issues/2983 + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_pselect=no" + fi +} + +termux_step_make() { + # Allow to bootstrap make if building on device without make installed. + if $TERMUX_ON_DEVICE_BUILD && [ -z "$(command -v make)" ]; then + ./build.sh + else + make -j $TERMUX_MAKE_PROCESSES + fi +} + +termux_step_make_install() { + if $TERMUX_ON_DEVICE_BUILD && [ -z "$(command -v make)" ]; then + ./make -j 1 install + else + make -j 1 install + fi +} diff --git a/packages/make-guile/src-job.c.patch b/packages/make-guile/src-job.c.patch new file mode 100644 index 000000000..eb9f822e3 --- /dev/null +++ b/packages/make-guile/src-job.c.patch @@ -0,0 +1,12 @@ +diff -u -r ../make-4.3/src/job.c ./src/job.c +--- ../make-4.3/src/job.c 2020-01-19 20:32:59.000000000 +0000 ++++ ./src/job.c 2020-01-22 11:01:36.728655000 +0000 +@@ -77,7 +77,7 @@ + + #else + +-const char *default_shell = "/bin/sh"; ++const char *default_shell = "@TERMUX_PREFIX@/bin/sh"; + int batch_mode_shell = 0; + + #endif diff --git a/packages/make-guile/src-output.c.patch b/packages/make-guile/src-output.c.patch new file mode 100644 index 000000000..3f58fdd7f --- /dev/null +++ b/packages/make-guile/src-output.c.patch @@ -0,0 +1,15 @@ +diff -u -r ../make-4.3/src/output.c ./src/output.c +--- ../make-4.3/src/output.c 2020-01-03 07:11:27.000000000 +0000 ++++ ./src/output.c 2020-01-22 11:04:03.593327000 +0000 +@@ -150,7 +150,10 @@ + static void + set_append_mode (int fd) + { +-#if defined(F_GETFL) && defined(F_SETFL) && defined(O_APPEND) ++#ifdef __ANDROID__ ++ /* SELinux has a deny rule for append on stderr (eg. SCM_RIGHTS returns MSG_CTRUNC) */ ++ if (isatty(fd)) return; ++#elif defined(F_GETFL) && defined(F_SETFL) && defined(O_APPEND) + int flags = fcntl (fd, F_GETFL, 0); + if (flags >= 0) + { diff --git a/packages/make/build.sh b/packages/make/build.sh index 925979af3..93864efcf 100644 --- a/packages/make/build.sh +++ b/packages/make/build.sh @@ -2,8 +2,9 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/make/ TERMUX_PKG_DESCRIPTION="Tool to control the generation of non-source files from source files" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="@termux" +# Update both make and make-guile to the same version in one PR. TERMUX_PKG_VERSION=4.3 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/make/make-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19 TERMUX_PKG_BREAKS="make-dev" @@ -11,13 +12,19 @@ TERMUX_PKG_REPLACES="make-dev" TERMUX_PKG_GROUPS="base-devel" # Prevent linking against libelf: TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_lib_elf_elf_begin=no" +# Prevent linking against libiconv: +TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" am_cv_func_iconv=no" + +TERMUX_PKG_CONFLICTS="make-guile" +# Prevent linking against guile: +TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --without-guile" termux_step_pre_configure() { - if [ "$TERMUX_ARCH" = arm ]; then - # Fix issue with make on arm hanging at least under cmake: - # https://github.com/termux/termux-packages/issues/2983 - TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_pselect=no" - fi + if [ "$TERMUX_ARCH" = arm ]; then + # Fix issue with make on arm hanging at least under cmake: + # https://github.com/termux/termux-packages/issues/2983 + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_pselect=no" + fi } termux_step_make() {