From d14fe018fcf9502dfa20fde84d45d8845e1441f4 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 27 Feb 2022 12:21:37 +0100 Subject: [PATCH 1/3] libsecret: clean up - re-order the expression - format with nixpkgs-fmt - make patchShebangs argument more specific - run hooks in installCheckPhase --- .../libraries/libsecret/default.nix | 78 ++++++++++++++----- 1 file changed, 60 insertions(+), 18 deletions(-) diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix index 18f00a0933c3..36db62182e4e 100644 --- a/pkgs/development/libraries/libsecret/default.nix +++ b/pkgs/development/libraries/libsecret/default.nix @@ -1,29 +1,64 @@ -{ lib, stdenv, fetchurl, fetchpatch, glib, pkg-config, gettext, libxslt, python3 -, docbook_xsl, docbook_xml_dtd_42 , libgcrypt, gobject-introspection, vala -, gtk-doc, gnome, gjs, libintl, dbus, xvfb-run }: +{ stdenv +, lib +, fetchurl +, glib +, pkg-config +, gettext +, libxslt +, python3 +, docbook-xsl-nons +, docbook_xml_dtd_42 +, libgcrypt +, gobject-introspection +, vala +, gtk-doc +, gnome +, gjs +, libintl +, dbus +, xvfb-run +}: stdenv.mkDerivation rec { pname = "libsecret"; version = "0.20.4"; + outputs = [ "out" "dev" "devdoc" ]; + src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "0a4xnfmraxchd9cq5ai66j12jv2vrgjmaaxz25kl031jvda4qnij"; }; - postPatch = '' - patchShebangs . - ''; - - outputs = [ "out" "dev" "devdoc" ]; - - propagatedBuildInputs = [ glib ]; nativeBuildInputs = [ - pkg-config gettext libxslt docbook_xsl docbook_xml_dtd_42 libintl - gobject-introspection vala gtk-doc glib + pkg-config + gettext + libxslt + docbook-xsl-nons + docbook_xml_dtd_42 + libintl + gobject-introspection + vala + gtk-doc + glib + ]; + + buildInputs = [ + libgcrypt + ]; + + propagatedBuildInputs = [ + glib + ]; + + installCheckInputs = [ + python3 + python3.pkgs.dbus-python + python3.pkgs.pygobject3 + xvfb-run + dbus + gjs ]; - buildInputs = [ libgcrypt ]; - # optional: build docs with gtk-doc? (probably needs a flag as well) configureFlags = [ "--with-libgcrypt-prefix=${libgcrypt.dev}" @@ -31,17 +66,24 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - installCheckInputs = [ - python3 python3.pkgs.dbus-python python3.pkgs.pygobject3 xvfb-run dbus gjs - ]; - # needs to run after install because typelibs point to absolute paths doInstallCheck = false; # Failed to load shared library '/force/shared/libmock_service.so.0' referenced by the typelib + + postPatch = '' + patchShebangs \ + ./tool/test-*.sh \ + build/tap-unittest + ''; + installCheckPhase = '' + runHook preInstallCheck + export NO_AT_BRIDGE=1 xvfb-run -s '-screen 0 800x600x24' dbus-run-session \ --config-file=${dbus.daemon}/share/dbus-1/session.conf \ make check + + runHook postInstallCheck ''; passthru = { From d56a0b9d728ac92383a135760f8daa5bed1c9bdb Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 27 Feb 2022 11:11:37 +0000 Subject: [PATCH 2/3] =?UTF-8?q?libsecret:=200.20.4=20=E2=86=92=200.20.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://gitlab.gnome.org/GNOME/libsecret/-/compare/0.20.4...0.20.5 --- .../libraries/libsecret/default.nix | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix index 36db62182e4e..aec0b8f120fb 100644 --- a/pkgs/development/libraries/libsecret/default.nix +++ b/pkgs/development/libraries/libsecret/default.nix @@ -2,6 +2,8 @@ , lib , fetchurl , glib +, meson +, ninja , pkg-config , gettext , libxslt @@ -11,7 +13,7 @@ , libgcrypt , gobject-introspection , vala -, gtk-doc +, gi-docgen , gnome , gjs , libintl @@ -21,25 +23,27 @@ stdenv.mkDerivation rec { pname = "libsecret"; - version = "0.20.4"; + version = "0.20.5"; outputs = [ "out" "dev" "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; - sha256 = "0a4xnfmraxchd9cq5ai66j12jv2vrgjmaaxz25kl031jvda4qnij"; + sha256 = "P7PONA/NfbVNh8iT5pv8Kx9uTUsnkGX/5m2snw/RK00="; }; nativeBuildInputs = [ + meson + ninja pkg-config gettext - libxslt + libxslt # for xsltproc for building man pages docbook-xsl-nons docbook_xml_dtd_42 libintl gobject-introspection vala - gtk-doc + gi-docgen glib ]; @@ -60,19 +64,12 @@ stdenv.mkDerivation rec { gjs ]; - configureFlags = [ - "--with-libgcrypt-prefix=${libgcrypt.dev}" - ]; - - enableParallelBuilding = true; - # needs to run after install because typelibs point to absolute paths doInstallCheck = false; # Failed to load shared library '/force/shared/libmock_service.so.0' referenced by the typelib postPatch = '' patchShebangs \ - ./tool/test-*.sh \ - build/tap-unittest + ./tool/test-*.sh ''; installCheckPhase = '' @@ -81,11 +78,16 @@ stdenv.mkDerivation rec { export NO_AT_BRIDGE=1 xvfb-run -s '-screen 0 800x600x24' dbus-run-session \ --config-file=${dbus.daemon}/share/dbus-1/session.conf \ - make check + meson test --print-errorlogs runHook postInstallCheck ''; + postFixup = '' + # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. + moveToOutput "share/doc" "$devdoc" + ''; + passthru = { updateScript = gnome.updateScript { packageName = pname; From 821703c0d20f28592ccb40d43246cdcfa644679d Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 28 Feb 2022 15:10:40 +0100 Subject: [PATCH 3/3] libsecret: fix tests --- .../libraries/libsecret/default.nix | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/libsecret/default.nix b/pkgs/development/libraries/libsecret/default.nix index aec0b8f120fb..796fe77f7b61 100644 --- a/pkgs/development/libraries/libsecret/default.nix +++ b/pkgs/development/libraries/libsecret/default.nix @@ -18,7 +18,6 @@ , gjs , libintl , dbus -, xvfb-run }: stdenv.mkDerivation rec { @@ -55,32 +54,44 @@ stdenv.mkDerivation rec { glib ]; - installCheckInputs = [ + checkInputs = [ python3 python3.pkgs.dbus-python python3.pkgs.pygobject3 - xvfb-run dbus gjs ]; - # needs to run after install because typelibs point to absolute paths - doInstallCheck = false; # Failed to load shared library '/force/shared/libmock_service.so.0' referenced by the typelib + doCheck = true; postPatch = '' patchShebangs \ ./tool/test-*.sh ''; - installCheckPhase = '' - runHook preInstallCheck + preCheck = '' + # Our gobject-introspection patches make the shared library paths absolute + # in the GIR files. When running tests, the library is not yet installed, + # though, so we need to replace the absolute path with a local one during build. + # We are using a symlink that will be overwitten during installation. + mkdir -p $out/lib $out/lib + ln -s "$PWD/libsecret/libmock-service.so" "$out/lib/libmock-service.so" + ln -s "$PWD/libsecret/libsecret-1.so.0" "$out/lib/libsecret-1.so.0" + ''; - export NO_AT_BRIDGE=1 - xvfb-run -s '-screen 0 800x600x24' dbus-run-session \ + checkPhase = '' + runHook preCheck + + dbus-run-session \ --config-file=${dbus.daemon}/share/dbus-1/session.conf \ meson test --print-errorlogs - runHook postInstallCheck + runHook postCheck + ''; + + postCheck = '' + # This is test-only so it won’t be overwritten during installation. + rm "$out/lib/libmock-service.so" ''; postFixup = ''