From acf90fdbbe87c69180e06d130a27ade4bf348f51 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 31 Aug 2023 14:37:55 -0400 Subject: [PATCH 1/7] backports/freecad: upgrade to 0.20.1 --- backports/freecad/APKBUILD | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backports/freecad/APKBUILD b/backports/freecad/APKBUILD index a638a02..0eab289 100644 --- a/backports/freecad/APKBUILD +++ b/backports/freecad/APKBUILD @@ -1,8 +1,8 @@ # Contributor: Aiden Grossman # Maintainer: Aiden Grossman pkgname=freecad -pkgver=0.20.2 -pkgrel=4 +pkgver=0.21.0 +pkgrel=0 pkgdesc="Free and open source 3D parametric modeler" url="https://freecadweb.org/" license="LGPL-2.0-or-later" @@ -93,7 +93,7 @@ package() { } sha512sums=" -c3acd77dd2bb9a2a23ac354da3b6102effb89c95d675e91421d65486414dfe8cc0188a7212245e0deb63f17b9c5df76133017be09e4cd14b833be8cbec52a08d freecad-0.20.2.tar.gz +f5b4428217d9abd18aed1dcd8a5c77132b90173d07627ff9164919a87f04d242f9d616e9655751ec06ff57fc3e242090cc4d7e1d7045fdae9bc2e281e7855281 freecad-0.21.0.tar.gz 75a237f7ed7a89a98c0e5bdb3d3f0788749602daf718089aa0814e05f93ced1e15ad5867c7c87f170b48c5984f9ace1bbc95c4f386ce72bfb8d616323b47f1e5 freecad-python3.11-1.patch 80b08b031810fce7b6d698c662f64fa4f8a904f283f46b478b1d718529164c0ee61ce190f633abf04e03212720480f3f0603b0c1e160af79d7b6bb82da3bd0e4 numpy-1.20.patch 73aaba7015dce7048eb7d2456131b5b5ba4673cc980503331987be54d99daed5f61db015ca33d7d2ef0f02bd3192da8ce122c103c3b93f9959927deb4f0b933e no-execinfo.patch -- 2.45.2 From 1fc4159ed22126e200097996968d596083734161 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Thu, 31 Aug 2023 14:45:05 -0400 Subject: [PATCH 2/7] Fix build --- backports/freecad/APKBUILD | 13 +--- backports/freecad/no-workaround-spnav.patch | 69 --------------------- backports/freecad/numpy-1.20.patch | 25 -------- backports/freecad/resourceDirectory.patch | 11 ---- 4 files changed, 3 insertions(+), 115 deletions(-) delete mode 100644 backports/freecad/no-workaround-spnav.patch delete mode 100644 backports/freecad/numpy-1.20.patch delete mode 100644 backports/freecad/resourceDirectory.patch diff --git a/backports/freecad/APKBUILD b/backports/freecad/APKBUILD index 0eab289..279a09b 100644 --- a/backports/freecad/APKBUILD +++ b/backports/freecad/APKBUILD @@ -44,14 +44,11 @@ makedepends=" vtk-dev xerces-c-dev " +options="!check" # Failing test units upstream as well checkdepends="xvfb-run mesa mesa-dri-gallium font-opensans" source="https://github.com/FreeCAD/FreeCAD/archive/$pkgver/freecad-$pkgver.tar.gz - $pkgname-python3.11-1.patch::https://github.com/FreeCAD/FreeCAD/commit/fe02d63c8c9b1280978be841d04e68a0a55cceb9.patch - numpy-1.20.patch + $pkgname-cstdint.patch::https://github.com/FreeCAD/FreeCAD/commit/f8f02f089537497a1bf46bc1057f01659b6636c1.patch no-execinfo.patch - no-workaround-spnav.patch - resourceDirectory.patch - tests.patch " builddir="$srcdir/FreeCAD-$pkgver" @@ -94,10 +91,6 @@ package() { sha512sums=" f5b4428217d9abd18aed1dcd8a5c77132b90173d07627ff9164919a87f04d242f9d616e9655751ec06ff57fc3e242090cc4d7e1d7045fdae9bc2e281e7855281 freecad-0.21.0.tar.gz -75a237f7ed7a89a98c0e5bdb3d3f0788749602daf718089aa0814e05f93ced1e15ad5867c7c87f170b48c5984f9ace1bbc95c4f386ce72bfb8d616323b47f1e5 freecad-python3.11-1.patch -80b08b031810fce7b6d698c662f64fa4f8a904f283f46b478b1d718529164c0ee61ce190f633abf04e03212720480f3f0603b0c1e160af79d7b6bb82da3bd0e4 numpy-1.20.patch +27dffdbb124096e7fcbec3589cdcfc587ea09bf039c1c1108edb68a9a4fd1278f66a39642636f98b8759a44da92485fd748f8b3d615b0625bc37fc717130e237 freecad-cstdint.patch 73aaba7015dce7048eb7d2456131b5b5ba4673cc980503331987be54d99daed5f61db015ca33d7d2ef0f02bd3192da8ce122c103c3b93f9959927deb4f0b933e no-execinfo.patch -15696bdaaf77482f1b5d3806535a8004c8cec7d598d62092d9f0394b4ca9e2ad6cedd77c4b86a83a06324d16678c1c6bbf3a390b807729717a2f513e858afd50 no-workaround-spnav.patch -8ba13b17bad66316757d180c1b9e9e72a24382627eac7c43a2264b3b5101e6e8f701775f2b805ed733f500fbcd8b0e8e422ec58a9ab3d948d613b666157d4c52 resourceDirectory.patch -5db19e0aa2ca1fd21f4c56afc9db54390a799262aaa0a741704c2c304b0068fd6ca1dcc086465e12e9c0cfe06aac750aaf9b8f5f4db324539af4dd3394803ff9 tests.patch " diff --git a/backports/freecad/no-workaround-spnav.patch b/backports/freecad/no-workaround-spnav.patch deleted file mode 100644 index ee4fead..0000000 --- a/backports/freecad/no-workaround-spnav.patch +++ /dev/null @@ -1,69 +0,0 @@ -Patch-Source: https://github.com/FreeCAD/FreeCAD/commit/7b377a216b9185960e4cee980a6504dc1a755f50 -fixes stderr reassignment --- -From 7b377a216b9185960e4cee980a6504dc1a755f50 Mon Sep 17 00:00:00 2001 -From: wmayer -Date: Wed, 29 Jun 2022 15:19:18 +0200 -Subject: [PATCH] Gui: remove workaround for spnav 0.23 due to build failure - with musl libc - ---- - src/Gui/3Dconnexion/GuiNativeEventLinux.cpp | 27 --------------------- - 1 file changed, 27 deletions(-) - -diff --git a/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp b/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp -index 7f0ddd75d262..455ece0b36bd 100644 ---- a/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp -+++ b/src/Gui/3Dconnexion/GuiNativeEventLinux.cpp -@@ -21,42 +21,17 @@ - ***************************************************************************/ - - #include --#include - - #include "GuiNativeEventLinux.h" - - #include "GuiApplicationNativeEventAware.h" - #include --#include - #include - - #include - - #include - --namespace { --class RedirectStdErr --{ --public: -- RedirectStdErr() -- : fi(Base::FileInfo::getTempFileName()) -- , file(stderr) -- { -- stderr = fopen(fi.filePath().c_str(), "w"); -- } -- ~RedirectStdErr() -- { -- fclose(stderr); -- fi.deleteFile(); -- stderr = file; -- } -- --private: -- Base::FileInfo fi; -- FILE* file; --}; --} -- - Gui::GuiNativeEvent::GuiNativeEvent(Gui::GUIApplicationNativeEventAware *app) - : GuiAbstractNativeEvent(app) - { -@@ -72,8 +47,6 @@ Gui::GuiNativeEvent::~GuiNativeEvent() - - void Gui::GuiNativeEvent::initSpaceball(QMainWindow *window) - { -- // tmp. redirect stderr to a file to suppress an error message from spnav_open() -- RedirectStdErr err; - Q_UNUSED(window) - if (spnav_open() == -1) { - Base::Console().Log("Couldn't connect to spacenav daemon. Please ignore if you don't have a spacemouse.\n"); diff --git a/backports/freecad/numpy-1.20.patch b/backports/freecad/numpy-1.20.patch deleted file mode 100644 index 20f4b41..0000000 --- a/backports/freecad/numpy-1.20.patch +++ /dev/null @@ -1,25 +0,0 @@ -Patch-Source: https://github.com/FreeCAD/FreeCAD/commit/8b0df1dc936b544091f6a2d68df1c1a14ae3de5b --- -From 8b0df1dc936b544091f6a2d68df1c1a14ae3de5b Mon Sep 17 00:00:00 2001 -From: lorenz -Date: Tue, 27 Dec 2022 04:59:35 +0100 -Subject: [PATCH] FEM: femmesh: fix AttributeError: module 'numpy' has no - attribute 'int' - ---- - src/Mod/Fem/femmesh/meshtools.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/Mod/Fem/femmesh/meshtools.py b/src/Mod/Fem/femmesh/meshtools.py -index dd8671b..d2e2b0a 100644 ---- a/src/Mod/Fem/femmesh/meshtools.py -+++ b/src/Mod/Fem/femmesh/meshtools.py -@@ -485,7 +485,7 @@ def get_femelement_sets( - # fem_objects = FreeCAD FEM document objects - # get femelements for reference shapes of each obj.References - count_femelements = 0 -- referenced_femelements = np.zeros((max(femelement_table.keys())+1,),dtype=np.int) -+ referenced_femelements = np.zeros((max(femelement_table.keys())+1,),dtype=int) - has_remaining_femelements = None - for fem_object_i, fem_object in enumerate(fem_objects): - obj = fem_object["Object"] diff --git a/backports/freecad/resourceDirectory.patch b/backports/freecad/resourceDirectory.patch deleted file mode 100644 index a2a16d1..0000000 --- a/backports/freecad/resourceDirectory.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./cMake/FreeCAD_Helpers/ConfigureCMakeVariables.cmake.orig -+++ ./cMake/FreeCAD_Helpers/ConfigureCMakeVariables.cmake -@@ -23,7 +23,7 @@ - "Path to the directory containing PyCXX's cxxextensions.c source file") - - # used as compiler defines -- set(RESOURCEDIR "${CMAKE_INSTALL_DATADIR}") -+ set(RESOURCEDIR "../../share/freecad") - set(LIBRARYDIR "${CMAKE_INSTALL_LIBDIR}") - set(DOCDIR "${CMAKE_INSTALL_DOCDIR}") - -- 2.45.2 From c566f00f032b6f4d4815c4574ac24c10c44ec827 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 3 May 2023 01:33:58 -0400 Subject: [PATCH 3/7] user/trilium: new aport --- user/trilium/APKBUILD | 117 +++++++++++++++++++++++++++ user/trilium/config-sample.ini.patch | 13 +++ user/trilium/copy-trilium.sh.patch | 33 ++++++++ user/trilium/trilium-dumpdb.sh | 3 + user/trilium/trilium-server.sh | 3 + user/trilium/trilium.desktop | 15 ++++ user/trilium/trilium.sh | 21 +++++ 7 files changed, 205 insertions(+) create mode 100644 user/trilium/APKBUILD create mode 100644 user/trilium/config-sample.ini.patch create mode 100644 user/trilium/copy-trilium.sh.patch create mode 100644 user/trilium/trilium-dumpdb.sh create mode 100644 user/trilium/trilium-server.sh create mode 100644 user/trilium/trilium.desktop create mode 100644 user/trilium/trilium.sh diff --git a/user/trilium/APKBUILD b/user/trilium/APKBUILD new file mode 100644 index 0000000..1fdd846 --- /dev/null +++ b/user/trilium/APKBUILD @@ -0,0 +1,117 @@ +# Maintainer: Antoine Martin (ayakael) +# Contributor: Antoine Martin (ayakael) + +pkgname="trilium" +pkgver=0.59.4 +pkgrel=0 +pkgdesc="A hierarchical note taking application with focus on building large personal knowledge bases." +arch="x86_64'" +url="https://github.com/zadam/trilium" +license="AGPL-3.0" +depends="electron" +makedepends=" + npm + nodejs + " +subpackages="$pkgname-server $pkgname-dumpdb" +source="$pkgname-$pkgver.tar.gz::https://github.com/zadam/trilium/archive/refs/tags/v$pkgver.tar.gz + copy-trilium.sh.patch + config-sample.ini.patch + trilium.sh + trilium-server.sh + trilium-dumpdb.sh + trilium.desktop + " + +prepare() { + default_prepare + + sed -i "s|@electronversion@|$_electron_version|" ../trilium.sh +} + +_trilium_desktop_src_dir=./dist/trilium-linux-x64-src +_trilium_server_src_dir=./dist/trilium-linux-server-x64-src + +build() { + export npm_config_cache="$srcdir/npm_cache" + export ELECTRON_SKIP_BINARY_DOWNLOAD=1 + npm install --build-from-source + + # Building trilium (desktop) + ./bin/copy-trilium.sh $_trilium_desktop_src_dir + rm -rf $_trilium_desktop_src_dir/dump-db + + rm -r $_trilium_desktop_src_dir/src/public/app-dist/*.mobile.* + + npx electron-builder --linux --x64 --dir \ + --project=$_trilium_desktop_src_dir \ + -c.electronDist=/usr/lib/electron$_electron_version \ + -c.electronVersion=$(electron$_electron_version --version | tail -c +2) + + # Building trilium-server + grep -v electron package.json > package-server.json + mv package-server.json package.json + + ./bin/copy-trilium.sh $_trilium_server_src_dir + rm -rf $_trilium_server_src_dir/dump-db + + mkdir $_trilium_server_src_dir/node_modules/better-sqlite3/build/Release + cp ./node_modules/better-sqlite3/build/Release/better_sqlite3.node $_trilium_server_src_dir/node_modules/better-sqlite3/build/Release/better_sqlite3.node + + rm -r $_trilium_server_src_dir/webpack* + rm -r $_trilium_server_src_dir/electron.js + + # Building trilium-dumpdb + cd dump-db + + npm install + cp -f ../node_modules/better-sqlite3/build/Release/better_sqlite3.node node_modules/better-sqlite3/build/Release/better_sqlite3.node +} + +package() { + install -vDm644 $_trilium_desktop_src_dir/dist/linux-unpacked/resources/app.asar -t "${pkgdir}/usr/lib/${pkgname}" + install -vDm644 $_trilium_desktop_src_dir/package.json -t "${pkgdir}/usr/lib/${pkgname}" + install -vDm644 bin/tpl/anonymize-database.sql -t "${pkgdir}/usr/lib/${pkgname}" + + for i in 16 32 64 128 256 512; do + install -vDm644 images/app-icons/png/${i}x${i}.png "${pkgdir}/usr/share/icons/hicolor/${i}x${i}/apps/${pkgname}.png" + done + + install -vDm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/trilium" + install -vDm644 "${srcdir}"/${pkgname}.desktop -t "${pkgdir}"/usr/share/applications +} + +server() { + pkgdesc="A hierarchical note taking application with focus on building large personal knowledge bases - Server version" + depends="nodejs" + + install -vd "${pkgdir}/usr/share/webapps/${pkgname}" + cp -vr $_trilium_server_src_dir/. -t "${pkgdir}/usr/share/webapps/${pkgname}" + chmod -v 755 "${pkgdir}/usr/share/webapps/${pkgname}/src/www" + install -vDm644 $_trilium_server_src_dir/package.json -t "${pkgdir}/usr/share/webapps/${pkgname}" + install -vDm644 bin/tpl/anonymize-database.sql -t "${pkgdir}/usr/share/webapps/${pkgname}" + + install -vDm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/trilium-server" + # TODO: setup openrc + # install -vDm644 "${srcdir}"/${pkgname}.service -t "${pkgdir}/usr/lib/systemd/system" +} + +dumpdb() { + pkgdesc="An emergency tool to extract notes from the database where they're stored to plain files on the filesystem" + depends="nodejs" + + install -vd "${pkgdir}/usr/lib/${pkgname}" + cp -vr dump-db/. -t "${pkgdir}/usr/lib/${pkgname}" + chmod -v 755 "${pkgdir}/usr/lib/${pkgname}/dump-db.js" + + install -vDm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/trilium-dumpdb" +} +sha512sums=" +96a4788574f66a830515eb8fe11bdc87e1083f04c3f409d095cdde2515c008c2ba32a0554d7e5cda4602c2b20861e5b442e022f3c1be4fd3397c0f9e4d24eae2 trilium-0.59.4.tar.gz +90ed115b3c7664d958f8426ac55253d46e770ebbfc4b7443581943df7e85211d709948e7ca41d698b28d4510c3e4c50244726ce49d44e1fa530fbf8129e42c5a copy-trilium.sh.patch +48fcb6931b632280a16b14744ee64804de1b399b0682076fdf1fa5669f691a53371532363020d8c7fb3704ea7bd633903cab1b92018f88a7170e6c2e213cd149 config-sample.ini.patch +6b03a7cce3836966d00e282d012cce944b8b56e29200fa06e64563a95e4edde591c0018715639a5e2acdbfd11a73ccb8283fbad19efc7dff218e8398c7e12d30 trilium.sh +14a97f1fab392dd9a55440712bf3f2976de20e9c09789392984313455af77d9900445bd06cf2c3a3879a94cab893e83bd4093060f9214b2c201af89d7f62f663 trilium-server.sh +e1fa62cdc2ecde41f5c5336bca3dd2d2b9e65de1a3162ef4ed336aaa7660c2b1c23793df7cdbd09e8b020890de0ba2d58c8704d2d1f0916da1212167c4820c0f trilium-dumpdb.sh +d0c051a0412f17f0373ead660ae6ddfefe5e8f8e2104a0ffc52d9af94c57c1274a2dc8d2317516dafa0fa85263250633acb56556318f21a663105dd7fce9b36f trilium.desktop +" diff --git a/user/trilium/config-sample.ini.patch b/user/trilium/config-sample.ini.patch new file mode 100644 index 0000000..041538e --- /dev/null +++ b/user/trilium/config-sample.ini.patch @@ -0,0 +1,13 @@ +diff --git a/config-sample.ini.orig b/config-sample.ini +index 0e8da03..046b970 100644 +--- a/config-sample.ini.orig ++++ b/config-sample.ini +@@ -9,7 +9,7 @@ noAuthentication=false + noBackup=false + + # Disable automatically generating desktop icon +-# noDesktopIcon=true ++noDesktopIcon=true + + [Network] + # host setting is relevant only for web deployments - set the host on which the server will listen diff --git a/user/trilium/copy-trilium.sh.patch b/user/trilium/copy-trilium.sh.patch new file mode 100644 index 0000000..a1bccb8 --- /dev/null +++ b/user/trilium/copy-trilium.sh.patch @@ -0,0 +1,33 @@ +diff --git a/./bin/copy-trilium.sh.orig b/./bin/copy-trilium.sh +index ae460ff..95015ca 100755 +--- a/./bin/copy-trilium.sh.orig ++++ b/./bin/copy-trilium.sh +@@ -5,12 +5,12 @@ if [[ $# -eq 0 ]] ; then + exit 1 + fi + +-n exec 16.19.1 npm run webpack ++npm run webpack + + DIR=$1 + + rm -rf $DIR +-mkdir $DIR ++mkdir -p $DIR + + echo "Copying Trilium to build directory $DIR" + +@@ -27,11 +27,11 @@ cp -r electron.js $DIR/ + cp webpack-* $DIR/ + + # run in subshell (so we return to original dir) +-(cd $DIR && n exec 16.19.1 npm install --only=prod) ++(cd $DIR && npm install --only=prod) + + # cleanup of useless files in dependencies + rm -r $DIR/node_modules/image-q/demo +-rm -r $DIR/node_modules/better-sqlite3/Release ++rm -r $DIR/node_modules/better-sqlite3/build/Release + rm -r $DIR/node_modules/better-sqlite3/deps/sqlite3.tar.gz + rm -r $DIR/node_modules/@jimp/plugin-print/fonts + rm -r $DIR/node_modules/jimp/browser diff --git a/user/trilium/trilium-dumpdb.sh b/user/trilium/trilium-dumpdb.sh new file mode 100644 index 0000000..8065a35 --- /dev/null +++ b/user/trilium/trilium-dumpdb.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec node /usr/lib/trilium-dumpdb/dump-db.js $@ diff --git a/user/trilium/trilium-server.sh b/user/trilium/trilium-server.sh new file mode 100644 index 0000000..983724d --- /dev/null +++ b/user/trilium/trilium-server.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +exec node /usr/share/webapps/trilium-server/src/www $@ diff --git a/user/trilium/trilium.desktop b/user/trilium/trilium.desktop new file mode 100644 index 0000000..5d5733b --- /dev/null +++ b/user/trilium/trilium.desktop @@ -0,0 +1,15 @@ +[Desktop Entry] +Name=Trilium Notes +GenericName=Note-taking +Comment=A hierarchical note taking application with focus on building large personal knowledge bases. +Exec=trilium +Terminal=false +Type=Application +Icon=trilium +Categories=Office;Utility +StartupWMClass=Trilium +Actions=safe-mode + +[Desktop Action safe-mode] +Name=Run in safe mode +Exec=trilium --safe-mode diff --git a/user/trilium/trilium.sh b/user/trilium/trilium.sh new file mode 100644 index 0000000..7148c21 --- /dev/null +++ b/user/trilium/trilium.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +for i in "$@"; do + case $i in + --disable-tls-certificate-check) + export NODE_TLS_REJECT_UNAUTHORIZED=0 # Allows for certificates which aren't in the system's store + shift # This decreases security and shouldn't be used regularly in untrusted networks. + ;; + --safe-mode) + export TRILIUM_SAFE_MODE=1 # Enables some extra safety measures (i.e. disabling user scripting) to allow Trilium to load + _safemodecmdargs="--disable-gpu" + shift # if something user-defined is causing it to crash + ;; + *) + ;; + esac +done + +export ELECTRON_IS_DEV=0 # Without this env variable Arch's Electron would open devtools by default + +exec electron@electronversion@ /usr/lib/trilium/app.asar $_safemodecmdargs $@ -- 2.45.2 From f49047fe85035e2fd77d83c5e6a213c97195cbd0 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 3 May 2023 01:40:48 -0400 Subject: [PATCH 4/7] trilium: lint --- user/trilium/APKBUILD | 52 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/user/trilium/APKBUILD b/user/trilium/APKBUILD index 1fdd846..f1dfc2b 100644 --- a/user/trilium/APKBUILD +++ b/user/trilium/APKBUILD @@ -1,11 +1,11 @@ # Maintainer: Antoine Martin (ayakael) # Contributor: Antoine Martin (ayakael) -pkgname="trilium" +pkgname=trilium pkgver=0.59.4 pkgrel=0 pkgdesc="A hierarchical note taking application with focus on building large personal knowledge bases." -arch="x86_64'" +arch="x86_64" url="https://github.com/zadam/trilium" license="AGPL-3.0" depends="electron" @@ -26,7 +26,7 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/zadam/trilium/archive/refs/t prepare() { default_prepare - sed -i "s|@electronversion@|$_electron_version|" ../trilium.sh + sed -i "s|@electronversion@||" ../trilium.sh } _trilium_desktop_src_dir=./dist/trilium-linux-x64-src @@ -36,7 +36,7 @@ build() { export npm_config_cache="$srcdir/npm_cache" export ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install --build-from-source - + # Building trilium (desktop) ./bin/copy-trilium.sh $_trilium_desktop_src_dir rm -rf $_trilium_desktop_src_dir/dump-db @@ -45,19 +45,19 @@ build() { npx electron-builder --linux --x64 --dir \ --project=$_trilium_desktop_src_dir \ - -c.electronDist=/usr/lib/electron$_electron_version \ - -c.electronVersion=$(electron$_electron_version --version | tail -c +2) + -c.electronDist=/usr/lib/electron \ + -c.electronVersion="$(electron --version | tail -c +2)" # Building trilium-server grep -v electron package.json > package-server.json mv package-server.json package.json - + ./bin/copy-trilium.sh $_trilium_server_src_dir rm -rf $_trilium_server_src_dir/dump-db - + mkdir $_trilium_server_src_dir/node_modules/better-sqlite3/build/Release cp ./node_modules/better-sqlite3/build/Release/better_sqlite3.node $_trilium_server_src_dir/node_modules/better-sqlite3/build/Release/better_sqlite3.node - + rm -r $_trilium_server_src_dir/webpack* rm -r $_trilium_server_src_dir/electron.js @@ -69,42 +69,42 @@ build() { } package() { - install -vDm644 $_trilium_desktop_src_dir/dist/linux-unpacked/resources/app.asar -t "${pkgdir}/usr/lib/${pkgname}" - install -vDm644 $_trilium_desktop_src_dir/package.json -t "${pkgdir}/usr/lib/${pkgname}" - install -vDm644 bin/tpl/anonymize-database.sql -t "${pkgdir}/usr/lib/${pkgname}" + install -vDm644 $_trilium_desktop_src_dir/dist/linux-unpacked/resources/app.asar -t "$pkgdir/usr/lib/$pkgname" + install -vDm644 $_trilium_desktop_src_dir/package.json -t "$pkgdir/usr/lib/$pkgname" + install -vDm644 bin/tpl/anonymize-database.sql -t "$pkgdir/usr/lib/$pkgname" for i in 16 32 64 128 256 512; do - install -vDm644 images/app-icons/png/${i}x${i}.png "${pkgdir}/usr/share/icons/hicolor/${i}x${i}/apps/${pkgname}.png" + install -vDm644 images/app-icons/png/${i}x$i.png "$pkgdir/usr/share/icons/hicolor/${i}x$i/apps/$pkgname.png" done - install -vDm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/trilium" - install -vDm644 "${srcdir}"/${pkgname}.desktop -t "${pkgdir}"/usr/share/applications + install -vDm755 "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/trilium" + install -vDm644 "$srcdir"/$pkgname.desktop -t "$pkgdir"/usr/share/applications } server() { pkgdesc="A hierarchical note taking application with focus on building large personal knowledge bases - Server version" depends="nodejs" - install -vd "${pkgdir}/usr/share/webapps/${pkgname}" - cp -vr $_trilium_server_src_dir/. -t "${pkgdir}/usr/share/webapps/${pkgname}" - chmod -v 755 "${pkgdir}/usr/share/webapps/${pkgname}/src/www" - install -vDm644 $_trilium_server_src_dir/package.json -t "${pkgdir}/usr/share/webapps/${pkgname}" - install -vDm644 bin/tpl/anonymize-database.sql -t "${pkgdir}/usr/share/webapps/${pkgname}" + install -vd "$pkgdir/usr/share/webapps/$pkgname" + cp -vr $_trilium_server_src_dir/. -t "$pkgdir/usr/share/webapps/$pkgname" + chmod -v 755 "$pkgdir/usr/share/webapps/$pkgname/src/www" + install -vDm644 $_trilium_server_src_dir/package.json -t "$pkgdir/usr/share/webapps/$pkgname" + install -vDm644 bin/tpl/anonymize-database.sql -t "$pkgdir/usr/share/webapps/$pkgname" - install -vDm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/trilium-server" + install -vDm755 "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/trilium-server" # TODO: setup openrc - # install -vDm644 "${srcdir}"/${pkgname}.service -t "${pkgdir}/usr/lib/systemd/system" + # install -vDm644 "$srcdir"/$pkgname.service -t "$pkgdir/usr/lib/systemd/system" } dumpdb() { pkgdesc="An emergency tool to extract notes from the database where they're stored to plain files on the filesystem" depends="nodejs" - install -vd "${pkgdir}/usr/lib/${pkgname}" - cp -vr dump-db/. -t "${pkgdir}/usr/lib/${pkgname}" - chmod -v 755 "${pkgdir}/usr/lib/${pkgname}/dump-db.js" + install -vd "$pkgdir/usr/lib/$pkgname" + cp -vr dump-db/. -t "$pkgdir/usr/lib/$pkgname" + chmod -v 755 "$pkgdir/usr/lib/$pkgname/dump-db.js" - install -vDm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/trilium-dumpdb" + install -vDm755 "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/trilium-dumpdb" } sha512sums=" 96a4788574f66a830515eb8fe11bdc87e1083f04c3f409d095cdde2515c008c2ba32a0554d7e5cda4602c2b20861e5b442e022f3c1be4fd3397c0f9e4d24eae2 trilium-0.59.4.tar.gz -- 2.45.2 From 9b5cf81d6e62d9ecf1691acfc3a8e0bd09230904 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 3 May 2023 01:42:22 -0400 Subject: [PATCH 5/7] trilium: python --- user/trilium/APKBUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/user/trilium/APKBUILD b/user/trilium/APKBUILD index f1dfc2b..61e918d 100644 --- a/user/trilium/APKBUILD +++ b/user/trilium/APKBUILD @@ -12,6 +12,7 @@ depends="electron" makedepends=" npm nodejs + python3 " subpackages="$pkgname-server $pkgname-dumpdb" source="$pkgname-$pkgver.tar.gz::https://github.com/zadam/trilium/archive/refs/tags/v$pkgver.tar.gz -- 2.45.2 From 07d8d796fe561bdea42ffe97f3259339b74261e2 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 3 May 2023 01:45:21 -0400 Subject: [PATCH 6/7] trilium: just client --- user/trilium/APKBUILD | 39 +--------------------------------- user/trilium/trilium-server.sh | 3 --- 2 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 user/trilium/trilium-server.sh diff --git a/user/trilium/APKBUILD b/user/trilium/APKBUILD index 61e918d..ebfe242 100644 --- a/user/trilium/APKBUILD +++ b/user/trilium/APKBUILD @@ -14,12 +14,11 @@ makedepends=" nodejs python3 " -subpackages="$pkgname-server $pkgname-dumpdb" +subpackages="$pkgname-dumpdb" source="$pkgname-$pkgver.tar.gz::https://github.com/zadam/trilium/archive/refs/tags/v$pkgver.tar.gz copy-trilium.sh.patch config-sample.ini.patch trilium.sh - trilium-server.sh trilium-dumpdb.sh trilium.desktop " @@ -31,7 +30,6 @@ prepare() { } _trilium_desktop_src_dir=./dist/trilium-linux-x64-src -_trilium_server_src_dir=./dist/trilium-linux-server-x64-src build() { export npm_config_cache="$srcdir/npm_cache" @@ -48,25 +46,6 @@ build() { --project=$_trilium_desktop_src_dir \ -c.electronDist=/usr/lib/electron \ -c.electronVersion="$(electron --version | tail -c +2)" - - # Building trilium-server - grep -v electron package.json > package-server.json - mv package-server.json package.json - - ./bin/copy-trilium.sh $_trilium_server_src_dir - rm -rf $_trilium_server_src_dir/dump-db - - mkdir $_trilium_server_src_dir/node_modules/better-sqlite3/build/Release - cp ./node_modules/better-sqlite3/build/Release/better_sqlite3.node $_trilium_server_src_dir/node_modules/better-sqlite3/build/Release/better_sqlite3.node - - rm -r $_trilium_server_src_dir/webpack* - rm -r $_trilium_server_src_dir/electron.js - - # Building trilium-dumpdb - cd dump-db - - npm install - cp -f ../node_modules/better-sqlite3/build/Release/better_sqlite3.node node_modules/better-sqlite3/build/Release/better_sqlite3.node } package() { @@ -82,21 +61,6 @@ package() { install -vDm644 "$srcdir"/$pkgname.desktop -t "$pkgdir"/usr/share/applications } -server() { - pkgdesc="A hierarchical note taking application with focus on building large personal knowledge bases - Server version" - depends="nodejs" - - install -vd "$pkgdir/usr/share/webapps/$pkgname" - cp -vr $_trilium_server_src_dir/. -t "$pkgdir/usr/share/webapps/$pkgname" - chmod -v 755 "$pkgdir/usr/share/webapps/$pkgname/src/www" - install -vDm644 $_trilium_server_src_dir/package.json -t "$pkgdir/usr/share/webapps/$pkgname" - install -vDm644 bin/tpl/anonymize-database.sql -t "$pkgdir/usr/share/webapps/$pkgname" - - install -vDm755 "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/trilium-server" - # TODO: setup openrc - # install -vDm644 "$srcdir"/$pkgname.service -t "$pkgdir/usr/lib/systemd/system" -} - dumpdb() { pkgdesc="An emergency tool to extract notes from the database where they're stored to plain files on the filesystem" depends="nodejs" @@ -112,7 +76,6 @@ sha512sums=" 90ed115b3c7664d958f8426ac55253d46e770ebbfc4b7443581943df7e85211d709948e7ca41d698b28d4510c3e4c50244726ce49d44e1fa530fbf8129e42c5a copy-trilium.sh.patch 48fcb6931b632280a16b14744ee64804de1b399b0682076fdf1fa5669f691a53371532363020d8c7fb3704ea7bd633903cab1b92018f88a7170e6c2e213cd149 config-sample.ini.patch 6b03a7cce3836966d00e282d012cce944b8b56e29200fa06e64563a95e4edde591c0018715639a5e2acdbfd11a73ccb8283fbad19efc7dff218e8398c7e12d30 trilium.sh -14a97f1fab392dd9a55440712bf3f2976de20e9c09789392984313455af77d9900445bd06cf2c3a3879a94cab893e83bd4093060f9214b2c201af89d7f62f663 trilium-server.sh e1fa62cdc2ecde41f5c5336bca3dd2d2b9e65de1a3162ef4ed336aaa7660c2b1c23793df7cdbd09e8b020890de0ba2d58c8704d2d1f0916da1212167c4820c0f trilium-dumpdb.sh d0c051a0412f17f0373ead660ae6ddfefe5e8f8e2104a0ffc52d9af94c57c1274a2dc8d2317516dafa0fa85263250633acb56556318f21a663105dd7fce9b36f trilium.desktop " diff --git a/user/trilium/trilium-server.sh b/user/trilium/trilium-server.sh deleted file mode 100644 index 983724d..0000000 --- a/user/trilium/trilium-server.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec node /usr/share/webapps/trilium-server/src/www $@ -- 2.45.2 From 3b27a762af11d067444341c2000d3237dc20f96b Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 3 May 2023 14:47:18 -0400 Subject: [PATCH 7/7] Create npm prefix --- user/trilium/APKBUILD | 2 ++ 1 file changed, 2 insertions(+) diff --git a/user/trilium/APKBUILD b/user/trilium/APKBUILD index ebfe242..22f1582 100644 --- a/user/trilium/APKBUILD +++ b/user/trilium/APKBUILD @@ -27,12 +27,14 @@ prepare() { default_prepare sed -i "s|@electronversion@||" ../trilium.sh + mkdir -p "$srcdir/node_modules/lib" } _trilium_desktop_src_dir=./dist/trilium-linux-x64-src build() { export npm_config_cache="$srcdir/npm_cache" + export npm_config_prefix="$srcdir/node_modules" export ELECTRON_SKIP_BINARY_DOWNLOAD=1 npm install --build-from-source -- 2.45.2