python3Packages.setuptools-git: hardcode path to git executable

Changed files
+52 -10
pkgs
development
python-modules
+21 -10
pkgs/development/python-modules/setuptools-git/default.nix
···
{
lib,
buildPythonPackage,
-
fetchPypi,
-
pkgs,
+
fetchFromGitHub,
+
gitMinimal,
+
replaceVars,
+
setuptools,
}:
buildPythonPackage rec {
pname = "setuptools-git";
version = "1.2";
-
format = "setuptools";
+
pyproject = true;
-
src = fetchPypi {
-
inherit pname version;
-
sha256 = "ff64136da01aabba76ae88b050e7197918d8b2139ccbf6144e14d472b9c40445";
+
src = fetchFromGitHub {
+
owner = "msabramo";
+
repo = "setuptools-git";
+
tag = version;
+
hash = "sha256-dbQ15y62nanuWgh2puLYSio391Ja3SF+HrafvTBVNbk=";
};
-
propagatedBuildInputs = [ pkgs.git ];
+
patches = [
+
(replaceVars ./hardcode-git-path.patch {
+
git = lib.getExe gitMinimal;
+
})
+
];
+
+
build-system = [ setuptools ];
+
doCheck = false;
-
meta = with lib; {
+
meta = {
description = "Setuptools revision control system plugin for Git";
-
homepage = "https://pypi.python.org/pypi/setuptools-git";
-
license = licenses.bsd3;
+
homepage = "https://github.com/msabramo/setuptools-git";
+
license = lib.licenses.bsd3;
};
}
+31
pkgs/development/python-modules/setuptools-git/hardcode-git-path.patch
···
+
diff --git a/setuptools_git/__init__.py b/setuptools_git/__init__.py
+
index 24c9b8c..a289aca 100644
+
--- a/setuptools_git/__init__.py
+
+++ b/setuptools_git/__init__.py
+
@@ -28,7 +28,7 @@ def version_calc(dist, attr, value):
+
+
+
def calculate_version():
+
- return check_output(['git', 'describe', '--tags', '--dirty']).strip()
+
+ return check_output(['@git@', 'describe', '--tags', '--dirty']).strip()
+
+
+
def ntfsdecode(path):
+
@@ -64,7 +64,7 @@ def gitlsfiles(dirname=''):
+
+
try:
+
topdir = check_output(
+
- ['git', 'rev-parse', '--show-toplevel'], cwd=dirname or None,
+
+ ['@git@', 'rev-parse', '--show-toplevel'], cwd=dirname or None,
+
stderr=PIPE).strip()
+
+
if sys.platform == 'win32':
+
@@ -73,7 +73,7 @@ def gitlsfiles(dirname=''):
+
cwd = topdir
+
+
filenames = check_output(
+
- ['git', 'ls-files', '-z'], cwd=cwd, stderr=PIPE)
+
+ ['@git@', 'ls-files', '-z'], cwd=cwd, stderr=PIPE)
+
except (CalledProcessError, OSError):
+
# Setuptools mandates we fail silently
+
return res