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

62 lines
1.3 KiB
Nix

{ stdenv
, lib
, fetchurl
, pkg-config
, libsoup_3
, libxml2
, meson
, ninja
, gnome
}:
stdenv.mkDerivation rec {
pname = "phodav";
version = "3.0";
outputs = [ "out" "dev" "lib" ];
src = fetchurl {
url = "mirror://gnome/sources/phodav/${version}/phodav-${version}.tar.xz";
sha256 = "OS7C0G1QMA3P8e8mmiqYUwTim841IAAvyiny7cHRONE=";
};
nativeBuildInputs = [
pkg-config
meson
ninja
];
buildInputs = [
libsoup_3
libxml2
];
mesonFlags = [
"-Davahi=disabled"
"-Dsystemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
"-Dgtk_doc=disabled"
"-Dudevrulesdir=${placeholder "out"}/lib/udev/rules.d"
];
NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-lintl";
passthru = {
updateScript = gnome.updateScript {
packageName = pname;
};
};
# We need to do this in pre-configure before the data/ folder disappears.
preConfigure = ''
install -vDt $out/lib/udev/rules.d/ data/*-spice-webdavd.rules
'';
meta = with lib; {
description = "WebDav server implementation and library using libsoup";
homepage = "https://gitlab.gnome.org/GNOME/phodav";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ wegank ];
platforms = platforms.unix;
};
}