jjr-joplin/PKGBUILD

113 lines
3.8 KiB
Bash
Raw Normal View History

# 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:
# https://github.com/alfredopalhares/arch-pkgbuilds
2018-04-18 18:26:44 +02:00
pkgbase="joplin"
pkgname=('joplin' 'joplin-desktop-electron')
pkgver=1.4.19
2020-03-23 12:18:53 +01:00
pkgrel=1
pkgdesc="A note taking and to-do application with synchronization capabilities - Split Package"
arch=('x86_64' 'i686')
conflicts=('joplin-cli' 'joplin-desktop')
makedepends=('git' 'npm' 'python' 'rsync')
2020-01-05 14:55:22 +01:00
url="https://joplinapp.org/"
license=('MIT')
source=("joplin.desktop" "joplin-desktop.sh" "joplin.sh"
"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() {
cd "${srcdir}/joplin-${pkgver}"
msg "Disabling husky (git hooks)"
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
msg2 "Installing dependencies..."
npm install
npm install compare-version # Joplin Cli needs this
./node_modules/.bin/lerna bootstrap
2018-04-18 18:26:44 +02:00
}
2018-04-18 18:26:44 +02:00
#TODO: A slimdown is needed
package_joplin() {
pkgdesc="A note taking and to-do application with synchronization capabilities - CLI App"
depends=('nodejs' 'rsync')
2019-10-29 15:45:05 +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
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
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
#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
done
msg2 "Installing LICENSE..."
cd "${srcdir}/joplin-${pkgver}/"
install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
2018-04-18 18:26:44 +02:00
msg2 "Installing Startup Script"
cd "${srcdir}"
install -Dm755 joplin.sh "${pkgdir}/usr/bin/joplin-cli"
}
#TODO: Check for slimdown
package_joplin-desktop-electron() {
pkgdesc="A note taking and to-do application with synchronization capabilities - Desktop"
depends=('gtk3' 'libexif' 'libgsf' 'libjpeg-turbo' 'libwebp' 'libxss' 'nodejs'
'nss' 'orc')
optdepends=('libappindicator-gtk3: for tray icon')
msg2 "Building Desktop..."
mkdir -p "${pkgdir}/usr/share/joplin-desktop"
cd "${srcdir}/joplin-${pkgver}/packages/app-desktop"
USE_HARD_LINKS=false npm run dist -- --publish=never
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
}