Merge pull request #113366 from bhipple/ledger/py3

ledger: build python bindings with python3
This commit is contained in:
Sandro 2021-02-17 09:49:38 +01:00 committed by GitHub
commit 2fe492c198
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, cmake, boost, gmp, mpfr, libedit, python
{ stdenv, lib, fetchFromGitHub, cmake, boost, gmp, mpfr, libedit, python3
, texinfo, gnused, usePython ? true }:
stdenv.mkDerivation rec {
@ -15,8 +15,8 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ];
buildInputs = [
(boost.override { enablePython = usePython; })
gmp mpfr libedit python gnused
(boost.override { enablePython = usePython; python = python3; })
gmp mpfr libedit python3 gnused
];
nativeBuildInputs = [ cmake texinfo ];
@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
# however, that would write to a different nixstore path, pass our own sitePackages location
prePatch = lib.optionalString usePython ''
substituteInPlace src/CMakeLists.txt \
--replace 'DESTINATION ''${Python_SITEARCH}' 'DESTINATION "${python.sitePackages}"'
--replace 'DESTINATION ''${Python_SITEARCH}' 'DESTINATION "${python3.sitePackages}"'
'';
installTargets = [ "doc" "install" ];