From b70ac50486f26872e1025759087c6e129ec04dad Mon Sep 17 00:00:00 2001 From: Ronald Y Date: Tue, 24 Sep 2024 20:46:50 +0800 Subject: [PATCH] new package: libreoffice-still --- ...-configure-error-and-disable-isystem.patch | 72 ++++++ .../0002-fix-shebang-for-ondevice.patch | 23 ++ .../0003-no-static_cast-__fsword_t.patch | 30 +++ .../libreoffice-still/0004-no-lcpaper.patch | 26 ++ ...05-apply-some-android-specific-patch.patch | 186 ++++++++++++++ .../0006-icu-74-compatibility.patch | 228 ++++++++++++++++++ .../0007-tmpdir-and-proc-version.patch | 51 ++++ .../0008-no-clean-destdir.patch | 28 +++ tur-on-device/libreoffice-still/build.sh | 148 ++++++++++++ 9 files changed, 792 insertions(+) create mode 100644 tur-on-device/libreoffice-still/0001-configure-error-and-disable-isystem.patch create mode 100644 tur-on-device/libreoffice-still/0002-fix-shebang-for-ondevice.patch create mode 100644 tur-on-device/libreoffice-still/0003-no-static_cast-__fsword_t.patch create mode 100644 tur-on-device/libreoffice-still/0004-no-lcpaper.patch create mode 100644 tur-on-device/libreoffice-still/0005-apply-some-android-specific-patch.patch create mode 100644 tur-on-device/libreoffice-still/0006-icu-74-compatibility.patch create mode 100644 tur-on-device/libreoffice-still/0007-tmpdir-and-proc-version.patch create mode 100644 tur-on-device/libreoffice-still/0008-no-clean-destdir.patch create mode 100644 tur-on-device/libreoffice-still/build.sh diff --git a/tur-on-device/libreoffice-still/0001-configure-error-and-disable-isystem.patch b/tur-on-device/libreoffice-still/0001-configure-error-and-disable-isystem.patch new file mode 100644 index 000000000..b01fe9d43 --- /dev/null +++ b/tur-on-device/libreoffice-still/0001-configure-error-and-disable-isystem.patch @@ -0,0 +1,72 @@ +From 8f05899b0b9ee8817ceec610589341a8b9cb3a4d Mon Sep 17 00:00:00 2001 +From: Ronald Y +Date: Sun, 22 Sep 2024 09:21:18 +0800 +Subject: [PATCH 1/8] configure-error-and-disable-isystem + +Change-Id: I70125356c9306f442fd5c2ec8343b55019cd118b +--- + configure.ac | 27 ++++----------------------- + 1 file changed, 4 insertions(+), 23 deletions(-) + +diff --git a/configure.ac b/configure.ac +index d31963fce..5bda2889d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -4058,26 +4058,7 @@ AC_SUBST(ENABLE_WASM_STRIP) + AC_SUBST(ENABLE_WASM_STRIP_WRITER) + AC_SUBST(ENABLE_WASM_STRIP_CALC) + +-# Use -isystem (gcc) if possible, to avoid warnings in 3rd party headers. +-# NOTE: must _not_ be used for bundled external libraries! +-ISYSTEM= +-if test "$GCC" = "yes"; then +- AC_MSG_CHECKING( for -isystem ) +- save_CFLAGS=$CFLAGS +- CFLAGS="$CFLAGS -isystem /usr/include -Werror" +- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM="-isystem " ],[]) +- CFLAGS=$save_CFLAGS +- if test -n "$ISYSTEM"; then +- AC_MSG_RESULT(yes) +- else +- AC_MSG_RESULT(no) +- fi +-fi +-if test -z "$ISYSTEM"; then +- # fall back to using -I +- ISYSTEM=-I +-fi +-AC_SUBST(ISYSTEM) ++ISYSTEM=-I + + dnl =================================================================== + dnl Check which Visual Studio compiler is used +@@ -11304,7 +11285,7 @@ else + save_CXXFLAGS=$CXXFLAGS + save_IFS=$IFS + IFS=$P_SEP +- for i in $CPLUS_INCLUDE_PATH /usr/include; do ++ for i in $CPLUS_INCLUDE_PATH /data/data/com.termux/files/usr/include; do + dnl Reset IFS as soon as possible, to avoid unexpected side effects (and the + dnl "/usr/include" fallback makes sure we get here at least once; resetting rather than + dnl unsetting follows the advice at = 1.14 development package])], []) + AC_CHECK_HEADER(gpgme.h, [], + [AC_MSG_ERROR([gpgme headers not found, install gpgme development package])], []) +@@ -15065,7 +15046,7 @@ AC_SUBST(PERL) + if test -n "$TMPDIR"; then + TEMP_DIRECTORY="$TMPDIR" + else +- TEMP_DIRECTORY="/tmp" ++ TEMP_DIRECTORY="/data/data/com.termux/files/usr/tmp" + fi + CYGWIN_BASH="C:/cygwin64/bin/bash.exe" + if test "$build_os" = "cygwin"; then +-- +2.46.1 + diff --git a/tur-on-device/libreoffice-still/0002-fix-shebang-for-ondevice.patch b/tur-on-device/libreoffice-still/0002-fix-shebang-for-ondevice.patch new file mode 100644 index 000000000..e8cb2cdab --- /dev/null +++ b/tur-on-device/libreoffice-still/0002-fix-shebang-for-ondevice.patch @@ -0,0 +1,23 @@ +From 72e2caaba9acf182f6e7807d06b3344a03c39845 Mon Sep 17 00:00:00 2001 +From: Ronald Y +Date: Sun, 22 Sep 2024 09:24:40 +0800 +Subject: [PATCH 2/8] fix-shebang-for-ondevice + +Change-Id: I272c11cb236cfa7cac305b449cd64b82d7e8f0f2 +--- + solenv/bin/install-gdb-printers | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/solenv/bin/install-gdb-printers b/solenv/bin/install-gdb-printers +index 3eae4d9ef..2db5b9953 100755 +--- a/solenv/bin/install-gdb-printers ++++ b/solenv/bin/install-gdb-printers +@@ -1,4 +1,4 @@ +-#!/usr/bin/env bash ++#!/data/data/com.termux/files/usr/bin/env bash + # + # This file is part of the LibreOffice project. + # +-- +2.46.1 + diff --git a/tur-on-device/libreoffice-still/0003-no-static_cast-__fsword_t.patch b/tur-on-device/libreoffice-still/0003-no-static_cast-__fsword_t.patch new file mode 100644 index 000000000..ba86b7413 --- /dev/null +++ b/tur-on-device/libreoffice-still/0003-no-static_cast-__fsword_t.patch @@ -0,0 +1,30 @@ +From 2166ab3cc0c5c0f9130b440bef3c0b7e75a64f49 Mon Sep 17 00:00:00 2001 +From: Ronald Y +Date: Sun, 22 Sep 2024 09:25:14 +0800 +Subject: [PATCH 3/8] no-static_cast-__fsword_t + +Change-Id: I61efb86c0aeda762acd7d32d9a5bd770a682ab5a +--- + sal/osl/unx/file.cxx | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx +index ee7412dd1..0ca882201 100644 +--- a/sal/osl/unx/file.cxx ++++ b/sal/osl/unx/file.cxx +@@ -67,9 +67,9 @@ + #ifdef LINUX + #include + // As documented by the kernel +-#define SMB_SUPER_MAGIC static_cast<__fsword_t>(0x517B) +-#define CIFS_SUPER_MAGIC static_cast<__fsword_t>(0xFF534D42) +-#define SMB2_SUPER_MAGIC static_cast<__fsword_t>(0xFE534D42) ++#define SMB_SUPER_MAGIC 0x517B ++#define CIFS_SUPER_MAGIC 0xFF534D42 ++#define SMB2_SUPER_MAGIC 0xFE534D42 + #endif + + namespace { +-- +2.46.1 + diff --git a/tur-on-device/libreoffice-still/0004-no-lcpaper.patch b/tur-on-device/libreoffice-still/0004-no-lcpaper.patch new file mode 100644 index 000000000..6150eb924 --- /dev/null +++ b/tur-on-device/libreoffice-still/0004-no-lcpaper.patch @@ -0,0 +1,26 @@ +From 99384fd9126b6408bd9ef30f8fbe524e13c85d13 Mon Sep 17 00:00:00 2001 +From: Ronald Y +Date: Sun, 22 Sep 2024 09:25:48 +0800 +Subject: [PATCH 4/8] no-lcpaper + +Change-Id: I23f35718a2fe6e1d2f27b552149a3eaca78b5e57 +--- + i18nutil/source/utility/paper.cxx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx +index 399b3295e..745c22a3a 100644 +--- a/i18nutil/source/utility/paper.cxx ++++ b/i18nutil/source/utility/paper.cxx +@@ -310,7 +310,7 @@ PaperInfo PaperInfo::getSystemDefaultPaper() + #endif + + // _NL_PAPER_WIDTH / HEIGHT not available with android unified headers +-#if defined(LC_PAPER) && defined(_GNU_SOURCE) && !defined(ANDROID) ++#if defined(LC_PAPER) && defined(_GNU_SOURCE) && !defined(__ANDROID__) + // try LC_PAPER + locale_t loc = newlocale(LC_PAPER_MASK, "", static_cast(0)); + if (loc != static_cast(0)) +-- +2.46.1 + diff --git a/tur-on-device/libreoffice-still/0005-apply-some-android-specific-patch.patch b/tur-on-device/libreoffice-still/0005-apply-some-android-specific-patch.patch new file mode 100644 index 000000000..d2a477639 --- /dev/null +++ b/tur-on-device/libreoffice-still/0005-apply-some-android-specific-patch.patch @@ -0,0 +1,186 @@ +From 62c87df518bb297c44a9fc66ad26a81a7b85057c Mon Sep 17 00:00:00 2001 +From: Ronald Y +Date: Sun, 22 Sep 2024 09:27:21 +0800 +Subject: [PATCH 5/8] apply some android-specific patch + +Change-Id: I4be7216701e300369a2ccde7b57fe0966d0645b5 +--- + .../cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx | 2 +- + bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx | 2 +- + bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx | 4 ++-- + bridges/source/cpp_uno/gcc3_linux_arm/except.cxx | 10 +++++----- + bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx | 8 ++++---- + desktop/source/app/app.cxx | 6 +++--- + 6 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx +index b944f31cf..84cf10fa4 100644 +--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx ++++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/callvirtualfunction.cxx +@@ -55,7 +55,7 @@ void callVirtualFunction( + "m" (stackargs) // dummy input to prevent optimizing the alloca away + : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", + "r11", "r12", "r13", "r14", "r15", "r16", "r17", +-#if !defined ANDROID && !defined MACOSX ++#if !defined __ANDROID__ && !defined MACOSX + "r18"/*TODO?*/, + #endif + "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8", "v9", "v10", "v11", +diff --git a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx +index 669c4443c..bb3c2fcbd 100644 +--- a/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx ++++ b/bridges/source/cpp_uno/gcc3_linux_aarch64/cpp2uno.cxx +@@ -583,7 +583,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( + void bridges::cpp_uno::shared::VtableFactory::flushCode( + unsigned char const * begin, unsigned char const * end) + { +-#if !defined ANDROID && !defined MACOSX ++#if !defined __ANDROID__ && !defined MACOSX + static void (*clear_cache)(unsigned char const *, unsigned char const *) + = (void (*)(unsigned char const *, unsigned char const *)) dlsym( + RTLD_DEFAULT, "__clear_cache"); +diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx +index f476cf7df..37636b0d2 100644 +--- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx ++++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx +@@ -38,7 +38,7 @@ + + #include + +-#ifdef ANDROID ++#ifdef __ANDROID__ + #include + #endif + +@@ -580,7 +580,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( + void bridges::cpp_uno::shared::VtableFactory::flushCode( + unsigned char const *beg, unsigned char const *end) + { +-#ifndef ANDROID ++#ifndef __ANDROID__ + static void (*clear_cache)(unsigned char const*, unsigned char const*) + = reinterpret_cast + (dlsym(RTLD_DEFAULT, "__clear_cache")); +diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx +index 14bffa75a..8a6dfe6d5 100644 +--- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx ++++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx +@@ -94,7 +94,7 @@ namespace { + t_rtti_map m_rttis; + t_rtti_map m_generatedRttis; + +-#ifndef ANDROID ++#ifndef __ANDROID__ + void * m_hApp; + #endif + +@@ -107,7 +107,7 @@ namespace { + } + + RTTI::RTTI() +-#ifndef ANDROID ++#ifndef __ANDROID__ + : m_hApp( dlopen( nullptr, RTLD_LAZY ) ) + #endif + { +@@ -115,7 +115,7 @@ namespace { + + RTTI::~RTTI() + { +-#ifndef ANDROID ++#ifndef __ANDROID__ + dlclose( m_hApp ); + #endif + } +@@ -146,7 +146,7 @@ namespace { + buf.append( 'E' ); + + OString symName( buf.makeStringAndClear() ); +-#ifndef ANDROID ++#ifndef __ANDROID__ + rtti = static_cast(dlsym( m_hApp, symName.getStr() )); + #else + rtti = (type_info *)dlsym( RTLD_DEFAULT, symName.getStr() ); +@@ -170,7 +170,7 @@ namespace { + // symbol and rtti-name is nearly identical, + // the symbol is prefixed with _ZTI + +-#ifdef ANDROID ++#ifdef __ANDROID__ + // This code is supposed to be used only used for + // inter-process UNO, says sberg. Thus it should + // be unnecessary and never reached for +diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx +index 9bce77bc8..a5bfc5b0e 100644 +--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx ++++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx +@@ -78,7 +78,7 @@ class RTTI + std::vector m_rttiNames; + std::unordered_map> m_generatedRttis; + +-#if !defined ANDROID ++#if !defined __ANDROID__ + void * m_hApp; + #endif + +@@ -90,7 +90,7 @@ public: + }; + + RTTI::RTTI() +-#if !defined ANDROID ++#if !defined __ANDROID__ + : m_hApp( dlopen( nullptr, RTLD_LAZY ) ) + #endif + { +@@ -98,7 +98,7 @@ RTTI::RTTI() + + RTTI::~RTTI() + { +-#if !defined ANDROID ++#if !defined __ANDROID__ + dlclose( m_hApp ); + #endif + } +@@ -128,7 +128,7 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr) + buf.append( 'E' ); + + OString symName( buf.makeStringAndClear() ); +-#if !defined ANDROID ++#if !defined __ANDROID__ + rtti = static_cast(dlsym( m_hApp, symName.getStr() )); + #else + rtti = static_cast(dlsym( RTLD_DEFAULT, symName.getStr() )); +diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx +index 0d66a48da..82160e1a7 100644 +--- a/desktop/source/app/app.cxx ++++ b/desktop/source/app/app.cxx +@@ -505,7 +505,7 @@ void Desktop::Init() + RequestHandler::Status aStatus = RequestHandler::Enable(true); + if ( aStatus == RequestHandler::IPC_STATUS_PIPE_ERROR ) + { +-#if defined(ANDROID) || defined(EMSCRIPTEN) ++#if defined(__ANDROID__) || defined(EMSCRIPTEN) + // Ignore crack pipe errors on Android + #else + // Keep using this oddly named BE_PATHINFO_MISSING value +@@ -917,7 +917,7 @@ void handleCrashReport() + } + #endif + +-#if !defined ANDROID ++#if !defined __ANDROID__ + void handleSafeMode() + { + css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); +@@ -1973,7 +1973,7 @@ void Desktop::OpenClients() + // need some time, where the user won't see any results and wait for finishing the office startup... + bool bAllowRecoveryAndSessionManagement = ( !rArgs.IsNoRestore() ) && ( !rArgs.IsHeadless() ); + +-#if !defined ANDROID ++#if !defined __ANDROID__ + // Enter safe mode if requested + if (Application::IsSafeModeEnabled()) { + handleSafeMode(); +-- +2.46.1 + diff --git a/tur-on-device/libreoffice-still/0006-icu-74-compatibility.patch b/tur-on-device/libreoffice-still/0006-icu-74-compatibility.patch new file mode 100644 index 000000000..96caad0a7 --- /dev/null +++ b/tur-on-device/libreoffice-still/0006-icu-74-compatibility.patch @@ -0,0 +1,228 @@ +From 31baff5c7cdbd4f70b022c8ef81f3f59eae976d1 Mon Sep 17 00:00:00 2001 +From: Ronald Y +Date: Sun, 22 Sep 2024 09:29:02 +0800 +Subject: [PATCH 6/8] icu 74+ compatibility + +Change-Id: Ic8e51d16e121ade7f2036c21e402d5a6f38a73e0 +--- + i18npool/source/breakiterator/data/line.txt | 87 ++++++++++----------- + i18npool/source/breakiterator/data/sent.txt | 1 - + 2 files changed, 43 insertions(+), 45 deletions(-) + +diff --git a/i18npool/source/breakiterator/data/line.txt b/i18npool/source/breakiterator/data/line.txt +index ff3f3eafc..206e212c7 100644 +--- a/i18npool/source/breakiterator/data/line.txt ++++ b/i18npool/source/breakiterator/data/line.txt +@@ -14,7 +14,6 @@ + # + + !!chain; +-!!LBCMNoChain; + + + !!lookAheadHardBreak; +@@ -206,13 +205,13 @@ $CR $LF {100}; + # + $LB4NonBreaks? $LB4Breaks {100}; # LB 5 do not break before hard breaks. + $CAN_CM $CM* $LB4Breaks {100}; +-$CM+ $LB4Breaks {100}; ++^$CM+ $LB4Breaks {100}; + + # LB 7 x SP + # x ZW + $LB4NonBreaks [$SP $ZW]; + $CAN_CM $CM* [$SP $ZW]; +-$CM+ [$SP $ZW]; ++^$CM+ [$SP $ZW]; + + # + # LB 8 Break after zero width space +@@ -226,14 +225,14 @@ $LB8NonBreaks = [[$LB4NonBreaks] - [$ZW]]; + # See definition of $CAN_CM. + + $CAN_CM $CM+; # Stick together any combining sequences that don't match other rules. +-$CM+; ++^$CM+; + + # + # LB 11 Do not break before or after WORD JOINER & related characters. + # + $CAN_CM $CM* $WJcm; + $LB8NonBreaks $WJcm; +-$CM+ $WJcm; ++^$CM+ $WJcm; + + $WJcm [^$CAN_CM]; + $WJcm $CAN_CM $CM*; +@@ -243,7 +242,7 @@ $WJcm $CAN_CM $CM*; + # + # (!SP) x GL + [$LB8NonBreaks-$SP] $CM* $GLcm; +-$CM+ $GLcm; ++^$CM+ $GLcm; + + # GL x + $GLcm ($LB8Breaks | $SP); +@@ -260,19 +259,19 @@ $GLcm [$LB8NonBreaks-$SP] $CM*; # Don't let a combining mark go onto $CR, $B + # + $LB8NonBreaks $CL; + $CAN_CM $CM* $CL; +-$CM+ $CL; # by rule 10, stand-alone CM behaves as AL ++^$CM+ $CL; # by rule 10, stand-alone CM behaves as AL + + $LB8NonBreaks $EX; + $CAN_CM $CM* $EX; +-$CM+ $EX; # by rule 10, stand-alone CM behaves as AL ++^$CM+ $EX; # by rule 10, stand-alone CM behaves as AL + + $LB8NonBreaks $IS; + $CAN_CM $CM* $IS; +-$CM+ $IS; # by rule 10, stand-alone CM behaves as AL ++^$CM+ $IS; # by rule 10, stand-alone CM behaves as AL + + $LB8NonBreaks $SY; + $CAN_CM $CM* $SY; +-$CM+ $SY; # by rule 10, stand-alone CM behaves as AL ++^$CM+ $SY; # by rule 10, stand-alone CM behaves as AL + + + # +@@ -302,7 +301,7 @@ $LB18Breaks = [$LB8Breaks $SP]; + # LB 19 + # x QU + $LB18NonBreaks $CM* $QUcm; +-$CM+ $QUcm; ++^$CM+ $QUcm; + + # QU x + $QUcm .?; +@@ -331,7 +330,7 @@ $HLcm ($HYcm | $BAcm) [^$CB]?; + + # LB 22 + ($ALcm | $HLcm) $INcm; +-$CM+ $INcm; # by rule 10, any otherwise unattached CM behaves as AL ++^$CM+ $INcm; # by rule 10, any otherwise unattached CM behaves as AL + $IDcm $INcm; + $INcm $INcm; + $NUcm $INcm; +@@ -341,7 +340,7 @@ $NUcm $INcm; + $IDcm $POcm; + $ALcm $NUcm; # includes $LB19 + $HLcm $NUcm; +-$CM+ $NUcm; # Rule 10, any otherwise unattached CM behaves as AL ++^$CM+ $NUcm; # Rule 10, any otherwise unattached CM behaves as AL + $NUcm $ALcm; + $NUcm $HLcm; + +@@ -373,7 +372,7 @@ $PRcm ($JLcm | $JVcm | $JTcm | $H2cm | $H3cm); + # LB 28 Do not break between alphabetics + # + ($ALcm | $HLcm) ($ALcm | $HLcm); +-$CM+ ($ALcm | $HLcm); # The $CM+ is from rule 10, an unattached CM is treated as AL ++^$CM+ ($ALcm | $HLcm); # The $CM+ is from rule 10, an unattached CM is treated as AL + + # LB 29 + $IScm ($ALcm | $NUcm); +@@ -383,7 +382,7 @@ $IScm ($ALcm | $NUcm); + # and opening or closing punctuation + # + ($ALcm | $HLcm | $NUcm) $OPcm; +-$CM+ $OPcm; ++^$CM+ $OPcm; + $CLcm ($ALcm | $HLcm | $NUcm); + + # +@@ -393,32 +392,32 @@ $CLcm ($ALcm | $HLcm | $NUcm); + + !!reverse; + +-$CM+ $ALPlus; +-$CM+ $BA; +-$CM+ $BB; +-$CM+ $B2; +-$CM+ $CL; +-$CM+ $EX; +-$CM+ $GL; +-$CM+ $HL; +-$CM+ $HY; +-$CM+ $H2; +-$CM+ $H3; +-$CM+ $ID; +-$CM+ $IN; +-$CM+ $IS; +-$CM+ $JL; +-$CM+ $JV; +-$CM+ $JT; +-$CM+ $NS; +-$CM+ $NU; +-$CM+ $OP; +-$CM+ $PO; +-$CM+ $PR; +-$CM+ $QU; +-$CM+ $SY; +-$CM+ $WJ; +-$CM+; ++^$CM+ $ALPlus; ++^$CM+ $BA; ++^$CM+ $BB; ++^$CM+ $B2; ++^$CM+ $CL; ++^$CM+ $EX; ++^$CM+ $GL; ++^$CM+ $HL; ++^$CM+ $HY; ++^$CM+ $H2; ++^$CM+ $H3; ++^$CM+ $ID; ++^$CM+ $IN; ++^$CM+ $IS; ++^$CM+ $JL; ++^$CM+ $JV; ++^$CM+ $JT; ++^$CM+ $NS; ++^$CM+ $NU; ++^$CM+ $OP; ++^$CM+ $PO; ++^$CM+ $PR; ++^$CM+ $QU; ++^$CM+ $SY; ++^$CM+ $WJ; ++^$CM+; + + + # +@@ -468,7 +467,7 @@ $LF $CR; + # X $CM needs to behave like X, where X is not $SP or controls. + # $CM not covered by the above needs to behave like $AL + # Stick together any combining sequences that don't match other rules. +-$CM+ $CAN_CM; ++^$CM+ $CAN_CM; + + + # LB 11 +@@ -606,8 +605,8 @@ $CM* ($ALPlus | $HL | $NU) $CM* ($CL | $SY)+ [^$SP]; + !!safe_reverse; + + # LB 7 +-$CM+ [^$CM $BK $CR $LF $NL $ZW $SP]; +-$CM+ $SP / .; ++^$CM+ [^$CM $BK $CR $LF $NL $ZW $SP]; ++^$CM+ $SP / .; + + # LB 9 + $SP+ $CM* $OP; +diff --git a/i18npool/source/breakiterator/data/sent.txt b/i18npool/source/breakiterator/data/sent.txt +index 7fada89e6..5b8c1d6a1 100644 +--- a/i18npool/source/breakiterator/data/sent.txt ++++ b/i18npool/source/breakiterator/data/sent.txt +@@ -106,7 +106,6 @@ $CloseEx_R = ($Extend | $Format)* $Close; + # builder. Needs more investigation. + # + +-[{bof}] (.? | $LF $CR) [^$Sep]* [$Sep {eof}] ($SpEx_R* $CloseEx_R* ($STermEx_R | $ATermEx_R))*; + #.*; + + # Explanation for this rule: +-- +2.46.1 + diff --git a/tur-on-device/libreoffice-still/0007-tmpdir-and-proc-version.patch b/tur-on-device/libreoffice-still/0007-tmpdir-and-proc-version.patch new file mode 100644 index 000000000..d48ac4b9d --- /dev/null +++ b/tur-on-device/libreoffice-still/0007-tmpdir-and-proc-version.patch @@ -0,0 +1,51 @@ +From 8e1e644f2db77b8b6278daf66a63560c4563215f Mon Sep 17 00:00:00 2001 +From: Ronald Y +Date: Sun, 22 Sep 2024 20:00:47 +0800 +Subject: [PATCH 7/8] tmpdir and /proc/version + +Change-Id: If2f56ac807fbfcf80c27463da9c526419abdd1f8 +--- + desktop/unx/source/start.c | 6 +++--- + vcl/unx/generic/app/geninst.cxx | 2 +- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c +index 0bb009d9c..5e7a73f78 100644 +--- a/desktop/unx/source/start.c ++++ b/desktop/unx/source/start.c +@@ -38,8 +38,8 @@ + #include "pagein.h" + #include "splashx.h" + +-#define PIPEDEFAULTPATH "/tmp" +-#define PIPEALTERNATEPATH "/var/tmp" ++#define PIPEDEFAULTPATH "/data/data/com.termux/files/usr/tmp" ++#define PIPEALTERNATEPATH "/data/data/com.termux/files/usr/var/tmp" + + /* Easier conversions: rtl_uString to rtl_String */ + static rtl_String *ustr_to_str(rtl_uString *pStr) +@@ -556,7 +556,7 @@ static ProgressStatus read_percent(ChildInfo const *info, int *pPercent) + /* Simple system check. */ + static void system_checks(void) + { +-#ifdef LINUX ++#if defined LINUX && !defined __ANDROID__ + struct stat buf; + + /* check proc is mounted - lots of things fail otherwise */ +diff --git a/vcl/unx/generic/app/geninst.cxx b/vcl/unx/generic/app/geninst.cxx +index 191d87ca7..a40505345 100644 +--- a/vcl/unx/generic/app/geninst.cxx ++++ b/vcl/unx/generic/app/geninst.cxx +@@ -53,7 +53,7 @@ SalGenericInstance::~SalGenericInstance() + OUString SalGenericInstance::getOSVersion() + { + OUString aKernelVer = "unknown"; +-#if defined(LINUX) ++#if defined(LINUX) && !defined(__ANDROID__) + FILE* pVersion = fopen( "/proc/version", "r" ); + if ( pVersion ) + { +-- +2.46.1 + diff --git a/tur-on-device/libreoffice-still/0008-no-clean-destdir.patch b/tur-on-device/libreoffice-still/0008-no-clean-destdir.patch new file mode 100644 index 000000000..b23eabde6 --- /dev/null +++ b/tur-on-device/libreoffice-still/0008-no-clean-destdir.patch @@ -0,0 +1,28 @@ +From 0e600fd4dc02d7250efea7389eecd57664ba8ea0 Mon Sep 17 00:00:00 2001 +From: Ronald Y +Date: Tue, 24 Sep 2024 12:49:59 +0800 +Subject: [PATCH 8/8] no clean destdir + +Change-Id: Id9da2e78cb9aaa739823029467b68d0cdae221b4 +--- + solenv/bin/ooinstall | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/solenv/bin/ooinstall b/solenv/bin/ooinstall +index 71f10c739..39a959ef6 100755 +--- a/solenv/bin/ooinstall ++++ b/solenv/bin/ooinstall +@@ -81,10 +81,6 @@ if ($is_windows) { + # make distro-pack-install shuffle with the SDK installation to make it LSB compliant + # it creates symlinks from the original path to /usr/share; they are not valid with $DESTDIR + # and potential second ooinstall call fails with strange error messages if the old tree is still there +-if ($destdir && "$ENV{DESTDIR}" ne "/" && -d "$ENV{DESTDIR}") { +- print "Cleaning destdir...\n"; +- system ("rm -rf \"$ENV{DESTDIR}\"") && die "Failed to clean up destdir: $!"; +-} + + print "Running LibreOffice installer\n"; + +-- +2.46.1 + diff --git a/tur-on-device/libreoffice-still/build.sh b/tur-on-device/libreoffice-still/build.sh new file mode 100644 index 000000000..803ce49e8 --- /dev/null +++ b/tur-on-device/libreoffice-still/build.sh @@ -0,0 +1,148 @@ +TERMUX_PKG_HOMEPAGE=https://www.libreoffice.org/ +TERMUX_PKG_DESCRIPTION="LibreOffice branch which contains new features and program enhancements" +TERMUX_PKG_LICENSE="MPL-2.0, LGPL-3.0" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=24.2.6.2 +TERMUX_PKG_SRCURL=https://download.documentfoundation.org/libreoffice/src/${TERMUX_PKG_VERSION%.*}/libreoffice-$TERMUX_PKG_VERSION.tar.xz +TERMUX_PKG_SHA256=f6ea4df022696065b5dcdca4e28bf06906ac852df4ba6dc50aa8fe59c8e11db3 +TERMUX_PKG_DEPENDS="mdds, which, bison, hunspell, python, pango, libjpeg-turbo, libxrandr, libhyphen, libgraphite, libicu, libxslt, libglvnd, poppler, harfbuzz-icu, hicolor-icon-theme, desktop-file-utils, shared-mime-info, libxinerama, cups, littlecms, libwebp, libtommath, libatomic-ops, xmlsec, gpgme, libepoxy, libzxing-cpp, fontconfig, openldap, zlib, libpng, freetype, libraptor2, libxml2, libcairo, libx11, boost, libtiff, libxext, openjpeg, dbus, glm, openssl, argon2, curl, libcurl, libwpd, libwps, libneon, libnspr, redland, lpsolve, libvisio, libetonyek, libodfgen, libcdr, libmspub, libnss, clucene, libpagemaker, libabw, libmwaw, libe-book, liblangtag, libexttextcat, liborcus, libcmis, libzmf, libnumbertext, libfreehand, libstaroffice, libepubgen, libqxp, libexpat, librevenge, libwpg, xsltproc, libxml2-utils, libtommath-static, gobject-introspection, g-ir-scanner" +TERMUX_PKG_BUILD_DEPENDS="cppunit, gtk4, gtk3, qt6-qtbase, postgresql, unixodbc, mariadb, boost, boost-headers, icu-devtools, openjdk-17, openjdk-17-x, ant" +TERMUX_PKG_RECOMMENDS="openjdk-17, openjdk-17-x, gtk4, gtk3, qt6-qtbase, qt6-qtmultimedia" +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_BLACKLISTED_ARCHES="arm, i686" +# Ref: https://gitlab.archlinux.org/archlinux/packaging/packages/libreoffice-still/-/blob/main/PKGBUILD?ref_type=heads + +# TODO: patch and remove TERMUX_PKG_BLACKLISTED_ARCHES +# TODO: remove --disable-skia, some vulkan related compilation error I couldn't solve. +# TODO: add back qt6-qtmultimedia, which currently breaks tur-on-device building by installing subpackage of deps and conflicting woth other deps. +# TODO: see if we want to add back qt5-qtbase, qt5-qmake, qt5-qtx11extras, some qt5 compilation to be fix. +# TODO: see if we want to add junit pacakge for java unit test and remove --without-junit +# TODO: replace --enable-debug with --enable-release-build +# TODO: replace --without-system-xmlsec by --with-system-xmlsec whwn xmlsec-nss becomes available by PR + +## Set variables for building on my phone: +# TERMUX_PREFIX="$PREFIX" +# TERMUX_ARCH="aarch64" +# TERMUX_HOST_PLATFORM="$TERMUX_ARCH-linux-android" +# TERMUX_PKG_MAKE_PROCESSES=0 +# TERMUX_ON_DEVICE_BUILD="true" + +# TERMUX_PKG_EXTRA_MAKE_ARGS="--trace" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +--enable-debug + +--with-vendor=Termux +--enable-split-app-modules + +CC=$TERMUX_HOST_PLATFORM-clang +CXX=$TERMUX_HOST_PLATFORM-clang++ +--with-parallelism=$TERMUX_PKG_MAKE_PROCESSES +--host=$TERMUX_ARCH-linux + +--disable-sdremote +--disable-sdremote-bluetooth + +--enable-curl +--with-jdk-home=$TERMUX_PREFIX/lib/jvm/java-17-openjdk +--with-ant-home=$TERMUX_PREFIX/opt/ant +--without-junit +--without-webdav +--with-system-libcmis +--with-system-clucene +--without-system-xmlsec + +--with-system-librevenge +--with-system-libodfgen +--with-system-libepubgen +--with-system-libvisio +--with-system-libwpd +--with-system-libwpg +--with-system-libwps +--with-system-libcdr +--with-system-libmspub +--with-system-libmwaw +--with-system-libetonyek +--with-system-libfreehand +--with-system-libebook +--with-system-libabw +--with-system-libpagemaker +--with-system-libqxp +--with-system-libzmf +--with-system-libstaroffice + +--with-system-cppunit + +--with-system-libtommath +--with-system-mdds +--without-system-dragonbox +--without-system-frozen +--without-system-libfixmath +--without-system-hsqldb +--without-system-sane +--with-system-orcus +--with-system-redland +--without-system-box2d +--without-system-zxcvbn +--with-system-libexttextcat +--without-system-mythes +--with-system-libnumbertext +--disable-gstreamer-1-0 +--disable-avahi +--with-system-liblangtag + +--disable-coinmp +--enable-dbus +--enable-qt6 +--enable-gtk3 +--enable-gtk4 +--enable-introspection +--enable-openssl +--enable-python=system +--without-system-beanshell +--enable-scripting-beanshell +--enable-scripting-javascript +--with-system-gpgmepp +--disable-report-builder +--disable-dconf +--enable-ext-wiki-publisher +--enable-ext-nlpsolver +--without-fonts +--with-system-libxml +--without-myspell-dicts +--without-system-firebird +--with-system-zxing +--with-system-dicts +--with-external-dict-dir=$TERMUX_PREFIX/share/hunspell +--with-external-hyph-dir=$TERMUX_PREFIX/share/hyphen +--with-system-graphite +--with-system-glm +--with-system-boost +--with-system-icu +--with-system-cairo +--with-system-libs +--with-system-headers + +--disable-skia +--disable-firebird-sdbc + +--with-boost=$TERMUX_PREFIX +boost_cv_lib_tag= + +--disable-online-update +--disable-breakpad +--disable-dependency-tracking +" + +termux_step_pre_configure() { + if [ "$TERMUX_ON_DEVICE_BUILD" = "true" ]; then + termux-fix-shebang ./solenv/bin/* + fi + export CLUCENE_CFLAGS=" -std=c++11" + export qt6_libexec_dirs="$TERMUX_PREFIX/lib/qt6" + export LDFLAGS+=" -Wl,--undefined-version" + NOCONFIGURE=1 ./autogen.sh +} + +termux_step_make_install() { + make distro-pack-install +}