mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +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" ```
54 lines
1.3 KiB
Nix
54 lines
1.3 KiB
Nix
{ buildPythonApplication
|
|
, lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, pkg-config
|
|
, setuptools
|
|
, setuptools-rust
|
|
, rustPlatform
|
|
, cargo
|
|
, rustc
|
|
, breezy
|
|
, dulwich
|
|
, jinja2
|
|
, libiconv
|
|
, openssl
|
|
, pyyaml
|
|
, ruamel-yaml
|
|
}:
|
|
|
|
buildPythonApplication rec {
|
|
pname = "silver-platter";
|
|
version = "0.5.20";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "jelmer";
|
|
repo = "silver-platter";
|
|
rev = version;
|
|
hash = "sha256-k+C4jrC4FO/yy9Eb6x4lv1zyyp/eGkpMcDqZ0KoxfBs=";
|
|
};
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
inherit src;
|
|
name = "${pname}-${version}";
|
|
hash = "sha256-+EUj6iBnHF4zlOAAfaHy5V/z6CCD/LFksBClE4FaHHc=";
|
|
};
|
|
|
|
propagatedBuildInputs = [ setuptools breezy dulwich jinja2 pyyaml ruamel-yaml ];
|
|
nativeBuildInputs = [ setuptools-rust rustPlatform.cargoSetupHook cargo rustc ]
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ];
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl ]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
|
|
|
|
pythonImportsCheck = [ "silver_platter" ];
|
|
|
|
meta = with lib; {
|
|
description = "Automate the creation of merge proposals for scriptable changes";
|
|
homepage = "https://jelmer.uk/code/silver-platter";
|
|
license = licenses.gpl2Plus;
|
|
maintainers = with maintainers; [ lukegb ];
|
|
mainProgram = "svp";
|
|
};
|
|
}
|