nixpkgs/pkgs/applications/version-management/git-open/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2021-09-10 14:34:44 +00:00
{ lib, stdenv, git, xdg-utils, gnugrep, fetchFromGitHub, installShellFiles, makeWrapper, pandoc }:
2017-04-15 19:25:59 +00:00
stdenv.mkDerivation rec {
pname = "git-open";
version = "3.0.0";
2017-04-15 19:25:59 +00:00
src = fetchFromGitHub {
owner = "paulirish";
repo = "git-open";
rev = "v${version}";
sha256 = "sha256-Bag2rI2uR7ilkg2ozjR8tPXqKz5XjiY7WAUJKTVTXd8=";
2017-04-15 19:25:59 +00:00
};
2021-09-10 14:34:44 +00:00
nativeBuildInputs = [ installShellFiles makeWrapper pandoc ];
2017-04-15 19:25:59 +00:00
2021-09-10 14:34:44 +00:00
buildPhase = ''
# marked-man is broken and severly outdated.
# pandoc with some extra metadata is good enough and produces a by man readable file.
cat <(echo echo '% git-open (1) Version ${version} | Git manual') git-open.1.md > tmp
mv tmp git-open.1.md
pandoc --standalone --to man git-open.1.md -o git-open.1
'';
2017-04-15 19:25:59 +00:00
installPhase = ''
mkdir -p $out/bin
mv git-open $out/bin
2021-09-10 14:34:44 +00:00
installManPage git-open.1
2017-04-15 19:25:59 +00:00
wrapProgram $out/bin/git-open \
--prefix PATH : "${lib.makeBinPath [ gnugrep ]}" \
--suffix PATH : "${lib.makeBinPath [ xdg-utils ]}"
2017-04-15 19:25:59 +00:00
'';
meta = with lib; {
homepage = "https://github.com/paulirish/git-open";
2017-04-15 19:25:59 +00:00
description = "Open the GitHub page or website for a repository in your browser";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ SuperSandro2000 ];
2023-11-27 01:17:53 +00:00
mainProgram = "git-open";
2017-04-15 19:25:59 +00:00
};
}