From b7839cf9c999f00e6088aa4a491fcfb7e401fd77 Mon Sep 17 00:00:00 2001 From: fosslinux Date: Fri, 2 Oct 2020 18:44:06 +1000 Subject: [PATCH 1/2] New package: joplin-desktop-2.1.7. --- srcpkgs/joplin-desktop/files/joplin-desktop | 2 + srcpkgs/joplin-desktop/files/joplin.desktop | 8 +++ .../joplin-desktop/patches/electron-ver.patch | 11 ++++ srcpkgs/joplin-desktop/template | 55 +++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100755 srcpkgs/joplin-desktop/files/joplin-desktop create mode 100644 srcpkgs/joplin-desktop/files/joplin.desktop create mode 100644 srcpkgs/joplin-desktop/patches/electron-ver.patch create mode 100644 srcpkgs/joplin-desktop/template diff --git a/srcpkgs/joplin-desktop/files/joplin-desktop b/srcpkgs/joplin-desktop/files/joplin-desktop new file mode 100755 index 000000000000..ea7f12ba1b04 --- /dev/null +++ b/srcpkgs/joplin-desktop/files/joplin-desktop @@ -0,0 +1,2 @@ +#!/bin/sh +exec electron10 /usr/libexec/joplin-desktop/resources/app.asar "$@" diff --git a/srcpkgs/joplin-desktop/files/joplin.desktop b/srcpkgs/joplin-desktop/files/joplin.desktop new file mode 100644 index 000000000000..37852543a51a --- /dev/null +++ b/srcpkgs/joplin-desktop/files/joplin.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=Joplin +Comment=Joplin - a note taking and to-do application with synchronization capabilities for Windows, macOS, Linux, Android and iOS. +Exec=/usr/bin/joplin-desktop +Icon=/usr/libexec/joplin/resources/build/icons/128x128.png +Terminal=false +Type=Application +Categories=Application;Office; diff --git a/srcpkgs/joplin-desktop/patches/electron-ver.patch b/srcpkgs/joplin-desktop/patches/electron-ver.patch new file mode 100644 index 000000000000..de21dd83ab22 --- /dev/null +++ b/srcpkgs/joplin-desktop/patches/electron-ver.patch @@ -0,0 +1,11 @@ +--- a/packages/app-desktop/package.json 2021-01-03 20:03:05.818525142 +1100 ++++ b/packages/app-desktop/package.json 2021-01-03 20:04:24.352069708 +1100 +@@ -36,6 +36,8 @@ + "afterAllArtifactBuild": "./generateSha512.js", + "asar": true, + "asarUnpack": "./node_modules/node-notifier/vendor/**", ++ "electronDist": "/usr/lib/electron10", ++ "electronVersion": "@ELECTRON_VER@", + "win": { + "rfc3161TimeStampServer": "http://timestamp.comodoca.com/rfc3161", + "icon": "../../Assets/ImageSources/Joplin.ico", diff --git a/srcpkgs/joplin-desktop/template b/srcpkgs/joplin-desktop/template new file mode 100644 index 000000000000..834e02ef092b --- /dev/null +++ b/srcpkgs/joplin-desktop/template @@ -0,0 +1,55 @@ +# Template file for 'joplin-desktop' +pkgname=joplin-desktop +version=2.1.7 +revision=1 +wrksrc="joplin-${version}" +hostmakedepends="nodejs python3 pkg-config rsync git p7zip tar app-builder + squashfs-tools" +makedepends="libvips-devel libsecret-devel electron10" +depends="electron10" +short_desc="Open source note taking and to-do application - Desktop version" +maintainer="fosslinux " +license="MIT" +homepage="https://joplinapp.org" +distfiles="https://github.com/laurent22/joplin/archive/v${version}.tar.gz" +checksum=b8d4fedb636d41d93718e51fcd99a5d889471db3f86002d9f3c1d90fc386f68c +no_generic_pkgconfig_link=yes +nopie_files="/usr/libexec/joplin-desktop/@joplinapp-desktop + /usr/libexec/joplin-desktop/chrome-sandbox" + +export USE_SYSTEM_7ZA="true" +export USE_SYSTEM_APP_BUILDER="true" +export USE_SYSTEM_MKSQUASHFS="true" + +if [ "$CROSS_BUILD" ]; then + export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE" + export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_LIBDIR:$XBPS_CROSS_BASE/usr/share/pkgconfig" +fi + +do_configure() { + # Remove unused modules + rm -rf packages/{app-mobile,app-cli,generator-joplin,app-clipper} + # Set electron version + sed -i "s/@ELECTRON_VER@/$(cat /usr/lib/electron10/version)/" packages/app-desktop/package.json +} + +do_build() { + npm install ${XBPS_ALLOW_CHROOT_BREAKOUT:+--unsafe-perm} \ + --build-from-source + cd packages/app-desktop + npm run dist +} + +do_check() { + npm run test +} + +do_install() { + vmkdir usr/libexec/joplin-desktop + rm -rf packages/app-desktop/dist/linux-*unpacked/resources/app.asar.unpacked/node_modules/7zip-bin-linux + vcopy packages/app-desktop/dist/linux-*unpacked/* usr/libexec/joplin-desktop/ + vinstall "${FILESDIR}/joplin.desktop" 644 usr/share/applications/ joplin.desktop + vbin "${FILESDIR}/joplin-desktop" + vlicense LICENSE +} From 1afc6907bf1ac1e29eb0a465c1951ef3ea99880f Mon Sep 17 00:00:00 2001 From: fosslinux Date: Sat, 5 Dec 2020 13:19:21 +1100 Subject: [PATCH 2/2] New package: joplin-cli-2.1.7. --- srcpkgs/joplin-cli/files/joplin-cli | 3 ++ srcpkgs/joplin-cli/template | 69 +++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 srcpkgs/joplin-cli/files/joplin-cli create mode 100644 srcpkgs/joplin-cli/template diff --git a/srcpkgs/joplin-cli/files/joplin-cli b/srcpkgs/joplin-cli/files/joplin-cli new file mode 100644 index 000000000000..e65e75598db5 --- /dev/null +++ b/srcpkgs/joplin-cli/files/joplin-cli @@ -0,0 +1,3 @@ +#!/bin/sh +cd /usr/libexec/joplin-cli/app-cli +node app/main.js "$@" diff --git a/srcpkgs/joplin-cli/template b/srcpkgs/joplin-cli/template new file mode 100644 index 000000000000..16a61924f3f9 --- /dev/null +++ b/srcpkgs/joplin-cli/template @@ -0,0 +1,69 @@ +# Template file for 'joplin-cli' +pkgname=joplin-cli +version=2.1.7 +revision=1 +wrksrc="joplin-${version}" +hostmakedepends="nodejs git python3 pkg-config libvips-devel rsync" +makedepends="libvips-devel libsecret-devel" +depends="nodejs" +short_desc="Open source note taking and to-do application - CLI version" +maintainer="fosslinux " +license="MIT" +homepage="https://joplinapp.org" +distfiles="https://github.com/laurent22/joplin/archive/v${version}.tar.gz" +checksum=b8d4fedb636d41d93718e51fcd99a5d889471db3f86002d9f3c1d90fc386f68c +python_version=3 +#nocross="somehow -m64 appears in CFLAGS out of nowhere" + +# A first step to cross working... +if [ "$CROSS_BUILD" ]; then + export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE" + export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_LIBDIR:$XBPS_CROSS_BASE/usr/share/pkgconfig" +fi + +do_build() { + # Remove unused modules + rm -rf packages/{app-mobile,app-desktop,app-clipper,generator-joplin} + + platform="linux" + if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + platform="linuxmusl" + fi + arch="" + case "$XBPS_TARGET_MACHINE" in + x86_64*) arch=x64 ;; + i686*) arch=ia32 ;; + *) # Dummy of arm; allows to be compiled from source + if [ "$XBPS_TARGET_WORDSIZE" = "64" ]; then + arch=arm64 + else + arch=arm + fi ;; + esac + npm install ${XBPS_ALLOW_CHROOT_BREAKOUT:+--unsafe-perm} --build-from-source \ + --platform="${platform}" --arch="${arch}" + + cd packages + # https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=joplin-cli#n30 + # Unsure why this is needed, but it is + for d in app-cli lib renderer tools; do + pushd "${d}" + mv node_modules/@joplin . + npm prune --production + mv @joplin node_modules/ + popd + done +} + +do_install() { + cd packages + + vmkdir usr/libexec/joplin-cli + for d in app-cli fork-sax fork-htmlparser2 renderer lib tools; do + vcopy "${d}" usr/libexec/joplin-cli/ + done + + vbin "${FILESDIR}/joplin-cli" + vlicense ../LICENSE +}