···11{ stdenv, fetchurl, parted, utillinux }:
2233stdenv.mkDerivation rec {
44-44+55 version = "1.0.2";
66 name = "fatresize-${version}";
77···99 url = "mirror://sourceforge/fatresize/fatresize-${version}.tar.bz2";
1010 sha256 = "04wp48jpdvq4nn0dgbw5za07g842rnxlh9mig4mslz70zqs0izjm";
1111 };
1212-1212+1313 buildInputs = [ parted utillinux ];
1414-1414+1515 # This patch helps this unmantained piece of software to be built against recent parted
1616 # It basically modifies the detection scheme for parted version (the current one has no micro version defined)
1717 # The second change is to include a header for a moved function since 1.6+ to current 3.1+ parted
1818 # The third change is to modify the call to PED_ASSERT that is no longer defined with 2 params
1919 patches = [ ./fatresize_parted_nix.patch ];
2020-2020+2121 preConfigure = ''
2222 echo "Replacing calls to ped_free with free ..."
2323 substituteInPlace ./fatresize.c --replace ped_free free
2424 '';
2525-2525+2626 # Filesystem resize functions were reintroduced in parted 3.1 due to no other available free alternatives
2727 # but in a sepparate library -> libparted-fs-resize --- that's why the added LDFLAG
2828 makeFlags = ''
2929 LDFLAGS=-lparted-fs-resize
3030 '';
3131-3131+3232 propagatedBuildInputs = [ parted utillinux ];
3333-3434- meta = {
3333+3434+ meta = with stdenv.lib; {
3535 description = "The FAT16/FAT32 non-destructive resizer";
3636 homepage = https://sourceforge.net/projects/fatresize;
3737- platforms = stdenv.lib.platforms.linux;
3737+ platforms = platforms.linux;
3838+ license = licenses.gpl2;
3839 };
3940}