diff --git a/x11-packages/mogan/build.sh b/x11-packages/mogan/build.sh index f05b7fd1f50..265731dbd42 100644 --- a/x11-packages/mogan/build.sh +++ b/x11-packages/mogan/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="A structure editor forked from GNU TeXmacs" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="1.2.9.8" -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/XmacsLabs/mogan/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=70af74dad16816a8097b877dc4cd94202f35517468ab54f6ae6f84ede32746fb TERMUX_PKG_DEPENDS="freetype, ghostscript, libandroid-complex-math, libandroid-execinfo, libandroid-spawn, libandroid-wordexp, libc++, libcurl, libgit2, libiconv, libjpeg-turbo, libpng, qt6-qtbase, qt6-qtsvg, zlib" @@ -33,6 +33,8 @@ termux_step_post_get_source() { > "${TERMUX_PKG_SRCDIR}"/xmake/packages/l/lolly/lolly.diff cp -f "${TERMUX_PKG_BUILDER_DIR}"/s7.diff \ "${TERMUX_PKG_SRCDIR}"/xmake/packages/s/s7/s7.diff + cp -f "${TERMUX_PKG_BUILDER_DIR}"/moebius.diff \ + "${TERMUX_PKG_SRCDIR}"/xmake/packages/m/moebius/moebius.diff } termux_step_pre_configure() { @@ -45,6 +47,22 @@ termux_step_pre_configure() { # xmake tests -ldl wrongly? LD="${CXX}" + # allows 'scripts/run-docker.sh ./build-package,sh -I -f -a all mogan' to work + # without causing 'ld.lld: error: /home/builder/.xmake/packages/s/s7/ + # 20241122/2613d5544f43431dad530be0c61b8a28/lib/libs7.a(s7.c.o) + # is incompatible with armelf_linux_eabi' + export XMAKE_GLOBALDIR="$TERMUX_PKG_TMPDIR" + + # for some reason building mogan can corrupt $TERMUX_PREFIX/lib/libcurl.so + # and /home/builder/.termux-build/_cache/xmake-2.9.5/bin/xmake , + # but if they are backed up, then restored when the build completes, the chance + # of ruining the builds of other packages after mogan (including repeated builds of mogan) + # is reduced. + mkdir -p "$TERMUX_PKG_TMPDIR/backup_dir" + export XMAKE_ORIG=$(command -v xmake) + cp "$TERMUX_PREFIX/lib/libcurl.so" "$TERMUX_PKG_TMPDIR/backup_dir/libcurl.so" + cp "$XMAKE_ORIG" "$TERMUX_PKG_TMPDIR/backup_dir/xmake" + if [[ "${TERMUX_ON_DEVICE_BUILD}" == "false" ]]; then install -Dm755 "${TERMUX_PKG_BUILDER_DIR}/qmake.sh" "${TERMUX_PKG_TMPDIR}/qmake" sed -e "s|@TERMUX_PREFIX@|${TERMUX_PREFIX}|g" -i "${TERMUX_PKG_TMPDIR}/qmake" @@ -93,3 +111,8 @@ termux_step_make_install() { -o "${TERMUX_PREFIX}" \ research } + +termux_step_post_make_install() { + cp "$TERMUX_PKG_TMPDIR/backup_dir/libcurl.so" "$TERMUX_PREFIX/lib/libcurl.so" + cp "$TERMUX_PKG_TMPDIR/backup_dir/xmake" "$XMAKE_ORIG" +} diff --git a/x11-packages/mogan/lolly.diff b/x11-packages/mogan/lolly.diff index 84db7ebcc9f..ccf86b24a1c 100644 --- a/x11-packages/mogan/lolly.diff +++ b/x11-packages/mogan/lolly.diff @@ -1,3 +1,7 @@ +file.cpp: prepend @TERMUX_PREFIX@ to /tmp path + +hashtree.ipp: https://github.com/MoganLab/lolly/pull/346 + --- a/System/Files/file.cpp +++ b/System/Files/file.cpp @@ -290,7 +290,7 @@ @@ -9,3 +13,14 @@ #endif static url tmp_dir= main_tmp_dir * url (as_string (get_process_id ())); return (tmp_dir); +--- a/Kernel/Containers/hashtree.ipp ++++ b/Kernel/Containers/hashtree.ipp +@@ -102,7 +102,7 @@ hashtree::operator->(void) { + template + inline hashtree + hashtree::operator[] (K key) { +- if (*this->contains (key)) return *this->children (key); ++ if ((*this)->contains (key)) return (*this)->children (key); + else TM_FAILED ("read-access to non-existent node requested"); + } + diff --git a/x11-packages/mogan/moebius.diff b/x11-packages/mogan/moebius.diff new file mode 100644 index 00000000000..c039d045f23 --- /dev/null +++ b/x11-packages/mogan/moebius.diff @@ -0,0 +1,13 @@ +Prevents the error about "please add -DCMAKE_POLICY_VERSION_MINIMUM=3.5" + +--- a/xmake.lua ++++ b/xmake.lua +@@ -32,7 +32,7 @@ local moe_includedirs = { + + add_repositories("moe-repo xmake") + +-local DOCTEST_VERSION = "2.4.11" ++local DOCTEST_VERSION = "2.4.12" + + add_requires("lolly") + local tbox_configs = {hash=true, ["force-utf8"]=true, charset=true} diff --git a/x11-packages/mogan/xmake-packages-l-lolly.patch b/x11-packages/mogan/xmake-packages-l-lolly.patch index 095c666e9ba..60518235337 100644 --- a/x11-packages/mogan/xmake-packages-l-lolly.patch +++ b/x11-packages/mogan/xmake-packages-l-lolly.patch @@ -4,7 +4,7 @@ add_urls("https://github.com/XmacsLabs/lolly.git") add_urls("https://gitee.com/XmacsLabs/lolly.git") add_versions("1.4.28", "v1.4.28") -+ add_patches("1.4.28", "lolly.diff", "b5253738e894c2f5d6633da8c33959f0e64f8daf71f9a147651b03f50f2ded1a") ++ add_patches("1.4.28", "lolly.diff", "d58775888f5ec760422bcdc61fd84424204e7a5297b42ceedcdbb93a9b08530d") add_deps("tbox") if not is_plat("wasm") then diff --git a/x11-packages/mogan/xmake-packages-m-moebius.patch b/x11-packages/mogan/xmake-packages-m-moebius.patch new file mode 100644 index 00000000000..4d6893d2b38 --- /dev/null +++ b/x11-packages/mogan/xmake-packages-m-moebius.patch @@ -0,0 +1,12 @@ +diff --git a/xmake/packages/m/moebius/xmake.lua b/xmake/packages/m/moebius/xmake.lua +index 233b876..8c30731 100644 +--- a/xmake/packages/m/moebius/xmake.lua ++++ b/xmake/packages/m/moebius/xmake.lua +@@ -25,6 +25,7 @@ package("moebius") + add_urls("https://github.com/XmacsLabs/moebius.git") + add_urls("https://gitee.com/XmacsLabs/moebius.git") + add_versions("0.1.21", "v0.1.21") ++ add_patches("0.1.21", "moebius.diff", "6ddd295110dd2c224f9ffe3a94ba16209df1a86f9d3522d047b847090b0456f8") + + add_deps("lolly") +