mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-06 04:53:27 +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" ```
63 lines
1.4 KiB
Nix
63 lines
1.4 KiB
Nix
{
|
|
stdenv,
|
|
bashInteractive,
|
|
buildPythonPackage,
|
|
cryptography,
|
|
diffstat,
|
|
fetchFromGitHub,
|
|
lib,
|
|
rpm,
|
|
urllib3,
|
|
keyring,
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "osc";
|
|
version = "1.9.1";
|
|
format = "setuptools";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "openSUSE";
|
|
repo = "osc";
|
|
rev = version;
|
|
hash = "sha256-03EDarU7rmsiE96IYHXFuPtD8nWur0qwj8NDzSj8OX0=";
|
|
};
|
|
|
|
buildInputs = [ bashInteractive ]; # needed for bash-completion helper
|
|
nativeCheckInputs = [
|
|
rpm
|
|
diffstat
|
|
];
|
|
propagatedBuildInputs = [
|
|
urllib3
|
|
cryptography
|
|
keyring
|
|
];
|
|
|
|
postInstall = ''
|
|
install -D -m444 contrib/osc.fish $out/etc/fish/completions/osc.fish
|
|
install -D -m555 contrib/osc.complete $out/share/bash-completion/helpers/osc-helper
|
|
mkdir -p $out/share/bash-completion/completions
|
|
cat >>$out/share/bash-completion/completions/osc <<EOF
|
|
test -z "\$BASH_VERSION" && return
|
|
complete -o default _nullcommand >/dev/null 2>&1 || return
|
|
complete -r _nullcommand >/dev/null 2>&1 || return
|
|
complete -o default -C $out/share/bash-completion/helpers/osc-helper osc
|
|
EOF
|
|
'';
|
|
|
|
preCheck = "HOME=$TOP/tmp";
|
|
|
|
meta = with lib; {
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
homepage = "https://github.com/openSUSE/osc";
|
|
description = "opensuse-commander with svn like handling";
|
|
mainProgram = "osc";
|
|
maintainers = with maintainers; [
|
|
peti
|
|
saschagrunert
|
|
];
|
|
license = licenses.gpl2;
|
|
};
|
|
}
|