summary refs log tree commit diff
path: root/pkgs/tools/filesystems/fatresize
diff options
context:
space:
mode:
authorPuck Meerburg <puck@puck.moe>2020-09-30 12:59:06 +0000
committerPuck Meerburg <puck@puck.moe>2020-10-02 13:16:41 +0000
commit3733a496bd6b6805c55198c60fb3ddbd8e59b2e4 (patch)
tree38ff7da896a5dabf36b4f7b296bad3b020254ae6 /pkgs/tools/filesystems/fatresize
parent9a43f55bb02dc76b2f977dca0c75997111d0b1f0 (diff)
downloadnixpkgs-3733a496bd6b6805c55198c60fb3ddbd8e59b2e4.tar
nixpkgs-3733a496bd6b6805c55198c60fb3ddbd8e59b2e4.tar.gz
nixpkgs-3733a496bd6b6805c55198c60fb3ddbd8e59b2e4.tar.bz2
nixpkgs-3733a496bd6b6805c55198c60fb3ddbd8e59b2e4.tar.lz
nixpkgs-3733a496bd6b6805c55198c60fb3ddbd8e59b2e4.tar.xz
nixpkgs-3733a496bd6b6805c55198c60fb3ddbd8e59b2e4.tar.zst
nixpkgs-3733a496bd6b6805c55198c60fb3ddbd8e59b2e4.zip
fatresize: 1.0.2 -> 1.1.0
Diffstat (limited to 'pkgs/tools/filesystems/fatresize')
-rw-r--r--pkgs/tools/filesystems/fatresize/default.nix32
-rw-r--r--pkgs/tools/filesystems/fatresize/fatresize_parted_nix.patch74
2 files changed, 10 insertions, 96 deletions
diff --git a/pkgs/tools/filesystems/fatresize/default.nix b/pkgs/tools/filesystems/fatresize/default.nix
index c1d048889c7..79551df00ee 100644
--- a/pkgs/tools/filesystems/fatresize/default.nix
+++ b/pkgs/tools/filesystems/fatresize/default.nix
@@ -1,38 +1,26 @@
-{ stdenv, fetchurl, parted, utillinux }:
+{ stdenv, fetchFromGitHub, parted, utillinux, pkg-config }:
 
 stdenv.mkDerivation rec {
 
-  version = "1.0.2";
+  version = "1.1.0";
   pname = "fatresize";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/fatresize/fatresize-${version}.tar.bz2";
-    sha256 = "04wp48jpdvq4nn0dgbw5za07g842rnxlh9mig4mslz70zqs0izjm";
+  src = fetchFromGitHub {
+    owner = "ya-mouse";
+    repo = "fatresize";
+    rev = "v${version}";
+    sha256 = "1vhz84kxfyl0q7mkqn68nvzzly0a4xgzv76m6db0bk7xyczv1qr2";
   };
 
   buildInputs = [ parted utillinux ];
-
-  # This patch helps this unmantained piece of software to be built against recent parted
-  # It basically modifies the detection scheme for parted version (the current one has no micro version defined)
-  # The second change is to include a header for a moved function since 1.6+ to current 3.1+ parted
-  # The third change is to modify the call to PED_ASSERT that is no longer defined with 2 params
-  patches = [ ./fatresize_parted_nix.patch ];
-
-  preConfigure = ''
-    echo "Replacing calls to ped_free with free ..."
-    substituteInPlace ./fatresize.c --replace ped_free free
-  '';
-
-  # Filesystem resize functions were reintroduced in parted 3.1 due to no other available free alternatives
-  # but in a sepparate library -> libparted-fs-resize --- that's why the added LDFLAG
-  makeFlags = [ "LDFLAGS=-lparted-fs-resize" ];
+  nativeBuildInputs = [ pkg-config ];
 
   propagatedBuildInputs = [ parted utillinux ];
 
   meta = with stdenv.lib; {
     description = "The FAT16/FAT32 non-destructive resizer";
-    homepage = "https://sourceforge.net/projects/fatresize";
+    homepage = "https://github.com/ya-mouse/fatresize";
     platforms = platforms.linux;
-    license = licenses.gpl2;
+    license = licenses.gpl3;
   };
 }
diff --git a/pkgs/tools/filesystems/fatresize/fatresize_parted_nix.patch b/pkgs/tools/filesystems/fatresize/fatresize_parted_nix.patch
deleted file mode 100644
index e9aa87a2d56..00000000000
--- a/pkgs/tools/filesystems/fatresize/fatresize_parted_nix.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-diff --git a/aclocal.m4 b/aclocal.m4
-index 18e8176..2e75592 100644
---- a/aclocal.m4
-+++ b/aclocal.m4
-@@ -88,8 +88,15 @@ int main ()
- 	if ( !(version = ped_get_version ()) )
- 		exit(1);
- 	if (sscanf(version, "%d.%d.%d", &major, &minor, &micro) != 3) {
--		printf("%s, bad version string\n", version);
--		exit(1);
-+		if (sscanf(version, "%d.%d", &major, &minor) != 2)
-+		{
-+		  printf("%s, bad version string\n", version);
-+		  exit(1);
-+		}
-+		else
-+		{
-+		  micro = 0;
-+		}
- 	}
- 	
- 	if ((major > $parted_config_major_version) ||
-diff --git a/configure b/configure
-index ed31457..e5f1705 100755
---- a/configure
-+++ b/configure
-@@ -4793,8 +4793,15 @@ int main ()
- 	if ( !(version = ped_get_version ()) )
- 		exit(1);
- 	if (sscanf(version, "%d.%d.%d", &major, &minor, &micro) != 3) {
--		printf("%s, bad version string\n", version);
--		exit(1);
-+		if (sscanf(version, "%d.%d", &major, &minor) != 2)
-+		{
-+		  printf("%s, bad version string\n", version);
-+		  exit(1);
-+		}
-+		else
-+		{
-+		  micro = 0;
-+		}
- 	}
- 
- 	if ((major > $parted_config_major_version) ||
-diff --git a/fatresize.c b/fatresize.c
-index 424d5d2..e439102 100644
---- a/fatresize.c
-+++ b/fatresize.c
-@@ -30,6 +30,7 @@
- #include <inttypes.h>
- #include <parted/parted.h>
- #include <parted/debug.h>
-+#include <parted/filesys.h>
- #include <parted/unit.h>
- 
- #include "config.h"
-@@ -217,7 +218,7 @@ fatresize_handler(PedException *ex)
- static int
- snap(PedSector* sector, PedSector new_sector, PedGeometry* range)
- {
--    PED_ASSERT(ped_geometry_test_sector_inside (range, *sector), return 0);
-+    PED_ASSERT(ped_geometry_test_sector_inside (range, *sector));
-     if (!ped_geometry_test_sector_inside(range, new_sector))
- 	return 0;
- 
-@@ -281,7 +282,7 @@ snap_to_boundaries (PedGeometry* new_geom, PedGeometry* old_geom,
- 			  end_part->geom.end, end_part->geom.start - 1, -1);
- 	}
- 
--	PED_ASSERT (start <= end, return);
-+	PED_ASSERT (start <= end);
- 	ped_geometry_set (new_geom, start, end - start + 1);
- }
-