mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-14 17:04:42 +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" ```
70 lines
1.4 KiB
Nix
70 lines
1.4 KiB
Nix
{ lib
|
|
, rustPlatform
|
|
, fetchFromGitHub
|
|
, pkg-config
|
|
, libgit2
|
|
, oniguruma
|
|
, zlib
|
|
, stdenv
|
|
, darwin
|
|
, git
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "git-dive";
|
|
version = "0.1.6";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "gitext-rs";
|
|
repo = "git-dive";
|
|
rev = "v${version}";
|
|
hash = "sha256-sy2qNFn8JLE173HVWfFXBx21jcx4kpFMwi9a0m38lso=";
|
|
};
|
|
|
|
cargoHash = "sha256-Z3TgVunC/qNzUe0X9xIg3fTFXFk2w9yDA+EskSCg0Qo=";
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs = [
|
|
libgit2
|
|
oniguruma
|
|
zlib
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
darwin.apple_sdk.frameworks.Security
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
git
|
|
];
|
|
|
|
# don't use vendored libgit2
|
|
buildNoDefaultFeatures = true;
|
|
|
|
checkFlags = [
|
|
# requires internet access
|
|
"--skip=screenshot"
|
|
];
|
|
|
|
preCheck = ''
|
|
export HOME=$(mktemp -d)
|
|
git config --global user.name nixbld
|
|
git config --global user.email nixbld@example.com
|
|
'';
|
|
|
|
env = {
|
|
LIBGIT2_NO_VENDOR = 1;
|
|
RUSTONIG_SYSTEM_LIBONIG = true;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Dive into a file's history to find root cause";
|
|
homepage = "https://github.com/gitext-rs/git-dive";
|
|
changelog = "https://github.com/gitext-rs/git-dive/blob/${src.rev}/CHANGELOG.md";
|
|
license = with licenses; [ asl20 mit ];
|
|
maintainers = with maintainers; [ figsoda ];
|
|
mainProgram = "git-dive";
|
|
};
|
|
}
|