nixpkgs/pkgs/applications/version-management/sourcehut/man.nix

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

71 lines
1.4 KiB
Nix
Raw Normal View History

2021-04-18 03:11:00 +00:00
{ lib
, fetchFromSourcehut
, buildGoModule
2021-04-18 03:11:00 +00:00
, buildPythonPackage
, srht
, pygit2
, python
, unzip
, pip
, pythonOlder
, setuptools
2021-04-18 03:11:00 +00:00
}:
let
2024-03-30 13:17:31 +00:00
version = "0.16.5";
gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.43"; };
2021-04-18 03:11:00 +00:00
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "man.sr.ht";
rev = version;
2024-03-30 13:17:31 +00:00
hash = "sha256-JFMtif2kIE/fs5PNcQtkJikAFNszgZTU7BG/8fTncTI=";
};
mansrht-api = buildGoModule ({
inherit src version;
pname = "mansrht-api";
modRoot = "api";
2024-03-30 13:17:31 +00:00
vendorHash = "sha256-GVN11nEJqIHh8MtKvIXe4zcUwJph9eTSkJ2R+ufD+ic=";
} // gqlgen);
in
buildPythonPackage rec {
inherit src version;
pname = "mansrht";
pyproject = true;
disabled = pythonOlder "3.7";
postPatch = ''
substituteInPlace Makefile --replace "all: api" ""
'';
nativeBuildInputs = [
pip
setuptools
];
propagatedBuildInputs = [
srht
pygit2
];
preBuild = ''
export PKGVER=${version}
2021-04-18 03:11:00 +00:00
export SRHT_PATH=${srht}/${python.sitePackages}/srht
'';
postInstall = ''
ln -s ${mansrht-api}/bin/api $out/bin/mansrht-api
'';
2021-08-15 21:11:47 +00:00
pythonImportsCheck = [ "mansrht" ];
meta = with lib; {
homepage = "https://git.sr.ht/~sircmpwn/man.sr.ht";
description = "Wiki service for the sr.ht network";
2021-08-15 20:54:11 +00:00
license = licenses.agpl3Only;
maintainers = with maintainers; [ eadwu christoph-heiss ];
};
}