summaryrefslogtreecommitdiff
path: root/gnu/packages/appimage.scm
diff options
context:
space:
mode:
authorNoé Lopez <noelopez@free.fr>2024-11-07 17:50:03 +0100
committerLudovic Courtès <ludo@gnu.org>2024-11-23 16:25:44 +0100
commitb143ec8edacbdc2afb9e0c8fb4e8940b861be01a (patch)
treef3109bfe2c3b84577c99f4a7d356fb180a584fbb /gnu/packages/appimage.scm
parent2d3bf6a2a33fae685c03320f289d73ba3e7275f6 (diff)
gnu: appimage: New packages for the appimage runtime.
* gnu/packages/appimage.scm (gnu packages appimage): New module. (appimage-type2-runtime): New variable. * gnu/packages/file-systems.scm (squashfuse-for-appimage): New variable. * gnu/packages/linux.scm (fuse-for-appimage): New variable. Change-Id: I857a8eb5399a6a493e52db70b6c8cf0c71360930 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/appimage.scm')
-rw-r--r--gnu/packages/appimage.scm97
1 files changed, 97 insertions, 0 deletions
diff --git a/gnu/packages/appimage.scm b/gnu/packages/appimage.scm
new file mode 100644
index 00000000000..1d0caada465
--- /dev/null
+++ b/gnu/packages/appimage.scm
@@ -0,0 +1,97 @@
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2024 Noé Lopez <noelopez@free.fr>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages appimage)
20 #:use-module ((guix licenses) #:prefix license:)
21 #:use-module (gnu packages base)
22 #:use-module (gnu packages compression)
23 #:use-module (gnu packages file-systems)
24 #:use-module (gnu packages linux)
25 #:use-module (gnu packages)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix gexp)
28 #:use-module (guix git-download)
29 #:use-module (guix packages)
30 #:use-module (guix utils))
31
32(define-public appimage-type2-runtime
33 (let ((revision "0")
34 ;; No releases, just the latest commit.
35 (commit "47b665594856b4e8928f8932adcf6d13061d8c30"))
36 (package
37 (name "appimage-type2-runtime")
38 (version (git-version "continuous" revision commit))
39 (source
40 (origin
41 (method git-fetch)
42 (uri (git-reference
43 (url "https://github.com/AppImage/type2-runtime")
44 (commit commit)))
45 (file-name (git-file-name name version))
46 (sha256
47 (base32 "0954crhlbapxis96g1s0vfpf78ybr64zvjalak387ksxj560g44x"))))
48 (arguments
49 (list
50 #:make-flags
51 #~(list "-Csrc/runtime" "runtime-fuse3"
52 (string-append
53 "CFLAGS=" "-I" #$(this-package-input "fuse") "/include/fuse/"
54 " -DGIT_COMMIT='\"" "guix-" #$version "\"'"
55 " -D_FILE_OFFSET_BITS=64"
56 " -static"))
57 #:modules
58 `((guix build gnu-build-system)
59 (guix build utils)
60 (ice-9 binary-ports))
61 #:phases #~(modify-phases %standard-phases
62 (delete 'configure)
63 (delete 'check) ; No tests.
64 (replace 'install
65 (lambda _
66 (install-file "src/runtime/runtime-fuse3"
67 (string-append #$output "/bin"))))
68 ;; Must be after all elf reliant phases. Used to identify the
69 ;; executable as an AppImage as per the specification.
70 (add-after 'make-dynamic-linker-cache 'set-magic-bytes
71 (lambda _
72 (let ((port (open (string-append #$output
73 "/bin/runtime-fuse3")
74 (logior O_WRONLY))))
75 (seek port 8 SEEK_SET)
76 (put-bytevector port #vu8(#x41 #x49 #x02))
77 (close-port port)))))
78 #:disallowed-references (list squashfuse-for-appimage
79 fuse-for-appimage
80 (gexp-input zstd "static")
81 (gexp-input zlib "static"))))
82 ;; Only needed at build time.
83 (inputs (list squashfuse-for-appimage
84 fuse-for-appimage
85 `(,zstd "static")
86 `(,zlib "static")))
87 (build-system gnu-build-system)
88 (home-page "https://github.com/AppImage/type2-runtime")
89 (synopsis "Runtime for executing AppImages")
90 (description "The runtime is the executable part of every AppImage. It mounts
91the payload via @acronym{FUSE} and executes the entrypoint, allowing users to run
92applications in a portable manner without the need for installation. This runtime
93ensures that the AppImage can access its bundled libraries and resources seamlessly,
94providing a consistent environment across different Linux distributions. In the
95absence of @acronym{FUSE}, the AppImage can still be started using the
96@option{--appimage-extract-and-run} flag.")
97 (license license:expat))))