1 { lib, stdenv, fetchurl, fetchpatch, libuuid, autoreconfHook }:
3 stdenv.mkDerivation rec {
8 url = "mirror://sourceforge/jfs/jfsutils-${version}.tar.gz";
9 sha256 = "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4";
14 ./hardening-format.patch
15 # required for cross-compilation
19 name = "add_sysmacros.patch";
20 url = "https://sources.debian.org/data/main/j/jfsutils/1.1.15-4/debian/patches/add_sysmacros.patch";
21 sha256 = "1qcwvxs4d0d24w5x98z59arqfx2n7f0d9xaqhjcg6w8n34vkhnyc";
25 name = "musl-fix-includes.patch";
26 url = "https://git.alpinelinux.org/aports/plain/main/jfsutils/musl-fix-includes.patch?id=567823dca7dc1f8ce919efbe99762d2d5c020124";
27 sha256 = "sha256-FjdUOI+y+MdSWxTR+csH41uR0P+PWWTfIMPwQjBfQtQ=";
31 nativeBuildInputs = [ autoreconfHook ];
32 buildInputs = [ libuuid ];
34 # Workaround build failure on -fno-common toolchains like upstream
35 # gcc-10. Otherwise build fails as:
36 # ld: extract.o:/build/jfsutils-1.1.15/fscklog/extract.c:67: multiple definition of
37 # `xchklog_buffer'; display.o:/build/jfsutils-1.1.15/fscklog/display.c:57: first defined here
38 env.NIX_CFLAGS_COMPILE = "-fcommon";
40 # this required for wipefreespace
43 cp include/*.h $out/include
45 cp ./libfs/libfs.a $out/lib
49 description = "IBM JFS utilities";
50 homepage = "https://jfs.sourceforge.net";
51 license = licenses.gpl3;
52 platforms = platforms.linux;