file: Add `meta.pkgConfigModules` and test

+10 -5
+10 -5
pkgs/tools/misc/file/default.nix
··· 1 - { lib, stdenv, fetchurl, file, zlib, libgnurx }: 2 3 # Note: this package is used for bootstrapping fetchurl, and thus 4 # cannot use fetchpatch! All mutable patches (generated by GitHub or 5 # cgit) that are needed here should be included directly in Nixpkgs as 6 # files. 7 8 - stdenv.mkDerivation rec { 9 pname = "file"; 10 version = "5.45"; 11 12 src = fetchurl { 13 urls = [ 14 - "https://astron.com/pub/file/${pname}-${version}.tar.gz" 15 - "https://distfiles.macports.org/file/${pname}-${version}.tar.gz" 16 ]; 17 hash = "sha256-/Jf1ECm7DiyfTjv/79r2ePDgOe6HK53lwAKm0Jx4TYI="; 18 }; ··· 37 38 makeFlags = lib.optional stdenv.hostPlatform.isWindows "FILE_COMPILE=file"; 39 40 meta = with lib; { 41 homepage = "https://darwinsys.com/file"; 42 description = "A program that shows the type of files"; 43 maintainers = with maintainers; [ doronbehar ]; 44 license = licenses.bsd2; 45 platforms = platforms.all; 46 mainProgram = "file"; 47 }; 48 - }
··· 1 + { lib, stdenv, fetchurl, file, zlib, libgnurx 2 + , testers 3 + }: 4 5 # Note: this package is used for bootstrapping fetchurl, and thus 6 # cannot use fetchpatch! All mutable patches (generated by GitHub or 7 # cgit) that are needed here should be included directly in Nixpkgs as 8 # files. 9 10 + stdenv.mkDerivation (finalAttrs: { 11 pname = "file"; 12 version = "5.45"; 13 14 src = fetchurl { 15 urls = [ 16 + "https://astron.com/pub/file/${finalAttrs.pname}-${finalAttrs.version}.tar.gz" 17 + "https://distfiles.macports.org/file/${finalAttrs.pname}-${finalAttrs.version}.tar.gz" 18 ]; 19 hash = "sha256-/Jf1ECm7DiyfTjv/79r2ePDgOe6HK53lwAKm0Jx4TYI="; 20 }; ··· 39 40 makeFlags = lib.optional stdenv.hostPlatform.isWindows "FILE_COMPILE=file"; 41 42 + passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 43 + 44 meta = with lib; { 45 homepage = "https://darwinsys.com/file"; 46 description = "A program that shows the type of files"; 47 maintainers = with maintainers; [ doronbehar ]; 48 license = licenses.bsd2; 49 + pkgConfigModules = [ "libmagic" ]; 50 platforms = platforms.all; 51 mainProgram = "file"; 52 }; 53 + })