about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gupnp
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gupnp')
-rw-r--r--nixpkgs/pkgs/development/libraries/gupnp/0001-pkg-config-Declare-header-dependencies-as-public.patch55
-rw-r--r--nixpkgs/pkgs/development/libraries/gupnp/1.6.nix73
-rw-r--r--nixpkgs/pkgs/development/libraries/gupnp/default.nix103
3 files changed, 231 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gupnp/0001-pkg-config-Declare-header-dependencies-as-public.patch b/nixpkgs/pkgs/development/libraries/gupnp/0001-pkg-config-Declare-header-dependencies-as-public.patch
new file mode 100644
index 000000000000..46a2dae382d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gupnp/0001-pkg-config-Declare-header-dependencies-as-public.patch
@@ -0,0 +1,55 @@
+From a3461f69222ef23b2edd411c5fc8daefea556a2c Mon Sep 17 00:00:00 2001
+From: Jan Tojnar <jtojnar@gmail.com>
+Date: Wed, 20 Oct 2021 20:55:29 +0200
+Subject: [PATCH] pkg-config: Declare header dependencies as public
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The headers include libsoup and libxml2 headers but those libraries are only
+listed in Requires.private. This does not matter for upstream pkg-config
+because it uses Cflags from libraries in Requires.private as well but as our
+pkg-config is patched to only use Requires.private for static linking.
+
+Let’s add libsoup-2.4 and libxml-2.0 to Requires rather than Requires.private
+to make the reverse dependencies correctly find their headers.
+---
+ libgupnp/meson.build | 2 +-
+ meson.build          | 3 ++-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/libgupnp/meson.build b/libgupnp/meson.build
+index cb8a102..5fda9d8 100644
+--- a/libgupnp/meson.build
++++ b/libgupnp/meson.build
+@@ -129,7 +129,7 @@ pkg.generate(
+     libgupnp,
+     subdirs: 'gupnp-1.2',
+     name : 'gupnp-1.2',
+-    requires : ['glib-2.0', 'gio-2.0', 'gssdp-1.2'],
++    requires : ['glib-2.0', 'gio-2.0', 'gssdp-1.2', 'libsoup-2.4 >= ' + libsoup_version, 'libxml-2.0'],
+     description : 'GObject-based UPnP library',
+     version : meson.project_version(),
+     filebase : 'gupnp-1.2'
+diff --git a/meson.build b/meson.build
+index 3790bcf..c96a983 100644
+--- a/meson.build
++++ b/meson.build
+@@ -25,12 +25,13 @@ gssdp_dep = dependency('gssdp-1.2', version : '>= 1.3.0', default_options: ['sni
+ 
+ gio_unix = dependency('gio-unix-2.0', version: '>= 2.44', required: host_machine.system() != 'windows')
+ 
++libsoup_version = '2.48.0'
+ dependencies = [
+     dependency('glib-2.0', version : '>= ' + glib_version),
+     dependency('gio-2.0', version : '>= ' + glib_version),
+     dependency('gmodule-2.0', version : '>= ' + glib_version),
+     dependency('gobject-2.0', version : '>= ' + glib_version),
+-    dependency('libsoup-2.4', version : '>= 2.48.0'),
++    dependency('libsoup-2.4', version : '>= ' + libsoup_version),
+     gssdp_dep,
+     dependency('libxml-2.0'),
+ ]
+-- 
+2.33.0
+
diff --git a/nixpkgs/pkgs/development/libraries/gupnp/1.6.nix b/nixpkgs/pkgs/development/libraries/gupnp/1.6.nix
new file mode 100644
index 000000000000..44ae478e42f5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gupnp/1.6.nix
@@ -0,0 +1,73 @@
+{ stdenv
+, lib
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, vala
+, gi-docgen
+, glib
+, gssdp_1_6
+, libsoup_3
+, libxml2
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gupnp";
+  version = "1.6.6";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gupnp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    hash = "sha256-ydxQ6MeLN5LRsObFxfUsk+k0XT2uKJHjEamTpXT1oE8=";
+  };
+
+  depsBuildBuild = [
+    pkg-config
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gobject-introspection
+    vala
+    gi-docgen
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    gssdp_1_6
+    libsoup_3
+    libxml2
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+  ];
+
+  doCheck = true;
+
+  postFixup = ''
+    # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
+    moveToOutput "share/doc" "$devdoc"
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      attrPath = "gupnp_1_6";
+      packageName = pname;
+    };
+  };
+
+  meta = with lib; {
+    homepage = "http://www.gupnp.org/";
+    description = "An implementation of the UPnP specification";
+    mainProgram = "gupnp-binding-tool-1.6";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gupnp/default.nix b/nixpkgs/pkgs/development/libraries/gupnp/default.nix
new file mode 100644
index 000000000000..d9e9f483a63b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gupnp/default.nix
@@ -0,0 +1,103 @@
+{ stdenv
+, lib
+, fetchurl
+, fetchpatch2
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, vala
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_412
+, docbook_xml_dtd_45
+, glib
+, gssdp
+, libsoup
+, libxml2
+, libuuid
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gupnp";
+  version = "1.4.4";
+
+  outputs = [ "out" "dev" ]
+    ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gupnp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-N2GxXLBjYh+Efz7/t9djfwMXUA/Ka9oeGQT3OSF1Ch8=";
+  };
+
+  patches = [
+    # Bring .pc file in line with our patched pkg-config.
+    ./0001-pkg-config-Declare-header-dependencies-as-public.patch
+
+    # Unbreak build with Meson 1.2.0
+    # https://gitlab.gnome.org/GNOME/gupnp/-/merge_requests/33
+    (fetchpatch2 {
+      name = "meson-1.2-fix.patch";
+      url = "https://gitlab.gnome.org/GNOME/gupnp/-/commit/85c0244cfbf933d3e90d50ab68394c68d86f9ed5.patch";
+      hash = "sha256-poDhkEgDTpgGnTbbZLPwx8Alf0h81vmzJyx3izWmDGw=";
+    })
+
+    # Fix build against libxml2 2.11
+    # https://gitlab.gnome.org/GNOME/gupnp/-/merge_requests/34
+    (fetchpatch2 {
+      name = "libxml2-2.11-fix.patch";
+      url = "https://gitlab.gnome.org/GNOME/gupnp/-/commit/bc56f02b0f89e96f2bd74af811903d9931965f58.patch";
+      hash = "sha256-KCHlq7Es+WLIWKgIgGVTaHarVQIiZPEi5r6nMAhXTgY=";
+    })
+  ];
+
+  depsBuildBuild = [
+    pkg-config
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gobject-introspection
+    vala
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_412
+    docbook_xml_dtd_45
+  ];
+
+  buildInputs = [
+    libuuid
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    gssdp
+    libsoup
+    libxml2
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}"
+  ];
+
+  # Bail out! ERROR:../tests/test-bugs.c:168:test_on_timeout: code should not be reached
+  doCheck = !stdenv.isDarwin;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      freeze = true;
+    };
+  };
+
+  meta = with lib; {
+    homepage = "http://www.gupnp.org/";
+    description = "An implementation of the UPnP specification";
+    mainProgram = "gupnp-binding-tool-1.2";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+  };
+}