~ruther/guix-local

14d7fe42b83081a4bd945351d67f4f15b05bbd12 — Ashvith Shetty 1 year, 4 months ago 8261915
gnu: Add beanbag.

* gnu/packages/zig-xyz.scm (beanbag): New variable.

Change-Id: I1ffb34dd771e4cb0938f1c471573e6bbe1ff5046
Signed-off-by: Hilton Chain <hako@ultrarare.space>
Modified-by: Hilton Chain <hako@ultrarare.space>
1 files changed, 58 insertions(+), 0 deletions(-)

M gnu/packages/zig-xyz.scm
M gnu/packages/zig-xyz.scm => gnu/packages/zig-xyz.scm +58 -0
@@ 38,6 38,64 @@
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages zig))

(define-public beanbag
  (package
    (name "beanbag")
    (version "0.1.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://codeberg.org/bwbuhse/beanbag")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1d2h5bqicqnyawswdq7bg1w9frjk0ra2sva1as2qgc5s7pjclyql"))
       (snippet (rename-zig-dependencies '(("clap" . "zig-clap")
                                           ("zigimg" . "zig-zigimg"))))))
    (build-system zig-build-system)
    (arguments
     (list
      #:install-source? #f
      #:zig-release-type "safe"
      #:phases
      #~(modify-phases %standard-phases
          (add-after 'unpack 'remove-deps
            (lambda* (#:key inputs #:allow-other-keys)
              (delete-file-recursively "protocol")
              (substitute* "build.zig"
                (("protocol/(wlr-layer-shell-unstable-v1.xml)" _ file)
                 (string-append
                  (search-input-file
                   inputs
                   (in-vicinity "share/wlr-protocols/unstable/" file)))))))
          ;; TODO: Support test-target when changing zig-build-system next time.
          (replace 'check
            (lambda* (#:key tests? zig-test-flags target parallel-tests?
                      #:allow-other-keys)
              (when (and tests? (not target))
                (let ((old-destdir (getenv "DESTDIR")))
                  (setenv "DESTDIR" "test-out") ;; Avoid colisions with the build output
                  (let ((call `("zig" "build" "check" "--verbose"
                                ,(string-append
                                  "-j" (if parallel-tests?
                                           (number->string (parallel-job-count))
                                           "1"))
                                ,@zig-test-flags)))
                    (format #t "running: ~s~%" call)
                    (apply invoke call))
                  (if old-destdir
                      (setenv "DESTDIR" old-destdir)
                      (unsetenv "DESTDIR")))))))))
    (inputs (list wlr-protocols zig-clap zig-pixman zig-wayland zig-zigimg))
    (native-inputs (list pkg-config))
    (home-page "https://codeberg.org/bwbuhse/beanbag")
    (synopsis "Wallpaper application for Wayland compositors")
    (description
     "@command{beanbag} is a wallpaper application for Wayland compositors,
heavily inspired by @code{wbg}.")
    (license license:gpl3+)))

(define-public river
  (package
    (name "river")