summary refs log tree commit diff
diff options
context:
space:
mode:
authormidchildan <git@midchildan.org>2021-05-16 01:39:05 +0900
committermidchildan <git@midchildan.org>2021-05-18 02:40:11 +0900
commitc951b0e90c9633d5bf1b261784da3b7b295c2b4e (patch)
tree7238d9335d70ad1522e4b16d33a2bb6ed057f9dc
parentb23797e2c58e87ba79ccd433548397ec5ed82ed2 (diff)
downloadnixpkgs-c951b0e90c9633d5bf1b261784da3b7b295c2b4e.tar
nixpkgs-c951b0e90c9633d5bf1b261784da3b7b295c2b4e.tar.gz
nixpkgs-c951b0e90c9633d5bf1b261784da3b7b295c2b4e.tar.bz2
nixpkgs-c951b0e90c9633d5bf1b261784da3b7b295c2b4e.tar.lz
nixpkgs-c951b0e90c9633d5bf1b261784da3b7b295c2b4e.tar.xz
nixpkgs-c951b0e90c9633d5bf1b261784da3b7b295c2b4e.tar.zst
nixpkgs-c951b0e90c9633d5bf1b261784da3b7b295c2b4e.zip
curlftpfs: fix sandboxed builds on darwin
-rw-r--r--pkgs/tools/filesystems/curlftpfs/default.nix18
-rw-r--r--pkgs/tools/filesystems/curlftpfs/fix-rpl_malloc.patch13
2 files changed, 27 insertions, 4 deletions
diff --git a/pkgs/tools/filesystems/curlftpfs/default.nix b/pkgs/tools/filesystems/curlftpfs/default.nix
index 2c5d886c14d..8c8fe31624f 100644
--- a/pkgs/tools/filesystems/curlftpfs/default.nix
+++ b/pkgs/tools/filesystems/curlftpfs/default.nix
@@ -1,11 +1,21 @@
 { lib, stdenv, fetchurl, autoreconfHook, fuse, curl, pkg-config, glib, zlib }:
 
-stdenv.mkDerivation {
-  name = "curlftpfs-0.9.2";
+stdenv.mkDerivation rec {
+  pname = "curlftpfs";
+  version = "0.9.2";
+
   src = fetchurl {
-    url = "mirror://sourceforge/curlftpfs/curlftpfs-0.9.2.tar.gz";
+    url = "mirror://sourceforge/curlftpfs/curlftpfs-${version}.tar.gz";
     sha256 = "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f";
   };
+
+  patches = [
+    # This removes AC_FUNC_MALLOC and AC_FUNC_REALLOC from configure.ac because
+    # it is known to cause problems. Search online for "rpl_malloc" and
+    # "rpl_realloc" to find out more.
+    ./fix-rpl_malloc.patch
+  ];
+
   nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ fuse curl glib zlib ];
 
@@ -24,7 +34,7 @@ stdenv.mkDerivation {
   meta = with lib; {
     description = "Filesystem for accessing FTP hosts based on FUSE and libcurl";
     homepage = "http://curlftpfs.sourceforge.net";
-    license = licenses.gpl2;
+    license = licenses.gpl2Only;
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/tools/filesystems/curlftpfs/fix-rpl_malloc.patch b/pkgs/tools/filesystems/curlftpfs/fix-rpl_malloc.patch
new file mode 100644
index 00000000000..0265e1d8289
--- /dev/null
+++ b/pkgs/tools/filesystems/curlftpfs/fix-rpl_malloc.patch
@@ -0,0 +1,13 @@
+diff -Naur a/configure.ac b/configure.ac
+--- a/configure.ac	2008-04-23 20:37:42.000000000 +0900
++++ b/configure.ac	2021-05-16 01:28:24.000000000 +0900
+@@ -46,9 +46,7 @@
+ 
+ # Checks for library functions.
+ AC_FUNC_CHOWN
+-AC_FUNC_MALLOC
+ AC_FUNC_MKTIME
+-AC_FUNC_REALLOC
+ AC_FUNC_SELECT_ARGTYPES
+ AC_FUNC_STRFTIME
+ AC_FUNC_UTIME_NULL