diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix index 83acfcfe9c37..580de87bdb23 100644 --- a/pkgs/applications/science/math/R/default.nix +++ b/pkgs/applications/science/math/R/default.nix @@ -8,15 +8,18 @@ # R as of writing does not support outputting both .so and .a files; it outputs: # --enable-R-static-lib conflicts with --enable-R-shlib and will be ignored , static ? false +, testers }: assert (!blas.isILP64) && (!lapack.isILP64); -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "R"; version = "4.2.2"; - src = fetchurl { + src = let + inherit (finalAttrs) pname version; + in fetchurl { url = "https://cran.r-project.org/src/base/R-${lib.versions.major version}/${pname}-${version}.tar.gz"; sha256 = "sha256-D/YrQuxRr6VxPK7nxP3noMRZQLo5vvjFyUh/7wyVPfU="; }; @@ -97,6 +100,8 @@ stdenv.mkDerivation rec { setupHook = ./setup-hook.sh; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { homepage = "http://www.r-project.org/"; description = "Free software environment for statistical computing and graphics"; @@ -121,8 +126,9 @@ stdenv.mkDerivation rec { user-defined recursive functions and input and output facilities. ''; + pkgConfigModules = [ "libR" ]; platforms = platforms.all; maintainers = with maintainers; [ jbedo ] ++ teams.sage.members; }; -} +}) diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index dceada0f7f8f..d0374c74901e 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -266,6 +266,10 @@ , MediaToolbox , VideoDecodeAcceleration , VideoToolbox +/* + * Testing + */ +, testers }: /* Maintainer notes: @@ -321,13 +325,13 @@ assert buildAvformat -> buildAvcodec && buildAvutil; # configure flag since 0.6 assert buildPostproc -> buildAvutil; assert buildSwscale -> buildAvutil; -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "ffmpeg" + (if ffmpegVariant == "small" then "" else "-${ffmpegVariant}"); inherit version; src = fetchgit { url = "https://git.ffmpeg.org/ffmpeg.git"; - rev = "n${version}"; + rev = "n${finalAttrs.version}"; inherit sha256; }; @@ -522,7 +526,7 @@ stdenv.mkDerivation rec { # outputs where we don't want them. Patch the generated config.h to remove all # such references except for data. postConfigure = let - toStrip = lib.remove "data" outputs; # We want to keep references to the data dir. + toStrip = lib.remove "data" finalAttrs.outputs; # We want to keep references to the data dir. in "remove-references-to ${lib.concatStringsSep " " (map (o: "-t ${placeholder o}") toStrip)} config.h"; @@ -656,6 +660,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { description = "A complete, cross-platform solution to record, convert and stream audio and video"; homepage = "https://www.ffmpeg.org/"; @@ -671,7 +677,8 @@ stdenv.mkDerivation rec { ++ optional withGPL gpl2Plus ++ optional withGPLv3 gpl3Plus ++ optional withUnfree unfreeRedistributable; + pkgConfigModules = [ "libavutil" ]; platforms = platforms.all; maintainers = with maintainers; [ atemu ]; }; -} +}) diff --git a/pkgs/development/libraries/hidapi/default.nix b/pkgs/development/libraries/hidapi/default.nix index b29b64c2a757..e9bfe33e9f48 100644 --- a/pkgs/development/libraries/hidapi/default.nix +++ b/pkgs/development/libraries/hidapi/default.nix @@ -7,16 +7,17 @@ , udev , Cocoa , IOKit +, testers }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "hidapi"; version = "0.12.0"; src = fetchFromGitHub { owner = "libusb"; repo = "hidapi"; - rev = "${pname}-${version}"; + rev = "${finalAttrs.pname}-${finalAttrs.version}"; sha256 = "sha256-SMhlcB7LcViC6UFVYACjunxsGkvSOKC3mbLBH4XQSzM="; }; @@ -28,12 +29,20 @@ stdenv.mkDerivation rec { propagatedBuildInputs = lib.optionals stdenv.isDarwin [ Cocoa IOKit ]; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { description = "Library for communicating with USB and Bluetooth HID devices"; homepage = "https://github.com/libusb/hidapi"; maintainers = with maintainers; [ prusnak ]; # You can choose between GPLv3, BSD or HIDAPI license (even more liberal) license = with licenses; [ bsd3 /* or */ gpl3Only ] ; + pkgConfigModules = lib.optionals stdenv.isDarwin [ + "hidapi" + ] ++ lib.optionals stdenv.isLinux [ + "hidapi-hidraw" + "hidapi-libusb" + ]; platforms = platforms.unix; }; -} +}) diff --git a/pkgs/development/libraries/icu/63.nix b/pkgs/development/libraries/icu/63.nix index 19838763f5b4..a83e2cd5f5eb 100644 --- a/pkgs/development/libraries/icu/63.nix +++ b/pkgs/development/libraries/icu/63.nix @@ -1,4 +1,6 @@ -{ stdenv, lib, fetchurl, fetchpatch, fixDarwinDylibNames, nativeBuildRoot, buildRootOnly ? false }: +{ stdenv, lib, fetchurl, fetchpatch, fixDarwinDylibNames, nativeBuildRoot, testers +, buildRootOnly ? false +}: import ./base.nix { version = "63.1"; @@ -11,4 +13,4 @@ import ./base.nix { }) ]; patchFlags = [ "-p3" ]; -} { inherit stdenv lib fetchurl fixDarwinDylibNames nativeBuildRoot buildRootOnly; } +} { inherit stdenv lib fetchurl fixDarwinDylibNames nativeBuildRoot testers buildRootOnly; } diff --git a/pkgs/development/libraries/icu/base.nix b/pkgs/development/libraries/icu/base.nix index a714e758bd88..c5e46fa4530d 100644 --- a/pkgs/development/libraries/icu/base.nix +++ b/pkgs/development/libraries/icu/base.nix @@ -2,6 +2,7 @@ { stdenv, lib, fetchurl, fixDarwinDylibNames # Cross-compiled icu4c requires a build-root of a native compile , buildRootOnly ? false, nativeBuildRoot +, testers }: let @@ -45,6 +46,11 @@ let description = "Unicode and globalization support library"; homepage = "https://icu.unicode.org/"; maintainers = with maintainers; [ raskin ]; + pkgConfigModules = [ + "icu-i18n" + "icu-io" + "icu-uc" + ]; platforms = platforms.all; }; }; @@ -97,4 +103,6 @@ let then buildRootOnlyAttrs else realAttrs; in -stdenv.mkDerivation attrs +stdenv.mkDerivation (finalAttrs: attrs // { + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; +}) diff --git a/pkgs/development/libraries/imlib2/default.nix b/pkgs/development/libraries/imlib2/default.nix index 66092f436509..02707c750c06 100644 --- a/pkgs/development/libraries/imlib2/default.nix +++ b/pkgs/development/libraries/imlib2/default.nix @@ -21,17 +21,18 @@ , fluxbox , enlightenment , xorg +, testers }: let inherit (lib) optional optionals; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "imlib2"; version = "1.9.1"; src = fetchurl { - url = "mirror://sourceforge/enlightenment/${pname}-${version}.tar.xz"; + url = "mirror://sourceforge/enlightenment/${finalAttrs.pname}-${finalAttrs.version}.tar.xz"; hash = "sha256-SiJAOL//vl1NJQxE4F9O5a4k3P74OVsWd8cVxY92TUM="; }; @@ -69,6 +70,8 @@ stdenv.mkDerivation rec { enlightenment; }; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { description = "Image manipulation library"; @@ -83,7 +86,8 @@ stdenv.mkDerivation rec { homepage = "https://docs.enlightenment.org/api/imlib2/html"; changelog = "https://git.enlightenment.org/legacy/imlib2.git/plain/ChangeLog?h=v${version}"; license = licenses.imlib2; + pkgConfigModules = [ "imlib2" ]; platforms = platforms.unix; maintainers = with maintainers; [ spwhitt ]; }; -} +}) diff --git a/pkgs/development/libraries/libb2/default.nix b/pkgs/development/libraries/libb2/default.nix index a461f5039aa7..9e507188aad3 100644 --- a/pkgs/development/libraries/libb2/default.nix +++ b/pkgs/development/libraries/libb2/default.nix @@ -4,16 +4,17 @@ , autoreconfHook , libtool , pkg-config +, testers }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "libb2"; version = "0.98.1"; src = fetchFromGitHub { owner = "BLAKE2"; repo = "libb2"; - rev = "refs/tags/v${version}"; + rev = "refs/tags/v${finalAttrs.version}"; sha256 = "0qj8aaqvfcavj1vj5asm4pqm03ap7q8x4c2fy83cqggvky0frgya"; }; @@ -29,11 +30,14 @@ stdenv.mkDerivation rec { doCheck = true; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { description = "The BLAKE2 family of cryptographic hash functions"; homepage = "https://blake2.net/"; + pkgConfigModules = [ "libb2" ]; platforms = platforms.all; maintainers = with maintainers; [ dfoxfranke dotlambda ]; license = licenses.cc0; }; -} +}) diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 488613fd489a..75ffe5ae06a6 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -10,6 +10,7 @@ # path to openssl.cnf file. will be placed in $etc/etc/ssl/openssl.cnf to replace the default , conf ? null , removeReferencesTo +, testers }: # Note: this package is used for bootstrapping fetchurl, and thus @@ -19,12 +20,12 @@ let common = { version, sha256, patches ? [], withDocs ? false, extraMeta ? {} }: - stdenv.mkDerivation rec { + stdenv.mkDerivation (finalAttrs: { pname = "openssl"; inherit version; src = fetchurl { - url = "https://www.openssl.org/source/${pname}-${version}.tar.gz"; + url = "https://www.openssl.org/source/${finalAttrs.pname}-${version}.tar.gz"; inherit sha256; }; @@ -204,13 +205,20 @@ let fi ''; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { homepage = "https://www.openssl.org/"; description = "A cryptographic library that implements the SSL and TLS protocols"; license = licenses.openssl; + pkgConfigModules = [ + "libcrypto" + "libssl" + "openssl" + ]; platforms = platforms.all; } // extraMeta; - }; + }); in { diff --git a/pkgs/development/libraries/science/math/liblapack/default.nix b/pkgs/development/libraries/science/math/liblapack/default.nix index b9563346ada4..3bf16057f835 100644 --- a/pkgs/development/libraries/science/math/liblapack/default.nix +++ b/pkgs/development/libraries/science/math/liblapack/default.nix @@ -6,16 +6,17 @@ , shared ? true # Compile with ILP64 interface , blas64 ? false +, testers }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "liblapack"; version = "3.11"; src = fetchFromGitHub { owner = "Reference-LAPACK"; repo = "lapack"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; sha256 = "sha256-AYD78u70y8cY19hmM/aDjQEzxO8u9lPWhCFxRe5cqXI="; }; @@ -40,7 +41,7 @@ stdenv.mkDerivation rec { postInstall = let canonicalExtension = if stdenv.hostPlatform.isLinux - then "${stdenv.hostPlatform.extensions.sharedLibrary}.${lib.versions.major version}" + then "${stdenv.hostPlatform.extensions.sharedLibrary}.${lib.versions.major finalAttrs.version}" else stdenv.hostPlatform.extensions.sharedLibrary; in lib.optionalString blas64 '' ln -s $out/lib/liblapack64${canonicalExtension} $out/lib/liblapack${canonicalExtension} @@ -65,15 +66,18 @@ stdenv.mkDerivation rec { checkPhase = '' runHook preCheck - ctest ${ctestArgs} + ctest ${finalAttrs.ctestArgs} runHook postCheck ''; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { description = "Linear Algebra PACKage"; homepage = "http://www.netlib.org/lapack/"; maintainers = with maintainers; [ markuskowa ]; license = licenses.bsd3; + pkgConfigModules = [ "lapack" ]; platforms = platforms.all; }; -} +}) diff --git a/pkgs/development/libraries/webkitgtk/default.nix b/pkgs/development/libraries/webkitgtk/default.nix index 99ee89edcac3..fdefeb86a046 100644 --- a/pkgs/development/libraries/webkitgtk/default.nix +++ b/pkgs/development/libraries/webkitgtk/default.nix @@ -64,6 +64,7 @@ , enableGeoLocation ? true , withLibsecret ? true , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd +, testers }: stdenv.mkDerivation (finalAttrs: { @@ -232,10 +233,17 @@ stdenv.mkDerivation (finalAttrs: { requiredSystemFeatures = [ "big-parallel" ]; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { description = "Web content rendering engine, GTK port"; homepage = "https://webkitgtk.org/"; license = licenses.bsd2; + pkgConfigModules = [ + "javascriptcoregtk-4.0" + "webkit2gtk-4.0" + "webkit2gtk-web-extension-4.0" + ]; platforms = platforms.linux ++ platforms.darwin; maintainers = teams.gnome.members; broken = stdenv.isDarwin; diff --git a/pkgs/misc/jackaudio/default.nix b/pkgs/misc/jackaudio/default.nix index 441f3ccb37f4..fce51aabd263 100644 --- a/pkgs/misc/jackaudio/default.nix +++ b/pkgs/misc/jackaudio/default.nix @@ -10,6 +10,8 @@ # Extra options , prefix ? "" + +, testers }: with lib; @@ -25,7 +27,7 @@ let optAlsaLib = if libOnly then null else shouldUsePkg alsa-lib; optLibopus = shouldUsePkg libopus; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "${prefix}jack2"; version = "1.9.19"; @@ -63,11 +65,14 @@ stdenv.mkDerivation rec { wrapProgram $out/bin/jack_control --set PYTHONPATH $PYTHONPATH ''); + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = { description = "JACK audio connection kit, version 2 with jackdbus"; homepage = "https://jackaudio.org"; license = licenses.gpl2Plus; + pkgConfigModules = [ "jack" ]; platforms = platforms.unix; maintainers = with maintainers; [ goibhniu ]; }; -} +}) diff --git a/pkgs/misc/jackaudio/jack1.nix b/pkgs/misc/jackaudio/jack1.nix index ba77e9c3c91a..4e7375a26916 100644 --- a/pkgs/misc/jackaudio/jack1.nix +++ b/pkgs/misc/jackaudio/jack1.nix @@ -2,6 +2,8 @@ # Optional Dependencies , alsa-lib ? null, db ? null, libuuid ? null, libffado ? null, celt ? null + +, testers }: let @@ -13,12 +15,12 @@ let optLibffado = shouldUsePkg libffado; optCelt = shouldUsePkg celt; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "jack1"; version = "0.125.0"; src = fetchurl { - url = "https://jackaudio.org/downloads/jack-audio-connection-kit-${version}.tar.gz"; + url = "https://jackaudio.org/downloads/jack-audio-connection-kit-${finalAttrs.version}.tar.gz"; sha256 = "0i6l25dmfk2ji2lrakqq9icnwjxklgcjzzk65dmsff91z2zva5rm"; }; @@ -30,11 +32,14 @@ stdenv.mkDerivation rec { buildInputs = [ optAlsaLib optDb optLibffado optCelt ]; propagatedBuildInputs = [ optLibuuid ]; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { broken = stdenv.isDarwin; description = "JACK audio connection kit"; homepage = "https://jackaudio.org"; license = with licenses; [ gpl2 lgpl21 ]; + pkgConfigModules = [ "jack" ]; platforms = platforms.unix; }; -} +}) diff --git a/pkgs/tools/compression/brotli/default.nix b/pkgs/tools/compression/brotli/default.nix index dfac5af0980b..3d15cbd395c4 100644 --- a/pkgs/tools/compression/brotli/default.nix +++ b/pkgs/tools/compression/brotli/default.nix @@ -4,18 +4,19 @@ , cmake , fetchpatch , staticOnly ? stdenv.hostPlatform.isStatic +, testers }: # ?TODO: there's also python lib in there -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "brotli"; version = "1.0.9"; src = fetchFromGitHub { owner = "google"; repo = "brotli"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; sha256 = "z6Dhrabav1MDQ4rAcXaDv0aN+qOoh9cvoXZqEWBB13c="; }; @@ -55,6 +56,8 @@ stdenv.mkDerivation rec { cp ../docs/*.3 $out/share/man/man3/ ''; + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + meta = with lib; { homepage = "https://github.com/google/brotli"; description = "A generic-purpose lossless compression algorithm and tool"; @@ -72,6 +75,10 @@ stdenv.mkDerivation rec { ''; license = licenses.mit; maintainers = with maintainers; [ freezeboy ]; + pkgConfigModules = [ + "libbrotlidec" + "libbrotlienc" + ]; platforms = platforms.all; }; -} +})