From 90d8dcdb965c1c2e7298f2cb3decb6784e651844 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 6 Sep 2023 14:39:47 -0400 Subject: [PATCH 01/16] user/onlyoffice-document-server: new aport --- user/onlyoffice-document-server/APKBUILD | 144 ++++++++++++++++++ .../build_tools-nerf-v8.patch | 47 ++++++ .../build_tools-untarget-pkg.patch | 22 +++ .../core_fix-musl-build.patch | 79 ++++++++++ .../server_fix-makefile.patch | 41 +++++ .../server_restore-mobile-editing.patch | 90 +++++++++++ .../web-apps_restore-mobile-editing.patch | 51 +++++++ 7 files changed, 474 insertions(+) create mode 100644 user/onlyoffice-document-server/APKBUILD create mode 100644 user/onlyoffice-document-server/build_tools-nerf-v8.patch create mode 100644 user/onlyoffice-document-server/build_tools-untarget-pkg.patch create mode 100644 user/onlyoffice-document-server/core_fix-musl-build.patch create mode 100644 user/onlyoffice-document-server/server_fix-makefile.patch create mode 100644 user/onlyoffice-document-server/server_restore-mobile-editing.patch create mode 100644 user/onlyoffice-document-server/web-apps_restore-mobile-editing.patch diff --git a/user/onlyoffice-document-server/APKBUILD b/user/onlyoffice-document-server/APKBUILD new file mode 100644 index 0000000..9540c67 --- /dev/null +++ b/user/onlyoffice-document-server/APKBUILD @@ -0,0 +1,144 @@ +# Contributor: Antoine Martin (ayakael) +# Maintainer: Antoine Martin (ayakael) + +pkgname=onlyoffice-document-server +pkgver=7.3.3 +_buildno=60 +_webtag=d26dc3f8736709e502e05f4daf50b29f96923b42 +pkgrel=0 +pkgdesc="ONLYOFFICE Docs is a free collaborative online office suite" +url="https://github.com/ONLYOFFICE/DocumentServer" +arch="x86_64" +license="AGPL-3.0" +makedepends=" + make + qt5-qtbase-dev + bash + g++ + nodejs + clang + npm + autoconf + automake + openjdk20-jdk + libxscrnsaver + libncurses++ + libxrender-dev + boost1.82-dev + boost1.82-libs + boost1.82-regex + boost1.82-system + boost1.82-filesystem + boost1.82-date_time + libxi-dev + libxcb-dev + libx11-dev + gst-plugins-base-dev + gstreamer-dev + glu + icu-dev + dbus-dev + cups-dev + at-spi2-core + harfbuzz-dev + alsa-lib + subversion + gzip + p7zip + libtool + libpulse + gtk+3.0-dev + glib-dev + nodejs-dev + " +options="!check" # No testsuite +source=" + $pkgname-$pkgver.tar.gz::https://lab.ilot.io/mirrors/onlyoffice-document-server/-/releases/v$pkgver/downloads/tarball/onlyoffice-document-server-v$pkgver.tar.gz + $pkgname-build_tools-$pkgver.$_buildno.tar.gz::https://github.com/ONLYOFFICE/build_tools/archive/refs/tags/v$pkgver.$_buildno.tar.gz + $pkgname-document-server-integration-$pkgver.$_buildno.tar.gz::https://github.com/ONLYOFFICE/document-server-integration/archive/refs/tags/v$pkgver.$_buildno.tar.gz + $pkgname-document-templates-$pkgver.$_buildno.tar.gz::https://github.com/ONLYOFFICE/document-templates/archive/refs/tags/v$pkgver.$_buildno.tar.gz + $pkgname-onlyoffice-io-$_webtag.tar.gz::https://github.com/ONLYOFFICE/onlyoffice.github.io/archive/$_webtag.tar.gz + server_fix-makefile.patch + server_restore-mobile-editing.patch + web-apps_restore-mobile-editing.patch + build_tools-untarget-pkg.patch + core_fix-musl-build.patch + " +builddir="$srcdir"/$pkgname-v$pkgver + +prepare() { + mv ../build_tools-$pkgver.$_buildno build_tools + mv ../document-server-integration-$pkgver.$_buildno document-server-integration + mv ../document-templates-$pkgver.$_buildno document-templates + mv ../onlyoffice.github.io-$_webtag onlyoffice.github.io + default_prepare + + mkdir -p "$srcdir"/system_qt/gcc_64 + ln -s /usr/lib "$srcdir"/system_qt/gcc_64/lib + ln -s /usr/lib/qt5/bin "$srcdir"/system_qt/gcc_64/bin + ln -s /usr/lib/qt5/plugins "$srcdir"/system_qt/gcc_64/plugins + + npm install -g --prefix "$srcdir"/npm_cache pkg grunt grunt-cli gifsicle + # overrides rpi for certain 3rd party libraries as already provided by system + sed -i '/harfbuzz.make()/d' build_tools/scripts/core_common/make_common.py + cat > "$builddir"/core/Common/3dParty/harfbuzz/harfbuzz.pri << EOF +INCLUDEPATH += /usr/include/harfbuzz +EOF + + sed -i '/icu.make()/d' build_tools/scripts/core_common/make_common.py + cat > "$builddir"/core/Common/3dParty/icu/icu.pri << EOF +INCLUDEPATH += /usr/include +LIBS += -licuuc -l icudata +EOF + sed -i '/v8.make()/d' build_tools/scripts/core_common/make_common.py + cat > "$builddir"/core/Common/3dParty/v8/v8.pri << EOF +INCLUDEPATH += /usr/include/node +LIBS += -lnode +EOF + sed -i '/openssl.make()/d' build_tools/scripts/core_common/make_common.py + cat > "$builddir"/core/Common/3dParty/openssl/openssl.pri << EOF +INCLUDEPATH += /usr/include/openssl +LIBS += -lcrypto -lssl +EOF + sed -i '/boost.make()/d' build_tools/scripts/core_common/make_common.py + cat > "$builddir"/core/Common/3dParty/boost/boost.pri << EOF +INCLUDEPATH += /usr/include/boost +CORE_BOOST_LIBS = /usr/lib +core_boost_libs:LIBS += -L\$CORE_BOOST_LIBS -lboost_system -lboost_filesystem +core_boost_regex:LIBS += -L\$CORE_BOOST_LIBS -lboost_regex +core_boost_date_time:LIBS += -L\$CORE_BOOST_LIBS -lboost_date_time +EOF +} + +build() { + export PATH="$PATH:$srcdir/npm_cache/bin" + msg "Building core" + cd "$builddir"/build_tools + ./configure.py \ + --update 0 \ + --module "server" \ + --qt-dir "$srcdir"/system_qt + ./make.py +} + +package() { + export PATH="$PATH:$srcdir/npm_cache/bin" + + cd "$builddir"/server + make install DESTDIR="$pkgdir" +} + + + +sha512sums=" +e4601334830932515e4ba165eeeab935059d80523fcb4888da0b88b5fe6b3a2feff1f9c60166f4dbbaceabe546fe075f253b302eb0a7510c3b7762a06ab38755 onlyoffice-document-server-7.3.3.tar.gz +8f9833765838803b6ca7abed12b35a791b4f81e5c6d248b773e0c63fda4f3e54a4df60199fd5c9ef0fe9c0444dccad13a01244b947a5af8f91e2c854435f5a54 onlyoffice-document-server-build_tools-7.3.3.60.tar.gz +ec02da8a8ee92c69ee8089b5f32fb817bc700f65670228a6205ef5afd26c85804931da0dfdc19f7739d5bf6b09732c3a5c5f46a0571b2ee68043c2ce6bf55478 onlyoffice-document-server-document-server-integration-7.3.3.60.tar.gz +24bda1feadf6b47cb556691fcfe71d60f7c34eb00da293f58ba4713c21754eeb146535befc511608477678cd7bc1fb8cf1a379c25300a43e2a7461d4225ed2e0 onlyoffice-document-server-document-templates-7.3.3.60.tar.gz +0144fdd79d1c633fbc54b24fef9bf9e4386fa7d46e67012b05786484dad9a5264e31f7de55eae23067e473483250b678138f86fb00b93aff801e21ddcbded0ad onlyoffice-document-server-onlyoffice-io-d26dc3f8736709e502e05f4daf50b29f96923b42.tar.gz +dce838e901720cf18ccc8035e02b9f8fea0f38a448124321663612027058467de152bfc9c257a3bd14a0ab33a00962f604e1d6c5a7040d7f1b117d260e286839 server_fix-makefile.patch +7c70d7392040ed415da0cdce91c71926624c20a36f850ba9affaff3353368830cc172c243cebc608d72051627c7e44de232818c93453b8c7e58314f05e450b2d server_restore-mobile-editing.patch +5d5758b59c2e8e2b6a31d99efb7e3ad42c60ab035af3641be5f3d84f02a1ea5abf51a380cfc55e403569ebdf3620a9c67c81b8bd0ba4632fc0b5f0506e9cf57e web-apps_restore-mobile-editing.patch +ad2ebbc5293ff3203b4fd84016910b4074f145febcbae28ba5ff5f8c4514c7da2a7b5b35d80ae37919a3794ff12e93af0bd9787175eda86bb546b13c98d3029e build_tools-untarget-pkg.patch +edf83d229459cba87029cecde2777fdc5b4717eed965fe91a4223475bc85e0c99cbc25b9be8de4497c0b14d96b0fe4bee77dd2174c6f59cc9a82ef6c96a1feae core_fix-musl-build.patch +" diff --git a/user/onlyoffice-document-server/build_tools-nerf-v8.patch b/user/onlyoffice-document-server/build_tools-nerf-v8.patch new file mode 100644 index 0000000..cd2ede4 --- /dev/null +++ b/user/onlyoffice-document-server/build_tools-nerf-v8.patch @@ -0,0 +1,47 @@ +diff --git a/build_tools/scripts/core_common/modules/v8.py.orig b/build_tools/scripts/core_common/modules/v8.py +index f185baa..ed86e58 100644 +--- a/build_tools/scripts/core_common/modules/v8.py.orig ++++ b/build_tools/scripts/core_common/modules/v8.py +@@ -73,7 +73,6 @@ def make(): + use_v8_89 = True + + if (use_v8_89): +- v8_89.make() + return + + print("[fetch & build]: v8") +@@ -167,34 +166,6 @@ def make(): + base_args64 = "target_cpu=\\\"x64\\\" v8_target_cpu=\\\"x64\\\" v8_static_library=true is_component_build=false v8_use_snapshot=false" + base_args32 = "target_cpu=\\\"x86\\\" v8_target_cpu=\\\"x86\\\" v8_static_library=true is_component_build=false v8_use_snapshot=false" + +- if config.check_option("platform", "linux_64"): +- base.cmd2("gn", ["gen", "out.gn/linux_64", "--args=\"is_debug=false " + base_args64 + " is_clang=" + is_use_clang() + " use_sysroot=false treat_warnings_as_errors=false\""]) +- base.cmd("ninja", ["-C", "out.gn/linux_64"]) +- +- if config.check_option("platform", "linux_32"): +- base.cmd2("gn", ["gen", "out.gn/linux_32", "--args=\"is_debug=false " + base_args32 + " is_clang=" + is_use_clang() + " use_sysroot=false treat_warnings_as_errors=false\""]) +- base.cmd("ninja", ["-C", "out.gn/linux_32"]) +- +- if config.check_option("platform", "mac_64"): +- base.cmd2("gn", ["gen", "out.gn/mac_64", "--args=\"is_debug=false " + base_args64 + "\""]) +- base.cmd("ninja", ["-C", "out.gn/mac_64"]) +- +- if config.check_option("platform", "win_64"): +- if (-1 != config.option("config").lower().find("debug")): +- base.cmd2("gn", ["gen", "out.gn/win_64/debug", "--args=\"is_debug=true " + base_args64 + " is_clang=false\""]) +- base.cmd("ninja", ["-C", "out.gn/win_64/debug"]) +- +- base.cmd2("gn", ["gen", "out.gn/win_64/release", "--args=\"is_debug=false " + base_args64 + " is_clang=false\""]) +- base.cmd("ninja", ["-C", "out.gn/win_64/release"]) +- +- if config.check_option("platform", "win_32"): +- if (-1 != config.option("config").lower().find("debug")): +- base.cmd2("gn", ["gen", "out.gn/win_32/debug", "--args=\"is_debug=true " + base_args32 + " is_clang=false\""]) +- base.cmd("ninja", ["-C", "out.gn/win_32/debug"]) +- +- base.cmd2("gn", ["gen", "out.gn/win_32/release", "--args=\"is_debug=false " + base_args32 + " is_clang=false\""]) +- base.cmd("ninja", ["-C", "out.gn/win_32/release"]) +- + os.chdir(old_cur) + os.environ.clear() + os.environ.update(old_env) diff --git a/user/onlyoffice-document-server/build_tools-untarget-pkg.patch b/user/onlyoffice-document-server/build_tools-untarget-pkg.patch new file mode 100644 index 0000000..3de5f8a --- /dev/null +++ b/user/onlyoffice-document-server/build_tools-untarget-pkg.patch @@ -0,0 +1,22 @@ +diff --git a/build_tools/scripts/build_server.py.orig b/build_tools/scripts/build_server.py +index 15a8ff4..e5a8f28 100644 +--- a/build_tools/scripts/build_server.py.orig ++++ b/build_tools/scripts/build_server.py +@@ -51,14 +51,9 @@ def make(): + if ("windows" == base.host_platform()): + pkg_target += "-win" + +- base.cmd_in_dir(server_build_dir + "/DocService", "pkg", [".", "-t", pkg_target, "--options", "max_old_space_size=4096", "-o", "docservice"]) +- base.cmd_in_dir(server_build_dir + "/FileConverter", "pkg", [".", "-t", pkg_target, "-o", "converter"]) +- base.cmd_in_dir(server_build_dir + "/Metrics", "pkg", [".", "-t", pkg_target, "-o", "metrics"]) +- +- example_dir = base.get_script_dir() + "/../../document-server-integration/web/documentserver-example/nodejs" +- base.delete_dir(example_dir + "/node_modules") +- base.cmd_in_dir(example_dir, "npm", ["install"]) +- base.cmd_in_dir(example_dir, "pkg", [".", "-t", pkg_target, "-o", "example"]) ++ base.cmd_in_dir(server_build_dir + "/DocService", "pkg", [".", "--options", "max_old_space_size=4096", "-o", "docservice"]) ++ base.cmd_in_dir(server_build_dir + "/FileConverter", "pkg", [".", "-o", "converter"]) ++ base.cmd_in_dir(server_build_dir + "/Metrics", "pkg", [".", "-o", "metrics"]) + + def build_server_develop(): + server_dir = base.get_script_dir() + "/../../server" diff --git a/user/onlyoffice-document-server/core_fix-musl-build.patch b/user/onlyoffice-document-server/core_fix-musl-build.patch new file mode 100644 index 0000000..4b0bb14 --- /dev/null +++ b/user/onlyoffice-document-server/core_fix-musl-build.patch @@ -0,0 +1,79 @@ +diff --git a/core/DesktopEditor/graphics/BaseThread.cpp.orig b/core/DesktopEditor/graphics/BaseThread.cpp +index df64ee0..beba342 100644 +--- a/core/DesktopEditor/graphics/BaseThread.cpp.orig ++++ b/core/DesktopEditor/graphics/BaseThread.cpp +@@ -136,7 +136,7 @@ namespace NSThreads + public: + __native_thread() : CThreadDescriptor() + { +- m_thread = NULL; ++ m_thread = 0; + } + virtual ~__native_thread() + { +diff --git a/core/DesktopEditor/cximage/CxImage/ximagif.cpp.orig b/core/DesktopEditor/cximage/CxImage/ximagif.cpp +index 4fbcf1e..fef552f 100644 +--- a/core/DesktopEditor/cximage/CxImage/ximagif.cpp.orig ++++ b/core/DesktopEditor/cximage/CxImage/ximagif.cpp +@@ -86,7 +86,7 @@ namespace NSGeneratePalette + + if ( ( X + Width ) > SrcWidth || ( Y + Height ) > SrcHeigth || NULL == pSrc ) + { +- return NULL; ++ return 0; + } + + (*pImage) = new CImage8bit (); +diff --git a/core/DesktopEditor/doctrenderer/nativecontrol.h.orig b/core/DesktopEditor/doctrenderer/nativecontrol.h +index 22a99e3..c49cc88 100644 +--- a/core/DesktopEditor/doctrenderer/nativecontrol.h.orig ++++ b/core/DesktopEditor/doctrenderer/nativecontrol.h +@@ -327,7 +327,7 @@ namespace NSNativeControl + + if (m_map_access_directories.end() == m_map_access_directories.find(NSFile::GetDirectoryName(strFile))) + { +- *pData = NULL; ++ *pData = 0; + dwLen = 0; + return; + } +diff --git a/core/UnicodeConverter/UnicodeConverter.cpp.orig b/core/UnicodeConverter/UnicodeConverter.cpp +index 61f1403..60d517f 100644 +--- a/core/UnicodeConverter/UnicodeConverter.cpp.orig ++++ b/core/UnicodeConverter/UnicodeConverter.cpp +@@ -131,7 +131,7 @@ namespace NSUnicodeConverter + char *sResCur = sResStart; + const char *sResLimit = sResCur + nOutputLen * ucnv_getMaxCharSize(conv); + +- ucnv_fromUnicode(conv, &sResCur, sResLimit, &pOutputStart, pOutputLimit, NULL, TRUE, &status); ++ ucnv_fromUnicode(conv, &sResCur, sResLimit, &pOutputStart, pOutputLimit, NULL, true, &status); + if (U_SUCCESS(status)) + { + sRes = std::string(sResStart, sResCur - sResStart); +@@ -180,7 +180,7 @@ namespace NSUnicodeConverter + char *sResCur = sResStart; + const char *sResLimit = sResCur + sRes.size(); + +- ucnv_fromUnicode(conv, &sResCur, sResLimit, &pUCharStart, pUCharLimit, NULL, TRUE, &status); ++ ucnv_fromUnicode(conv, &sResCur, sResLimit, &pUCharStart, pUCharLimit, NULL, true, &status); + if (U_SUCCESS(status)) + { + sRes.resize(sResCur - sResStart); +@@ -223,7 +223,7 @@ namespace NSUnicodeConverter + UChar* target = targetStart; + UChar* targetLimit = target + uBufSize; + +- ucnv_toUnicode(conv, &target, targetLimit, &source, sourceLimit, NULL, TRUE, &status); ++ ucnv_toUnicode(conv, &target, targetLimit, &source, sourceLimit, NULL, true, &status); + if (U_SUCCESS(status)) + { + size_t nTargetSize = target - targetStart; +@@ -278,7 +278,7 @@ namespace NSUnicodeConverter + UChar* target = targetStart; + UChar* targetLimit = target + uBufSize; + +- ucnv_toUnicode(conv, &target, targetLimit, &source, sourceLimit, NULL, TRUE, &status); ++ ucnv_toUnicode(conv, &target, targetLimit, &source, sourceLimit, NULL, true, &status); + if (U_SUCCESS(status)) + { + size_t nTargetSize = target - targetStart; diff --git a/user/onlyoffice-document-server/server_fix-makefile.patch b/user/onlyoffice-document-server/server_fix-makefile.patch new file mode 100644 index 0000000..a5030e0 --- /dev/null +++ b/user/onlyoffice-document-server/server_fix-makefile.patch @@ -0,0 +1,41 @@ +diff --git a/server/Makefile.orig b/server/Makefile +index e8e1308..cd01a39 100644 +--- a/server/Makefile.orig ++++ b/server/Makefile +@@ -141,7 +141,6 @@ clean: + + install: + mkdir -pv ${DESTDIR}/var/www/onlyoffice +- if ! id -u onlyoffice > /dev/null 2>&1; then useradd -m -d /var/www/onlyoffice -r -U onlyoffice; fi + + mkdir -p ${DESTDIR}${DOCUMENT_ROOT}/fonts + mkdir -p ${DESTDIR}/var/log/onlyoffice/documentserver +@@ -151,10 +150,6 @@ install: + mkdir -p ${DESTDIR}/etc/onlyoffice/documentserver + mv ${DESTDIR}${DOCUMENT_ROOT}/server/Common/config/* ${DESTDIR}/etc/onlyoffice/documentserver + +- chown onlyoffice:onlyoffice -R ${DESTDIR}/var/www/onlyoffice +- chown onlyoffice:onlyoffice -R ${DESTDIR}/var/log/onlyoffice +- chown onlyoffice:onlyoffice -R ${DESTDIR}/var/lib/onlyoffice +- + # Make symlinks for shared libs + find \ + ${DESTDIR}${DOCUMENT_ROOT}/server/FileConverter/bin \ +@@ -162,7 +157,7 @@ install: + -name *$(SHARED_EXT) \ + -exec sh -c 'ln -sf {} ${DESTDIR}/lib/$$(basename {})' \; + +- sudo -u onlyoffice "${DESTDIR}${DOCUMENT_ROOT}/server/tools/allfontsgen"\ ++ "${DESTDIR}${DOCUMENT_ROOT}/server/tools/allfontsgen"\ + --input="${DESTDIR}${DOCUMENT_ROOT}/core-fonts"\ + --allfonts-web="${DESTDIR}${DOCUMENT_ROOT}/sdkjs/common/AllFonts.js"\ + --allfonts="${DESTDIR}${DOCUMENT_ROOT}/server/FileConverter/bin/AllFonts.js"\ +@@ -171,7 +166,7 @@ install: + --output-web="${DESTDIR}${DOCUMENT_ROOT}/fonts"\ + --use-system="true" + +- sudo -u onlyoffice "${DESTDIR}${DOCUMENT_ROOT}/server/tools/allthemesgen"\ ++ "${DESTDIR}${DOCUMENT_ROOT}/server/tools/allthemesgen"\ + --converter-dir="${DESTDIR}${DOCUMENT_ROOT}/server/FileConverter/bin"\ + --src="${DESTDIR}${DOCUMENT_ROOT}/sdkjs/slide/themes"\ + --output="${DESTDIR}${DOCUMENT_ROOT}/sdkjs/common/Images" diff --git a/user/onlyoffice-document-server/server_restore-mobile-editing.patch b/user/onlyoffice-document-server/server_restore-mobile-editing.patch new file mode 100644 index 0000000..95e12cd --- /dev/null +++ b/user/onlyoffice-document-server/server_restore-mobile-editing.patch @@ -0,0 +1,90 @@ +diff --git a/server/DocService/sources/server.js b/server/DocService/sources/server.js +index 5c744f6..edfb423 100644 +--- a/server/DocService/sources/server.js ++++ b/server/DocService/sources/server.js +@@ -110,7 +110,6 @@ if (!(cfgTokenEnableBrowser && cfgTokenEnableRequestInbox && cfgTokenEnableReque + + if (!tenantManager.isMultitenantMode()) { + updateLicense(); +- fs.watchFile(cfgLicenseFile, updateLicense); + setInterval(updateLicense, 86400000); + } + +diff --git a/server/Makefile b/server/Makefile +index e8e1308..23f7e2e 100644 +--- a/server/Makefile ++++ b/server/Makefile +@@ -87,7 +87,7 @@ DEBUG = $(BRANDING_DIR)/debug.js + .PHONY: all clean install uninstall build-date + + .NOTPARALLEL: +-all: $(SPELLCHECKER_DICTIONARIES) $(TOOLS) $(SCHEMA) $(CORE_FONTS) $(DOCUMENT_TEMPLATES) $(LICENSE) $(WELCOME) $(INFO) build-date ++all: $(SCHEMA) $(LICENSE) $(WELCOME) $(INFO) build-date + + build-date: $(GRUNT_FILES) + sed "s|\(const buildVersion = \).*|\1'${PRODUCT_VERSION}';|" -i $(COMMON_DEFINES_JS) +diff --git a/server/Common/sources/constants.js.orig b/server/Common/sources/constants.js +index b9c2906..4124680 100644 +--- a/server/Common/sources/constants.js.orig ++++ b/server/Common/sources/constants.js +@@ -84,7 +84,7 @@ exports.LICENSE_RESULT = { + UsersViewCountOS: 15 + }; + +-exports.LICENSE_CONNECTIONS = 20; ++exports.LICENSE_CONNECTIONS = 9999; + exports.LICENSE_EXPIRE_USERS_ONE_DAY = 24 * 60 * 60; // day in seconds + + exports.AVS_OFFICESTUDIO_FILE_UNKNOWN = 0x0000; +diff --git a/server/Common/sources/license.js.orig b/server/Common/sources/license.js +index 1b617c6..fc72302 100644 +--- a/server/Common/sources/license.js.orig ++++ b/server/Common/sources/license.js +@@ -45,24 +45,24 @@ exports.readLicense = function*() { + count: 1, + type: c_LR.Success, + light: false, +- packageType: constants.PACKAGE_TYPE_OS, ++ packageType: constants.PACKAGE_TYPE_I, + mode: constants.LICENSE_MODE.None, +- branding: false, ++ branding: true, + connections: constants.LICENSE_CONNECTIONS, + connectionsView: constants.LICENSE_CONNECTIONS, +- customization: false, +- advancedApi: false, +- usersCount: 0, +- usersViewCount: 0, ++ customization: true, ++ advancedApi: true, ++ usersCount: constants.LICENSE_CONNECTIONS, ++ usersViewCount: constants.LICENSE_CONNECTIONS, + usersExpire: constants.LICENSE_EXPIRE_USERS_ONE_DAY, +- hasLicense: false, +- plugins: false, ++ hasLicense: true, ++ plugins: true, + buildDate: oBuildDate, + startDate: startDate, +- endDate: null, ++ endDate: new Date("2099-01-01T23:59:59.000Z"), + customerId: "", +- alias: "" ++ alias: "community" + }, null]; + }; + +-exports.packageType = constants.PACKAGE_TYPE_OS; ++exports.packageType = constants.PACKAGE_TYPE_I; +diff --git a/server/FileConverter/sources/convertermaster.js.orig b/server/FileConverter/sources/convertermaster.js +index 2a0b366..96468f9 100644 +--- a/server/FileConverter/sources/convertermaster.js.orig ++++ b/server/FileConverter/sources/convertermaster.js +@@ -93,7 +93,6 @@ if (cluster.isMaster) { + updateLicense(); + + if (!tenantManager.isMultitenantMode()) { +- fs.watchFile(cfgLicenseFile, updateLicense); + setInterval(updateLicense, 86400000); + } + } else { diff --git a/user/onlyoffice-document-server/web-apps_restore-mobile-editing.patch b/user/onlyoffice-document-server/web-apps_restore-mobile-editing.patch new file mode 100644 index 0000000..9466cc2 --- /dev/null +++ b/user/onlyoffice-document-server/web-apps_restore-mobile-editing.patch @@ -0,0 +1,51 @@ +From 692bef4561ef9978c6b8663dd618211bf526b69f Mon Sep 17 00:00:00 2001 +From: Beeant +Date: Sat, 24 Sep 2022 21:39:36 +0800 +Subject: [PATCH] build: license + +--- + apps/documenteditor/mobile/src/lib/web-apps/patch.jsx | 2 +- + apps/presentationeditor/mobile/src/lib/web-apps/patch.jsx | 2 +- + apps/spreadsheeteditor/mobile/src/lib/web-apps/patch.jsx | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/web-apps/apps/documenteditor/mobile/src/lib/web-apps/patch.jsx b/apps/documenteditor/mobile/src/lib/patch.jsx +index 963aca451..1ee48e856 100644 +--- a/web-apps/apps/documenteditor/mobile/src/lib/web-apps/patch.jsx ++++ b/web-apps/apps/documenteditor/mobile/src/lib/patch.jsx +@@ -4,7 +4,7 @@ const EditorUIController = () => { + }; + + EditorUIController.isSupportEditFeature = () => { +- return false ++ return true + }; + + EditorUIController.getToolbarOptions = () => { +diff --git a/web-apps/apps/presentationeditor/mobile/src/lib/web-apps/patch.jsx b/apps/presentationeditor/mobile/src/lib/patch.jsx +index ec7b37a2c..bfd879583 100644 +--- a/web-apps/apps/presentationeditor/mobile/src/lib/web-apps/patch.jsx ++++ b/web-apps/apps/presentationeditor/mobile/src/lib/patch.jsx +@@ -1,6 +1,6 @@ + + const EditorUIController = () => null; + +-EditorUIController.isSupportEditFeature = () => false; ++EditorUIController.isSupportEditFeature = () => true; + + export default EditorUIController; +diff --git a/web-apps/apps/spreadsheeteditor/mobile/src/lib/web-apps/patch.jsx b/apps/spreadsheeteditor/mobile/src/lib/patch.jsx +index ec7b37a2c..bfd879583 100644 +--- a/web-apps/apps/spreadsheeteditor/mobile/src/lib/web-apps/patch.jsx ++++ b/web-apps/apps/spreadsheeteditor/mobile/src/lib/patch.jsx +@@ -1,6 +1,6 @@ + + const EditorUIController = () => null; + +-EditorUIController.isSupportEditFeature = () => false; ++EditorUIController.isSupportEditFeature = () => true; + + export default EditorUIController; +-- +2.31.1.windows.1 + -- 2.45.2 From 6b88471971c3ebd4f450aa125e1e90141b5f3ce8 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 6 Sep 2023 14:40:34 -0400 Subject: [PATCH 02/16] gitlab-ci: update tags --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 92c7743..7ee28c7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,7 +19,7 @@ lint: only: - merge_requests tags: - - apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME + - apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME-x86_64 build: stage: build @@ -40,7 +40,7 @@ build: only: - merge_requests tags: - - apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME + - apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME-x86_64 push: interruptible: true @@ -57,4 +57,4 @@ push: - if: $CI_PIPELINE_SOURCE == "merge_request_event" when: manual tags: - - apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME + - apk-$CI_MERGE_REQUEST_TARGET_BRANCH_NAME-x86_64 -- 2.45.2 From 861560939401bb30f08b4aaedbc7ad1b46ef42c3 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 6 Sep 2023 14:42:45 -0400 Subject: [PATCH 03/16] deps --- user/onlyoffice-document-server/APKBUILD | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/user/onlyoffice-document-server/APKBUILD b/user/onlyoffice-document-server/APKBUILD index 9540c67..ab5b792 100644 --- a/user/onlyoffice-document-server/APKBUILD +++ b/user/onlyoffice-document-server/APKBUILD @@ -17,19 +17,22 @@ makedepends=" g++ nodejs clang + musl-dev npm + python3 + pythonispython3 autoconf automake - openjdk20-jdk + openjdk17-jdk libxscrnsaver - libncurses++ + ncurses-libs libxrender-dev - boost1.82-dev - boost1.82-libs - boost1.82-regex - boost1.82-system - boost1.82-filesystem - boost1.82-date_time + boost1.77-dev + boost1.77-libs + boost1.77-regex + boost1.77-system + boost1.77-filesystem + boost1.77-date_time libxi-dev libxcb-dev libx11-dev -- 2.45.2 From 6d59081fd3780166f87e3160cffaf4e2bc596be4 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 6 Sep 2023 14:59:52 -0400 Subject: [PATCH 04/16] Add sys-info fix --- user/onlyoffice-document-server/APKBUILD | 2 ++ .../core_fix-memory-limitations.patch | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 user/onlyoffice-document-server/core_fix-memory-limitations.patch diff --git a/user/onlyoffice-document-server/APKBUILD b/user/onlyoffice-document-server/APKBUILD index ab5b792..31a54b5 100644 --- a/user/onlyoffice-document-server/APKBUILD +++ b/user/onlyoffice-document-server/APKBUILD @@ -63,6 +63,7 @@ source=" $pkgname-onlyoffice-io-$_webtag.tar.gz::https://github.com/ONLYOFFICE/onlyoffice.github.io/archive/$_webtag.tar.gz server_fix-makefile.patch server_restore-mobile-editing.patch + core_fix-memory-limitations.patch web-apps_restore-mobile-editing.patch build_tools-untarget-pkg.patch core_fix-musl-build.patch @@ -141,6 +142,7 @@ ec02da8a8ee92c69ee8089b5f32fb817bc700f65670228a6205ef5afd26c85804931da0dfdc19f77 0144fdd79d1c633fbc54b24fef9bf9e4386fa7d46e67012b05786484dad9a5264e31f7de55eae23067e473483250b678138f86fb00b93aff801e21ddcbded0ad onlyoffice-document-server-onlyoffice-io-d26dc3f8736709e502e05f4daf50b29f96923b42.tar.gz dce838e901720cf18ccc8035e02b9f8fea0f38a448124321663612027058467de152bfc9c257a3bd14a0ab33a00962f604e1d6c5a7040d7f1b117d260e286839 server_fix-makefile.patch 7c70d7392040ed415da0cdce91c71926624c20a36f850ba9affaff3353368830cc172c243cebc608d72051627c7e44de232818c93453b8c7e58314f05e450b2d server_restore-mobile-editing.patch +814ebde322af9ef468b447cb1989742bf94fe3839c29b7904cc079e5ce1e5d8db307fe546107de610cbfccc6227ae14dfdb3835aeb9f272f5303249f787afac5 core_fix-memory-limitations.patch 5d5758b59c2e8e2b6a31d99efb7e3ad42c60ab035af3641be5f3d84f02a1ea5abf51a380cfc55e403569ebdf3620a9c67c81b8bd0ba4632fc0b5f0506e9cf57e web-apps_restore-mobile-editing.patch ad2ebbc5293ff3203b4fd84016910b4074f145febcbae28ba5ff5f8c4514c7da2a7b5b35d80ae37919a3794ff12e93af0bd9787175eda86bb546b13c98d3029e build_tools-untarget-pkg.patch edf83d229459cba87029cecde2777fdc5b4717eed965fe91a4223475bc85e0c99cbc25b9be8de4497c0b14d96b0fe4bee77dd2174c6f59cc9a82ef6c96a1feae core_fix-musl-build.patch diff --git a/user/onlyoffice-document-server/core_fix-memory-limitations.patch b/user/onlyoffice-document-server/core_fix-memory-limitations.patch new file mode 100644 index 0000000..90938ce --- /dev/null +++ b/user/onlyoffice-document-server/core_fix-memory-limitations.patch @@ -0,0 +1,15 @@ +diff --git a/core/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h.orig b/core/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h +index 2700377..4846688 100644 +--- a/core/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h.orig ++++ b/core/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h +@@ -18,10 +18,6 @@ + #include "v8.h" + #include "libplatform/libplatform.h" + +-#ifndef DISABLE_MEMORY_LIMITATION +-#include "src/base/sys-info.h" +-#endif +- + #ifdef V8_VERSION_89_PLUS + #define kV8NormalString v8::NewStringType::kNormal + #define kV8ProduceCodeCache v8::ScriptCompiler::kEagerCompile -- 2.45.2 From f8f87c5618e10a2d2d548102fa8dc40710c1562d Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 6 Sep 2023 15:02:37 -0400 Subject: [PATCH 05/16] disable memory limitation --- user/onlyoffice-document-server/APKBUILD | 2 +- .../core_fix-memory-limitations.patch | 28 +++++++++---------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/user/onlyoffice-document-server/APKBUILD b/user/onlyoffice-document-server/APKBUILD index 31a54b5..8138bd2 100644 --- a/user/onlyoffice-document-server/APKBUILD +++ b/user/onlyoffice-document-server/APKBUILD @@ -142,7 +142,7 @@ ec02da8a8ee92c69ee8089b5f32fb817bc700f65670228a6205ef5afd26c85804931da0dfdc19f77 0144fdd79d1c633fbc54b24fef9bf9e4386fa7d46e67012b05786484dad9a5264e31f7de55eae23067e473483250b678138f86fb00b93aff801e21ddcbded0ad onlyoffice-document-server-onlyoffice-io-d26dc3f8736709e502e05f4daf50b29f96923b42.tar.gz dce838e901720cf18ccc8035e02b9f8fea0f38a448124321663612027058467de152bfc9c257a3bd14a0ab33a00962f604e1d6c5a7040d7f1b117d260e286839 server_fix-makefile.patch 7c70d7392040ed415da0cdce91c71926624c20a36f850ba9affaff3353368830cc172c243cebc608d72051627c7e44de232818c93453b8c7e58314f05e450b2d server_restore-mobile-editing.patch -814ebde322af9ef468b447cb1989742bf94fe3839c29b7904cc079e5ce1e5d8db307fe546107de610cbfccc6227ae14dfdb3835aeb9f272f5303249f787afac5 core_fix-memory-limitations.patch +726781cf6309ca3f148f28a78f892f034e8889cf90ac688cf9f4f8083662012173f23ac196b7d30e7b3d90120980953f15fb8b0eaa1c6d86b7f7bdebca3e534a core_fix-memory-limitations.patch 5d5758b59c2e8e2b6a31d99efb7e3ad42c60ab035af3641be5f3d84f02a1ea5abf51a380cfc55e403569ebdf3620a9c67c81b8bd0ba4632fc0b5f0506e9cf57e web-apps_restore-mobile-editing.patch ad2ebbc5293ff3203b4fd84016910b4074f145febcbae28ba5ff5f8c4514c7da2a7b5b35d80ae37919a3794ff12e93af0bd9787175eda86bb546b13c98d3029e build_tools-untarget-pkg.patch edf83d229459cba87029cecde2777fdc5b4717eed965fe91a4223475bc85e0c99cbc25b9be8de4497c0b14d96b0fe4bee77dd2174c6f59cc9a82ef6c96a1feae core_fix-musl-build.patch diff --git a/user/onlyoffice-document-server/core_fix-memory-limitations.patch b/user/onlyoffice-document-server/core_fix-memory-limitations.patch index 90938ce..cdeec91 100644 --- a/user/onlyoffice-document-server/core_fix-memory-limitations.patch +++ b/user/onlyoffice-document-server/core_fix-memory-limitations.patch @@ -1,15 +1,13 @@ -diff --git a/core/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h.orig b/core/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h -index 2700377..4846688 100644 ---- a/core/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h.orig -+++ b/core/DesktopEditor/doctrenderer/js_internal/v8/v8_base.h -@@ -18,10 +18,6 @@ - #include "v8.h" - #include "libplatform/libplatform.h" - --#ifndef DISABLE_MEMORY_LIMITATION --#include "src/base/sys-info.h" --#endif -- - #ifdef V8_VERSION_89_PLUS - #define kV8NormalString v8::NewStringType::kNormal - #define kV8ProduceCodeCache v8::ScriptCompiler::kEagerCompile +diff --git a/core/DesktopEditor/doctrenderer/doctrenderer.pro.orig b/core/DesktopEditor/doctrenderer/doctrenderer.pro +index c49729e..338d00e 100644 +--- a/core/DesktopEditor/doctrenderer/doctrenderer.pro.orig ++++ b/core/DesktopEditor/doctrenderer/doctrenderer.pro +@@ -28,6 +28,8 @@ core_android { + CONFIG += doct_renderer_empty + } + ++DEFINES += DISABLE_MEMORY_LIMITATION ++ + doct_renderer_empty { + SOURCES += doctrenderer_empty.cpp + } else { -- 2.45.2 From 6164d22dfadb83613abce82c9dcf367754064667 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 7 Sep 2023 10:37:10 -0400 Subject: [PATCH 06/16] user/nodejs: new aport --- user/nodejs/APKBUILD | 204 +++++++ .../disable-running-gyp-on-shared-deps.patch | 22 + .../nodejs/fix-build-with-system-c-ares.patch | 535 ++++++++++++++++++ .../link-with-libatomic-on-mips32.patch | 28 + user/nodejs/nodejs.post-upgrade | 26 + 5 files changed, 815 insertions(+) create mode 100644 user/nodejs/APKBUILD create mode 100644 user/nodejs/disable-running-gyp-on-shared-deps.patch create mode 100644 user/nodejs/fix-build-with-system-c-ares.patch create mode 100644 user/nodejs/link-with-libatomic-on-mips32.patch create mode 100644 user/nodejs/nodejs.post-upgrade diff --git a/user/nodejs/APKBUILD b/user/nodejs/APKBUILD new file mode 100644 index 0000000..4e62b79 --- /dev/null +++ b/user/nodejs/APKBUILD @@ -0,0 +1,204 @@ +# Contributor: Jose-Luis Rivas +# Contributor: Jakub Jirutka +# Contributor: Dave Esaias +# Contributor: Tadahisa Kamijo +# Contributor: Eivind Uggedal +# Maintainer: Jakub Jirutka +# +# secfixes: +# 14.21.3-r0: +# - CVE-2023-23918 +# - CVE-2023-23920 +# 14.20.1-r0: +# - CVE-2022-32213 +# - CVE-2022-32214 +# - CVE-2022-32215 +# - CVE-2022-35256 +# 14.19.0-r0: +# - CVE-2022-21824 +# - CVE-2021-44533 +# - CVE-2021-44532 +# - CVE-2021-44531 +# 14.18.1-r0: +# - CVE-2021-22959 +# - CVE-2021-22960 +# 14.17.6-r0: +# - CVE-2021-37701 +# - CVE-2021-37712 +# - CVE-2021-37713 +# - CVE-2021-39134 +# - CVE-2021-39135 +# 14.17.5-r0: +# - CVE-2021-3672 +# - CVE-2021-22931 +# - CVE-2021-22939 +# 14.17.4-r0: +# - CVE-2021-22930 +# 14.17.3-r0: +# - CVE-2021-22918 +# 14.16.1-r0: +# - CVE-2020-7774 +# 14.16.0-r0: +# - CVE-2021-22883 +# - CVE-2021-22884 +# 14.15.5-r0: +# - CVE-2021-21148 +# 14.15.4-r0: +# - CVE-2020-8265 +# - CVE-2020-8287 +# 14.15.1-r0: +# - CVE-2020-8277 +# 12.18.4-r0: +# - CVE-2020-8201 +# - CVE-2020-8252 +# 12.18.0-r0: +# - CVE-2020-8172 +# - CVE-2020-11080 +# - CVE-2020-8174 +# 12.15.0-r0: +# - CVE-2019-15606 +# - CVE-2019-15605 +# - CVE-2019-15604 +# 10.16.3-r0: +# - CVE-2019-9511 +# - CVE-2019-9512 +# - CVE-2019-9513 +# - CVE-2019-9514 +# - CVE-2019-9515 +# - CVE-2019-9516 +# - CVE-2019-9517 +# - CVE-2019-9518 +# 10.15.3-r0: +# - CVE-2019-5737 +# 10.14.0-r0: +# - CVE-2018-12121 +# - CVE-2018-12122 +# - CVE-2018-12123 +# - CVE-2018-0735 +# - CVE-2018-0734 +# 8.11.4-r0: +# - CVE-2018-12115 +# 8.11.3-r0: +# - CVE-2018-7167 +# - CVE-2018-7161 +# - CVE-2018-1000168 +# 8.11.0-r0: +# - CVE-2018-7158 +# - CVE-2018-7159 +# - CVE-2018-7160 +# 8.9.3-r0: +# - CVE-2017-15896 +# - CVE-2017-15897 +# 6.11.5-r0: +# - CVE-2017-14919 +# 6.11.1-r0: +# - CVE-2017-1000381 +# 0: +# - CVE-2022-32212 +# - CVE-2022-32223 +# +pkgname=nodejs +# Note: Update only to even-numbered versions (e.g. 6.y.z, 8.y.z)! +# Odd-numbered versions are supported only for 9 months by upstream. +pkgver=14.21.3 +pkgrel=0 +pkgdesc="JavaScript runtime built on V8 engine - LTS version" +url="https://nodejs.org/" +arch="all !mips64 !mips64el !riscv64" +license="MIT" +depends="ca-certificates nghttp2-libs>=1.41" +makedepends=" + brotli-dev + c-ares-dev + icu-dev + linux-headers + nghttp2-dev + openssl-dev + python3 + zlib-dev + " +install="$pkgname.post-upgrade" +subpackages="$pkgname-dev $pkgname-doc" +provider_priority=100 # highest priority (other provider is nodejs-current) +provides="nodejs-lts=$pkgver" # for backward compatibility +replaces="nodejs-current nodejs-lts" # nodejs-lts for backward compatibility +source="https://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz + disable-running-gyp-on-shared-deps.patch + link-with-libatomic-on-mips32.patch + fix-build-with-system-c-ares.patch + " +builddir="$srcdir/node-v$pkgver" + +prepare() { + default_prepare + + # Remove bundled dependencies that we're not using. + rm -rf deps/brotli deps/cares deps/openssl deps/zlib +} + +build() { + # Add defines recommended in libuv readme. + local common_flags="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" + + # Compiling with O2 instead of Os increases binary size by ~10% + # (53.1 MiB -> 58.6 MiB), but also increases performance by ~20% + # according to v8/web-tooling-benchmark. Node.js is quite huge anyway; + # there are better options for size constrained environments. + export CFLAGS="${CFLAGS/-Os/-O2} $common_flags" + export CXXFLAGS="${CXXFLAGS/-Os/-O2} $common_flags" + export CPPFLAGS="${CPPFLAGS/-Os/-O2} $common_flags" + + case "$CARCH" in + mips*) _carchflags="--with-mips-arch-variant=r1 --with-mips-float-abi=soft";; + esac + + # NOTE: We use bundled libuv because they don't care much about backward + # compatibility and it has happened several times in past that we + # couldn't upgrade nodejs package in stable branches to fix CVEs due to + # libuv incompatibility. + # + # NOTE: We don't package the bundled npm - it's a separate project with + # its own release cycle and version numbering, so it's better to keep + # it in a standalone aport. + # + # TODO: After icu package is modified to split data into multiple + # variants, change --with-intl to "system-icu". + python3 configure.py --prefix=/usr \ + $_carchflags \ + --shared-brotli \ + --shared-zlib \ + --shared-openssl \ + --shared-cares \ + --shared-nghttp2 \ + --openssl-use-def-ca-store \ + --with-icu-default-data-dir=$(icu-config --icudatadir) \ + --with-intl=small-icu \ + --without-corepack \ + --without-npm + + make BUILDTYPE=Release +} + +# TODO Run provided test suite. +check() { + cd "$builddir"/out/Release + + ./node -e 'console.log("Hello, world!")' + ./node -e "require('assert').equal(process.versions.node, '$pkgver')" +} + +package() { + make DESTDIR="$pkgdir" install +} + +dev() { + provides="nodejs-lts-dev=$pkgver" # for backward compatibility + default_dev +} + +sha512sums=" +36e91d15f8e3687deb74f05e4e635c824410b586ebe9b7a410006d1e864093a45d0d350fa9b8536ff9d48d81907ac5f551c17a010707f9776a2f53d5711be0cb node-v14.21.3.tar.gz +8033162669e01a1cd6d5103e5b86c3a6cc49d9a40c1715538be08a181d2c30eb588b251ef7520e73bf6ca8fccb90d81d139ba933927a0869f02546489e3df281 disable-running-gyp-on-shared-deps.patch +44e81fbf254bd79e38b813f7f5a1336df854588939cba50aaec600660495f9b7745a7049a99eb59d15a51100b3a44f66892a902d7fc32e1399b51883ad4c02cf link-with-libatomic-on-mips32.patch +30ca1ce7f9512c943950b8eec98bca99d24c740ebaa14619292fe5ed931dcf603ca90afb1d704ca7f545e421752ba4dde81c0c5bbb5242eb1726739ca627e15f fix-build-with-system-c-ares.patch +" diff --git a/user/nodejs/disable-running-gyp-on-shared-deps.patch b/user/nodejs/disable-running-gyp-on-shared-deps.patch new file mode 100644 index 0000000..5008430 --- /dev/null +++ b/user/nodejs/disable-running-gyp-on-shared-deps.patch @@ -0,0 +1,22 @@ +From: Jakub Jirutka +Date: Sat, 26 Nov 2016 01:32:00 +0200 +Subject: Disable running gyp on shared deps + +Author: Stephen Gallagher + +Modified 2016-11-26 by Jakub Jirutka to update for +Node.js 7.2.0 + +diff --git a/Makefile b/Makefile +index 6d6f2e47..28e572df 100644 +--- a/Makefile ++++ b/Makefile +@@ -148,7 +148,7 @@ with-code-cache test-code-cache: + $(warning '$@' target is a noop) + + out/Makefile: config.gypi common.gypi node.gyp \ +- deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \ ++ deps/uv/uv.gyp deps/llhttp/llhttp.gyp \ + tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \ + tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp + $(PYTHON) tools/gyp_node.py -f make diff --git a/user/nodejs/fix-build-with-system-c-ares.patch b/user/nodejs/fix-build-with-system-c-ares.patch new file mode 100644 index 0000000..8121891 --- /dev/null +++ b/user/nodejs/fix-build-with-system-c-ares.patch @@ -0,0 +1,535 @@ +From aff98a5667c22794e2eaf658f6dfbee54cdd4a3b Mon Sep 17 00:00:00 2001 +From: Felix Yan +Date: Thu, 12 Aug 2021 02:44:43 +0800 +Subject: [PATCH 1/2] deps: fix building with system c-ares on Linux +Patch-Source: https://github.com/nodejs/node/pull/39739 + +The change in #39724 breaks building with system c-ares +(`--shared-cares`): +``` +In file included from ../src/cares_wrap.cc:25: +../src/cares_wrap.h:25:11: fatal error: ares_nameser.h: No such file or +directory + 25 | # include + | ^~~~~~~~~~~~~~~~ +``` + +Since `ares_nameser.h` isn't available with a default system c-ares +installation, let's copy it as our private header here. + +Tested to build fine on Arch Linux with shared c-ares. +--- + src/ares_nameser.h | 482 +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 482 insertions(+) + create mode 100644 src/ares_nameser.h + +diff --git a/src/ares_nameser.h b/src/ares_nameser.h +new file mode 100644 +index 000000000000..5270e5a3a6a0 +--- /dev/null ++++ b/src/ares_nameser.h +@@ -0,0 +1,482 @@ ++ ++#ifndef ARES_NAMESER_H ++#define ARES_NAMESER_H ++ ++#ifdef HAVE_ARPA_NAMESER_H ++# include ++#endif ++#ifdef HAVE_ARPA_NAMESER_COMPAT_H ++# include ++#endif ++ ++/* ============================================================================ ++ * arpa/nameser.h may or may not provide ALL of the below defines, so check ++ * each one individually and set if not ++ * ============================================================================ ++ */ ++ ++#ifndef NS_PACKETSZ ++# define NS_PACKETSZ 512 /* maximum packet size */ ++#endif ++ ++#ifndef NS_MAXDNAME ++# define NS_MAXDNAME 256 /* maximum domain name */ ++#endif ++ ++#ifndef NS_MAXCDNAME ++# define NS_MAXCDNAME 255 /* maximum compressed domain name */ ++#endif ++ ++#ifndef NS_MAXLABEL ++# define NS_MAXLABEL 63 ++#endif ++ ++#ifndef NS_HFIXEDSZ ++# define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */ ++#endif ++ ++#ifndef NS_QFIXEDSZ ++# define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */ ++#endif ++ ++#ifndef NS_RRFIXEDSZ ++# define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */ ++#endif ++ ++#ifndef NS_INT16SZ ++# define NS_INT16SZ 2 ++#endif ++ ++#ifndef NS_INADDRSZ ++# define NS_INADDRSZ 4 ++#endif ++ ++#ifndef NS_IN6ADDRSZ ++# define NS_IN6ADDRSZ 16 ++#endif ++ ++#ifndef NS_CMPRSFLGS ++# define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */ ++#endif ++ ++#ifndef NS_DEFAULTPORT ++# define NS_DEFAULTPORT 53 /* For both TCP and UDP. */ ++#endif ++ ++/* ============================================================================ ++ * arpa/nameser.h should provide these enumerations always, so if not found, ++ * provide them ++ * ============================================================================ ++ */ ++#ifndef HAVE_ARPA_NAMESER_H ++ ++typedef enum __ns_class { ++ ns_c_invalid = 0, /* Cookie. */ ++ ns_c_in = 1, /* Internet. */ ++ ns_c_2 = 2, /* unallocated/unsupported. */ ++ ns_c_chaos = 3, /* MIT Chaos-net. */ ++ ns_c_hs = 4, /* MIT Hesiod. */ ++ /* Query class values which do not appear in resource records */ ++ ns_c_none = 254, /* for prereq. sections in update requests */ ++ ns_c_any = 255, /* Wildcard match. */ ++ ns_c_max = 65536 ++} ns_class; ++ ++typedef enum __ns_type { ++ ns_t_invalid = 0, /* Cookie. */ ++ ns_t_a = 1, /* Host address. */ ++ ns_t_ns = 2, /* Authoritative server. */ ++ ns_t_md = 3, /* Mail destination. */ ++ ns_t_mf = 4, /* Mail forwarder. */ ++ ns_t_cname = 5, /* Canonical name. */ ++ ns_t_soa = 6, /* Start of authority zone. */ ++ ns_t_mb = 7, /* Mailbox domain name. */ ++ ns_t_mg = 8, /* Mail group member. */ ++ ns_t_mr = 9, /* Mail rename name. */ ++ ns_t_null = 10, /* Null resource record. */ ++ ns_t_wks = 11, /* Well known service. */ ++ ns_t_ptr = 12, /* Domain name pointer. */ ++ ns_t_hinfo = 13, /* Host information. */ ++ ns_t_minfo = 14, /* Mailbox information. */ ++ ns_t_mx = 15, /* Mail routing information. */ ++ ns_t_txt = 16, /* Text strings. */ ++ ns_t_rp = 17, /* Responsible person. */ ++ ns_t_afsdb = 18, /* AFS cell database. */ ++ ns_t_x25 = 19, /* X_25 calling address. */ ++ ns_t_isdn = 20, /* ISDN calling address. */ ++ ns_t_rt = 21, /* Router. */ ++ ns_t_nsap = 22, /* NSAP address. */ ++ ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */ ++ ns_t_sig = 24, /* Security signature. */ ++ ns_t_key = 25, /* Security key. */ ++ ns_t_px = 26, /* X.400 mail mapping. */ ++ ns_t_gpos = 27, /* Geographical position (withdrawn). */ ++ ns_t_aaaa = 28, /* Ip6 Address. */ ++ ns_t_loc = 29, /* Location Information. */ ++ ns_t_nxt = 30, /* Next domain (security). */ ++ ns_t_eid = 31, /* Endpoint identifier. */ ++ ns_t_nimloc = 32, /* Nimrod Locator. */ ++ ns_t_srv = 33, /* Server Selection. */ ++ ns_t_atma = 34, /* ATM Address */ ++ ns_t_naptr = 35, /* Naming Authority PoinTeR */ ++ ns_t_kx = 36, /* Key Exchange */ ++ ns_t_cert = 37, /* Certification record */ ++ ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */ ++ ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */ ++ ns_t_sink = 40, /* Kitchen sink (experimentatl) */ ++ ns_t_opt = 41, /* EDNS0 option (meta-RR) */ ++ ns_t_apl = 42, /* Address prefix list (RFC3123) */ ++ ns_t_ds = 43, /* Delegation Signer (RFC4034) */ ++ ns_t_sshfp = 44, /* SSH Key Fingerprint (RFC4255) */ ++ ns_t_rrsig = 46, /* Resource Record Signature (RFC4034) */ ++ ns_t_nsec = 47, /* Next Secure (RFC4034) */ ++ ns_t_dnskey = 48, /* DNS Public Key (RFC4034) */ ++ ns_t_tkey = 249, /* Transaction key */ ++ ns_t_tsig = 250, /* Transaction signature. */ ++ ns_t_ixfr = 251, /* Incremental zone transfer. */ ++ ns_t_axfr = 252, /* Transfer zone of authority. */ ++ ns_t_mailb = 253, /* Transfer mailbox records. */ ++ ns_t_maila = 254, /* Transfer mail agent records. */ ++ ns_t_any = 255, /* Wildcard match. */ ++ ns_t_zxfr = 256, /* BIND-specific, nonstandard. */ ++ ns_t_caa = 257, /* Certification Authority Authorization. */ ++ ns_t_max = 65536 ++} ns_type; ++ ++typedef enum __ns_opcode { ++ ns_o_query = 0, /* Standard query. */ ++ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */ ++ ns_o_status = 2, /* Name server status query (unsupported). */ ++ /* Opcode 3 is undefined/reserved. */ ++ ns_o_notify = 4, /* Zone change notification. */ ++ ns_o_update = 5, /* Zone update message. */ ++ ns_o_max = 6 ++} ns_opcode; ++ ++typedef enum __ns_rcode { ++ ns_r_noerror = 0, /* No error occurred. */ ++ ns_r_formerr = 1, /* Format error. */ ++ ns_r_servfail = 2, /* Server failure. */ ++ ns_r_nxdomain = 3, /* Name error. */ ++ ns_r_notimpl = 4, /* Unimplemented. */ ++ ns_r_refused = 5, /* Operation refused. */ ++ /* these are for BIND_UPDATE */ ++ ns_r_yxdomain = 6, /* Name exists */ ++ ns_r_yxrrset = 7, /* RRset exists */ ++ ns_r_nxrrset = 8, /* RRset does not exist */ ++ ns_r_notauth = 9, /* Not authoritative for zone */ ++ ns_r_notzone = 10, /* Zone of record different from zone section */ ++ ns_r_max = 11, ++ /* The following are TSIG extended errors */ ++ ns_r_badsig = 16, ++ ns_r_badkey = 17, ++ ns_r_badtime = 18 ++} ns_rcode; ++ ++#endif /* HAVE_ARPA_NAMESER_H */ ++ ++ ++/* ============================================================================ ++ * arpa/nameser_compat.h typically sets these. However on some systems ++ * arpa/nameser.h does, but may not set all of them. Lets conditionally ++ * define each ++ * ============================================================================ ++ */ ++ ++#ifndef PACKETSZ ++# define PACKETSZ NS_PACKETSZ ++#endif ++ ++#ifndef MAXDNAME ++# define MAXDNAME NS_MAXDNAME ++#endif ++ ++#ifndef MAXCDNAME ++# define MAXCDNAME NS_MAXCDNAME ++#endif ++ ++#ifndef MAXLABEL ++# define MAXLABEL NS_MAXLABEL ++#endif ++ ++#ifndef HFIXEDSZ ++# define HFIXEDSZ NS_HFIXEDSZ ++#endif ++ ++#ifndef QFIXEDSZ ++# define QFIXEDSZ NS_QFIXEDSZ ++#endif ++ ++#ifndef RRFIXEDSZ ++# define RRFIXEDSZ NS_RRFIXEDSZ ++#endif ++ ++#ifndef INDIR_MASK ++# define INDIR_MASK NS_CMPRSFLGS ++#endif ++ ++#ifndef NAMESERVER_PORT ++# define NAMESERVER_PORT NS_DEFAULTPORT ++#endif ++ ++ ++/* opcodes */ ++#ifndef O_QUERY ++# define O_QUERY 0 /* ns_o_query */ ++#endif ++#ifndef O_IQUERY ++# define O_IQUERY 1 /* ns_o_iquery */ ++#endif ++#ifndef O_STATUS ++# define O_STATUS 2 /* ns_o_status */ ++#endif ++#ifndef O_NOTIFY ++# define O_NOTIFY 4 /* ns_o_notify */ ++#endif ++#ifndef O_UPDATE ++# define O_UPDATE 5 /* ns_o_update */ ++#endif ++ ++ ++/* response codes */ ++#ifndef SERVFAIL ++# define SERVFAIL ns_r_servfail ++#endif ++#ifndef NOTIMP ++# define NOTIMP ns_r_notimpl ++#endif ++#ifndef REFUSED ++# define REFUSED ns_r_refused ++#endif ++#if defined(_WIN32) && !defined(HAVE_ARPA_NAMESER_COMPAT_H) && defined(NOERROR) ++# undef NOERROR /* it seems this is already defined in winerror.h */ ++#endif ++#ifndef NOERROR ++# define NOERROR ns_r_noerror ++#endif ++#ifndef FORMERR ++# define FORMERR ns_r_formerr ++#endif ++#ifndef NXDOMAIN ++# define NXDOMAIN ns_r_nxdomain ++#endif ++/* Non-standard response codes, use numeric values */ ++#ifndef YXDOMAIN ++# define YXDOMAIN 6 /* ns_r_yxdomain */ ++#endif ++#ifndef YXRRSET ++# define YXRRSET 7 /* ns_r_yxrrset */ ++#endif ++#ifndef NXRRSET ++# define NXRRSET 8 /* ns_r_nxrrset */ ++#endif ++#ifndef NOTAUTH ++# define NOTAUTH 9 /* ns_r_notauth */ ++#endif ++#ifndef NOTZONE ++# define NOTZONE 10 /* ns_r_notzone */ ++#endif ++#ifndef TSIG_BADSIG ++# define TSIG_BADSIG 16 /* ns_r_badsig */ ++#endif ++#ifndef TSIG_BADKEY ++# define TSIG_BADKEY 17 /* ns_r_badkey */ ++#endif ++#ifndef TSIG_BADTIME ++# define TSIG_BADTIME 18 /* ns_r_badtime */ ++#endif ++ ++ ++/* classes */ ++#ifndef C_IN ++# define C_IN 1 /* ns_c_in */ ++#endif ++#ifndef C_CHAOS ++# define C_CHAOS 3 /* ns_c_chaos */ ++#endif ++#ifndef C_HS ++# define C_HS 4 /* ns_c_hs */ ++#endif ++#ifndef C_NONE ++# define C_NONE 254 /* ns_c_none */ ++#endif ++#ifndef C_ANY ++# define C_ANY 255 /* ns_c_any */ ++#endif ++ ++ ++/* types */ ++#ifndef T_A ++# define T_A 1 /* ns_t_a */ ++#endif ++#ifndef T_NS ++# define T_NS 2 /* ns_t_ns */ ++#endif ++#ifndef T_MD ++# define T_MD 3 /* ns_t_md */ ++#endif ++#ifndef T_MF ++# define T_MF 4 /* ns_t_mf */ ++#endif ++#ifndef T_CNAME ++# define T_CNAME 5 /* ns_t_cname */ ++#endif ++#ifndef T_SOA ++# define T_SOA 6 /* ns_t_soa */ ++#endif ++#ifndef T_MB ++# define T_MB 7 /* ns_t_mb */ ++#endif ++#ifndef T_MG ++# define T_MG 8 /* ns_t_mg */ ++#endif ++#ifndef T_MR ++# define T_MR 9 /* ns_t_mr */ ++#endif ++#ifndef T_NULL ++# define T_NULL 10 /* ns_t_null */ ++#endif ++#ifndef T_WKS ++# define T_WKS 11 /* ns_t_wks */ ++#endif ++#ifndef T_PTR ++# define T_PTR 12 /* ns_t_ptr */ ++#endif ++#ifndef T_HINFO ++# define T_HINFO 13 /* ns_t_hinfo */ ++#endif ++#ifndef T_MINFO ++# define T_MINFO 14 /* ns_t_minfo */ ++#endif ++#ifndef T_MX ++# define T_MX 15 /* ns_t_mx */ ++#endif ++#ifndef T_TXT ++# define T_TXT 16 /* ns_t_txt */ ++#endif ++#ifndef T_RP ++# define T_RP 17 /* ns_t_rp */ ++#endif ++#ifndef T_AFSDB ++# define T_AFSDB 18 /* ns_t_afsdb */ ++#endif ++#ifndef T_X25 ++# define T_X25 19 /* ns_t_x25 */ ++#endif ++#ifndef T_ISDN ++# define T_ISDN 20 /* ns_t_isdn */ ++#endif ++#ifndef T_RT ++# define T_RT 21 /* ns_t_rt */ ++#endif ++#ifndef T_NSAP ++# define T_NSAP 22 /* ns_t_nsap */ ++#endif ++#ifndef T_NSAP_PTR ++# define T_NSAP_PTR 23 /* ns_t_nsap_ptr */ ++#endif ++#ifndef T_SIG ++# define T_SIG 24 /* ns_t_sig */ ++#endif ++#ifndef T_KEY ++# define T_KEY 25 /* ns_t_key */ ++#endif ++#ifndef T_PX ++# define T_PX 26 /* ns_t_px */ ++#endif ++#ifndef T_GPOS ++# define T_GPOS 27 /* ns_t_gpos */ ++#endif ++#ifndef T_AAAA ++# define T_AAAA 28 /* ns_t_aaaa */ ++#endif ++#ifndef T_LOC ++# define T_LOC 29 /* ns_t_loc */ ++#endif ++#ifndef T_NXT ++# define T_NXT 30 /* ns_t_nxt */ ++#endif ++#ifndef T_EID ++# define T_EID 31 /* ns_t_eid */ ++#endif ++#ifndef T_NIMLOC ++# define T_NIMLOC 32 /* ns_t_nimloc */ ++#endif ++#ifndef T_SRV ++# define T_SRV 33 /* ns_t_srv */ ++#endif ++#ifndef T_ATMA ++# define T_ATMA 34 /* ns_t_atma */ ++#endif ++#ifndef T_NAPTR ++# define T_NAPTR 35 /* ns_t_naptr */ ++#endif ++#ifndef T_KX ++# define T_KX 36 /* ns_t_kx */ ++#endif ++#ifndef T_CERT ++# define T_CERT 37 /* ns_t_cert */ ++#endif ++#ifndef T_A6 ++# define T_A6 38 /* ns_t_a6 */ ++#endif ++#ifndef T_DNAME ++# define T_DNAME 39 /* ns_t_dname */ ++#endif ++#ifndef T_SINK ++# define T_SINK 40 /* ns_t_sink */ ++#endif ++#ifndef T_OPT ++# define T_OPT 41 /* ns_t_opt */ ++#endif ++#ifndef T_APL ++# define T_APL 42 /* ns_t_apl */ ++#endif ++#ifndef T_DS ++# define T_DS 43 /* ns_t_ds */ ++#endif ++#ifndef T_SSHFP ++# define T_SSHFP 44 /* ns_t_sshfp */ ++#endif ++#ifndef T_RRSIG ++# define T_RRSIG 46 /* ns_t_rrsig */ ++#endif ++#ifndef T_NSEC ++# define T_NSEC 47 /* ns_t_nsec */ ++#endif ++#ifndef T_DNSKEY ++# define T_DNSKEY 48 /* ns_t_dnskey */ ++#endif ++#ifndef T_TKEY ++# define T_TKEY 249 /* ns_t_tkey */ ++#endif ++#ifndef T_TSIG ++# define T_TSIG 250 /* ns_t_tsig */ ++#endif ++#ifndef T_IXFR ++# define T_IXFR 251 /* ns_t_ixfr */ ++#endif ++#ifndef T_AXFR ++# define T_AXFR 252 /* ns_t_axfr */ ++#endif ++#ifndef T_MAILB ++# define T_MAILB 253 /* ns_t_mailb */ ++#endif ++#ifndef T_MAILA ++# define T_MAILA 254 /* ns_t_maila */ ++#endif ++#ifndef T_ANY ++# define T_ANY 255 /* ns_t_any */ ++#endif ++#ifndef T_ZXFR ++# define T_ZXFR 256 /* ns_t_zxfr */ ++#endif ++#ifndef T_CAA ++# define T_CAA 257 /* ns_t_caa */ ++#endif ++#ifndef T_MAX ++# define T_MAX 65536 /* ns_t_max */ ++#endif ++ ++ ++#endif /* ARES_NAMESER_H */ + +From db4643979ee676b3a3d6cdf2fb597d399cf8013f Mon Sep 17 00:00:00 2001 +From: Felix Yan +Date: Fri, 13 Aug 2021 00:01:59 +0800 +Subject: [PATCH 2/2] build: ignore cpplint for third-party ares_nameser.h + +--- + Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile b/Makefile +index ec4c774748cd..c418995c53c1 100644 +--- a/Makefile ++++ b/Makefile +@@ -1289,6 +1289,7 @@ jslint-ci: lint-js-ci + LINT_CPP_ADDON_DOC_FILES_GLOB = test/addons/??_*/*.cc test/addons/??_*/*.h + LINT_CPP_ADDON_DOC_FILES = $(wildcard $(LINT_CPP_ADDON_DOC_FILES_GLOB)) + LINT_CPP_EXCLUDE ?= ++LINT_CPP_EXCLUDE += src/ares_nameser.h + LINT_CPP_EXCLUDE += src/node_root_certs.h + LINT_CPP_EXCLUDE += $(LINT_CPP_ADDON_DOC_FILES) + LINT_CPP_EXCLUDE += $(wildcard test/js-native-api/??_*/*.cc test/js-native-api/??_*/*.h test/node-api/??_*/*.cc test/node-api/??_*/*.h) diff --git a/user/nodejs/link-with-libatomic-on-mips32.patch b/user/nodejs/link-with-libatomic-on-mips32.patch new file mode 100644 index 0000000..ed20033 --- /dev/null +++ b/user/nodejs/link-with-libatomic-on-mips32.patch @@ -0,0 +1,28 @@ +--- a/tools/v8_gypfiles/v8.gyp ++++ b/tools/v8_gypfiles/v8.gyp +@@ -1266,6 +1266,11 @@ + ['want_separate_host_toolset', { + 'toolsets': ['host', 'target'], + }], ++ [ 'host_arch=="mips" or host_arch=="mipsel"', { ++ 'link_settings': { ++ 'libraries': [ '-latomic' ], ++ }, ++ }], + ['component=="shared_library"', { + 'direct_dependent_settings': { + 'defines': ['USING_V8_PLATFORM_SHARED'], +--- a/node.gyp ++++ b/node.gyp +@@ -381,6 +381,11 @@ + 'msvs_disabled_warnings!': [4244], + + 'conditions': [ ++ [ 'host_arch=="mips" or host_arch=="mipsel"', { ++ 'link_settings': { ++ 'libraries': [ '-latomic' ], ++ }, ++ }], + [ 'error_on_warn=="true"', { + 'cflags': ['-Werror'], + 'xcode_settings': { diff --git a/user/nodejs/nodejs.post-upgrade b/user/nodejs/nodejs.post-upgrade new file mode 100644 index 0000000..764aa17 --- /dev/null +++ b/user/nodejs/nodejs.post-upgrade @@ -0,0 +1,26 @@ +#!/bin/sh + +# This file is not provided since splitting npm into a separate aport, +# so we use it to quickly detect presence of the old npm package. +if [ -f /usr/lib/node_modules/npm/configure ]; then + pkg_ver=$(apk info -W /usr/bin/npm 2>/dev/null \ + | sed -En 's/.*owned by npm-([^-]+).*/\1/p' \ + | grep .) || exit 0 + + npm_ver=$(/usr/bin/npm --version 2>/dev/null) || exit 0 + + [ "$pkg_ver" = "$npm_ver" ] && exit 0 + + cat >&2 <<-EOF + * + * You have an old version of the 'npm' package installed + * (pkg version: $pkg_ver, real version: $npm_ver). The newer package + * has a *lower* version number that now corresponds to the actual + * version of the 'npm' program. You have to reinstall the npm package + * (apk del npm; apk add npm) or upgrade all packages to the available + * versions (apk upgrade -a). + * + EOF +fi + +exit 0 -- 2.45.2 From 919c00659b9f0c4532c8b5395c8346ba2be30698 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 7 Sep 2023 10:37:37 -0400 Subject: [PATCH 07/16] use nodejs14 --- user/onlyoffice-document-server/APKBUILD | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/user/onlyoffice-document-server/APKBUILD b/user/onlyoffice-document-server/APKBUILD index 8138bd2..1732e28 100644 --- a/user/onlyoffice-document-server/APKBUILD +++ b/user/onlyoffice-document-server/APKBUILD @@ -15,7 +15,6 @@ makedepends=" qt5-qtbase-dev bash g++ - nodejs clang musl-dev npm @@ -52,7 +51,7 @@ makedepends=" libpulse gtk+3.0-dev glib-dev - nodejs-dev + nodejs-dev~=14 " options="!check" # No testsuite source=" -- 2.45.2 From e5762aa4899cff0e186e017c8fc8b5b75625fb3e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 7 Sep 2023 11:05:00 -0400 Subject: [PATCH 08/16] nodejs10 --- user/nodejs/APKBUILD | 160 +++++++----------- .../dont-run-gyp-files-for-bundled-deps.patch | 21 +++ .../link-with-libatomic-on-mips32.patch | 22 +-- 3 files changed, 82 insertions(+), 121 deletions(-) create mode 100644 user/nodejs/dont-run-gyp-files-for-bundled-deps.patch diff --git a/user/nodejs/APKBUILD b/user/nodejs/APKBUILD index 4e62b79..e5c439a 100644 --- a/user/nodejs/APKBUILD +++ b/user/nodejs/APKBUILD @@ -6,56 +6,9 @@ # Maintainer: Jakub Jirutka # # secfixes: -# 14.21.3-r0: -# - CVE-2023-23918 -# - CVE-2023-23920 -# 14.20.1-r0: -# - CVE-2022-32213 -# - CVE-2022-32214 -# - CVE-2022-32215 -# - CVE-2022-35256 -# 14.19.0-r0: -# - CVE-2022-21824 -# - CVE-2021-44533 -# - CVE-2021-44532 -# - CVE-2021-44531 -# 14.18.1-r0: -# - CVE-2021-22959 -# - CVE-2021-22960 -# 14.17.6-r0: -# - CVE-2021-37701 -# - CVE-2021-37712 -# - CVE-2021-37713 -# - CVE-2021-39134 -# - CVE-2021-39135 -# 14.17.5-r0: -# - CVE-2021-3672 -# - CVE-2021-22931 -# - CVE-2021-22939 -# 14.17.4-r0: -# - CVE-2021-22930 -# 14.17.3-r0: -# - CVE-2021-22918 -# 14.16.1-r0: +# 10.24.1-r0: # - CVE-2020-7774 -# 14.16.0-r0: -# - CVE-2021-22883 -# - CVE-2021-22884 -# 14.15.5-r0: -# - CVE-2021-21148 -# 14.15.4-r0: -# - CVE-2020-8265 -# - CVE-2020-8287 -# 14.15.1-r0: -# - CVE-2020-8277 -# 12.18.4-r0: -# - CVE-2020-8201 -# - CVE-2020-8252 -# 12.18.0-r0: -# - CVE-2020-8172 -# - CVE-2020-11080 -# - CVE-2020-8174 -# 12.15.0-r0: +# 10.19.0-r0: # - CVE-2019-15606 # - CVE-2019-15605 # - CVE-2019-15604 @@ -93,39 +46,26 @@ # - CVE-2017-14919 # 6.11.1-r0: # - CVE-2017-1000381 -# 0: -# - CVE-2022-32212 -# - CVE-2022-32223 # pkgname=nodejs # Note: Update only to even-numbered versions (e.g. 6.y.z, 8.y.z)! # Odd-numbered versions are supported only for 9 months by upstream. -pkgver=14.21.3 +pkgver=10.24.1 pkgrel=0 pkgdesc="JavaScript runtime built on V8 engine - LTS version" url="https://nodejs.org/" -arch="all !mips64 !mips64el !riscv64" +arch="all !mips64 !mips64el" license="MIT" -depends="ca-certificates nghttp2-libs>=1.41" -makedepends=" - brotli-dev - c-ares-dev - icu-dev - linux-headers - nghttp2-dev - openssl-dev - python3 - zlib-dev - " -install="$pkgname.post-upgrade" -subpackages="$pkgname-dev $pkgname-doc" -provider_priority=100 # highest priority (other provider is nodejs-current) +depends="ca-certificates" +# gold is needed for mksnapshot +makedepends="$depends_dev python2 openssl-dev zlib-dev libuv-dev linux-headers + paxmark binutils-gold http-parser-dev ca-certificates c-ares-dev" +subpackages="$pkgname-dev $pkgname-doc npm::noarch" provides="nodejs-lts=$pkgver" # for backward compatibility replaces="nodejs-current nodejs-lts" # nodejs-lts for backward compatibility source="https://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz - disable-running-gyp-on-shared-deps.patch + dont-run-gyp-files-for-bundled-deps.patch link-with-libatomic-on-mips32.patch - fix-build-with-system-c-ares.patch " builddir="$srcdir/node-v$pkgver" @@ -133,20 +73,11 @@ prepare() { default_prepare # Remove bundled dependencies that we're not using. - rm -rf deps/brotli deps/cares deps/openssl deps/zlib + rm -rf deps/http_parser deps/openssl deps/zlib } build() { - # Add defines recommended in libuv readme. - local common_flags="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" - - # Compiling with O2 instead of Os increases binary size by ~10% - # (53.1 MiB -> 58.6 MiB), but also increases performance by ~20% - # according to v8/web-tooling-benchmark. Node.js is quite huge anyway; - # there are better options for size constrained environments. - export CFLAGS="${CFLAGS/-Os/-O2} $common_flags" - export CXXFLAGS="${CXXFLAGS/-Os/-O2} $common_flags" - export CPPFLAGS="${CPPFLAGS/-Os/-O2} $common_flags" + cd "$builddir" case "$CARCH" in mips*) _carchflags="--with-mips-arch-variant=r1 --with-mips-float-abi=soft";; @@ -156,27 +87,21 @@ build() { # compatibility and it has happened several times in past that we # couldn't upgrade nodejs package in stable branches to fix CVEs due to # libuv incompatibility. - # - # NOTE: We don't package the bundled npm - it's a separate project with - # its own release cycle and version numbering, so it's better to keep - # it in a standalone aport. - # - # TODO: After icu package is modified to split data into multiple - # variants, change --with-intl to "system-icu". - python3 configure.py --prefix=/usr \ + ./configure --prefix=/usr \ $_carchflags \ - --shared-brotli \ --shared-zlib \ --shared-openssl \ + --shared-http-parser \ --shared-cares \ - --shared-nghttp2 \ - --openssl-use-def-ca-store \ - --with-icu-default-data-dir=$(icu-config --icudatadir) \ - --with-intl=small-icu \ - --without-corepack \ - --without-npm + --openssl-use-def-ca-store - make BUILDTYPE=Release + # We need run mksnapshot at build time so paxmark it early. + make -C out mksnapshot BUILDTYPE=Release + paxmark -m out/Release/mksnapshot + make + + # paxmark so JIT works + paxmark -m out/Release/node } # TODO Run provided test suite. @@ -188,7 +113,25 @@ check() { } package() { + cd "$builddir" + make DESTDIR="$pkgdir" install + + # It's strange, but it really needs to be paxmarked again... + paxmark -m "$pkgdir"/usr/bin/node + + cp -pr "$pkgdir"/usr/lib/node_modules/npm/man "$pkgdir"/usr/share + local d; for d in docs man; do + rm -r "$pkgdir"/usr/lib/node_modules/npm/$d + done + + # XXX: Workaround for https://github.com/npm/cli/issues/780. + (cd "$pkgdir"/usr/share/man/man5 && find * \ + -type f ! \( -name 'package-json.*' -or -name 'npmrc.*' -or -name 'npm-*' \) \ + -exec mv {} npm-{} \;) + (cd "$pkgdir"/usr/share/man/man7 && find * \ + -type f ! \( -name 'semver.*' -or -name 'npm-*' \) \ + -exec mv {} npm-{} \;) } dev() { @@ -196,9 +139,20 @@ dev() { default_dev } -sha512sums=" -36e91d15f8e3687deb74f05e4e635c824410b586ebe9b7a410006d1e864093a45d0d350fa9b8536ff9d48d81907ac5f551c17a010707f9776a2f53d5711be0cb node-v14.21.3.tar.gz -8033162669e01a1cd6d5103e5b86c3a6cc49d9a40c1715538be08a181d2c30eb588b251ef7520e73bf6ca8fccb90d81d139ba933927a0869f02546489e3df281 disable-running-gyp-on-shared-deps.patch -44e81fbf254bd79e38b813f7f5a1336df854588939cba50aaec600660495f9b7745a7049a99eb59d15a51100b3a44f66892a902d7fc32e1399b51883ad4c02cf link-with-libatomic-on-mips32.patch -30ca1ce7f9512c943950b8eec98bca99d24c740ebaa14619292fe5ed931dcf603ca90afb1d704ca7f545e421752ba4dde81c0c5bbb5242eb1726739ca627e15f fix-build-with-system-c-ares.patch -" +npm() { + pkgdesc="A package manager for JavaScript" + depends="$pkgname" + # for backward compatibility + provides="nodejs-npm=$pkgver-r$pkgrel nodejs-current-npm=$pkgver-r$pkgrel" + replaces="nodejs-npm nodejs-current-npm $pkgname" + + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/np[mx] "$subpkgdir"/usr/bin/ + + mkdir -p "$subpkgdir"/usr/lib/node_modules + mv "$pkgdir"/usr/lib/node_modules/npm "$subpkgdir"/usr/lib/node_modules/ +} + +sha512sums="1ce82fd404a434e48ebd16dc83792a4b3cff18433c1cce53b09b85dda2fbf1abf372574e3ab113e99c884012caadc13b246698ce071aaa329577bc08cdc2be46 node-v10.24.1.tar.gz +c27cb338eea8c817042d58b8fbadc234fb586f490020677f28f900ade31d2f4dd7bcdd4e52fddf209d9221b7e1fa57f629bd38787456995413cee79311f9571f dont-run-gyp-files-for-bundled-deps.patch +4fd3f10bd82d1e851ed000169c2635c001a4a051283edf96f1efb2260e2d395199dd5843f79f1cff8f2c0c65462c44241c508ea67835dfbd9880d9196fae290a link-with-libatomic-on-mips32.patch" diff --git a/user/nodejs/dont-run-gyp-files-for-bundled-deps.patch b/user/nodejs/dont-run-gyp-files-for-bundled-deps.patch new file mode 100644 index 0000000..2c2ebe2 --- /dev/null +++ b/user/nodejs/dont-run-gyp-files-for-bundled-deps.patch @@ -0,0 +1,21 @@ +From: Jakub Jirutka +Date: Sat, 26 Nov 2016 01:32:00 +0200 +Subject: Disable running gyp files for bundled deps + +Author: Stephen Gallagher + +Modified 2016-11-26 by Jakub Jirutka to update for +Node.js 7.2.0 + +--- a/Makefile ++++ b/Makefile +@@ -123,8 +123,7 @@ + test-code-cache: with-code-cache + $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) code-cache + +-out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \ +- deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \ ++out/Makefile: common.gypi deps/uv/uv.gyp deps/v8/gypfiles/toolchain.gypi \ + deps/v8/gypfiles/features.gypi deps/v8/gypfiles/v8.gyp node.gyp \ + config.gypi + $(PYTHON) tools/gyp_node.py -f make diff --git a/user/nodejs/link-with-libatomic-on-mips32.patch b/user/nodejs/link-with-libatomic-on-mips32.patch index ed20033..c4988a0 100644 --- a/user/nodejs/link-with-libatomic-on-mips32.patch +++ b/user/nodejs/link-with-libatomic-on-mips32.patch @@ -1,20 +1,6 @@ ---- a/tools/v8_gypfiles/v8.gyp -+++ b/tools/v8_gypfiles/v8.gyp -@@ -1266,6 +1266,11 @@ - ['want_separate_host_toolset', { - 'toolsets': ['host', 'target'], - }], -+ [ 'host_arch=="mips" or host_arch=="mipsel"', { -+ 'link_settings': { -+ 'libraries': [ '-latomic' ], -+ }, -+ }], - ['component=="shared_library"', { - 'direct_dependent_settings': { - 'defines': ['USING_V8_PLATFORM_SHARED'], --- a/node.gyp +++ b/node.gyp -@@ -381,6 +381,11 @@ +@@ -478,6 +478,11 @@ 'msvs_disabled_warnings!': [4244], 'conditions': [ @@ -23,6 +9,6 @@ + 'libraries': [ '-latomic' ], + }, + }], - [ 'error_on_warn=="true"', { - 'cflags': ['-Werror'], - 'xcode_settings': { + [ 'node_code_cache_path!=""', { + 'sources': [ '<(node_code_cache_path)' ] + }, { -- 2.45.2 From bb6df3ce5c77b97e28c8f82607e89747d06eb944 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 7 Sep 2023 11:05:16 -0400 Subject: [PATCH 09/16] nodejs10 --- user/onlyoffice-document-server/APKBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/onlyoffice-document-server/APKBUILD b/user/onlyoffice-document-server/APKBUILD index 1732e28..c92df8b 100644 --- a/user/onlyoffice-document-server/APKBUILD +++ b/user/onlyoffice-document-server/APKBUILD @@ -51,7 +51,7 @@ makedepends=" libpulse gtk+3.0-dev glib-dev - nodejs-dev~=14 + nodejs-dev~=10 " options="!check" # No testsuite source=" -- 2.45.2 From e35e3a99b5d7fcd84d6f9ebe0199ddfd6474d574 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 7 Sep 2023 14:02:15 -0400 Subject: [PATCH 10/16] nodejs12 --- user/nodejs/APKBUILD | 66 ++++++++++--------- .../dont-run-gyp-files-for-bundled-deps.patch | 15 ++--- .../link-with-libatomic-on-mips32.patch | 22 +++++-- user/nodejs/unbundle-uv.patch | 10 +++ user/onlyoffice-document-server/APKBUILD | 2 +- 5 files changed, 71 insertions(+), 44 deletions(-) create mode 100644 user/nodejs/unbundle-uv.patch diff --git a/user/nodejs/APKBUILD b/user/nodejs/APKBUILD index e5c439a..48b7890 100644 --- a/user/nodejs/APKBUILD +++ b/user/nodejs/APKBUILD @@ -6,9 +6,14 @@ # Maintainer: Jakub Jirutka # # secfixes: -# 10.24.1-r0: -# - CVE-2020-7774 -# 10.19.0-r0: +# 12.18.4-r0: +# - CVE-2020-8201 +# - CVE-2020-8252 +# 12.18.0-r0: +# - CVE-2020-8172 +# - CVE-2020-11080 +# - CVE-2020-8174 +# 12.15.0-r0: # - CVE-2019-15606 # - CVE-2019-15605 # - CVE-2019-15604 @@ -50,21 +55,30 @@ pkgname=nodejs # Note: Update only to even-numbered versions (e.g. 6.y.z, 8.y.z)! # Odd-numbered versions are supported only for 9 months by upstream. -pkgver=10.24.1 +pkgver=12.19.0 pkgrel=0 pkgdesc="JavaScript runtime built on V8 engine - LTS version" url="https://nodejs.org/" arch="all !mips64 !mips64el" license="MIT" -depends="ca-certificates" -# gold is needed for mksnapshot -makedepends="$depends_dev python2 openssl-dev zlib-dev libuv-dev linux-headers - paxmark binutils-gold http-parser-dev ca-certificates c-ares-dev" +depends="ca-certificates nghttp2-libs>=1.41" +depends_dev="libuv" +makedepends=" + brotli-dev + c-ares-dev + libuv-dev + linux-headers + nghttp2-dev + openssl-dev + python3 + zlib-dev + " subpackages="$pkgname-dev $pkgname-doc npm::noarch" provides="nodejs-lts=$pkgver" # for backward compatibility replaces="nodejs-current nodejs-lts" # nodejs-lts for backward compatibility source="https://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz dont-run-gyp-files-for-bundled-deps.patch + unbundle-uv.patch link-with-libatomic-on-mips32.patch " builddir="$srcdir/node-v$pkgver" @@ -73,35 +87,29 @@ prepare() { default_prepare # Remove bundled dependencies that we're not using. - rm -rf deps/http_parser deps/openssl deps/zlib + rm -rf deps/brotli deps/cares deps/openssl deps/uv deps/zlib } build() { - cd "$builddir" + # Add defines recommended in libuv readme. + export CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" + export CXXFLAGS="$CXXFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" case "$CARCH" in mips*) _carchflags="--with-mips-arch-variant=r1 --with-mips-float-abi=soft";; esac - # NOTE: We use bundled libuv because they don't care much about backward - # compatibility and it has happened several times in past that we - # couldn't upgrade nodejs package in stable branches to fix CVEs due to - # libuv incompatibility. - ./configure --prefix=/usr \ + python3 configure.py --prefix=/usr \ $_carchflags \ + --shared-brotli \ --shared-zlib \ + --shared-libuv \ --shared-openssl \ - --shared-http-parser \ --shared-cares \ + --shared-nghttp2 \ --openssl-use-def-ca-store - # We need run mksnapshot at build time so paxmark it early. - make -C out mksnapshot BUILDTYPE=Release - paxmark -m out/Release/mksnapshot - make - - # paxmark so JIT works - paxmark -m out/Release/node + make BUILDTYPE=Release } # TODO Run provided test suite. @@ -113,13 +121,8 @@ check() { } package() { - cd "$builddir" - make DESTDIR="$pkgdir" install - # It's strange, but it really needs to be paxmarked again... - paxmark -m "$pkgdir"/usr/bin/node - cp -pr "$pkgdir"/usr/lib/node_modules/npm/man "$pkgdir"/usr/share local d; for d in docs man; do rm -r "$pkgdir"/usr/lib/node_modules/npm/$d @@ -153,6 +156,7 @@ npm() { mv "$pkgdir"/usr/lib/node_modules/npm "$subpkgdir"/usr/lib/node_modules/ } -sha512sums="1ce82fd404a434e48ebd16dc83792a4b3cff18433c1cce53b09b85dda2fbf1abf372574e3ab113e99c884012caadc13b246698ce071aaa329577bc08cdc2be46 node-v10.24.1.tar.gz -c27cb338eea8c817042d58b8fbadc234fb586f490020677f28f900ade31d2f4dd7bcdd4e52fddf209d9221b7e1fa57f629bd38787456995413cee79311f9571f dont-run-gyp-files-for-bundled-deps.patch -4fd3f10bd82d1e851ed000169c2635c001a4a051283edf96f1efb2260e2d395199dd5843f79f1cff8f2c0c65462c44241c508ea67835dfbd9880d9196fae290a link-with-libatomic-on-mips32.patch" +sha512sums="8ad4c4a9d05f8b0ea36173398906faf0ec2f9e76bc3e3f12efb1c46adbc14710f694b6845355a4a7179e82860a6f619bbc0fd0c4ec2312023a740fe1d512ebd7 node-v12.19.0.tar.gz +3c536776e2ecb5dc677bf711a09418085b3c5e931a6eaf647f47c28e194d5c6dec354d4e7a039a5805b30fc7e83140594851e18d9120f523eec2f93539eac4db dont-run-gyp-files-for-bundled-deps.patch +a4e1e7bd4f32ee30ebd319ac0c2fc751166f8fdd27f491709003dfebda51cbece9412630f0b98f0b85253ccc4f066c82997ad68abb9b87dc0b47c24d09a0643a unbundle-uv.patch +a63b42c08b55139c1c363f6ba8aba9d85a0621b383ed514f7562cfa02f0cc290785d7cfe09892ac39962980d1b318957511f57b3f9b9d1fbc8704c0603597c9a link-with-libatomic-on-mips32.patch" diff --git a/user/nodejs/dont-run-gyp-files-for-bundled-deps.patch b/user/nodejs/dont-run-gyp-files-for-bundled-deps.patch index 2c2ebe2..db2ab01 100644 --- a/user/nodejs/dont-run-gyp-files-for-bundled-deps.patch +++ b/user/nodejs/dont-run-gyp-files-for-bundled-deps.patch @@ -9,13 +9,12 @@ Node.js 7.2.0 --- a/Makefile +++ b/Makefile -@@ -123,8 +123,7 @@ - test-code-cache: with-code-cache - $(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) code-cache +@@ -141,7 +141,7 @@ + echo "'test-code-cache' target is a noop" --out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \ -- deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \ -+out/Makefile: common.gypi deps/uv/uv.gyp deps/v8/gypfiles/toolchain.gypi \ - deps/v8/gypfiles/features.gypi deps/v8/gypfiles/v8.gyp node.gyp \ - config.gypi + out/Makefile: config.gypi common.gypi node.gyp \ +- deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp \ ++ deps/http_parser/http_parser.gyp \ + tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \ + tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp $(PYTHON) tools/gyp_node.py -f make diff --git a/user/nodejs/link-with-libatomic-on-mips32.patch b/user/nodejs/link-with-libatomic-on-mips32.patch index c4988a0..64a2d58 100644 --- a/user/nodejs/link-with-libatomic-on-mips32.patch +++ b/user/nodejs/link-with-libatomic-on-mips32.patch @@ -1,6 +1,20 @@ +--- a/tools/v8_gypfiles/v8.gyp ++++ b/tools/v8_gypfiles/v8.gyp +@@ -1168,6 +1168,11 @@ + ['want_separate_host_toolset', { + 'toolsets': ['host', 'target'], + }], ++ [ 'host_arch=="mips" or host_arch=="mipsel"', { ++ 'link_settings': { ++ 'libraries': [ '-latomic' ], ++ }, ++ }], + ['component=="shared_library"', { + 'direct_dependent_settings': { + 'defines': ['USING_V8_PLATFORM_SHARED'], --- a/node.gyp +++ b/node.gyp -@@ -478,6 +478,11 @@ +@@ -350,6 +350,11 @@ 'msvs_disabled_warnings!': [4244], 'conditions': [ @@ -9,6 +23,6 @@ + 'libraries': [ '-latomic' ], + }, + }], - [ 'node_code_cache_path!=""', { - 'sources': [ '<(node_code_cache_path)' ] - }, { + [ 'node_intermediate_lib_type=="static_library" and ' + 'node_shared=="true" and OS=="aix"', { + # For AIX, shared lib is linked by static lib and .exp. In the diff --git a/user/nodejs/unbundle-uv.patch b/user/nodejs/unbundle-uv.patch new file mode 100644 index 0000000..38025e8 --- /dev/null +++ b/user/nodejs/unbundle-uv.patch @@ -0,0 +1,10 @@ +--- a/deps/uvwasi/uvwasi.gyp ++++ b/deps/uvwasi/uvwasi.gyp +@@ -16,7 +16,6 @@ + 'src/wasi_rights.c', + ], + 'dependencies': [ +- '../uv/uv.gyp:libuv', + ], + 'direct_dependent_settings': { + 'include_dirs': ['include'] diff --git a/user/onlyoffice-document-server/APKBUILD b/user/onlyoffice-document-server/APKBUILD index c92df8b..8ccefd3 100644 --- a/user/onlyoffice-document-server/APKBUILD +++ b/user/onlyoffice-document-server/APKBUILD @@ -51,7 +51,7 @@ makedepends=" libpulse gtk+3.0-dev glib-dev - nodejs-dev~=10 + nodejs-dev~=12 " options="!check" # No testsuite source=" -- 2.45.2 From c5602788385e7f9dead5067b673524855712d05f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 7 Sep 2023 14:21:50 -0400 Subject: [PATCH 11/16] nodejs12.22 --- user/nodejs/APKBUILD | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/user/nodejs/APKBUILD b/user/nodejs/APKBUILD index 48b7890..0dc1a80 100644 --- a/user/nodejs/APKBUILD +++ b/user/nodejs/APKBUILD @@ -55,7 +55,7 @@ pkgname=nodejs # Note: Update only to even-numbered versions (e.g. 6.y.z, 8.y.z)! # Odd-numbered versions are supported only for 9 months by upstream. -pkgver=12.19.0 +pkgver=12.22.12 pkgrel=0 pkgdesc="JavaScript runtime built on V8 engine - LTS version" url="https://nodejs.org/" @@ -156,7 +156,9 @@ npm() { mv "$pkgdir"/usr/lib/node_modules/npm "$subpkgdir"/usr/lib/node_modules/ } -sha512sums="8ad4c4a9d05f8b0ea36173398906faf0ec2f9e76bc3e3f12efb1c46adbc14710f694b6845355a4a7179e82860a6f619bbc0fd0c4ec2312023a740fe1d512ebd7 node-v12.19.0.tar.gz +sha512sums=" +cb45e8d0aa1808439def6b0e770bf5c15c7a03b4d399efee604b10e11c706a241d780d867597dc209d856bcbc66cf737cb2a996bad6f2737b4d912c96d8e1cd9 node-v12.22.12.tar.gz 3c536776e2ecb5dc677bf711a09418085b3c5e931a6eaf647f47c28e194d5c6dec354d4e7a039a5805b30fc7e83140594851e18d9120f523eec2f93539eac4db dont-run-gyp-files-for-bundled-deps.patch a4e1e7bd4f32ee30ebd319ac0c2fc751166f8fdd27f491709003dfebda51cbece9412630f0b98f0b85253ccc4f066c82997ad68abb9b87dc0b47c24d09a0643a unbundle-uv.patch -a63b42c08b55139c1c363f6ba8aba9d85a0621b383ed514f7562cfa02f0cc290785d7cfe09892ac39962980d1b318957511f57b3f9b9d1fbc8704c0603597c9a link-with-libatomic-on-mips32.patch" +a63b42c08b55139c1c363f6ba8aba9d85a0621b383ed514f7562cfa02f0cc290785d7cfe09892ac39962980d1b318957511f57b3f9b9d1fbc8704c0603597c9a link-with-libatomic-on-mips32.patch +" -- 2.45.2 From 4db787d2dc9f6ec102c8c457ed45faad2cf7ab7f Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 8 Sep 2023 18:30:14 -0400 Subject: [PATCH 12/16] attempt using gcompat --- user/onlyoffice-document-server/APKBUILD | 31 ++---------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/user/onlyoffice-document-server/APKBUILD b/user/onlyoffice-document-server/APKBUILD index 8ccefd3..8128af4 100644 --- a/user/onlyoffice-document-server/APKBUILD +++ b/user/onlyoffice-document-server/APKBUILD @@ -18,6 +18,7 @@ makedepends=" clang musl-dev npm + gcompat python3 pythonispython3 autoconf @@ -52,6 +53,7 @@ makedepends=" gtk+3.0-dev glib-dev nodejs-dev~=12 + libc-compat " options="!check" # No testsuite source=" @@ -82,35 +84,6 @@ prepare() { ln -s /usr/lib/qt5/plugins "$srcdir"/system_qt/gcc_64/plugins npm install -g --prefix "$srcdir"/npm_cache pkg grunt grunt-cli gifsicle - # overrides rpi for certain 3rd party libraries as already provided by system - sed -i '/harfbuzz.make()/d' build_tools/scripts/core_common/make_common.py - cat > "$builddir"/core/Common/3dParty/harfbuzz/harfbuzz.pri << EOF -INCLUDEPATH += /usr/include/harfbuzz -EOF - - sed -i '/icu.make()/d' build_tools/scripts/core_common/make_common.py - cat > "$builddir"/core/Common/3dParty/icu/icu.pri << EOF -INCLUDEPATH += /usr/include -LIBS += -licuuc -l icudata -EOF - sed -i '/v8.make()/d' build_tools/scripts/core_common/make_common.py - cat > "$builddir"/core/Common/3dParty/v8/v8.pri << EOF -INCLUDEPATH += /usr/include/node -LIBS += -lnode -EOF - sed -i '/openssl.make()/d' build_tools/scripts/core_common/make_common.py - cat > "$builddir"/core/Common/3dParty/openssl/openssl.pri << EOF -INCLUDEPATH += /usr/include/openssl -LIBS += -lcrypto -lssl -EOF - sed -i '/boost.make()/d' build_tools/scripts/core_common/make_common.py - cat > "$builddir"/core/Common/3dParty/boost/boost.pri << EOF -INCLUDEPATH += /usr/include/boost -CORE_BOOST_LIBS = /usr/lib -core_boost_libs:LIBS += -L\$CORE_BOOST_LIBS -lboost_system -lboost_filesystem -core_boost_regex:LIBS += -L\$CORE_BOOST_LIBS -lboost_regex -core_boost_date_time:LIBS += -L\$CORE_BOOST_LIBS -lboost_date_time -EOF } build() { -- 2.45.2 From 2a7094efb4009764cd52ac486841bac573c0ac82 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 8 Sep 2023 18:36:21 -0400 Subject: [PATCH 13/16] deps --- user/onlyoffice-document-server/APKBUILD | 1 - 1 file changed, 1 deletion(-) diff --git a/user/onlyoffice-document-server/APKBUILD b/user/onlyoffice-document-server/APKBUILD index 8128af4..84f2bee 100644 --- a/user/onlyoffice-document-server/APKBUILD +++ b/user/onlyoffice-document-server/APKBUILD @@ -53,7 +53,6 @@ makedepends=" gtk+3.0-dev glib-dev nodejs-dev~=12 - libc-compat " options="!check" # No testsuite source=" -- 2.45.2 From 35e54da03bcbb220e698d782403c5569a6adaf39 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 8 Sep 2023 18:37:28 -0400 Subject: [PATCH 14/16] nodejs14 --- user/onlyoffice-document-server/APKBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user/onlyoffice-document-server/APKBUILD b/user/onlyoffice-document-server/APKBUILD index 84f2bee..d6886bb 100644 --- a/user/onlyoffice-document-server/APKBUILD +++ b/user/onlyoffice-document-server/APKBUILD @@ -52,7 +52,7 @@ makedepends=" libpulse gtk+3.0-dev glib-dev - nodejs-dev~=12 + nodejs-dev~=14 " options="!check" # No testsuite source=" -- 2.45.2 From 8c20890fabb18eed7ed6b1851150b32c09a4c553 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 8 Sep 2023 18:52:33 -0400 Subject: [PATCH 15/16] nodejs --- user/nodejs/APKBUILD | 126 ++++++++++++------ .../link-with-libatomic-on-mips32.patch | 10 +- 2 files changed, 88 insertions(+), 48 deletions(-) diff --git a/user/nodejs/APKBUILD b/user/nodejs/APKBUILD index 0dc1a80..4e62b79 100644 --- a/user/nodejs/APKBUILD +++ b/user/nodejs/APKBUILD @@ -6,6 +6,48 @@ # Maintainer: Jakub Jirutka # # secfixes: +# 14.21.3-r0: +# - CVE-2023-23918 +# - CVE-2023-23920 +# 14.20.1-r0: +# - CVE-2022-32213 +# - CVE-2022-32214 +# - CVE-2022-32215 +# - CVE-2022-35256 +# 14.19.0-r0: +# - CVE-2022-21824 +# - CVE-2021-44533 +# - CVE-2021-44532 +# - CVE-2021-44531 +# 14.18.1-r0: +# - CVE-2021-22959 +# - CVE-2021-22960 +# 14.17.6-r0: +# - CVE-2021-37701 +# - CVE-2021-37712 +# - CVE-2021-37713 +# - CVE-2021-39134 +# - CVE-2021-39135 +# 14.17.5-r0: +# - CVE-2021-3672 +# - CVE-2021-22931 +# - CVE-2021-22939 +# 14.17.4-r0: +# - CVE-2021-22930 +# 14.17.3-r0: +# - CVE-2021-22918 +# 14.16.1-r0: +# - CVE-2020-7774 +# 14.16.0-r0: +# - CVE-2021-22883 +# - CVE-2021-22884 +# 14.15.5-r0: +# - CVE-2021-21148 +# 14.15.4-r0: +# - CVE-2020-8265 +# - CVE-2020-8287 +# 14.15.1-r0: +# - CVE-2020-8277 # 12.18.4-r0: # - CVE-2020-8201 # - CVE-2020-8252 @@ -51,35 +93,39 @@ # - CVE-2017-14919 # 6.11.1-r0: # - CVE-2017-1000381 +# 0: +# - CVE-2022-32212 +# - CVE-2022-32223 # pkgname=nodejs # Note: Update only to even-numbered versions (e.g. 6.y.z, 8.y.z)! # Odd-numbered versions are supported only for 9 months by upstream. -pkgver=12.22.12 +pkgver=14.21.3 pkgrel=0 pkgdesc="JavaScript runtime built on V8 engine - LTS version" url="https://nodejs.org/" -arch="all !mips64 !mips64el" +arch="all !mips64 !mips64el !riscv64" license="MIT" depends="ca-certificates nghttp2-libs>=1.41" -depends_dev="libuv" makedepends=" brotli-dev c-ares-dev - libuv-dev + icu-dev linux-headers nghttp2-dev openssl-dev python3 zlib-dev " -subpackages="$pkgname-dev $pkgname-doc npm::noarch" +install="$pkgname.post-upgrade" +subpackages="$pkgname-dev $pkgname-doc" +provider_priority=100 # highest priority (other provider is nodejs-current) provides="nodejs-lts=$pkgver" # for backward compatibility replaces="nodejs-current nodejs-lts" # nodejs-lts for backward compatibility source="https://nodejs.org/dist/v$pkgver/node-v$pkgver.tar.gz - dont-run-gyp-files-for-bundled-deps.patch - unbundle-uv.patch + disable-running-gyp-on-shared-deps.patch link-with-libatomic-on-mips32.patch + fix-build-with-system-c-ares.patch " builddir="$srcdir/node-v$pkgver" @@ -87,27 +133,48 @@ prepare() { default_prepare # Remove bundled dependencies that we're not using. - rm -rf deps/brotli deps/cares deps/openssl deps/uv deps/zlib + rm -rf deps/brotli deps/cares deps/openssl deps/zlib } build() { # Add defines recommended in libuv readme. - export CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" - export CXXFLAGS="$CXXFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" + local common_flags="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" + + # Compiling with O2 instead of Os increases binary size by ~10% + # (53.1 MiB -> 58.6 MiB), but also increases performance by ~20% + # according to v8/web-tooling-benchmark. Node.js is quite huge anyway; + # there are better options for size constrained environments. + export CFLAGS="${CFLAGS/-Os/-O2} $common_flags" + export CXXFLAGS="${CXXFLAGS/-Os/-O2} $common_flags" + export CPPFLAGS="${CPPFLAGS/-Os/-O2} $common_flags" case "$CARCH" in mips*) _carchflags="--with-mips-arch-variant=r1 --with-mips-float-abi=soft";; esac + # NOTE: We use bundled libuv because they don't care much about backward + # compatibility and it has happened several times in past that we + # couldn't upgrade nodejs package in stable branches to fix CVEs due to + # libuv incompatibility. + # + # NOTE: We don't package the bundled npm - it's a separate project with + # its own release cycle and version numbering, so it's better to keep + # it in a standalone aport. + # + # TODO: After icu package is modified to split data into multiple + # variants, change --with-intl to "system-icu". python3 configure.py --prefix=/usr \ $_carchflags \ --shared-brotli \ --shared-zlib \ - --shared-libuv \ --shared-openssl \ --shared-cares \ --shared-nghttp2 \ - --openssl-use-def-ca-store + --openssl-use-def-ca-store \ + --with-icu-default-data-dir=$(icu-config --icudatadir) \ + --with-intl=small-icu \ + --without-corepack \ + --without-npm make BUILDTYPE=Release } @@ -122,19 +189,6 @@ check() { package() { make DESTDIR="$pkgdir" install - - cp -pr "$pkgdir"/usr/lib/node_modules/npm/man "$pkgdir"/usr/share - local d; for d in docs man; do - rm -r "$pkgdir"/usr/lib/node_modules/npm/$d - done - - # XXX: Workaround for https://github.com/npm/cli/issues/780. - (cd "$pkgdir"/usr/share/man/man5 && find * \ - -type f ! \( -name 'package-json.*' -or -name 'npmrc.*' -or -name 'npm-*' \) \ - -exec mv {} npm-{} \;) - (cd "$pkgdir"/usr/share/man/man7 && find * \ - -type f ! \( -name 'semver.*' -or -name 'npm-*' \) \ - -exec mv {} npm-{} \;) } dev() { @@ -142,23 +196,9 @@ dev() { default_dev } -npm() { - pkgdesc="A package manager for JavaScript" - depends="$pkgname" - # for backward compatibility - provides="nodejs-npm=$pkgver-r$pkgrel nodejs-current-npm=$pkgver-r$pkgrel" - replaces="nodejs-npm nodejs-current-npm $pkgname" - - mkdir -p "$subpkgdir"/usr/bin - mv "$pkgdir"/usr/bin/np[mx] "$subpkgdir"/usr/bin/ - - mkdir -p "$subpkgdir"/usr/lib/node_modules - mv "$pkgdir"/usr/lib/node_modules/npm "$subpkgdir"/usr/lib/node_modules/ -} - sha512sums=" -cb45e8d0aa1808439def6b0e770bf5c15c7a03b4d399efee604b10e11c706a241d780d867597dc209d856bcbc66cf737cb2a996bad6f2737b4d912c96d8e1cd9 node-v12.22.12.tar.gz -3c536776e2ecb5dc677bf711a09418085b3c5e931a6eaf647f47c28e194d5c6dec354d4e7a039a5805b30fc7e83140594851e18d9120f523eec2f93539eac4db dont-run-gyp-files-for-bundled-deps.patch -a4e1e7bd4f32ee30ebd319ac0c2fc751166f8fdd27f491709003dfebda51cbece9412630f0b98f0b85253ccc4f066c82997ad68abb9b87dc0b47c24d09a0643a unbundle-uv.patch -a63b42c08b55139c1c363f6ba8aba9d85a0621b383ed514f7562cfa02f0cc290785d7cfe09892ac39962980d1b318957511f57b3f9b9d1fbc8704c0603597c9a link-with-libatomic-on-mips32.patch +36e91d15f8e3687deb74f05e4e635c824410b586ebe9b7a410006d1e864093a45d0d350fa9b8536ff9d48d81907ac5f551c17a010707f9776a2f53d5711be0cb node-v14.21.3.tar.gz +8033162669e01a1cd6d5103e5b86c3a6cc49d9a40c1715538be08a181d2c30eb588b251ef7520e73bf6ca8fccb90d81d139ba933927a0869f02546489e3df281 disable-running-gyp-on-shared-deps.patch +44e81fbf254bd79e38b813f7f5a1336df854588939cba50aaec600660495f9b7745a7049a99eb59d15a51100b3a44f66892a902d7fc32e1399b51883ad4c02cf link-with-libatomic-on-mips32.patch +30ca1ce7f9512c943950b8eec98bca99d24c740ebaa14619292fe5ed931dcf603ca90afb1d704ca7f545e421752ba4dde81c0c5bbb5242eb1726739ca627e15f fix-build-with-system-c-ares.patch " diff --git a/user/nodejs/link-with-libatomic-on-mips32.patch b/user/nodejs/link-with-libatomic-on-mips32.patch index 64a2d58..ed20033 100644 --- a/user/nodejs/link-with-libatomic-on-mips32.patch +++ b/user/nodejs/link-with-libatomic-on-mips32.patch @@ -1,6 +1,6 @@ --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp -@@ -1168,6 +1168,11 @@ +@@ -1266,6 +1266,11 @@ ['want_separate_host_toolset', { 'toolsets': ['host', 'target'], }], @@ -14,7 +14,7 @@ 'defines': ['USING_V8_PLATFORM_SHARED'], --- a/node.gyp +++ b/node.gyp -@@ -350,6 +350,11 @@ +@@ -381,6 +381,11 @@ 'msvs_disabled_warnings!': [4244], 'conditions': [ @@ -23,6 +23,6 @@ + 'libraries': [ '-latomic' ], + }, + }], - [ 'node_intermediate_lib_type=="static_library" and ' - 'node_shared=="true" and OS=="aix"', { - # For AIX, shared lib is linked by static lib and .exp. In the + [ 'error_on_warn=="true"', { + 'cflags': ['-Werror'], + 'xcode_settings': { -- 2.45.2 From d82f74896d47a0fee6883a00e3319de4d4f9a77a Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Fri, 8 Sep 2023 20:00:16 -0400 Subject: [PATCH 16/16] xz --- user/onlyoffice-document-server/APKBUILD | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user/onlyoffice-document-server/APKBUILD b/user/onlyoffice-document-server/APKBUILD index d6886bb..3b7feb2 100644 --- a/user/onlyoffice-document-server/APKBUILD +++ b/user/onlyoffice-document-server/APKBUILD @@ -47,6 +47,8 @@ makedepends=" alsa-lib subversion gzip + xz + pigz p7zip libtool libpulse -- 2.45.2