libmodulemd: init at 2.6.0
Includes a patch for the usual pygobject override stuff. Pending upstream submission.
This commit is contained in:
parent
dca61d854f
commit
fdd28981d7
59
pkgs/development/libraries/libmodulemd/default.nix
Normal file
59
pkgs/development/libraries/libmodulemd/default.nix
Normal file
@ -0,0 +1,59 @@
|
||||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, pkgconfig
|
||||
, meson
|
||||
, ninja
|
||||
, gobject-introspection
|
||||
, python3
|
||||
, libyaml
|
||||
, gtk-doc
|
||||
, docbook_xsl
|
||||
, docbook_xml_dtd_412
|
||||
, glib
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "libmodulemd";
|
||||
version = "2.6.0";
|
||||
|
||||
outputs = [ "out" "devdoc" "py" ];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "fedora-modularity";
|
||||
repo = pname;
|
||||
rev = "${pname}-${version}";
|
||||
sha256 = "0gizfmzs6jrzb29lwcimm5dq3027935xbzwgkbvbp67zcmjd3y5i";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./pygobject-dir.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkgconfig
|
||||
meson
|
||||
ninja
|
||||
gtk-doc
|
||||
docbook_xsl
|
||||
docbook_xml_dtd_412
|
||||
gobject-introspection
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libyaml
|
||||
glib
|
||||
];
|
||||
|
||||
mesonFlags = [
|
||||
"-Ddeveloper_build=false"
|
||||
"-Dpygobject_override_dir=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
|
||||
];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "C Library for manipulating module metadata files";
|
||||
homepage = "https://github.com/fedora-modularity/libmodulemd";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
45
pkgs/development/libraries/libmodulemd/pygobject-dir.patch
Normal file
45
pkgs/development/libraries/libmodulemd/pygobject-dir.patch
Normal file
@ -0,0 +1,45 @@
|
||||
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')
|
@ -12346,6 +12346,8 @@ in
|
||||
|
||||
libvdpau = callPackage ../development/libraries/libvdpau { };
|
||||
|
||||
libmodulemd = callPackage ../development/libraries/libmodulemd { };
|
||||
|
||||
libvdpau-va-gl = callPackage ../development/libraries/libvdpau-va-gl { };
|
||||
|
||||
libversion = callPackage ../development/libraries/libversion { };
|
||||
|
Loading…
Reference in New Issue
Block a user