From patchwork Thu Jun 22 19:33:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bruno Victal X-Patchwork-Id: 51192 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E472927BBE2; Thu, 22 Jun 2023 20:34:30 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 98BD427BBE2 for ; Thu, 22 Jun 2023 20:34:29 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCQ4C-0006Yz-2E; Thu, 22 Jun 2023 15:34:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCQ4B-0006Yf-4L for guix-patches@gnu.org; Thu, 22 Jun 2023 15:34:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCQ4A-0002uv-Rp for guix-patches@gnu.org; Thu, 22 Jun 2023 15:34:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qCQ4A-00064k-OB for guix-patches@gnu.org; Thu, 22 Jun 2023 15:34:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#60826] [PATCH gnome-team v4 3/4] gnu: shared-mime-info: Update to 2.2. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 22 Jun 2023 19:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60826 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60826@debbugs.gnu.org Cc: Bruno Victal , liliana.prikler@gmail.com Received: via spool by 60826-submit@debbugs.gnu.org id=B60826.168746242223301 (code B ref 60826); Thu, 22 Jun 2023 19:34:02 +0000 Received: (at 60826) by debbugs.gnu.org; 22 Jun 2023 19:33:42 +0000 Received: from localhost ([127.0.0.1]:36815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCQ3p-00063k-Up for submit@debbugs.gnu.org; Thu, 22 Jun 2023 15:33:42 -0400 Received: from smtpm5.myservices.hosting ([185.26.105.236]:54766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCQ3n-00063a-BB for 60826@debbugs.gnu.org; Thu, 22 Jun 2023 15:33:40 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm5.myservices.hosting (Postfix) with ESMTP id 62CF120CBD; Thu, 22 Jun 2023 21:33:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id C8CD1800AB; Thu, 22 Jun 2023 21:33:37 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id t_paWuBBz00n; Thu, 22 Jun 2023 21:33:36 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id B193A800AA; Thu, 22 Jun 2023 21:33:36 +0200 (CEST) From: Bruno Victal Date: Thu, 22 Jun 2023 20:33:19 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/gnome.scm (shared-mime-info): Update to 2.2. [source]: Switch to git source. [build-system]: Switch to meson-build-system. [arguments]: Enable parallel builds. Do not patch test files. [native-inputs]: Switch to new style. Add python, xdgmime. Remove itstool. * gnu/packages/patches/shared-mime-info-xdgmime-path.patch: New file. * gnu/packages/freedesktop.scm: Register it. --- gnu/local.mk | 2 + gnu/packages/freedesktop.scm | 41 +++++++++++++------ .../shared-mime-info-xdgmime-path.patch | 22 ++++++++++ 3 files changed, 52 insertions(+), 13 deletions(-) create mode 100644 gnu/packages/patches/shared-mime-info-xdgmime-path.patch diff --git a/gnu/local.mk b/gnu/local.mk index 4d0e34cf09..50d47234c9 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -58,6 +58,7 @@ # Copyright © 2022 jgart # Copyright © 2023 Zheng Junjie <873216071@qq.com> # Copyright © 2023 Ivana Drazovic +# Copyright © 2023 Bruno Victal # # This file is part of GNU Guix. # @@ -1911,6 +1912,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 @@ (define xdgmime (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 . + +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