Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion x11-packages/mogan/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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() {
Expand All @@ -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"
Expand Down Expand Up @@ -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"
}
15 changes: 15 additions & 0 deletions x11-packages/mogan/lolly.diff
Original file line number Diff line number Diff line change
@@ -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 @@
Expand All @@ -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<K, V>::operator->(void) {
template <class K, class V>
inline hashtree<K, V>
hashtree<K, V>::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");
}

13 changes: 13 additions & 0 deletions x11-packages/mogan/moebius.diff
Original file line number Diff line number Diff line change
@@ -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}
2 changes: 1 addition & 1 deletion x11-packages/mogan/xmake-packages-l-lolly.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions x11-packages/mogan/xmake-packages-m-moebius.patch
Original file line number Diff line number Diff line change
@@ -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")