diff mbox series

[bug#60826,gnome-team,v4,2/4] gnu: Add xdgmime.

Message ID a0bfaa8641543530ba45f2999560892bcad630c4.1687462396.git.mirai@makinata.eu
State New
Headers show
Series None | expand

Commit Message

Bruno Victal June 22, 2023, 7:33 p.m. UTC
This package is only used for testing shared-mime-info, and thus not exported.

* gnu/packages/freedesktop.scm (xdgmime): New variable.
---
 gnu/packages/freedesktop.scm | 47 ++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index bd3df9ee68..b6b9f5d4ee 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -33,6 +33,7 @@ 
 ;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
 ;;; Copyright © 2022 muradm <mail@muradm.net>
 ;;; Copyright © 2023 Alex Devaure <ajadevaure@gmail.com>
+;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -465,6 +466,52 @@  (define-public maliit-keyboard
 display servers.  It supports many different languages and emoji.")
     (license license:gpl3+)))
 
+;; Private package used by shared-mime-info.
+(define xdgmime
+  ;; No public release, match commit to the one used in the
+  ;; shared-mime-info release.
+  (let ((commit "de283fc430460b9b3a7e61432a6d273cd64cb102")
+        (revision "1"))
+    (package
+      (name "xdgmime")
+      (version (git-version "0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://gitlab.freedesktop.org/xdg/xdgmime.git")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "0m9k7nfxgchb9j0xh9cwsldz6564qisqdkvlhgkcgc0grd4nfbn9"))))
+      (build-system gnu-build-system)
+      (arguments
+       (list
+        #:tests? #f  ; no tests
+        #:make-flags #~(list (string-append "DESTDIR=" #$output)
+                             #$(string-append "CC=" (cc-for-target)))
+        #:imported-modules `((guix build copy-build-system)
+                             ,@%gnu-build-system-modules)
+        #:modules `((guix build gnu-build-system)
+                    ((guix build copy-build-system) #:prefix copy:)
+                    (guix build utils))
+        #:phases
+        #~(modify-phases %standard-phases
+            ;; Package uses a hand-crafted Makefile.
+            (delete 'configure)
+            (replace 'install
+              (lambda args
+                (apply (assoc-ref copy:%standard-phases 'install)
+                       #:install-plan
+                       '(("src" "bin/" #:include ("print-mime-data"
+                                                  "test-mime-data"
+                                                  "test-mime")))
+                       args))))))
+      (home-page "https://gitlab.freedesktop.org/xdg/xdgmime/")
+      (synopsis "Module that parses the freedesktop.org MIME spec")
+      (description "This module is used for shared-mime-info package tests.")
+      (license (list license:lgpl2.1+ license:artistic2.0)))))
+
 (define-public shared-mime-info
   (package
     (name "shared-mime-info")