diff options
52 files changed, 4869 insertions, 1457 deletions
diff --git a/.dir-locals.el b/.dir-locals.el index e0716f9..f8ee130 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,3 +1,4 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later ;; Per-directory local variables for GNU Emacs 23 and later. ((nil diff --git a/.guix-authorizations b/.guix-authorizations index 1d6aa61..2103b65 100644 --- a/.guix-authorizations +++ b/.guix-authorizations @@ -1,3 +1,4 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later ;; This is the list of OpenPGP keys currently authorized to sign commits in ;; this repository. @@ -17,5 +18,7 @@ (name "jonsger")) ("D319 C7A9 8F2C 3A11 D9C0 0E30 F369 0CBE 3152 EF58" (name "pineapples")) + ("A420 7B56 C255 109F 2CB3 157E 4990 97AE 5EA8 15D9" + (name "podiki")) ("1EFB 0909 1F17 D28C CBF9 B13A 53D4 57B2 D636 EE82" (name "roptat")))) diff --git a/.guix-channel b/.guix-channel index 73787dc..cfa33b0 100644 --- a/.guix-channel +++ b/.guix-channel @@ -1,3 +1,4 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later ;; -*- mode: scheme; -*- (channel @@ -0,0 +1,18 @@ + -*- org -*- +# SPDX-License-Identifier: CC0-1.0 +# Copyright © 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de> +# Copyright © 2023 John Kehayias <john.kehayias@protonmail.com> +#+TITLE: NEWS about user visible changes of nonguix + +* Changes in 1.4.0 (since 2022-05-21 (Guix 1.3.0)) +** Distribution +*** Nvidia driver now available as service +*** Enable WebAssembly sandboxed libraries in firefox +*** Update binary build system to return a monadic procedure +** New services +nvidia +** package updates including: +firefox 108.0.1, firefox-esr 102.6.0esr, linux 6.0.12, nvidia-driver 515.76 +steam 1.0.0.75 +*** steam updates +Steam now supports Proton versions 5.13 and newer, including support for SteamVR. @@ -98,17 +98,25 @@ For some hardware the official Guix installation image won't do nonfree Linux kernel and nonfree firmware with the following command: #+begin_src sh +guix system image --image-type=iso9660 /path/to/this/channel/nongnu/system/install.scm +#+end_src + +Like the official Guix installation image, this will produce a read-only image +with any changes made stored in memory. As indicated below, you will need to +run ~guix pull~ to download the Nonguix package descriptions, so will need +enough memory to hold the cached channel code which can be several hundred +megabytes. As an alternative, you can create a writable image with the +following command: + +#+begin_src sh guix system image --image-size=7.2GiB /path/to/this/channel/nongnu/system/install.scm #+end_src -As indicated bellow, you will need to run ~guix pull~ to download the -Nonguix package descriptions. Some free space on your USB thumbdrive is -required for this operation to succeed. The ~--image-size~ option allows -you to specify the size of the image and, as such, to allocate free space -to it. The given value is purely indicative. It obviously depends on your -thumbdrive capacity. +The ~--image-size~ option allows you to specify the size of the image and, as +such, to allocate free space to it. The given value is purely indicative. It +obviously depends on your thumbdrive capacity. -Then you can write the generated disk image to a USB thumbdrive with: +Either type of image can be written to a USB thumbdrive with: #+BEGIN_SRC sh # NOTE: This example assumes your thumbdrive is recognized by Linux as /dev/sdb. @@ -185,9 +193,51 @@ required, it is recommended to stay with Linux LTS releases: ...) #+END_SRC -** Avoiding kernel recompilation +** Substitutes for nonguix + +A Nonguix substitute server is available at [[https://substitutes.nonguix.org]]. +On Guix System, you can add and authorize this URL in the following way: +#+BEGIN_SRC scheme +(operating-system + (services (modify-services %desktop-services + (guix-service-type config => (guix-configuration + (inherit config) + (substitute-urls + (append (list "https://substitutes.nonguix.org") + %default-substitute-urls)) + (authorized-keys + (append (list (local-file "./signing-key.pub")) + %default-authorized-guix-keys)))))) + ...) +#+END_SRC + +Notice that the URL of the server should be specified without a trailing +slash. The file ~signing-key.pub~ should be downloaded directly from +[[https://substitutes.nonguix.org/signing-key.pub]]. + +Alternatively, you can replace ~(local-file "./signing-key.pub")~ by: +#+BEGIN_SRC scheme +(plain-file "non-guix.pub" + "<contents of signing-key.pub>") +#+END_SRC + +Guix System will only use the substitution server after it has been +reconfigured. The substitution server will therefore by default not +be used the first time you run ~guix system reconfigure~ after adding +the substitution server. It is therefore recommended to explicitly +specify the use of the substitution server the first time +you reconfigure your system: +#+BEGIN_SRC sh +sudo guix archive --authorize < signing-key.pub +sudo guix system reconfigure /etc/config.scm --substitute-urls='https://ci.guix.gnu.org https://bordeaux.guix.gnu.org https://substitutes.nonguix.org' +#+END_SRC + +Check out the [[https://guix.gnu.org/manual/en/html_node/Substitutes.html][chapter on substitutes]] +in the Guix manual for more details. + +** Pinning package versions -Since prebuilt substitutes are not currently available for Nonguix, you may find +When using substitutes is not an option, you may find that ~guix system reconfigure~ recompiles the kernel frequently due to version bumps in the kernel package. An inferior can be used to pin the kernel version and avoid lengthy rebuilds. @@ -1,4 +1,5 @@ ;;; Copyright © 2020 Alex Griffin <a@ajgrf.com> +;;; Copyright © 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de> ;; ;; Copying and distribution of this file, with or without modification, are ;; permitted in any medium without royalty provided the copyright notice and @@ -7,6 +8,20 @@ (channel-news (version 0) + (entry (commit "7d4c49eace0d3f074aa34ebbbf880236b6b0fab1") + (title + (en "Nvidia driver configuration refactored") + (de "Nvidia Treiberkonfiguration überarbeitet")) + (body + (en "The configuration of the Nvidia driver was completly over-worked. +In the system definition @code{nvidia-driver} needs to be replaced by +@code{nvidia-module} in the @code{kernel-loadable-module} list. Further add +the service @code{nvidia-service-type}.") + (de "Die Konfiguration der Nvidia Treiber wurde komplett überarbeitet. +Dazu muss in der Systemkonfiguration @code{nvidia-driver} mit @code{nvidia-module} +in der @code{kernel-loadable-module} Liste ersetzt werden. Sowie der Dienst +@code{nvidia-service-type} hinzugefügt werden."))) + (entry (commit "1ac29b33f3ca19134fcbedd6dc22deb45c15229f") (title (en "Nonguix authenticated updates")) (body diff --git a/nongnu/ci.scm b/nongnu/ci.scm index a4e2c72..db9e68a 100644 --- a/nongnu/ci.scm +++ b/nongnu/ci.scm @@ -1,17 +1,5 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2021 Mathieu Othacehe <m.othacehe@gmail.com> -;;; -;;; This program is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see <https://www.gnu.org/licenses/>. (define-module (nongnu ci) #:use-module (gnu ci) diff --git a/nongnu/packages/anydesk.scm b/nongnu/packages/anydesk.scm index 5ba0c7c..655e0e2 100644 --- a/nongnu/packages/anydesk.scm +++ b/nongnu/packages/anydesk.scm @@ -1,21 +1,6 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2021 Korytov Pavel <thexcloud@gmail.com> ;;; Copyright © 2021 Jonathan Brielmaier <jonathan.brielmaier@web.de> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (nongnu packages anydesk) #:use-module (gnu packages compression) diff --git a/nongnu/packages/benchmark.scm b/nongnu/packages/benchmark.scm new file mode 100644 index 0000000..feb2c7d --- /dev/null +++ b/nongnu/packages/benchmark.scm @@ -0,0 +1,43 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2021-2022 Petr Hodina <phodina@protonmail.com> + +(define-module (nongnu packages benchmark) + #:use-module (guix packages) + #:use-module (gnu packages base) + #:use-module (gnu packages gcc) + #:use-module (guix gexp) + #:use-module (guix download) + #:use-module (nonguix build-system binary) + #:use-module ((nonguix licenses) #:prefix license:)) + +(define-public geekbench5 + (package + (name "geekbench5") + (version "5.4.5") + (source (origin + (method url-fetch) + (uri (string-append "https://cdn.geekbench.com/Geekbench-" + version "-Linux.tar.gz")) + (sha256 + (base32 + "0qppx5ivclfwldb4fcmzg3v9a9nzi7d4f44vx634mfzw2symn3r4")))) + (build-system binary-build-system) + (arguments + (list #:strip-binaries? #f ;TODO: For some reason it fails validate-runpath + #:install-plan #~'(("geekbench5" "bin/") + ("geekbench.plar" "bin/") + ("geekbench_x86_64" "bin/")) + #:patchelf-plan #~(list (list "geekbench5" + '("glibc" "gcc:lib")) + (list "geekbench_x86_64" + '("glibc" "gcc:lib"))))) + (supported-systems '("x86_64-linux")) + (inputs `(("gcc:lib" ,gcc "lib") + ("glibc" ,glibc))) + (synopsis "Benchmark that measures processor and memory performance") + (description + "This package provides benchmark that measures processor and memory +performance and uploads the results into online database.") + (home-page "https://www.geekbench.com/") + (license (license:nonfree + "https://www.primatelabs.com/legal/terms-of-use.html")))) diff --git a/nongnu/packages/cad.scm b/nongnu/packages/cad.scm new file mode 100644 index 0000000..c17bb35 --- /dev/null +++ b/nongnu/packages/cad.scm @@ -0,0 +1,165 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2021-2022 Petr Hodina <phodina@protonmail.com> + +(define-module (nongnu packages cad) + #:use-module (guix packages) + #:use-module (gnu packages base) + #:use-module (gnu packages bootstrap) + #:use-module (gnu packages compression) + #:use-module (gnu packages cups) + #:use-module (gnu packages elf) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages gcc) + #:use-module (gnu packages gl) + #:use-module (gnu packages glib) + #:use-module (gnu packages gstreamer) + #:use-module (gnu packages libusb) + #:use-module (gnu packages linux) + #:use-module (gnu packages nss) + #:use-module (gnu packages maths) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages qt) + #:use-module (gnu packages xorg) + #:use-module (guix download) + #:use-module (nonguix build-system binary) + #:use-module ((nonguix licenses) #:prefix license:)) + +(define-public lightburn + (package + (name "lightburn") + (version "1.2.01") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/LightBurnSoftware/deployment/" + "releases/download/" version + "/LightBurn-Linux64-v" version ".7z")) + (sha256 + (base32 + "1yqxkf0izcfz05wrxh9xpmm7qi5wd5f1w9d2kni2wbzs531nr22p")))) + (build-system binary-build-system) + (arguments + `(#:strip-binaries? #f ;TODO: For some reason it fails validate-runpath + ;; phase if enbaled + #:install-plan + `(("LightBurn" "bin/LightBurn") ("LightBurn.png" "Lightburn.png") + ("qt.conf" "qt.conf") + ("languages" "languages") + ("plugins" "plugins") + ("translations" "translations")) + #:phases + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key inputs #:allow-other-keys) + (let ((source (assoc-ref inputs "source"))) + (invoke "7z" "x" source) + (chdir "LightBurn") + (delete-file-recursively "lib")))) + (replace 'patchelf + (lambda* (#:key inputs outputs patchelf-plan #:allow-other-keys) + (let* ((lightburn "LightBurn") + (plugins (list + "audio/libqtaudio_alsa.so" + "audio/libqtmedia_pulse.so" + "bearer/libqconnmanbearer.so" + "bearer/libqgenericbearer.so" + "bearer/libqnmbearer.so" + "imageformats/libqgif.so" + "imageformats/libqicns.so" + "imageformats/libqico.so" + "imageformats/libqjpeg.so" + "imageformats/libqtga.so" + "imageformats/libqtiff.so" + "imageformats/libqwbmp.so" + "imageformats/libqwebp.so" + "mediaservice/libgstaudiodecoder.so" + "mediaservice/libgstcamerabin.so" + "mediaservice/libgstmediacapture.so" + "mediaservice/libgstmediaplayer.so" + (string-append + "platforminputcontexts" + "/libcomposeplatforminputcontextplugin.so") + (string-append + "platforminputcontexts" + "/libibusplatforminputcontextplugin.so") + "platforms/libqxcb.so" + "printsupport/libcupsprintersupport.so" + "xcbglintegrations/libqxcb-egl-integration.so" + "xcbglintegrations/libqxcb-glx-integration.so")) + (libc (assoc-ref inputs "libc")) + (nss (assoc-ref inputs "nss")) + (rpath (string-append (apply string-append + (map (lambda (pkg) + (string-append (assoc-ref + inputs + pkg) + "/lib:")) + '("alsa-lib" + "cups-minimal" + "fontconfig-minimal" + "freetype" + "gcc" + "glib" + "gst-plugins-base" + "gstreamer" + "libusb" + "libx11" + "libxcb" + "libxext" + "libxi" + "libxrender" + "mesa" + "nspr" + "openlibm" + "pulseaudio" + "qtbase" + "qtserialport" + "qtmultimedia" + "zlib"))) nss + "/lib/nss:")) + (ld-so (string-append libc + ,(glibc-dynamic-linker)))) + (invoke "patchelf" "--set-rpath" rpath lightburn) + (invoke "patchelf" "--set-interpreter" ld-so lightburn) + (map (lambda (x) + (invoke "patchelf" "--set-rpath" rpath + (string-append "plugins/" x))) plugins))))))) + (supported-systems '("x86_64-linux")) + (native-inputs (list p7zip + patchelf)) + (inputs (list alsa-lib + cups-minimal + fontconfig + `(,gcc "lib") + glib + gst-plugins-base + gstreamer + libusb + libx11 + libxcb + libxext + libxi + libxrender + nspr + nss + mesa + openlibm + pulseaudio + qtbase-5 + qtserialport + qtmultimedia-5 + zlib)) + (synopsis "Layout, editing, and control software for your laser cutter") + (description + "This package provides layout, editing, and control software +for your laser cutter. Following features are supported: +@enumerate +@item Import artwork from formats such as AI, PDF, SVG, DXF, PLT, PNG, JPG, GIF +, BMP +@item arrange, edit, and even create new vector shapes within the editor +@item apply production settings such as like power, speed, number of passes, +cut order, etc. +@item send the result directly to your laser cutter +@end enumerate") + (home-page "https://lightburnsoftware.com/") + (license (license:nonfree "https://lightburnsoftware.com/pages/how-the-lightburn-license-works")))) diff --git a/nongnu/packages/chrome.scm b/nongnu/packages/chrome.scm new file mode 100644 index 0000000..500fadd --- /dev/null +++ b/nongnu/packages/chrome.scm @@ -0,0 +1,213 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022 Giacomo Leidi <goodoldpaul@autistici.org> +;;; Copyright © 2022 Mathieu Othacehe <m.othacehe@gmail.com> +;;; Copyright © 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de> + +(define-module (nongnu packages chrome) + #:use-module (gnu packages base) + #:use-module (gnu packages compression) + #:use-module (gnu packages curl) + #:use-module (gnu packages cups) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages fonts) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages databases) + #:use-module (gnu packages gcc) + #:use-module (gnu packages gl) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gtk) + #:use-module (gnu packages image) + #:use-module (gnu packages linux) + #:use-module (gnu packages nss) + #:use-module (gnu packages pciutils) + #:use-module (gnu packages photo) + #:use-module (gnu packages video) + #:use-module (gnu packages wget) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xiph) + #:use-module (gnu packages xml) + #:use-module (gnu packages xorg) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix build-system gnu) + #:use-module (nonguix build-system binary) + #:use-module (nonguix licenses) + #:use-module (ice-9 string-fun)) + +(define-public (make-google-chrome repo version hash) + (let* ((name (string-append "google-chrome-" repo)) + (appname (if (string=? repo "stable") + "chrome" + (string-replace-substring name "google-" ""))) + (patchelf-inputs (list "alsa-lib" "at-spi2-atk" "at-spi2-core" "atk" "cairo" "cups" + "dbus" "eudev" "expat" "freetype" "fontconfig-minimal" "gcc" "gdk-pixbuf" + "glib" "gtk" "harfbuzz" "libdrm" "libnotify" "libsecret" "libx11" + "libxcb" "libexif" "libxcomposite" "libxcursor" "libxdamage" + "libxext" "libxfixes" "libxi" "libxkbcommon" "libxkbfile" "libxrandr" + "libxrender" "libxtst" "libnotify" "mesa" "nspr" "pango" "pipewire" + "sqlcipher" "xdg-utils" "zlib"))) + (package + (name name) + (version version) + (source (origin + (method url-fetch) + (uri + (string-append + "https://dl.google.com/linux/chrome/deb/pool/main/g/" + name "/" name "_" version "-1_amd64.deb")) + (sha256 + (base32 hash)))) + (build-system binary-build-system) + (arguments + (list + ;; almost 300MB, faster to download and build from Google servers + #:substitutable? #f + #:patchelf-plan + #~(let ((patchelf-inputs (list #$@patchelf-inputs)) + (path (string-append "opt/google/" #$appname "/"))) + (map (lambda (file) + (cons (string-append path file) (list patchelf-inputs))) + '("chrome" + "chrome-sandbox" + "chrome_crashpad_handler" + "nacl_helper" + "libEGL.so" + "libGLESv2.so"))) + #:install-plan + #~'(("opt/" "/share") + ("usr/share/" "/share")) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'unpack-deb + (lambda* (#:key inputs #:allow-other-keys) + (invoke "ar" "x" #$source) + (invoke "rm" "-v" "control.tar.xz" + "debian-binary" + (string-append "google-chrome-" #$repo "_" + #$version + "-1_amd64.deb")) + (invoke "tar" "xf" "data.tar.xz") + (invoke "rm" "-vrf" "data.tar.xz" "etc"))) + (add-before 'install 'patch-assets + ;; Many thanks to + ;; https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/google-chrome/default.nix + (lambda _ + (let* ((bin (string-append #$output "/bin")) + (share (string-append #$output "/share")) + (opt "./opt") + (usr/share "./usr/share") + (old-exe (string-append "/opt/google/" #$appname "/google-" #$appname)) + (exe (string-append bin "/google-" #$appname))) + ;; This allows us to override CHROME_WRAPPER later. + (substitute* (string-append opt "/google/" #$appname "/google-" #$appname) + (("CHROME_WRAPPER") "WRAPPER")) + (substitute* (string-append usr/share "/applications/google-" #$appname ".desktop") + (("^Exec=.*") (string-append "Exec=" exe "\n"))) + (substitute* (string-append usr/share "/gnome-control-center/default-apps/google-" #$appname ".xml") + ((old-exe) exe)) + (substitute* (string-append usr/share "/menu/google-" #$appname ".menu") + (("/opt") share) + ((old-exe) exe)) + #t))) + (add-after 'install 'install-wrapper + (lambda _ + (let* ((bin (string-append #$output "/bin")) + (exe (string-append bin "/google-" #$appname)) + (share (string-append #$output "/share")) + (chrome-target (string-append share "/google/" #$appname "/google-" #$appname)) + (patchelf-inputs-packages (list #$@(map (lambda (i) (this-package-input i)) patchelf-inputs))) + (ld-library-libs (map (lambda (input) + (string-append input "/lib")) + patchelf-inputs-packages))) + (mkdir-p bin) + (symlink chrome-target exe) + (wrap-program exe + `("FONTCONFIG_PATH" ":" prefix + (,(string-join + (list + (string-append #$(this-package-input "fontconfig-minimal") "/etc/fonts") + #$output) + ":"))) + `("LD_LIBRARY_PATH" ":" prefix + (,(string-join + (append + ld-library-libs + (list + (string-append #$(this-package-input "nss") "/lib/nss") + #$output)) + ":"))) + '("CHROME_WRAPPER" = (#$appname))))))))) + (native-inputs (list tar)) + (inputs + (list alsa-lib + at-spi2-atk + at-spi2-core + atk + bzip2 + cairo + curl + cups + dbus + eudev + expat + flac + fontconfig + freetype + font-liberation + `(,gcc "lib") + gdk-pixbuf + glib + gtk + harfbuzz + libdrm + libexif + libglvnd + libnotify + libpng + librsvg + libsecret + libva + libx11 + libxcb + libxcomposite + libxcursor + libxdamage + libxext + libxfixes + libxi + libxkbcommon + libxkbfile + libxrandr + libxscrnsaver + libxshmfence + libxrender + libxtst + mesa + nspr + nss + opus + pango + pciutils + pipewire + snappy + sqlcipher + util-linux + xdg-utils + wget + zlib)) + (synopsis "Freeware web browser") + (supported-systems '("x86_64-linux")) + (description "Google Chrome is a cross-platform web browser developed by Google.") + (home-page "https://www.google.com/chrome/") + (license (nonfree "https://www.google.com/intl/en/chrome/terms/"))))) + +(define-public google-chrome-stable + (make-google-chrome "stable" "110.0.5481.77" "0jjdgfps6siy9hk2r553vvh0jmkn987ad77sv2zqs9gvx0vsrwgp")) + +(define-public google-chrome-beta + (make-google-chrome "beta" "110.0.5481.77" "0wnzgvwbpmb5ja4ba5mjk4bk0aaxzbw4zi509vw96q6mbqmr4iwr")) + +(define-public google-chrome-unstable + (make-google-chrome "unstable" "111.0.5563.19" "02aaqny23dcdp611n6jr7swkjnx1wd0lb8dgxq53b806f0s374cp")) diff --git a/nongnu/packages/chromium.scm b/nongnu/packages/chromium.scm new file mode 100644 index 0000000..9580b8a --- /dev/null +++ b/nongnu/packages/chromium.scm @@ -0,0 +1,148 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022 Pierre Neidhardt <mail@ambrevar.xyz> + +(define-module (nongnu packages chromium) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix gexp) + #:use-module (guix download) + #:use-module (guix utils) + #:use-module (guix build-system gnu) + #:use-module (nonguix build-system binary) + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages cmake) + #:use-module (gnu packages cups) + #:use-module (gnu packages gcc) + #:use-module (gnu packages gl) + #:use-module (gnu packages glib) + #:use-module (gnu packages gtk) + #:use-module (gnu packages linux) + #:use-module (gnu packages nss) + #:use-module (gnu packages xml) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xorg) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1)) + +(define-public chromium-embedded-framework + (let ((git-revision "d0bbcbb") + (chromium-version "103.0.5060.114") + (arch (match (or (%current-target-system) (%current-system)) + ("aarch64-linux" "linuxarm64") + ("armhf-linux" "linuxarm") + (_ "linux64")))) + (package + (name "chromium-embedded-framework") + (version "103.0.9") + (source (origin + (method url-fetch) + (uri (string-append + "https://cef-builds.spotifycdn.com/cef_binary_" + version + "+g" git-revision + "+chromium-" chromium-version + "_" arch "_minimal.tar.bz2")) + (sha256 + (base32 + "143x0jmasl4z16bkxlrbz874chd9x9xpc5qylb9h7j80gfcrzlsi")))) + (build-system binary-build-system) + (arguments + `(#:patchelf-plan + `(("Release/libcef.so" ("alsa-lib" + "at-spi2-atk" + "at-spi2-core" + "atk" + "cairo" + "cups" + "dbus" + "expat" + "gcc" + "glib" + "glibc" + "gtk+" + "libdrm" + "libx11" + "libxcb" + "libxcomposite" + "libxdamage" + "libxext" + "libxfixes" + "libxkbcommon" + "libxrandr" + "libxshmfence" + "mesa" + "nspr" + ("nss" "/lib/nss") + "pango"))) + #:install-plan + `(("Release/libcef.so" "lib/") + ("libcef_dll_wrapper/libcef_dll_wrapper.a" "lib/") + ("Release/" "share/cef/" + #:include-regexp (".*.bin")) + ("Resources/" "share/cef/") + ("include" "./")) + #:phases + (modify-phases %standard-phases + (add-before 'install 'build + (lambda _ + (invoke "cmake" "-DCMAKE_BUILD_TYPE=Release" ".") + (invoke "make" "libcef_dll_wrapper")))))) + (inputs + (list + alsa-lib + at-spi2-atk + at-spi2-core + atk + cairo + cups + dbus + expat + `(,gcc "lib") + glib + gtk+ + libdrm + libx11 + libxcb + libxcomposite + libxdamage + libxext + libxfixes + libxkbcommon + libxrandr + libxshmfence + mesa + nspr + nss + pango)) + (native-inputs + ;; FIXME: We specify glibc here so that Cmake does not pick the wrong + ;; architecture (e.g. glibc32 while on a 64-bit system). + ;; The build system could be smarter. + (list glibc + cmake)) + (synopsis "Embed Chromium-based browsers in other applications") + (supported-systems '("armhf-linux" "aarch64-linux" "x86_64-linux")) + (description "This library provides a simple framework for embedding +Chromium-based browsers in other applications. + +Unlike the Chromium project itself, which focuses mainly on Google Chrome +application development, CEF focuses on facilitating embedded browser use +cases in third-party applications. CEF insulates the user from the underlying +Chromium and Blink code complexity by offering production-quality stable +APIs. + +Some use cases for CEF include: + +@itemize +@item Embedding an HTML5-compliant Web browser control in an existing native +application. +@item Creating a light-weight native \"shell\" application that hosts a user +interface developed primarily using Web technologies. +@item Rendering Web content “off-screen” in applications that have their own +custom drawing frameworks. +@item Acting as a host for automated testing of existing Web properties and +applications. +@end itemize\n") + (home-page "https://bitbucket.org/chromiumembedded/cef") + (license license:bsd-3)))) diff --git a/nongnu/packages/clojure.scm b/nongnu/packages/clojure.scm index 66567bb..3ef3ff4 100644 --- a/nongnu/packages/clojure.scm +++ b/nongnu/packages/clojure.scm @@ -1,86 +1,33 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz> ;;; Copyright © 2020 Jelle Licht <jlicht@fsfe.org> ;;; Copyright © 2020 Alex Griffin <a@ajgrf.com> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (nongnu packages clojure) + #:use-module (gnu packages compression) + #:use-module (gnu packages gcc) #:use-module (gnu packages readline) - #:use-module (guix packages) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (nonguix build-system binary) #:use-module ((guix licenses) #:prefix license:)) -(define-public clojure-tools - (package - (name "clojure-tools") - (version "1.10.3.943") - (source - (origin - (method url-fetch) - (uri (string-append "https://download.clojure.org/install/clojure-tools-" - version - ".tar.gz")) - (sha256 (base32 "1yrk6m9f6n8f0drpx305jb95d61py423aawkl2p6syr2kfyx2w63")))) - (build-system copy-build-system) - (arguments - `(#:install-plan - '(("deps.edn" "lib/clojure/") - ("example-deps.edn" "lib/clojure/") - ("tools.edn" "lib/clojure/") - ("exec.jar" "lib/clojure/libexec/") - (,(string-append "clojure-tools-" version ".jar") "lib/clojure/libexec/") - ("clojure" "bin/") - ("clj" "bin/")) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'fix-paths - (lambda* (#:key outputs #:allow-other-keys) - (substitute* "clojure" - (("PREFIX") (string-append (assoc-ref outputs "out") "/lib/clojure"))) - (substitute* "clj" - (("BINDIR") (string-append (assoc-ref outputs "out") "/bin")) - (("rlwrap") (which "rlwrap"))) - #true))))) - (inputs `(("rlwrap" ,rlwrap))) - (synopsis "CLI tools for the Clojure programming language") - (description "The Clojure command line tools can be used to start -a Clojure repl, use Clojure and Java libraries, and start Clojure -programs.") - (license license:epl1.0) - (home-page "https://clojure.org/releases/tools"))) - - ;; This is a hidden package, as it does not really serve a purpose on its own. (define leiningen-jar (package (name "leiningen-jar") - (version "2.9.7") + (version "2.10.0") (source (origin (method url-fetch) - (uri (string-append "https://github.com/technomancy/leiningen/releases/download/" - version "/leiningen-" version "-standalone.jar")) + (uri "https://codeberg.org/attachments/43cebda5-a7c2-405b-b641-5143a00051b5") (file-name "leiningen-standalone.jar") (sha256 (base32 - "00m8xbrfbkv84jncssr3jg86y6k7pc2iamvdpl7bppgcmha19w42")))) + "0d5vmpyp9ddxpj1s5c60fv2f5iimz1chbgfhchlaqxa0sfx9jwnj")))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) @@ -102,16 +49,16 @@ lets you focus on your code.") (package (inherit leiningen-jar) (name "leiningen") - (version "2.9.7") + (version "2.10.0") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/technomancy/leiningen.git") + (url "https://codeberg.org/leiningen/leiningen.git") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 - "1sx54g50rb6pj9mhqp77byh1ikfic7cmyifacxn4mi4a5j949kly")))) + "0xvniav6iy1yrbamvbg8i3dq8issiczv3rbig2yc3nm08d2q0rig")))) (build-system gnu-build-system) (arguments `(#:tests? #f @@ -134,3 +81,38 @@ lets you focus on your code.") #t)))))) (inputs `(("leiningen-jar" ,leiningen-jar))))) + +(define-public clj-kondo + (package + (name "clj-kondo") + (version "2023.01.20") + (source (origin + (method url-fetch/zipbomb) + (uri (string-append + "https://github.com/clj-kondo/clj-kondo/releases/download/v" + version "/clj-kondo-" version "-linux-amd64.zip")) + (sha256 + (base32 + "0i91qaqjnrg7ad0rs1r4rjwi77pr16dhck9bflb4kiyggcbs4dds")))) + (build-system binary-build-system) + (arguments + `(#:patchelf-plan + '(("clj-kondo" ("gcc:lib" "zlib"))) + #:install-plan + '(("clj-kondo" "/bin/")) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'chmod + (lambda _ + (chmod "clj-kondo" #o755)))))) + (native-inputs + `(("unzip" ,unzip))) + (inputs + `(("gcc:lib" ,gcc "lib") + ("zlib" ,zlib))) + (supported-systems '("x86_64-linux")) + (home-page "https://github.com/clj-kondo/clj-kondo") + (synopsis "Linter for Clojure code") + (description "Clj-kondo performs static analysis on Clojure, ClojureScript +and EDN, without the need of a running REPL.") + (license license:epl1.0))) diff --git a/nongnu/packages/compression.scm b/nongnu/packages/compression.scm index 60b1352..bb0ae88 100644 --- a/nongnu/packages/compression.scm +++ b/nongnu/packages/compression.scm @@ -1,20 +1,5 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (nongnu packages compression) #:use-module (guix packages) @@ -25,14 +10,14 @@ (define-public unrar (package (name "unrar") - (version "6.0.2") + (version "6.2.2") (source (origin (method url-fetch) (uri (string-append "https://www.rarlab.com/rar/unrarsrc-" version ".tar.gz")) (sha256 (base32 - "1lzdsfb4d00silyk04lkvaklmxaiyqksyxx4h1krg77q6f1iigw1")))) + "1mbw20lh300r541dz4m84rvq7b542mnb70yc29afrjj6waknqza7")))) (build-system gnu-build-system) (arguments '(#:tests? #f ; No tests. diff --git a/nongnu/packages/coq.scm b/nongnu/packages/coq.scm index 4754b47..4c8b411 100644 --- a/nongnu/packages/coq.scm +++ b/nongnu/packages/coq.scm @@ -1,21 +1,7 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu> -;;; Copyright © 2021 Isaac Young <isyoung@pm.me> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +;;; Copyright © 2021 Isaac Young <isyoung@pm.me> +;;; Copyright © 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de> (define-module (nongnu packages coq) #:use-module (ice-9 match) @@ -29,7 +15,7 @@ (define-public compcert (package (name "compcert") - (version "3.9") + (version "3.11") (source (origin (method git-fetch) (uri (git-reference @@ -38,11 +24,15 @@ (file-name (git-file-name name version)) (sha256 (base32 - "1srcz2dqrvmbvv5cl66r34zqkm0hsbryk7gd3i9xx4slahc9zvdb")))) + "183b1fn7vhb9ykxax11x0bb2q6z5jnd874nzlxqnnm89j3ysr134")))) (build-system gnu-build-system) (arguments `(#:phases (modify-phases %standard-phases + (add-before 'configure 'allow-newer-coq-version + (lambda _ + (substitute* "configure" + (("8.14.0") "8.16.0")))) (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (let ((system ,(match (or (%current-target-system) (%current-system)) @@ -68,11 +58,11 @@ ;; MIPS is not supported. (supported-systems (delete "mips64el-linux" %supported-systems)) (native-inputs - `(("ocaml" ,ocaml) - ("ocaml-findlib" ,ocaml-findlib); for menhir --suggest-menhirlib - ("coq" ,coq))) + (list coq + ocaml + ocaml-findlib)) ; for menhir --suggest-menhirlib (inputs - `(("menhir" ,ocaml-menhir))) + (list ocaml-menhir)) (home-page "http://compcert.inria.fr") (synopsis "Certified C compiler") (description "The CompCert project investigates the formal verification of diff --git a/nongnu/packages/dotnet.scm b/nongnu/packages/dotnet.scm index cb9a0d8..a45a1ca 100644 --- a/nongnu/packages/dotnet.scm +++ b/nongnu/packages/dotnet.scm @@ -1,20 +1,5 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2021 Jelle Licht <jlicht@fsfe.org> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (nongnu packages dotnet) #:use-module (ice-9 match) @@ -27,7 +12,7 @@ #:use-module (gnu packages gcc) #:use-module (gnu packages icu4c) #:use-module (gnu packages kerberos) - #:use-module (gnu packages linux) + #:use-module (gnu packages instrumentation) #:use-module (gnu packages tls)) (define-public omnisharp @@ -82,20 +67,20 @@ various IDEs and plugins.") (license license:expat))) (define-public dotnet - (let ((dotnet-sdk-version "5.0.4")) + (let ((dotnet-sdk-version "6.0.9")) (package (name "dotnet") - (version "5.0.201") + (version "6.0.401") (source (origin (method url-fetch/tarbomb) (uri - (string-append "https://dotnetcli.azureedge.net/dotnet/Sdk/" - version "/dotnet-sdk-" - version "-linux-x64.tar.gz")) + (string-append "https://download.visualstudio.microsoft.com/download/pr/8159607a-e686-4ead-ac99-b4c97290a5fd/ec6070b1b2cc0651ebe57cf1bd411315/dotnet-sdk-" + version + "-linux-x64.tar.gz")) (sha256 (base32 - "0hdkwz39ql7madg5dzy50by6q4vyagpwjvjn34ks730yhf3p1xwz")))) + "05yr64ffcaf48ripxzcv9nwlzp7r83cy9hz17dm5c0317lhksqch")))) (build-system binary-build-system) (arguments `(#:patchelf-plan @@ -193,10 +178,10 @@ building different types of applications.") (license license:expat)))) (define-public dotnet-core-3.1 - (let ((dotnet-sdk-version "3.1.13")) + (let ((dotnet-sdk-version "3.1.25")) (package (name "dotnet") - (version "3.1.113") + (version "3.1.419") (source (origin (method url-fetch/tarbomb) @@ -206,7 +191,7 @@ building different types of applications.") version "-linux-x64.tar.gz")) (sha256 (base32 - "0dm4kxpq235yfxzf41m1iyfg5avlxdic0nwr865g5wyzc6kz9nhw")))) + "0wg91y5czimcrcv4rfvza9qc1n7l29szbs9qnmr437175zl10ksi")))) (build-system binary-build-system) (arguments `(#:patchelf-plan @@ -295,7 +280,7 @@ building different types of applications.") ("mit-krb5" ,mit-krb5) ("openssl" ,openssl) ("zlib" ,zlib))) - (home-page "https://docs.microsoft.com/en-us/dotnet/") + (home-page "https://dotnet.microsoft.com/en-us/") (supported-systems '("x86_64-linux")) (synopsis "Binary build of the @code{.NET} SDK and runtime") (description "@code{.NET} is a cross-platform developer platform for diff --git a/nongnu/packages/dyalog.scm b/nongnu/packages/dyalog.scm new file mode 100644 index 0000000..7408b68 --- /dev/null +++ b/nongnu/packages/dyalog.scm @@ -0,0 +1,222 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022 B. Wilson <x@wilsonb.com> + +(define-module (nongnu packages dyalog) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages bootstrap) + #:use-module (gnu packages compression) + #:use-module (gnu packages cups) + #:use-module (gnu packages databases) + #:use-module (gnu packages elf) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages gcc) + #:use-module (gnu packages glib) + #:use-module (gnu packages gtk) + #:use-module (gnu packages icu4c) + #:use-module (gnu packages linux) + #:use-module (gnu packages nss) + #:use-module (gnu packages xorg) + #:use-module (gnu packages xml) + #:use-module (guix build utils) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module (guix records) + #:use-module (guix utils) + #:use-module (ice-9 regex) + #:use-module (ice-9 match) + #:use-module (nongnu packages dotnet) + #:use-module (nongnu packages ncurses) + #:use-module ((nonguix licenses) #:prefix license:)) + +(define-public dyalog-apl + (package + (name "dyalog-apl") + (version "18.2.45405") + (source + (origin + (method url-fetch) + (uri (string-append + "https://www.dyalog.com/uploads/php/download.dyalog.com/" + "download.php?file=" (version-major+minor version) + "/linux_64_" version "_unicode.x86_64.deb")) + (sha256 + (base32 "0qx6z4n9p0dfrk0wwh66s8z8m91cq4inwan8w03gqqis60cxc3x4")))) + (build-system gnu-build-system) + (outputs '("out" "fonts")) + (inputs (list alsa-lib + at-spi2-atk + at-spi2-core + atk + cups + dbus + dotnet-core-3.1 + fontconfig + expat + (list gcc "lib") + glib + glibc + gtk+-2 + icu4c + libx11 + libxcb + libxcomposite + libxcursor + libxdamage + libxext + libxfixes + libxi + libxrender + libxscrnsaver + libxtst + libxrandr + ncurses/tinfo-5 + nspr + nss + pango + unixodbc)) + (native-inputs (list binutils bzip2 patchelf tar)) + (arguments + `(#:modules (((guix build gremlin) #:select (file-runpath)) + ((guix elf) #:select (elf-segments parse-elf PT_INTERP)) + ((ice-9 binary-ports) #:select (get-bytevector-n)) + ((srfi srfi-1) #:select (last)) + ,@%gnu-build-system-modules) + #:tests? #f + #:phases + (modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key inputs #:allow-other-keys) + (let ((source (assoc-ref inputs "source"))) + (invoke "ar" "x" source) + (invoke "tar" "-xzvf" "data.tar.gz")))) + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib/dyalog")) + (in (string-append "opt/mdyalog/" + ,(version-major+minor version) + "/64/unicode/"))) + (substitute* (string-append in "mapl") + (("\"\\$\\{DYALOG\\}/dyalog\"" dyalog) + (string-append "exec -a dyalog " dyalog))) + (substitute* (string-append in "scriptbin/dyalogscript") + (("^INSTALLDIR=.*") (format #f "INSTALLDIR=\"~a\"~%" lib)))))) + (delete 'build) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (fonts (assoc-ref outputs "fonts")) + (lib (string-append out "/lib/dyalog")) + (bin (string-append out "/bin")) + (truetype (string-append fonts "/share/fonts/truetype")) + (dotnet (assoc-ref inputs "dotnet")) + (dotnet-root (string-append dotnet "/share/dotnet")) + (icu4c (assoc-ref inputs "icu4c")) + (icu4c-lib (string-append icu4c "/lib")) + (in (string-append "opt/mdyalog/" + ,(version-major+minor version) + "/64/unicode/"))) + (mkdir-p lib) + (copy-recursively in lib) + (delete-file-recursively (string-append lib "/fonts")) + + (mkdir-p truetype) + (install-file (string-append in "/fonts/Apl385.ttf") truetype) + (install-file (string-append in "/fonts/APL333.ttf") truetype) + + (mkdir-p bin) + (symlink (string-append lib "/mapl") + (string-append bin "/dyalog")) + (symlink (string-append lib "/scriptbin/dyalogscript") + (string-append bin "/dyalogscript")) + (wrap-program (string-append lib "/dyalog") + `("DOTNET_ROOT" = (,dotnet-root)) + `("LD_LIBRARY_PATH" ":" suffix (,icu4c-lib))) + #t))) + (add-after 'install 'patch-elf-files + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib/dyalog")) + (glibc (assoc-ref inputs "glibc")) + (ld.so (string-append glibc ,(glibc-dynamic-linker))) + (rpath (pk (string-join + (cons* lib + (string-append lib "/lib") + (string-append (assoc-ref inputs "nss") + "/lib/nss") + (map (lambda (pkg) + (string-append (assoc-ref inputs pkg) + "/lib")) + '("alsa-lib" + "at-spi2-atk" + "at-spi2-core" + "atk" + "cups" + "dbus" + "expat" + "fontconfig-minimal" + "gcc" + "glib" + "glibc" + "gtk+" + "libx11" + "libxcb" + "libxcomposite" + "libxcursor" + "libxdamage" + "libxext" + "libxfixes" + "libxi" + "libxrender" + "libxscrnsaver" + "libxtst" + "libxrandr" + "ncurses-with-tinfo" + "nspr" + "pango" + "unixodbc"))) + ":"))) + (elf-file?* (lambda (file stat) (elf-file? file)))) + + (define* (file-segments file #:key type) + (let* ((bv (call-with-input-file file + (lambda (port) + (get-bytevector-n port 4096)) + #:binary #t #:guess-encoding #f)) + (segments (elf-segments (parse-elf bv))) + (select? (lambda (elf) + (eq? (elf-segment-type elf) type)))) + (if type + (filter select? segments) + segments))) + + (define* (set-runpath file #:optional (runpath rpath)) + (if (file-runpath file) + (begin + (format #f "Setting RUNPATH: ~a~&" file) + (invoke "patchelf" "--set-rpath" runpath file) + (invoke "patchelf" "--shrink-rpath" file)))) + + (define* (set-interpreter file #:optional (interp ld.so)) + (if (not (null? (file-segments file #:type PT_INTERP))) + (begin + (format #f "Setting interpreter: ~a~%" file) + (invoke "patchelf" "--set-interpreter" interp file)))) + + (define (patch-elf file) + (begin + (set-runpath file) + (set-interpreter file))) + + (for-each patch-elf (find-files out elf-file?*)) + #t)))))) + (home-page "https://www.dyalog.com/") + (synopsis "Dyalog APL interpreter and programming language environment") + (description "Dyalog APL is de facto the most widely deployed dialect of +APL in the wild. The interpreter boasts world-class performance benchmarks, +excellent tooling integration, and support for modern APL features.") + (license (license:nonfree + "https://www.dyalog.com/prices-and-licences.htm")))) diff --git a/nongnu/packages/emacs.scm b/nongnu/packages/emacs.scm index 4e070e2..ee1616c 100644 --- a/nongnu/packages/emacs.scm +++ b/nongnu/packages/emacs.scm @@ -1,27 +1,20 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz> ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +;;; Copyright © 2022 Fredrik Salomonsson <plattfot@posteo.net> +;;; Copyright © 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de> (define-module (nongnu packages emacs) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages emacs-xyz) #:use-module (guix packages) #:use-module (guix build-system emacs) + #:use-module (guix build-system copy) #:use-module (guix download) - #:use-module (nonguix licenses)) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (nonguix licenses) + #:use-module (nongnu packages lisp)) (define-public clhs (package @@ -70,3 +63,90 @@ browsing. An Emacs package is provided for easy access. Load it with: @end lisp ") (license (nonfree "http://quickdocs.org/clhs/")))) + +(define-public emacs-eli + ;; 10.1 HEAD has a fix for Emacs 28.1, as opposed to the latest "express" tag. + (let ((commit "8f9a8b9eb1aa518774c54d51e4f38ba534356415")) + (package + (name "emacs-eli") + (version (git-version "acl10.1express_Feb2022update2022-02-11" "1" commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/franzinc/eli/") + (commit commit))) + (file-name (git-file-name "emacs-eli" version)) + (sha256 + (base32 + "0w1hdkr9x3byf1l6dbcbnd4x8110wvps3527ivyj1bmdk1hyqnzb")))) + ;; The `emacs-build-system' fails here, probably because ELI is meant to + ;; be load with (load "fi-site-init.el") and not with `require'. See + ;; https://franz.com/emacs/. + (build-system copy-build-system) + (inputs (list allegro-cl)) + (arguments + `(#:install-plan + `(("." ,,(string-append "share/emacs/site-lisp/eli-" version) + ;; Remove useless Windows or build files. + #:exclude ("emacsdir.pl" "nsis" "Makefile" "local.mak"))) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-paths + (lambda* (#:key inputs #:allow-other-keys) + (let ((allegro-cl (assoc-ref inputs "allegro-cl"))) + ;; FIXME: Can't get `emacs-substitute-variables' to work here, why? + (substitute* "fi-vars.el" + (("defvar fi:common-lisp-image-name \"alisp\"") + (string-append "defvar fi:common-lisp-image-name \"" + allegro-cl "/bin/alisp\"")) + (("defvar fi:common-lisp-image-file nil") + (string-append "defvar fi:common-lisp-image-file \"" + allegro-cl "/share/allegro-cl/alisp.dxl\"")) + (("defvar fi:common-lisp-directory nil") + (string-append "defvar fi:common-lisp-directory \"" + allegro-cl "/share/allegro-cl\""))))))))) + (home-page "https://franz.com/emacs/") + (synopsis "Allegro Common Lisp Emacs interface") + (description + "An integral part of the Allegro CL programming environment is the interface +between Emacs and Allegro CL, hereafter referred to as the Emacs-Lisp +interface. This interface allows the editing and running of Common Lisp +programs, and contains enhancements that allow a tight coupling between Emacs +and Lisp, very similar to those which used to be available only on Lisp +machines. + +To load it, call @code{(load \"fi-site-init.el\")} from Emacs. +Then you can start Allegro CL by entering @code{M-x fi:common-lisp}.") + ;; While this may be a free license, this Emacs package is only useful + ;; with the non-free Allegro CL. + (license (nonfree "https://raw.githubusercontent.com/franzinc/eli/acl10.1express_Feb2022update2022-02-11/LICENSE"))))) + +(define-public emacs-org-roam-ui + (let ((commit "c75fc7506ee7f03840a9a93ed9336d7ed24551aa") + (revision "0")) + (package + (name "emacs-org-roam-ui") + (version (git-version "0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/org-roam/org-roam-ui") + (commit commit))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 "0mkcd2622np8s5qz2zvx7lch6dc586xqmn6914gi4ym7nvklf3zy")))) + (build-system emacs-build-system) + (arguments + (list #:include #~(cons "^out" %default-include))) + (propagated-inputs + (list emacs-org-roam emacs-simple-httpd emacs-websocket)) + (home-page "https://github.com/org-roam/org-roam-ui") + (synopsis "Web User Interface for Org Roam") + (description + "Org Roam UI is meant as a successor of Org Roam server that extends +functionality of Org Roam with a web application that runs side-by-side with +Emacs. It provides a web interface for navigating around notes created within +Org Roam.") + (license license:gpl3)))) diff --git a/nongnu/packages/emulators.scm b/nongnu/packages/emulators.scm index 0ec22c0..5dade3b 100644 --- a/nongnu/packages/emulators.scm +++ b/nongnu/packages/emulators.scm @@ -1,20 +1,5 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (nongnu packages emulators) #:use-module (gnu packages backup) diff --git a/nongnu/packages/engineering.scm b/nongnu/packages/engineering.scm new file mode 100644 index 0000000..18c7864 --- /dev/null +++ b/nongnu/packages/engineering.scm @@ -0,0 +1,167 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022 Demis Balbach <db@minikn.xyz> +;;; Copyright © 2023 Jonathan Brielmaier <jonathan.brielmaier@web.de> + +(define-module (nongnu packages engineering) + #:use-module (gnu packages base) + #:use-module (gnu packages cups) + #:use-module (gnu packages compression) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages gcc) + #:use-module (gnu packages gl) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gtk) + #:use-module (gnu packages linux) + #:use-module (gnu packages nss) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xorg) + #:use-module (gnu packages xml) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module ((guix licenses) :prefix license:) + #:use-module (nonguix build-system binary) + #:use-module ((nonguix licenses) :prefix license:) + #:use-module (ice-9 match)) + +(define-public lycheeslicer + (package + (name "lycheeslicer") + (version "4.1.0") + (source + (origin + (method url-fetch) + (uri + (string-append + "https://mango-lychee.nyc3.cdn.digitaloceanspaces.com/LycheeSlicer-" version ".deb")) + (sha256 + (base32 "1rv3f8d1sb5irn4y8hjzk2m7c9irw71ls8p1mqambxg79q9ffj9m")))) + (supported-systems '("x86_64-linux")) + (build-system binary-build-system) + (arguments + (list #:validate-runpath? #f ; TODO: fails on wrapped binary and included other files + #:patchelf-plan + #~'(("lib/LycheeSlicer/lycheeslicer" + ("alsa-lib" + "at-spi2-atk" + "at-spi2-core" + "atk" + "cairo" + "cups" + "dbus" + "expat" + "eudev" + "fontconfig-minimal" + "gcc" + "gdk-pixbuf" + "glib" + "gtk+" + "libdrm" + "libnotify" + "libsecret" + "libx11" + "libxcb" + "libxcomposite" + "libxdamage" + "libxext" + "libxfixes" + "libxkbcommon" + "libxrandr" + "libxscrnsaver" + "libxshmfence" + "libxtst" + "mesa" + "nspr" + "pango"))) + #:phases + #~(modify-phases %standard-phases + (replace 'unpack + (lambda _ + (invoke "ar" "x" #$source) + (invoke "tar" "xvf" "data.tar.xz") + ;; Use the more standard lib directory for everything. + (rename-file "opt/" "lib") + (mkdir-p "share") + (copy-recursively "usr/share" "share") + ;; Remove unneeded files. + (delete-file-recursively "usr") + (delete-file "control.tar.gz") + (delete-file "data.tar.xz") + (delete-file "debian-binary"))) + (add-after 'unpack 'fix-desktop-file + (lambda _ + ;; Fix the .desktop file binary location. + (substitute* '("share/applications/lycheeslicer.desktop") + (("/opt/LycheeSlicer") + (string-append #$output "/lib/LycheeSlicer"))))) + (add-after 'install 'symlink-binary-file-and-cleanup + (lambda _ + (delete-file (string-append #$output "/environment-variables")) + (mkdir-p (string-append #$output "/bin")) + (symlink (string-append #$output "/lib/LycheeSlicer/lycheeslicer") + (string-append #$output "/bin/lycheeslicer")))) + (add-after 'install 'wrap-where-patchelf-does-not-work + (lambda _ + (wrap-program (string-append #$output "/lib/LycheeSlicer/lycheeslicer") + `("FONTCONFIG_PATH" ":" prefix + (,(string-join + (list + (string-append #$(this-package-input "fontconfig-minimal") "/etc/fonts") + #$output) + ":"))) + `("LD_LIBRARY_PATH" ":" prefix + (,(string-join + (list + (string-append #$(this-package-input "nss") "/lib/nss") + (string-append #$(this-package-input "mesa") "/lib") + (string-append #$(this-package-input "dbus") "/lib") + (string-append #$(this-package-input "gcc") "/lib") + (string-append #$(this-package-input "eudev") "/lib") + (string-append #$(this-package-input "libsecret") "/lib") + (string-append #$(this-package-input "libxscrnsaver") "/lib") + (string-append #$(this-package-input "libnotify") "/lib") + (string-append #$output "/lib/LycheeSlicer") + #$output) + ":"))))))))) + (native-inputs (list tar)) + (inputs + (list alsa-lib + at-spi2-atk + at-spi2-core + atk + cairo + cups + dbus + expat + eudev + fontconfig + `(,gcc "lib") + glib + gtk+ + libdrm + libnotify + libsecret + libx11 + libxcb + libxcomposite + libxdamage + libxext + libxfixes + libxkbcommon + libxrandr + libxscrnsaver + libxshmfence + libxtst + mesa + nspr + nss + pango)) + (home-page "https://mango3d.io") + (synopsis "Slicer for resin 3d printers of different manufacturers") + (description "A user-friendly slicing software for resin 3d printers. It +supports printers and resins of different manufacturers alongside +community-created profiles as well. It offers a paid- and free version with a +reduced feature set.") + (license (license:nonfree "https://mango3d.io/terms-and-conditions")))) diff --git a/nongnu/packages/firmware.scm b/nongnu/packages/firmware.scm new file mode 100644 index 0000000..a71104c --- /dev/null +++ b/nongnu/packages/firmware.scm @@ -0,0 +1,178 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022-2023 Jonathan Brielmaier <jonathan.brielmaier@web.de> +;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com> + +(define-module (nongnu packages firmware) + #:use-module (gnu packages efi) + #:use-module (gnu packages firmware) + #:use-module (guix build-system copy) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module ((guix licenses) #:prefix guix-license:) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (nonguix licenses)) + +;; fwupd with LVFS nonfree repositories enabled +(define-public fwupd-nonfree + (package + (inherit fwupd) + (name "fwupd-nonfree") + (arguments + (substitute-keyword-arguments (package-arguments fwupd) + ((#:configure-flags _ + #~'()) + #~(list "--wrap-mode=nofallback" + "-Dsystemd=false" + (string-append "-Defi_os_dir=" + #$gnu-efi "/lib") + "-Defi_binary=false" + (string-append "-Dudevdir=" + #$output "/lib/udev") + "--localstatedir=/var" + (string-append "--libexecdir=" + #$output "/libexec") + "-Dsupported_build=true")))))) + +(define-public ov5640-firmware + (let ((commit "6e8e591e17e207644dfe747e51026967bb1edab5") + (revision "1")) + (package + (name "ov5640-firmware") + (version (git-version "0.0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://megous.com/git/linux-firmware") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "19xmkdvlkczc6zgigy8jdbgnp37i6pc03m2cm3gilvzg8m7v18ad")))) + (build-system copy-build-system) + (arguments + `(#:substitutable? #f + #:install-plan '(("ov5640_af.bin" "lib/firmware/")))) + (synopsis "Firmware for the OV5640 sensor in the PinePhone") + (description "This package provides binary firmware for the 0V5640 sensor +in the PinePhone.") + (home-page "https://megous.com/git/linux-firmware") + (license (nonfree (string-append "unknown")))))) + +(define-public rtl8723bt-firmware + (let ((commit "6e8e591e17e207644dfe747e51026967bb1edab5") + (revision "1")) + (package + (name "rtl8723bt-firmware") + (version (git-version "0.0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://megous.com/git/linux-firmware") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "19xmkdvlkczc6zgigy8jdbgnp37i6pc03m2cm3gilvzg8m7v18ad")))) + (build-system copy-build-system) + (arguments + `(#:substitutable? #f + #:install-plan '(("rtl_bt/rtl8723cs_xx_fw.bin" "lib/firmware/")))) + (synopsis "Firmware for the RTL8723BS/CS") + (description "This package provides binary firmware for the RTL8723BS/CS +WiFi/Bluetooth chip in the PinePhone.") + (home-page "https://megous.com/git/linux-firmware") + (license (nonfree (string-append "unknown")))))) + +(define-public anx7688-firmware + (let ((commit "6e8e591e17e207644dfe747e51026967bb1edab5") + (revision "1")) + (package + (name "anx7688-firmware") + (version (git-version "0.0.0" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://megous.com/git/linux-firmware") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "19xmkdvlkczc6zgigy8jdbgnp37i6pc03m2cm3gilvzg8m7v18ad")))) + (build-system copy-build-system) + (arguments + `(#:substitutable? #f + #:install-plan '(("anx7688-fw.bin" "lib/firmware/")))) + (synopsis "Firmware for the ANX7688") + (description "This package provides binary firmware for the ANX7688 +HDMI to USB Type-C Bridge in the PinePhone.") + (home-page "https://megous.com/git/linux-firmware") + (license (nonfree (string-append "unknown")))))) + +(define-public ap6256-firmware + (let ((commit "056d5f6776e515f90bbbbead1be06857aaef17d0") + (revision "1")) + (package + (name "ap6256-firmware") + (version (git-version "2020.02" revision commit)) + (source (origin + (method git-fetch) + (uri (git-reference + (url + "https://gitlab.manjaro.org/manjaro-arm/packages/community/ap6256-firmware") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1s52rpikw0gysph5lq7vr6b3nsxczg4ikgil9zdgmcknjnxk9kbv")))) + (build-system copy-build-system) + (arguments + `(#:substitutable? #f + #:install-plan '( ;Bluetooth firmware + ("BCM4345C5.hcd" "usr/lib/firmware/brcm/") + ;; WiFi firmware + ("fw_bcm43456c5_ag.bin" "usr/lib/firmware/brcm/") + ("brcmfmac43456-sdio.clm_blob" + "usr/lib/firmware/brcm/") + ("brcmfmac43456-sdio.AP6256.txt" + "usr/lib/firmware/brcm/") + ("brcmfmac43456-sdio.AP6256.txt" + "usr/lib/firmware/brcm/brcmfmac43456-sdio.pine64,pinebook-pro.txt")))) + (synopsis "Firmware for the wifi/bt module AP6256") + (description + "This package provides Firmware for the wifi/bt module AP6256, +found in Pinebook Pro.") + (home-page "https://gitlab.manjaro.org/manjaro-arm/packages/community/ap6256-firmware") + (license (nonfree (string-append "unknown")))))) + +(define-public bluez-firmware + (package + (name "bluez-firmware") + (version "1.2") + (source (origin + (method url-fetch) + (uri (string-append "http://bluez.sf.net/download/" name "-" + version ".tar.gz")) + (sha256 + (base32 + "1v4yv6gvlvvwslpb0lj1nsp4r900zxpvxz2ab0sbvimbiw8rw4dn")))) + (build-system gnu-build-system) + (arguments + (list #:phases #~(modify-phases %standard-phases + (add-after 'install-license-files 'relocate-copyright + (lambda* _ + (install-file (string-append #$output + "/lib/firmware/BCM-LEGAL.txt") + (string-append #$output + "/share/doc/bluez-firmware-" + #$(package-version bluez-firmware) + "/BCM-LEGAL.txt"))))))) + (synopsis "Firmware for Broadcom BCM203x and STLC2300 Bluetooth chips") + (description "This package provides firmware for Broadcom BCM203x +and STLC2300 Bluetooth chips.") + (home-page "https://github.com/RPi-Distro/bluez-firmware") + (license (list guix-license:gpl2+ + (nonfree + "file:///share/doc/bluez-firmware-1.2/BCM-LEGAL.txt"))))) diff --git a/nongnu/packages/fonts.scm b/nongnu/packages/fonts.scm index 7120fef..b0689bb 100644 --- a/nongnu/packages/fonts.scm +++ b/nongnu/packages/fonts.scm @@ -1,25 +1,11 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2021 Korytov Pavel <thexcloud@gmail.com> ;;; Copyright © 2021 Jonathan Brielmaier <jonathan.brielmaier@web.de> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (nongnu packages fonts) #:use-module (ice-9 string-fun) #:use-module (gnu packages compression) + #:use-module (guix deprecation) #:use-module (guix download) #:use-module (guix packages) #:use-module (guix build-system font) @@ -90,13 +76,16 @@ font from the pack of Microsoft core fonts for the web.")) #:font-name "Comic Sans MS" #:hash "0ki0rljjc1pxkbsxg515fwx15yc95bdyaksa3pjd89nyxzzg6vcw")) -(define-public font-microsoft-couirer-new +(define-public font-microsoft-courier-new (mscorefont "courie32" #:version "2.82" #:font-name "Courier New" #:hash "111k3waxki9yyxpjwl2qrdkswvsd2dmvhbjmmrwyipam2s31sldv")) +(define-public font-microsoft-couirer-new + (deprecated-package "font-microsoft-couirer-new" font-microsoft-courier-new)) + (define-public font-microsoft-georgia (mscorefont "georgi32" diff --git a/nongnu/packages/game-development.scm b/nongnu/packages/game-development.scm index 0974af5..566cea2 100644 --- a/nongnu/packages/game-development.scm +++ b/nongnu/packages/game-development.scm @@ -1,20 +1,6 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019, 2020 Pierre Neidhardt <mail@ambrevar.xyz> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +;;; Copyright © 2022 Attila Lendvai <attila@lendvai.name> (define-module (nongnu packages game-development) #:use-module (ice-9 match) @@ -147,12 +133,10 @@ development should opt for GLSL rather than Cg.") (supported-systems '("i686-linux" "x86_64-linux")) (arguments `(#:system "i686-linux" - #:validate-runpath? #f ; TODO: Why doesn't it pass? #:patchelf-plan - `(("libsteam_api.so" - ("gcc:lib"))) + `(("libsteam_api.so" ("gcc" "glibc"))) #:install-plan - `(("." ("steam") "lib/")) + `(("libsteam_api.so" "lib/")) #:phases (modify-phases %standard-phases (replace 'unpack @@ -167,7 +151,7 @@ development should opt for GLSL rather than Cg.") (string-append out "/lib/libsteam_api.so.1"))) #t))))) (inputs - `(("gcc:lib" ,gcc "lib"))) + (list (list gcc "lib") glibc)) (home-page "https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted") (synopsis "Redistribution binary needed by some video games") (description "") diff --git a/nongnu/packages/gog.scm b/nongnu/packages/gog.scm index 88a8a84..76ff569 100644 --- a/nongnu/packages/gog.scm +++ b/nongnu/packages/gog.scm @@ -1,18 +1,6 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com> -;;; Copyright © 2021 Timotej Lazar <timotej.lazar@araneo.si> -;;; -;;; This program is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see <https://www.gnu.org/licenses/>. +;;; Copyright © 2021-2022 Timotej Lazar <timotej.lazar@araneo.si> (define-module (nongnu packages gog) #:use-module (gnu packages boost) @@ -27,13 +15,13 @@ #:use-module (gnu packages xml) #:use-module (guix packages) #:use-module (guix git-download) - #:use-module (guix build-system cmake) + #:use-module (guix build-system qt) #:use-module ((guix licenses) #:prefix license:)) (define-public lgogdownloader (package (name "lgogdownloader") - (version "3.7") + (version "3.9") (source (origin (method git-fetch) @@ -42,27 +30,27 @@ (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "02zn4zc9hqym81vbs88x5ayk2xb808jlvfyvn96ksx1ai4b6a4fz")))) - (build-system cmake-build-system) + (base32 "1hbwgwdm1vn7lkz366q9q8f44sk1pvhgjffndwx49lh3md66xps2")))) + (build-system qt-build-system) (arguments `(#:configure-flags '("-DUSE_QT_GUI=ON") #:tests? #f)) ; no tests (inputs - `(("boost" ,boost) - ("curl" ,curl) - ("htmlcxx" ,htmlcxx) - ("jsoncpp" ,jsoncpp) - ("liboauth" ,liboauth) - ("qtbase" ,qtbase-5) - ("qtdeclarative" ,qtdeclarative) - ("qtwebchannel" ,qtwebchannel) - ("qtwebengine" ,qtwebengine) - ("rhash" ,rhash) - ("tinyxml2" ,tinyxml2) - ("zlib" ,zlib))) + (list boost + curl + htmlcxx + jsoncpp + liboauth + qtbase-5 + qtdeclarative-5 + qtwebchannel-5 + qtwebengine-5 + rhash + tinyxml2 + zlib)) (native-inputs - `(("help2man" ,help2man) - ("pkg-config" ,pkg-config))) + (list help2man + pkg-config)) (home-page "https://sites.google.com/site/gogdownloader/") (synopsis "Downloader for GOG.com files") (description "LGOGDownloader is a client for the GOG.com download API, diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm index 106786b..ba16623 100644 --- a/nongnu/packages/linux.scm +++ b/nongnu/packages/linux.scm @@ -1,24 +1,25 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com> ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz> ;;; Copyright © 2019 Giacomo Leidi <goodoldpaul@autistici.org> ;;; Copyright © 2019 Timotej Lazar <timotej.lazar@araneo.si> ;;; Copyright © 2020, 2021 James Smith <jsubuntuxp@disroot.org> -;;; Copyright © 2020, 2021 Jonathan Brielmaier <jonathan.brielmaier@web.de> +;;; Copyright © 2020, 2021, 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de> +;;; Copyright © 2020, 2022 Michael Rohleder <mike@rohleder.de> +;;; Copyright © 2020, 2021, 2022 Tobias Geerinckx-Rice <me@tobias.gr> +;;; Copyright © 2020, 2021, 2022 Zhu Zihao <all_but_last@163.com> ;;; Copyright © 2021 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re> -;;; -;;; This program is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see <https://www.gnu.org/licenses/>. +;;; Copyright © 2021 Risto Stevcev <me@risto.codes> +;;; Copyright © 2021 aerique <aerique@xs4all.nl> +;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz> +;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com> +;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com> +;;; Copyright © 2022 Remco van 't Veer <remco@remworks.net> +;;; Copyright © 2022 Simen Endsjø <simendsjo@gmail.com> +;;; Copyright © 2022 Leo Famulari <leo@famulari.name> +;;; Copyright © 2023 Morgan Smith <Morgan.J.Smith@outlook.com> +;;; Copyright © 2023 Jelle Licht <jlicht@fsfe.org> (define-module (nongnu packages linux) #:use-module (gnu packages) @@ -29,6 +30,7 @@ #:use-module (guix packages) #:use-module (guix utils) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) @@ -36,72 +38,101 @@ #:use-module (guix build-system trivial) #:use-module (ice-9 match) #:use-module (nonguix licenses) + #:use-module (srfi srfi-1) #:export (corrupt-linux)) -(define (linux-urls version) - "Return a list of URLS for Linux VERSION." - (list (string-append "https://www.kernel.org/pub/linux/kernel/v" - (version-major version) ".x/linux-" version ".tar.xz"))) - -(define (corrupt-linux freedo version hash) - (package - (inherit freedo) - (name "linux") - (version version) - (source (origin - (method url-fetch) - (uri (linux-urls version)) - (sha256 (base32 hash)))) - (home-page "https://www.kernel.org/") - (synopsis "Linux kernel with nonfree binary blobs included") - (description - "The unmodified Linux kernel, including nonfree blobs, for running Guix -System on hardware which requires nonfree software to function."))) - -(define-public linux-5.14 - (corrupt-linux linux-libre-5.14 "5.14.14" - "0snh17ah49wmfmazy6x42rhvl484h657y0iq4l09a885sjb4xzsd")) +(define (linux-url version) + "Return a URL for Linux VERSION." + (string-append "mirror://kernel.org" + "/linux/kernel/v" (version-major version) ".x" + "/linux-" version ".tar.xz")) + +(define* (corrupt-linux freedo #:key (name "linux") (configs '())) + + ;; TODO: This very directly depends on guix internals. + ;; Throw it all out when we manage kernel hashes. + (define gexp-inputs (@@ (guix gexp) gexp-inputs)) + + (define extract-gexp-inputs + (compose gexp-inputs force origin-uri)) + + (define (find-source-hash sources url) + (let ((versioned-origin + (find (lambda (source) + (let ((uri (origin-uri source))) + (and (string? uri) (string=? uri url)))) sources))) + (if versioned-origin + (origin-hash versioned-origin) + #f))) + + (let* ((version (package-version freedo)) + (url (linux-url version)) + (pristine-source (package-source freedo)) + (inputs (map gexp-input-thing (extract-gexp-inputs pristine-source))) + (sources (filter origin? inputs)) + (hash (find-source-hash sources url))) + (package + (inherit + (customize-linux + #:name name + #:source (origin + (method url-fetch) + (uri url) + (hash hash)) + #:configs configs)) + (version version) + (home-page "https://www.kernel.org/") + (synopsis "Linux kernel with nonfree binary blobs included") + (description + "The unmodified Linux kernel, including nonfree blobs, for running Guix System +on hardware which requires nonfree software to function.")))) + +(define-public linux-6.2 + (corrupt-linux linux-libre-6.2)) + +(define-public linux-6.1 + (corrupt-linux linux-libre-6.1)) + +(define-public linux-5.15 + (corrupt-linux linux-libre-5.15)) (define-public linux-5.10 - (corrupt-linux linux-libre-5.10 "5.10.75" - "0jrhhk89587caw54nhnwms93kq33qdm75x5f18cp61xrxxgjyaqa")) + (corrupt-linux linux-libre-5.10)) (define-public linux-5.4 - (corrupt-linux linux-libre-5.4 "5.4.145" - "1yb8vk5sbnyswylkpqw5i4n9cmnmlrfmbrnmy3nif579q8p7ixsw")) + (corrupt-linux linux-libre-5.4)) (define-public linux-4.19 - (corrupt-linux linux-libre-4.19 "4.19.206" - "1h44lvzxd0cngj71bk8qba9dz7jlqj68ir6xjwfafglb81ppgsxp")) + (corrupt-linux linux-libre-4.19)) (define-public linux-4.14 - (corrupt-linux linux-libre-4.14 "4.14.246" - "0fpgig84shpas1jc0h4s3aw9brkcq1as84gjbk4bfhc48bpi4mlw")) + (corrupt-linux linux-libre-4.14)) + +(define-public linux linux-6.2) +;; linux-lts points to the *newest* released long-term support version. +(define-public linux-lts linux-5.15) -(define-public linux-4.9 - (corrupt-linux linux-libre-4.9 "4.9.282" - "059fin4si93ya13xy831w84q496ksxidpd3kyw38918sfy4p6wk7")) +(define-public linux-arm64-generic-6.0 + (corrupt-linux linux-libre-arm64-generic #:name "linux-arm64-generic")) -(define-public linux-4.4 - (corrupt-linux linux-libre-4.4 "4.4.283" - "1d9v4h4cbc4i371lhhwpxbmg88gna6xyi2ahfvv0clz60802y982")) +(define-public linux-arm64-generic-5.15 + (corrupt-linux linux-libre-arm64-generic #:name "linux-arm64-generic")) -(define-public linux linux-5.14) -;; linux-lts points to the *newest* released long-term support version. -(define-public linux-lts linux-5.10) +(define-public linux-arm64-generic linux-arm64-generic-6.0) + +(define-public linux-arm64-generic-lts linux-arm64-generic-5.15) (define-public linux-firmware (package (name "linux-firmware") - (version "20210919") + (version "20230310") (source (origin (method url-fetch) - (uri (string-append "https://git.kernel.org/pub/scm/linux/kernel" - "/git/firmware/linux-firmware.git/snapshot/" - "linux-firmware-" version ".tar.gz")) + (uri (string-append "mirror://kernel.org/linux/kernel/firmware/" + "linux-firmware-" version ".tar.xz")) (sha256 (base32 - "1fy6alg7pz5bc09vq0icmgbwqpribws6nyc6k2pkip8jljmxvlr0")))) + "1clrh5bkfd8ifjmfwj3sbkr8ihh28sx6phs17jnyr8cc2zjx8s2r")))) (build-system gnu-build-system) (arguments `(#:tests? #f @@ -171,16 +202,30 @@ advanced 3D."))) (define-public raspberrypi-firmware (package (name "raspberrypi-firmware") - (version "1.20210527") + (version "1.20220331") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/raspberrypi/firmware") (commit version))) + (modules '((guix build utils) + (ice-9 ftw) + (srfi srfi-26))) + (snippet + '(begin + (for-each (lambda (name) + (delete-file-recursively name)) + `("documentation" "extra" ".github" "hardfp" "modules" "opt" "README.md" + ,@(map (lambda (name) + (string-append "boot/" name)) + (scandir "boot" (cut (file-name-predicate "^(kernel.*|COPYING\\.linux)$") <> #f))))))) (file-name (git-file-name name version)) (sha256 (base32 - "08lgg90k6lhqm3ccg7db0lrrng0pgf63dvbrxpfpwm1pswrc5vf5")))) + "1hd1vkghkgdlmw04fap28f68nsf7d7i8dq6h9r4xa0h9y4f6j6ag")))) + (arguments + '(#:install-plan + '(("boot/" ".")))) (build-system copy-build-system) (synopsis "Firmware for the Raspberry Pi boards") (description "Pre-compiled binaries of the current Raspberry Pi kernel @@ -412,6 +457,26 @@ support for 5GHz and 802.11ac, among others.") "https://git.kernel.org/pub/scm/linux/kernel/git/firmware" "/linux-firmware.git/plain/LICENCE.iwlwifi_firmware"))))) +(define-public i915-firmware + (package + (inherit linux-firmware) + (name "i915-firmware") + (arguments + `(#:license-file-regexp "LICENCE.i915" + ,@(substitute-keyword-arguments (package-arguments linux-firmware) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'select-firmware + ,(select-firmware "^i915/"))))))) + (home-page "https://01.org/linuxgraphics/gfx-docs/drm/gpu/i915.html") + (synopsis "Nonfree firmware for Intel integrated graphics") + (description "This package contains the various firmware for Intel +integrated graphics chipsets, including GuC, HuC and DMC.") + (license + (nonfree (string-append + "https://git.kernel.org/pub/scm/linux/kernel/git/firmware" + "/linux-firmware.git/plain/LICENCE.i915"))))) + (define-public realtek-firmware (package (inherit linux-firmware) @@ -422,7 +487,8 @@ support for 5GHz and 802.11ac, among others.") ((#:phases phases) `(modify-phases ,phases (add-after 'unpack 'select-firmware - ,(select-firmware "^(rtlwifi|rtl_nic|rtl_bt)/"))))))) + ,(select-firmware + "^(rtlwifi|rtl_nic|rtl_bt|rtw88|rtw89)/"))))))) (home-page "https://wireless.wiki.kernel.org/en/users/drivers/rtl819x") (synopsis "Nonfree firmware for Realtek ethernet, wifi, and bluetooth chips") (description @@ -512,8 +578,8 @@ package contains nonfree firmware for the following chips: (deprecated-package "rtl-bt-firmware" realtek-firmware)) (define-public rtl8192eu-linux-module - (let ((commit "cdf1b06b7bff49042f42d0294610d3f3780ee62b") - (revision "1")) + (let ((commit "865656c3a1d1aee8c4ba459ce7608756d17c712f") + (revision "5")) (package (name "rtl8192eu-linux-module") (version (git-version "0.0.0" revision commit)) @@ -526,7 +592,7 @@ package contains nonfree firmware for the following chips: (file-name (git-file-name name version)) (sha256 (base32 - "1afscxmjmapvm8hcd0blp1fn5lxg92rhpiqkgj89x53shfsp12d6")))) + "08nq0wlrpzm8n2g14c4jlxs0crr6s5ls1n14bc17zmpy9vlarhfx")))) (build-system linux-module-build-system) (arguments `(#:make-flags @@ -544,8 +610,122 @@ package contains nonfree firmware for the following chips: (synopsis "Linux driver for Realtek RTL8192EU wireless network adapters") (description "This is Realtek's RTL8192EU Linux driver for wireless network adapters.") + ;; Rejected by Guix beause it contains a binary blob in: + ;; hal/rtl8192e/hal8192e_fw.c (license gpl2)))) +(define-public rtl8821ce-linux-module + (let ((commit "538c34671b391340e0ae23ff11bde77b6588496c") + (revision "9")) + (package + (name "rtl8821ce-linux-module") + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/tomaspinho/rtl8821ce") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0p7xj032bp3h6wp27dhf2j42bgd4gvpk7w95n830awbj07c04dss")))) + (build-system linux-module-build-system) + (arguments + (list #:make-flags + #~(list (string-append "CC=" #$(cc-for-target)) + (string-append "KSRC=" + (assoc-ref %build-inputs + "linux-module-builder") + "/lib/modules/build")) + #:phases + #~(modify-phases %standard-phases + (replace 'build + (lambda* (#:key (make-flags '()) (parallel-build? #t) + #:allow-other-keys) + (apply invoke "make" + `(,@(if parallel-build? + `("-j" ,(number->string (parallel-job-count))) + '()) + ,@make-flags))))) + #:tests? #f)) ; no test suite + (home-page "https://github.com/tomaspinho/rtl8821ce") + (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters") + (description "This is Realtek's RTL8821CE Linux driver for wireless +network adapters.") + ;; Rejected by Guix beause it contains a binary blob in: + ;; hal/rtl8821c/hal8821c_fw.c + (license gpl2)))) + +(define-public rtl8812au-aircrack-ng-linux-module + (let ((commit "08589e2f8c18d4de18a28d92c74d0a2191bb86b9") + (revision "10")) + (package + (inherit rtl8821ce-linux-module) + (name "rtl8812au-aircrack-ng-linux-module") + (version (git-version "5.6.4.2" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/aircrack-ng/rtl8812au") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "07yiya5ckm578pwxdm5nnyq45vnw4zjbd31a5365l9cwbpfji67s")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Remove bundled tarballs, APKs, word lists, speadsheets, + ;; and other unnecessary unlicenced things. + (for-each delete-file-recursively (list "android" + "docs" + "tools")))))) + (supported-systems '("x86_64-linux" "i686-linux")) + (home-page "https://github.com/aircrack-ng/rtl8812au") + (synopsis "Linux driver for Realtek USB wireless network adapters") + (description + "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless +network adapters, modified by the aircrack-ng project to support monitor mode +and frame injection. It provides a @code{88XXau} kernel module that supports +RTL8812AU, RTL8821AU, and RTL8814AU chips.") + ;; Rejected by Guix beause it contains a binary blob in: + ;; hal/rtl8812a/hal8812a_fw.c + (license gpl2+)))) + +(define-public r8168-linux-module + (package + (name "r8168-linux-module") + (version "8.051.02") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mtorromeo/r8168") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "16mpr0np6xbmzdnwg4p3q6yli2gh032k98g4vplya33hrn50vh52")))) + (arguments + (list #:tests? #f + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'enter-src-directory + (lambda _ + (chdir "src"))) + ;; Needed to compile module for linux >= 6.1 + (add-before 'build 'fix-build + (lambda _ + (substitute* "r8168.h" + (("netif_napi_add\\(ndev, &priv->napi, function, weight\\)") + "netif_napi_add(ndev, &priv->napi, function)"))))))) + (build-system linux-module-build-system) + (home-page "https://github.com/mtorromeo/r8168") + (synopsis "Linux driver for Realtek PCIe network adapters") + (description + "Linux driver for Realtek PCIe network adapters. If the r8169 kernel module is +giving you trouble, you can try this module.") + (license gpl2))) + (define broadcom-sta-version "6.30.223.271") (define broadcom-sta-x86_64-source @@ -598,25 +778,15 @@ network adapters.") (package (name "broadcom-sta") (version broadcom-sta-version) - (source #f) + (source + (match (or (%current-target-system) (%current-system)) + ("x86_64-linux" broadcom-sta-x86_64-source) + (_ broadcom-sta-i686-source))) (build-system linux-module-build-system) (arguments - `(#:linux ,linux - #:tests? #f - #:phases - (modify-phases %standard-phases - (replace 'unpack - (lambda* (#:key inputs #:allow-other-keys) - (let ((source (assoc-ref inputs "broadcom-sta-source"))) - (invoke "tar" "xf" source) - (chdir ((@@ (guix build gnu-build-system) first-subdirectory) ".")) - #t)))))) + `(#:linux ,linux-lts + #:tests? #f)) (supported-systems '("i686-linux" "x86_64-linux")) - (native-inputs - `(("broadcom-sta-source" - ,(match (or (%current-target-system) (%current-system)) - ("x86_64-linux" broadcom-sta-x86_64-source) - (_ broadcom-sta-i686-source))))) (home-page "https://www.broadcom.com/support/802.11") (synopsis "Broadcom 802.11 Linux STA wireless driver") (description "This package contains Broadcom's IEEE 802.11a/b/g/n/ac hybrid @@ -659,9 +829,7 @@ releases.") "1b1qjwxjk4y91l3iz157kms8601n0mmiik32cs6w9b1q4sl4pxx9")))) (build-system trivial-build-system) (arguments - `(#:modules ((guix build utils) - (ice-9 rdelim) - (ice-9 regex)) + `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils) @@ -738,7 +906,7 @@ chipsets from Broadcom: (define-public intel-microcode (package (name "intel-microcode") - (version "20210608") + (version "20230214") (source (origin (method git-fetch) @@ -749,7 +917,7 @@ chipsets from Broadcom: (commit (string-append "microcode-" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "08nk353z2lcqsjbm2qdsfapfgrvlfw0rj7r9scr9pllzkjj5n9x3")))) + (base32 "047m1c7bap19cqxpqy2xlzngn8i8jfk44ffbkmkhw4nfrval81sb")))) (build-system copy-build-system) (arguments `(#:install-plan @@ -791,46 +959,24 @@ documented in the respective processor revision guides.") (define-public sof-firmware (package (name "sof-firmware") - (version "1.6.1") + (version "2.2.3") (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/thesofproject/sof-bin") - (commit (string-append "stable-v" version)))) - (file-name (git-file-name name version)) + (method url-fetch) + (uri (string-append "https://github.com/thesofproject/sof-bin/releases/download/v" + version "/sof-bin-v" version ".tar.gz")) (sha256 - (base32 "1zg5fki8skmmx84p4ws8x2m13bm13fb3kvlhz7zsnmdg6ra06az6")))) + (base32 + "0hnvzbjgib8f0m2gw345vk0p4h9ba34g7vciih1jgcz2y5kgs7sr")))) (build-system copy-build-system) (arguments `(#:install-plan - (let* ((base - (string-append "lib/firmware/intel/sof/v" ,version)) - (dest "lib/firmware/intel/sof") - (tplg - (string-append "lib/firmware/intel/sof-tplg-v" ,version)) - (dest-tplg "lib/firmware/intel/sof-tplg") - (fw-file (lambda* (file #:optional subdir) - (list (string-append base "/" - (or subdir "") - file "-v" ,version ".ri") - (string-append dest "/" file ".ri")))) - (unsigned fw-file) - (intel-signed (lambda (file) - (fw-file file "intel-signed/")))) - (list (unsigned "sof-bdw") - (unsigned "sof-byt") - (unsigned "sof-cht") - (intel-signed "sof-apl") - (intel-signed "sof-cnl") - (intel-signed "sof-ehl") - (intel-signed "sof-icl") - (intel-signed "sof-tgl") - (list tplg dest-tplg))))) + (list (list (string-append "sof-v" ,version) "lib/firmware/intel/sof") + (list (string-append "sof-tplg-v" ,version) "lib/firmware/intel/sof-tplg")))) (home-page "https://www.sofproject.org") (synopsis "Sound Open Firmware") (description "This package contains Linux firmwares and topology files for -audio DSPs that can be found on the Intel Skylake architecture. Those -firmware can be built for source but need to be signed by Intel in order to be +audio DSPs that can be found on the Intel Skylake architecture. This +firmware can be built from source but need to be signed by Intel in order to be loaded by Linux.") (license bsd-3))) diff --git a/nongnu/packages/lisp.scm b/nongnu/packages/lisp.scm new file mode 100644 index 0000000..38c415a --- /dev/null +++ b/nongnu/packages/lisp.scm @@ -0,0 +1,106 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022 Pierre Neidhardt <mail@ambrevar.xyz> + +(define-module (nongnu packages lisp) + #:use-module (ice-9 match) + #:use-module (gnu packages bash) + #:use-module (gnu packages compression) + #:use-module (gnu packages tls) + #:use-module (guix build-system copy) + #:use-module (guix build-system gnu) + #:use-module (guix download) + #:use-module (guix packages) + #:use-module (nonguix build-system binary) + #:use-module ((nonguix licenses) #:prefix license:)) + +;; TODO: Split into differents outputs: +;; - emacs: for ELI. Or just remove it and use our own up-to-date package? +;; - doc: For the doc. (> 40+10 MiB). +;; - gui: For the express GUI (including all the JS stuff). +;; - out: Everything else: alisp, alisp.dxl, etc. +(define-public allegro-cl + (package + (name "allegro-cl") + (version "10.1") + (source (origin + (method url-fetch) + (uri + (let ((arch1 (match (or (%current-target-system) (%current-system)) + ("armhf-linux" "linuxarm64") + ("i686-linux" "linux86") + (s "linuxamd64.64"))) + (arch2 (match (or (%current-target-system) (%current-system)) + ("armhf-linux" "linux-aarch64") + ("i686-linux" "linux-x86") + (s "linux-x64")))) + (string-append "https://franz.com/ftp/pub/acl" + version "express/" arch1 + "/acl" version "express-" arch2 ".tbz2"))) + (sha256 + (base32 + "0ir1irpq5hhcmy0yp5p2jpnq5if1gr1fgxybqyvppx1j1jdfkcsp")))) + (build-system binary-build-system) + (inputs (list bash-minimal zlib openssl)) + (arguments + ;; FIXME: Patchelf the .so files as well? Does not seem necessary. + `(#:patchelf-plan '(("alisp") + ("allegro-express")) + #:install-plan + '(("." "share/allegro-cl/" + ;; The "eli" Emacs interface is outdated and broken. + ;; Use the Nonguix emacs-eli package instead. + #:exclude ("update.sh" "eli"))) + #:phases + (modify-phases %standard-phases + (replace 'unpack + ;; Guix does not know how to extract .tbz2. + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p "source") + (invoke "tar" + "--directory=source" "-xvf" (assoc-ref inputs "source") + "--strip-components" "1") + (chdir "source"))) + (add-after 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (zlib-lib (string-append (assoc-ref inputs "zlib") "/lib")) + (openssl-lib (string-append (assoc-ref inputs "openssl") "/lib")) + (openssl-bin (string-append (assoc-ref inputs "openssl") "/bin")) + (bash-bin (string-append (assoc-ref inputs "bash") "/bin")) + (wrapper (string-append out "/bin/allegro-express")) + (bin (string-append out "/share/allegro-cl/" + "allegro-express")) + (cli-wrapper (string-append out "/bin/alisp")) + (cli-bin (string-append out "/share/allegro-cl/" + "alisp"))) + (mkdir-p (dirname wrapper)) + (pk 'BIN bin) + (make-wrapper wrapper bin + `("LD_LIBRARY_PATH" ":" prefix + ,(list zlib-lib openssl-lib)) + `("PATH" ":" prefix + ,(list openssl-bin bash-bin))) + (make-wrapper cli-wrapper cli-bin)) + #t))))) + (native-search-paths + ;; XDG_DATA_DIRS is required to find the cl-* libraries. + (list + (search-path-specification + (variable "XDG_DATA_DIRS") + (files '("share"))))) + (synopsis "Commercial software implementation of the language Common Lisp") + (description + "This is a Lisp implementation by Franz Inc. +It includes AllegroCache, a command line based REPL as well as a web-based GUI. + +The Express Edition has a heap limitation compared to the commercial versions +of Allegro CL. + +You can run the GUI from a container, for instance: + + guix shell --container --network allegro-cl -- allegro-express + +then open a browser at http://localhost:PORT, where PORT is the indicated port.") + (home-page "https://franz.com/products/allegrocl/") + (license (license:nonfree + "https://franz.com/ftp/pub/legal/ACL-Express-20170301.pdf")))) diff --git a/nongnu/packages/messaging.scm b/nongnu/packages/messaging.scm new file mode 100644 index 0000000..7e56aff --- /dev/null +++ b/nongnu/packages/messaging.scm @@ -0,0 +1,525 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2021, 2022 PantherX OS Team <team@pantherx.org> +;;; Copyright © 2022, 2023 John Kehayias <john.kehayias@protonmail.com> +;;; Copyright © 2022 Evgenii Lepikhin <johnlepikhin@gmail.com> + +(define-module (nongnu packages messaging) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages compression) + #:use-module (gnu packages cups) + #:use-module (gnu packages databases) + #:use-module (gnu packages fontutils) + #:use-module (gnu packages gcc) + #:use-module (gnu packages gl) + #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages gtk) + #:use-module (gnu packages kerberos) + #:use-module (gnu packages linux) + #:use-module (gnu packages nss) + #:use-module (gnu packages pulseaudio) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xml) + #:use-module (gnu packages xorg) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module ((guix licenses) :prefix license:) + #:use-module (nonguix build-system binary) + #:use-module ((nonguix licenses) :prefix license:) + #:use-module (ice-9 match)) + +(define-public element-desktop + (package + (name "element-desktop") + (version "1.11.24") + (source + (origin + (method url-fetch) + (uri + (string-append + "https://packages.riot.im/debian/pool/main/e/" name "/" name "_" version + "_amd64.deb")) + (sha256 + (base32 "1bqhsimvchphjaha1vwj12xrrp8cy5bmvv1ha5nyifih8nk8k3l4")))) + (supported-systems '("x86_64-linux")) + (build-system binary-build-system) + (arguments + (list #:validate-runpath? #f ; TODO: fails on wrapped binary and included other files + #:patchelf-plan + #~'(("lib/Element/element-desktop" + ("alsa-lib" "at-spi2-atk" "at-spi2-core" "atk" "cairo" "cups" + "dbus" "expat" "fontconfig-minimal" "gcc" "gdk-pixbuf" "glib" + "gtk+" "libdrm" "libnotify" "libsecret" "libx11" "libxcb" + "libxcomposite" "libxcursor" "libxdamage" "libxext" "libxfixes" + "libxi" "libxkbcommon" "libxkbfile" "libxrandr" "libxrender" + "libxtst" "mesa" "nspr" "pango" "zlib"))) + #:phases + #~(modify-phases %standard-phases + (replace 'unpack + (lambda _ + (invoke "ar" "x" #$source) + (invoke "tar" "xvf" "data.tar.xz") + (copy-recursively "usr/" ".") + ;; Use the more standard lib directory for everything. + (rename-file "opt/" "lib") + ;; Remove unneeded files. + (delete-file-recursively "usr") + (delete-file "control.tar.gz") + (delete-file "data.tar.xz") + (delete-file "debian-binary") + ;; Fix the .desktop file binary location. + (substitute* '("share/applications/element-desktop.desktop") + (("/opt/Element/") + (string-append #$output "/lib/Element/"))))) + (add-after 'install 'symlink-binary-file-and-cleanup + (lambda _ + (delete-file (string-append #$output "/environment-variables")) + (mkdir-p (string-append #$output "/bin")) + (symlink (string-append #$output "/lib/Element/element-desktop") + (string-append #$output "/bin/element-desktop")))) + (add-after 'install 'wrap-where-patchelf-does-not-work + (lambda _ + (wrap-program (string-append #$output "/lib/Element/element-desktop") + `("FONTCONFIG_PATH" ":" prefix + (,(string-join + (list + (string-append #$(this-package-input "fontconfig-minimal") "/etc/fonts") + #$output) + ":"))) + `("LD_LIBRARY_PATH" ":" prefix + (,(string-join + (list + (string-append #$(this-package-input "nss") "/lib/nss") + (string-append #$(this-package-input "eudev") "/lib") + (string-append #$(this-package-input "gcc") "/lib") + (string-append #$(this-package-input "mesa") "/lib") + (string-append #$(this-package-input "libxkbfile") "/lib") + (string-append #$(this-package-input "zlib") "/lib") + (string-append #$(this-package-input "libsecret") "/lib") + (string-append #$(this-package-input "sqlcipher") "/lib") + (string-append #$(this-package-input "libnotify") "/lib") + (string-append #$output "/lib/Element") + #$output) + ":"))))))))) + (native-inputs (list tar)) + (inputs + (list alsa-lib + at-spi2-atk + at-spi2-core + atk + cairo + cups + dbus + eudev + expat + fontconfig + `(,gcc "lib") + glib + gtk+ + libdrm + libnotify + librsvg + libsecret + libx11 + libxcb + libxcomposite + libxcursor + libxdamage + libxext + libxfixes + libxi + libxkbcommon + libxkbfile + libxrandr + libxrender + libxtst + mesa + nspr + nss + pango + sqlcipher + zlib)) + (home-page "https://github.com/vector-im/element-desktop") + (synopsis "Matrix collaboration client for desktop") + (description "Element Desktop is a Matrix client for desktop with Element Web at +its core.") + ;; not working? + (properties + '((release-monitoring-url . "https://github.com/vector-im/element-desktop/releases"))) + (license license:asl2.0))) + +(define-public signal-desktop + (package + (name "signal-desktop") + (version "6.9.0") + (source + (origin + (method url-fetch) + (uri + (string-append + "https://updates.signal.org/desktop/apt/pool/main/s/" name "/" name "_" version + "_amd64.deb")) + (sha256 + (base32 "0a44ykrq9k8s1dz756hqimhsyijxjf4ck19ab945mg8bvwb0c0an")))) + (supported-systems '("x86_64-linux")) + (build-system binary-build-system) + (arguments + (list #:validate-runpath? #f ; TODO: fails on wrapped binary and included other files + #:patchelf-plan + #~'(("lib/Signal/signal-desktop" + ("alsa-lib" "at-spi2-atk" "at-spi2-core" "atk" "cairo" "cups" + "dbus" "expat" "fontconfig-minimal" "gcc" "gdk-pixbuf" "glib" + "gtk+" "libdrm" "libsecret" "libx11" "libxcb" "libxcomposite" + "libxcursor" "libxdamage" "libxext" "libxfixes" "libxi" + "libxkbcommon" "libxkbfile" "libxrandr" "libxshmfence" "libxtst" + "mesa" "nspr" "pango" "pulseaudio" "zlib"))) + #:phases + #~(modify-phases %standard-phases + (replace 'unpack + (lambda _ + (invoke "ar" "x" #$source) + (invoke "tar" "xvf" "data.tar.xz") + (copy-recursively "usr/" ".") + ;; Use the more standard lib directory for everything. + (rename-file "opt/" "lib") + ;; Remove unneeded files. + (delete-file-recursively "usr") + (delete-file "control.tar.gz") + (delete-file "data.tar.xz") + (delete-file "debian-binary") + (delete-file "environment-variables") + ;; Fix the .desktop file binary location. + (substitute* '("share/applications/signal-desktop.desktop") + (("/opt/Signal/") + (string-append #$output "/lib/Signal/"))))) + (add-after 'install 'symlink-binary-file-and-cleanup + (lambda _ + (delete-file (string-append #$output "/environment-variables")) + (mkdir-p (string-append #$output "/bin")) + (symlink (string-append #$output "/lib/Signal/signal-desktop") + (string-append #$output "/bin/signal-desktop")))) + (add-after 'install 'wrap-where-patchelf-does-not-work + (lambda _ + (wrap-program (string-append #$output "/lib/Signal/signal-desktop") + `("FONTCONFIG_PATH" ":" prefix + (,(string-join + (list + (string-append #$(this-package-input "fontconfig-minimal") "/etc/fonts") + #$output) + ":"))) + `("LD_LIBRARY_PATH" ":" prefix + (,(string-join + (list + (string-append #$(this-package-input "nss") "/lib/nss") + (string-append #$(this-package-input "eudev") "/lib") + (string-append #$(this-package-input "gcc") "/lib") + (string-append #$(this-package-input "mesa") "/lib") + (string-append #$(this-package-input "libxkbfile") "/lib") + (string-append #$(this-package-input "pulseaudio") "/lib") + (string-append #$(this-package-input "zlib") "/lib") + (string-append #$(this-package-input "libsecret") "/lib") + (string-append #$output "/lib/Signal") + #$output) + ":"))))))))) + (native-inputs (list tar)) + (inputs (list alsa-lib + at-spi2-atk + at-spi2-core + atk + cairo + cups + dbus + eudev + expat + fontconfig + `(,gcc "lib") + glib + gtk+ + libdrm + librsvg + libsecret + libx11 + libxcb + libxcomposite + libxdamage + libxext + libxfixes + libxkbcommon + libxkbfile + libxrandr + libxshmfence + mesa + nspr + nss + pango + pulseaudio + zlib)) + (home-page "https://signal.org/") + (synopsis "Private messenger using the Signal protocol") + (description "Signal Desktop is an Electron application that links with Signal on Android +or iOS.") + ;; doesn't work? + (properties + '((release-monitoring-url . "https://github.com/signalapp/Signal-Desktop/releases"))) + (license license:agpl3))) + +(define-public zoom + (package + (name "zoom") + (version "5.13.11.1288") + (source + (origin + (method url-fetch) + (uri (string-append "https://cdn.zoom.us/prod/" version "/zoom_x86_64.tar.xz")) + (file-name (string-append name "-" version "-x86_64.tar.xz")) + (sha256 + (base32 "1ngj15j9d7i0z4d0wraziyv75whp0digh8rg1jzfmi0ws3ir2d6b")))) + (supported-systems '("x86_64-linux")) + (build-system binary-build-system) + (arguments + (list #:validate-runpath? #f ; TODO: fails on wrapped binary and included other files + #:patchelf-plan + ;; Note: it seems like some (all?) of these only do anything in + ;; LD_LIBRARY_PATH, or at least needed there as well. + #~(let ((libs '("alsa-lib" + "at-spi2-atk" + "at-spi2-core" + "atk" + "cairo" + "cups" + "dbus" + "eudev" + "expat" + "fontconfig-minimal" + "gcc" + "glib" + "gtk+" + "libdrm" + "libx11" + "libxcb" + "libxcomposite" + "libxcursor" + "libxdamage" + "libxext" + "libxfixes" + "libxi" + "libxkbcommon" + "libxkbfile" + "libxrandr" + "libxshmfence" + "libxtst" + "mesa" + "nspr" + "pango" + "pulseaudio" + "xcb-util-image" + "xcb-util-keysyms" + "zlib"))) + `(("lib/zoom/ZoomLauncher" + ,libs) + ("lib/zoom/zoom" + ,libs) + ("lib/zoom/zopen" + ,libs) + ("lib/zoom/aomhost" + ,libs))) + #:phases + #~(modify-phases %standard-phases + (replace 'unpack + (lambda _ + (invoke "tar" "xvf" #$source) + ;; Use the more standard lib directory for everything. + (mkdir-p "lib") + (rename-file "zoom/" "lib/zoom"))) + (add-after 'install 'wrap-where-patchelf-does-not-work + (lambda _ + (wrap-program (string-append #$output "/lib/zoom/zopen") + `("LD_LIBRARY_PATH" prefix + ,(list #$@(map (lambda (pkg) + (file-append (this-package-input pkg) "/lib")) + '("fontconfig-minimal" + "freetype" + "gcc" + "glib" + "libxcomposite" + "libxdamage" + "libxkbcommon" + "libxkbfile" + "libxrandr" + "libxrender" + "zlib"))))) + (wrap-program (string-append #$output "/lib/zoom/zoom") + `("FONTCONFIG_PATH" ":" prefix + (,(string-join + (list + (string-append #$(this-package-input "fontconfig-minimal") "/etc/fonts") + #$output) + ":"))) + `("LD_LIBRARY_PATH" prefix + ,(list (string-append #$(this-package-input "nss") "/lib/nss") + #$@(map (lambda (pkg) + (file-append (this-package-input pkg) "/lib")) + ;; TODO: Reuse this long list as it is + ;; needed for aomhost. Or perhaps + ;; aomhost has a shorter needed list, + ;; but untested. + '("alsa-lib" + "atk" + "at-spi2-atk" + "at-spi2-core" + "cairo" + "cups" + "dbus" + "eudev" + "expat" + "gcc" + "glib" + "mesa" + "mit-krb5" + "nspr" + "libxcb" + "libxcomposite" + "libxdamage" + "libxext" + "libxkbcommon" + "libxkbfile" + "libxrandr" + "libxshmfence" + "pango" + "pulseaudio" + "xcb-util" + "xcb-util-wm" + "xcb-util-renderutil" + "zlib"))))) + (wrap-program (string-append #$output "/lib/zoom/aomhost") + `("FONTCONFIG_PATH" ":" prefix + (,(string-join + (list + (string-append #$(this-package-input "fontconfig-minimal") "/etc/fonts") + #$output) + ":"))) + `("LD_LIBRARY_PATH" prefix + ,(list (string-append #$(this-package-input "nss") "/lib/nss") + #$@(map (lambda (pkg) + (file-append (this-package-input pkg) "/lib")) + '("alsa-lib" + "atk" + "at-spi2-atk" + "at-spi2-core" + "cairo" + "cups" + "dbus" + "eudev" + "expat" + "gcc" + "glib" + "mesa" + "mit-krb5" + "nspr" + "libxcb" + "libxcomposite" + "libxdamage" + "libxext" + "libxkbcommon" + "libxkbfile" + "libxrandr" + "libxshmfence" + "pango" + "pulseaudio" + "xcb-util" + "xcb-util-wm" + "xcb-util-renderutil" + "zlib"))))))) + (add-after 'wrap-where-patchelf-does-not-work 'rename-binary + ;; IPC (for single sign-on and handling links) fails if the + ;; name does not end in "zoom," so rename the real binary. + ;; Thanks to the Nix packagers for figuring this out. + (lambda _ + (rename-file (string-append #$output "/lib/zoom/.zoom-real") + (string-append #$output "/lib/zoom/.zoom")) + (substitute* (string-append #$output "/lib/zoom/zoom") + (("zoom-real") + "zoom")))) + (add-after 'rename-binary 'symlink-binaries + (lambda _ + (delete-file (string-append #$output "/environment-variables")) + (mkdir-p (string-append #$output "/bin")) + (symlink (string-append #$output "/lib/zoom/aomhost") + (string-append #$output "/bin/aomhost")) + (symlink (string-append #$output "/lib/zoom/zoom") + (string-append #$output "/bin/zoom")) + (symlink (string-append #$output "/lib/zoom/zopen") + (string-append #$output "/bin/zopen")) + (symlink (string-append #$output "/lib/zoom/ZoomLauncher") + (string-append #$output "/bin/ZoomLauncher")))) + (add-after 'symlink-binaries 'create-desktop-file + (lambda _ + (let ((apps (string-append #$output "/share/applications"))) + (mkdir-p apps) + (make-desktop-entry-file + (string-append apps "/zoom.desktop") + #:name "Zoom" + #:generic-name "Zoom Client for Linux" + #:exec (string-append #$output "/bin/ZoomLauncher %U") + #:mime-type (list + "x-scheme-handler/zoommtg" + "x-scheme-handler/zoomus" + "x-scheme-handler/tel" + "x-scheme-handler/callto" + "x-scheme-handler/zoomphonecall" + "application/x-zoom") + #:categories '("Network" "InstantMessaging" + "VideoConference" "Telephony") + #:startup-w-m-class "zoom" + #:comment + '(("en" "Zoom Video Conference") + (#f "Zoom Video Conference"))))))))) + (native-inputs (list tar)) + (inputs (list alsa-lib + at-spi2-atk + at-spi2-core + atk + bash-minimal + cairo + cups + dbus + eudev + expat + fontconfig + freetype + `(,gcc "lib") + glib + gtk+ + libdrm + librsvg + libx11 + libxcb + libxcomposite + libxdamage + libxext + libxfixes + libxkbcommon + libxkbfile + libxrandr + libxrender + libxshmfence + mesa + mit-krb5 + nspr + nss + pango + pulseaudio + xcb-util + xcb-util-image + xcb-util-keysyms + xcb-util-renderutil + xcb-util-wm + zlib)) + (home-page "https://zoom.us/") + (synopsis "Video conference client") + (description "The Zoom video conferencing and messaging client. Zoom must be run via an +app launcher to use its .desktop file, or with @code{ZoomLauncher}.") + (license (license:nonfree "https://explore.zoom.us/en/terms/")))) diff --git a/nongnu/packages/mozilla.scm b/nongnu/packages/mozilla.scm index 6d090f1..1dffc26 100644 --- a/nongnu/packages/mozilla.scm +++ b/nongnu/packages/mozilla.scm @@ -1,39 +1,25 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> -;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org> +;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com> ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2017, 2018 Nikita <nikita@n0.is> -;;; Copyright (C) 2017, 2018 ng0 <gillmann@infotropique.org> +;;; Copyright © 2017, 2018 ng0 <gillmann@infotropique.org> ;;; Copyright © 2017, 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr> -;;; Copyright © 2018, 2020 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2018, 2020, 2022 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2019 Ivan Petkov <ivanppetkov@gmail.com> ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com> ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> ;;; Copyright © 2019, 2020 Adrian Malacoda <malacoda@monarch-pass.net> -;;; Copyright (C) 2019, 2020 Adrian Malacoda <malacoda@monarch-pass.net> -;;; Copyright © 2020, 2021 Jonathan Brielmaier <jonathan.brielmaier@web.de> +;;; Copyright © 2020-2023 Jonathan Brielmaier <jonathan.brielmaier@web.de> ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com> ;;; Copyright © 2021 pineapples <guixuser6392@protonmail.com> ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +;;; Copyright © 2021, 2022, 2023 John Kehayias <john.kehayias@protonmail.com> +;;; Copyright © 2022 Pierre Langlois <pierre.langlois@gmx.com> (define-module (nongnu packages mozilla) #:use-module (guix build-system gnu) @@ -41,8 +27,10 @@ #:use-module (guix build-system trivial) #:use-module (guix download) #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix utils) + #:use-module ((guix build utils) #:select (alist-replace)) #:use-module (gnu packages) #:use-module (gnu packages assembly) @@ -57,6 +45,7 @@ #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gtk) + #:use-module (gnu packages hunspell) #:use-module (gnu packages icu4c) #:use-module (gnu packages image) #:use-module (gnu packages jemalloc) @@ -64,7 +53,6 @@ #:use-module (gnu packages libcanberra) #:use-module (gnu packages libevent) #:use-module (gnu packages libffi) - #:use-module (gnu packages libreoffice) ;for hunspell #:use-module (gnu packages linux) #:use-module (gnu packages llvm) #:use-module (gnu packages m4) @@ -78,371 +66,518 @@ #:use-module (gnu packages rust-apps) #:use-module (gnu packages sqlite) #:use-module (gnu packages video) + #:use-module (nongnu packages wasm) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg)) +;; Define the versions of rust needed to build firefox, trying to match +;; upstream. See the file taskcluster/ci/toolchain/rust.yml at +;; https://searchfox.org under the particular firefox release, like +;; mozilla-esr102. +(define-public rust-firefox-esr rust) ; 1.60 is the default in Guix +(define-public rust-firefox (@@ (gnu packages rust) rust-1.65)) ; 1.63 is also listed, but 1.61 is the minimum needed + +(define icu4c-72 + (package + (inherit icu4c) + (version "72.1") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/unicode-org/icu/releases/download/release-" + (string-map (lambda (x) (if (char=? x #\.) #\- x)) version) + "/icu4c-" + (string-map (lambda (x) (if (char=? x #\.) #\_ x)) version) + "-src.tgz")) + (sha256 + (base32 + "0s0xly0ndspd4p9jl6101qvnp5rgz5kl9qrmcvapwah92y1d7lm2")))))) + ;; Update this id with every firefox update to it's release date. ;; It's used for cache validation and therefor can lead to strange bugs. -(define %firefox-build-id "20211017000000") +(define %firefox-esr-build-id "20230313000000") -(define-public firefox +(define-public firefox-esr (package - (name "firefox") - (version "93.0") + (name "firefox-esr") + (version "102.9.0esr") (source (origin (method url-fetch) (uri (string-append "https://archive.mozilla.org/pub/firefox/releases/" version "/source/firefox-" version ".source.tar.xz")) (sha256 - (base32 "00kiz6hnwmz659cqndpalxhyj4jajd03b7r9hi5jig29b07hi3x7")))) + (base32 "1l8xlbba8sa9dg132k96ch8mz97i5lyhpvkxi8d85jh97xi79c1i")))) (build-system gnu-build-system) (arguments - `(#:configure-flags - (let ((clang (assoc-ref %build-inputs "clang"))) - `("--enable-application=browser" + (list + #:configure-flags + #~(let ((clang #$(this-package-native-input "clang")) + (wasi-sysroot #$(this-package-native-input "wasm32-wasi-clang-toolchain"))) + `("--enable-application=browser" - ;; Configuration - "--with-system-jpeg" - "--with-system-zlib" - ;; "--with-system-png" ;require libpng-apng >= 1.6.35 - "--with-system-icu" - "--enable-system-ffi" - "--enable-system-pixman" - "--enable-jemalloc" + ;; Configuration + "--with-system-jpeg" + "--with-system-zlib" + ;; "--with-system-png" ;require libpng-apng >= 1.6.35 + "--with-system-icu" + "--enable-system-ffi" + "--enable-system-pixman" + "--enable-jemalloc" - ;; see https://bugs.gnu.org/32833 - ;; "--with-system-nspr" - ;; "--with-system-nss" + ;; see https://bugs.gnu.org/32833 + "--with-system-nspr" + ;; "--with-system-nss" - ,(string-append "--with-clang-path=" - clang "/bin/clang") - ,(string-append "--with-libclang-path=" - clang "/lib") + ,(string-append "--with-clang-path=" + clang "/bin/clang") + ,(string-append "--with-libclang-path=" + clang "/lib") + ,(string-append "--with-wasi-sysroot=" wasi-sysroot "/wasm32-wasi") - ;; Distribution - "--with-distribution-id=org.nonguix" - "--disable-official-branding" + ;; Distribution + "--with-distribution-id=org.nonguix" + "--disable-official-branding" - ;; Features - "--disable-tests" - "--disable-updater" - "--enable-pulseaudio" - "--disable-crashreporter" + ;; Features + "--disable-tests" + "--disable-updater" + "--enable-pulseaudio" + "--disable-crashreporter" - ;; Build details - "--disable-debug" - "--enable-rust-simd" - "--enable-release" - "--enable-optimize" - "--enable-strip" - "--disable-elf-hack")) - #:imported-modules ,%cargo-utils-modules - #:modules ((ice-9 regex) + ;; Build details + "--disable-debug" + "--enable-rust-simd" + "--enable-release" + "--enable-optimize" + "--enable-strip" + "--disable-elf-hack")) + #:imported-modules %cargo-utils-modules + #:modules `((ice-9 regex) (ice-9 ftw) + (srfi srfi-1) (srfi srfi-26) + (rnrs bytevectors) + (rnrs io ports) + (guix elf) + (guix build gremlin) ,@%gnu-build-system-modules) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'fix-preferences - (lambda* (#:key inputs #:allow-other-keys) - (let ((port (open-file "browser/app/profile/firefox.js" "a"))) - (define (write-setting key value) - (format port "~%pref(\"~a\", ~a);~%" - key value) - (format #t "fix-preferences: setting value of ~a to ~a~%" - key value)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-preferences + (lambda* (#:key inputs #:allow-other-keys) + (let ((port (open-file "browser/app/profile/firefox.js" "a"))) + (define (write-setting key value) + (format port "~%pref(\"~a\", ~a);~%" + key value) + (format #t "fix-preferences: setting value of ~a to ~a~%" + key value)) - ;; We should allow Firefox sandbox to read the store directory, - ;; because Firefox sandbox have access to /usr on FHS distros. - (write-setting "security.sandbox.content.read_path_whitelist" - (string-append "\"" (%store-directory) "/\"")) + ;; We should allow Firefox sandbox to read the store directory, + ;; because Firefox sandbox have access to /usr on FHS distros. + (write-setting "security.sandbox.content.read_path_whitelist" + (string-append "\"" (%store-directory) "/\"")) - ;; XDG settings should be managed by Guix. - (write-setting "browser.shell.checkDefaultBrowser" "false") - (close-port port)) - #t)) - (add-after 'fix-preferences 'fix-ffmpeg-runtime-linker - (lambda* (#:key inputs #:allow-other-keys) - (let* ((ffmpeg (assoc-ref inputs "ffmpeg")) - (libavcodec (string-append ffmpeg "/lib/libavcodec.so"))) - ;; Arrange to load libavcodec.so by its absolute file name. - (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp" - (("libavcodec\\.so") - libavcodec)) - #t))) + ;; XDG settings should be managed by Guix. + (write-setting "browser.shell.checkDefaultBrowser" "false") + (close-port port)))) + (add-after 'fix-preferences 'fix-ffmpeg-runtime-linker + (lambda* (#:key inputs #:allow-other-keys) + (let* ((ffmpeg (assoc-ref inputs "ffmpeg")) + (libavcodec (string-append ffmpeg "/lib/libavcodec.so"))) + ;; Arrange to load libavcodec.so by its absolute file name. + (substitute* "dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp" + (("libavcodec\\.so") + libavcodec))))) + (add-after 'patch-source-shebangs 'patch-cargo-checksums + (lambda _ + (use-modules (guix build cargo-utils)) + (let ((null-hash + ;; This is the SHA256 output of an empty string. + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")) + (for-each + (lambda (file) + (format #t "patch-cargo-checksums: patching checksums in ~a~%" + file) + (substitute* file + (("(checksum = )\".*\"" all name) + (string-append name "\"" null-hash "\"")))) + (find-files "." "Cargo\\.lock$")) + (for-each generate-all-checksums + '("build" + "dom/media" + "dom/webauthn" + "gfx" + "intl" + "js" + "media" + "modules" + "mozglue/static/rust" + "netwerk" + "remote" + "security/manager/ssl" + "servo" + "storage" + "third_party/rust" + "toolkit" + "xpcom/rust" + "services"))))) + (add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag + (lambda _ + ;; Remove --frozen flag from cargo invokation, otherwise it'll + ;; complain that it's not able to change Cargo.lock. + ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373 + (substitute* "build/RunCbindgen.py" + (("\"--frozen\",") "")))) + (delete 'bootstrap) + (add-before 'configure 'set-build-id + ;; Firefox will write the timestamp to output, which is harmful + ;; for reproducibility, so change it to a fixed date. Use a + ;; separate phase for easier modification with inherit. + (lambda _ + (setenv "MOZ_BUILD_DATE" #$%firefox-esr-build-id))) + (replace 'configure + (lambda* (#:key inputs outputs configure-flags #:allow-other-keys) + (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf") + "/bin/autoconf")) + (setenv "SHELL" (which "bash")) + (setenv "CONFIG_SHELL" (which "bash")) + (setenv "MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE" "system") + ;; This should use the host info probably (does firefox build on + ;; non-x86_64 though?) + (setenv "GUIX_PYTHONPATH" + (string-append (getcwd) + "/obj-x86_64-pc-linux-gnu/_virtualenvs/build")) - (add-after 'patch-source-shebangs 'patch-cargo-checksums - (lambda _ - (use-modules (guix build cargo-utils)) - (let ((null-hash - ;; This is the SHA256 output of an empty string. - "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")) - (for-each - (lambda (file) - (format #t "patch-cargo-checksums: patching checksums in ~a~%" - file) - (substitute* file - (("(checksum = )\".*\"" all name) - (string-append name "\"" null-hash "\"")))) - (find-files "." "Cargo\\.lock$")) - (for-each generate-all-checksums - '("build" - "dom/media" - "dom/webauthn" - "gfx" - "intl" - "js" - "media" - "modules" - "mozglue/static/rust" - "netwerk" - "remote" - "security/manager/ssl" - "servo" - "storage" - "third_party/rust" - "toolkit" - "xpcom/rust" - "services")) - #t))) - (add-after 'patch-cargo-checksums 'remove-cargo-frozen-flag - (lambda _ - ;; Remove --frozen flag from cargo invokation, otherwise it'll - ;; complain that it's not able to change Cargo.lock. - ;; https://bugzilla.mozilla.org/show_bug.cgi?id=1726373 - (substitute* "build/RunCbindgen.py" - (("\"--frozen\",") "")) - #t)) - (delete 'bootstrap) - (replace 'configure - (lambda* (#:key inputs outputs configure-flags #:allow-other-keys) - (setenv "AUTOCONF" (string-append (assoc-ref inputs "autoconf") - "/bin/autoconf")) - (setenv "SHELL" (which "bash")) - (setenv "CONFIG_SHELL" (which "bash")) - (setenv "MACH_USE_SYSTEM_PYTHON" "1") + ;; Use Clang, Clang is 2x faster than GCC + (setenv "AR" "llvm-ar") + (setenv "NM" "llvm-nm") + (setenv "CC" "clang") + (setenv "CXX" "clang++") + (setenv "WASM_CC" + (string-append + (assoc-ref inputs "wasm32-wasi-clang-toolchain") + "/bin/clang")) + (setenv "WASM_CXX" + (string-append + (assoc-ref inputs "wasm32-wasi-clang-toolchain") + "/bin/clang++")) - ;; Use Clang, Clang is 2x faster than GCC - (setenv "AR" "llvm-ar") - (setenv "NM" "llvm-nm") - (setenv "CC" "clang") - (setenv "CXX" "clang++") + (setenv "MOZ_NOSPAM" "1") - (setenv "MOZ_NOSPAM" "1") - ;; Firefox will write the timestamp to output, which is harmful for - ;; reproducibility, so change it to a fixed date. - (setenv "MOZ_BUILD_DATE" ,%firefox-build-id) + (setenv "MOZBUILD_STATE_PATH" (getcwd)) - (setenv "MOZBUILD_STATE_PATH" (getcwd)) + (let* ((mozconfig (string-append (getcwd) "/mozconfig")) + (out (assoc-ref outputs "out")) + (flags (cons (string-append "--prefix=" out) + configure-flags))) + (format #t "build directory: ~s~%" (getcwd)) + (format #t "configure flags: ~s~%" flags) - (let* ((mozconfig (string-append (getcwd) "/mozconfig")) - (out (assoc-ref outputs "out")) - (flags (cons (string-append "--prefix=" out) - configure-flags))) - (format #t "build directory: ~s~%" (getcwd)) - (format #t "configure flags: ~s~%" flags) - - (define write-flags - (lambda flags - (display (string-join - (map (cut string-append "ac_add_options " <>) - flags) - "\n")) - (display "\n"))) - (with-output-to-file mozconfig - (lambda () - (apply write-flags flags) - ;; The following option unsets Telemetry Reporting. With the Addons Fiasco, - ;; Mozilla was found to be collecting user's data, including saved passwords and - ;; web form data, without users consent. Mozilla was also found shipping updates - ;; to systems without the user's knowledge or permission. - ;; As a result of this, use the following command to permanently disable - ;; telemetry reporting in Firefox. - (display "unset MOZ_TELEMETRY_REPORTING\n"))) - (setenv "MOZCONFIG" mozconfig)) - (invoke "./mach" "configure"))) - (replace 'build - (lambda* (#:key (make-flags '()) (parallel-build? #t) - #:allow-other-keys) - (apply invoke "./mach" "build" - ;; mach will use parallel build if possible by default - `(,@(if parallel-build? - '() - '("-j1")) - ,@make-flags)))) - (add-after 'build 'neutralise-store-references - (lambda _ - ;; Mangle the store references to compilers & other build tools in - ;; about:buildconfig, reducing Firefox's closure by 1 GiB on x86-64. - (let* ((build-dir (car (scandir "." (cut string-prefix? "obj-" <>)))) - (file (string-append build-dir "/dist/bin/chrome/toolkit/content/global/buildconfig.html"))) - (substitute* file - (((format #f "(~a/)([0-9a-df-np-sv-z]{32})" - (regexp-quote (%store-directory))) - _ store hash) - (string-append store - (string-take hash 8) - "<!-- Guix: not a runtime dependency -->" - (string-drop hash 8))))) - #t)) - (replace 'install - (lambda _ (invoke "./mach" "install"))) - (add-after 'install 'wrap-program - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (lib (string-append out "/lib")) - (ld-libs - (map (lambda (x) - (string-append (assoc-ref inputs x) - "/lib")) - '("pulseaudio" "mesa" - "udev" ;; For U2F and WebAuthn - ;; For hardware video acceleration via VA-API - "libva" - ;; For the integration of native notifications - "libnotify"))) - (gtk-share (string-append (assoc-ref inputs "gtk+") - "/share"))) - (wrap-program (car (find-files lib "^firefox$")) - `("LD_LIBRARY_PATH" prefix ,ld-libs) - `("XDG_DATA_DIRS" prefix (,gtk-share)) - `("MOZ_LEGACY_PROFILES" = ("1")) - `("MOZ_ALLOW_DOWNGRADE" = ("1"))) - #t))) - (add-after 'wrap-program 'install-desktop-entry - (lambda* (#:key outputs #:allow-other-keys) - (let* ((desktop-file "taskcluster/docker/firefox-snap/firefox.desktop") - (out (assoc-ref outputs "out")) - (applications (string-append out "/share/applications"))) - (substitute* desktop-file - (("^Exec=firefox") (string-append "Exec=" out "/bin/firefox")) - (("Icon=.*") "Icon=firefox\n") - (("NewWindow") "new-window") - (("NewPrivateWindow") "new-private-window")) - (install-file desktop-file applications)) - #t)) - (add-after 'install-desktop-entry 'install-icons - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (icon-source-dir + (define write-flags + (lambda flags + (display (string-join + (map (cut string-append "ac_add_options " <>) + flags) + "\n")) + (display "\n"))) + (with-output-to-file mozconfig + (lambda () + (apply write-flags flags) + ;; The following option unsets Telemetry Reporting. With the Addons Fiasco, + ;; Mozilla was found to be collecting user's data, including saved passwords and + ;; web form data, without users consent. Mozilla was also found shipping updates + ;; to systems without the user's knowledge or permission. + ;; As a result of this, use the following command to permanently disable + ;; telemetry reporting in Firefox. + (display "unset MOZ_TELEMETRY_REPORTING\n"))) + (setenv "MOZCONFIG" mozconfig)) + (invoke "./mach" "configure"))) + (replace 'build + (lambda* (#:key (make-flags '()) (parallel-build? #t) + #:allow-other-keys) + (apply invoke "./mach" "build" + ;; mach will use parallel build if possible by default + `(,@(if parallel-build? + '() + '("-j1")) + ,@make-flags)))) + (add-after 'build 'neutralise-store-references + (lambda _ + ;; Mangle the store references to compilers & other build tools in + ;; about:buildconfig, reducing Firefox's closure by 1 GiB on x86-64. + (let* ((build-dir (car (scandir "." (cut string-prefix? "obj-" <>)))) + (file (string-append build-dir "/dist/bin/chrome/toolkit/content/global/buildconfig.html"))) + (substitute* file + (((format #f "(~a/)([0-9a-df-np-sv-z]{32})" + (regexp-quote (%store-directory))) + _ store hash) + (string-append store + (string-take hash 8) + "<!-- Guix: not a runtime dependency -->" + (string-drop hash 8))))))) + (replace 'install + (lambda _ (invoke "./mach" "install"))) + (add-after 'install 'wrap-program + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; The following two functions are from Guix's icecat package in + ;; (gnu packages gnuzilla). See commit + ;; b7a0935420ee630a29b7e5ac73a32ba1eb24f00b. + (define (runpath-of lib) + (call-with-input-file lib + (compose elf-dynamic-info-runpath + elf-dynamic-info + parse-elf + get-bytevector-all))) + (define (runpaths-of-input label) + (let* ((dir (string-append (assoc-ref inputs label) "/lib")) + (libs (find-files dir "\\.so$"))) + (append-map runpath-of libs))) + (let* ((out (assoc-ref outputs "out")) + (lib (string-append out "/lib")) + ;; TODO: make me a loop again + (mesa-lib (string-append (assoc-ref inputs "mesa") "/lib")) + ;; For the integration of native notifications + (libnotify-lib (string-append (assoc-ref inputs "libnotify") + "/lib")) + ;; For hardware video acceleration via VA-API + (libva-lib (string-append (assoc-ref inputs "libva") + "/lib")) + ;; VA-API is run in the RDD (Remote Data Decoder) sandbox + ;; and must be explicitly given access to files it needs. + ;; Rather than adding the whole store (as Nix had + ;; upstream do, see + ;; <https://github.com/NixOS/nixpkgs/pull/165964> and + ;; linked upstream patches), we can just follow the + ;; runpaths of the needed libraries to add everything to + ;; LD_LIBRARY_PATH. These will then be accessible in the + ;; RDD sandbox. + (rdd-whitelist + (map (cut string-append <> "/") + (delete-duplicates + (append-map runpaths-of-input + '("mesa" "ffmpeg"))))) + (pulseaudio-lib (string-append (assoc-ref inputs "pulseaudio") + "/lib")) + ;; For U2F and WebAuthn + (eudev-lib (string-append (assoc-ref inputs "eudev") "/lib")) + (gtk-share (string-append (assoc-ref inputs "gtk+") + "/share"))) + (wrap-program (car (find-files lib "^firefox$")) + `("LD_LIBRARY_PATH" prefix (,mesa-lib ,libnotify-lib ,libva-lib + ,pulseaudio-lib ,eudev-lib ,@rdd-whitelist)) + `("XDG_DATA_DIRS" prefix (,gtk-share)) + `("MOZ_LEGACY_PROFILES" = ("1")) + `("MOZ_ALLOW_DOWNGRADE" = ("1")))))) + (add-after 'wrap-program 'install-desktop-entry + (lambda* (#:key outputs #:allow-other-keys) + (let* ((desktop-file "taskcluster/docker/firefox-snap/firefox.desktop") + (applications (string-append #$output "/share/applications"))) + (substitute* desktop-file + (("^Exec=firefox") (string-append "Exec=" #$output "/bin/firefox")) + (("Icon=.*") "Icon=firefox\n") + (("NewWindow") "new-window") + (("NewPrivateWindow") "new-private-window") + (("StartupNotify=true") + "StartupNotify=true\nStartupWMClass=Navigator")) + (install-file desktop-file applications)))) + (add-after 'install-desktop-entry 'install-icons + (lambda* (#:key outputs #:allow-other-keys) + (let ((icon-source-dir (string-append - out "/lib/firefox/browser/chrome/icons/default"))) - (for-each - (lambda (size) - (let ((dest (string-append out "/share/icons/hicolor/" - size "x" size "/apps"))) - (mkdir-p dest) - (symlink (string-append icon-source-dir - "/default" size ".png") - (string-append dest "/firefox.png")))) - '("16" "32" "48" "64" "128")) - #t)))) + #$output "/lib/firefox/browser/chrome/icons/default"))) + (for-each + (lambda (size) + (let ((dest (string-append #$output "/share/icons/hicolor/" + size "x" size "/apps"))) + (mkdir-p dest) + (symlink (string-append icon-source-dir + "/default" size ".png") + (string-append dest "/firefox.png")))) + '("16" "32" "48" "64" "128")))))) - ;; Test will significantly increase build time but with little rewards. - #:tests? #f + ;; Test will significantly increase build time but with little rewards. + #:tests? #f - ;; WARNING: Parallel build will consume lots of memory! - ;; If you have encountered OOM issue in build phase, try disable it. - ;; #:parallel-build? #f + ;; WARNING: Parallel build will consume lots of memory! + ;; If you have encountered OOM issue in build phase, try disable it. + ;; #:parallel-build? #f - ;; Some dynamic lib was determined at runtime, so rpath check may fail. - #:validate-runpath? #f)) + ;; Some dynamic lib was determined at runtime, so rpath check may fail. + #:validate-runpath? #f)) (inputs - `(("bzip2" ,bzip2) - ("cairo" ,cairo) - ("cups" ,cups) - ("dbus-glib" ,dbus-glib) - ("freetype" ,freetype) - ("ffmpeg" ,ffmpeg) - ("gdk-pixbuf" ,gdk-pixbuf) - ("glib" ,glib) - ("gtk+" ,gtk+) - ("gtk+-2" ,gtk+-2) - ("hunspell" ,hunspell) - ("icu4c" ,icu4c-69) - ("jemalloc" ,jemalloc) - ("libcanberra" ,libcanberra) - ("libevent" ,libevent) - ("libffi" ,libffi) - ("libgnome" ,libgnome) - ("libjpeg-turbo" ,libjpeg-turbo) - ("libnotify" ,libnotify) - ;; ("libpng-apng" ,libpng-apng) - ("libva" ,libva) - ("libvpx" ,libvpx) - ("libxcomposite" ,libxcomposite) - ("libxft" ,libxft) - ("libxinerama" ,libxinerama) - ("libxscrnsaver" ,libxscrnsaver) - ("libxt" ,libxt) - ("mesa" ,mesa) - ("mit-krb5" ,mit-krb5) - ;; ("nspr" ,nspr) - ;; ("nss" ,nss) - ("pango" ,pango) - ("pixman" ,pixman) - ("pulseaudio" ,pulseaudio) - ("startup-notification" ,startup-notification) - ("sqlite" ,sqlite) - ("udev" ,eudev) - ("unzip" ,unzip) - ("zip" ,zip) - ("zlib" ,zlib))) + (list + bzip2 + cairo + cups + dbus-glib + freetype + ffmpeg + gdk-pixbuf + glib + gtk+ + gtk+-2 + hunspell + icu4c-71 + jemalloc + libcanberra + libevent + libffi + libgnome + libjpeg-turbo + libnotify + ;; libpng-apng + libva + libvpx + libxcomposite + libxft + libxinerama + libxscrnsaver + libxt + mesa + mit-krb5 + nspr-4.32 + ;; nss + pango + pipewire + pixman + pulseaudio + startup-notification + sqlite + eudev + unzip + zip + zlib)) (native-inputs - `(("autoconf" ,autoconf-2.13) - ("cargo" ,rust-1.51 "cargo") - ("clang" ,clang-10) - ("llvm" ,llvm-10) - ("m4" ,m4) - ("nasm" ,nasm) - ("node" ,node) - ("perl" ,perl) - ("pkg-config" ,pkg-config) - ("python" ,python) - ("rust" ,rust-1.51) - ("rust-cbindgen" ,rust-cbindgen-0.19) - ("which" ,which) - ("yasm" ,yasm))) + (list + alsa-lib + autoconf-2.13 + `(,rust-firefox-esr "cargo") + clang + llvm + wasm32-wasi-clang-toolchain + m4 + nasm + node + perl + pkg-config + python + rust-firefox-esr + rust-cbindgen-0.23 + which + yasm)) (home-page "https://mozilla.org/firefox/") (synopsis "Trademarkless version of Firefox") (description "Full-featured browser client built from Firefox source tree, without -the official icon and the name \"firefox\".") +the official icon and the name \"firefox\". This is the Extended Support +Release (ESR) version.") (license license:mpl2.0))) - (define-public firefox/wayland - (package - (inherit firefox) - (name "firefox-wayland") - (native-inputs '()) - (inputs - `(("bash" ,bash-minimal) - ("firefox" ,firefox))) - (build-system trivial-build-system) - (arguments - '(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (let* ((bash (assoc-ref %build-inputs "bash")) - (firefox (assoc-ref %build-inputs "firefox")) - (out (assoc-ref %outputs "out")) - (exe (string-append out "/bin/firefox"))) - (mkdir-p (dirname exe)) +(define-public firefox-esr/wayland + (package + (inherit firefox-esr) + (name "firefox-esr-wayland") + (native-inputs '()) + (inputs + `(("bash" ,bash-minimal) + ("firefox-esr" ,firefox-esr))) + (build-system trivial-build-system) + (arguments + '(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((bash (assoc-ref %build-inputs "bash")) + (firefox (assoc-ref %build-inputs "firefox-esr")) + (out (assoc-ref %outputs "out")) + (exe (string-append out "/bin/firefox"))) + (mkdir-p (dirname exe)) + + (call-with-output-file exe + (lambda (port) + (format port "#!~a +MOZ_ENABLE_WAYLAND=1 exec ~a $@\n" + (string-append bash "/bin/bash") + (string-append firefox "/bin/firefox")))) + (chmod exe #o555) + + ;; Provide the manual and .desktop file. + (copy-recursively (string-append firefox "/share") + (string-append out "/share")) + (substitute* (string-append + out "/share/applications/firefox.desktop") + ((firefox) out)) + #t)))))) + +;; Update this id with every firefox update to it's release date. +;; It's used for cache validation and therefor can lead to strange bugs. +(define %firefox-build-id "20230321000000") + +(define-public firefox + (package + (inherit firefox-esr) + (name "firefox") + (version "111.0.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://archive.mozilla.org/pub/firefox/releases/" + version "/source/firefox-" version ".source.tar.xz")) + (sha256 + (base32 "1s6wxg12b4z5n13ijcb281ydfh4qwpqzha6x3i2y1xidlsmz7944")))) + (arguments + (substitute-keyword-arguments (package-arguments firefox-esr) + ((#:phases phases) + #~(modify-phases #$phases + (replace 'set-build-id + (lambda _ + (setenv "MOZ_BUILD_DATE" #$%firefox-build-id))))))) + (inputs + (modify-inputs (package-inputs firefox-esr) + (replace "icu4c" icu4c-72))) + (native-inputs + (modify-inputs (package-native-inputs firefox-esr) + (replace "rust" rust-firefox) + (replace "rust:cargo" `(,rust-firefox "cargo")) + (replace "node" node-lts) + (replace "rust-cbindgen" rust-cbindgen-0.24))) + (description + "Full-featured browser client built from Firefox source tree, without +the official icon and the name \"firefox\"."))) + +(define-public firefox/wayland + (package + (inherit firefox) + (name "firefox-wayland") + (native-inputs '()) + (inputs + `(("bash" ,bash-minimal) + ("firefox" ,firefox))) + (build-system trivial-build-system) + (arguments + '(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((bash (assoc-ref %build-inputs "bash")) + (firefox (assoc-ref %build-inputs "firefox")) + (out (assoc-ref %outputs "out")) + (exe (string-append out "/bin/firefox"))) + (mkdir-p (dirname exe)) - (call-with-output-file exe - (lambda (port) - (format port "#!~a + (call-with-output-file exe + (lambda (port) + (format port "#!~a MOZ_ENABLE_WAYLAND=1 exec ~a $@\n" - (string-append bash "/bin/bash") - (string-append firefox "/bin/firefox")))) - (chmod exe #o555) + (string-append bash "/bin/bash") + (string-append firefox "/bin/firefox")))) + (chmod exe #o555) - ;; Provide the manual and .desktop file. - (copy-recursively (string-append firefox "/share") - (string-append out "/share")) - (substitute* (string-append - out "/share/applications/firefox.desktop") - ((firefox) out)) - #t)))))) + ;; Provide the manual and .desktop file. + (copy-recursively (string-append firefox "/share") + (string-append out "/share")) + (substitute* (string-append + out "/share/applications/firefox.desktop") + ((firefox) out)) + #t)))))) diff --git a/nongnu/packages/music.scm b/nongnu/packages/music.scm new file mode 100644 index 0000000..dffd758 --- /dev/null +++ b/nongnu/packages/music.scm @@ -0,0 +1,103 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022 Sughosha <sughosha@proton.me> +;;; Copyright © 2023 Jonathan Brielmaier <jonathan.brielmaier@web.de> + +(define-module (nongnu packages music) + #:use-module (gnu packages audio) + #:use-module (gnu packages base) + #:use-module (gnu packages cpp) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gcc) + #:use-module (gnu packages linux) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (ice-9 match) + #:use-module (ice-9 regex) + #:use-module ((nonguix licenses) #:prefix license:) + #:use-module (nonguix build-system binary)) + +(define-public reaper + (package + (name "reaper") + (version "6.73") + (source + (origin + (method url-fetch) + (uri (string-append "https://www.reaper.fm/files/" + (version-major version) + ".x/reaper" + (string-replace-substring version "." "") + "_" + (match (%current-system) + ("x86_64-linux" "linux_x86_64") + ("i686-linux" "linux_i686") + ("aarch64-linux" "linux_aarch64") + ("armhf-linux" "linux_armv7l")) + ".tar.xz")) + (sha256 + (base32 + (match (%current-system) + ("x86_64-linux" "1hd7fbk0px45fxhqa7nqcnij8ls2fhpjp60v840vy2zqs9fkcr52") + ("i686-linux" "11vk32mxyda9xl08pp2ivd1vsahnw6w7d08in4syz6iannfwp19b") + ("aarch64-linux" "0zpkaiwwxn8yh3s1d22qswshbgaxx5d8iy17hb3w256zgb722yjw") + ("armhf-linux" "18174b1lgsk73gxhala471ppzbrpa1cs953b5par998yqgh74znk")))))) + (build-system binary-build-system) + (arguments + (list #:strip-binaries? #f ;allocated section `.dynsym' not in segment + #:patchelf-plan #~`(("REAPER/reaper" ("libc" "gcc" "alsa-lib")) + ("REAPER/reamote-server" ("libc" "gcc")) + ("REAPER/Plugins/reaper_host_x86_64" ("libc" "gcc"))) + #:phases #~(modify-phases %standard-phases + (replace 'install + (lambda* (#:key outputs inputs #:allow-other-keys) + (let* ((target (string-append #$output "/opt")) + (bin (string-append #$output "/bin")) + (libexec (string-append #$output "/libexec")) + (data (string-append #$output "/share")) + (doc (string-append data "/doc/reaper-" + #$version))) + (setenv "HOME" "/tmp") + (setenv "XDG_DATA_HOME" data) + (invoke "sh" "./install-reaper.sh" "--install" + target "--integrate-user-desktop") + (delete-file (string-append target + "/REAPER/uninstall-reaper.sh")) + (delete-file (string-append target + "/REAPER/libSwell.so")) + (symlink (search-input-file inputs + "/lib/libSwell.so") + (string-append target + "/REAPER/libSwell.so")) + (mkdir-p bin) + (symlink (string-append target "/REAPER/reaper") + (string-append bin "/reaper")) + (mkdir-p libexec) + (symlink (string-append target + "/REAPER/Plugins/reaper_host_x86_64") + (string-append libexec + "/reaper_host_x86_64")) + (mkdir-p doc) + (symlink (string-append target + "/REAPER/EULA.txt") + (string-append doc "/LICENSE")))))))) + (native-inputs + (list + which + xdg-utils)) + (inputs + (list + alsa-lib + `(,gcc "lib") + wdl)) + (supported-systems '("x86_64-linux" "i686-linux" "aarch64-linux" + "armhf-linux")) + (home-page "https://www.reaper.fm") + (synopsis "Digital audio workstation") + (description + "REAPER is a digital audio production application offering multitrack +audio and MIDI recording, editing, processing, mixing and mastering toolset. +It supports a vast range of hardware, digital formats and plugins, and can be +comprehensively extended, scripted and modified.") + (license (license:nonfree "file:///opt/REAPER/EULA.txt")))) diff --git a/nongnu/packages/ncurses.scm b/nongnu/packages/ncurses.scm new file mode 100644 index 0000000..dd979ad --- /dev/null +++ b/nongnu/packages/ncurses.scm @@ -0,0 +1,234 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014, 2016 Mark H Weaver <mhw@netris.org> +;;; Copyright © 2015, 2017 Leo Famulari <leo@famulari.name> +;;; Copyright © 2016 Nikita <nikita@n0.is> +;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> +;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org> +;;; Copyright © 2017, 2019, 2020, 2021 Marius Bakke <marius@gnu.org> +;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> +;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de> +;;; Copyright © 2022 B. Wilson <x@wilsonb.com> + +(define-module (nongnu packages ncurses) + #:use-module (gnu packages) + #:use-module (guix licenses) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix build-system gnu) + #:use-module (guix build-system perl) + #:use-module (gnu packages) + #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages swig) + #:use-module (gnu packages linux) + #:use-module (guix utils) + #:use-module (ice-9 match)) + +(define-public ncurses-5 + (package + (name "ncurses") + (version "5.9.20141206") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnu/ncurses/ncurses-" + (version-major+minor version) + ".tar.gz")) + (sha256 + (base32 + "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh")))) + (build-system gnu-build-system) + (outputs '("out" + "doc")) ;1 MiB of man pages + (arguments + (let ((patch-makefile-phase + '(lambda _ + (for-each patch-makefile-SHELL + (find-files "." "Makefile.in")))) + (configure-phase + ;; The 'configure' script does not understand '--docdir', so we must + ;; override that and use '--mandir' instead. + '(lambda* (#:key build target outputs configure-flags + #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (doc (assoc-ref outputs "doc"))) + (apply invoke "./configure" + (string-append "SHELL=" (which "sh")) + (string-append "--build=" build) + (string-append "--prefix=" out) + (string-append "--mandir=" doc "/share/man") + (if target + (cons (string-append "--host=" target) + configure-flags) + configure-flags))))) + (apply-rollup-patch-phase + ;; Ncurses distributes "stable" patchsets to be applied on top + ;; of the release tarball. These are only available as shell + ;; scripts(!) so we decompress and apply them in a phase. + ;; See <https://invisible-mirror.net/archives/ncurses/6.1/README>. + '(lambda* (#:key inputs native-inputs #:allow-other-keys) + (let ((rollup-patch (assoc-ref (or native-inputs inputs) + "rollup-patch"))) + (when rollup-patch + (copy-file rollup-patch + (string-append (getcwd) "/rollup-patch.sh.bz2")) + (invoke "bzip2" "-d" "rollup-patch.sh.bz2") + (invoke "sh" "rollup-patch.sh"))))) + (remove-shebang-phase + '(lambda _ + ;; To avoid retaining a reference to the bootstrap Bash via the + ;; shebang of the 'ncursesw6-config' script, simply remove that + ;; shebang: it'll work just as well without it. Likewise, do not + ;; retain a reference to the "doc" output. + (substitute* "misc/ncurses-config.in" + (("#!@SHELL@") + "# No shebang here, use /bin/sh!\n") + (("@SHELL@ \\$0") + "$0") + (("mandir=.*$") + "mandir=share/man")))) + (post-install-phase + `(lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + ;; When building a wide-character (Unicode) build, create backward + ;; compatibility links from the the "normal" libraries to the + ;; wide-character ones (e.g. libncurses.so to libncursesw.so). + ,@(if (target-mingw?) + '( ;; TODO: create .la files to link to the .dll? + (with-directory-excursion (string-append out "/bin") + (for-each + (lambda (lib) + (define lib.dll + (string-append "lib" lib ".dll")) + (define libw6.dll + (string-append "lib" lib "w6.dll")) + + (when (file-exists? libw6.dll) + (format #t "creating symlinks for `lib~a'~%" lib) + (symlink libw6.dll lib.dll))) + '("curses" "ncurses" "form" "panel" "menu")))) + '()) + (with-directory-excursion (string-append out "/lib") + (for-each (lambda (lib) + (define libw.a + (string-append "lib" lib "w.a")) + (define lib.a + (string-append "lib" lib ".a")) + + ,@(if (not (target-mingw?)) + `((define libw.so.x + (string-append "lib" lib "w.so." + ,(version-major version))) + (define lib.so.x + (string-append "lib" lib ".so." + ,(version-major version))) + (define lib.so + (string-append "lib" lib ".so")) + (define packagew.pc + (string-append lib "w.pc")) + (define package.pc + (string-append lib ".pc"))) + '()) + + (when (file-exists? libw.a) + (format #t "creating symlinks for `lib~a'~%" lib) + (symlink libw.a lib.a) + ,@(if (not (target-mingw?)) + '((symlink libw.so.x lib.so.x) + (false-if-exception (delete-file lib.so)) + (call-with-output-file lib.so + (lambda (p) + (format p "INPUT (-l~aw)~%" lib))) + (with-directory-excursion "pkgconfig" + (format #t "creating symlink for `~a'~%" + package.pc) + (when (file-exists? packagew.pc) + (symlink packagew.pc package.pc)))) + '()))) + '("curses" "ncurses" "form" "panel" "menu"))))))) + `(#:configure-flags + ,(cons* + 'quasiquote + `(("--with-shared" "--without-debug" "--enable-widec" + + "--enable-pc-files" "--with-versioned-syms=yes" + ,(list 'unquote '(string-append "--with-pkg-config-libdir=" + (assoc-ref %outputs "out") + "/lib/pkgconfig")) + + ;; By default headers land in an `ncursesw' subdir, which is not + ;; what users expect. + ,(list 'unquote '(string-append "--includedir=" (assoc-ref %outputs "out") + "/include")) + "--enable-overwrite" ;really honor --includedir + + ;; Make sure programs like 'tic', 'reset', and 'clear' have a + ;; correct RUNPATH. + ,(list 'unquote '(string-append "LDFLAGS=-Wl,-rpath=" (assoc-ref %outputs "out") + "/lib")) + + ;; Starting from ncurses 6.1, "make install" runs "install -s" + ;; by default, which doesn't work for cross-compiled binaries + ;; because it invokes 'strip' instead of 'TRIPLET-strip'. Work + ;; around this. + ,@(if (%current-target-system) '("--disable-stripping") '()) + + ;; Do not assume a default search path in ld, even if it is only to + ;; filter it out in ncurses-config. Mainly because otherwise it ends + ;; up using the libdir from binutils, which makes little sense and + ;; causes an unnecessary runtime dependency. + "cf_cv_ld_searchpath=/no-ld-searchpath" + + ;; MinGW: Use term-driver created for the MinGW port. + ,@(if (target-mingw?) '("--enable-term-driver") '())))) + #:tests? #f ; no "check" target + #:phases (modify-phases %standard-phases + (add-after 'unpack 'apply-rollup-patch + ,apply-rollup-patch-phase) + (replace 'configure ,configure-phase) + (add-after 'install 'post-install + ,post-install-phase) + (add-before 'configure 'patch-makefile-SHELL + ,patch-makefile-phase) + (add-before 'patch-source-shebangs 'remove-unneeded-shebang + ,remove-shebang-phase))))) + (native-inputs + `(,@(if (%current-target-system) + `(("self" ,this-package)) ;for `tic' + '()) + ("rollup-patch" + ,(origin + (method url-fetch) + (uri (match (string-split (version-major+minor+point version) #\.) + ((major minor point) + (string-append "https://invisible-mirror.net/archives" + "/ncurses/" major "." minor "/ncurses-" + major "." minor "-" point "-patch.sh.bz2")))) + (sha256 + (base32 + "16ny892yhimy6r4mmsgw3rcl0i15570ifn9c54g1ndyrk7kpmlgs")))) + ("pkg-config" ,pkg-config))) + (native-search-paths + (list (search-path-specification + (variable "TERMINFO_DIRS") + (files '("share/terminfo"))))) + (synopsis "Terminal emulation (termcap, terminfo) library") + (description + "GNU Ncurses is a library which provides capabilities to write text to +a terminal in a terminal-independent manner. It supports pads and color as +well as multiple highlights and forms characters. It is typically used to +implement user interfaces for command-line applications. The accompanying +ncursesw library provides wide character support.") + (license x11) + (home-page "https://www.gnu.org/software/ncurses/"))) + +;; Needed by u-boot 2022.04+ +;; Consider merging into ncurses for next core-updates cycle. +(define-public ncurses/tinfo-5 + (package/inherit ncurses-5 + (name "ncurses-with-tinfo") + (arguments + (substitute-keyword-arguments (package-arguments ncurses-5) + ((#:configure-flags cf) + `(cons "--with-termlib=tinfo" + ,cf)))))) diff --git a/nongnu/packages/nvidia.scm b/nongnu/packages/nvidia.scm index a154f28..f4241ca 100644 --- a/nongnu/packages/nvidia.scm +++ b/nongnu/packages/nvidia.scm @@ -1,47 +1,54 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2020 Hebi Li <hebi@lihebi.com> ;;; Copyright © 2020 Malte Frank Gerdes <malte.f.gerdes@gmail.com> ;;; Copyright © 2020, 2021 Jean-Baptiste Volatier <jbv@pm.me> -;;; Copyright © 2020, 2021 Jonathan Brielmaier <jonathan.brielmaier@web.de> +;;; Copyright © 2020-2022 Jonathan Brielmaier <jonathan.brielmaier@web.de> ;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; This program is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see <https://www.gnu.org/licenses/>. +;;; Copyright © 2022, 2023 Petr Hodina <phodina@protonmail.com> +;;; Copyright © 2022 Alexey Abramov <levenson@mmer.org> +;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space> (define-module (nongnu packages nvidia) #:use-module (guix packages) + #:use-module (guix deprecation) #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) #:use-module (guix utils) + #:use-module ((guix licenses) #:prefix license-gnu:) #:use-module ((nonguix licenses) #:prefix license:) #:use-module (guix build-system linux-module) + #:use-module (guix build-system cmake) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) + #:use-module (guix build-system python) #:use-module (guix build-system trivial) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages bootstrap) + #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages elf) #:use-module (gnu packages freedesktop) + #:use-module (gnu packages gawk) #:use-module (gnu packages gcc) #:use-module (gnu packages gl) #:use-module (gnu packages glib) #:use-module (gnu packages gtk) #:use-module (gnu packages linux) + #:use-module (gnu packages m4) + #:use-module (gnu packages lsof) #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-web) + #:use-module (gnu packages qt) + #:use-module (gnu packages terminals) + #:use-module (gnu packages video) + #:use-module (gnu packages web) + #:use-module (gnu packages xdisorg) + #:use-module (gnu packages xml) #:use-module (gnu packages xorg) #:use-module (nongnu packages linux) #:use-module (ice-9 match) @@ -51,379 +58,598 @@ #:use-module (ice-9 match) #:use-module (srfi srfi-1)) -(define-public nvidia-driver - (package - (name "nvidia-driver") - (version "465.27") - (source +(define nvidia-version "515.76") + +(define computed-origin-method + (@@ (guix packages) computed-origin-method)) + +;; Extract the driver installer and make it a new origin instance for reusing. +(define (make-nvidia-source version installer) + (origin + (method computed-origin-method) + (file-name (string-append "nvidia-driver-" version "-checkout")) + (sha256 #f) + (uri + (delay + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils) + (ice-9 ftw)) + (set-path-environment-variable + "PATH" '("bin") + (list (canonicalize-path #+bash-minimal) + (canonicalize-path #+coreutils) + (canonicalize-path #+gawk) + (canonicalize-path #+grep) + (canonicalize-path #+tar) + (canonicalize-path #+which) + (canonicalize-path #+xz))) + (setenv "XZ_OPT" (string-join (%xz-parallel-args))) + (invoke "sh" #$installer "-x") + (copy-recursively + (car (scandir (canonicalize-path (getcwd)) + (lambda (file) + (not (member file '("." "..")))))) + #$output))))))) + +(define nvidia-source + (let ((version nvidia-version)) + (make-nvidia-source + version (origin - (uri (format #f "http://us.download.nvidia.com/XFree86/Linux-x86_64/~a/~a.run" - version - (format #f "NVIDIA-Linux-x86_64-~a" version))) - (sha256 (base32 "0w9ivi4z4j4hvhkimr11mgwrj09v53dy39vfdfmamrnybflgysby")) (method url-fetch) - (file-name (string-append "nvidia-driver-" version "-checkout")))) - (build-system linux-module-build-system) - (arguments - `(#:linux ,linux-lts - #:phases - (modify-phases %standard-phases - (replace 'unpack - (lambda* (#:key inputs #:allow-other-keys #:rest r) - (let ((source (assoc-ref inputs "source"))) - (invoke "sh" source "--extract-only") - (chdir ,(format #f "NVIDIA-Linux-x86_64-~a" version)) - #t))) - (replace 'build - (lambda* (#:key inputs outputs #:allow-other-keys) - ;; We cannot use with-directory-excursion, because the install - ;; phase needs to be in the kernel folder. Otherwise no .ko - ;; would be installed. - (chdir "kernel") - ;; Patch Kbuild - (substitute* "Kbuild" - (("/bin/sh") (string-append (assoc-ref inputs "bash-minimal") "/bin/sh"))) - (invoke "make" - "-j" - (string-append "SYSSRC=" - (assoc-ref inputs "linux-module-builder") - "/lib/modules/build") - "CC=gcc") - #t)) - (delete 'check) - (delete 'strip) - (add-after 'install 'install-copy - (lambda* (#:key inputs native-inputs outputs #:allow-other-keys) - (chdir "..") - (use-modules (ice-9 ftw) - (ice-9 regex) - (ice-9 textual-ports)) - (let* ((out (assoc-ref outputs "out")) - (libdir (string-append out "/lib")) - (bindir (string-append out "/bin")) - (etcdir (string-append out "/etc"))) - ;; ------------------------------ - ;; Copy .so files - (for-each - (lambda (file) - (format #t "Copying '~a'...~%" file) - (install-file file libdir)) - (scandir "." (lambda (name) - (string-contains name ".so")))) + (uri (string-append + "https://us.download.nvidia.com/XFree86/Linux-x86_64/" + version "/NVIDIA-Linux-x86_64-" version ".run")) + (sha256 + (base32 "0i5zyvlsjnfkpfqhw6pklp0ws8nndyiwxrg4pj04jpwnxf6a38n6")))))) - (install-file "nvidia_drv.so" (string-append out "/lib/xorg/modules/drivers/")) - (install-file ,(string-append "libglxserver_nvidia.so." version) (string-append out "/lib/xorg/modules/extensions/")) - - ;; ICD Loader for OpenCL - (let ((file (string-append etcdir "/OpenCL/vendors/nvidia.icd"))) - (mkdir-p (string-append etcdir "/OpenCL/vendors/")) - (call-with-output-file file - (lambda (port) - (display (string-append out "/lib/libnvidia-opencl.so.1") port))) - (chmod file #o555)) +(define-public gpustat + (package + (name "gpustat") + (version "1.0.0") + (source (origin + (method url-fetch) + (uri (pypi-uri "gpustat" version)) + (sha256 + (base32 + "1wg3yikkqdrcxp5xscyb9rxifgfwv7qh73xv4airab63b3w8y7jq")))) + (build-system python-build-system) + (arguments + '(#:tests? #f)) + (propagated-inputs (list python-blessed python-nvidia-ml-py python-psutil + python-six)) + (native-inputs (list python-mock python-pytest python-pytest-runner)) + (home-page "https://github.com/wookayin/gpustat") + (synopsis "Utility to monitor NVIDIA GPU status and usage") + (description + "This package provides an utility to monitor NVIDIA GPU status +and usage.") + (license license-gnu:expat))) - ;; Add udev rules for nvidia - (let ((rulesdir (string-append out "/lib/udev/rules.d/")) - (rules (string-append out "/lib/udev/rules.d/90-nvidia.rules")) - (sh (string-append (assoc-ref inputs "bash-minimal") "/bin/sh")) - (mknod (string-append (assoc-ref inputs "coreutils") "/bin/mknod")) - (cut (string-append (assoc-ref inputs "coreutils") "/bin/cut")) - (grep (string-append (assoc-ref inputs "grep") "/bin/grep"))) - (mkdir-p rulesdir) - (call-with-output-file rules - (lambda (port) - (put-string port - (string-append - "KERNEL==\"nvidia\", " - "RUN+=\"" sh " -c '" mknod " -m 666 /dev/nvidiactl c $$(" grep " nvidia-frontend /proc/devices | " cut " -d \\ -f 1) 255'\"" "\n" - "KERNEL==\"nvidia_modeset\", " - "RUN+=\"" sh " -c '" mknod " -m 666 /dev/nvidia-modeset c $$(" grep " nvidia-frontend /proc/devices | " cut " -d \\ -f 1) 254'\"" "\n" - "KERNEL==\"card*\", SUBSYSTEM==\"drm\", DRIVERS==\"nvidia\", " - "RUN+=\"" sh " -c '" mknod " -m 666 /dev/nvidia0 c $$(" grep " nvidia-frontend /proc/devices | " cut " -d \\ -f 1) 0'\"" "\n" - "KERNEL==\"nvidia_uvm\", " - "RUN+=\"" sh " -c '" mknod " -m 666 /dev/nvidia-uvm c $$(" grep " nvidia-uvm /proc/devices | " cut " -d \\ -f 1) 0'\"" "\n" - "KERNEL==\"nvidia_uvm\", " - "RUN+=\"" sh " -c '" mknod " -m 666 /dev/nvidia-uvm-tools c $$(" grep " nvidia-uvm /proc/devices | " cut " -d \\ -f 1) 0'\"" "\n" ))))) +(define-public python-nvidia-ml-py + (package + (name "python-nvidia-ml-py") + (version "11.495.46") + (source (origin + (method url-fetch) + (uri (pypi-uri "nvidia-ml-py" version)) + (sha256 + (base32 + "09cnb7xasd7brby52j70y7fqsfm9n6gvgqf769v0cmj74ypy2s4g")))) + (build-system python-build-system) + (arguments + (list #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'fix-libnvidia + (lambda _ + (substitute* "pynvml.py" + (("libnvidia-ml.so.1") + (string-append #$(this-package-input + "nvidia-driver") + "/lib/libnvidia-ml.so.1")))))))) + (inputs (list nvidia-driver)) + (home-page "https://forums.developer.nvidia.com") + (synopsis "Python Bindings for the NVIDIA Management Library") + (description "This package provides official Python Bindings for the NVIDIA +Management Library") + (license license-gnu:bsd-3))) - ;; ------------------------------ - ;; Add a file to load nvidia drivers - (mkdir-p bindir) - (let ((file (string-append bindir "/nvidia-insmod")) - (out (assoc-ref outputs "out")) - (moddir (string-append "/lib/modules/" (utsname:release (uname)) "-gnu/extra"))) - (call-with-output-file file - (lambda (port) - (put-string port (string-append "#!" (assoc-ref inputs "bash-minimal") "/bin/sh" "\n" - "modprobe ipmi_devintf" "\n" - "insmod " out moddir "/nvidia.ko" "\n" - "insmod " out moddir "/nvidia-modeset.ko" "\n" - "insmod " out moddir "/nvidia-uvm.ko" "\n" - "insmod " out moddir "/nvidia-drm.ko" "\n")))) - (chmod file #o555)) - (let ((file (string-append bindir "/nvidia-rmmod"))) - (call-with-output-file file - (lambda (port) - (put-string port (string-append "#!" (assoc-ref inputs "bash-minimal") "/bin/sh" "\n" - "rmmod " "nvidia-drm" "\n" - "rmmod " "nvidia-uvm" "\n" - "rmmod " "nvidia-modeset" "\n" - "rmmod " "nvidia" "\n" - "rmmod " "ipmi_devintf" "\n")))) - (chmod file #o555)) +(define-public nvidia-htop + (package + (name "nvidia-htop") + (version "1.0.5") + (source (origin + (method url-fetch) + (uri (pypi-uri "nvidia-htop" version)) + (sha256 + (base32 + "0lv9cpccpkbg0d577irm1lp9rx6pacyk2pk9v41k9s9hyl4b7hvx")))) + (build-system python-build-system) + (arguments + (list #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'fix-libnvidia + (lambda _ + (substitute* "nvidia-htop.py" + (("nvidia-smi") + (string-append #$(this-package-input + "nvidia-driver") + "/bin/nvidia-smi")))))))) + (inputs (list nvidia-driver)) + (propagated-inputs (list python-termcolor)) + (home-page "https://github.com/peci1/nvidia-htop") + (synopsis "Tool to enrich the output of nvidia-smi") + (description "This package provides tool for enriching the output of +nvidia-smi.") + (license license-gnu:bsd-3))) - ;; ------------------------------ - ;; nvidia-smi +(define-public python-py3nvml + (package + (name "python-py3nvml") + (version "0.2.7") + (source (origin + (method url-fetch) + (uri (pypi-uri "py3nvml" version)) + (sha256 + (base32 + "0wxxky9amy38q7qjsdmmznk1kqdzwd680ps64i76cvlab421vvh9")))) + (build-system python-build-system) + (arguments + (list #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'fix-libnvidia + (lambda _ + (substitute* "py3nvml/py3nvml.py" + (("libnvidia-ml.so.1") + (string-append #$(this-package-input + "nvidia-driver") + "/lib/libnvidia-ml.so.1")))))))) + (propagated-inputs (list nvidia-driver python-xmltodict)) + (home-page "https://github.com/fbcotter/py3nvml") + (synopsis "Unoffcial Python 3 Bindings for the NVIDIA Management Library") + (description "This package provides unofficial Python 3 Bindings for the +NVIDIA Management Library") + (license license-gnu:bsd-3))) - (install-file "nvidia-smi" bindir) +(define-public nvidia-driver + (package + (name "nvidia-driver") + (version nvidia-version) + (source nvidia-source) + (build-system copy-build-system) + (arguments + (list #:modules '((guix build copy-build-system) + (guix build utils) + (ice-9 ftw) + (ice-9 popen) + (ice-9 rdelim) + (ice-9 regex) + (ice-9 textual-ports)) + #:install-plan + #~`(("." "lib/" #:include-regexp ("^./[^/]+\\.so") #:exclude-regexp ("nvidia_drv\\.so" "libglxserver_nvidia\\.so\\..*")) + ("." "share/nvidia/" #:include-regexp ("nvidia-application-profiles.*")) + ("." "share/egl/egl_external_platform.d/" #:include-regexp (".*_nvidia_.*\\.json")) + ("90-nvidia.rules" "lib/udev/rules.d/") + ("nvidia-drm-outputclass.conf" "share/x11/xorg.conf.d/") + ("nvidia-smi" "bin/") + ("nvidia-dbus.conf" "share/dbus-1/system.d/") + ("nvidia-smi.1.gz" "share/man/man1/") + ("nvidia.icd" "etc/OpenCL/vendors/") + ("nvidia_drv.so" "lib/xorg/modules/drivers/") + ("nvidia_icd.json" "share/vulkan/icd.d/") + ("nvidia_layers.json" "share/vulkan/implicit_layer.d/") + (,(string-append "libglxserver_nvidia.so." #$version) "lib/xorg/modules/extensions/")) + #:phases + #~(modify-phases %standard-phases + (delete 'strip) + (add-after 'unpack 'create-misc-files + (lambda* (#:key inputs #:allow-other-keys) + ;; Vulkan layer configuration + (for-each (lambda (file) + (substitute* file + (("lib(GLX|nvidia).*\\.so\\..*" all) + (string-append #$output "/lib/" all)))) + (scandir "." (lambda (name) + (string-contains name ".json")))) - ;; ------------------------------ - ;; patchelf - (let* ((libc (assoc-ref inputs "libc")) - (ld.so (string-append libc ,(glibc-dynamic-linker))) + ;; OpenCL vendor ICD configuration + (substitute* "nvidia.icd" + ((".*" all) (string-append #$output "/lib/" all))) - (out (assoc-ref outputs "out")) - (rpath (string-join - (list "$ORIGIN" - (string-append out "/lib") - (string-append libc "/lib") - (string-append (assoc-ref inputs "libx11") "/lib") - (string-append (assoc-ref inputs "libxext") "/lib") - (string-append (assoc-ref inputs "pango") "/lib") - (string-append (assoc-ref inputs "gtk+") "/lib") - (string-append (assoc-ref inputs "gtk2") "/lib") - (string-append (assoc-ref inputs "atk") "/lib") - (string-append (assoc-ref inputs "glib") "/lib") - (string-append (assoc-ref inputs "cairo") "/lib") - (string-append (assoc-ref inputs "gdk-pixbuf") "/lib") - (string-append (assoc-ref inputs "wayland") "/lib") - (string-append (assoc-ref inputs "gcc:lib") "/lib")) - ":"))) - (define (patch-elf file) - (format #t "Patching ~a ...~%" file) - (unless (string-contains file ".so") - (invoke "patchelf" "--set-interpreter" ld.so file)) - (invoke "patchelf" "--set-rpath" rpath file)) - (for-each (lambda (file) - (when (elf-file? file) - (patch-elf file))) - (find-files out ".*\\.so")) - (patch-elf (string-append bindir "/" "nvidia-smi"))) + ;; Add udev rules for nvidia + (let ((rules "90-nvidia.rules")) + (call-with-output-file rules + (lambda (port) + (put-string port (format #f "~ +KERNEL==\"nvidia\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidiactl c $$(@grep@ nvidia-frontend /proc/devices | @cut@ -d \\ -f 1) 255'\" +KERNEL==\"nvidia_modeset\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-modeset c $$(@grep@ nvidia-frontend /proc/devices | @cut@ -d \\ -f 1) 254'\" +KERNEL==\"card*\", SUBSYSTEM==\"drm\", DRIVERS==\"nvidia\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia0 c $$(@grep@ nvidia-frontend /proc/devices | @cut@ -d \\ -f 1) 0'\" +KERNEL==\"nvidia_uvm\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-uvm c $$(@grep@ nvidia-uvm /proc/devices | @cut@ -d \\ -f 1) 0'\" +KERNEL==\"nvidia_uvm\", RUN+=\"@sh@ -c '@mknod@ -m 666 /dev/nvidia-uvm-tools c $$(@grep@ nvidia-uvm /proc/devices | @cut@ -d \\ -f 1) 0'\" +")))) + (substitute* rules + (("@\\<(sh|grep|mknod|cut)\\>@" all cmd) + (search-input-file inputs (string-append "/bin/" cmd))))))) + (add-after 'install 'patch-elf + (lambda _ + (let* ((ld.so (string-append #$(this-package-input "glibc") + #$(glibc-dynamic-linker))) + (rpath (string-join + (list "$ORIGIN" + (string-append #$output "/lib") + (string-append #$gcc:lib "/lib") + (string-append #$gtk+-2 "/lib") + (string-append #$(this-package-input "atk") "/lib") + (string-append #$(this-package-input "cairo") "/lib") + (string-append #$(this-package-input "gdk-pixbuf") "/lib") + (string-append #$(this-package-input "glib") "/lib") + (string-append #$(this-package-input "glibc") "/lib") + (string-append #$(this-package-input "gtk+") "/lib") + (string-append #$(this-package-input "libdrm") "/lib") + (string-append #$(this-package-input "libx11") "/lib") + (string-append #$(this-package-input "libxext") "/lib") + (string-append #$(this-package-input "mesa") "/lib") + (string-append #$(this-package-input "pango") "/lib") + (string-append #$(this-package-input "wayland") "/lib")) + ":"))) + (define (patch-elf file) + (format #t "Patching ~a ..." file) + (unless (string-contains file ".so") + (invoke "patchelf" "--set-interpreter" ld.so file)) + (invoke "patchelf" "--set-rpath" rpath file) + (display " done\n")) + (for-each (lambda (file) + (when (elf-file? file) + (patch-elf file))) + (append (find-files #$output ".*\\.so") + (find-files (string-append #$output "/bin"))))))) + (add-after 'patch-elf 'create-short-name-symlinks + (lambda _ + (define (get-soname file) + (when elf-file? file + (let* ((cmd (string-append "patchelf --print-soname " file)) + (port (open-input-pipe cmd)) + (soname (read-line port))) + (close-pipe port) + soname))) - ;; ------------------------------ - ;; Create short name symbolic links - (for-each (lambda (file) - (let* ((short (regexp-substitute - #f - (string-match "([^/]*\\.so).*" file) - 1)) - (major (if (or (string=? short "libEGL.so") - (string=? short "libEGL_nvidia.so") - (string=? short "libGLX.so") - (string=? short "libGLX_nvidia.so")) - "0" "1")) - (mid (string-append short "." major)) - (short-file (string-append libdir "/" short)) - (mid-file (string-append libdir "/" mid))) - ;; FIXME the same name, print out warning at least - ;; [X] libEGL.so.1.1.0 - ;; [ ] libEGL.so.435.21 - (when (not (file-exists? short-file)) - (format #t "Linking ~a to ~a ...~%" short file) - (symlink (basename file) short-file)) - (when (not (file-exists? mid-file)) - (format #t "Linking ~a to ~a ...~%" mid file) - (symlink (basename file) mid-file)))) - (find-files libdir "\\.so\\.")) - (symlink ,(string-append "libglxserver_nvidia.so." version) - (string-append out "/lib/xorg/modules/extensions/" "libglxserver_nvidia.so"))) - #t))))) - (native-inputs - `(("patchelf" ,patchelf) - ("perl" ,perl) - ("python" ,python-2) - ("which" ,which) - ("xz" ,xz))) + (for-each + (lambda (lib) + (let ((lib-soname (get-soname lib))) + (when (string? lib-soname) + (let* ((soname (string-append + (dirname lib) "/" lib-soname)) + (base (string-append + (regexp-substitute + #f (string-match "(.*)\\.so.*" soname) 1) + ".so")) + (source (basename lib))) + (for-each + (lambda (target) + (unless (file-exists? target) + (format #t "Symlinking ~a -> ~a..." + target source) + (symlink source target) + (display " done\n"))) + (list soname base)))))) + (find-files #$output "\\.so")) + (symlink (string-append "libglxserver_nvidia.so." #$version) + (string-append #$output "/lib/xorg/modules/extensions/" "libglxserver_nvidia.so")) + (symlink (string-append "libnvidia-allocator.so." #$version) + (string-append #$output "/lib/nvidia-drm_gbm.so" ))))))) + (supported-systems '("x86_64-linux")) + (native-inputs (list patchelf)) (inputs - `(("atk" ,atk) - ("bash-minimal" ,bash-minimal) - ("cairo" ,cairo) - ("coreutils" ,coreutils) - ("gcc:lib" ,gcc "lib") - ("gdk-pixbuf" ,gdk-pixbuf) - ("glib" ,glib) - ("grep" ,grep) - ("gtk+" ,gtk+) - ("gtk2" ,gtk+-2) - ("kmod" ,kmod) - ("libc" ,glibc) - ("libx11" ,libx11) - ("libxext" ,libxext) - ("linux" ,linux-lts) - ("pango" ,pango) - ("wayland" ,wayland))) + (list `(,gcc "lib") + atk + bash-minimal + cairo + coreutils + gdk-pixbuf + glib + glibc + grep + gtk+ + gtk+-2 + kmod + libdrm + libx11 + libxext + linux-lts + mesa + pango + wayland)) (home-page "https://www.nvidia.com") - (synopsis "Proprietary Nvidia driver") - (description "This is the evil Nvidia driver. Don't forget to add -nvidia-driver to the udev-rules in your config.scm: -@code{(simple-service 'custom-udev-rules udev-service-type (list nvidia-driver))} -Further xorg should be configured by adding: -@code{(modules (cons* nvidia-driver %default-xorg-modules)) -(drivers '(\"nvidia\"))} to @code{xorg-configuration}.") - (license (license:nonfree (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version))))) + (synopsis "Proprietary NVIDIA driver") + (description + "This is the evil NVIDIA driver. Don't forget to add @code{service +nvidia-service-type} to your @file{config.scm}. Further xorg should be +configured by adding: @code{(modules (cons* nvidia-driver +%default-xorg-modules)) (drivers '(\"nvidia\"))} to @code{xorg-configuration}. +") + (license + (license:nonfree + (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version))))) -(define-public nvidia-libs +(define-public nvidia-firmware + (let ((base nvidia-driver)) + (package + (inherit base) + (name "nvidia-firmware") + (arguments + (list #:install-plan + #~'(("firmware" #$(string-append + "lib/firmware/nvidia/" (package-version base)))) + #:phases + #~(modify-phases %standard-phases + (delete 'strip)))) + (inputs '()) + (native-inputs '()) + (properties `((hidden? . #t)))))) + +(define-public nvidia-exec (package - (name "nvidia-libs") - (version "465.27") + (name "nvidia-exec") + (version "0.1.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pedro00dk/nvidia-exec") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "079alqgz3drv5mvx059fzhj3f20rnljl7r4yihfd5qq7djgmvv0v")))) + (build-system copy-build-system) + (arguments + (list #:install-plan #~`(("nvx" "bin/")) + #:modules #~((guix build copy-build-system) + (guix build utils) + (srfi srfi-1)) + #:phases #~(modify-phases %standard-phases + (add-after 'install 'wrap-nvx + (lambda* (#:key inputs outputs #:allow-other-keys) + (wrap-program (string-append #$output "/bin/nvx") + `("PATH" ":" prefix + ,(fold (lambda (input paths) + (let* ((in (assoc-ref + inputs input)) + (bin (string-append + in "/bin"))) + (append (filter + file-exists? + (list bin)) + paths))) + '() + '("jq" "lshw" "lsof"))))))))) + (inputs (list bash-minimal jq lshw lsof)) + (home-page "https://github.com/pedro00dk/nvidia-exec") + (synopsis "GPU switching without login out for Nvidia Optimus laptops") + (description + "This package provides GPU switching without login out for Nvidia Optimus +laptops.") + (license license-gnu:gpl3+))) + +(define-public nvidia-nvml + (package + (name "nvidia-nvml") + (version "352.79") (source (origin - (uri (format #f "http://us.download.nvidia.com/XFree86/Linux-x86_64/~a/~a.run" - version - (format #f "NVIDIA-Linux-x86_64-~a" version))) - (sha256 (base32 "0w9ivi4z4j4hvhkimr11mgwrj09v53dy39vfdfmamrnybflgysby")) (method url-fetch) - (file-name (string-append "nvidia-driver-" version "-checkout")))) + (uri (string-append "https://developer.download.nvidia.com/compute/cuda/7.5/Prod/gdk/" + (format #f "gdk_linux_amd64_~a_release.run" + (string-replace-substring version "." "_")))) + (sha256 + (base32 + "1r2cwm0j9svaasky3qw46cpg2q6rrazwzrc880nxh6bismyd3a9z")) + (file-name (string-append "nvidia-nvml-" version "-checkout")))) (build-system copy-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (replace 'unpack - (lambda* (#:key inputs #:allow-other-keys #:rest r) - (let ((source (assoc-ref inputs "source"))) - (invoke "sh" source "--extract-only") - (chdir ,(format #f "NVIDIA-Linux-x86_64-~a" version)) - #t))) - (delete 'build) - (delete 'check) - (add-after 'install 'patch-symlink - (lambda* (#:key inputs native-inputs outputs #:allow-other-keys) - (use-modules (ice-9 ftw) - (ice-9 regex) - (ice-9 textual-ports)) - (let* ((out (assoc-ref outputs "out")) - (libdir (string-append out "/lib")) - (bindir (string-append out "/bin")) - (etcdir (string-append out "/etc"))) - ;; ------------------------------ - ;; patchelf - (let* ((libc (assoc-ref inputs "libc")) - (ld.so (string-append libc ,(glibc-dynamic-linker))) - - (out (assoc-ref outputs "out")) - (rpath (string-join - (list "$ORIGIN" - (string-append out "/lib") - (string-append libc "/lib") - (string-append (assoc-ref inputs "atk") "/lib") - (string-append (assoc-ref inputs "cairo") "/lib") - (string-append (assoc-ref inputs "gcc:lib") "/lib") - (string-append (assoc-ref inputs "gdk-pixbuf") "/lib") - (string-append (assoc-ref inputs "glib") "/lib") - (string-append (assoc-ref inputs "gtk+") "/lib") - (string-append (assoc-ref inputs "gtk2") "/lib") - (string-append (assoc-ref inputs "libx11") "/lib") - (string-append (assoc-ref inputs "libxext") "/lib") - (string-append (assoc-ref inputs "pango") "/lib") - (string-append (assoc-ref inputs "wayland") "/lib")) - ":"))) - (define (patch-elf file) - (format #t "Patching ~a ...~%" file) - (unless (string-contains file ".so") - (invoke "patchelf" "--set-interpreter" ld.so file)) - (invoke "patchelf" "--set-rpath" rpath file)) - (for-each (lambda (file) - (when (elf-file? file) - (patch-elf file))) - (find-files out ".*\\.so"))) + (list #:phases + #~(modify-phases %standard-phases + (replace 'unpack + (lambda _ + (invoke "sh" #$source "--tar" "xvf")))) + #:install-plan + ''(("payload/nvml/lib" "lib") + ("payload/nvml/include" "include/nvidia/gdk") + ("payload/nvml/example" "src/gdk/nvml/examples") + ("payload/nvml/doc/man" "share/man") + ("payload/nvml/README.txt" "README.txt") + ("payload/nvml/COPYRIGHT.txt" "COPYRIGHT.txt")))) + (home-page "https://www.nvidia.com") + (synopsis "The NVIDIA Management Library (NVML)") + (description "C-based programmatic interface for monitoring and managing various +states within NVIDIA Tesla GPUs. It is intended to be a platform for +building 3rd party applications, and is also the underlying library for the +NVIDIA-supported nvidia-smi tool. NVML is thread-safe so it is safe to make +simultaneous NVML calls from multiple threads.") + ;; Doesn't have any specific LICENSE file, but see COPYRIGHT.txt for details. + (license (license:nonfree "file://COPYRIGHT.txt")))) - ;; ------------------------------ - ;; Create short name symbolic links - (for-each (lambda (file) - (let* ((short (regexp-substitute - #f +(define-public nvidia-libs + (deprecated-package "nvidia-libs" nvidia-driver)) - (string-match "([^/]*\\.so).*" file) - 1)) - (major (if (or (string=? short "libEGL.so") - (string=? short "libEGL_nvidia.so") - (string=? short "libGLX.so") - (string=? short "libGLX_nvidia.so")) - "0" "1")) - (mid (string-append short "." major)) - (short-file (string-append libdir "/" short)) - (mid-file (string-append libdir "/" mid))) - ;; FIXME the same name, print out warning at least - ;; [X] libEGL.so.1.1.0 - ;; [ ] libEGL.so.435.21 - (when (not (file-exists? short-file)) - (format #t "Linking ~a to ~a ...~%" short file) - (symlink (basename file) short-file)) - (when (not (file-exists? mid-file)) - (format #t "Linking ~a to ~a ...~%" mid file) - (symlink (basename file) mid-file)))) - (find-files libdir "\\.so\\.")) - #t)))) - #:install-plan - ,@(match (%current-system) - ("x86_64-linux" '(`(("." "lib" #:include-regexp ("^./[^/]+\\.so"))))) - ("i686-linux" '(`(("32" "lib" #:include-regexp ("^./[^/]+\\.so"))))) - (_ '())))) - (supported-systems '("i686-linux" "x86_64-linux")) - (native-inputs - `(("patchelf" ,patchelf) - ("perl" ,perl) - ("python" ,python-2) - ("which" ,which) - ("xz" ,xz))) - (inputs - `(("atk" ,atk) - ("cairo" ,cairo) - ("gcc:lib" ,gcc "lib") - ("gdk-pixbuf" ,gdk-pixbuf) - ("glib" ,glib) - ("gtk+" ,gtk+) - ("gtk2" ,gtk+-2) - ("libc" ,glibc) - ("libx11" ,libx11) - ("libxext" ,libxext) - ("wayland" ,wayland))) +(define-public nvidia-module + (package + (name "nvidia-module") + (version nvidia-version) + (source nvidia-source) + (build-system linux-module-build-system) + (arguments + (list #:linux linux-lts + #:source-directory "kernel" + #:tests? #f + #:make-flags + #~(list (string-append "CC=" #$(cc-for-target))) + #:phases + #~(modify-phases %standard-phases + (delete 'strip) + (add-before 'configure 'fixpath + (lambda* (#:key (source-directory ".") #:allow-other-keys) + (substitute* (string-append source-directory "/Kbuild") + (("/bin/sh") (which "sh"))))) + (replace 'build + (lambda* (#:key (make-flags '()) (parallel-build? #t) + (source-directory ".") + inputs + #:allow-other-keys) + (apply invoke "make" "-C" (canonicalize-path source-directory) + (string-append "SYSSRC=" (search-input-directory + inputs "/lib/modules/build")) + `(,@(if parallel-build? + `("-j" ,(number->string + (parallel-job-count))) + '()) + ,@make-flags))))))) (home-page "https://www.nvidia.com") - (synopsis "Libraries of the proprietary Nvidia driver") - (description "These are the libraries of the evil Nvidia driver compatible -with the ones usually provided by Mesa. To use these libraries with -packages that have been compiled with a mesa output, take a look at the nvda -package.") - (license (license:nonfree (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version))))) + (synopsis "Proprietary NVIDIA kernel modules") + (description + "This package provides the evil NVIDIA proprietary kernel modules.") + (license + (license:nonfree + (format #f "file:///share/doc/nvidia-driver-~a/LICENSE" version))))) + +(define-public nvidia-module-open + (let ((base nvidia-module)) + (package/inherit base + (name "nvidia-module-open") + (arguments + (substitute-keyword-arguments (package-arguments base) + ;; NOTE: Kernels compiled with CONFIG_LTO_CLANG_THIN would cause an + ;; error here. See also: + ;; <https://github.com/NVIDIA/open-gpu-kernel-modules/issues/214> + ;; <https://github.com/llvm/llvm-project/issues/55820> + ((#:source-directory _) "kernel-open"))) + (home-page "https://github.com/NVIDIA/open-gpu-kernel-modules") + (synopsis "NVIDIA kernel module") + (description + "This package provides NVIDIA open-gpu-kernel-modules. However, they +are only for the latest GPU architectures Turing and Ampere. Also they still +require firmware file @code{gsp.bin} to be loaded as well as closed source +userspace tools from the corresponding driver release.") + (license license-gnu:gpl2)))) + +(define-public nvidia-settings + (package + (name "nvidia-settings") + (version nvidia-version) + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/NVIDIA/nvidia-settings") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1hplc42115c06cc555cjmw3c9371qn7ibwjpqjybcf6ixfd6lryq")))) + (build-system gnu-build-system) + (arguments + (list #:tests? #f ;no test suite + #:make-flags + #~(list (string-append "PREFIX=" #$output) + (string-append "CC=" #$(cc-for-target))) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-after 'install 'wrap-program + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (wrap-program (string-append out "/bin/nvidia-settings") + `("LD_LIBRARY_PATH" ":" prefix + (,(string-append out "/lib/")))))))))) + (native-inputs (list m4 + pkg-config)) + (inputs (list bash-minimal + dbus + glu + gtk+ + gtk+-2 + libvdpau + libx11 + libxext + libxrandr + libxv + libxxf86vm)) + (synopsis "Nvidia driver control panel") + (description + "This package provides Nvidia driver control panel for monitor +configuration, creating application profiles, gpu monitoring and more.") + (home-page "https://github.com/NVIDIA/nvidia-settings") + (license license-gnu:gpl2))) + +(define-public nvidia-system-monitor + (package + (name "nvidia-system-monitor") + (version "1.5") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/congard/nvidia-system-monitor-qt") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0aghdqljvjmc02g9jpc7sb3yhha738ywny51riska56hkxd3jg2l")))) + (build-system cmake-build-system) + (arguments + (list #:tests? #f + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'fix-nvidia-smi + (lambda _ + (let ((nvidia-smi (string-append #$(this-package-input + "nvidia-driver") + "/bin/nvidia-smi"))) + (substitute* "src/core/InfoProvider.cpp" + (("nvidia-smi") + nvidia-smi)) + (substitute* "src/main.cpp" + (("which nvidia-smi") + (string-append "which " nvidia-smi)) + (("exec..nvidia-smi") + (string-append "exec(\"" nvidia-smi)))))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((bin (string-append #$output "/bin"))) + (mkdir-p bin) + (install-file "qnvsm" bin))))))) + (inputs (list qtbase-5 qtdeclarative-5 nvidia-driver)) + (home-page "https://github.com/congard/nvidia-system-monitor-qt") + (synopsis "Task manager for Nvidia graphics cards") + (description + "This package provides a task manager for Nvidia graphics cards.") + (license license-gnu:expat))) ;; nvda is used as a name because it has the same length as mesa which is ;; required for grafting (define-public nvda (package - (inherit nvidia-libs) + (inherit nvidia-driver) (name "nvda") (source #f) (build-system trivial-build-system) (arguments - '(#:modules ((guix build union)) - #:builder (begin - (use-modules (guix build union) - (srfi srfi-1) - (ice-9 regex)) - (union-build (assoc-ref %outputs "out") - (list (assoc-ref %build-inputs "mesa") (assoc-ref %build-inputs "nvidia-libs")) - #:resolve-collision (lambda (files) (let ((file - (if (string-match "nvidia-libs" (first files)) - (first files) - (last files)))) - (format #t "chosen ~a ~%" file) - file))) - #t))) - (description "These are the libraries of the evil Nvidia driver, -packaged in such a way that you can use the transformation option -@code{--with-graft=mesa=nvda} to use the nvidia driver with a package that requires mesa.") - (inputs - `(("nvidia-libs" ,nvidia-libs) - ("mesa" ,mesa))) + (list #:modules '((guix build union)) + #:builder + #~(begin + (use-modules (guix build union) + (srfi srfi-1) + (ice-9 regex)) + (union-build #$output + (list #$(this-package-input "mesa") + #$(this-package-input "nvidia-driver")) + #:resolve-collision + (lambda (files) + (let ((file (if (string-match "nvidia-driver" + (first files)) + (first files) + (last files)))) + (format #t "chosen ~a ~%" file) + file)))))) + (description + "These are the libraries of the evil NVIDIA driver, packaged in such a +way that you can use the transformation option @code{--with-graft=mesa=nvda} +to use the NVIDIA driver with a package that requires mesa.") + (inputs (list mesa nvidia-driver)) (outputs '("out")))) (define mesa/fake diff --git a/nongnu/packages/playonlinux.scm b/nongnu/packages/playonlinux.scm index 7a7c727..8027c2d 100644 --- a/nongnu/packages/playonlinux.scm +++ b/nongnu/packages/playonlinux.scm @@ -1,20 +1,5 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (nongnu packages playonlinux) #:use-module ((guix licenses) :prefix license:) @@ -38,7 +23,7 @@ (define-public playonlinux (package (name "playonlinux") - (version "4.3.4") + (version "4.4") (source (origin (method git-fetch) (uri (git-reference @@ -46,7 +31,7 @@ (commit version))) (sha256 (base32 - "0xzdi6x4ksn4jiqa0z8j4rangn0aj1y7kqykan464mp2l585y76v")))) + "0jw43fmc298gb7ga2aldcdyrwlhki5k6hc198pl5x987x4gxfg2h")))) (build-system python-build-system) (arguments `(#:python ,python-2 @@ -100,18 +85,18 @@ (string-append out "/share/playonlinux/lang/locale"))) #t))))) (inputs - `(("cabextract" ,cabextract) - ("curl" ,curl) - ("gnupg" ,gnupg) - ("imagemagick" ,imagemagick) - ("jq" ,jq) - ("libx11" ,libx11) - ("mesa" ,mesa) - ("netcat" ,netcat) - ("python2-wxpython" ,python2-wxpython) - ("wget" ,wget) - ("wine" ,wine) - ("xrdb" ,xrdb))) + (list cabextract + curl + gnupg + imagemagick + jq + libx11 + mesa + netcat + python-wxpython + wget + wine + xrdb)) (home-page "https://www.playonlinux.com/") (synopsis "Easy installer for Windows games") (description "PlayOnLinux is a piece of software which allows you to easily diff --git a/nongnu/packages/printers.scm b/nongnu/packages/printers.scm new file mode 100644 index 0000000..f14988d --- /dev/null +++ b/nongnu/packages/printers.scm @@ -0,0 +1,197 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com> +;;; Copyright © 2021 Kahka F +;;; Copyright © 2021, 2023 Jonathan Brielmaier <jonathan.brielmaier@web.de> + +(define-module (nongnu packages printers) + #:use-module (gnu packages) + #:use-module (gnu packages cups) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (srfi srfi-1) + #:use-module (guix download) + #:use-module (guix build utils) + #:use-module (nonguix build-system binary) + #:use-module (nonguix licenses)) + +(define-public hplip-plugin + (package + (inherit hplip) + (name "hplip-plugin") + (description "Hewlett-Packard printer drivers with nonfree plugin.") + (source (origin (inherit (package-source hplip)) + (snippet + (delete '(for-each + delete-file + (find-files "." (lambda + (file stat) + (elf-file? file)))) + (origin-snippet (package-source hplip)))))) + (inputs (alist-delete "python-pyqt" (package-inputs hplip))) + (native-inputs + (append + `(("hplip-plugin" + ,(origin + (method url-fetch) + (uri (string-append "https://developers.hp.com/sites/default/files/hplip-" + (package-version hplip) "-plugin.run")) + (sha256 + (base32 + "1ffqnmmghxqclv66qq14wypfha2xalcrbrjw0dqkmpvbnzwbn49g"))))) + (package-native-inputs hplip))) + (arguments + (substitute-keyword-arguments + (package-arguments hplip) + ((#:configure-flags cf) + `(delete "--enable-qt5" ,cf)) + ((#:phases ph) + `(modify-phases + ,ph + (replace + 'fix-hard-coded-file-names + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + ;; FIXME: use merged ppds (I think actually only + ;; drvs need to be merged). + (cupsdir (assoc-ref inputs "cups-minimal"))) + (substitute* "base/g.py" + (("'/usr/share;[^']*'") + (string-append "'" cupsdir "/share'")) + (("'/etc/hp/hplip.conf'") + (string-append "'" out + "/etc/hp/hplip.conf" "'")) + (("/var/lib/hp") + (string-append + out + "/var/lib/hp"))) + + (substitute* "Makefile.in" + (("[[:blank:]]check-plugin\\.py[[:blank:]]") " ") + ;; FIXME Use beginning-of-word in regexp. + (("[[:blank:]]plugin\\.py[[:blank:]]") " ") + (("/usr/include/libusb-1.0") + (string-append (assoc-ref inputs "libusb") + "/include/libusb-1.0")) + (("hplip_statedir =.*$") + ;; Don't bail out while trying to create + ;; /var/lib/hplip. We can safely change its value + ;; here because it's hard-coded in the code anyway. + "hplip_statedir = $(prefix)/var/lib/hp\n") + (("hplip_confdir = /etc/hp") + ;; This is only used for installing the default config. + (string-append "hplip_confdir = " out + "/etc/hp")) + (("halpredir = /usr/share/hal/fdi/preprobe/10osvendor") + ;; We don't use hal. + (string-append "halpredir = " out + "/share/hal/fdi/preprobe/10osvendor")) + (("rulesdir = /etc/udev/rules.d") + ;; udev rules will be merged by base service. + (string-append "rulesdir = " out + "/lib/udev/rules.d")) + (("rulessystemdir = /usr/lib/systemd/system") + ;; We don't use systemd. + (string-append "rulessystemdir = " out + "/lib/systemd/system")) + (("/etc/sane.d") + (string-append out "/etc/sane.d"))) + + (substitute* "common/utils.h" + (("/var/lib/hp") + (string-append + out + "/var/lib/hp"))) + #t))) + (add-after + 'install-models-dat 'install-plugins + (lambda* (#:key outputs system inputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (state-dir (string-append out "/var/lib/hp")) + (hp-arch (assoc-ref + '(("i686-linux" . "x86_32") + ("x86_64-linux" . "x86_64") + ("armhf-linux" . "arm32") + ("aarch64-linux" . "aarch64")) + system))) + (unless hp-arch + (error (string-append + "HPLIP plugin not supported on " + system))) + (invoke "sh" (assoc-ref inputs "hplip-plugin") + "--noexec" "--keep") + (chdir "plugin_tmp") + (install-file "plugin.spec" + (string-append out "/share/hplip/")) + + (for-each + (lambda (file) + (install-file + file + (string-append out "/share/hplip/data/firmware"))) + (find-files "." "\\.fw.gz$")) + + (install-file "license.txt" + (string-append out "/share/hplip/data/plugins")) + (mkdir-p + (string-append out "/share/hplip/prnt/plugins")) + (for-each + (lambda (type plugins) + (for-each + (lambda (plugin) + (let ((file (string-append plugin "-" hp-arch ".so")) + (dir (string-append out "/share/hplip/" + type "/plugins"))) + (install-file file dir) + (chmod (string-append dir "/" file) #o755) + (symlink (string-append dir "/" file) + (string-append dir "/" plugin ".so")))) + plugins)) + '("prnt" "scan") + '(("lj" "hbpl1") + ("bb_soap" "bb_marvell" "bb_soapht" "bb_escl"))) + (mkdir-p state-dir) + (call-with-output-file + (string-append state-dir "/hplip.state") + (lambda (port) + (simple-format port "[plugin] +installed=1 +eula=1 +version=~A +" ,(package-version hplip)))) + + (substitute* (string-append out "/etc/hp/hplip.conf") + (("/usr") out)) + #t))))))))) + +(define-public samsung-unified-printer + (package + (name "samsung-unified-printer") + (version "1.00.37") + (source + (origin + (method url-fetch) + (uri (string-append "https://www.bchemnet.com/suldr/driver/UnifiedLinuxDriver" + version ".tar.gz")) + (sha256 + (base32 + "03jl2hw7rjcq0cpsq714yaw40v73lsm1qa5z4q2m0i36hhxj2f0c")))) + (build-system binary-build-system) + (arguments + (list + #:install-plan + #~'(("noarch/license/eula.txt" "/share/doc/samsung-unified-printer/") + ("noarch/share/ppd/" "/share/ppd/samsung/") + ("x86_64/rastertospl" "/lib/cups/filter/")) + #:patchelf-plan + #~'(("x86_64/rastertospl" ("cups-minimal"))) + #:strip-binaries? #f)) + (inputs + (list cups-minimal)) + (synopsis "Propriatary Samsung printer drivers") + (description "Samsung Unified Linux Driver provides propriatary printer +drivers for laser and multifunctional printers.") + (supported-systems '("x86_64-linux")) ;; TODO: install i686 files + ;; Samsung printers are part of HP since 2016 + (home-page "https://support.hp.com/us-en/drivers/printers") + (license (nonfree "file://eula.txt")))) diff --git a/nongnu/packages/radio.scm b/nongnu/packages/radio.scm new file mode 100644 index 0000000..a7ed2c3 --- /dev/null +++ b/nongnu/packages/radio.scm @@ -0,0 +1,111 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022 Guillaume Le Vaillant <glv@posteo.net> + +(define-module (nongnu packages radio) + #:use-module (gnu packages gcc) + #:use-module (gnu packages linux) + #:use-module (gnu packages radio) + #:use-module (guix build-system cmake) + #:use-module (guix download) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix licenses) + #:use-module (guix packages) + #:use-module (guix utils) + #:use-module (ice-9 match) + #:use-module (nonguix build-system binary) + #:use-module (nonguix licenses)) + +(define-public sdrplay + (package + (name "sdrplay") + (version "3.07.1") + (source + (origin + (method url-fetch) + (uri (string-append "https://www.sdrplay.com/software/" + "SDRplay_RSP_API-Linux-" version ".run")) + (sha256 + (base32 "1a25c7rsdkcjxr7ffvx2lwj7fxdbslg9qhr8ghaq1r53rcrqgzmf")))) + (build-system binary-build-system) + (supported-systems '("i686-linux" "x86_64-linux")) + (inputs + `(("eudev" ,eudev) + ("gcc:lib" ,gcc "lib"))) + (arguments + (let ((arch (match (or (%current-target-system) + (%current-system)) + ("i686-linux" "i686") + ("x86_64-linux" "x86_64") + (_ "UNSUPPORTED"))) + (major (version-major version)) + (major-minor (version-major+minor version))) + (list + #:patchelf-plan + #~(list + (list (string-append #$arch "/libsdrplay_api.so." #$major-minor) + '("gcc:lib")) + (list (string-append #$arch "/sdrplay_apiService") + '("eudev" "gcc:lib"))) + #:install-plan + #~(list '("66-mirics.rules" "lib/udev/rules.d/66-mirics.rules") + '("inc" "include") + (list (string-append #$arch "/libsdrplay_api.so." #$major-minor) + (string-append "lib/libsdrplay_api.so." #$major-minor)) + (list (string-append #$arch "/sdrplay_apiService") + "bin/sdrplay_apiService") + (list "sdrplay_license.txt" + (string-append "share/doc/sdrplay-" #$version + "/license.txt"))) + #:phases + #~(modify-phases %standard-phases + (replace 'unpack + (lambda* (#:key inputs #:allow-other-keys) + (let ((source-script (assoc-ref inputs "source"))) + (invoke "sh" source-script + "--noexec" "--target" "source") + (chdir "source")))) + (add-after 'install 'create-library-links + (lambda _ + (let* ((lib (string-append #$output "/lib/libsdrplay_api.so")) + (lib-major (string-append lib "." #$major)) + (lib-major-minor (string-append lib "." #$major-minor))) + (symlink lib-major-minor lib-major) + (symlink lib-major lib)))))))) + (home-page "https://www.sdrplay.com") + (synopsis "API for SDRplay RSP devices") + (description + "This package provides the library and API service for using SDRplay RSP +devices. + +To install the udev rules, you must extend @code{udev-service-type} with this +package. E.g.: @code{(udev-rules-service 'sdrplay sdrplay)}") + (license (nonfree (string-append "file:///share/doc/sdrplay-" + version + "/license.txt"))))) + +(define-public soapysdrplay3 + (let ((commit "9e5c80c45454db56b8b10bb997369f37e750631b") + (revision "1")) + (package + (name "soapysdrplay3") + (version (git-version "0.4.1" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/pothosware/SoapySDRPlay3") + (commit commit))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1sl3i1id0fily7qfm0yihxsaqy4f4gr85vl5ip05azhhbrnmnayx")))) + (build-system cmake-build-system) + (inputs + (list sdrplay soapysdr)) + (arguments + `(#:tests? #f)) ; No test suite + (home-page "https://github.com/pothosware/SoapySDRPlay3/wiki") + (synopsis "SoapySDR SDRplay module") + (description "This package provides SDRplay devices support to the +SoapySDR library.") + (license expat)))) diff --git a/nongnu/packages/scanner.scm b/nongnu/packages/scanner.scm index 9a8b3cf..ab4772f 100644 --- a/nongnu/packages/scanner.scm +++ b/nongnu/packages/scanner.scm @@ -1,20 +1,5 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (nongnu packages scanner) #:use-module (ice-9 match) diff --git a/nongnu/packages/steam-client.scm b/nongnu/packages/steam-client.scm index 7e91af8..08baba8 100644 --- a/nongnu/packages/steam-client.scm +++ b/nongnu/packages/steam-client.scm @@ -1,23 +1,10 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2020 pkill-9 ;;; Copyright © 2020, 2021 ison <ison@airmail.cc> ;;; Copyright © 2021 pineapples ;;; Copyright © 2021 Jean-Baptiste Volatier <jbv@pm.me> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +;;; Copyright © 2021 Kozo <kozodev@runbox.com> +;;; Copyright © 2021, 2022 John Kehayias <john.kehayias@protonmail.com> ;;; The steam script provided by this package may optionally be started as ;;; a shell instead of automatically launching Steam by setting the @@ -31,7 +18,7 @@ ;;; A container wrapper creates the following store items: ;;; * Main container package [nonguix-container->package] (basically a dummy ;;; package with symlink to wrapper script) -;;; - Wrapper script [make-container-wrapper] (runs "guix environment") +;;; - Wrapper script [make-container-wrapper] (runs "guix shell") ;;; References: ;;; -> manifest.scm [make-container-manifest] (used by wrapper to guarantee ;;; exact store items) @@ -49,30 +36,48 @@ ;;; module is apparently disallowed inside build phases. (define-module (nongnu packages steam-client) + #:use-module ((guix licenses) #:prefix license:) #:use-module ((nonguix licenses) #:prefix license:) #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix utils) #:use-module (guix packages) #:use-module (guix records) #:use-module (guix download) #:use-module (guix build-system gnu) + #:use-module (guix build-system python) #:use-module (guix build-system trivial) #:use-module (guix transformations) + #:use-module (gnu packages) #:use-module (gnu packages audio) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages certs) #:use-module (gnu packages compression) + #:use-module (gnu packages elf) #:use-module (gnu packages file) #:use-module (gnu packages fonts) #:use-module (gnu packages fontutils) + #:use-module (gnu packages freedesktop) #:use-module (gnu packages gawk) #:use-module (gnu packages gcc) #:use-module (gnu packages gl) #:use-module (gnu packages glib) + #:use-module (gnu packages gnome) + #:use-module (gnu packages graphics) + #:use-module (gnu packages libbsd) + #:use-module (gnu packages libusb) #:use-module (gnu packages linux) + #:use-module (gnu packages llvm) + #:use-module (gnu packages logging) #:use-module (nongnu packages nvidia) + #:use-module (gnu packages pciutils) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages python) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages toolkits) + #:use-module (gnu packages video) #:use-module (nonguix utils)) (define-record-type* <nonguix-container> @@ -102,7 +107,7 @@ (define steam-client (package (name "steam-client") - (version "1.0.0.61") + (version "1.0.0.75") (source (origin (method url-fetch) @@ -110,32 +115,27 @@ version ".tar.gz")) (sha256 (base32 - "0c5xy57gwr14vp3wy3jpqi5dl6y7n01p2dy4jlgl9bf9x7616r6n")) + "19rn29slsxv7b5fisr1jzn79bskzifbj5hmxqn2436ivwfjna9g5")) (file-name (string-append name "-" version ".tar.gz")))) (build-system gnu-build-system) (arguments - `(#:tests? #f + `(#:tests? #f ; There are no tests. + #:validate-runpath? #f ; Looks for bin/steam which doesn't exist. #:make-flags (list "PREFIX=" (string-append "DESTDIR=" (assoc-ref %outputs "out"))) #:phases (modify-phases %standard-phases - (replace 'configure + (delete 'configure) + ;; Patch Makefile so it creates links to the store rather than /lib. + (add-after 'unpack 'patch-makefile (lambda _ - (mkdir-p "bootstrap-temp") - (invoke "tar" "xfa" "bootstraplinux_ubuntu12_32.tar.xz" - "-C" "bootstrap-temp") - (substitute* "bootstrap-temp/steam.sh" - (("export LD_LIBRARY_PATH=\"") - "export LD_LIBRARY_PATH=\"${LD_LIBRARY_PATH-}:")) - (substitute* "bootstrap-temp/ubuntu12_32/steam-runtime/run.sh" - (("^export LD_LIBRARY_PATH=.*") - "export LD_LIBRARY_PATH=\"${LD_LIBRARY_PATH-}:$steam_runtime_library_paths\"")) - (invoke "tar" "cfJ" "bootstraplinux_ubuntu12_32.tar.xz" "-C" "bootstrap-temp" - "linux32" "ubuntu12_32" "steam.sh" "steamdeps.txt") - (delete-file-recursively "bootstrap-temp"))) + (substitute* "Makefile" + (("-fns ") + "-fns $(DESTDIR)")))) + (delete 'patch-dot-desktop-files) (add-after 'unpack 'patch-startscript (lambda _ - (substitute* "steam" + (substitute* "bin_steam.sh" (("/usr") (assoc-ref %outputs "out"))))) (add-after 'patch-dot-desktop-files 'patch-desktop-file (lambda _ @@ -152,34 +152,40 @@ (add-after 'install-binaries 'post-install (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref %outputs "out"))) - ;; Steamdeps installs missing packages, which doesn't work with Guix. - (delete-file (string-append out "/bin/steamdeps")) - (wrap-program (string-append out "/bin/steam") - '("LD_LIBRARY_PATH" prefix - ("/lib" - "/lib/alsa-lib" - "/lib/dri" - "/lib/nss" - "/lib/vdpau" - "/lib64" - "/lib64/alsa-lib" - "/lib64/dri" - "/lib64/nss" - "/lib64/vdpau"))) - ;; .steam-real will fail unless it is renamed to exactly "steam". - (rename-file (string-append out "/bin/steam") - (string-append out "/bin/steam-wrapper")) - (rename-file (string-append out "/bin/.steam-real") - (string-append out "/bin/steam")) - (substitute* (string-append out "/bin/steam-wrapper") - (("\\.steam-real") "steam")))))))) + (delete-file (string-append out "/lib/steam/bin_steamdeps.py")) + (delete-file (string-append out "/bin/steamdeps")))))))) (home-page "https://store.steampowered.com") (synopsis "Digital distribution platform for managing and playing games") (description "Steam is a digital software distribution platform created by Valve.") (license (license:nonfree "file:///share/doc/steam/steam_subscriber_agreement.txt")))) +(define glibc-for-fhs + (package + (inherit glibc) + (name "glibc-for-fhs") + (source (origin (inherit (package-source glibc)) + ;; Remove Guix's patch to read ld.so.cache from /gnu/store + ;; directories, re-enabling the default /etc/ld.so.cache + ;; behavior. + (patches (delete (car (search-patches "glibc-dl-cache.patch")) + (origin-patches (package-source glibc)))))))) + +;; After guix commit to add a replacement for expat (security fixes), +;; https://git.savannah.gnu.org/cgit/guix.git/commit/?id=2045852b096131a714409aa0cc4fe17938f60b15 +;; a profile collision happens with the propagated expat (now grafted) from +;; fontconfig. See upstream report https://issues.guix.gnu.org/53406 +;; So we define a fontconfig variation that explicitly does the expat replacement +;; which works around this bug for now, at the cost of building fontconfig. +;; TODO: remove once upstream bug is fixed +(define fontconfig-fixed + (package + (inherit fontconfig) + (propagated-inputs + (modify-inputs (package-propagated-inputs fontconfig) + (replace "expat" (@@ (gnu packages xml) expat/fixed)))))) + (define fhs-min-libs - `(("glibc" ,glibc) + `(("glibc" ,glibc-for-fhs) ("glibc-locales" ,glibc-locales))) (define steam-client-libs @@ -187,27 +193,47 @@ ("coreutils" ,coreutils) ("diffutils" ,diffutils) ("dbus-glib" ,dbus-glib) ; Required for steam browser. - ("fontconfig" ,fontconfig) ; Required for steam client. + ("elfutils" ,elfutils) ; Required for capturing library dependencies in pv. + ("eudev" ,eudev) ; Required for steamwebhelper/heavy runtime. + ;; TODO: set back to ,fontconfig once https://issues.guix.gnu.org/53406 is fixed + ("fontconfig" ,fontconfig-fixed) ; Required for steam client. ("file" ,file) ; Used for steam installation. + ("find" ,findutils) ; Required at least for some logging. ("freetype" ,freetype) ; Required for steam login. ("gawk" ,gawk) ("gcc:lib" ,gcc "lib") ; Required for steam startup. ("grep" ,grep) + ("libbsd" ,libbsd) + ("libcap" ,libcap) ; Required for SteamVR, but needs pkexec too. + ("libusb" ,libusb) ; Required for SteamVR. + ("libva" ,libva) ; Required for hardware video encoding/decoding. + ("libvdpau" ,libvdpau) ; Required for hardware video encoding/decoding. + ("libvdpau-va-gl" ,libvdpau-va-gl) ; Additional VDPAU support. + ("llvm" ,llvm-11) ; Required for mesa. ("mesa" ,mesa) ; Required for steam startup. ("nss-certs" ,nss-certs) ; Required for steam login. + ("pciutils" ,pciutils) ; Tries to run lspci at steam startup. + ("procps" ,procps) ("sed" ,sed) ("tar" ,tar) + ("usbutils" ,usbutils) ; Required for SteamVR. ("util-linux" ,util-linux) ; Required for steam login. - ("xz" ,xz))) + ("wayland" ,wayland) ; Required for mesa vulkan (e.g. libvulkan_radeon). + ("flatpak-xdg-utils" ,flatpak-xdg-utils) + ("xz" ,xz) + ("zenity" ,zenity))) ; Required for progress dialogs. (define steam-gameruntime-libs `(("alsa-lib" ,alsa-lib) ; Required for audio in most games. ("alsa-plugins:pulseaudio" ,alsa-plugins "pulseaudio") ; Required for audio in most games. ("font-dejavu" ,font-dejavu) ("font-liberation" ,font-liberation) + ("imgui" ,imgui-1.86) ; Required for MangoHud. + ("mangohud" ,mangohud) ("openal" ,openal) ; Prevents corrupt audio in Crypt of the Necrodancer. ("pulseaudio" ,pulseaudio) ; Prevents corrupt audio in Sven Coop. - ("python" ,python))) ; Required for KillingFloor2 and Wreckfest. + ("python" ,python) ; Required for KillingFloor2 and Wreckfest. + ("spdlog" ,spdlog))) ; Required for MangoHud. (define* (fhs-union inputs #:key (name "fhs-union") (version "0.0") (system "x86_64-linux")) "Create a package housing the union of inputs." @@ -234,6 +260,65 @@ (description "Libraries needed to build a guix container FHS.") (license #f))) +(define (ld.so.conf->ld.so.cache ld-conf) + "Create a ld.so.cache file-like object from an ld.so.conf file." + (computed-file + "ld.so.cache" + (with-imported-modules + `((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (let ((ldconfig (string-append #$glibc "/sbin/ldconfig"))) + (invoke ldconfig + "-X" ; Don't update symbolic links. + "-f" #$ld-conf ; Use #$ld-conf as configuration file. + "-C" #$output)))))) ; Use #$output as cache file. + +(define (packages->ld.so.conf packages) + "Takes a list of package objects and returns a file-like object for ld.so.conf +in the Guix store" + (computed-file + "ld.so.conf" + (with-imported-modules + `((guix build union) + (guix build utils)) + #~(begin + (use-modules (guix build union) + (guix build utils)) + ;; Need to quote "#$packages" as #$packages tries to "apply" the first item to the rest, like a procedure. + (let* ((packages '#$packages) + ;; Add "/lib" to each package. + ;; TODO Make this more general for other needed directories. + (dirs-lib + (lambda (packages) + (map (lambda (package) + (string-append package "/lib")) + packages))) + (fhs-lib-dirs + (dirs-lib packages))) + (call-with-output-file #$output + (lambda (port) + (for-each (lambda (directory) + (display directory port) + (newline port)) + fhs-lib-dirs))) + #$output))))) + +(define steam-ld.so.conf + (packages->ld.so.conf + (list (fhs-union `(,@steam-client-libs + ,@steam-gameruntime-libs + ,@fhs-min-libs) + #:name "fhs-union-64") + (fhs-union `(,@steam-client-libs + ,@steam-gameruntime-libs + ,@fhs-min-libs) + #:name "fhs-union-32" + #:system "i686-linux")))) + +(define steam-ld.so.cache + (ld.so.conf->ld.so.cache steam-ld.so.conf)) + (define (nonguix-container->package container) "Return a package with wrapper script to launch the supplied container object in a sandboxed FHS environment." @@ -323,26 +408,50 @@ in a sandboxed FHS environment." (preserved-env '("^DBUS_" "^DISPLAY$" "^DRI_PRIME$" + "^GDK_SCALE$" ; For Steam UI scaling. + "^PRESSURE_VESSEL_" ; For pressure vessel options. "_PROXY$" "_proxy$" "^SDL_" "^STEAM_" + "^VDPAU_DRIVER_PATH$" ; For VDPAU drivers. "^XAUTHORITY$" ;; Matching all ^XDG_ vars causes issues ;; discussed in 80decf05. "^XDG_DATA_HOME$" - "^XDG_RUNTIME_DIR$")) - (expose `("/dev/dri" + "^XDG_RUNTIME_DIR$" + ;; The following are useful for debugging. + "^CAPSULE_DEBUG$" + "^G_MESSAGES_DEBUG$" + "^LD_DEBUG$" + "^LIBGL_DEBUG$")) + (expose `("/dev/bus/usb" ; Needed for libusb. + "/dev/dri" "/dev/input" ; Needed for controller input. - ,@(exists-> "/etc/machine-id") - "/sys/class/input" ; Needed for controller input. - "/sys/dev" + "/dev/uinput" ; Needed for Steam Input. ,@(exists-> "/dev/nvidia0") ; needed for nvidia proprietary driver ,@(exists-> "/dev/nvidiactl") ,@(exists-> "/dev/nvidia-modeset") + ,@(exists-> "/etc/machine-id") + "/etc/localtime" ; Needed for correct time zone. + "/sys/class/drm" ; Needed for hw monitoring like MangoHud. + "/sys/class/hwmon" ; Needed for hw monitoring like MangoHud. + "/sys/class/hidraw" ; Needed for devices like the Valve Index. + "/sys/class/input" ; Needed for controller input. + ,@(exists-> "/sys/class/power_supply") ; Needed for power monitoring like MangoHud. + ,@(exists-> "/sys/class/powercap") ; Needed for power monitoring like MangoHud. + "/sys/dev" "/sys/devices" ,@(exists-> "/var/run/dbus"))) - (share `("/dev/shm" + ;; /dev/hidraw is needed for SteamVR to access the HMD, although here we + ;; share all hidraw devices. Instead we could filter to only share specific + ;; device. See, for example, this script: + ;; https://arvchristos.github.io/post/matching-dev-hidraw-devices-with-physical-devices/ + (share `(,@(find-files "/dev" "hidraw") + "/dev/shm" + ;; "/tmp/.X11-unix" is needed for bwrap, and "/tmp" more generally + ;; for writing things like crash dumps and "steam_chrome_shm". + "/tmp" ,(string-append sandbox-home "=" home) ,@(exists-> (string-append home "/.config/pulse")) ,@(exists-> (string-append xdg-runtime "/pulse")) @@ -352,6 +461,15 @@ in a sandboxed FHS environment." (args (cdr (command-line))) (command (if DEBUG '() `("--" ,run ,@args)))) + ;; TODO: Remove once upstream change is merged and in stable pressure-vessel + ;; (although may want to hold off for anyone using older pressure-vessel versions + ;; for whatever reason), see: + ;; https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/merge_requests/406 + (setenv "PRESSURE_VESSEL_FILESYSTEMS_RO" "/gnu/store") + ;; By default VDPAU drivers are searched for in libvdpau's store + ;; path, so set this path to where the drivers will actually be + ;; located in the container. + (setenv "VDPAU_DRIVER_PATH" "/lib64/vdpau") (format #t "\n* Launching ~a in sandbox: ~a.\n\n" #$(package-name (ngc-wrap-package container)) sandbox-home) (when DEBUG @@ -362,8 +480,8 @@ in a sandboxed FHS environment." "--start" "--exit-idle-time=60") (apply invoke - `("guix" "environment" - "--ad-hoc" "--container" "--no-cwd" "--network" + `("guix" "shell" + "--container" "--no-cwd" "--network" ,@(map preserve-var preserved-env) ,@(map add-path expose) ,@(map (lambda (item) @@ -439,13 +557,18 @@ environment.") "Return an fhs-internal script which is used to perform additional steps to set up the environment inside an FHS container before launching the desired application." - (let* ((pkg (ngc-wrap-package container)) + ;; The ld cache is not created inside the container, meaning the paths it + ;; contains are directly to /gnu/store/. Instead, it could be generated with + ;; a generic ld.so.conf and result in paths more typical in an FHS distro, + ;; like /lib within the container. This may be useful for future compatibility. + (let* ((ld.so.conf steam-ld.so.conf) + (ld.so.cache steam-ld.so.cache) + (pkg (ngc-wrap-package container)) (run (ngc-run container))) (program-file (ngc-internal-name container) (with-imported-modules - `((guix build utils) - (ice-9 getopt-long)) + `((guix build utils)) #~(begin (use-modules (guix build utils) (ice-9 getopt-long)) @@ -466,6 +589,8 @@ application." (let* ((guix-env (getenv "GUIX_ENVIRONMENT")) (union64 #$(file-append (ngc-union64 container))) (union32 #$(file-append (ngc-union32 container))) + (ld.so.conf #$(file-append ld.so.conf)) + (ld.so.cache #$(file-append ld.so.cache)) (all-args (cdr (command-line))) (fhs-args (member "--" all-args)) (steam-args (if fhs-args @@ -478,32 +603,47 @@ application." '("/run/current-system/profile/etc" "/run/current-system/profile/share" "/sbin" - "/usr/bin" - "/usr/share/vulkan/icd.d")) + "/usr/share/vulkan/icd.d" + "/usr/share/vulkan/implicit_layer.d")) ; Implicit layers like MangoHud (for-each new-symlink - `(((,guix-env "etc/ssl") . "/etc/ssl") + `((,ld.so.cache . "/etc/ld.so.cache") + (,ld.so.conf . "/etc/ld.so.conf") ;; needed? + ((,guix-env "etc/ssl") . "/etc/ssl") ((,guix-env "etc/ssl") . "/run/current-system/profile/etc/ssl") ((,union32 "lib") . "/lib") ((,union32 "lib") . "/run/current-system/profile/lib") ((,union64 "bin") . "/bin") - ((,union64 "bin/env") . "/usr/bin/env") + ((,union64 "bin") . "/usr/bin") ; Steam hardcodes some paths like xdg-open. ((,union64 "lib") . "/lib64") ((,union64 "lib") . "/run/current-system/profile/lib64") ((,union64 "lib/locale") . "/run/current-system/locale") ((,union64 "sbin/ldconfig") . "/sbin/ldconfig") ((,union64 "share/drirc.d") . "/usr/share/drirc.d") ((,union64 "share/fonts") . "/run/current-system/profile/share/fonts") + ((,union64 "etc/fonts") . "/etc/fonts") ((,union64 "share/vulkan/explicit_layer.d") . - "/usr/share/vulkan/explicit_layer.d"))) + "/usr/share/vulkan/explicit_layer.d") + ;; The MangoHud layer has the same file name for 64- and 32-bit, + ;; so create links with different names. + ((,union64 "share/vulkan/implicit_layer.d/MangoHud.json") . + "/usr/share/vulkan/implicit_layer.d/MangoHud.json") + ((,union32 "share/vulkan/implicit_layer.d/MangoHud.json") . + "/usr/share/vulkan/implicit_layer.d/MangoHud.x86.json"))) (for-each icd-symlink + ;; Use stat to follow links from packages like MangoHud. `(,@(find-files (string-append union32 "/share/vulkan/icd.d") - #:directories? #t) + #:directories? #t #:stat stat) ,@(find-files (string-append union64 "/share/vulkan/icd.d") - #:directories? #t))) + #:directories? #t #:stat stat))) + ;; TODO: Is this the right place for this? + ;; Newer versions of Steam won't startup if they can't copy to here + ;; (previous would output this error but continue). + (if (file-exists? ".steam/root/bootstrap.tar.xz") + (chmod ".steam/root/bootstrap.tar.xz" #o644)) - ;; Process FHS-specific command line options + ;; Process FHS-specific command line options. (let* ((options (getopt-long (or fhs-args '("")) fhs-option-spec)) (asound32-opt (option-ref options 'asound32 #f)) (asound-lib (if asound32-opt "lib" "lib64"))) @@ -543,7 +683,7 @@ ctl.!default { (nonguix-container (name "steam") (wrap-package steam-client) - (run "/bin/steam-wrapper") + (run "/bin/steam") (union64 (fhs-union `(,@steam-client-libs ,@steam-gameruntime-libs @@ -567,7 +707,7 @@ all games will be installed.")))) (nonguix-container (name "steam-nvidia") (wrap-package steam-client) - (run "/bin/steam-wrapper") + (run "/bin/steam") (union64 (replace-mesa (fhs-union `(,@steam-client-libs @@ -587,3 +727,27 @@ all games will be installed.")))) Valve. This package provides a script for launching Steam in a Guix container which will use the directory @file{$HOME/.local/share/guix-sandbox-home} where all games will be installed.")))) + +(define-public protonup-ng + (package + (name "protonup-ng") + (version "0.2.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/cloudishBenne/protonup-ng") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0yd2mhhqxzarqxk85zf42s931jzc94f1cssn1hblsqghr79laa45")))) + (build-system python-build-system) + (arguments + (list #:tests? #f)) ; there are no tests + (inputs + (list python-configparser python-requests)) + (home-page "https://github.com/cloudishBenne/protonup-ng") + (synopsis "Manage Proton-GE Installations") + (description "ProtonUp-ng is a CLI program and API to automate the installation +and update of GloriousEggroll's Proton-GE.") + (license license:gpl3))) diff --git a/nongnu/packages/version-control.scm b/nongnu/packages/version-control.scm new file mode 100644 index 0000000..1948f7d --- /dev/null +++ b/nongnu/packages/version-control.scm @@ -0,0 +1,58 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022 dan <i@dan.games> +;;; Copyright © 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de> + +(define-module (nongnu packages version-control) + #:use-module (gnu packages base) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (nonguix build-system binary) + #:use-module (nonguix licenses) + #:use-module (ice-9 match)) + +(define-public helix-core + (package + (name "helix-core") + (version "r22.1") + (source (origin + (method url-fetch) + (uri (string-append "https://ftp.perforce.com/perforce/" version + "/bin.linux26" + (match (%current-system) + ("i686-linux" "x86") + (_ "x86_64")) + "/helix-core-server.tgz")) + (sha256 + (base32 + (match (%current-system) + ("i686-linux" + "0f5qs55rspw86axnmml3nxx551lwbxwz1cgi9kmy2f9g5rrplnkn") + (_ + "077rfbjgyhdgv76i2727s3yk3p52y75nml8n9wv8g7mvhfs9ypa9")))))) + (build-system binary-build-system) + (arguments + `(#:strip-binaries? #f + #:phases (modify-phases %standard-phases + (add-before 'patchelf 'patchelf-writable + (lambda _ + (for-each make-file-writable + (find-files "."))))) + #:patchelf-plan '(("p4" ("glibc")) + ("p4d" ("glibc")) + ("p4p" ("glibc")) + ("p4broker" ("glibc"))) + #:install-plan '(("p4" "bin/") + ("p4d" "bin/") + ("p4p" "bin/") + ("p4broker" "bin/")))) + (inputs (list glibc)) + (home-page "https://www.perforce.com/products/helix-core") + (synopsis + "A version control software for large scale development environments") + (description + "Helix Core is a version control software for large scale development +environments. The Helix Version Control System manages a central database and +a master repository of file versions.") + (supported-systems '("i686-linux" "x86_64-linux")) + (license (nonfree + "https://www.perforce.com/sites/default/files/pdfs/Helix_Core%20On%20Prem%20Software%20License%20Agmt%20ClickThru_FINAL%2006.28.2021.pdf")))) diff --git a/nongnu/packages/video.scm b/nongnu/packages/video.scm new file mode 100644 index 0000000..815f37d --- /dev/null +++ b/nongnu/packages/video.scm @@ -0,0 +1,75 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022 Jelle Licht <jlicht@fsfe.org> + +(define-module (nongnu packages video) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages video) + #:use-module (guix build utils) + #:use-module (guix build-system cmake) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module ((guix licenses) #:prefix license:)) + +(define-public gmmlib + (package + (name "gmmlib") + (version "22.3.3") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/intel/gmmlib") + (commit (string-append "intel-gmmlib-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0rbbzqpxgqklgdmbl7wjyblylm1g0jan3552scbi12z31bvq2442")))) + (build-system cmake-build-system) + (arguments + ;; Tests are run as part of the normal build step + '(#:tests? #f)) + (home-page "https://github.com/intel/gmmlib") + (synopsis "Intel Graphics Memory Management Library") + (description + "This package provides device specific and buffer management for the +Intel Graphics Compute Runtime for OpenCL and the Intel Media Driver +for VAAPI.") + (license license:expat))) + +(define-public intel-media-driver + (package + (name "intel-media-driver") + (version "22.6.6") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/intel/media-driver") + (commit (string-append "intel-media-" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "08rnvhpgf7czb39swpm0qds11v5zlfjzl1wxnjl7df9vgf1lx3qh")))) + (build-system cmake-build-system) + (inputs (list libva gmmlib)) + (native-inputs (list pkg-config)) + (arguments + '(#:tests? #f ;Tests are run as part of the normal build step + #:configure-flags + (list "-DENABLE_NONFREE_KERNELS=OFF" + (string-append "-DLIBVA_DRIVERS_PATH=" + (assoc-ref %outputs "out") "/lib/dri")))) + ;; XXX Because of <https://issues.guix.gnu.org/issue/22138>, we need to add + ;; this to all VA-API back ends instead of once to libva. + (native-search-paths + (list (search-path-specification + (variable "LIBVA_DRIVERS_PATH") + (files '("lib/dri"))))) + (supported-systems '("i686-linux" "x86_64-linux")) + (home-page "https://github.com/intel/media-driver") + (synopsis "Intel Media Driver for VAAPI") + (description + "This package provides a VA-API user mode driver supporting hardware +accelerated decoding, encoding, and video post processing for the GEN based +graphics hardware.") + (license (list license:expat license:bsd-3)))) + +intel-media-driver diff --git a/nongnu/packages/vpn.scm b/nongnu/packages/vpn.scm index 84ed23c..c7be7e4 100644 --- a/nongnu/packages/vpn.scm +++ b/nongnu/packages/vpn.scm @@ -1,21 +1,5 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2020 Alexey Abramov <levenson@mmer.org> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. - (define-module (nongnu packages vpn) #:use-module (guix build utils) @@ -28,7 +12,7 @@ (define-public zerotier (package (name "zerotier") - (version "1.6.6") + (version "1.8.4") (source (origin (method git-fetch) (uri (git-reference @@ -37,7 +21,7 @@ (file-name (git-file-name name version)) (sha256 (base32 - "0pi22252c21gxmjcgwmagkrnp5y1hhqrm9jkjj9pg1nlzzrlyrnm")))) + "101b1k9f3cpbgj0l87ya1cbqs9dv0qiayjap4m29fxyjra8hbkb8")))) (build-system gnu-build-system) (arguments `(#:phases diff --git a/nongnu/packages/wasm.scm b/nongnu/packages/wasm.scm new file mode 100644 index 0000000..fa236d1 --- /dev/null +++ b/nongnu/packages/wasm.scm @@ -0,0 +1,250 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022-2023 Pierre Langlois <pierre.langlois@gmx.com> + +(define-module (nongnu packages wasm) + #:use-module (guix base32) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix utils) + #:use-module (guix git-download) + #:use-module (guix build-system cmake) + #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) + #:use-module (gnu packages bash) + #:use-module (gnu packages llvm) + #:use-module (gnu packages python)) + +(define-public wasi-libc + (package + (name "wasi-libc") + (version "sdk-19") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/WebAssembly/wasi-libc") + (commit (string-append "wasi-" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0bnpz8wk9wiic938296gxp4vz820bvpi1w41jksjzz5552hql169")))) + (build-system gnu-build-system) + (native-inputs (list clang-15)) + (arguments + (list #:tests? #f ;No test suite + ;; Firefox uses wasm2c to compile WebAssembly to C code, and it + ;; does not support the memory.copy opcode. + ;; See https://bugzilla.mozilla.org/show_bug.cgi?id=1773200#c4 + #:make-flags ''("BULK_MEMORY_SOURCES=") + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-before 'build 'set-sysroot-include + (lambda _ + (setenv "C_INCLUDE_PATH" + (string-append (getcwd) "/sysroot/include")))) + (add-before 'install 'set-install-dir + (lambda _ + (setenv "INSTALL_DIR" + (string-append #$output "/wasm32-wasi"))))))) + (home-page "https://wasi.dev") + (synopsis "WASI libc implementation for WebAssembly") + (description + "WASI Libc is a libc for WebAssembly programs built on top of WASI +system calls. It provides a wide array of POSIX-compatible C APIs, including +support for standard I/O, file I/O, filesystem manipulation, memory +management, time, string, environment variables, program startup, and many +other APIs.") + (license (list + ;; For wasi-libc, with LLVM exceptions + license:asl2.0 + ;; For malloc.c. + license:cc0 + ;; For cloudlibc. + license:bsd-2 + ;; For wasi-libc and musl-libc. + license:expat)))) + +(define-public wasm32-wasi-clang-runtime + (package (inherit clang-runtime-15) + (native-inputs + (list clang-15 + wasi-libc)) + (inputs (list llvm-15)) + (arguments + (list + #:build-type "Release" + #:tests? #f + ;; Stripping binaries breaks wasm linking, resulting in the following + ;; error: "archive has no index; run ranlib to add one". + #:strip-binaries? #f + #:configure-flags + #~(list "-DCMAKE_C_COMPILER=clang" + "-DCMAKE_C_COMPILER_TARGET=wasm32-wasi" + (string-append + "-DCMAKE_SYSROOT=" #$wasi-libc "/wasm32-wasi") + (string-append + "-DCMAKE_C_FLAGS=-I " #$wasi-libc "/wasm32-wasi/include") + + "-DCOMPILER_RT_OS_DIR=wasi" + + "-DCOMPILER_RT_BAREMETAL_BUILD=On" + "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=On" + + ;; WASM only needs libclang_rt.builtins-wasm32.a from + ;; compiler-rt. + "../source/compiler-rt/lib/builtins"))))) + +;; FIXME: Ideally we wouldn't need to build a separate compiler because clang +;; can support multiple targets at runtime. However Guix patches the default +;; clang with a specific clang-runtime package. It would be good to improve +;; upstream Guix's support for cross-compiling with clang. + +(define clang-from-llvm (@@ (gnu packages llvm) clang-from-llvm)) +(define llvm-monorepo (@@ (gnu packages llvm) llvm-monorepo)) + +(define-public wasm32-wasi-clang + (let ((base (clang-from-llvm llvm-15 wasm32-wasi-clang-runtime))) + (package (inherit base) + (name "wasm32-wasi-clang") + (inputs + (modify-inputs (package-inputs base) + (prepend wasi-libc))) + (arguments + (substitute-keyword-arguments (package-arguments base) + ((#:configure-flags flags) + #~(list "-DCLANG_INCLUDE_TESTS=True" + ;; Use a sane default include directory. + (string-append "-DC_INCLUDE_DIRS=" + #$wasi-libc + "/wasm32-wasi/include"))) + ((#:phases phases) + `(modify-phases ,phases + (delete 'symlink-cfi_ignorelist)))))))) + +(define-public wasm32-wasi-libcxx + (package + (name "wasm32-wasi-libcxx") + (version (package-version llvm-15)) + (source (llvm-monorepo version)) + (build-system cmake-build-system) + (arguments + (list + #:configure-flags + #~(list (string-append "-S ../source/runtimes") + + "-DLLVM_ENABLE_RUNTIMES=libcxx;libcxxabi" + + (string-append + "-DCMAKE_SYSROOT=" #$wasi-libc "/wasm32-wasi") + + (string-append + "-DCMAKE_INCLUDE_PATH=" #$wasi-libc "/wasm32-wasi/include") + + (string-append + "-DCMAKE_STAGING_PREFIX=" #$output "/wasm32-wasi") + + "-DCMAKE_C_COMPILER=clang" + "-DCMAKE_C_COMPILER_WORKS=ON" + "-DCMAKE_CXX_COMPILER=clang++" + "-DCMAKE_CXX_COMPILER_WORKS=ON" + "-DCMAKE_C_COMPILER_TARGET=wasm32-wasi" + "-DCMAKE_CXX_COMPILER_TARGET=wasm32-wasi" + + "-DLIBCXX_LIBDIR_SUFFIX=/wasm32-wasi" + + "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" + "-DLIBCXX_ENABLE_SHARED=OFF" + "-DLIBCXX_ENABLE_THREADS=OFF" + "-DLIBCXX_ENABLE_FILESYSTEM=OFF" + + "-DLIBCXXABI_LIBDIR_SUFFIX=/wasm32-wasi" + + "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF" + "-DLIBCXXABI_ENABLE_SHARED=OFF" + "-DLIBCXXABI_ENABLE_THREADS=OFF" + "-DLIBCXXABI_ENABLE_FILESYSTEM=OFF") + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH + (lambda _ + (setenv "CPLUS_INCLUDE_PATH" + (string-append #$wasi-libc "/wasm32-wasi/include:" + (getenv "CPLUS_INCLUDE_PATH")))))))) + (native-inputs + (list lld + python + wasm32-wasi-clang)) + (inputs + (list wasi-libc)) + (home-page "https://libcxx.llvm.org") + (synopsis "C++ standard library for WebAssembly") + (description + "This package provides an implementation of the C++ standard library for +use with Clang, targeting C++11, C++14 and above. This package targets +WebAssembly with WASI.") + (license license:expat))) + +(define-public wasm32-wasi-clang-toolchain + (package + (name "wasm32-wasi-clang-toolchain") + (version (package-version wasm32-wasi-clang)) + (source #f) + (build-system trivial-build-system) + (arguments + (list + #:builder + (with-imported-modules '((guix build union) + (guix build utils)) + #~(begin + (use-modules (guix build union) + (guix build utils)) + (union-build #$output + (list #$wasm32-wasi-clang-runtime + #$wasi-libc + #$wasm32-wasi-libcxx)) + (mkdir-p (string-append #$output "/bin")) + + ;; We provide clang and clang++ via a wrapped program that sets + ;; include paths correctly so that it does not include paths from + ;; the host. + + ;; FIXME: Review how we can provide better support for + ;; cross-compiling with clang in Guix, maybe adding support for + ;; the CROSS_C_INCLUDE_PATH and CROSS_CPLUS_INCLUDE_PATH + ;; environment variables like GCC. + + (for-each + (lambda (bin) + (symlink (string-append #$wasm32-wasi-clang bin) + (string-append #$output bin)) + (wrap-program (string-append #$output bin) + #:sh (string-append #$bash-minimal "/bin/bash") + `("C_INCLUDE_PATH" ":" = + (,(string-append #$output "/wasm32-wasi/include"))) + `("CPLUS_INCLUDE_PATH" ":" = + ;; Make sure inclure/c++/v1 comes first for #include_next + ;; to work. + (,(string-append #$output "/wasm32-wasi/include/c++/v1") + ,(string-append #$output "/wasm32-wasi/include"))))) + '("/bin/clang" "/bin/clang++")) + + (symlink (string-append #$lld "/bin/wasm-ld") + (string-append #$output "/bin/wasm-ld")))))) + (inputs + (list bash-minimal + lld + wasi-libc + wasm32-wasi-clang + wasm32-wasi-clang-runtime + wasm32-wasi-libcxx)) + (license (cons + (package-license wasm32-wasi-clang) + (package-license wasi-libc))) + (home-page "https://clang.llvm.org") + (synopsis "Complete Clang toolchain for C/C++ development, for WebAssembly.") + (description "This package provides a complete Clang toolchain for C/C++ +development targeting WebAssembly with WASI. This includes Clang, as well as +libc, libc++ and wasm-ld."))) diff --git a/nongnu/packages/wine.scm b/nongnu/packages/wine.scm index d128119..106f0a3 100644 --- a/nongnu/packages/wine.scm +++ b/nongnu/packages/wine.scm @@ -1,20 +1,5 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (nongnu packages wine) #:use-module (ice-9 match) @@ -36,7 +21,7 @@ (define-public winetricks (package (name "winetricks") - (version "20210206") + (version "20220411") (source (origin (method git-fetch) (uri (git-reference @@ -45,7 +30,7 @@ (file-name (git-file-name name version)) (sha256 (base32 - "0x2ykd6krk0fric45yl4gcc8cdv6j206l62rc9klw0rxfv12hz5n")))) + "09bv6wsm3y9p6jhlcmnjlnczdyr996b2mvxg4fbvlqa3fv9gac8n")))) (build-system gnu-build-system) (inputs `(("cabextract" ,cabextract) @@ -157,7 +142,7 @@ Use @command{setup_dxvk} to install the required libraries to a Wine prefix.") (define-public dxvk-next (package (name "dxvk") - (version "1.9") + (version "2.0") (home-page "https://github.com/doitsujin/dxvk/") (source (origin (method url-fetch) @@ -166,7 +151,7 @@ Use @command{setup_dxvk} to install the required libraries to a Wine prefix.") version "/dxvk-" version ".tar.gz") ) (sha256 (base32 - "1vd64525c6qwvxhdsqp7icbf7zsfdcyj125p0hm1k1rqg3w6hf23")))) + "0xr4lq4zdmqwxh5x19am2y4lvy6q6s6bl1nfr4ixfgy2l2sghliq")))) (build-system copy-build-system) (arguments `(#:install-plan @@ -211,3 +196,19 @@ allows running complex 3D applications with high performance using Wine. Use @command{setup_dxvk} to install the required libraries to a Wine prefix.") (supported-systems '("i686-linux" "x86_64-linux")) (license license:zlib))) + +;; Keep 1.10 since it's backward-compatible with older hardware unlike 2.* +;; See https://github.com/doitsujin/dxvk/releases/tag/v2.0 +(define-public dxvk-1.10 + (package + (inherit dxvk-1.7) + (version "1.10.3") + (home-page "https://github.com/doitsujin/dxvk/") + (source (origin + (method url-fetch) + (uri (string-append + "https://github.com/doitsujin/dxvk/releases/download/v" + version "/dxvk-" version ".tar.gz")) + (sha256 + (base32 + "1ijkznb8asqg18blhs6f82g67xpncjp7i17rg7451d314y8kq6ld")))))) diff --git a/nongnu/services/nvidia.scm b/nongnu/services/nvidia.scm new file mode 100644 index 0000000..985e12b --- /dev/null +++ b/nongnu/services/nvidia.scm @@ -0,0 +1,56 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later +;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space> + +(define-module (nongnu services nvidia) + #:use-module (gnu packages) + #:use-module (gnu packages linux) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services linux) + #:use-module (gnu services shepherd) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (nongnu packages nvidia) + #:export (nvidia-configuration + nvidia-configuration? + nvidia-configuration-record? + nvidia-service-type)) + +(define-record-type* <nvidia-configuration> + nvidia-configuration make-nvidia-configuration + nvidia-configuration? + (nvidia-driver nvidia-configuration-nvidia-driver + (default (list nvidia-driver))) ; list of file-like + (nvidia-firmware nvidia-configuration-nvidia-firmware + (default (list nvidia-firmware))) ; list of file-like + (nvidia-module nvidia-configuration-nvidia-module + (default (list nvidia-module))) ; list of file-like + (modules nvidia-configuration-modules + (default (list "nvidia-uvm")))) ; list of string + +(define (nvidia-shepherd-service config) + (list (shepherd-service + (documentation "Unload nvidia-uvm module on powering off.") + (provision '(nvidia)) + (requirement '(user-processes)) + (start #~(const #t)) + (stop #~(lambda _ + (let ((rmmod #$(file-append kmod "/bin/rmmod"))) + (zero? (system* rmmod "nvidia-uvm")))))))) + +(define nvidia-service-type + (service-type + (name 'nvidia) + (extensions + (list (service-extension shepherd-root-service-type + nvidia-shepherd-service) + (service-extension udev-service-type + nvidia-configuration-nvidia-driver) + (service-extension firmware-service-type + nvidia-configuration-nvidia-firmware) + (service-extension linux-loadable-module-service-type + nvidia-configuration-nvidia-module) + (service-extension kernel-module-loader-service-type + nvidia-configuration-modules))) + (default-value (nvidia-configuration)) + (description "Load NVIDIA modules."))) diff --git a/nongnu/services/vpn.scm b/nongnu/services/vpn.scm index b76cf03..71a15dc 100644 --- a/nongnu/services/vpn.scm +++ b/nongnu/services/vpn.scm @@ -1,20 +1,5 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2020 Alexey Abramov <levenson@mmer.org> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (nongnu services vpn) #:use-module (guix gexp) @@ -64,6 +49,7 @@ (define zerotier-one-service-type (service-type (name 'zerotier-one) + (description "ZeroTier One daemon.") (extensions (list (service-extension shepherd-root-service-type zerotier-one-shepherd-service))))) diff --git a/nongnu/system/install.scm b/nongnu/system/install.scm index 275bcaa..100e278 100644 --- a/nongnu/system/install.scm +++ b/nongnu/system/install.scm @@ -1,23 +1,16 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com> ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz> -;;; -;;; This program is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see <https://www.gnu.org/licenses/>. +;;; Copyright © 2022 Jonathan Brielmaier <jonathan.brielmaier@web.de> ;; Generate a bootable image (e.g. for USB sticks, etc.) with: ;; $ guix system disk-image nongnu/system/install.scm (define-module (nongnu system install) + #:use-module (gnu packages curl) + #:use-module (gnu packages version-control) + #:use-module (gnu packages vim) + #:use-module (gnu packages zile) #:use-module (gnu system) #:use-module (gnu system install) #:use-module (nongnu packages linux) @@ -27,6 +20,13 @@ (operating-system (inherit installation-os) (kernel linux) - (firmware (list linux-firmware)))) + (firmware (list linux-firmware)) + (packages + (append + (list curl + git + neovim + zile) + (operating-system-packages installation-os))))) installation-os-nonfree diff --git a/nongnu/system/linux-initrd.scm b/nongnu/system/linux-initrd.scm index 5b29235..5f34e79 100644 --- a/nongnu/system/linux-initrd.scm +++ b/nongnu/system/linux-initrd.scm @@ -1,17 +1,5 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2020 Alex Griffin <a@ajgrf.com> -;;; -;;; This program is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see <https://www.gnu.org/licenses/>. (define-module (nongnu system linux-initrd) #:use-module (gnu system linux-initrd) @@ -79,7 +67,9 @@ MICROCODE-PACKAGES, in the format expected by the kernel." "/initrd.cpio")) (define (combined-initrd . initrds) - "Return a combined initrd, the result of concatenating INITRDS." + "Return a combined initrd, the result of concatenating INITRDS. This relies +on the kernel ability to detect and load multiple initrds archives from a +single file." (define builder (with-imported-modules (source-module-closure '((guix build utils) @@ -87,13 +77,28 @@ MICROCODE-PACKAGES, in the format expected by the kernel." #:select? import-nonguix-module?) #~(begin (use-modules (guix build utils) - (nonguix build utils)) + (nonguix build utils) + (srfi srfi-1)) ;; Use .img suffix since the result is no longer easily inspected by ;; standard tools like cpio and gzip. - (let ((initrd (string-append #$output "/initrd.img"))) + ;; + ;; The initrds may contain "references" files to keep some items + ;; such as the static guile alive. Concatenate them in a single, + ;; top-level references file. + (let ((initrd (string-append #$output "/initrd.img")) + (references + (filter-map + (lambda (initrd) + (let ((ref (string-append (dirname initrd) + "/references"))) + (and (file-exists? ref) ref))) + '#$initrds)) + (new-references + (string-append #$output "/references"))) (mkdir-p #$output) - (concatenate-files '#$initrds initrd))))) + (concatenate-files '#$initrds initrd) + (concatenate-files references new-references))))) (file-append (computed-file "combined-initrd" builder) "/initrd.img")) diff --git a/nonguix/build-system/binary.scm b/nonguix/build-system/binary.scm index 038bd89..121162d 100644 --- a/nonguix/build-system/binary.scm +++ b/nonguix/build-system/binary.scm @@ -1,24 +1,12 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +;;; Copyright © 2021 Josselin Poiret <dev@jpoiret.xyz> (define-module (nonguix build-system binary) #:use-module (guix store) #:use-module (guix utils) + #:use-module (guix gexp) + #:use-module (guix monads) #:use-module (guix derivations) #:use-module (guix search-paths) #:use-module (guix build-system) @@ -69,7 +57,7 @@ #:rest arguments) "Return a bag for NAME." (define private-keywords - '(#:source #:target #:patchelf #:inputs #:native-inputs)) + '(#:target #:patchelf #:inputs #:native-inputs)) (and (not target) ;XXX: no cross-compilation (bag @@ -90,8 +78,9 @@ (build binary-build) (arguments (strip-keyword-arguments private-keywords arguments))))) -(define* (binary-build store name inputs - #:key (guile #f) +(define* (binary-build name inputs + #:key + guile source (outputs '("out")) (patchelf-plan ''()) (install-plan ''(("." "./"))) @@ -109,49 +98,43 @@ (imported-modules %binary-build-system-modules) (modules '((nonguix build binary-build-system) (guix build utils) - (nonguix build utils)))) + (nonguix build utils))) + (substitutable? #t) + allowed-references + disallowed-references) "Build SOURCE using PATCHELF, and with INPUTS. This assumes that SOURCE provides its own binaries." (define builder - `(begin - (use-modules ,@modules) - (binary-build #:source ,(match (assoc-ref inputs "source") - (((? derivation? source)) - (derivation->output-path source)) - ((source) - source) - (source - source)) - #:system ,system - #:outputs %outputs - #:inputs %build-inputs - #:patchelf-plan ,patchelf-plan - #:install-plan ,install-plan - #:search-paths ',(map search-path-specification->sexp - search-paths) - #:phases ,phases - #:out-of-source? ,out-of-source? - #:validate-runpath? ,validate-runpath? - #:patch-shebangs? ,patch-shebangs? - #:strip-binaries? ,strip-binaries? - #:strip-flags ,strip-flags - #:strip-directories ,strip-directories))) + (with-imported-modules imported-modules + #~(begin + (use-modules #$@modules) - (define guile-for-build - (match guile - ((? package?) - (package-derivation store guile system #:graft? #f)) - (#f ; the default - (let* ((distro (resolve-interface '(gnu packages commencement))) - (guile (module-ref distro 'guile-final))) - (package-derivation store guile system #:graft? #f))))) + #$(with-build-variables inputs outputs + #~(binary-build #:source #+source + #:system #$system + #:outputs %outputs + #:inputs %build-inputs + #:patchelf-plan #$patchelf-plan + #:install-plan #$install-plan + #:search-paths '#$(map search-path-specification->sexp + search-paths) + #:phases #$phases + #:out-of-source? #$out-of-source? + #:validate-runpath? #$validate-runpath? + #:patch-shebangs? #$patch-shebangs? + #:strip-binaries? #$strip-binaries? + #:strip-flags #$strip-flags + #:strip-directories #$strip-directories))))) - (build-expression->derivation store name builder - #:system system - #:inputs inputs - #:modules imported-modules - #:outputs outputs - #:guile-for-build guile-for-build)) + (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) + system #:graft? #f))) + (gexp->derivation name builder + #:system system + #:target #f + #:substitutable? substitutable? + #:allowed-references allowed-references + #:disallowed-references disallowed-references + #:guile-for-build guile))) (define binary-build-system (build-system diff --git a/nonguix/build/binary-build-system.scm b/nonguix/build/binary-build-system.scm index 6a676ae..087ef89 100644 --- a/nonguix/build/binary-build-system.scm +++ b/nonguix/build/binary-build-system.scm @@ -1,20 +1,6 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +;;; Copyright © 2022 Attila Lendvai <attila@lendvai.name> (define-module (nonguix build binary-build-system) #:use-module ((guix build gnu-build-system) #:prefix gnu:) @@ -97,6 +83,19 @@ The PATCHELF-PLAN elements are lists of: Both executables and dynamic libraries are accepted. The inputs are optional when the file is an executable." (define (binary-patch binary interpreter runpath) + + (define* (maybe-make-rpath entries name #:optional (extra-path "/lib")) + (let ((entry (assoc-ref entries name))) + (if entry + (string-append entry extra-path) + #f))) + + (define* (make-rpath name #:optional (extra-path "/lib")) + (or (maybe-make-rpath outputs name extra-path) + (maybe-make-rpath inputs name extra-path) + (error (format #f "`~a' not found among the inputs nor the outputs." + name)))) + (unless (string-contains binary ".so") ;; Use `system*' and not `invoke' since this may raise an error if ;; library does not end with .so. @@ -104,13 +103,11 @@ The inputs are optional when the file is an executable." (when runpath (let ((rpath (string-join (map - (lambda (input-or-output) - (cond - ((assoc-ref outputs input-or-output) - (string-append (assoc-ref outputs input-or-output) "/lib")) - ((assoc-ref inputs input-or-output) - (string-append (assoc-ref inputs input-or-output) "/lib")) - (else (error (format #f "`~a' not found among the inputs nor the outputs." input-or-output))))) + (match-lambda + ((name extra-path) + (make-rpath name extra-path)) + (name + (make-rpath name))) runpath) ":"))) (invoke "patchelf" "--set-rpath" rpath binary))) diff --git a/nonguix/build/utils.scm b/nonguix/build/utils.scm index ab437f2..fd92a12 100644 --- a/nonguix/build/utils.scm +++ b/nonguix/build/utils.scm @@ -1,21 +1,6 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz> ;;; Copyright © 2020 Alex Griffin <a@ajgrf.com> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (nonguix build utils) #:use-module (ice-9 match) diff --git a/nonguix/download.scm b/nonguix/download.scm index 11087ff..0eb661a 100644 --- a/nonguix/download.scm +++ b/nonguix/download.scm @@ -1,17 +1,5 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu> -;;; -;;; This program is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see <https://www.gnu.org/licenses/>. (define-module (nonguix download) #:use-module (guix derivations) diff --git a/nonguix/licenses.scm b/nonguix/licenses.scm index 84d2346..a09452a 100644 --- a/nonguix/licenses.scm +++ b/nonguix/licenses.scm @@ -1,17 +1,5 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com> -;;; -;;; This program is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see <https://www.gnu.org/licenses/>. (define-module (nonguix licenses) #:use-module (guix licenses) diff --git a/nonguix/modules.scm b/nonguix/modules.scm index 24d4267..cd07d44 100644 --- a/nonguix/modules.scm +++ b/nonguix/modules.scm @@ -1,17 +1,5 @@ +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2020 Alex Griffin <a@ajgrf.com> -;;; -;;; This program is free software: you can redistribute it and/or modify -;;; it under the terms of the GNU General Public License as published by -;;; the Free Software Foundation, either version 3 of the License, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with this program. If not, see <https://www.gnu.org/licenses/>. (define-module (nonguix modules) #:use-module (ice-9 match) diff --git a/nonguix/utils.scm b/nonguix/utils.scm index 7611a47..6703f4a 100644 --- a/nonguix/utils.scm +++ b/nonguix/utils.scm @@ -1,20 +1,6 @@ -;;; GNU Guix --- Functional package management for GNU +;;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz> -;;; -;;; This file is not part of GNU Guix. -;;; -;;; GNU Guix is free software; you can redistribute it and/or modify it -;;; under the terms of the GNU General Public License as published by -;;; the Free Software Foundation; either version 3 of the License, or (at -;;; your option) any later version. -;;; -;;; GNU Guix is distributed in the hope that it will be useful, but -;;; WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;;; GNU General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. +;;; Copyright © 2020 Jonathan Brielmaier <jonathan.brielmaier@web.de> (define-module (nonguix utils) #:use-module (srfi srfi-26) |