2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, libuuid, autoreconfHook }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-08-18 13:19:15 +00:00
|
|
|
pname = "jfsutils";
|
|
|
|
version = "1.1.15";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-07-14 12:49:19 +00:00
|
|
|
url = "mirror://sourceforge/jfs/jfsutils-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./types.patch
|
|
|
|
./hardening-format.patch
|
|
|
|
# required for cross-compilation
|
|
|
|
./ar-fix.patch
|
|
|
|
# fix for glibc>=2.28
|
|
|
|
(fetchpatch {
|
|
|
|
name = "add_sysmacros.patch";
|
|
|
|
url = "https://sources.debian.org/data/main/j/jfsutils/1.1.15-4/debian/patches/add_sysmacros.patch";
|
|
|
|
sha256 = "1qcwvxs4d0d24w5x98z59arqfx2n7f0d9xaqhjcg6w8n34vkhnyc";
|
|
|
|
})
|
2022-12-02 08:20:57 +00:00
|
|
|
# fix for musl
|
|
|
|
(fetchpatch {
|
|
|
|
name = "musl-fix-includes.patch";
|
|
|
|
url = "https://git.alpinelinux.org/aports/plain/main/jfsutils/musl-fix-includes.patch?id=567823dca7dc1f8ce919efbe99762d2d5c020124";
|
|
|
|
sha256 = "sha256-FjdUOI+y+MdSWxTR+csH41uR0P+PWWTfIMPwQjBfQtQ=";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
buildInputs = [ libuuid ];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains like upstream
|
|
|
|
# gcc-10. Otherwise build fails as:
|
|
|
|
# ld: extract.o:/build/jfsutils-1.1.15/fscklog/extract.c:67: multiple definition of
|
|
|
|
# `xchklog_buffer'; display.o:/build/jfsutils-1.1.15/fscklog/display.c:57: first defined here
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
# this required for wipefreespace
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/include
|
|
|
|
cp include/*.h $out/include
|
|
|
|
mkdir -p $out/lib
|
|
|
|
cp ./libfs/libfs.a $out/lib
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "IBM JFS utilities";
|
2023-02-22 10:55:15 +00:00
|
|
|
homepage = "https://jfs.sourceforge.net";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|