diff --git a/pkgs/development/libraries/physics/yoda/default.nix b/pkgs/development/libraries/physics/yoda/default.nix index c6c6f742d0bf..8ed0a2c4ae3a 100644 --- a/pkgs/development/libraries/physics/yoda/default.nix +++ b/pkgs/development/libraries/physics/yoda/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, python2Packages, root, makeWrapper, zlib, withRootSupport ? false }: +{ stdenv, fetchurl, fetchpatch, python, root, makeWrapper, zlib, withRootSupport ? false }: stdenv.mkDerivation rec { pname = "yoda"; @@ -9,14 +9,26 @@ stdenv.mkDerivation rec { sha256 = "1ki88rscnym0vjxpfgql8m1lrc7vm1jb9w4jhw9lvv3rk84lpdng"; }; - pythonPath = []; # python wrapper support + patches = [ + # fixes "TypeError: expected bytes, str found" in writeYODA() + (fetchpatch { + url = "https://gitlab.com/hepcedar/yoda/commit/d2bbbe92912457f8a29b440cbfa0b39daf28ec34.diff"; + sha256 = "1x60piswpxwak61r2sdclsc8pzi1fshpkjnxlyflsa1iap77vkq8"; + }) + ]; - buildInputs = with python2Packages; [ python numpy matplotlib makeWrapper ] + nativeBuildInputs = with python.pkgs; [ cython makeWrapper ]; + buildInputs = [ python ] + ++ (with python.pkgs; [ numpy matplotlib ]) ++ stdenv.lib.optional withRootSupport root; propagatedBuildInputs = [ zlib ]; enableParallelBuilding = true; + postPatch = '' + touch pyext/yoda/*.{pyx,pxd} + ''; + postInstall = '' for prog in "$out"/bin/*; do wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out") diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f79c8c6e87dc..6b5f63e857ab 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24626,7 +24626,9 @@ in thepeg = callPackage ../development/libraries/physics/thepeg { }; - yoda = callPackage ../development/libraries/physics/yoda { }; + yoda = callPackage ../development/libraries/physics/yoda { + python = python2; + }; yoda-with-root = lowPrio (yoda.override { withRootSupport = true; }); diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 596c397505f1..955cd768c4e6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5693,6 +5693,10 @@ in { xxhash = callPackage ../development/python-modules/xxhash { }; + yoda = toPythonModule (pkgs.yoda.override { + inherit python; + }); + youtube-dl = callPackage ../tools/misc/youtube-dl {}; youtube-dl-light = callPackage ../tools/misc/youtube-dl {