Skip to content

Commit

Permalink
textproc/obsidian: + Markdown-based knowledge database.
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.freebsd.org/D38691

Sponsored by:	Serenity Cybersecurity, LLC
  • Loading branch information
arrowd committed Feb 24, 2023
1 parent 403dd0d commit 21285a8
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 0 deletions.
1 change: 1 addition & 0 deletions textproc/Makefile
Expand Up @@ -503,6 +503,7 @@
SUBDIR += nuspell
SUBDIR += nux
SUBDIR += ny-aspell
SUBDIR += obsidian
SUBDIR += ocaml-csv
SUBDIR += ocaml-expat
SUBDIR += ocaml-text
Expand Down
96 changes: 96 additions & 0 deletions textproc/obsidian/Makefile
@@ -0,0 +1,96 @@
# This port will not be packaged by the official FreeBSD build cluster, because
# its license doesn't permit redistribution.
#
# To build this port locally with minimal effort use
# cd <PORTSDIR>/textproc/obsidian
# pkg install -A `make -V 'electron${ELECTRON_VERSION}'`
# make USE_PACKAGE_DEPENDS_ONLY=yes install clean

PORTNAME= obsidian
PORTVERSION= 1.1.9
CATEGORIES= textproc
# Icon is taken from the Nix build recipe
# https://github.com/NixOS/nixpkgs/blob/de5448dab588ad41aef40f8c7c0c230981656698/pkgs/applications/misc/obsidian/default.nix#L31-L34
MASTER_SITES= https://github.com/obsidianmd/obsidian-releases/releases/download/v${PORTVERSION}/ \
https://forum.obsidian.md/uploads/default/original/1X/:icon
DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
bf119bd48f748f4fd2d65f2d1bb05d3c806883b5.png:icon
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}

MAINTAINER= arrowd@FreeBSD.org
COMMENT= Powerful and extensible knowledge base application
WWW= https://obsidian.md

LICENSE= EULA
LICENSE_NAME= End User License Agreement
LICENSE_TEXT= See https://obsidian.md/terms
LICENSE_PERMS=

BUILD_DEPENDS= electron${ELECTRON_VERSION}:devel/electron${ELECTRON_VERSION}
RUN_DEPENDS= electron${ELECTRON_VERSION}:devel/electron${ELECTRON_VERSION}

# All deps below are there only to please stage-qa

LIB_DEPENDS= libatk-bridge-2.0.so:accessibility/at-spi2-atk \
libatspi.so:accessibility/at-spi2-core \
libsnappy.so:archivers/snappy \
libopus.so:audio/opus \
libdbus-1.so:devel/dbus \
libicuuc.so:devel/icu \
libevent.so:devel/libevent \
libnspr4.so:devel/nspr \
libFLAC.so:audio/flac \
libpci.so:devel/libpci \
libdrm.so:graphics/libdrm \
libpng.so:graphics/png \
libwayland-client.so:graphics/wayland \
libwebp.so:graphics/webp \
libopenh264.so:multimedia/openh264 \
libharfbuzz.so:print/harfbuzz \
libexpat.so:textproc/expat2 \
libnss3.so:security/nss \
libxkbcommon.so:x11/libxkbcommon \
libxshmfence.so:x11/libxshmfence \
libfontconfig.so:x11-fonts/fontconfig \
libcups.so:print/cups \
libasound.so:audio/alsa-lib

USES= desktop-file-utils gettext-runtime gl gnome iconv jpeg xorg

USE_GL= gbm gl glesv2
USE_GNOME= cairo gdkpixbuf2 glib20 gtk30 libxml2 libxslt
USE_XORG= x11 xcb xcomposite xcursor xdamage xext xfixes xi xrandr \
xrender xscrnsaver xtst

SUB_FILES= obsidian
NO_BUILD= yes
STRIP=

ELECTRON_VERSION= 21
ELECTRON_FILES= chromedriver \
libEGL.so \
libGLESv2.so \
libffmpeg.so \
libvk_swiftshader.so \
libvulkan.so \
resources.pak \
snapshot_blob.bin \
v8_context_snapshot.bin

do-install:
cd ${WRKSRC} && ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}
${INSTALL_PROGRAM} ${WRKDIR}/obsidian ${STAGEDIR}${PREFIX}/bin
${INSTALL_DATA} ${PATCHDIR}/obsidian.desktop ${STAGEDIR}${DESKTOPDIR}/obsidian.desktop
${INSTALL_DATA} ${DISTDIR}/bf119bd48f748f4fd2d65f2d1bb05d3c806883b5.png ${STAGEDIR}${PREFIX}/share/pixmaps/obsidian.png

post-install:
${RM} ${STAGEDIR}${DATADIR}/chrome-sandbox
${RM} ${STAGEDIR}${DATADIR}/libvulkan.so.1
.for f in ${ELECTRON_FILES}
${RM} ${STAGEDIR}${DATADIR}/${f}
${RLN} ${LOCALBASE}/share/electron${ELECTRON_VERSION}/${f} ${STAGEDIR}${DATADIR}/${f}
.endfor
# We have to copy the electron binary instead of symlinking
${CP} ${LOCALBASE}/share/electron${ELECTRON_VERSION}/electron ${STAGEDIR}${DATADIR}/obsidian

