summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Leidi <goodoldpaul@autistici.org>2023-07-16 15:14:41 +0200
committerJohn Kehayias <john.kehayias@protonmail.com>2023-10-06 22:20:48 -0400
commit5e5167168efbdaf561a53edd5622531f411a051b (patch)
treebebd39397b7600fdc3563340ab30a5f3ba771c9d
parentf78100ae575822001e00d04804f27a874e5477f0 (diff)
nongnu: Add anytype.
* nongnu/packages/productivity: New module. (anytype): new variable. Signed-off-by: John Kehayias <john.kehayias@protonmail.com>
-rw-r--r--nongnu/packages/productivity.scm113
1 files changed, 113 insertions, 0 deletions
diff --git a/nongnu/packages/productivity.scm b/nongnu/packages/productivity.scm
new file mode 100644
index 0000000..0a67ad9
--- /dev/null
+++ b/nongnu/packages/productivity.scm
@@ -0,0 +1,113 @@
1;;; SPDX-License-Identifier: GPL-3.0-or-later
2;;; Copyright © 2023 Giacomo Leidi <goodoldpaul@autistici.org>
3
4(define-module (nongnu packages productivity)
5 #:use-module (gnu packages base)
6 #:use-module (gnu packages compression)
7 #:use-module (gnu packages freedesktop)
8 #:use-module (gnu packages gl)
9 #:use-module (gnu packages gtk)
10 #:use-module (gnu packages image)
11 #:use-module (gnu packages linux)
12 #:use-module (gnu packages pciutils)
13 #:use-module (gnu packages photo)
14 #:use-module (gnu packages xiph)
15 #:use-module (gnu packages xorg)
16 #:use-module (gnu packages video)
17 #:use-module (gnu packages wget)
18 #:use-module (guix download)
19 #:use-module (guix gexp)
20 #:use-module (guix packages)
21 #:use-module (nonguix build-system chromium-binary)
22 #:use-module ((nonguix licenses) #:prefix license:))
23
24(define-public anytype
25 (package
26 (name "anytype")
27 (version "0.35.2")
28 (source
29 (origin
30 (method url-fetch)
31 (uri
32 (string-append "https://download.anytype.io?action=download"
33 "&key=desktop&id=127051615"))
34 (file-name (string-append "anytype-" version ".deb"))
35 (sha256
36 (base32
37 "12lfy5rygnaachax62j40b1ns9qsysa94f0hgqhsjaij50kw3dlc"))))
38 (build-system chromium-binary-build-system)
39 (arguments
40 (list
41 ;; almost 300MB
42 #:substitutable? #f
43 #:validate-runpath? #f ; TODO: fails on wrapped binary and included other files
44 #:wrapper-plan
45 #~(map (lambda (file)
46 (string-append "opt/Anytype/" file))
47 '("anytype"
48 "chrome-sandbox"
49 "chrome_crashpad_handler"
50 "libEGL.so"
51 "libffmpeg.so"
52 "libGLESv2.so"
53 "libvk_swiftshader.so"
54 "libvulkan.so.1"
55 "resources/app.asar.unpacked/node_modules/keytar/build/Release/keytar.node"))
56 #:install-plan
57 #~'(("opt/" "/share")
58 ("usr/share/" "/share"))
59 #:phases
60 #~(modify-phases %standard-phases
61 (add-after 'unpack 'unpack-deb
62 (lambda* (#:key inputs #:allow-other-keys)
63 (invoke "ar" "x" #$source)
64 (invoke "rm" "-v" "control.tar.gz"
65 "debian-binary"
66 (string-append "anytype-" #$version ".deb"))
67 (invoke "tar" "xvf" "data.tar.xz")
68 (invoke "rm" "-vrf" "data.tar.xz")))
69 (add-before 'install 'patch-assets
70 (lambda _
71 (let* ((bin (string-append #$output "/bin"))
72 (icon (string-append #$output "/share/icons/hicolor/0x0/apps/anytype.png"))
73 (usr/share "./usr/share")
74 (old-exe "/opt/Anytype/anytype")
75 (exe (string-append bin "/anytype")))
76 (substitute* (string-append usr/share "/applications/anytype.desktop")
77 (("^Icon=anytype") (string-append "Icon=" icon))
78 (((string-append "^Exec=" old-exe)) (string-append "Exec=" exe))))))
79 (add-before 'install-wrapper 'symlink-entrypoint
80 (lambda _
81 (let* ((bin (string-append #$output "/bin"))
82 (exe (string-append bin "/anytype"))
83 (share (string-append #$output "/share/Anytype"))
84 (target (string-append share "/anytype")))
85 (mkdir-p bin)
86 (symlink target exe)
87 (wrap-program exe
88 `("LD_LIBRARY_PATH" = (,share)))))))))
89 (native-inputs (list tar))
90 (inputs
91 (list bzip2
92 flac
93 gdk-pixbuf
94 harfbuzz
95 libexif
96 libglvnd
97 libpng
98 libva
99 libxscrnsaver
100 opus
101 pciutils
102 snappy
103 util-linux
104 xdg-utils
105 wget))
106 (synopsis "Productivity and note-taking app")
107 (supported-systems '("x86_64-linux"))
108 (description "Anytype is an E2E encrypted, cross-platform, productivity and
109note taking app. It stores all the data locally and allows for peer-to-peer
110synchronization.")
111 (home-page "https://anytype.io")
112 (license (license:nonfree
113 "https://github.com/anyproto/anytype-ts/blob/main/LICENSE.md"))))