Skip to content

shared-mime-info: 1.13.1 -> 2.1#126050

Merged
jtojnar merged 1 commit intoNixOS:stagingfrom
est31:update-shared-mime-info
Jun 7, 2021
Merged

shared-mime-info: 1.13.1 -> 2.1#126050
jtojnar merged 1 commit intoNixOS:stagingfrom
est31:update-shared-mime-info

Conversation

@est31
Copy link
Contributor

@est31 est31 commented Jun 7, 2021

Motivation for this change

Prior update was in #68732 . The main motivation: #125920 (no idea yet whether it's of any help tho)

https://gitlab.freedesktop.org/xdg/shared-mime-info/-/tags/2.1
https://gitlab.freedesktop.org/xdg/shared-mime-info/-/releases#2.1

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@est31
Copy link
Contributor Author

est31 commented Jun 7, 2021

cc @mimame

@ofborg ofborg bot requested a review from mimame June 7, 2021 08:38
@ofborg ofborg bot added 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jun 7, 2021
@jtojnar
Copy link
Member

jtojnar commented Jun 7, 2021

Comparing the outputs of the old and new package, you probably need to run update-mime-database since there is ton of missing files.

Network also is not needed, you just need the appropriate dependencies (docbook_xml_dtd_412 and docbook-xsl-nons). But even if we build it, it is not actually installed so it is probably useless.

Lastly, could you please add freedesktop team to maintainers,

diff --git a/pkgs/data/misc/shared-mime-info/default.nix b/pkgs/data/misc/shared-mime-info/default.nix
index fefb7355ba3..63713d03e6d 100644
--- a/pkgs/data/misc/shared-mime-info/default.nix
+++ b/pkgs/data/misc/shared-mime-info/default.nix
@@ -1,4 +1,5 @@
-{ lib, stdenv
+{ stdenv
+, lib
 , fetchurl
 , fetchpatch
 , meson
@@ -20,6 +21,15 @@ stdenv.mkDerivation rec {
     sha256 = "0qw59rixlilrfzz730c55y8wzsbp7qzpn469yb83bs44vpy0rm5j";
   };
 
+  patches = [
+    # xmlto is only used for building spec, which is not installed anyway.
+    (fetchpatch {
+      name = "xmlto-optional.patch";
+      url = "https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/110.patch";
+      sha256 = "0p5gxlcmn8ji5bc7pd105s1halqwa1d28lfx9yj43rn6mav7allx";
+    })
+  ];
+
   nativeBuildInputs = [
     meson
     ninja
@@ -35,18 +45,15 @@ stdenv.mkDerivation rec {
     glib
   ];
 
-  # using xmlto involves using the network
-  patches = [(fetchpatch {
-    name = "xmlto-optional.patch";
-    url = "https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/110.patch";
-    sha256 = "0p5gxlcmn8ji5bc7pd105s1halqwa1d28lfx9yj43rn6mav7allx";
-  })];
+  mesonFlags = [
+    "-Dupdate-mimedb=true"
+  ];
 
   meta = with lib; {
     description = "A database of common MIME types";
     homepage = "http://freedesktop.org/wiki/Software/shared-mime-info";
     license = licenses.gpl2Plus;
     platforms = platforms.unix;
-    maintainers = [ maintainers.mimame ];
+    maintainers = teams.freedesktop.members ++ [ maintainers.mimame ];
   };
 }

@jtojnar
Copy link
Member

jtojnar commented Jun 7, 2021

Also this needs to target staging branch since it causes a mass rebuild.

@est31 est31 force-pushed the update-shared-mime-info branch from caa717a to 1027bc5 Compare June 7, 2021 11:18
@est31 est31 changed the base branch from master to staging June 7, 2021 11:18
@est31
Copy link
Contributor Author

est31 commented Jun 7, 2021

I've tried out github's "change base branch" feature to not have to open a new PR and apparently it requested tons of reviews as a result... sorry for the inbox spam.

@est31 est31 force-pushed the update-shared-mime-info branch from 1027bc5 to fe02994 Compare June 7, 2021 11:27
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
url = "https://gitlab.freedesktop.org/xdg/${pname}/uploads/0ee50652091363ab0d17e335e5e74fbe/${pname}-${version}.tar.xz";
url = "https://gitlab.freedesktop.org/xdg/shared-mime-info/uploads/0ee50652091363ab0d17e335e5e74fbe/shared-mime-info-${version}.tar.xz";

Also why is this not using fetchFromGitLab?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you supposed to avoid pname? I'm very new to this so I have no idea. Also, I've adopted fetchFromGitlab now, using ${pname}, but can change it if requested.

@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 8.has: clean-up This PR removes packages or removes other cruft 8.has: package (new) This PR adds a new package and removed 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. labels Jun 7, 2021
@ofborg ofborg bot requested a review from mimame June 7, 2021 11:28
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. and removed 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. labels Jun 7, 2021
@est31 est31 force-pushed the update-shared-mime-info branch from 51a7c49 to 0677cfc Compare June 7, 2021 11:36
@ofborg ofborg bot requested a review from jtojnar June 7, 2021 11:37
@ofborg ofborg bot added 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. and removed 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. labels Jun 7, 2021
@est31
Copy link
Contributor Author

est31 commented Jun 7, 2021

I've tried building the gtksourceview package again after applying @jtojnar 's suggestions and now the package works well.

@est31 est31 force-pushed the update-shared-mime-info branch from 0677cfc to 2a5b615 Compare June 7, 2021 12:52
@ofborg ofborg bot requested a review from jtojnar June 7, 2021 13:02
@est31 est31 force-pushed the update-shared-mime-info branch from 2a5b615 to 59adc6c Compare June 7, 2021 17:00
@jtojnar jtojnar merged commit b43f2e9 into NixOS:staging Jun 7, 2021
@jtojnar
Copy link
Member

jtojnar commented Jun 7, 2021

This has been on my to-do list for the past year so thanks for tackling this 😸

@est31 est31 deleted the update-shared-mime-info branch June 10, 2021 08:54
@Mindavi
Copy link
Contributor

Mindavi commented Jun 16, 2021

Note that this does break cross-compilation. I'll see if I can do anything about that. The first thing that I see is that libxml2 seems to be required in the nativeBuildInputs now, but after that it tries to run the update-mimedb tool, which is not configured correctly in meson as a tool that might need to be run on the 'build' platform (the terminology keeps confusing me...).

That's something that (ideally) needs to be addressed upstream though, I'll check if I can convince them to fix that :).

shared-mime-info 1.13.1 did seem to cross-compile ok.

@Mindavi
Copy link
Contributor

Mindavi commented Jun 23, 2021

I've made a PR upstream: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/136, hope that gets accepted and then it should be good again 👍.

Seems that it was a relatively easy fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: clean-up This PR removes packages or removes other cruft 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 101-500 This PR causes between 101 and 500 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants