Merge branch 'master' into staging
Hydra nixpkgs: ?compare=1279790
This commit is contained in:
@@ -9,7 +9,7 @@ for f in sys.path:
|
||||
for req in pkg_resources.find_distributions(f):
|
||||
if req not in packages[req.project_name]:
|
||||
# some exceptions inside buildPythonPackage
|
||||
if req.project_name in ['setuptools', 'pip']:
|
||||
if req.project_name in ['setuptools', 'pip', 'wheel']:
|
||||
continue
|
||||
packages[req.project_name].append(req)
|
||||
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
# Additional flags to pass to "pip install".
|
||||
, installFlags ? []
|
||||
|
||||
# Raise an error if two packages are installed with the same name
|
||||
, catchConflicts ? true
|
||||
|
||||
, format ? "setup"
|
||||
|
||||
, ... } @ attrs:
|
||||
@@ -141,7 +144,7 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled" "doCheck"] //
|
||||
|
||||
postFixup = attrs.postFixup or ''
|
||||
wrapPythonPrograms
|
||||
|
||||
'' + lib.optionalString catchConflicts ''
|
||||
# check if we have two packages with the same name in closure and fail
|
||||
# this shouldn't happen, something went wrong with dependencies specs
|
||||
${python.interpreter} ${./catch_conflicts.py}
|
||||
|
||||
129
pkgs/development/python-modules/libgpuarray/cuda/default.nix
Normal file
129
pkgs/development/python-modules/libgpuarray/cuda/default.nix
Normal file
@@ -0,0 +1,129 @@
|
||||
{ stdenv
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, cython
|
||||
, numpy
|
||||
, Mako
|
||||
, six
|
||||
, nose
|
||||
, beaker
|
||||
, memcached
|
||||
, pkgconfig
|
||||
, glibc
|
||||
, clblas
|
||||
, Babel
|
||||
, pygments
|
||||
, scipy
|
||||
, python
|
||||
, cudatoolkit
|
||||
, nvidia_x11
|
||||
}:
|
||||
buildPythonPackage rec {
|
||||
name = "libgpuarray-cuda-${version}";
|
||||
version = "-9998.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Theano";
|
||||
repo = "libgpuarray";
|
||||
rev = "fc36a40526c0a8303ace6c574ffdefba7feafe17";
|
||||
sha256 = "1kb0k42addqjxiahlcbv6v6271yhsmz71j12186fpy60870i7zm7";
|
||||
};
|
||||
|
||||
doCheck = true;
|
||||
|
||||
configurePhase = ''
|
||||
mkdir -p Build/Install
|
||||
pushd Build
|
||||
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=./Install \
|
||||
-DCLBLAS_ROOT_DIR=${clblas}
|
||||
|
||||
popd
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
pushd Build
|
||||
make
|
||||
make install
|
||||
|
||||
function fixRunPath {
|
||||
p=$(patchelf --print-rpath $1)
|
||||
patchelf --set-rpath "$p:${cudatoolkit}/lib:${clblas}/lib:${nvidia_x11}/lib" $1
|
||||
}
|
||||
|
||||
fixRunPath Install/lib/libgpuarray.so
|
||||
|
||||
popd
|
||||
'';
|
||||
|
||||
setupPyBuildFlags = [ "-L $(pwd)/Build/Install/lib" "-I $(pwd)/Build/Install/include" ];
|
||||
|
||||
preInstall = ''
|
||||
cp -r Build/Install $out
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
pushd $out/${python.sitePackages}/pygpu
|
||||
for f in $(find $out/pygpu -name "*.h"); do
|
||||
ln -s $f $(basename $f)
|
||||
done
|
||||
popd
|
||||
'';
|
||||
checkPhase = ''
|
||||
mkdir -p my_bin
|
||||
pushd my_bin
|
||||
|
||||
cat > libgpuarray_run_tests << EOF
|
||||
#!/bin/sh
|
||||
if [ \$# -eq 0 ]; then
|
||||
echo "No argument provided."
|
||||
echo "Available tests:"
|
||||
ls $out/${python.sitePackages}/pygpu/tests | grep "test_"
|
||||
exit 1
|
||||
else
|
||||
nosetests -v "$out/${python.sitePackages}/pygpu/tests/\$@"
|
||||
fi
|
||||
EOF
|
||||
|
||||
chmod +x libgpuarray_run_tests
|
||||
popd
|
||||
|
||||
cp -r my_bin $out/bin
|
||||
'';
|
||||
|
||||
dontStrip = true;
|
||||
|
||||
propagatedBuildInputs = [
|
||||
numpy
|
||||
scipy
|
||||
nose
|
||||
six
|
||||
Mako
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
cmake
|
||||
cython
|
||||
beaker
|
||||
memcached
|
||||
pkgconfig
|
||||
glibc
|
||||
Babel
|
||||
pygments
|
||||
numpy.blas
|
||||
cudatoolkit
|
||||
nvidia_x11
|
||||
clblas
|
||||
];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = https://github.com/Theano/libgpuarray;
|
||||
description = "Library to manipulate tensors on GPU.";
|
||||
license = licenses.free;
|
||||
maintainers = with maintainers; [ artuuge ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
|
||||
}
|
||||
21
pkgs/development/python-modules/pycuda/compyte.nix
Normal file
21
pkgs/development/python-modules/pycuda/compyte.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ mkDerivation
|
||||
, fetchFromGitHub
|
||||
}:
|
||||
|
||||
mkDerivation rec {
|
||||
name = "compyte-${version}";
|
||||
version = "git-20150817";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "inducer";
|
||||
repo = "compyte";
|
||||
rev = "ac1c71d46428c14aa1bd1c09d7da19cd0298d5cc";
|
||||
sha256 = "1980h017qi52b7fqwm75m481xs2napgdd3fbrzkfc29k085cbign";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r * $out
|
||||
'';
|
||||
|
||||
}
|
||||
69
pkgs/development/python-modules/pycuda/default.nix
Normal file
69
pkgs/development/python-modules/pycuda/default.nix
Normal file
@@ -0,0 +1,69 @@
|
||||
{ buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, boost
|
||||
, numpy
|
||||
, pytools
|
||||
, pytest
|
||||
, decorator
|
||||
, appdirs
|
||||
, six
|
||||
, cudatoolkit
|
||||
, python
|
||||
, mkDerivation
|
||||
, stdenv
|
||||
, pythonOlder
|
||||
}:
|
||||
let
|
||||
compyte = import ./compyte.nix {
|
||||
inherit mkDerivation fetchFromGitHub;
|
||||
};
|
||||
in
|
||||
buildPythonPackage rec {
|
||||
name = "pycuda-${version}";
|
||||
version = "2016.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "inducer";
|
||||
repo = "pycuda";
|
||||
rev = "609817e22c038249f5e9ddd720b3ca5a9d58ca11";
|
||||
sha256 = "0kg6ayxsw2gja9rqspy6z8ihacf9jnxr8hzywjwmj1izkv24cff7";
|
||||
};
|
||||
|
||||
preConfigure = ''
|
||||
findInputs ${boost} boost_dirs propagated-native-build-inputs
|
||||
|
||||
export BOOST_INCLUDEDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep '\-dev')/include
|
||||
export BOOST_LIBRARYDIR=$(echo $boost_dirs | sed -e s/\ /\\n/g - | grep -v '\-dev')/lib
|
||||
|
||||
${python.interpreter} configure.py --boost-inc-dir=$BOOST_INCLUDEDIR \
|
||||
--boost-lib-dir=$BOOST_LIBRARYDIR \
|
||||
--no-use-shipped-boost \
|
||||
--boost-python-libname=boost_python
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
ln -s ${compyte} $out/${python.sitePackages}/pycuda/compyte
|
||||
'';
|
||||
|
||||
doCheck = pythonOlder "3.5";
|
||||
|
||||
propagatedBuildInputs = [
|
||||
numpy
|
||||
pytools
|
||||
pytest
|
||||
decorator
|
||||
appdirs
|
||||
six
|
||||
cudatoolkit
|
||||
compyte
|
||||
python
|
||||
];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = https://github.com/inducer/pycuda/;
|
||||
description = "CUDA integration for Python.";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ artuuge ];
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{ stdenv, fetchurl, cmake, libxml2, libxslt, pysideApiextractor, pysideGeneratorrunner, python, sphinx, qt4, isPy3k, isPy35 }:
|
||||
|
||||
# Python 3.5 is not supported: https://github.com/PySide/Shiboken/issues/77
|
||||
if isPy35 then throw "shiboken not supported for interpreter ${python.executable}" else stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation rec {
|
||||
name = "${python.libPrefix}-pyside-shiboken-${version}";
|
||||
version = "1.2.4";
|
||||
|
||||
@@ -19,6 +19,7 @@ if isPy35 then throw "shiboken not supported for interpreter ${python.executable
|
||||
substituteInPlace generator/CMakeLists.txt --replace \
|
||||
\"$\{GENERATORRUNNER_PLUGIN_DIR}\" lib/generatorrunner/
|
||||
'';
|
||||
patches = if isPy35 then [ ./shiboken_py35.patch ] else null;
|
||||
|
||||
cmakeFlags = if isPy3k then "-DUSE_PYTHON3=TRUE" else null;
|
||||
|
||||
|
||||
12
pkgs/development/python-modules/pyside/shiboken_py35.patch
Normal file
12
pkgs/development/python-modules/pyside/shiboken_py35.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/cmake/Modules/FindPython3Libs.cmake b/cmake/Modules/FindPython3Libs.cmake
|
||||
--- a/cmake/Modules/FindPython3Libs.cmake
|
||||
+++ b/cmake/Modules/FindPython3Libs.cmake
|
||||
@@ -27,7 +27,7 @@ INCLUDE(CMakeFindFrameworks)
|
||||
# Search for the python framework on Apple.
|
||||
# CMAKE_FIND_FRAMEWORKS(Python)
|
||||
|
||||
-FOREACH(_CURRENT_VERSION 3.4 3.3 3.2 3.1 3.0)
|
||||
+FOREACH(_CURRENT_VERSION 3.5 3.4 3.3 3.2 3.1 3.0)
|
||||
IF(_CURRENT_VERSION GREATER 3.1)
|
||||
SET(_32FLAGS "m" "u" "mu" "dm" "du" "dmu" "")
|
||||
ELSE()
|
||||
Reference in New Issue
Block a user