lol

Merge pull request #99306 from puckipedia/patch-fatresize

fatresize: 1.0.2 -> 1.1.0

authored by

Benjamin Hipple and committed by
GitHub
42303209 a2aa0cbf

+10 -96
+10 -22
pkgs/tools/filesystems/fatresize/default.nix
··· 1 - { stdenv, fetchurl, parted, utillinux }: 1 + { stdenv, fetchFromGitHub, parted, utillinux, pkg-config }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 5 - version = "1.0.2"; 5 + version = "1.1.0"; 6 6 pname = "fatresize"; 7 7 8 - src = fetchurl { 9 - url = "mirror://sourceforge/fatresize/fatresize-${version}.tar.bz2"; 10 - sha256 = "04wp48jpdvq4nn0dgbw5za07g842rnxlh9mig4mslz70zqs0izjm"; 8 + src = fetchFromGitHub { 9 + owner = "ya-mouse"; 10 + repo = "fatresize"; 11 + rev = "v${version}"; 12 + sha256 = "1vhz84kxfyl0q7mkqn68nvzzly0a4xgzv76m6db0bk7xyczv1qr2"; 11 13 }; 12 14 13 15 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" ]; 16 + nativeBuildInputs = [ pkg-config ]; 29 17 30 18 propagatedBuildInputs = [ parted utillinux ]; 31 19 32 20 meta = with stdenv.lib; { 33 21 description = "The FAT16/FAT32 non-destructive resizer"; 34 - homepage = "https://sourceforge.net/projects/fatresize"; 22 + homepage = "https://github.com/ya-mouse/fatresize"; 35 23 platforms = platforms.linux; 36 - license = licenses.gpl2; 24 + license = licenses.gpl3; 37 25 }; 38 26 }
-74
pkgs/tools/filesystems/fatresize/fatresize_parted_nix.patch
··· 1 - diff --git a/aclocal.m4 b/aclocal.m4 2 - index 18e8176..2e75592 100644 3 - --- a/aclocal.m4 4 - +++ b/aclocal.m4 5 - @@ -88,8 +88,15 @@ int main () 6 - if ( !(version = ped_get_version ()) ) 7 - exit(1); 8 - if (sscanf(version, "%d.%d.%d", &major, &minor, &micro) != 3) { 9 - - printf("%s, bad version string\n", version); 10 - - exit(1); 11 - + if (sscanf(version, "%d.%d", &major, &minor) != 2) 12 - + { 13 - + printf("%s, bad version string\n", version); 14 - + exit(1); 15 - + } 16 - + else 17 - + { 18 - + micro = 0; 19 - + } 20 - } 21 - 22 - if ((major > $parted_config_major_version) || 23 - diff --git a/configure b/configure 24 - index ed31457..e5f1705 100755 25 - --- a/configure 26 - +++ b/configure 27 - @@ -4793,8 +4793,15 @@ int main () 28 - if ( !(version = ped_get_version ()) ) 29 - exit(1); 30 - if (sscanf(version, "%d.%d.%d", &major, &minor, &micro) != 3) { 31 - - printf("%s, bad version string\n", version); 32 - - exit(1); 33 - + if (sscanf(version, "%d.%d", &major, &minor) != 2) 34 - + { 35 - + printf("%s, bad version string\n", version); 36 - + exit(1); 37 - + } 38 - + else 39 - + { 40 - + micro = 0; 41 - + } 42 - } 43 - 44 - if ((major > $parted_config_major_version) || 45 - diff --git a/fatresize.c b/fatresize.c 46 - index 424d5d2..e439102 100644 47 - --- a/fatresize.c 48 - +++ b/fatresize.c 49 - @@ -30,6 +30,7 @@ 50 - #include <inttypes.h> 51 - #include <parted/parted.h> 52 - #include <parted/debug.h> 53 - +#include <parted/filesys.h> 54 - #include <parted/unit.h> 55 - 56 - #include "config.h" 57 - @@ -217,7 +218,7 @@ fatresize_handler(PedException *ex) 58 - static int 59 - snap(PedSector* sector, PedSector new_sector, PedGeometry* range) 60 - { 61 - - PED_ASSERT(ped_geometry_test_sector_inside (range, *sector), return 0); 62 - + PED_ASSERT(ped_geometry_test_sector_inside (range, *sector)); 63 - if (!ped_geometry_test_sector_inside(range, new_sector)) 64 - return 0; 65 - 66 - @@ -281,7 +282,7 @@ snap_to_boundaries (PedGeometry* new_geom, PedGeometry* old_geom, 67 - end_part->geom.end, end_part->geom.start - 1, -1); 68 - } 69 - 70 - - PED_ASSERT (start <= end, return); 71 - + PED_ASSERT (start <= end); 72 - ped_geometry_set (new_geom, start, end - start + 1); 73 - } 74 -