2021-09-18 10:52:07 +00:00
|
|
|
{ lib, stdenv, git, xdg-utils, gnugrep, fetchFromGitHub, installShellFiles, makeWrapper, pandoc }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "git-open";
|
2023-03-24 00:07:29 +00:00
|
|
|
version = "3.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "paulirish";
|
|
|
|
repo = "git-open";
|
|
|
|
rev = "v${version}";
|
2023-03-24 00:07:29 +00:00
|
|
|
sha256 = "sha256-Bag2rI2uR7ilkg2ozjR8tPXqKz5XjiY7WAUJKTVTXd8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper pandoc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +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
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
2023-03-24 00:07:29 +00:00
|
|
|
mv git-open $out/bin
|
2021-09-18 10:52:07 +00:00
|
|
|
installManPage git-open.1
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/bin/git-open \
|
2023-03-24 00:07:29 +00:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ gnugrep ]}" \
|
2022-08-21 13:32:41 +00:00
|
|
|
--suffix PATH : "${lib.makeBinPath [ xdg-utils ]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/paulirish/git-open";
|
|
|
|
description = "Open the GitHub page or website for a repository in your browser";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
2023-03-24 00:07:29 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "git-open";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|