diff --git a/app-misc/notion/Manifest b/app-misc/notion/Manifest new file mode 100644 index 0000000..7eb917a --- /dev/null +++ b/app-misc/notion/Manifest @@ -0,0 +1,5 @@ +DIST Notion-3.9.1.dmg 102684257 BLAKE2B 467a054bb79cb9ea0cdd370aebf721eb7de562617ab079a70f31203f73105087ee6ea1bb84650f24f79668619f56b87242d8e33ab09a1247baf6c6608923d4bf SHA512 284fcb12b14fe9a5ffee763affd9f33ce4d1e4df2daf7137a4adb45e5d405e71065d510ace5070449c676885770f3dfa907964f8663ec005a71de2dceeb0a543 +DIST better_sqlite3_amd64.node 2042992 BLAKE2B beb128548f64602887886917b69df680a50a0f8642a65e89f6d3aa812fd34ac80e7c3a0c833f8a0591ff8778716b0c8434f9bac42da313a6aaae855c0df23222 SHA512 cb7cd32030ed29c7ce4009ede3eba32863d0bdd424e9ff94bd99131640e34d0542544e302ad29947afbe8e9d85455f86e205d10e0439e4bf066255a6423e0d07 +DIST better_sqlite3_arm64.node 2037712 BLAKE2B 1e05a44c8085f87eae28f2e48dcc9a67b8e0bc3e7a7d498dad5a306a0f7de615f077914f3f1e74eb9bfb93645009171d21d662d2e5c9aebb2a81977e2ab3fa05 SHA512 0b7f21b1feec0155604dfe12f6d5ce80bfdad85895b5334e5b303b25b1bd11d8cd6acc925f1d9174c9f13220c1a3fca906ea667a7d3ff5bf04411f459e0cfdc3 +DIST electron-v29.3.0-linux-arm64.zip 102894820 BLAKE2B a3135bdb8d50c13a2447b78a9d7f4a969853f2585f52b19270c24ab962a06bab960465e7e6284ee61cc09dd2787432ab035ff5129c2f5fe31c25e6f981fe71d9 SHA512 dda4d48771140e40b129f7ce1e369c8ba179a1094180be9297aebc8ee0dc5e3f0ef6d63025cee611a0c83a0376dce13a0ee8503d04bf0c247d7d7fc0edfe472d +DIST electron-v29.3.0-linux-x64.zip 102650900 BLAKE2B a9487c93b49b32db205c94994bb2d0e76f38313bf9048de3cef55d5d94c1f0b247290a74222188f444debd3e32d7b6930962711e76fbc24916dde918937b3661 SHA512 c8733e7dcb1a8d1da966b0dead547e62e983a6ee0dd42c65619fad29e2a0867f6aab68d740e270deec803ed255375143c73377fda0262de52d4381503628d826 diff --git a/app-misc/notion/files/notion.png b/app-misc/notion/files/notion.png new file mode 100644 index 0000000..3910516 Binary files /dev/null and b/app-misc/notion/files/notion.png differ diff --git a/app-misc/notion/notion-3.9.1.ebuild b/app-misc/notion/notion-3.9.1.ebuild new file mode 100644 index 0000000..52ceb8a --- /dev/null +++ b/app-misc/notion/notion-3.9.1.ebuild @@ -0,0 +1,112 @@ +# Copyright 2020-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_PN="${PN/-bin/}" +MY_PV="${PV/-r*/}" + +# Matches the version used by Notion. +ELECTRON_VERSION=v29.3.0 +BETTER_SQLITE3_VERSION="9.4.5" + +inherit chromium-2 desktop linux-info optfeature unpacker xdg + +DESCRIPTION="" +HOMEPAGE="https://github.com/ArmCord/ArmCord" +SRC_URI=" + https://desktop-release.notion-static.com/Notion-${MY_PV}.dmg + amd64? ( + https://gentoo.rgst.io/updater_artifacts/app-misc/notion/${MY_PV}/better_sqlite3-${BETTER_SQLITE3_VERSION}/amd64/better_sqlite3.node -> better_sqlite3_amd64.node + https://github.com/electron/electron/releases/download/$ELECTRON_VERSION/electron-$ELECTRON_VERSION-linux-x64.zip + ) + arm64? ( + https://gentoo.rgst.io/updater_artifacts/app-misc/notion/${MY_PV}/better_sqlite3-${BETTER_SQLITE3_VERSION}/arm64/better_sqlite3.node -> better_sqlite3_arm64.node + https://github.com/electron/electron/releases/download/$ELECTRON_VERSION/electron-$ELECTRON_VERSION-linux-arm64.zip + ) +" + +IUSE="appindicator +seccomp wayland" +BDEPEND="app-arch/7zip" +LICENSE="all-rights-reserved" +SLOT="0" +KEYWORDS="amd64 arm64" + +RESTRICT="bindist mirror strip test" + +QA_PREBUILT="*" +DESTDIR="/opt/${MY_PN}" +CONFIG_CHECK="~USER_NS" + +src_unpack() { + ls -alh + 7zz x "${DISTDIR}/Notion-${MY_PV}.dmg" || true + 7zz x "${DISTDIR}/electron-$ELECTRON_VERSION-linux-"**".zip" -o"$WORKDIR/electron" || die "Failed to extract Electron" + cp "$DISTDIR/better_sqlite3_"**".node" "$WORKDIR/better_sqlite3.node" || die "Failed to copy better_sqlite3.node" + + S="${WORKDIR}" +} + +src_configure() { + default + chromium_suid_sandbox_check_kernel_config +} + +src_compile() { + # We "build" Notion by combining the downloaded artifacts. + + BUILDDIR="${S}/${MY_PN}-${MY_PV}" + mkdir -p "${BUILDDIR}" + + # Copy the Electron files. + cp -r "${WORKDIR}/electron"/* "${BUILDDIR}" + + # Copy the Notion files. + cp -rp Notion/Notion.app/Contents/Resources/{app.asar.unpacked,app.asar} "$BUILDDIR/resources/" + + # Remove the Electron files we don't need. + rm -rf "${BUILDDIR}/resources/default_app.asar" + + # Rename "electron" to "notion" to avoid confusion. + mv "${BUILDDIR}/electron" "${BUILDDIR}/${MY_PN}" + + # TODO + cp better_sqlite3.node "$BUILDDIR/resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node" || + die "Failed to copy better_sqlite3.node" + S="${BUILDDIR}" +} + +src_install() { + doicon -s 256 "${FILESDIR}/notion.png" + + exeinto "${DESTDIR}" + doexe "${MY_PN}" chrome-sandbox libEGL.so libffmpeg.so libGLESv2.so libvk_swiftshader.so + + insinto "${DESTDIR}" + doins chrome_100_percent.pak chrome_200_percent.pak icudtl.dat resources.pak snapshot_blob.bin v8_context_snapshot.bin + insopts -m0755 + doins -r locales resources + + # Chrome-sandbox requires the setuid bit to be specifically set. + # see https://github.com/electron/electron/issues/17972 + fowners root "${DESTDIR}/chrome-sandbox" + fperms 4711 "${DESTDIR}/chrome-sandbox" + [[ -x chrome_crashpad_handler ]] && doins chrome_crashpad_handler + + dosym "${DESTDIR}/${MY_PN}" "/usr/bin/${MY_PN}" + + executable="${PN}" + if use wayland; then + executable="${PN} --ozone-platform-hint=auto" + fi + make_desktop_entry "$executable" "Notion" "${PN}" "Office;TextEditor;" +} + +pkg_postinst() { + xdg_pkg_postinst + + optfeature_header "Install the following packages for additional support:" + optfeature "sound support" \ + media-sound/pulseaudio media-sound/apulse[sdk] media-video/pipewire + optfeature "emoji support" media-fonts/noto-emoji +}