mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-07 13:33:12 +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" ```
42 lines
1.2 KiB
Nix
42 lines
1.2 KiB
Nix
{ stdenv
|
|
, lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, pkg-config
|
|
, Foundation
|
|
, dbusSupport ? stdenv.hostPlatform.isLinux, dbus
|
|
# rustls will be used for TLS if useOpenSSL=false
|
|
, useOpenSSL ? stdenv.hostPlatform.isLinux, openssl
|
|
, notificationSupport ? stdenv.hostPlatform.isLinux
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "tiny";
|
|
version = "0.12.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "osa1";
|
|
repo = "tiny";
|
|
rev = "v${version}";
|
|
hash = "sha256-VlKhOHNggT+FbMvE/N2JQOJf0uB1N69HHdP09u89qSk=";
|
|
};
|
|
|
|
cargoHash = "sha256-AhQCfLCoJU7o8s+XL3hDOPmZi9QjOxXSA9uglA1KSuY=";
|
|
|
|
nativeBuildInputs = lib.optional stdenv.hostPlatform.isLinux pkg-config;
|
|
buildInputs = lib.optionals dbusSupport [ dbus ]
|
|
++ lib.optionals useOpenSSL [ openssl ]
|
|
++ lib.optional stdenv.hostPlatform.isDarwin Foundation;
|
|
|
|
buildFeatures = lib.optional notificationSupport "desktop-notifications";
|
|
|
|
meta = with lib; {
|
|
description = "Console IRC client";
|
|
homepage = "https://github.com/osa1/tiny";
|
|
changelog = "https://github.com/osa1/tiny/blob/v${version}/CHANGELOG.md";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ Br1ght0ne vyp ];
|
|
mainProgram = "tiny";
|
|
};
|
|
}
|