1 { lib, stdenv, fetchurl, file, zlib, libgnurx }:
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
8 stdenv.mkDerivation rec {
14 "https://astron.com/pub/file/${pname}-${version}.tar.gz"
15 "https://distfiles.macports.org/file/${pname}-${version}.tar.gz"
17 sha256 = "sha256-jIAV6Rrg6NAyHZTHgjmJLvnbxwxK3gAIwOlYlKv7GZE=";
21 enableParallelBuilding = true;
23 nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file;
24 buildInputs = [ zlib ]
25 ++ lib.optional stdenv.hostPlatform.isWindows libgnurx;
27 # https://bugs.astron.com/view.php?id=382
28 doCheck = !stdenv.buildPlatform.isMusl;
30 makeFlags = lib.optional stdenv.hostPlatform.isWindows "FILE_COMPILE=file";
33 homepage = "https://darwinsys.com/file";
34 description = "A program that shows the type of files";
35 maintainers = with maintainers; [ doronbehar ];
36 license = licenses.bsd2;
37 platforms = platforms.all;