Merge pull request #182172 from amjoseph-nixpkgs/pr/units/pythonless
This commit is contained in:
commit
00104650c8
|
@ -9,7 +9,10 @@
|
||||||
|
|
||||||
assert enableCurrenciesUpdater -> pythonPackages != null;
|
assert enableCurrenciesUpdater -> pythonPackages != null;
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let pythonEnv = pythonPackages.python.withPackages(ps: [
|
||||||
|
ps.requests
|
||||||
|
]);
|
||||||
|
in stdenv.mkDerivation rec {
|
||||||
pname = "units";
|
pname = "units";
|
||||||
version = "2.22";
|
version = "2.22";
|
||||||
|
|
||||||
|
@ -18,16 +21,12 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "sha256-XRPhIHch/ncm2Qa6HZLcDt2qn8JnWe0i47jRp5MSWEg=";
|
sha256 = "sha256-XRPhIHch/ncm2Qa6HZLcDt2qn8JnWe0i47jRp5MSWEg=";
|
||||||
};
|
};
|
||||||
|
|
||||||
pythonEnv = pythonPackages.python.withPackages(ps: [
|
|
||||||
ps.requests
|
|
||||||
]);
|
|
||||||
|
|
||||||
buildInputs = [ readline ]
|
buildInputs = [ readline ]
|
||||||
++ lib.optionals enableCurrenciesUpdater [
|
++ lib.optionals enableCurrenciesUpdater [
|
||||||
pythonEnv
|
pythonEnv
|
||||||
]
|
]
|
||||||
;
|
;
|
||||||
prePatch = ''
|
prePatch = lib.optionalString enableCurrenciesUpdater ''
|
||||||
substituteInPlace units_cur \
|
substituteInPlace units_cur \
|
||||||
--replace "#!/usr/bin/env python" ${pythonEnv}/bin/python
|
--replace "#!/usr/bin/env python" ${pythonEnv}/bin/python
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue