Python: drop python.majorVersion

Drop `python.majorVersion`. For Python language version, use `python.pythonVersion`.
For implementation version, use `python.sourceVersion`.

Some expressions were broken. Those that were identified were fixed.

fixup major
This commit is contained in:
Frederik Rietdijk 2019-01-03 10:05:50 +01:00
parent f665828fa3
commit 0a2caa41fe
10 changed files with 18 additions and 21 deletions

View File

@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
for program in ingenams ingenish
do
wrapProgram $out/bin/$program \
--prefix PYTHONPATH : $out/lib/python${python.majorVersion}/site-packages:$PYTHONPATH
--prefix PYTHONPATH : $out/${python.sitePackages}:$PYTHONPATH
done
'';

View File

@ -51,10 +51,10 @@ stdenv.mkDerivation rec {
"-DWITH_SYSTEM_OPENJPEG=ON"
"-DWITH_PLAYER=ON"
"-DWITH_OPENSUBDIV=ON"
"-DPYTHON_LIBRARY=python${python.majorVersion}m"
"-DPYTHON_LIBRARY=${python.libPrefix}"
"-DPYTHON_LIBPATH=${python}/lib"
"-DPYTHON_INCLUDE_DIR=${python}/include/python${python.majorVersion}m"
"-DPYTHON_VERSION=${python.majorVersion}"
"-DPYTHON_INCLUDE_DIR=${python}/include/${python.libPrefix}"
"-DPYTHON_VERSION=${python.pythonVersion}"
"-DWITH_PYTHON_INSTALL=OFF"
"-DWITH_PYTHON_INSTALL_NUMPY=OFF"
]
@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
]
++ optional colladaSupport "-DWITH_OPENCOLLADA=ON";
NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}m";
NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR -I${python}/include/${python.libPrefix}";
# Since some dependencies are built with gcc 6, we need gcc 6's
# libstdc++ in our RPATH. Sigh.
@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
postInstall = optionalString enableNumpy
''
wrapProgram $out/bin/blender \
--prefix PYTHONPATH : ${pythonPackages.numpy}/lib/python${python.majorVersion}/site-packages
--prefix PYTHONPATH : ${pythonPackages.numpy}/${python.sitePackages}
'';
meta = with stdenv.lib; {

View File

@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
++ optionals pythonPluginSupport [ "-I${python}/include/${python.libPrefix}" ];
LDFLAGS = [ ]
++ optionals pythonPluginSupport [ "-L${python}/lib" "-lpython${python.majorVersion}m" ];
++ optionals pythonPluginSupport [ "-L${python}/lib" "-l${python.libPrefix}" ];
meta = {
description = "A console based XMPP client";

View File

@ -4,7 +4,7 @@
}:
stdenv.mkDerivation rec {
name = "golly-${version}";
pname = "golly";
version = "2.8.99.2.20161122";
#src = fetchurl {
# url="mirror://sourceforge/project/golly/golly/golly-2.8/golly-2.8-src.tar.gz";
@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
makeFlags=[
"AM_LDFLAGS="
];
NIX_LDFLAGS="-lpython${python2.majorVersion} -lperl";
NIX_LDFLAGS="-l${python2.libPrefix} -lperl";
preConfigure=''
export NIX_LDFLAGS="$NIX_LDFLAGS -L$(dirname "$(find ${perl} -name libperl.so)")"
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE

View File

@ -1,8 +1,7 @@
{stdenv, fetchurl, wxGTK, perl, python2, zlib, libGLU_combined, libX11}:
stdenv.mkDerivation rec {
baseName="golly";
pname = "golly";
version = "3.2";
name="${baseName}-${version}";
src = fetchurl {
sha256 = "0cg9mbwmf4q6qxhqlnzrxh9y047banxdb8pd3hgj3smmja2zf0jd";
@ -21,7 +20,7 @@ stdenv.mkDerivation rec {
makeFlags=[
"AM_LDFLAGS="
];
NIX_LDFLAGS="-lpython${python2.majorVersion} -lperl";
NIX_LDFLAGS="-l${python2.libPrefix} -lperl";
preConfigure=''
export NIX_LDFLAGS="$NIX_LDFLAGS -L$(dirname "$(find ${perl} -name libperl.so)")"
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE

View File

@ -39,8 +39,6 @@ with pkgs;
pythonAtLeast = lib.versionAtLeast pythonVersion;
pythonOlder = lib.versionOlder pythonVersion;
inherit pythonForBuild;
majorVersion = pythonVersion; # Backwards compatibility. Should be dropped.
};
in {

View File

@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
preConfigure = ''
# Fix for boost 1.67+
substituteInPlace CMakeLists.txt \
--replace "find_package(Boost)" "find_package(Boost 1.40 REQUIRED COMPONENTS python${builtins.replaceStrings ["."] [""] python.majorVersion})"
--replace "find_package(Boost)" "find_package(Boost 1.40 REQUIRED COMPONENTS python${builtins.replaceStrings ["."] [""] python.pythonVersion})"
for f in `find . -name CMakeLists.txt`; do
substituteInPlace "$f" \
--replace "boost_python" "\''${Boost_LIBRARIES}"

View File

@ -45,7 +45,7 @@ in buildPythonPackage rec {
format = "wheel";
src = let
pyVerNoDot = lib.strings.stringAsChars (x: if x == "." then "" else x) "${python.majorVersion}";
pyVerNoDot = lib.strings.stringAsChars (x: if x == "." then "" else x) "${python.pythonVersion}";
pyver = if stdenv.isDarwin then builtins.substring 0 1 pyVerNoDot else pyVerNoDot;
platform = if stdenv.isDarwin then "mac" else "linux";
unit = if cudaSupport then "gpu" else "cpu";

View File

@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
enableParallelBuilding = false;
cmakeFlags = [
"-DPYTHON_LIBRARY=${python}/lib/libpython${python.majorVersion}m.so"
"-DPYTHON_INCLUDE_DIR=${python}/include/python${python.majorVersion}m"
"-DPYTHON_LIBRARY=${python}/lib/lib${python.libPrefix}.so"
"-DPYTHON_INCLUDE_DIR=${python}/include/${python.libPrefix}"
"-DCMAKE_VERBOSE_MAKEFILE=True"
"-DCMAKE_BUILD_TYPE=Release"
"-DWITH_PYTHONQT:BOOL=ON"

View File

@ -19,7 +19,7 @@ in stdenv.mkDerivation rec {
--replace "\$(LIBTOOL) --mode=install cp _unbound.la" "cp _unbound.la"
'';
preConfigure = "export PYTHON_VERSION=${python.majorVersion}";
preConfigure = "export PYTHON_VERSION=${python.pythonVersion}";
configureFlags = [
"--with-ssl=${openssl.dev}"