2022-05-18 14:49:53 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkg-config, libiconv, gettext, xxd }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dosfstools";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "4.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dosfstools";
|
|
|
|
repo = "dosfstools";
|
|
|
|
rev = "v${version}";
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-2gxB0lQixiHOHw8uTetHekaM57fvUd9zOzSxWnvUz/c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
patches = [
|
2023-02-02 18:25:31 +00:00
|
|
|
# macOS and FreeBSD build fixes backported from master
|
2022-05-18 14:49:53 +00:00
|
|
|
# TODO: remove on the next release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/dosfstools/dosfstools/commit/77ffb87e8272760b3bb2dec8f722103b0effb801.patch";
|
|
|
|
sha256 = "sha256-xHxIs3faHK/sK3vAVoG8JcTe4zAV+ZtkozWIIFBvPWI=";
|
|
|
|
})
|
2023-02-02 18:25:31 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/dosfstools/dosfstools/commit/2d3125c4a74895eae1f66b93287031d340324524.patch";
|
|
|
|
sha256 = "nlIuRDsNjk23MKZL9cZ05odOfTXvsyQaKcv/xEr4c+U=";
|
|
|
|
})
|
2023-10-09 19:29:22 +00:00
|
|
|
# reproducible builds fix backported from master
|
|
|
|
# (respect SOURCE_DATE_EPOCH)
|
|
|
|
# TODO: remove on the next release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/dosfstools/dosfstools/commit/8da7bc93315cb0c32ad868f17808468b81fa76ec.patch";
|
|
|
|
sha256 = "sha256-Quegj5uYZgACgjSZef6cjrWQ64SToGQxbxyqCdl8C7o=";
|
|
|
|
})
|
2022-05-18 14:49:53 +00:00
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ]
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optional stdenv.isDarwin libiconv;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
# configure.ac:75: error: required file './config.rpath' not found
|
|
|
|
# https://github.com/dosfstools/dosfstools/blob/master/autogen.sh
|
|
|
|
postPatch = ''
|
|
|
|
cp ${gettext}/share/gettext/config.rpath config.rpath
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [ "--enable-compat-symlinks" ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ xxd ];
|
2022-03-30 09:31:56 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Utilities for creating and checking FAT and VFAT file systems";
|
|
|
|
homepage = "https://github.com/dosfstools/dosfstools";
|
2023-02-02 18:25:31 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.gpl3;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|