1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-20 04:31:52 +00:00

Merge pull request #69843 from doronbehar/units_cur

units: Add units_cur python script to $out
This commit is contained in:
Matthew Bauer 2019-11-07 17:39:59 -05:00 committed by GitHub
commit ba205556e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 3 deletions

View file

@ -1,4 +1,13 @@
{ stdenv, fetchurl, readline }:
{
stdenv,
lib,
fetchurl,
readline,
enableCurrenciesUpdater ? true,
pythonPackages ? null
}:
assert enableCurrenciesUpdater -> pythonPackages != null;
stdenv.mkDerivation rec {
pname = "units";
@ -9,7 +18,22 @@ stdenv.mkDerivation rec {
sha256 = "0mk562g7dnidjgfgvkxxpvlba66fh1ykmfd9ylzvcln1vxmi6qj2";
};
buildInputs = [ readline ];
pythonEnv = pythonPackages.python.withPackages(ps: [
ps.requests
]);
buildInputs = [ readline ]
++ lib.optionals enableCurrenciesUpdater [
pythonEnv
]
;
prePatch = ''
substituteInPlace units_cur \
--replace "#!/usr/bin/env python" ${pythonEnv}/bin/python
'';
postInstall = ''
cp units_cur ${placeholder "out"}/bin/
'';
doCheck = true;

View file

@ -7092,7 +7092,10 @@ in
unbound = callPackage ../tools/networking/unbound { };
units = callPackage ../tools/misc/units { };
units = callPackage ../tools/misc/units {
enableCurrenciesUpdater = true;
pythonPackages = python3Packages;
};
unittest-cpp = callPackage ../development/libraries/unittest-cpp { };