From 0950324466d7d978dadccf8dee58c89344d8326b Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Fri, 27 Mar 2020 14:47:48 +0100 Subject: [PATCH] scons: Add passthru.py2 for backward compatibility Not all packages build with Python 3, see #75877. The goal is to get rid of Python 2 but this approach ensures a smoother transition. --- pkgs/applications/audio/jackmix/default.nix | 3 +-- pkgs/applications/audio/mixxx/default.nix | 3 ++- pkgs/applications/audio/rhvoice/default.nix | 2 +- .../networking/instant-messengers/swift-im/default.nix | 2 +- pkgs/development/libraries/serf/default.nix | 2 +- pkgs/development/libraries/swiften/default.nix | 2 +- pkgs/development/tools/build-managers/scons/common.nix | 9 ++++++--- pkgs/development/tools/build-managers/scons/default.nix | 6 +++--- pkgs/development/tools/nsis/default.nix | 2 +- pkgs/games/pingus/default.nix | 4 ++-- pkgs/games/tdm/default.nix | 2 +- pkgs/games/vdrift/default.nix | 4 ++-- pkgs/misc/drivers/xboxdrv/default.nix | 4 ++-- pkgs/os-specific/linux/ffado/default.nix | 2 +- pkgs/servers/gpsd/default.nix | 2 +- pkgs/servers/nosql/mongodb/default.nix | 2 +- pkgs/tools/misc/gringo/default.nix | 2 +- 17 files changed, 28 insertions(+), 25 deletions(-) diff --git a/pkgs/applications/audio/jackmix/default.nix b/pkgs/applications/audio/jackmix/default.nix index fe7c83dd56f1..5df6e1e2daea 100644 --- a/pkgs/applications/audio/jackmix/default.nix +++ b/pkgs/applications/audio/jackmix/default.nix @@ -9,9 +9,8 @@ stdenv.mkDerivation { patches = [ ./no_error.patch ]; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ scons.py2 pkgconfig ]; buildInputs = [ - scons qt4 lash jack diff --git a/pkgs/applications/audio/mixxx/default.nix b/pkgs/applications/audio/mixxx/default.nix index 82db91dcb077..950469e9a334 100644 --- a/pkgs/applications/audio/mixxx/default.nix +++ b/pkgs/applications/audio/mixxx/default.nix @@ -17,10 +17,11 @@ mkDerivation rec { sha256 = "1h7q25fv62c5m74d4cn1m6mpanmqpbl2wqbch4qvn488jb2jw1dv"; }; + nativeBuildInputs = [ scons.py2 ]; buildInputs = [ chromaprint fftw flac faad2 glibcLocales mp4v2 libid3tag libmad libopus libshout libsndfile libusb1 libvorbis libxcb libGLU lilv lv2 opusfile pkgconfig portaudio portmidi protobuf qtbase qtscript qtsvg - qtx11extras rubberband scons sqlite taglib upower vampSDK + qtx11extras rubberband sqlite taglib upower vampSDK ]; enableParallelBuilding = true; diff --git a/pkgs/applications/audio/rhvoice/default.nix b/pkgs/applications/audio/rhvoice/default.nix index e3eb750496ba..59a8b6ec8c49 100644 --- a/pkgs/applications/audio/rhvoice/default.nix +++ b/pkgs/applications/audio/rhvoice/default.nix @@ -15,7 +15,7 @@ in stdenv.mkDerivation { }; nativeBuildInputs = [ - scons pkgconfig + scons.py2 pkgconfig ]; buildInputs = [ diff --git a/pkgs/applications/networking/instant-messengers/swift-im/default.nix b/pkgs/applications/networking/instant-messengers/swift-im/default.nix index d47b7d00af92..0f1a7478a187 100644 --- a/pkgs/applications/networking/instant-messengers/swift-im/default.nix +++ b/pkgs/applications/networking/instant-messengers/swift-im/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { patches = [ ./qt-5.11.patch ./scons.patch ]; - nativeBuildInputs = [ pkgconfig qttools scons ]; + nativeBuildInputs = [ pkgconfig qttools scons.py2 ]; buildInputs = [ GConf avahi boost hunspell libXScrnSaver libedit libidn libnatpmp libxml2 diff --git a/pkgs/development/libraries/serf/default.nix b/pkgs/development/libraries/serf/default.nix index 3fd47125bcb3..2742ba1577b3 100644 --- a/pkgs/development/libraries/serf/default.nix +++ b/pkgs/development/libraries/serf/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "1k47gbgpp52049andr28y28nbwh9m36bbb0g8p0aka3pqlhjv72l"; }; - nativeBuildInputs = [ pkgconfig scons ]; + nativeBuildInputs = [ pkgconfig scons.py2 ]; buildInputs = [ apr openssl aprutil zlib libiconv ] ++ stdenv.lib.optional (!stdenv.isCygwin) kerberos; diff --git a/pkgs/development/libraries/swiften/default.nix b/pkgs/development/libraries/swiften/default.nix index c8c60c1f8ea6..f4dcc43a8740 100644 --- a/pkgs/development/libraries/swiften/default.nix +++ b/pkgs/development/libraries/swiften/default.nix @@ -3,7 +3,7 @@ stdenv.mkDerivation rec { pname = "swiften"; version = "4.0.2"; - nativeBuildInputs = [ scons]; + nativeBuildInputs = [ scons.py2 ]; buildInputs = [ python ]; propagatedBuildInputs = [ openssl boost ]; diff --git a/pkgs/development/tools/build-managers/scons/common.nix b/pkgs/development/tools/build-managers/scons/common.nix index 340364025a81..41ac16bed7a1 100644 --- a/pkgs/development/tools/build-managers/scons/common.nix +++ b/pkgs/development/tools/build-managers/scons/common.nix @@ -1,6 +1,6 @@ { version, sha256 }: -{ stdenv, fetchurl, python3Packages }: +{ stdenv, fetchurl, python3Packages, python2Packages, scons }: python3Packages.buildPythonApplication rec { pname = "scons"; @@ -13,10 +13,10 @@ python3Packages.buildPythonApplication rec { setupHook = ./setup-hook.sh; + passthru.py2 = scons.override { python3Packages = python2Packages; }; + meta = with stdenv.lib; { - homepage = http://scons.org/; description = "An improved, cross-platform substitute for Make"; - license = licenses.mit; longDescription = '' SCons is an Open Source software construction tool. Think of SCons as an improved, cross-platform substitute for the classic @@ -25,6 +25,9 @@ python3Packages.buildPythonApplication rec { SCons is an easier, more reliable and faster way to build software. ''; + homepage = "https://scons.org/"; + changelog = "https://raw.githubusercontent.com/SConsProject/scons/rel_${version}/src/CHANGES.txt"; + license = licenses.mit; platforms = platforms.all; maintainers = [ maintainers.primeos ]; }; diff --git a/pkgs/development/tools/build-managers/scons/default.nix b/pkgs/development/tools/build-managers/scons/default.nix index 0afe2fbe9281..19b092b86bab 100644 --- a/pkgs/development/tools/build-managers/scons/default.nix +++ b/pkgs/development/tools/build-managers/scons/default.nix @@ -1,12 +1,12 @@ -{ callPackage }: +{ callPackage, python2Packages }: let mkScons = args: callPackage (import ./common.nix args) { }; in { - scons_3_0_1 = mkScons { + scons_3_0_1 = (mkScons { version = "3.0.1"; sha256 = "0wzid419mlwqw9llrg8gsx4nkzhqy16m4m40r0xnh6cwscw5wir4"; - }; + }).override { python3Packages = python2Packages; }; scons_latest = mkScons { version = "3.1.2"; sha256 = "1yzq2gg9zwz9rvfn42v5jzl3g4qf1khhny6zfbi2hib55zvg60bq"; diff --git a/pkgs/development/tools/nsis/default.nix b/pkgs/development/tools/nsis/default.nix index 683d07ed4964..ea6203e57c31 100644 --- a/pkgs/development/tools/nsis/default.nix +++ b/pkgs/development/tools/nsis/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { chmod -R u+w $out/share/nsis ''; - nativeBuildInputs = [ scons ]; + nativeBuildInputs = [ scons.py2 ]; buildInputs = [ zlib ]; sconsFlags = [ diff --git a/pkgs/games/pingus/default.nix b/pkgs/games/pingus/default.nix index 628493a34b1b..d37e91a82022 100644 --- a/pkgs/games/pingus/default.nix +++ b/pkgs/games/pingus/default.nix @@ -13,8 +13,8 @@ let in stdenv.mkDerivation { inherit (s) name version; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [scons SDL SDL_image boost libpng SDL_mixer libGLU libGL]; + nativeBuildInputs = [ scons.py2 pkgconfig ]; + buildInputs = [ SDL SDL_image boost libpng SDL_mixer libGLU libGL]; src = fetchurl { inherit (s) url sha256; }; diff --git a/pkgs/games/tdm/default.nix b/pkgs/games/tdm/default.nix index 294d4703bb05..32f91f598684 100644 --- a/pkgs/games/tdm/default.nix +++ b/pkgs/games/tdm/default.nix @@ -24,7 +24,7 @@ in stdenv.mkDerivation { sha256 = "17wdpip8zvm2njz0xrf7xcxl73hnsc6i83zj18kn8rnjkpy50dd6"; }; nativeBuildInputs = [ - p7zip scons gnum4 makeWrapper + p7zip scons.py2 gnum4 makeWrapper ]; buildInputs = [ glibc_multi mesa.dev xorg.libX11.dev openal diff --git a/pkgs/games/vdrift/default.nix b/pkgs/games/vdrift/default.nix index 3002216b9d4b..3685d24c972c 100644 --- a/pkgs/games/vdrift/default.nix +++ b/pkgs/games/vdrift/default.nix @@ -20,8 +20,8 @@ let sha256 = "001wq3c4n9wzxqfpq40b1jcl16sxbqv2zbkpy9rq2wf9h417q6hg"; }; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ scons libGLU libGL SDL2 SDL2_image libvorbis bullet curl gettext ]; + nativeBuildInputs = [ pkgconfig scons.py2 ]; + buildInputs = [ libGLU libGL SDL2 SDL2_image libvorbis bullet curl gettext ]; patches = [ ./0001-Ignore-missing-data-for-installation.patch ]; diff --git a/pkgs/misc/drivers/xboxdrv/default.nix b/pkgs/misc/drivers/xboxdrv/default.nix index e2f2bcc2f24b..8b51060acd02 100644 --- a/pkgs/misc/drivers/xboxdrv/default.nix +++ b/pkgs/misc/drivers/xboxdrv/default.nix @@ -13,8 +13,8 @@ in stdenv.mkDerivation { }; makeFlags = [ "PREFIX=$(out)" ]; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ scons libX11 libusb1 boost glib dbus-glib ]; + nativeBuildInputs = [ pkgconfig scons.py2 ]; + buildInputs = [ libX11 libusb1 boost glib dbus-glib ]; dontUseSconsInstall = true; meta = with stdenv.lib; { diff --git a/pkgs/os-specific/linux/ffado/default.nix b/pkgs/os-specific/linux/ffado/default.nix index 3d2c6ae6dae2..6f858b405ed2 100644 --- a/pkgs/os-specific/linux/ffado/default.nix +++ b/pkgs/os-specific/linux/ffado/default.nix @@ -23,7 +23,7 @@ in stdenv.mkDerivation rec { outputs = [ "out" "bin" "dev" ]; - nativeBuildInputs = [ scons pkgconfig which makeWrapper python pyqt5 ]; + nativeBuildInputs = [ scons.py2 pkgconfig which makeWrapper python pyqt5 ]; prefixKey = "PREFIX="; sconsFlags = [ diff --git a/pkgs/servers/gpsd/default.nix b/pkgs/servers/gpsd/default.nix index 8ea060a82552..e5dcb3e28e45 100644 --- a/pkgs/servers/gpsd/default.nix +++ b/pkgs/servers/gpsd/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ - scons pkgconfig docbook_xml_dtd_412 docbook_xsl xmlto bc + scons.py2 pkgconfig docbook_xml_dtd_412 docbook_xsl xmlto bc python2Packages.python python2Packages.wrapPython ]; diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix index c2ae83f3e8af..d8e6e00074be 100644 --- a/pkgs/servers/nosql/mongodb/default.nix +++ b/pkgs/servers/nosql/mongodb/default.nix @@ -29,7 +29,7 @@ in stdenv.mkDerivation { sha256 = "1wz2mhl9z0b1bdkg6m8v8mvw9k60mdv5ybq554xn3yjj9z500f24"; }; - nativeBuildInputs = [ scons ]; + nativeBuildInputs = [ scons.py2 ]; buildInputs = [ sasl boost gperftools pcre-cpp snappy zlib libyamlcpp sasl openssl.dev openssl.out libpcap diff --git a/pkgs/tools/misc/gringo/default.nix b/pkgs/tools/misc/gringo/default.nix index 705c1a7e1d6a..2d1284d66529 100644 --- a/pkgs/tools/misc/gringo/default.nix +++ b/pkgs/tools/misc/gringo/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation { sha256 = "16k4pkwyr2mh5w8j91vhxh9aff7f4y31npwf09w6f8q63fxvpy41"; }; - buildInputs = [ bison re2c scons ]; + buildInputs = [ bison re2c scons.py2 ]; patches = [ ./gringo-4.5.4-cmath.patch