mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
e0464e4788
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" ```
77 lines
1.7 KiB
Nix
77 lines
1.7 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitLab
|
|
, buildPackages
|
|
, cargo
|
|
, meson
|
|
, ninja
|
|
, pkg-config
|
|
, desktop-file-utils
|
|
, rustPlatform
|
|
, rustc
|
|
, wrapGAppsHook4
|
|
, darwin
|
|
, gettext
|
|
, glib
|
|
, gtk4
|
|
, libadwaita
|
|
, libiconv
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "bustle";
|
|
version = "0.9.2";
|
|
|
|
src = fetchFromGitLab {
|
|
domain = "gitlab.gnome.org";
|
|
owner = "World";
|
|
repo = "bustle";
|
|
rev = finalAttrs.version;
|
|
hash = "sha256-/B1rY8epcP0OFv+kVgv4Jx6x/oK3XpNnZcpSGvdIPx0=";
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
inherit (finalAttrs) src;
|
|
name = "bustle-${finalAttrs.version}";
|
|
hash = "sha256-r29Z+6P+yuCpOBUE3vkESd15lcGXs5+ZTBiQ9nW6DJ4=";
|
|
};
|
|
|
|
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
|
|
meson
|
|
ninja
|
|
pkg-config
|
|
desktop-file-utils
|
|
rustPlatform.cargoSetupHook
|
|
rustc
|
|
wrapGAppsHook4
|
|
glib
|
|
];
|
|
|
|
buildInputs = [
|
|
glib
|
|
gtk4
|
|
libadwaita
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
darwin.apple_sdk.frameworks.Foundation
|
|
libiconv
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Graphical D-Bus message analyser and profiler";
|
|
homepage = "https://gitlab.gnome.org/World/bustle";
|
|
license = licenses.lgpl21Plus;
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
mainProgram = "bustle";
|
|
platforms = platforms.all;
|
|
};
|
|
})
|