Subject: [bug#75132] [PATCH] gnu: Add dmz-cursor-theme, haiku-gtk-theme and haiku-icon-theme.

From: Homo <[email-masked]>
Date: Fri, 27 Dec 2024 06:55:21 +0200

* gnu/packages/gnome-xyz.scm (dmz-cursor-theme, haiku-gtk-theme and haiku-icon-theme): New variables.

Change-Id: Icacff7a63a62bdf35fcd3cef159a5369ea656c65
---
The reason I add all three in one patch is because haiku-gtk-theme depends on them.
I don't know how to properly describe Haiku theme when they don't have proper descriptions in readmes.
The important thing about these themes is to bring back old style "3D" look.

 gnu/packages/gnome-xyz.scm | 127 +++++++++++++++++++++++++++++++++++++
 1 file changed, 127 insertions(+)

diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index a09c0befb0..ae28137e96 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2022 Sughosha <[email-masked]>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <[email-masked]>
 ;;; Copyright © 2023 Eidvilas Markevičius <[email-masked]>
+;;; Copyright © 2024 Homo <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -42,6 +43,7 @@ (define-module (gnu packages gnome-xyz)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
+  #:use-module (guix download)
   #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module (guix packages)
@@ -69,6 +71,7 @@ (define-module (gnu packages gnome-xyz)
   #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages ssh)
+  #:use-module (gnu packages text-editors)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages ruby)
   #:use-module (gnu packages web)
@@ -173,6 +176,42 @@ (define-public faba-icon-theme
     (license (list license:lgpl3+
                    license:cc-by-sa4.0))))
 
+(define-public haiku-icon-theme
+  (let ((revision "0")
+        ;; No releases, just only one commit.
+        (commit "c83ff57f7a2315ac745c08282ef02a082097ea48"))
+    (package
+      (name "haiku-icon-theme")
+      (version (git-version "initial" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/phillbush/haiku-icons")
+               (commit commit)))
+         (sha256
+          (base32
+           "1q56ar6c0v1kq69k1a5762gyw0jl5y6wh0k2jyga0jx2xa3fhly1"))
+         (file-name (git-file-name name version))))
+      (build-system gnu-build-system)
+      (arguments
+       (list
+         ;; No tests.
+         #:tests? #f
+         #:phases
+         #~(modify-phases %standard-phases
+             (delete 'configure)
+             (replace 'install
+               (lambda _
+                 (let* ((dest (string-append #$output "/share/icons/Haiku")))
+                   (mkdir-p dest)
+                   (copy-recursively "Haiku" dest)))))))
+      (home-page "https://github.com/phillbush/haiku-icons")
+      (native-inputs (list ed inkscape/stable))
+      (synopsis "3D icon theme")
+      (description "Icon theme from Haiku OS.")
+      (license license:expat))))
+
 (define-public moka-icon-theme
   (package
     (inherit faba-icon-theme)
@@ -402,6 +441,63 @@ (define theme
 cursor set.  This project aims at improving the cursor experience.")
     (license license:gpl3)))
 
+(define-public dmz-cursor-theme
+  (package
+    (name "dmz-cursor-theme")
+    (version "0.4.5.1")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append
+             "mirror://debian/pool/main/d/dmz-cursor-theme/"
+             "dmz-cursor-theme_" version ".tar.xz"))
+      (sha256
+       (base32
+        "1w1626x52y45k8pcy28fc9phni60yg5m6vjbh24jxq5j8bg00slx"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list
+       ;; No tests.
+       #:tests? #f
+       #:phases
+       #~(modify-phases %standard-phases
+           (delete 'configure)
+           (replace 'build
+             (lambda _
+               (for-each (lambda (color)
+                           (chdir (string-append "DMZ-" color "/pngs"))
+                           (invoke "./make.sh")
+                           (chdir "../.."))
+                         (list "White" "Black"))))
+           (replace 'install
+             (lambda _
+               (let* ((icondir (string-append #$output "/share/icons")))
+                 (for-each
+                   (lambda (color)
+                     (let* ((dest (string-append icondir "/" color))
+                            (cursordir (string-append dest "/cursors")))
+                       (mkdir-p cursordir)
+                       (for-each
+                         (lambda (file)
+                           (install-file (string-append color "/" file)
+                                         dest))
+                         (list "cursor.theme" "index.theme"))
+                       (copy-recursively
+                         (string-append color "/xcursors") cursordir)))
+                   (list "DMZ-White" "DMZ-Black"))
+                 (install-file "DMZ-White/dmz.svg"
+                               (string-append icondir "/DMZ-White"))
+                 (install-file "DMZ-Black/dmz-aa.svg"
+                               (string-append icondir "/DMZ-Black"))))))))
+    (native-inputs (list xcursorgen))
+    (home-page "https://packages.debian.org/sid/gnome/dmz-cursor-theme")
+    (synopsis "Style neutral, scalable cursor theme")
+    (description
+      "This package contains the DMZ cursor themes, which are derived from
+the Industrial theme developed for the Ximian GNOME desktop.  Black and
+white cursors are provided, in scalable formats.")
+    (license license:cc-by-sa3.0)))
+
 (define-public gnome-plots
   (package
     (name "gnome-plots")
@@ -1345,6 +1441,37 @@ (define-public greybird-gtk-theme
 Shimmer Project.  It supports GNOME, Unity, and Xfce.")
     (license (list license:gpl2+ license:cc-by-sa3.0))))
 
+(define-public haiku-gtk-theme
+  (let ((commit "633062a73a4bd285480c6c4737936f6c88806234")
+	    (revision "0"))
+    (package
+      (name "haiku-gtk-theme")
+      (version (git-version "0.1" revision commit))
+      (source
+        (origin
+         (method git-fetch)
+         (uri (git-reference
+                (url "https://github.com/B00merang-Project/Haiku")
+                (commit commit)))
+        (sha256
+          (base32
+           "1c8fvgsic1acqzlc56v7w0im15yr6gz0rcr2s3iilg382ac2icr2"))
+        (file-name (git-file-name name version))))
+      (build-system copy-build-system)
+      (arguments
+       `(#:install-plan
+         `(("." "share/themes/Haiku"
+            #:exclude ("LICENSE" "README.md")))))
+      ;; According to index.theme:
+      ;; IconTheme=Haiku
+      ;; CursorTheme=DMZ-White
+      (propagated-inputs (list dmz-cursor-theme haiku-icon-theme))
+      (inputs (list gtk-engines))
+      (home-page "https://github.com/B00merang-Project/Haiku")
+      (synopsis "3D GTK+ theme")
+      (description "GTK+ theme based on appearance of Haiku OS.")
+      (license license:gpl3))))
+
 (define-public matcha-theme
   (package
     (name "matcha-theme")
-- 
2.47.1