From 4e96a9d9f7357958479d17922ec95729bf58fd5f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 7 Nov 2019 13:46:37 +0100 Subject: [PATCH 1/5] gcab: clean up * format with nixpkgs-fmt * remove UTF-8 locale hack, since now we have C.UTF-8 * add description, fix homepage, correct license * split to multiple outputs --- pkgs/development/libraries/gcab/default.nix | 38 ++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/gcab/default.nix b/pkgs/development/libraries/gcab/default.nix index ee5988b30f57..bc8cb72f21ce 100644 --- a/pkgs/development/libraries/gcab/default.nix +++ b/pkgs/development/libraries/gcab/default.nix @@ -1,21 +1,42 @@ -{ stdenv, fetchurl, gettext, gobject-introspection, pkgconfig -, meson, ninja, glibcLocales, git, vala, glib, zlib, gnome3 +{ stdenv +, fetchurl +, gettext +, gobject-introspection +, pkgconfig +, meson +, ninja +, git +, vala +, glib +, zlib +, gnome3 }: stdenv.mkDerivation rec { pname = "gcab"; version = "1.2"; - LC_ALL = "en_US.UTF-8"; + outputs = [ "bin" "out" "dev" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "038h5kk41si2hc9d9169rrlvp8xgsxq27kri7hv2vr39gvz9cbas"; }; - nativeBuildInputs = [ meson ninja glibcLocales git pkgconfig vala gettext gobject-introspection ]; + nativeBuildInputs = [ + meson + ninja + git + pkgconfig + vala + gettext + gobject-introspection + ]; - buildInputs = [ glib zlib ]; + buildInputs = [ + glib + zlib + ]; mesonFlags = [ "-Ddocs=false" @@ -30,9 +51,10 @@ stdenv.mkDerivation rec { }; meta = with stdenv.lib; { + description = "GObject library to create cabinet files"; + homepage = "https://gitlab.gnome.org/GNOME/gcab"; + license = licenses.lgpl21Plus; + maintainers = gnome3.maintainers; platforms = platforms.linux; - license = licenses.lgpl21; - homepage = "https://wiki.gnome.org/msitools"; - maintainers = [ maintainers.lethalman ]; }; } From 40d77f8f0170f7b89de50fa1e317b21b36c79dff Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 7 Nov 2019 13:51:04 +0100 Subject: [PATCH 2/5] gcab: add devdoc --- pkgs/development/libraries/gcab/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gcab/default.nix b/pkgs/development/libraries/gcab/default.nix index bc8cb72f21ce..3242a04b2041 100644 --- a/pkgs/development/libraries/gcab/default.nix +++ b/pkgs/development/libraries/gcab/default.nix @@ -2,6 +2,9 @@ , fetchurl , gettext , gobject-introspection +, gtk-doc +, docbook_xsl +, docbook_xml_dtd_43 , pkgconfig , meson , ninja @@ -16,7 +19,7 @@ stdenv.mkDerivation rec { pname = "gcab"; version = "1.2"; - outputs = [ "bin" "out" "dev" ]; + outputs = [ "bin" "out" "dev" "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -31,6 +34,9 @@ stdenv.mkDerivation rec { vala gettext gobject-introspection + gtk-doc + docbook_xsl + docbook_xml_dtd_43 ]; buildInputs = [ @@ -39,7 +45,6 @@ stdenv.mkDerivation rec { ]; mesonFlags = [ - "-Ddocs=false" "-Dtests=false" ]; From c88e084ecb73c72d966423084ab13adf98376b83 Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Fri, 1 Nov 2019 21:16:03 -0700 Subject: [PATCH 3/5] gcab: 1.2 -> 1.3 --- pkgs/development/libraries/gcab/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/gcab/default.nix b/pkgs/development/libraries/gcab/default.nix index 3242a04b2041..b4e941eab397 100644 --- a/pkgs/development/libraries/gcab/default.nix +++ b/pkgs/development/libraries/gcab/default.nix @@ -17,13 +17,13 @@ stdenv.mkDerivation rec { pname = "gcab"; - version = "1.2"; + version = "1.3"; outputs = [ "bin" "out" "dev" "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "038h5kk41si2hc9d9169rrlvp8xgsxq27kri7hv2vr39gvz9cbas"; + sha256 = "1rv81b37d5ya7xpfdxrfk173jjcwabxyng7vafgwyl5myv44qc0h"; }; nativeBuildInputs = [ From e253d015a187aa51f85f9f1dfb926b7889c5731b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 7 Nov 2019 13:59:11 +0100 Subject: [PATCH 4/5] gcab: run & install tests also add nixosTests.installed-tests.gcab for running the installed tests --- nixos/tests/installed-tests/default.nix | 1 + nixos/tests/installed-tests/gcab.nix | 5 +++++ pkgs/development/libraries/gcab/default.nix | 17 +++++++++++++-- .../libraries/gcab/installed-tests-path.patch | 21 +++++++++++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 nixos/tests/installed-tests/gcab.nix create mode 100644 pkgs/development/libraries/gcab/installed-tests-path.patch diff --git a/nixos/tests/installed-tests/default.nix b/nixos/tests/installed-tests/default.nix index 7867a61e3dd1..fdf6bb91c139 100644 --- a/nixos/tests/installed-tests/default.nix +++ b/nixos/tests/installed-tests/default.nix @@ -67,6 +67,7 @@ in flatpak = callInstalledTest ./flatpak.nix {}; flatpak-builder = callInstalledTest ./flatpak-builder.nix {}; fwupd = callInstalledTest ./fwupd.nix {}; + gcab = callInstalledTest ./gcab.nix {}; gdk-pixbuf = callInstalledTest ./gdk-pixbuf.nix {}; gjs = callInstalledTest ./gjs.nix {}; glib-networking = callInstalledTest ./glib-networking.nix {}; diff --git a/nixos/tests/installed-tests/gcab.nix b/nixos/tests/installed-tests/gcab.nix new file mode 100644 index 000000000000..b24cc2e01267 --- /dev/null +++ b/nixos/tests/installed-tests/gcab.nix @@ -0,0 +1,5 @@ +{ pkgs, makeInstalledTest, ... }: + +makeInstalledTest { + tested = pkgs.gcab; +} diff --git a/pkgs/development/libraries/gcab/default.nix b/pkgs/development/libraries/gcab/default.nix index b4e941eab397..2598b85269fd 100644 --- a/pkgs/development/libraries/gcab/default.nix +++ b/pkgs/development/libraries/gcab/default.nix @@ -13,19 +13,25 @@ , glib , zlib , gnome3 +, nixosTests }: stdenv.mkDerivation rec { pname = "gcab"; version = "1.3"; - outputs = [ "bin" "out" "dev" "devdoc" ]; + outputs = [ "bin" "out" "dev" "devdoc" "installedTests" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "1rv81b37d5ya7xpfdxrfk173jjcwabxyng7vafgwyl5myv44qc0h"; }; + patches = [ + # allow installing installed tests to a separate output + ./installed-tests-path.patch + ]; + nativeBuildInputs = [ meson ninja @@ -45,14 +51,21 @@ stdenv.mkDerivation rec { ]; mesonFlags = [ - "-Dtests=false" + "-Dinstalled_tests=true" + "-Dinstalled_test_prefix=${placeholder ''installedTests''}" ]; + doCheck = true; + passthru = { updateScript = gnome3.updateScript { packageName = pname; versionPolicy = "none"; }; + + tests = { + installedTests = nixosTests.installed-tests.gcab; + }; }; meta = with stdenv.lib; { diff --git a/pkgs/development/libraries/gcab/installed-tests-path.patch b/pkgs/development/libraries/gcab/installed-tests-path.patch new file mode 100644 index 000000000000..ab3b6b3fae3f --- /dev/null +++ b/pkgs/development/libraries/gcab/installed-tests-path.patch @@ -0,0 +1,21 @@ +diff --git a/meson_options.txt b/meson_options.txt +index c1b1da1..9b76022 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -4,3 +4,4 @@ + option('vapi', type : 'boolean', value : true, description: 'generate Vala bindings (requires introspection)') + option('tests', type : 'boolean', value : true, description : 'enable tests') + option('installed_tests', type : 'boolean', value : false, description : 'install tests for "as-installed" testing') ++option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests') +diff --git a/tests/meson.build b/tests/meson.build +index 1e46e2a..aa780d0 100644 +--- a/tests/meson.build ++++ b/tests/meson.build +@@ -1,5 +1,5 @@ +-installed_tests_metadir = join_paths(get_option('datadir'), 'installed-tests', 'libgcab-1.0') +-installed_tests_execdir = join_paths(get_option('libexecdir'), 'installed-tests', 'libgcab-1.0') ++installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', 'libgcab-1.0') ++installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', 'libgcab-1.0') + installed_tests_enabled = get_option('installed_tests') + installed_tests_template_tap = files('template-tap.test.in') + abs_installed_tests_execdir = join_paths(get_option('prefix'), installed_tests_execdir) From fae720c861d7a26f27b6eb4f981a16d3160bad79 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 7 Nov 2019 14:49:05 +0100 Subject: [PATCH 5/5] gcab: propagate dependencies --- pkgs/development/libraries/gcab/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/libraries/gcab/default.nix b/pkgs/development/libraries/gcab/default.nix index 2598b85269fd..c05bb95913e6 100644 --- a/pkgs/development/libraries/gcab/default.nix +++ b/pkgs/development/libraries/gcab/default.nix @@ -50,6 +50,11 @@ stdenv.mkDerivation rec { zlib ]; + # required by libgcab-1.0.pc + propagatedBuildInputs = [ + glib + ]; + mesonFlags = [ "-Dinstalled_tests=true" "-Dinstalled_test_prefix=${placeholder ''installedTests''}"