nixpkgs-suyu/pkgs/applications/version-management/sourcehut/meta.nix
Julien Moutinho 664edda544 sourcehut: fix #198478
The error:
> Executing pythonOutputDistPhase
> mv: cannot stat 'dist': No such file or directory
was caused by the non-idempotent hook `pythonOutputDistHook`
appearing in: 86ab83260f
and initially in: adbc59c9d3
being run twice due to the manual propagation of
`nativeBuildInputs` from sourcehut's core to sourcehut's services.

Kudos to Winter (@winterqt) for making sense of this bug.
2022-11-01 21:56:37 -04:00

82 lines
1.5 KiB
Nix

{ lib
, fetchFromSourcehut
, buildPythonPackage
, buildGoModule
, pgpy
, srht
, redis
, bcrypt
, qrcode
, stripe
, zxcvbn
, alembic
, pystache
, dnspython
, sshpubkeys
, weasyprint
, prometheus-client
, python
, unzip
}:
let
version = "0.58.18";
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = "meta.sr.ht";
rev = version;
sha256 = "sha256-OjbQHAzG2nZwpJUIvhKaCJWZbhZDC2R6C+SkbKUpk8o=";
};
metasrht-api = buildGoModule ({
inherit src version;
pname = "metasrht-api";
modRoot = "api";
vendorSha256 = "sha256-kiEuEYZFbwJ6SbKFtxH4SiRaZmqYriRHPoHdTX28+d0=";
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; });
in
buildPythonPackage rec {
pname = "metasrht";
inherit version src;
postPatch = ''
substituteInPlace Makefile \
--replace "all: api" ""
'';
propagatedBuildInputs = [
pgpy
srht
redis
bcrypt
qrcode
stripe
zxcvbn
alembic
pystache
sshpubkeys
weasyprint
prometheus-client
dnspython
];
preBuild = ''
export PKGVER=${version}
export SRHT_PATH=${srht}/${python.sitePackages}/srht
'';
postInstall = ''
mkdir -p $out/bin
ln -s ${metasrht-api}/bin/api $out/bin/metasrht-api
'';
pythonImportsCheck = [ "metasrht" ];
meta = with lib; {
homepage = "https://git.sr.ht/~sircmpwn/meta.sr.ht";
description = "Account management service for the sr.ht network";
license = licenses.agpl3Only;
maintainers = with maintainers; [ eadwu ];
};
}