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