nixpkgs/pkgs/applications/graphics/icon-library/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

66 lines
1.5 KiB
Nix

{ lib
, stdenv
, fetchurl
, wrapGAppsHook4
, buildPackages
, cargo
, desktop-file-utils
, meson
, ninja
, pkg-config
, rustc
, gettext
, gdk-pixbuf
, glib
, gtk4
, gtksourceview5
, libadwaita
, darwin
}:
stdenv.mkDerivation rec {
pname = "icon-library";
version = "0.0.19";
src = fetchurl {
url = "https://gitlab.gnome.org/World/design/icon-library/uploads/7725604ce39be278abe7c47288085919/icon-library-${version}.tar.xz";
hash = "sha256-nWGTYoSa0/fxnD0Mb2132LkeB1oa/gj/oIXBbI+FDw8=";
};
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
# Set the location to gettext to ensure the nixpkgs one on Darwin instead of the vendored one.
# The vendored gettext does not build with clang 16.
GETTEXT_BIN_DIR = "${lib.getBin buildPackages.gettext}/bin";
GETTEXT_INCLUDE_DIR = "${lib.getDev gettext}/include";
GETTEXT_LIB_DIR = "${lib.getLib gettext}/lib";
};
nativeBuildInputs = [
cargo
desktop-file-utils
meson
ninja
pkg-config
rustc
wrapGAppsHook4
];
buildInputs = [
gdk-pixbuf
glib
gtk4
gtksourceview5
libadwaita
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Foundation
];
meta = with lib; {
homepage = "https://gitlab.gnome.org/World/design/icon-library";
description = "Symbolic icons for your apps";
mainProgram = "icon-library";
maintainers = with maintainers; [ qyliss ];
license = licenses.gpl3Plus;
platforms = platforms.unix;
};
}