-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(nix): make build use rev from nix
- Loading branch information
1 parent
9b37b80
commit 0066dcc
Showing
2 changed files
with
34 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
{ pkgs, project, python }: | ||
(project.renderers.buildPythonPackage { inherit python; }) // { | ||
src = ./..; | ||
postPatch = '' | ||
substituteInPlace pyproject.toml \ | ||
--replace-fail "cryptg-anyos" "cryptg" | ||
''; | ||
pythonRelaxDeps = [ | ||
"cryptg" | ||
]; | ||
meta = { | ||
license = pkgs.lib.licenses.mit; | ||
homepage = "https://tgpy.tmat.me/"; | ||
pythonImportsCheck = [ "tgpy" ]; | ||
{ | ||
pkgs, | ||
project, | ||
python, | ||
rev, | ||
}: | ||
let | ||
postPatch = | ||
'' | ||
substituteInPlace pyproject.toml \ | ||
--replace-fail "cryptg-anyos" "cryptg" | ||
'' | ||
+ pkgs.lib.optionalString (rev != null) '' | ||
substituteInPlace tgpy/version.py \ | ||
--replace-fail "COMMIT_HASH = None" "COMMIT_HASH = \"${rev}\"" | ||
''; | ||
newAttrs = { | ||
src = ./..; | ||
inherit postPatch; | ||
pythonRelaxDeps = [ | ||
"cryptg" | ||
]; | ||
meta = { | ||
license = pkgs.lib.licenses.mit; | ||
homepage = "https://tgpy.tmat.me/"; | ||
pythonImportsCheck = [ "tgpy" ]; | ||
}; | ||
}; | ||
} | ||
in | ||
(project.renderers.buildPythonPackage { inherit python; }) // newAttrs |