2021-09-10 16:34:44 +02:00
|
|
|
{ lib, stdenv, git, xdg-utils, gnugrep, fetchFromGitHub, installShellFiles, makeWrapper, pandoc }:
|
2017-04-15 21:25:59 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "git-open";
|
2020-06-16 03:05:26 +02:00
|
|
|
version = "2.1.0";
|
2017-04-15 21:25:59 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "paulirish";
|
|
|
|
repo = "git-open";
|
|
|
|
rev = "v${version}";
|
2020-06-16 03:05:26 +02:00
|
|
|
sha256 = "11n46bngvca5wbdbfcxzjhjbfdbad7sgf7h9gf956cb1q8swsdm0";
|
2017-04-15 21:25:59 +02:00
|
|
|
};
|
|
|
|
|
2021-09-10 16:34:44 +02:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper pandoc ];
|
2017-04-15 21:25:59 +02:00
|
|
|
|
2021-09-10 16:34:44 +02: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 21:25:59 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp git-open $out/bin
|
2021-09-10 16:34:44 +02:00
|
|
|
installManPage git-open.1
|
2017-04-15 21:25:59 +02:00
|
|
|
wrapProgram $out/bin/git-open \
|
2022-07-12 01:23:52 +02:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ git gnugrep ]}" \
|
|
|
|
--suffix PATH : "${lib.makeBinPath [ xdg-utils ]}"
|
2017-04-15 21:25:59 +02:00
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/paulirish/git-open";
|
2017-04-15 21:25:59 +02:00
|
|
|
description = "Open the GitHub page or website for a repository in your browser";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
2021-09-10 16:34:56 +02:00
|
|
|
maintainers = with maintainers; [ jlesquembre SuperSandro2000 ];
|
2017-04-15 21:25:59 +02:00
|
|
|
};
|
|
|
|
}
|