2021-12-06 16:07:01 +00:00
|
|
|
{ lib, stdenv, fetchurl, file, zlib, libgnurx }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
# Note: this package is used for bootstrapping fetchurl, and thus
|
|
|
|
# cannot use fetchpatch! All mutable patches (generated by GitHub or
|
|
|
|
# cgit) that are needed here should be included directly in Nixpkgs as
|
|
|
|
# files.
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "file";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "5.43";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
urls = [
|
2022-07-14 12:49:19 +00:00
|
|
|
"https://astron.com/pub/file/${pname}-${version}.tar.gz"
|
2020-04-24 23:36:52 +00:00
|
|
|
"https://distfiles.macports.org/file/${pname}-${version}.tar.gz"
|
|
|
|
];
|
2022-09-30 11:47:45 +00:00
|
|
|
sha256 = "sha256-jIAV6Rrg6NAyHZTHgjmJLvnbxwxK3gAIwOlYlKv7GZE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
strictDeps = true;
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file;
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ zlib ]
|
2021-08-08 23:34:03 +00:00
|
|
|
++ lib.optional stdenv.hostPlatform.isWindows libgnurx;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
# https://bugs.astron.com/view.php?id=382
|
2022-10-30 15:09:59 +00:00
|
|
|
doCheck = !stdenv.buildPlatform.isMusl;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
makeFlags = lib.optional stdenv.hostPlatform.isWindows "FILE_COMPILE=file";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://darwinsys.com/file";
|
|
|
|
description = "A program that shows the type of files";
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ doronbehar ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|