about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libmodulemd
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-08-22 13:47:37 +0000
committerAlyssa Ross <hi@alyssa.is>2019-08-22 18:22:22 +0000
commit1b9a13c4689af7e088eb7af5589f8c811282846a (patch)
tree3ed032953008280fb94ef894c869ff3e2a2f7865 /nixpkgs/pkgs/development/libraries/libmodulemd
parent4999a38db7c5de0ea9f514a12ecd4133cce647f3 (diff)
parent1412af4b2cfae71d447164097d960d426e9752c0 (diff)
downloadnixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.gz
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.bz2
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.lz
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.xz
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.tar.zst
nixlib-1b9a13c4689af7e088eb7af5589f8c811282846a.zip
Merge remote-tracking branch 'channels/nixos-unstable'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libmodulemd')
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodulemd/1.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodulemd/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodulemd/dont-check-docs.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodulemd/pygobject-dir.patch45
4 files changed, 154 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libmodulemd/1.nix b/nixpkgs/pkgs/development/libraries/libmodulemd/1.nix
new file mode 100644
index 000000000000..174296375e08
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmodulemd/1.nix
@@ -0,0 +1,21 @@
+{ libmodulemd, fetchurl }:
+
+libmodulemd.overrideAttrs(old: rec {
+  name = "libmodulemd-${version}";
+  version = "1.8.15";
+
+  # Removes py output since there's no overrides here
+  outputs = [ "out" "devdoc" ];
+
+  patches = [
+    # Checks for glib docs in glib's prefix
+    # but they're installed to another
+    ./dont-check-docs.patch
+  ];
+
+  src = fetchurl {
+    url = "https://github.com/fedora-modularity/libmodulemd/releases/download/${name}/modulemd-${version}.tar.xz";
+    sha256 = "0gz8p3qzji3cx0r57sy3gn4dhigg4k7pcxj3lmjcjn13vxh5rm7z";
+  };
+
+})
diff --git a/nixpkgs/pkgs/development/libraries/libmodulemd/default.nix b/nixpkgs/pkgs/development/libraries/libmodulemd/default.nix
new file mode 100644
index 000000000000..ba77c7806b53
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmodulemd/default.nix
@@ -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;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmodulemd/dont-check-docs.patch b/nixpkgs/pkgs/development/libraries/libmodulemd/dont-check-docs.patch
new file mode 100644
index 000000000000..38ad5683692b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmodulemd/dont-check-docs.patch
@@ -0,0 +1,29 @@
+diff --git a/meson.build b/meson.build
+index 155c9e7..9125372 100644
+--- a/meson.build
++++ b/meson.build
+@@ -60,15 +60,15 @@ sh = find_program('sh')
+ sed = find_program('sed')
+ test = find_program('test')
+ 
+-ret = run_command ([test, '-e', join_paths(glib_docpath, 'glib/index.html')])
+-if ret.returncode() != 0
+-  error('Missing documentation for GLib.')
+-endif
+-
+-ret = run_command ([test, '-e', join_paths(glib_docpath, 'gobject/index.html')])
+-if ret.returncode() != 0
+-  error('Missing documentation for GObject.')
+-endif
++# ret = run_command ([test, '-e', join_paths(glib_docpath, 'glib/index.html')])
++# if ret.returncode() != 0
++#   error('Missing documentation for GLib.')
++# endif
++
++# ret = run_command ([test, '-e', join_paths(glib_docpath, 'gobject/index.html')])
++# if ret.returncode() != 0
++#   error('Missing documentation for GObject.')
++# endif
+ 
+ python_name = get_option('python_name')
+ 
diff --git a/nixpkgs/pkgs/development/libraries/libmodulemd/pygobject-dir.patch b/nixpkgs/pkgs/development/libraries/libmodulemd/pygobject-dir.patch
new file mode 100644
index 000000000000..a367872eec65
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmodulemd/pygobject-dir.patch
@@ -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')