1 { lib, stdenv, fetchurl, file, zlib, libgnurx
2 , updateAutotoolsGnuConfigScriptsHook
6 # Note: this package is used for bootstrapping fetchurl, and thus
7 # cannot use fetchpatch! All mutable patches (generated by GitHub or
8 # cgit) that are needed here should be included directly in Nixpkgs as
11 stdenv.mkDerivation (finalAttrs: {
17 "https://astron.com/pub/file/file-${finalAttrs.version}.tar.gz"
18 "https://distfiles.macports.org/file/file-${finalAttrs.version}.tar.gz"
20 hash = "sha256-/Jf1ECm7DiyfTjv/79r2ePDgOe6HK53lwAKm0Jx4TYI=";
23 outputs = [ "out" "dev" "man" ];
26 # Upstream patch to fix 32-bit tests.
27 # Will be included in 5.46+ releases.
32 enableParallelBuilding = true;
34 nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ]
35 ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file;
36 buildInputs = [ zlib ]
37 ++ lib.optional stdenv.hostPlatform.isWindows libgnurx;
39 # https://bugs.astron.com/view.php?id=382
40 doCheck = !stdenv.buildPlatform.isMusl;
42 makeFlags = lib.optional stdenv.hostPlatform.isWindows "FILE_COMPILE=file";
44 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
47 homepage = "https://darwinsys.com/file";
48 description = "Program that shows the type of files";
49 maintainers = with maintainers; [ doronbehar ];
50 license = licenses.bsd2;
51 pkgConfigModules = [ "libmagic" ];
52 platforms = platforms.all;