nixpkgs/pkgs/tools/networking/lftp/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

45 lines
1.3 KiB
Nix

{ lib, stdenv, fetchurl, openssl, pkg-config, readline, zlib, libidn2, gmp, libiconv, libunistring, gettext }:
stdenv.mkDerivation rec {
pname = "lftp";
version = "4.9.2";
src = fetchurl {
urls = [
"https://lftp.yar.ru/ftp/${pname}-${version}.tar.xz"
"https://ftp.st.ryukoku.ac.jp/pub/network/ftp/lftp/${pname}-${version}.tar.xz"
];
sha256 = "03b7y0h3mf4jfq5y8zw6hv9v44z3n6i8hc1iswax96y3z7sc85y5";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl readline zlib libidn2 gmp libiconv libunistring gettext ];
hardeningDisable = lib.optional stdenv.hostPlatform.isDarwin "format";
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
# Required to build with clang 16 or `configure` will fail to detect several standard functions.
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
};
configureFlags = [
"--with-openssl"
"--with-readline=${readline.dev}"
"--with-zlib=${zlib.dev}"
"--without-expat"
];
installFlags = [ "PREFIX=$(out)" ];
enableParallelBuilding = true;
meta = with lib; {
description = "File transfer program supporting a number of network protocols";
homepage = "https://lftp.yar.ru/";
license = licenses.gpl3Plus;
platforms = platforms.unix;
maintainers = [ maintainers.bjornfor ];
};
}