nixpkgs/pkgs/tools/filesystems/curlftpfs/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

44 lines
1.4 KiB
Nix

{ lib, stdenv, fetchurl, autoreconfHook, fuse, curl, pkg-config, glib, zlib }:
stdenv.mkDerivation rec {
pname = "curlftpfs";
version = "0.9.2";
src = fetchurl {
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
./suse-bug-580609.patch
./suse-bug-955687.patch
];
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ fuse curl glib zlib ];
CFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-D__off_t=off_t";
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
# Fix the build on macOS with macFUSE installed. Needs autoreconfHook for
# this change to effect
substituteInPlace configure.ac --replace \
'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH' \
""
'';
doCheck = false; # fails, doesn't work well too, btw
meta = with lib; {
description = "Filesystem for accessing FTP hosts based on FUSE and libcurl";
mainProgram = "curlftpfs";
homepage = "https://curlftpfs.sourceforge.net";
license = licenses.gpl2Only;
platforms = platforms.unix;
};
}