···1-{ stdenv, fetchurl, parted, utillinux }:
23stdenv.mkDerivation rec {
45- version = "1.0.2";
6 pname = "fatresize";
78- src = fetchurl {
9- url = "mirror://sourceforge/fatresize/fatresize-${version}.tar.bz2";
10- sha256 = "04wp48jpdvq4nn0dgbw5za07g842rnxlh9mig4mslz70zqs0izjm";
0011 };
1213 buildInputs = [ parted utillinux ];
14-15- # This patch helps this unmantained piece of software to be built against recent parted
16- # It basically modifies the detection scheme for parted version (the current one has no micro version defined)
17- # The second change is to include a header for a moved function since 1.6+ to current 3.1+ parted
18- # The third change is to modify the call to PED_ASSERT that is no longer defined with 2 params
19- patches = [ ./fatresize_parted_nix.patch ];
20-21- preConfigure = ''
22- echo "Replacing calls to ped_free with free ..."
23- substituteInPlace ./fatresize.c --replace ped_free free
24- '';
25-26- # Filesystem resize functions were reintroduced in parted 3.1 due to no other available free alternatives
27- # but in a sepparate library -> libparted-fs-resize --- that's why the added LDFLAG
28- makeFlags = [ "LDFLAGS=-lparted-fs-resize" ];
2930 propagatedBuildInputs = [ parted utillinux ];
3132 meta = with stdenv.lib; {
33 description = "The FAT16/FAT32 non-destructive resizer";
34- homepage = "https://sourceforge.net/projects/fatresize";
35 platforms = platforms.linux;
36- license = licenses.gpl2;
37 };
38}