aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorBruno Victal <mirai@makinata.eu>2023-06-22 20:33:19 +0100
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2023-06-24 23:59:50 +0200
commit0a167432dbccb3ed5b6f27a48b61e570846cf784 (patch)
treed65c4e7da78349dd9d5404cf6f2e7a5a45a0e3f9 /gnu
parent5539ad8c65a943bfc0cec35dea76d016bcb881fc (diff)
downloadguix-0a167432dbccb3ed5b6f27a48b61e570846cf784.tar
guix-0a167432dbccb3ed5b6f27a48b61e570846cf784.tar.gz
gnu: shared-mime-info: Update to 2.2.
* gnu/packages/freedesktop.scm (shared-mime-info): Update to 2.2. [source]: Use git-fetch. [build-system]: Use meson-build-system. [arguments]<#:parallel-build?>: Removed argument. <#:phases>: Replace ‘patch-source-shebangs’ with a version that skips mime detection checks. [native-inputs]: Drop labels. Add python and xdgmime. Remove itstool. * gnu/packages/patches/shared-mime-info-xdgmime-path.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk2
-rw-r--r--gnu/packages/freedesktop.scm41
-rw-r--r--gnu/packages/patches/shared-mime-info-xdgmime-path.patch22
3 files changed, 52 insertions, 13 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 5dae534ec3..d0c03b9078 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -59,6 +59,7 @@
# Copyright © 2023 Zheng Junjie <873216071@qq.com>
# Copyright © 2023 Ivana Drazovic <iv.dra@hotmail.com>
# Copyright © 2023 Andy Tai <atai@atai.org>
+# Copyright © 2023 Bruno Victal <mirai@makinata.eu>
#
# This file is part of GNU Guix.
#
@@ -1919,6 +1920,7 @@ dist_patch_DATA = \
%D%/packages/patches/libsequoia-remove-store.patch \
%D%/packages/patches/serf-python3.patch \
%D%/packages/patches/shakespeare-spl-fix-grammar.patch \
+ %D%/packages/patches/shared-mime-info-xdgmime-path.patch \
%D%/packages/patches/sharutils-CVE-2018-1000097.patch \
%D%/packages/patches/slim-session.patch \
%D%/packages/patches/slim-config.patch \
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index b6b9f5d4ee..b16fa5d387 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -512,29 +512,44 @@ display servers. It supports many different languages and emoji.")
(description "This module is used for shared-mime-info package tests.")
(license (list license:lgpl2.1+ license:artistic2.0)))))
+;; Note: when updating shared-mime-info, don't forget to update xdgmime's commit
+;; to the one used in the release.
(define-public shared-mime-info
(package
(name "shared-mime-info")
- (version "1.15")
+ (version "2.2")
(source (origin
- (method url-fetch)
- (uri (string-append
- "https://gitlab.freedesktop.org/xdg/shared-mime-info/uploads/"
- "b27eb88e4155d8fccb8bb3cd12025d5b/shared-mime-info-" version
- ".tar.xz"))
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.freedesktop.org/xdg/shared-mime-info.git")
+ (commit version)))
+ (file-name (git-file-name name version))
(sha256
(base32
- "146vynj78wcwdq0ms52jzm1r4m6dzi1rhyh3h4xyb6bw8ckv10pl"))))
- (build-system gnu-build-system)
+ "04dfnnflspprxg7qia3whz1754lfvgi4ihvmihg379936zy5xd22"))
+ (patches (search-patches "shared-mime-info-xdgmime-path.patch"))))
+ (build-system meson-build-system)
(arguments
- ;; The build system appears not to be parallel-safe.
- '(#:parallel-build? #f))
+ (list
+ #:configure-flags
+ #~(list #$(format #f "-Dxdgmime-path=~a/bin"
+ (this-package-native-input "xdgmime"))
+ "-Dupdate-mimedb=true")
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; Don't patch shebangs for the test files.
+ (replace 'patch-source-shebangs
+ (lambda _
+ (let ((pred (lambda (file stat)
+ (and (eq? 'regular (stat:type stat))
+ (not (string-prefix? "./tests/mime-detection"
+ file))))))
+ (for-each patch-shebang
+ (find-files "." pred #:stat lstat))))))))
(inputs
(list glib libxml2))
(native-inputs
- `(("gettext" ,gettext-minimal)
- ("itstool" ,itstool)
- ("pkg-config" ,pkg-config)))
+ (list gettext-minimal pkg-config python xdgmime))
(home-page "https://www.freedesktop.org/wiki/Software/shared-mime-info")
(synopsis "Database of common MIME types")
(description
diff --git a/gnu/packages/patches/shared-mime-info-xdgmime-path.patch b/gnu/packages/patches/shared-mime-info-xdgmime-path.patch
new file mode 100644
index 0000000000..27c578f3fa
--- /dev/null
+++ b/gnu/packages/patches/shared-mime-info-xdgmime-path.patch
@@ -0,0 +1,22 @@
+Adapted from <https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/182>.
+
+diff --git a/meson.build b/meson.build
+index 3c75424..7058562 100644
+--- a/meson.build
++++ b/meson.build
+@@ -26,11 +26,11 @@ xmlto = find_program('xmlto', required: false)
+ ###############################################################################
+ # Find xdgmime
+
+-xdgmime = get_option('xdgmime-path') / 'src'
++xdgmime = get_option('xdgmime-path')
+
+-xdgmime_print_mime_data = find_program(xdgmime/'print-mime-data', required: false)
+-xdgmime_test_mime_data = find_program(xdgmime/'test-mime-data', required: false)
+-xdgmime_test_mime = find_program(xdgmime/'test-mime', required: false)
++xdgmime_print_mime_data = find_program('print-mime-data', xdgmime/'print-mime-data', required: false)
++xdgmime_test_mime_data = find_program('test-mime-data', xdgmime/'test-mime-data', required: false)
++xdgmime_test_mime = find_program('test-mime', xdgmime/'test-mime', required: false)
+ xdgmime_found = (
+ xdgmime_print_mime_data.found() and
+ xdgmime_test_mime_data.found() and