forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
59 lines
1.4 KiB
Nix
59 lines
1.4 KiB
Nix
{ lib, stdenv, fetchFromGitHub, git, makeWrapper, which }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "git-subrepo";
|
|
version = "0.4.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "ingydotnet";
|
|
repo = "git-subrepo";
|
|
rev = version;
|
|
sha256 = "0n10qnc8kyms6cv65k1n5xa9nnwpwbjn9h2cq47llxplawzqgrvp";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
makeWrapper
|
|
which
|
|
];
|
|
|
|
buildInputs = [
|
|
git
|
|
];
|
|
|
|
makeFlags = [
|
|
"PREFIX=${placeholder "out"}"
|
|
"INSTALL_LIB=${placeholder "out"}/bin"
|
|
"INSTALL_MAN=${placeholder "out"}/share/man/man1"
|
|
];
|
|
|
|
patches = [
|
|
# Allow zsh completion to work even though we aren't installing from a git
|
|
# clone. Also submitted upstream as
|
|
# https://github.com/ingydotnet/git-subrepo/pull/420
|
|
./zsh-completion.patch
|
|
];
|
|
|
|
postInstall = ''
|
|
ZSH_COMP_DIR="$out/share/zsh/vendor-completions"
|
|
mkdir -p "$ZSH_COMP_DIR"
|
|
cp share/zsh-completion/_git-subrepo "$ZSH_COMP_DIR/"
|
|
|
|
BASH_COMP_DIR="$out/share/bash-completion/completions"
|
|
mkdir -p "$BASH_COMP_DIR"
|
|
cp share/completion.bash "$BASH_COMP_DIR/git-subrepo"
|
|
'';
|
|
|
|
postFixup = ''
|
|
wrapProgram $out/bin/git-subrepo \
|
|
--prefix PATH : "${git}/bin"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/ingydotnet/git-subrepo";
|
|
description = "Git submodule alternative";
|
|
license = licenses.mit;
|
|
platforms = platforms.unix ++ platforms.darwin;
|
|
maintainers = [ maintainers.ryantrinkle ];
|
|
};
|
|
}
|