nixpkgs/pkgs/by-name/rr/rrdtool/package.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

70 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
autoreconfHook,
gettext,
perl,
pkg-config,
libxml2,
pango,
cairo,
groff,
tcl,
darwin,
}:
perl.pkgs.toPerlModule (
stdenv.mkDerivation rec {
pname = "rrdtool";
version = "1.9.0";
src = fetchFromGitHub {
owner = "oetiker";
repo = "rrdtool-1.x";
rev = "v${version}";
hash = "sha256-CPbSu1mosNlfj2nqiNVH14a5C5njkfvJM8ix3X3aP8E=";
};
# Fix darwin build
patches = lib.optional stdenv.hostPlatform.isDarwin (fetchpatch {
url = "https://github.com/oetiker/rrdtool-1.x/pull/1262.patch";
hash = "sha256-aP0rmDlILn6VC8Tg7HpRXbxL9+KD/PRTbXnbQ7HgPEg=";
});
nativeBuildInputs = [
pkg-config
autoreconfHook
];
buildInputs =
[
gettext
perl
libxml2
pango
cairo
groff
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
tcl
darwin.apple_sdk.frameworks.ApplicationServices
];
postInstall = ''
# for munin and rrdtool support
mkdir -p $out/${perl.libPrefix}
mv $out/lib/perl/5* $out/${perl.libPrefix}
'';
meta = with lib; {
homepage = "https://oss.oetiker.ch/rrdtool/";
description = "High performance logging in Round Robin Databases";
license = licenses.gpl2Only;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ pSub ];
};
}
)