Skip to content

Commit

Permalink
Python: drop python.majorVersion
Browse files Browse the repository at this point in the history
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
  • Loading branch information
FRidh committed Jan 4, 2019
1 parent f665828 commit 0a2caa4
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pkgs/applications/audio/ingen/default.nix
Expand Up @@ -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
'';

Expand Down
10 changes: 5 additions & 5 deletions pkgs/applications/misc/blender/default.nix
Expand Up @@ -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"
]
Expand All @@ -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.
Expand All @@ -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; {
Expand Down
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/science/misc/golly/beta.nix
Expand Up @@ -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";
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions pkgs/applications/science/misc/golly/default.nix
@@ -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";
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions pkgs/development/interpreters/python/default.nix
Expand Up @@ -39,8 +39,6 @@ with pkgs;
pythonAtLeast = lib.versionAtLeast pythonVersion;
pythonOlder = lib.versionOlder pythonVersion;
inherit pythonForBuild;

majorVersion = pythonVersion; # Backwards compatibility. Should be dropped.
};

in {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/physics/geant4/g4py/default.nix
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/python-modules/tensorflow/bin.nix
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/tools/misc/calamares/default.nix
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions pkgs/tools/networking/unbound/python.nix
Expand Up @@ -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}"
Expand All @@ -46,13 +46,13 @@ in stdenv.mkDerivation rec {

# All we want is the Unbound Python module
postInstall = ''
# Generate the built in root anchor and root key and store these in a logical place
# Generate the built in root anchor and root key and store these in a logical place
# to be used by tools depending only on the Python module
$out/bin/unbound-anchor -l | head -1 > $out/etc/${pname}/root.anchor
$out/bin/unbound-anchor -l | tail --lines=+2 - > $out/etc/${pname}/root.key
# We don't need anything else
rm -fR $out/bin $out/share $out/include $out/etc/unbound
patchelf --replace-needed libunbound.so.2 $out/${python.sitePackages}/libunbound.so.2 $out/${python.sitePackages}/_unbound.so
patchelf --replace-needed libunbound.so.2 $out/${python.sitePackages}/libunbound.so.2 $out/${python.sitePackages}/_unbound.so
'';

meta = with stdenv.lib; {
Expand Down

0 comments on commit 0a2caa4

Please sign in to comment.