summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaime Martínez Rincón2021-07-04 23:15:36 +0200
committerJaime Martínez Rincón2021-07-04 23:15:36 +0200
commitbde5531987f244b82647cfe191377b90bdb1398e (patch)
tree647cba0c1f9825bb5d43de88be49a064f75aa681
parentc22af8254314142efcd79e83696b48792985ae2a (diff)
downloadaur-bde5531987f244b82647cfe191377b90bdb1398e.tar.gz
Switch to notion-repackaged
-rw-r--r--.SRCINFO36
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD110
-rw-r--r--notion-app.desktop12
-rw-r--r--notion-app.install13
5 files changed, 80 insertions, 95 deletions
diff --git a/.SRCINFO b/.SRCINFO
index e1a58a6f91c1..006f9dde7dfb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,26 +1,30 @@
pkgbase = notion-app
pkgdesc = The all-in-one workspace for your notes and tasks
pkgver = 2.0.16
- pkgrel = 12
- epoch = 2
- url = https://www.notion.so/desktop
+ pkgrel = 13
+ url = https://github.com/notion-enhancer/notion-repackaged
+ install = notion-app.install
arch = i686
arch = x86_64
license = MIT
- makedepends = imagemagick
- makedepends = p7zip
- makedepends = npm
- makedepends = nvm
- makedepends = python2
- makedepends = git
- makedepends = jq
- depends = re2
+ depends = c-ares
+ depends = ffmpeg
depends = gtk3
- depends = xdg-utils
- source = Notion-2.0.16.exe::https://desktop-release.notion-static.com/Notion%20Setup%202.0.16.exe
- source = notion-app.desktop
- md5sums = 9f72284086cda3977f7f569dff3974d5
- md5sums = 257f3106e5d9364ef2df557a656cd8e7
+ depends = http-parser
+ depends = libevent
+ depends = libvpx
+ depends = libxslt
+ depends = libxss
+ depends = minizip
+ depends = nss
+ depends = re2
+ depends = snappy
+ depends = libnotify
+ depends = libappindicator-gtk3
+ provides = notion-app
+ conflicts = notion-app
+ source = https://github.com/notion-enhancer/notion-repackaged/releases/download/v2.0.16-1/notion-app-2.0.16-1.pacman
+ md5sums = 425831ab1296ff7e47f66d2cf3e1dd48
pkgname = notion-app
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..7d7a13d9faee
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+pkg
+src
+notion-app*.pkg.tar.zst
+notion-app*.pacman
diff --git a/PKGBUILD b/PKGBUILD
index d4bdfd439bc5..2a96b3121ee9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,81 +1,57 @@
# Maintainer: Jaime Martínez Rincón <jaime@jamezrin.name>
pkgname=notion-app
-pkgver=2.0.16
-pkgrel=12
-epoch=2
+pkgver="2.0.16"
+pkgrel=13
pkgdesc="The all-in-one workspace for your notes and tasks"
arch=('i686' 'x86_64')
-url="https://www.notion.so/desktop"
+url="https://github.com/notion-enhancer/notion-repackaged"
license=('MIT')
-depends=('re2' 'gtk3' 'xdg-utils')
-makedepends=('imagemagick' 'p7zip' 'npm' 'nvm' 'python2' 'git' 'jq')
-source=("Notion-"${pkgver}".exe::https://desktop-release.notion-static.com/Notion%20Setup%20${pkgver}.exe"
- 'notion-app.desktop')
-md5sums=('9f72284086cda3977f7f569dff3974d5'
- '257f3106e5d9364ef2df557a656cd8e7')
-print_info() {
- echo -e "\033[1;33m==> $@\033[0m"
-}
-
-_ensure_local_nvm() {
- which nvm >/dev/null 2>&1 && nvm deactivate && nvm unload
- export NVM_DIR="${srcdir}/.nvm"
- source /usr/share/nvm/init-nvm.sh || [[ $? != 1 ]]
-}
-
-prepare() {
- _ensure_local_nvm
- nvm install 14.16.1
-}
-
-build() {
- _ensure_local_nvm
-
- print_info "Extracting app from Windows build..."
- 7z x -y "${srcdir}/Notion-"${pkgver}".exe" -o"${srcdir}/extracted-exe" >/dev/null
- 7z x -y "${srcdir}/extracted-exe/\$PLUGINSDIR/app-64.7z" -o"${srcdir}/extracted-app" >/dev/null
-
- rm -rf "${srcdir}/package-rebuild"
- mkdir -p "${srcdir}/package-rebuild"
-
- print_info "Copying original app resources..."
- cp -r "${srcdir}/extracted-app/resources/app/"* "${srcdir}/package-rebuild"
+depends=(
+ 'c-ares'
+ 'ffmpeg'
+ 'gtk3'
+ 'http-parser'
+ 'libevent'
+ 'libvpx'
+ 'libxslt'
+ 'libxss'
+ 'minizip'
+ 'nss'
+ 're2'
+ 'snappy'
+ 'libnotify'
+ 'libappindicator-gtk3'
+)
+makedepends=()
+provides=('notion-app')
+conflicts=('notion-app')
+
+notion_repackaged_ver="2.0.16-1"
+source=("https://github.com/notion-enhancer/notion-repackaged/releases/download/v${notion_repackaged_ver}/notion-app-${notion_repackaged_ver}.pacman")
+md5sums=('425831ab1296ff7e47f66d2cf3e1dd48')
+
+install=${pkgname}.install
- cd "${srcdir}/package-rebuild"
-
- print_info "Patching original sources for fixes..."
- sed -i 's|process.platform === "win32"|process.platform !== "darwin"|g' main/main.js
-
- print_info "Recreating package node_modules..."
- rm -r node_modules
- PATCHED_PACKAGE_JSON=$(jq '.dependencies.cld="2.7.0"' package.json)
- echo "${PATCHED_PACKAGE_JSON}" > package.json
-
- npm install --cache "${srcdir}/npm-cache"
- node_modules/.bin/patch-package
+package() {
+ product_name="Notion"
+ package_name="notion-app"
- print_info "Converting app icon..."
- convert "icon.ico[0]" "icon.png" >/dev/null
+ install -d "${pkgdir}/usr/bin"
+ install -d "${pkgdir}/opt/${product_name}"
- print_info "Building electron package..."
- npm install electron@11 electron-builder --save-dev --cache "${srcdir}/npm-cache"
- node_modules/.bin/electron-builder --linux dir
+ cp -r "${srcdir}/opt/${product_name}" "${pkgdir}/opt/"
- cd "${srcdir}"
-}
+ icons_dir_path="usr/share/icons/hicolor"
+ desktop_file_path="usr/share/applications/${package_name}.desktop"
-package() {
- install -d "${pkgdir}/usr/bin"
- install -d "${pkgdir}/opt/${pkgname}"
- install -d "${pkgdir}/usr/share/pixmaps"
- install -d "${pkgdir}/usr/share/applications"
+ for icon_size_name in $(ls ${srcdir}/${icons_dir_path}); do
+ icon_size_path="${icons_dir_path}/${icon_size_name}/apps"
+ install -d "${pkgdir}/${icon_size_path}"
+ install -m644 "${srcdir}/${icon_size_path}/${package_name}.png" \
+ "${pkgdir}/${icon_size_path}/${package_name}.png"
+ done
- cp -r "${srcdir}/package-rebuild/dist/linux-unpacked/"* "${pkgdir}/opt/${pkgname}"
- cp "${srcdir}/package-rebuild/icon.png" "${pkgdir}/opt/${pkgname}/icon.png"
- install -Dm644 "${srcdir}/package-rebuild/icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
- install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications"
- ln -s "/opt/${pkgname}/notion" "${pkgdir}/usr/bin/${pkgname}"
+ install -Dm644 "${srcdir}/${desktop_file_path}" "${pkgdir}/${desktop_file_path}"
}
-
diff --git a/notion-app.desktop b/notion-app.desktop
deleted file mode 100644
index 914ac254a9be..000000000000
--- a/notion-app.desktop
+++ /dev/null
@@ -1,12 +0,0 @@
-[Desktop Entry]
-Exec=/opt/notion-app/notion %u
-Icon=notion-app
-Terminal=false
-Type=Application
-Name=Notion
-Comment=The all-in-one workspace for your notes and tasks
-Categories=Office;Utility;
-StartupNotify=true
-StartupWMClass=Notion
-MimeType=x-scheme-handler/notion
-
diff --git a/notion-app.install b/notion-app.install
new file mode 100644
index 000000000000..426aaf50fd39
--- /dev/null
+++ b/notion-app.install
@@ -0,0 +1,13 @@
+post_install() {
+ ln -sf '/opt/Notion/notion-app' '/usr/bin/notion-app'
+
+ # SUID chrome-sandbox for Electron 5+
+ chmod 4755 '/opt/Notion/chrome-sandbox' || true
+
+ update-mime-database /usr/share/mime || true
+ update-desktop-database /usr/share/applications || true
+}
+
+post_remove() {
+ rm -f '/usr/bin/notion-app'
+}