summary refs log tree commit diff
path: root/pkgs/development/libraries/libmodulemd
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/libmodulemd')
-rw-r--r--pkgs/development/libraries/libmodulemd/default.nix47
-rw-r--r--pkgs/development/libraries/libmodulemd/glib-devdoc.patch13
-rw-r--r--pkgs/development/libraries/libmodulemd/pygobject-dir.patch45
3 files changed, 51 insertions, 54 deletions
diff --git a/pkgs/development/libraries/libmodulemd/default.nix b/pkgs/development/libraries/libmodulemd/default.nix
index ba77c7806b5..f296883b686 100644
--- a/pkgs/development/libraries/libmodulemd/default.nix
+++ b/pkgs/development/libraries/libmodulemd/default.nix
@@ -1,54 +1,83 @@
 { stdenv
+, substituteAll
 , fetchFromGitHub
-, pkgconfig
+, fetchpatch
+, pkg-config
 , meson
 , ninja
 , gobject-introspection
 , python3
 , libyaml
+, rpm
+, file
 , gtk-doc
-, docbook_xsl
+, docbook-xsl-nons
+, help2man
 , docbook_xml_dtd_412
 , glib
 }:
 
 stdenv.mkDerivation rec {
   pname = "libmodulemd";
-  version = "2.6.0";
+  version = "2.9.2";
 
-  outputs = [ "out" "devdoc" "py" ];
+  outputs = [ "bin" "out" "dev" "devdoc" "man" "py" ];
 
   src = fetchFromGitHub {
     owner = "fedora-modularity";
     repo = pname;
     rev = "${pname}-${version}";
-    sha256 = "0gizfmzs6jrzb29lwcimm5dq3027935xbzwgkbvbp67zcmjd3y5i";
+    sha256 = "dm0uvzM5v1zDQVkonHbrT9l9ICnXZbCSiLRCMZRxhXY=";
   };
 
   patches = [
-    ./pygobject-dir.patch
+    # Use proper glib devdoc path.
+    (substituteAll {
+      src = ./glib-devdoc.patch;
+      glib_devdoc = glib.devdoc;
+    })
+
+    # Install pygobject overrides to our prefix instead of python3 one.
+    # https://github.com/fedora-modularity/libmodulemd/pull/469
+    (fetchpatch {
+      url = "https://github.com/fedora-modularity/libmodulemd/commit/f72a4bea092f4d84cfc48a3e820eb10270e828d0.patch";
+      sha256 = "7/76N9ZQ7qv/DjsaMCL+YWPDzarH1JWW4Sg5HzBJLuc=";
+    })
+    (fetchpatch {
+      url = "https://github.com/fedora-modularity/libmodulemd/commit/021ab08006b5cf601ce153174fdf403b910b8273.patch";
+      sha256 = "JibEmxMiTmu3ShhWLIWfMCtu3c30UcHqXmX9b+2VZXw=";
+    })
   ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     meson
     ninja
     gtk-doc
-    docbook_xsl
+    docbook-xsl-nons
+    help2man
     docbook_xml_dtd_412
     gobject-introspection
   ];
 
   buildInputs = [
     libyaml
+    rpm
+    file # for libmagic
     glib
   ];
 
   mesonFlags = [
     "-Ddeveloper_build=false"
-    "-Dpygobject_override_dir=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
+    "-Dgobject_overrides_dir_py3=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
   ];
 
+  postFixup = ''
+    # Python overrides depend our own typelibs and other packages
+    mkdir -p "$py/nix-support"
+    echo "$out ${python3.pkgs.pygobject3} ${python3.pkgs.six}" > "$py/nix-support/propagated-build-inputs"
+  '';
+
   meta = with stdenv.lib; {
     description = "C Library for manipulating module metadata files";
     homepage = "https://github.com/fedora-modularity/libmodulemd";
diff --git a/pkgs/development/libraries/libmodulemd/glib-devdoc.patch b/pkgs/development/libraries/libmodulemd/glib-devdoc.patch
new file mode 100644
index 00000000000..cde42d8e0b2
--- /dev/null
+++ b/pkgs/development/libraries/libmodulemd/glib-devdoc.patch
@@ -0,0 +1,13 @@
+diff --git a/meson.build b/meson.build
+index a8b02b4..dd31a76 100644
+--- a/meson.build
++++ b/meson.build
+@@ -67,7 +67,7 @@ test = find_program('test')
+ with_docs = get_option('with_docs')
+ if with_docs
+   gtkdoc = dependency('gtk-doc')
+-  glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
++  glib_docpath = join_paths('@glib_devdoc@', 'share', 'gtk-doc', 'html')
+ 
+   ret = run_command ([test, '-e', join_paths(glib_docpath, 'glib/index.html')])
+   if ret.returncode() != 0
diff --git a/pkgs/development/libraries/libmodulemd/pygobject-dir.patch b/pkgs/development/libraries/libmodulemd/pygobject-dir.patch
deleted file mode 100644
index a367872eec6..00000000000
--- a/pkgs/development/libraries/libmodulemd/pygobject-dir.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff --git a/bindings/python/meson.build b/bindings/python/meson.build
-index 4358b79..61fd5a5 100644
---- a/bindings/python/meson.build
-+++ b/bindings/python/meson.build
-@@ -1,3 +1,5 @@
-+pygobject_override_dir = get_option('pygobject_override_dir')
-+
- get_overridedir = '''
- import os
- import sysconfig
-@@ -21,7 +23,7 @@ print(overridedir)
- '''
- 
- # Python 3
--if (get_option('with_py3_overrides'))
-+if (get_option('with_py3_overrides')) and pygobject_override_dir == ''
-   ret = run_command([python3, '-c', get_overridedir])
- 
-   if ret.returncode() != 0
-@@ -34,7 +36,7 @@ if (get_option('with_py3_overrides'))
- endif
- 
- # Python 2
--if (get_option('with_py2_overrides'))
-+if (get_option('with_py2_overrides')) and pygobject_override_dir == ''
-   ret2 = run_command([python2, '-c', get_overridedir])
- 
-   if ret2.returncode() != 0
-@@ -45,3 +47,7 @@ if (get_option('with_py2_overrides'))
- 
-   install_data('gi/overrides/Modulemd.py', install_dir: pygobject2_override_dir)
- endif
-+
-+if pygobject_override_dir != ''
-+    install_data('gi/overrides/Modulemd.py', install_dir: pygobject_override_dir)
-+endif
-diff --git a/meson_options.txt b/meson_options.txt
-index 147419f..9071a04 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -18,3 +18,4 @@ option('skip_introspection', type : 'boolean', value : false)
- option('python_name', type : 'string')
- option('with_py2_overrides', type : 'boolean', value : false)
- option('with_py3_overrides', type : 'boolean', value : true)
-+option('pygobject_override_dir', type : 'string', value : '', description: 'Path to pygobject overrides directory')