diff options
author | Thanos Apollo <[email protected]> | 2025-04-10 17:15:20 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2025-04-10 17:15:20 +0300 |
commit | 56cb89181e2692c4a821afcd41f6e1a0568a8693 (patch) | |
tree | c75f2a0dc2074480034404f879a8808a29b5ecf2 | |
parent | 88fdc0294661d1068b01b95fe25de46002cb3614 (diff) |
guix: Add packages.
+ This should replace my personal hecate channel.
-rw-r--r-- | guix/packages/cgit.scm | 216 | ||||
-rw-r--r-- | guix/packages/emacs.scm | 317 | ||||
-rw-r--r-- | guix/packages/hunspell.scm | 52 | ||||
-rw-r--r-- | guix/packages/nyxt.scm | 273 |
4 files changed, 858 insertions, 0 deletions
diff --git a/guix/packages/cgit.scm b/guix/packages/cgit.scm new file mode 100644 index 0000000..d8b82c7 --- /dev/null +++ b/guix/packages/cgit.scm @@ -0,0 +1,216 @@ +(define-module (packages cgit) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix utils) + #:use-module (guix packages) + #:use-module (guix deprecation) + #:use-module (guix gexp) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix hg-download) + #:use-module (guix build-system cargo) + #:use-module (guix build-system cmake) + #:use-module (guix build-system copy) + #:use-module (guix build-system emacs) + #:use-module (guix build-system gnu) + #:use-module (guix build-system go) + #:use-module (guix build-system perl) + #:use-module (guix build-system pyproject) + #:use-module (guix build-system python) + #:use-module (guix build-system qt) + #:use-module (guix build-system trivial) + #:use-module (gnu packages apr) + #:use-module (gnu packages autotools) + #:use-module (gnu packages documentation) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages bison) + #:use-module (gnu packages boost) + #:use-module (gnu packages check) + #:use-module (gnu packages cook) + #:use-module (gnu packages crates-compression) + #:use-module (gnu packages crates-io) + #:use-module (gnu packages crates-vcs) + #:use-module (gnu packages crates-web) + #:use-module (gnu packages crypto) + #:use-module (gnu packages curl) + #:use-module (gnu packages databases) + #:use-module (gnu packages docbook) + #:use-module (gnu packages file) + #:use-module (gnu packages flex) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gawk) + #:use-module (gnu packages gettext) + #:use-module (gnu packages gl) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gnupg) + #:use-module (gnu packages golang) + #:use-module (gnu packages golang-build) + #:use-module (gnu packages golang-check) + #:use-module (gnu packages golang-crypto) + #:use-module (gnu packages golang-vcs) + #:use-module (gnu packages golang-web) + #:use-module (gnu packages golang-xyz) + #:use-module (gnu packages groff) + #:use-module (gnu packages guile) + #:use-module (gnu packages guile-xyz) + #:use-module (gnu packages image) + #:use-module (gnu packages imagemagick) + #:use-module (gnu packages less) + #:use-module (gnu packages libbsd) + #:use-module (gnu packages libevent) + #:use-module (gnu packages linux) + #:use-module (gnu packages mail) + #:use-module (gnu packages man) + #:use-module (gnu packages maths) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages ssh) + #:use-module (gnu packages web) + #:use-module (gnu packages patchutils) + #:use-module (gnu packages pcre) + #:use-module (gnu packages perl) + #:use-module (gnu packages perl-check) + #:use-module (gnu packages php) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (gnu packages python-check) + #:use-module (gnu packages python-crypto) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages readline) + #:use-module (gnu packages rsync) + #:use-module (gnu packages ruby) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages texinfo) + #:use-module (gnu packages text-editors) + #:use-module (gnu packages admin) + #:use-module (gnu packages xml) + #:use-module (gnu packages emacs) + #:use-module (gnu packages compression) + #:use-module (gnu packages sdl) + #:use-module (gnu packages swig) + #:use-module (gnu packages sync) + #:use-module (gnu packages tcl) + #:use-module (gnu packages textutils) + #:use-module (gnu packages time) + #:use-module (gnu packages tls) + #:use-module (gnu packages) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (gnu packages version-control)) + +(define-public cgit + (let ((commit "f5052197f082472f4a903e96f57d7b68937ebc05") + (rev "20")) + (package + (name "cgit") + ;; Update the ‘git-source’ input as well. + (version (git-version "1.2.3" rev commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://codeberg.org/thanosapollo/cgit") + (commit commit))) + (sha256 + (base32 + "09khbhs4l4rlczvmdpif21dcizfk69wy7z0sd67662aqabnryzgb")) + (file-name (git-file-name name version)))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ; XXX: fail to build the in-source git. + #:test-target "test" + #:make-flags #~(list (string-append "CC=" #$(cc-for-target)) + "SHELL_PATH=sh") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-git + (lambda* (#:key inputs #:allow-other-keys) + ;; Unpack the source of git into the 'git' directory. + (invoke "tar" "--strip-components=1" "-C" "git" "-xf" + (assoc-ref inputs "git-source")))) + (add-after 'unpack 'patch-absolute-file-names + (lambda* (#:key inputs outputs #:allow-other-keys) + (define (quoted-file-name input path) + (string-append "\"" input path "\"")) + (substitute* "ui-snapshot.c" + (("\"gzip\"") + (quoted-file-name (assoc-ref inputs "gzip") "/bin/gzip")) + (("\"bzip2\"") + (quoted-file-name (assoc-ref inputs "bzip2") "/bin/bzip2")) + (("\"xz\"") + (quoted-file-name (assoc-ref inputs "xz") "/bin/xz"))) + + (substitute* "filters/about-formatting.sh" + (("\\$\\(dirname \\$0\\)") (string-append (assoc-ref outputs "out") + "/lib/cgit/filters")) + (("\\| tr") (string-append "| " (which "tr")))) + + (substitute* "filters/html-converters/txt2html" + (("sed") (which "sed"))) + + (substitute* "filters/html-converters/man2html" + (("groff") (which "groff"))) + + (substitute* "filters/html-converters/rst2html" + (("rst2html\\.py") (which "rst2html.py"))))) + (delete 'configure) ; no configure script + (add-after 'build 'build-man + (lambda* (#:key make-flags #:allow-other-keys) + (apply invoke "make" "doc-man" make-flags))) + (replace 'install + (lambda* (#:key make-flags outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (apply invoke + "make" "install" "install-man" + (string-append "prefix=" out) + (string-append "CGIT_SCRIPT_PATH=" out "/share/cgit") + make-flags) + ;; Move the platform-dependent 'cgit.cgi' into lib to get it + ;; stripped. + (rename-file (string-append out "/share/cgit/cgit.cgi") + (string-append out "/lib/cgit/cgit.cgi"))))) + (add-after 'install 'wrap-python-scripts + (lambda* (#:key outputs #:allow-other-keys) + (for-each + (lambda (file) + (wrap-program (string-append (assoc-ref outputs "out") + "/lib/cgit/filters/" file) + `("GUIX_PYTHONPATH" ":" prefix (,(getenv "GUIX_PYTHONPATH"))))) + '("syntax-highlighting.py" + "html-converters/md2html"))))))) + (native-inputs + ;; For building manpage. + (list asciidoc)) + (inputs + `( ;; Building cgit requires a Git source tree. + ("git-source" + ,(origin + (method url-fetch) + ;; cgit is tightly bound to git. Use GIT_VER from the Makefile, + ;; which may not match the current (package-version git). + (uri "mirror://kernel.org/software/scm/git/git-2.45.2.tar.xz") + (sha256 + (base32 "1nws1vjgj54sv32wxl1h3n1jkcpabqv7a605hhafsby0n5zfigsi")))) + ("bash-minimal" ,bash-minimal) + ("openssl" ,openssl) + ("python" ,python) + ("python-docutils" ,python-docutils) + ("python-markdown" ,python-markdown) + ("python-pygments" ,python-pygments) + ("zlib" ,zlib) + ;; bzip2, groff, gzip and xz are inputs (not native inputs) + ;; since they are actually substituted into cgit source and + ;; referenced by the built package output. + ("bzip2" ,bzip2) + ("groff" ,groff) + ("gzip" ,gzip) + ("xz" ,xz))) + (home-page "https://git.zx2c4.com/cgit/") + (synopsis "Web frontend for git repositories") + (description + "CGit is an attempt to create a fast web interface for the Git SCM, using + a built-in cache to decrease server I/O pressure.") + (license license:gpl2)))) + diff --git a/guix/packages/emacs.scm b/guix/packages/emacs.scm new file mode 100644 index 0000000..24d0e2e --- /dev/null +++ b/guix/packages/emacs.scm @@ -0,0 +1,317 @@ +(define-module (packages emacs) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix gexp) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix build-system) + #:use-module (guix build-system gnu) + #:use-module (guix build-system glib-or-gtk) + #:use-module (gnu packages) + #:use-module (gnu packages acl) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages compression) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages fribidi) + #:use-module (gnu packages gawk) + #:use-module (gnu packages gcc) + #:use-module (gnu packages gd) + #:use-module (gnu packages gettext) + #:use-module (gnu packages ghostscript) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) ; for librsvg + #:use-module (gnu packages gtk) + #:use-module (gnu packages guile) + #:use-module (gnu packages image) + #:use-module (gnu packages lesstif) ; motif + #:use-module (gnu packages linux) ; alsa-lib, gpm + #:use-module (gnu packages mail) ; for mailutils + #:use-module (gnu packages multiprecision) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages pdf) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages selinux) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages texinfo) + #:use-module (gnu packages tls) + #:use-module (gnu packages tree-sitter) + #:use-module (gnu packages web) ; for jansson + #:use-module (gnu packages webkit) + #:use-module (gnu packages xml) + #:use-module (gnu packages xorg) + #:use-module (guix utils) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (gnu packages emacs)) + +(define-public emacs-minimal + (package + (name "emacs-minimal") + (version "29.4") + ;; Note: When using (replacement …), ensure that comp-native-version-dir + ;; stays the same across grafts. + ;; Run `make check-system TESTS=emacs-native-comp' to ensure that grafts + ;; can meaningfully be applied. + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/emacs/emacs-" + version ".tar.xz")) + (sha256 + (base32 + "0dd2mh6maa7dc5f49qdzj7bi4hda4wfm1cvvgq560djcz537k2ds")) + (patches (search-patches "emacs-disable-jit-compilation.patch" + "emacs-exec-path.patch" + "emacs-fix-scheme-indent-function.patch" + "emacs-native-comp-driver-options.patch" + "emacs-native-comp-fix-filenames.patch" + "emacs-native-comp-pin-packages.patch" + "emacs-pgtk-super-key-fix.patch")) + (modules '((guix build utils))) + (snippet + '(with-directory-excursion "lisp" + ;; Delete the bundled byte-compiled elisp files and generated + ;; autoloads. + (for-each delete-file + (append (find-files "." "\\.elc$") + (find-files "." "loaddefs\\.el$") + (find-files "eshell" "^esh-groups\\.el$"))) + + ;; Make sure Tramp looks for binaries in the right places on + ;; remote Guix System machines, where 'getconf PATH' returns + ;; something bogus. + (substitute* "net/tramp.el" + ;; Patch the line after "(defcustom tramp-remote-path". + (("\\(tramp-default-remote-path") + (format #f "(tramp-default-remote-path ~s ~s ~s ~s " + "~/.guix-profile/bin" "~/.guix-profile/sbin" + "/run/current-system/profile/bin" + "/run/current-system/profile/sbin"))) + + ;; Make sure Man looks for C header files in the right + ;; places. + (substitute* "man.el" + (("\"/usr/local/include\"" line) + (string-join + (list line + "\"~/.guix-profile/include\"" + "\"/var/guix/profiles/system/profile/include\"") + " "))))))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ; no check target + #:modules (%emacs-modules build-system) + #:configure-flags #~(list "--with-gnutls=no" "--disable-build-details") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'enable-elogind + (lambda _ + (substitute* "configure.ac" + (("libsystemd") "libelogind")) + (when (file-exists? "configure") + (delete-file "configure")))) + (add-after 'unpack 'patch-program-file-names + (lambda* (#:key inputs #:allow-other-keys) + ;; Substitute "sh" command. + (substitute* '("src/callproc.c" + "lisp/term.el" + "lisp/htmlfontify.el" + "lisp/mail/feedmail.el" + "lisp/obsolete/pgg-pgp.el" + "lisp/obsolete/pgg-pgp5.el" + "lisp/obsolete/terminal.el" + "lisp/org/ob-eval.el" + "lisp/textmodes/artist.el" + "lisp/progmodes/sh-script.el" + "lisp/textmodes/artist.el" + "lisp/htmlfontify.el" + "lisp/term.el") + (("\"/bin/sh\"") + (format #f "~s" (search-input-file inputs "bin/sh")))) + (substitute* '("lisp/gnus/mm-uu.el" + "lisp/gnus/nnrss.el" + "lisp/mail/blessmail.el") + (("\"#!/bin/sh\\\n\"") + (format #f "\"#!~a~%\"" (search-input-file inputs "bin/sh")))) + (substitute* '("lisp/jka-compr.el" + "lisp/man.el") + (("\"sh\"") + (format #f "~s" (search-input-file inputs "bin/sh")))) + + ;; Substitute "awk" command. + (substitute* '("lisp/gnus/nnspool.el" + "lisp/org/ob-awk.el" + "lisp/man.el") + (("\"awk\"") + (format #f "~s" (search-input-file inputs "bin/awk")))) + + ;; Substitute "find" command. + (substitute* '("lisp/gnus/gnus-search.el" + "lisp/obsolete/nnir.el" + "lisp/progmodes/executable.el" + "lisp/progmodes/grep.el" + "lisp/filecache.el" + "lisp/ldefs-boot.el" + "lisp/mpc.el") + (("\"find\"") + (format #f "~s" (search-input-file inputs "bin/find")))) + + ;; Substitute "sed" command. + (substitute* "lisp/org/ob-sed.el" + (("org-babel-sed-command \"sed\"") + (format #f "org-babel-sed-command ~s" + (search-input-file inputs "bin/sed")))) + (substitute* "lisp/man.el" + (("Man-sed-command \"sed\"") + (format #f "Man-sed-command ~s" + (search-input-file inputs "bin/sed")))) + + (substitute* "lisp/doc-view.el" + (("\"(gs|dvipdf|ps2pdf|pdftotext)\"" all what) + (let ((replacement (false-if-exception + (search-input-file + inputs + (string-append "/bin/" what))))) + (if replacement + (string-append "\"" replacement "\"") + all)))) + ;; match ".gvfs-fuse-daemon-real" and ".gvfsd-fuse-real" + ;; respectively when looking for GVFS processes. + (substitute* "lisp/net/tramp-gvfs.el" + (("\\(tramp-compat-process-running-p \"(.*)\"\\)" all process) + (format #f "(or ~a (tramp-compat-process-running-p ~s))" + all (string-append "." process "-real")))))) + (add-before 'configure 'fix-/bin/pwd + (lambda _ + ;; Use `pwd', not `/bin/pwd'. + (substitute* (find-files "." "^Makefile\\.in$") + (("/bin/pwd") + "pwd")))) + (add-after 'install 'install-site-start + ;; Use 'guix-emacs' in "site-start.el", which is used autoload the + ;; Elisp packages found in EMACSLOADPATH. + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lisp-dir (string-append out "/share/emacs/site-lisp")) + (emacs (string-append out "/bin/emacs"))) + + ;; This is duplicated from emacs-utils to prevent coupling. + (define* (emacs-byte-compile-directory dir) + (let ((expr `(progn + (setq byte-compile-debug t) + (byte-recompile-directory + (file-name-as-directory ,dir) 0 1)))) + (invoke emacs "--quick" "--batch" + (format #f "--eval=~s" expr)))) + + (copy-file #$(local-file + (search-auxiliary-file "emacs/guix-emacs.el")) + (string-append lisp-dir "/guix-emacs.el")) + (with-output-to-file (string-append lisp-dir "/site-start.el") + (lambda () + (display + (string-append + "(when (require 'guix-emacs nil t)\n" + " (guix-emacs-autoload-packages 'no-reload)\n" + " (advice-add 'package-load-all-descriptors" + " :after #'guix-emacs-load-package-descriptors))")))) + ;; Remove the extraneous subdirs.el file, as it causes Emacs to + ;; add recursively all the the sub-directories of a profile's + ;; share/emacs/site-lisp union when added to EMACSLOADPATH, + ;; which leads to conflicts. + (delete-file (string-append lisp-dir "/subdirs.el")) + ;; Byte compile the site-start files. + (emacs-byte-compile-directory lisp-dir)))) + (add-after 'install 'wrap-emacs-paths + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lisp-dirs (find-files (string-append out "/share/emacs") + "^lisp$" + #:directories? #t))) + (for-each + (lambda (prog) + (wrap-program prog + ;; Some variants rely on uname being in PATH for Tramp. + ;; Tramp paths can't be hardcoded, because they need to + ;; be portable. + `("PATH" suffix + ,(map dirname + (list (search-input-file inputs "/bin/gzip") + ;; for coreutils + (search-input-file inputs "/bin/yes")))) + `("EMACSLOADPATH" suffix ,lisp-dirs))) + (find-files (string-append out "/bin") + ;; Matches versioned and unversioned emacs binaries. + ;; We don't patch emacsclient, because it takes its + ;; environment variables from emacs. + ;; Likewise, we don't need to patch helper binaries + ;; like etags, ctags or ebrowse. + "^emacs(-[0-9]+(\\.[0-9]+)*)?$"))))) + (add-after 'wrap-emacs-paths 'undo-double-wrap + (lambda* (#:key outputs #:allow-other-keys) + ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped + ;; twice. This also fixes a minor issue, where WMs would not be + ;; able to track emacs back to emacs.desktop. + (with-directory-excursion (assoc-ref outputs "out") + (copy-file + (car (find-files "bin" "^emacs-([0-9]+\\.)+[0-9]+$")) + "bin/emacs"))))))) + (inputs (list bash-minimal coreutils findutils gawk gzip ncurses sed)) + (native-inputs (list autoconf pkg-config texinfo)) + (home-page "https://www.gnu.org/software/emacs/") + (synopsis "The extensible text editor (minimal build for byte-compilation)") + (description + "GNU Emacs is an extensible and highly customizable text editor. It is +based on an Emacs Lisp interpreter with extensions for text editing. Emacs +has been extended in essentially all areas of computing, giving rise to a +vast array of packages supporting, e.g., email, IRC and XMPP messaging, +spreadsheets, remote server editing, and much more. Emacs includes extensive +documentation on all aspects of the system, from basic editing to writing +large Lisp programs. It has full Unicode support for nearly all human +languages.") + (license license:gpl3+) + (native-search-paths + (list (search-path-specification + (variable "EMACSLOADPATH") + (files '("share/emacs/site-lisp"))) + (search-path-specification + (variable "EMACSNATIVELOADPATH") + (files '("lib/emacs/native-site-lisp"))) + (search-path-specification + (variable "INFOPATH") + (files '("share/info"))) + ;; Most variants support tree-sitter, so let's include it here. + (search-path-specification + (variable "TREE_SITTER_GRAMMAR_PATH") + (files '("lib/tree-sitter"))))) + (properties `((upstream-name . "emacs"))))) + +(define-public thanos/emacs-next-minimal + (let ((commit "881d593a9879f3355733f1b627af7cc0c12b429e") + (revision "0")) + (package + (inherit emacs-minimal) + (name "emacs-next-minimal") + (version (git-version "30.0.92" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.savannah.gnu.org/git/emacs.git") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0nj3a7wsl5piqf6a8wnmfyjbpxp2dwl0r48flv9q624jx4nxfr2p")) + (patches + (search-patches "emacs-disable-jit-compilation.patch" + "emacs-next-exec-path.patch" + "emacs-fix-scheme-indent-function.patch" + "emacs-next-native-comp-driver-options.patch" + "emacs-next-native-comp-fix-filenames.patch" + "emacs-native-comp-pin-packages.patch" + "emacs-pgtk-super-key-fix.patch"))))))) + +thanos/emacs-next-minimal diff --git a/guix/packages/hunspell.scm b/guix/packages/hunspell.scm new file mode 100644 index 0000000..38ae15e --- /dev/null +++ b/guix/packages/hunspell.scm @@ -0,0 +1,52 @@ +(define-module (packages hunspell) + #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (ice-9 match) + #:use-module (gnu packages aspell) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages m4) + #:use-module (gnu packages perl) + #:use-module (gnu packages textutils) + #:use-module (gnu packages hunspell)) + + +(define-public hunspell-dict-en-med + (package + (name "hunspell-dict-en-med") + (version "0.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.thanosapollo.org/hunspell-en-med") + (commit "672c036dee00b15dad43aad9fc268a1a0e90eb02"))) + (sha256 + (base32 "0h6j6d86w0pwfspz1jm5v1qlac70p1rmxy3nyv960x5cyf3qgbfb")))) + (build-system gnu-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'build) + (delete 'configure) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (share (string-append out "/share/hunspell/"))) + (install-file "en_med.aff" share) + (install-file "en_med.dic" share) + #t)))) + #:tests? #f)) + (native-inputs + (list hunspell ispell perl)) + (synopsis "Hunspell dictionary medical") + (description "This package provides a dictionary for the Hunspell +spell-checking library for English-US with .") + (home-page "https://www.j3e.de/ispell/igerman98/") + (license (list license:gpl2 license:gpl3)))) diff --git a/guix/packages/nyxt.scm b/guix/packages/nyxt.scm new file mode 100644 index 0000000..a77c3a3 --- /dev/null +++ b/guix/packages/nyxt.scm @@ -0,0 +1,273 @@ +(define-module (packages nyxt) + #:use-module (guix build-system gnu) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (gnu packages c) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gstreamer) + #:use-module (gnu packages gtk) + #:use-module (gnu packages lisp) + #:use-module (gnu packages lisp-check) + #:use-module (gnu packages lisp-xyz) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages tls) + #:use-module (gnu packages version-control) + #:use-module (gnu packages web-browsers) + #:use-module (gnu packages webkit) + #:use-module (gnu packages xdisorg) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public thanos/nyxt + (package + (name "nyxt") + (version "3.12.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/atlas-engineer/nyxt") + (commit version) + (recursive? #t))) + (sha256 + (base32 + "0nilfqcsily1y7x641cby5wsbh5va6jcfn8bx3fr90gjgccwvay0")) + (file-name (git-file-name name version)))) + (build-system gnu-build-system) + (arguments + `(#:make-flags (list "nyxt" + (string-append "DESTDIR=" (assoc-ref %outputs "out")) + "PREFIX=") + #:strip-binaries? #f ; Stripping breaks SBCL binaries. + #:tests? #f + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'fix-so-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "_build/cl-plus-ssl/src/reload.lisp" + (("libssl.so" all) + (string-append (assoc-ref inputs "openssl") "/lib/" all)) + (("libcrypto.so" all) + (string-append (assoc-ref inputs "openssl") "/lib/" all))) + (substitute* "_build/iolib/src/syscalls/ffi-functions-unix.lisp" + (("\\(:default \"libfixposix\"\\)") + (string-append "(:default \"" + (assoc-ref inputs "libfixposix") + "/lib/libfixposix\")"))) + (substitute* "_build/cl-sqlite/sqlite-ffi.lisp" + (("libsqlite3" all) + (string-append (assoc-ref inputs "sqlite") "/lib/" all))) + (substitute* "_build/cl-gobject-introspection/src/init.lisp" + (("libgobject-2\\.0\\.so") + (search-input-file inputs "/lib/libgobject-2.0.so")) + (("libgirepository-1\\.0\\.so") + (search-input-file inputs "/lib/libgirepository-1.0.so"))) + (substitute* "_build/cl-webkit/webkit2/webkit2.init.lisp" + (("libwebkit2gtk" all) + (string-append (assoc-ref inputs "webkitgtk-for-gtk3") "/lib/" all))) + (substitute* "_build/cl-cffi-gtk/glib/glib.init.lisp" + (("libglib-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all))) + (("libgthread-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/gobject/gobject.init.lisp" + (("libgobject-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/gio/gio.init.lisp" + (("libgio-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/cairo/cairo.init.lisp" + (("libcairo\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/pango/pango.init.lisp" + (("libpango-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all))) + (("libpangocairo-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/gdk-pixbuf/gdk-pixbuf.init.lisp" + (("libgdk_pixbuf-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/gdk/gdk.init.lisp" + (("libgdk-[0-9]\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/gdk/gdk.package.lisp" + (("libgtk-[0-9]\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))))) + (add-after 'unpack 'fix-clipboard-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "_build/trivial-clipboard/src/text.lisp" + (("\"xsel\"") + (string-append "\"" (assoc-ref inputs "xsel") "/bin/xsel\"")) + (("\"wl-copy\"") + (string-append "\"" (assoc-ref inputs "wl-clipboard") "/bin/wl-copy\"")) + (("\"wl-paste\"") + (string-append "\"" (assoc-ref inputs "wl-clipboard") "/bin/wl-paste\""))))) + (add-before 'build 'fix-common-lisp-cache-folder + (lambda _ (setenv "HOME" "/tmp"))) + (add-before 'check 'configure-tests + (lambda _ (setenv "NASDF_TESTS_NO_NETWORK" "1"))) + (add-after 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((gsettings (assoc-ref inputs "gsettings-desktop-schemas"))) + (wrap-program (string-append (assoc-ref outputs "out") "/bin/nyxt") + `("GIO_EXTRA_MODULES" prefix + (,(string-append (assoc-ref inputs "glib-networking") + "/lib/gio/modules"))) + `("GI_TYPELIB_PATH" prefix (,(getenv "GI_TYPELIB_PATH"))) + `("LD_LIBRARY_PATH" ":" prefix (,(string-append gsettings "/lib"))) + `("XDG_DATA_DIRS" ":" prefix (,(string-append gsettings "/share")))))))))) + (native-inputs (list cl-lisp-unit2 sbcl)) + (inputs (list cairo + git + glib + glib-networking + gobject-introspection + gsettings-desktop-schemas + gst-libav + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + gtk+ + gdk-pixbuf + libfixposix + openssl + pango + pkg-config + sqlite + webkitgtk-for-gtk3 + wl-clipboard + xsel)) + (synopsis "Extensible web-browser in Common Lisp") + (home-page "https://nyxt-browser.com/") + (description "Nyxt is a keyboard-oriented, extensible web-browser designed +for power users. The application has familiar Emacs and VI key-bindings and +is fully configurable and extensible in Common Lisp.") + (license license:bsd-3))) + +(define-public thanos/nyxt-latest + (let ((commit "72932017f320a79857462f518c256b07ae8d2d95") + (revision "1")) + (package + (name "nyxt-latest") + (version (git-version "4.0.0" revision commit)) + (source + (origin (method git-fetch) + (uri (git-reference (url "https://github.com/atlas-engineer/nyxt") + (commit commit) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 (base32 "041752kx6ilav5aqhbacqns442907j0vlzv134z1pf52jh1lwzyq")))) + (build-system gnu-build-system) + (arguments + `(#:make-flags (list "nyxt" + (string-append "DESTDIR=" (assoc-ref %outputs "out")) + "PREFIX=") + #:strip-binaries? #f ; Stripping breaks SBCL binaries. + #:phases + (modify-phases %standard-phases + (delete 'configure) + (add-after 'unpack 'fix-so-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "_build/cl-plus-ssl/src/reload.lisp" + (("libssl.so" all) + (string-append (assoc-ref inputs "openssl") "/lib/" all)) + (("libcrypto.so" all) + (string-append (assoc-ref inputs "openssl") "/lib/" all))) + (substitute* "_build/iolib/src/syscalls/ffi-functions-unix.lisp" + (("\\(:default \"libfixposix\"\\)") + (string-append "(:default \"" + (assoc-ref inputs "libfixposix") + "/lib/libfixposix\")"))) + (substitute* "_build/cl-sqlite/sqlite-ffi.lisp" + (("libsqlite3" all) + (string-append (assoc-ref inputs "sqlite") "/lib/" all))) + (substitute* "_build/cl-gobject-introspection/src/init.lisp" + (("libgobject-2\\.0\\.so") + (search-input-file inputs "/lib/libgobject-2.0.so")) + (("libgirepository-1\\.0\\.so") + (search-input-file inputs "/lib/libgirepository-1.0.so"))) + (substitute* "_build/cl-webkit/webkit2/webkit2.init.lisp" + (("libwebkit2gtk" all) + (string-append (assoc-ref inputs "webkitgtk-for-gtk3") "/lib/" all))) + (substitute* "_build/cl-cffi-gtk/glib/glib.init.lisp" + (("libglib-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all))) + (("libgthread-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/gobject/gobject.init.lisp" + (("libgobject-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/gio/gio.init.lisp" + (("libgio-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/cairo/cairo.init.lisp" + (("libcairo\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/pango/pango.init.lisp" + (("libpango-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all))) + (("libpangocairo-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/gdk-pixbuf/gdk-pixbuf.init.lisp" + (("libgdk_pixbuf-[0-9.]*\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/gdk/gdk.init.lisp" + (("libgdk-[0-9]\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))) + (substitute* "_build/cl-cffi-gtk/gdk/gdk.package.lisp" + (("libgtk-[0-9]\\.so" all) + (search-input-file inputs (string-append "/lib/" all)))))) + (add-after 'unpack 'fix-clipboard-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "_build/trivial-clipboard/src/text.lisp" + (("\"xsel\"") + (string-append "\"" (assoc-ref inputs "xsel") "/bin/xsel\"")) + (("\"wl-copy\"") + (string-append "\"" (assoc-ref inputs "wl-clipboard") "/bin/wl-copy\"")) + (("\"wl-paste\"") + (string-append "\"" (assoc-ref inputs "wl-clipboard") "/bin/wl-paste\""))))) + (add-before 'build 'fix-common-lisp-cache-folder + (lambda _ (setenv "HOME" "/tmp"))) + (add-before 'check 'configure-tests + (lambda _ (setenv "NASDF_TESTS_NO_NETWORK" "1"))) + (add-after 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((gsettings (assoc-ref inputs "gsettings-desktop-schemas"))) + (wrap-program (string-append (assoc-ref outputs "out") "/bin/nyxt") + `("GIO_EXTRA_MODULES" prefix + (,(string-append (assoc-ref inputs "glib-networking") + "/lib/gio/modules"))) + `("GI_TYPELIB_PATH" prefix (,(getenv "GI_TYPELIB_PATH"))) + `("LD_LIBRARY_PATH" ":" prefix (,(string-append gsettings "/lib"))) + `("XDG_DATA_DIRS" ":" prefix (,(string-append gsettings "/share")))))))))) + (native-inputs (list sbcl)) + (inputs (list cairo + gdk-pixbuf + glib + glib-networking + gobject-introspection + gsettings-desktop-schemas + gst-libav + gst-plugins-bad + gst-plugins-base + gst-plugins-good + gst-plugins-ugly + gtk+ + libfixposix + openssl + pango + pkg-config + sqlite + webkitgtk-for-gtk3 + wl-clipboard + xsel)) + (synopsis "Extensible web-browser in Common Lisp") + (home-page "https://nyxt-browser.com/") + (description "Nyxt is a keyboard-oriented, extensible web-browser designed +for power users. The application has familiar Emacs and VI key-bindings and +is fully configurable and extensible in Common Lisp.") + (license license:bsd-3)))) |