.include <bsd.port.mk>
5 changes: 5 additions & 0 deletions textproc/obsidian/distinfo
@@ -0,0 +1,5 @@
TIMESTAMP = 1676894388
SHA256 (obsidian-1.1.9.tar.gz) = 74547b2da0d1270a71acdc8f36c7868baea02001ce29fe40bb655797b4811921
SIZE (obsidian-1.1.9.tar.gz) = 93057094
SHA256 (bf119bd48f748f4fd2d65f2d1bb05d3c806883b5.png) = 4227a64156df4043395183dc7b9b23b809df79292d44c208e9649adcf7b2d4a3
SIZE (bf119bd48f748f4fd2d65f2d1bb05d3c806883b5.png) = 11970
10 changes: 10 additions & 0 deletions textproc/obsidian/files/obsidian.desktop
@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=Obsidian
GenericName=Knowledge base
Comment=Knowledge base
Icon=obsidian
Exec=obsidian %u
Categories=Office;
MimeType=x-scheme-handler/obsidian
14 changes: 14 additions & 0 deletions textproc/obsidian/files/obsidian.in
@@ -0,0 +1,14 @@
#!/bin/sh

# workaround Chromium bug https://bugs.chromium.org/p/chromium/issues/detail?id=918234
if [ "$DBUS_SESSION_BUS_ADDRESS" = "" ]; then
export DBUS_SESSION_BUS_ADDRESS="autolaunch:"
fi

# disable auto updater on first run
if [ ! -f $HOME/.config/obsidian/obsidian.json ]; then
mkdir -p $HOME/.config/obsidian/
echo '{"updateDisabled":true}' > $HOME/.config/obsidian/obsidian.json
fi

exec %%DATADIR%%/obsidian "$@"
3 changes: 3 additions & 0 deletions textproc/obsidian/pkg-descr
@@ -0,0 +1,3 @@
Obsidian is an Electron-based desktop application that allows creating a
knowledge base from Markdown-formatted notes. Notes can be connected and
visualized as a graph.
80 changes: 80 additions & 0 deletions textproc/obsidian/pkg-plist
@@ -0,0 +1,80 @@
bin/obsidian
share/applications/obsidian.desktop
%%DATADIR%%/LICENSE.electron.txt
%%DATADIR%%/LICENSES.chromium.html
%%DATADIR%%/chrome_100_percent.pak
%%DATADIR%%/chrome_200_percent.pak
%%DATADIR%%/chrome_crashpad_handler
%%DATADIR%%/chromedriver
%%DATADIR%%/icudtl.dat
%%DATADIR%%/libEGL.so
%%DATADIR%%/libGLESv2.so
%%DATADIR%%/libffmpeg.so
%%DATADIR%%/libvk_swiftshader.so
%%DATADIR%%/libvulkan.so
%%DATADIR%%/locales/af.pak
%%DATADIR%%/locales/am.pak
%%DATADIR%%/locales/ar.pak
%%DATADIR%%/locales/bg.pak
%%DATADIR%%/locales/bn.pak
%%DATADIR%%/locales/ca.pak
%%DATADIR%%/locales/cs.pak
%%DATADIR%%/locales/da.pak
%%DATADIR%%/locales/de.pak
%%DATADIR%%/locales/el.pak
%%DATADIR%%/locales/en-GB.pak
%%DATADIR%%/locales/en-US.pak
%%DATADIR%%/locales/es-419.pak
%%DATADIR%%/locales/es.pak
%%DATADIR%%/locales/et.pak
%%DATADIR%%/locales/fa.pak
%%DATADIR%%/locales/fi.pak
%%DATADIR%%/locales/fil.pak
%%DATADIR%%/locales/fr.pak
%%DATADIR%%/locales/gu.pak
%%DATADIR%%/locales/he.pak
%%DATADIR%%/locales/hi.pak
%%DATADIR%%/locales/hr.pak
%%DATADIR%%/locales/hu.pak
%%DATADIR%%/locales/id.pak
%%DATADIR%%/locales/it.pak
%%DATADIR%%/locales/ja.pak
%%DATADIR%%/locales/kn.pak
%%DATADIR%%/locales/ko.pak
%%DATADIR%%/locales/lt.pak
%%DATADIR%%/locales/lv.pak
%%DATADIR%%/locales/ml.pak
%%DATADIR%%/locales/mr.pak
%%DATADIR%%/locales/ms.pak
%%DATADIR%%/locales/nb.pak
%%DATADIR%%/locales/nl.pak
%%DATADIR%%/locales/pl.pak
%%DATADIR%%/locales/pt-BR.pak
%%DATADIR%%/locales/pt-PT.pak
%%DATADIR%%/locales/ro.pak
%%DATADIR%%/locales/ru.pak
%%DATADIR%%/locales/sk.pak
%%DATADIR%%/locales/sl.pak
%%DATADIR%%/locales/sr.pak
%%DATADIR%%/locales/sv.pak
%%DATADIR%%/locales/sw.pak
%%DATADIR%%/locales/ta.pak
%%DATADIR%%/locales/te.pak
%%DATADIR%%/locales/th.pak
%%DATADIR%%/locales/tr.pak
%%DATADIR%%/locales/uk.pak
%%DATADIR%%/locales/ur.pak
%%DATADIR%%/locales/vi.pak
%%DATADIR%%/locales/zh-CN.pak
%%DATADIR%%/locales/zh-TW.pak
%%DATADIR%%/obsidian
%%DATADIR%%/resources.pak
%%DATADIR%%/resources/app.asar
%%DATADIR%%/resources/app.asar.unpacked/node_modules/btime/binding.node
%%DATADIR%%/resources/app.asar.unpacked/node_modules/get-fonts/binding.node
%%DATADIR%%/resources/app.asar.unpacked/node_modules/vibrancy-win/binding.node
%%DATADIR%%/resources/obsidian.asar
%%DATADIR%%/snapshot_blob.bin
%%DATADIR%%/v8_context_snapshot.bin
%%DATADIR%%/vk_swiftshader_icd.json
share/pixmaps/obsidian.png

0 comments on commit 21285a8

Please sign in to comment.