| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 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 c)
|
| 23 | #:use-module (gnu packages compression)
|
| 24 | #:use-module (gnu packages file-systems)
|
| 25 | #:use-module (gnu packages linux)
|
| 26 | #:use-module (gnu packages pkg-config)
|
| 27 | #:use-module (gnu packages)
|
| 28 | #:use-module (guix build-system gnu)
|
| 29 | #:use-module (guix gexp)
|
| 30 | #:use-module (guix git-download)
|
| 31 | #:use-module (guix packages)
|
| 32 | #:use-module (guix utils))
|
| 33 |
|
| 34 | (define-public appimage-type2-runtime
|
| 35 | (let ((revision "1")
|
| 36 | |
| 37 | (commit "caf24f9f712084686bfc24a70b75e50df0aefb9c"))
|
| 38 | (package
|
| 39 | (name "appimage-type2-runtime")
|
| 40 | (version (git-version "continuous" revision commit))
|
| 41 | (source
|
| 42 | (origin
|
| 43 | (method git-fetch)
|
| 44 | (uri (git-reference
|
| 45 | (url "https://github.com/AppImage/type2-runtime")
|
| 46 | (commit commit)))
|
| 47 | (file-name (git-file-name name version))
|
| 48 | (sha256
|
| 49 | (base32 "17z0byws3dp375wcyq5xwy5npqy7hslqw21n677dp38z4f940nzv"))))
|
| 50 | (build-system gnu-build-system)
|
| 51 | (arguments
|
| 52 | (list
|
| 53 | #:tests? #f |
| 54 | #:make-flags
|
| 55 | #~(list "-Csrc/runtime" "runtime"
|
| 56 | (string-append "CC=" #$(cc-for-target))
|
| 57 | (string-append
|
| 58 | "CFLAGS=" "-I" #$(this-package-input "fuse") "/include/fuse3/"
|
| 59 | " -DGIT_COMMIT='\"" "guix-" #$version "\"'"
|
| 60 | " -D_FILE_OFFSET_BITS=64"
|
| 61 | " -static"
|
| 62 | " -Wno-int-conversion"))
|
| 63 | #:modules
|
| 64 | `((guix build gnu-build-system)
|
| 65 | (guix build utils)
|
| 66 | (ice-9 binary-ports))
|
| 67 | #:phases
|
| 68 | #~(modify-phases %standard-phases
|
| 69 | (add-after 'unpack 'use-pkgconfig-flags
|
| 70 | (lambda _
|
| 71 | (substitute* "src/runtime/Makefile"
|
| 72 | (("-lmimalloc")
|
| 73 | "$(pkg-config --cflags mimalloc)"))))
|
| 74 | (delete 'configure)
|
| 75 | (replace 'install
|
| 76 | (lambda _
|
| 77 | (install-file "src/runtime/runtime"
|
| 78 | (string-append #$output "/bin"))))
|
| 79 | |
| 80 | |
| 81 | (add-after 'make-dynamic-linker-cache 'set-magic-bytes
|
| 82 | (lambda _
|
| 83 | (let ((port (open (string-append #$output
|
| 84 | "/bin/runtime")
|
| 85 | (logior O_WRONLY))))
|
| 86 | (seek port 8 SEEK_SET)
|
| 87 | (put-bytevector port #vu8(#x41 #x49 #x02))
|
| 88 | (close-port port)))))
|
| 89 | #:disallowed-references
|
| 90 | (list (this-package-input "squashfuse-for-appimage")
|
| 91 | (this-package-input "fuse")
|
| 92 | (gexp-input (this-package-input "zstd") "static")
|
| 93 | (gexp-input (this-package-input "zlib") "static"))))
|
| 94 | (native-inputs (list pkg-config))
|
| 95 | |
| 96 | (inputs (list `(,fuse "out")
|
| 97 | `(,fuse "static")
|
| 98 | mimalloc
|
| 99 | squashfuse-for-appimage
|
| 100 | `(,zstd "static")
|
| 101 | `(,zlib "static")))
|
| 102 | (synopsis "Runtime for executing AppImages")
|
| 103 | (description "The runtime is the executable part of every AppImage. It mounts
|
| 104 | the payload via @acronym{FUSE} and executes the entrypoint, allowing users to run
|
| 105 | applications in a portable manner without the need for installation. This runtime
|
| 106 | ensures that the AppImage can access its bundled libraries and resources seamlessly,
|
| 107 | providing a consistent environment across different Linux distributions. In the
|
| 108 | absence of @acronym{FUSE}, the AppImage can still be started using the
|
| 109 | @option{--appimage-extract-and-run} flag.")
|
| 110 | (home-page "https://github.com/AppImage/type2-runtime")
|
| 111 | (license license:expat))))
|