2020-01-27 18:51:36 +01:00
|
|
|
# Maintainer: Alfredo Palhares <alfredo at palhares dot me>
|
|
|
|
# Contributor: Mark Wagie <mark dot wagie at tutanota dot com>
|
2018-04-18 18:26:44 +02:00
|
|
|
|
|
|
|
# Please contribute to:
|
2020-07-13 15:53:00 +02:00
|
|
|
# https://github.com/alfredopalhares/arch-pkgbuilds
|
2018-04-18 18:26:44 +02:00
|
|
|
|
2020-12-08 01:58:34 +01:00
|
|
|
pkgbase="joplin"
|
2020-12-08 17:40:12 +01:00
|
|
|
pkgname=('joplin-cmd' 'joplin-desktop-electron')
|
2020-12-08 01:58:34 +01:00
|
|
|
pkgver=1.4.19
|
2020-12-08 13:17:44 +01:00
|
|
|
pkgrel=2
|
2020-12-08 01:58:34 +01:00
|
|
|
pkgdesc="A note taking and to-do application with synchronization capabilities - Split Package"
|
2020-01-27 18:51:36 +01:00
|
|
|
arch=('x86_64' 'i686')
|
2020-12-08 02:07:38 +01:00
|
|
|
conflicts=('joplin-cli' 'joplin-desktop')
|
2020-12-08 17:40:12 +01:00
|
|
|
makedepends=('git' 'npm' 'python' 'rsync' 'electron')
|
2020-01-05 14:55:22 +01:00
|
|
|
url="https://joplinapp.org/"
|
2020-01-27 18:51:36 +01:00
|
|
|
license=('MIT')
|
2020-12-08 02:03:41 +01:00
|
|
|
source=("joplin.desktop" "joplin-desktop.sh" "joplin.sh"
|
2020-12-08 01:58:34 +01:00
|
|
|
"joplin-${pkgver}.tar.gz::https://github.com/laurent22/joplin/archive/v${pkgver}.tar.gz")
|
|
|
|
sha256sums=('c7c5d8b0ff9edb810ed901ea21352c9830bfa286f3c18b1292deca5b2f8febd2'
|
|
|
|
'a450284fe66d89aa463d129ce8fff3a0a1a783a64209e4227ee47449d5737be8'
|
|
|
|
'5b6f8847ec0c3848375755213c3009c273f478b4b80ed2c5f0af8f67ee0e94fb'
|
|
|
|
'55aad4fe50e2da980983a69bc7c0870626064db971550d522e266feb17d38916')
|
|
|
|
|
2019-05-13 12:32:49 +02:00
|
|
|
|
2018-04-18 18:26:44 +02:00
|
|
|
build() {
|
2020-12-08 01:58:34 +01:00
|
|
|
cd "${srcdir}/joplin-${pkgver}"
|
2020-12-08 17:40:12 +01:00
|
|
|
msg2 "Disabling husky (git hooks)"
|
2019-08-30 01:14:52 +02:00
|
|
|
sed -i '/"husky": ".*"/d' package.json
|
2020-01-07 17:23:47 +01:00
|
|
|
|
|
|
|
# Force Lang
|
|
|
|
# INFO: https://github.com/alfredopalhares/joplin-pkgbuild/issues/25
|
|
|
|
export LANG=en_US.utf8
|
|
|
|
|
2020-12-08 01:58:34 +01:00
|
|
|
msg2 "Installing dependencies..."
|
|
|
|
npm install
|
|
|
|
npm install compare-version # Joplin Cli needs this
|
|
|
|
./node_modules/.bin/lerna bootstrap
|
2020-12-08 17:40:12 +01:00
|
|
|
}
|
2018-04-18 18:26:44 +02:00
|
|
|
|
2020-12-08 17:40:12 +01:00
|
|
|
check() {
|
|
|
|
cd "${srcdir}/joplin-${pkgver}"
|
|
|
|
msg2 "Running Lerna Test Suite"
|
|
|
|
npm run test
|
2020-12-08 01:58:34 +01:00
|
|
|
}
|
2018-04-18 18:26:44 +02:00
|
|
|
|
2020-12-08 01:58:34 +01:00
|
|
|
#TODO: A slimdown is needed
|
2020-12-08 17:40:12 +01:00
|
|
|
package_joplin-cmd() {
|
2020-12-08 01:58:34 +01:00
|
|
|
pkgdesc="A note taking and to-do application with synchronization capabilities - CLI App"
|
|
|
|
depends=('nodejs' 'rsync')
|
2019-10-29 15:45:05 +01:00
|
|
|
|
2020-12-08 01:58:34 +01:00
|
|
|
msg2 "Building CLI..."
|
|
|
|
mkdir -p "${pkgdir}/usr/share/joplin-cli/app-cli"
|
|
|
|
cd "${srcdir}/joplin-${pkgver}/packages/app-cli"
|
|
|
|
npm run build
|
|
|
|
cd build
|
|
|
|
cp -R "." "${pkgdir}/usr/share/joplin-cli/app-cli/"
|
2018-04-18 18:26:44 +02:00
|
|
|
|
2020-12-08 01:58:34 +01:00
|
|
|
msg2 "Copying Base Node Modules packages..."
|
|
|
|
cd "${srcdir}/joplin-${pkgver}/packages/app-cli"
|
|
|
|
cp -R "node_modules/" \
|
|
|
|
"${pkgdir}/usr/share/joplin-cli/app-cli"
|
2018-04-18 18:26:44 +02:00
|
|
|
|
2020-12-08 01:58:34 +01:00
|
|
|
msg2 "Copy CLI Joplin Dependencies..."
|
|
|
|
cd "${srcdir}/joplin-${pkgver}/packages/"
|
|
|
|
cp -R "fork-htmlparser2" "${pkgdir}/usr/share/joplin-cli/"
|
|
|
|
cp -R "fork-sax" "${pkgdir}/usr/share/joplin-cli/"
|
|
|
|
cp -R "lib/" "${pkgdir}/usr/share/joplin-cli/"
|
|
|
|
cp -R "renderer/" "${pkgdir}/usr/share/joplin-cli/"
|
|
|
|
cp -R "tools/" "${pkgdir}/usr/share/joplin-cli/"
|
2018-04-18 18:26:44 +02:00
|
|
|
|
2020-12-08 01:58:34 +01:00
|
|
|
#TODO: Check if existing symblinks are valid
|
|
|
|
msg2 "Fixing @Joplin Symlinks..."
|
|
|
|
cd "${pkgdir}/usr/share/joplin-cli/"
|
|
|
|
for dir in $(find . -type d -name "@joplin"); do
|
|
|
|
cd "${pkgdir}/usr/share/joplin-cli/${dir}"
|
|
|
|
rm -r *
|
|
|
|
ln -s "../../../fork-htmlparser2" "fork-htmlparser2"
|
|
|
|
ln -s "../../../fork-sax" "fork-sax"
|
|
|
|
ln -s "../../../lib" "lib"
|
|
|
|
ln -s "../../../renderer" "renderer"
|
|
|
|
ln -s "../../../tools" "tools"
|
2018-04-18 18:26:44 +02:00
|
|
|
|
2020-12-08 01:58:34 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
msg2 "Installing LICENSE..."
|
|
|
|
cd "${srcdir}/joplin-${pkgver}/"
|
2020-01-27 18:51:36 +01:00
|
|
|
install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
|
2018-04-18 18:26:44 +02:00
|
|
|
|
2020-12-08 01:58:34 +01:00
|
|
|
msg2 "Installing Startup Script"
|
|
|
|
cd "${srcdir}"
|
2020-12-08 02:03:41 +01:00
|
|
|
install -Dm755 joplin.sh "${pkgdir}/usr/bin/joplin-cli"
|
2020-12-08 01:58:34 +01:00
|
|
|
}
|
|
|
|
|
2020-12-08 02:07:38 +01:00
|
|
|
package_joplin-desktop-electron() {
|
2020-12-08 01:58:34 +01:00
|
|
|
pkgdesc="A note taking and to-do application with synchronization capabilities - Desktop"
|
2020-12-08 13:17:44 +01:00
|
|
|
depends=('electron' 'gtk3' 'libexif' 'libgsf' 'libjpeg-turbo' 'libwebp' 'libxss' 'nodejs'
|
2020-12-08 01:58:34 +01:00
|
|
|
'nss' 'orc')
|
|
|
|
optdepends=('libappindicator-gtk3: for tray icon')
|
|
|
|
|
2020-12-08 13:17:44 +01:00
|
|
|
msg2 "Building Desktop with packaged Electron..."
|
2020-12-08 01:58:34 +01:00
|
|
|
mkdir -p "${pkgdir}/usr/share/joplin-desktop"
|
|
|
|
cd "${srcdir}/joplin-${pkgver}/packages/app-desktop"
|
2020-12-08 13:17:44 +01:00
|
|
|
electron_dir="/usr/lib/electron"
|
|
|
|
electron_version=$(cat /usr/lib/electron/version)
|
|
|
|
|
2020-12-08 17:40:12 +01:00
|
|
|
USE_HARD_LINKS=false npm run dist -- --publish=never --linux --x64 \
|
|
|
|
--dir="dist/" -c.electronDist=$electron_dir -c.electronVersion=$electron_version
|
2020-12-08 13:17:44 +01:00
|
|
|
|
2020-12-08 01:58:34 +01:00
|
|
|
cd dist/linux-unpacked/
|
|
|
|
cp -R "." "${pkgdir}/usr/share/joplin-desktop"
|
|
|
|
|
|
|
|
msg2 "Installing LICENSE..."
|
|
|
|
cd "${srcdir}/joplin-${pkgver}/"
|
|
|
|
install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
|
|
|
|
|
|
|
|
msg2 "Installing startup script and desktop file..."
|
|
|
|
cd "${srcdir}"
|
|
|
|
install -Dm755 ${srcdir}/joplin-desktop.sh "${pkgdir}/usr/bin/joplin-desktop"
|
|
|
|
install -Dm644 ${srcdir}/joplin.desktop -t "${pkgdir}/usr/share/applications"
|
2018-04-18 18:26:44 +02:00
|
|
|
}
|
2020-12-08 17:40:12 +01:00
|
|
|
|