Merge pull request #117570 from FRidh/python2alias

Python: be explicit on whether it is python2 or python3 that is used
This commit is contained in:
Frederik Rietdijk
2021-03-25 13:26:35 +01:00
committed by GitHub
70 changed files with 260 additions and 170 deletions
@@ -1,10 +1,10 @@
{ stdenv, lib, fetchFromGitHub, makeWrapper
, curl, python, bind, iproute, bc, gitMinimal }:
, curl, python3, bind, iproute, bc, gitMinimal }:
let
version = "1.23.0";
deps = lib.makeBinPath [
curl
python
python3
bind.dnsutils
iproute
bc
@@ -24,11 +24,13 @@ stdenv.mkDerivation {
nativeBuildInputs = [ makeWrapper ];
patchPhase = ''
postPatch = ''
patchShebangs install.sh
substituteInPlace install.sh --replace /usr/local "$out"
'';
strictDeps = true;
dontBuild = true;
installPhase = ''
@@ -1,6 +1,6 @@
{ lib, fetchFromGitHub, pythonPackages, gettext }:
{ lib, fetchFromGitHub, python2Packages, gettext }:
pythonPackages.buildPythonApplication rec {
python2Packages.buildPythonApplication rec {
pname = "cherrytree";
version = "0.39.4";
@@ -14,7 +14,7 @@ pythonPackages.buildPythonApplication rec {
nativeBuildInputs = [ gettext ];
propagatedBuildInputs = with pythonPackages; [ pygtk dbus-python pygtksourceview ];
propagatedBuildInputs = with python2Packages; [ pygtk dbus-python pygtksourceview ];
patches = [ ./subprocess.patch ];
@@ -1,4 +1,4 @@
{ stdenv, runtimeShell, lib, fetchurl, python, pythonPackages, unzip }:
{ stdenv, runtimeShell, lib, fetchurl, python2Packages, unzip }:
# This package uses a precompiled "binary" distribution of CuraByDagoma,
# distributed by the editor.
@@ -13,7 +13,9 @@
# I guess people owning a 3D printer generally don't use i686.
# If, however, someone needs it, we certainly can find a solution.
stdenv.mkDerivation rec {
let
pythonPackages = python2Packages;
in stdenv.mkDerivation rec {
pname = "curabydagoma";
# Version is the date, UNIX format
version = "1520506579";
@@ -26,7 +28,7 @@ stdenv.mkDerivation rec {
};
unpackCmd = "unzip $curSrc && tar zxf CuraByDagoma_amd64.tar.gz";
nativeBuildInputs = [ unzip ];
buildInputs = [ python pythonPackages.pyopengl pythonPackages.wxPython pythonPackages.pyserial pythonPackages.numpy ];
buildInputs = [ pythonPackages.python pythonPackages.pyopengl pythonPackages.wxPython pythonPackages.pyserial pythonPackages.numpy ];
# Compile all pyc files because the included pyc files may be older than the
# py files. However, Python doesn't realize that because the packages
@@ -46,7 +48,7 @@ stdenv.mkDerivation rec {
cat > $out/bin/curabydago <<EOF
#!${runtimeShell}
export PYTHONPATH=$PYTHONPATH
${python.out}/bin/python $out/curabydago/cura.py
${pythonPackages.python.interpreter} $out/curabydago/cura.py
EOF
chmod a+x $out/bin/curabydago
+3 -3
View File
@@ -1,6 +1,6 @@
{ lib, fetchFromGitHub, pythonPackages, gnome2, keybinder }:
{ lib, fetchFromGitHub, python2Packages, gnome2, keybinder }:
pythonPackages.buildPythonApplication rec {
python2Packages.buildPythonApplication rec {
ver = "0.93";
name = "dockbarx-${ver}";
@@ -24,7 +24,7 @@ pythonPackages.buildPythonApplication rec {
substituteInPlace dockx_applets/volume-control.py --replace /usr/share/ $out/share/
'';
propagatedBuildInputs = (with pythonPackages; [ pygtk pyxdg dbus-python pillow xlib ])
propagatedBuildInputs = (with python2Packages; [ pygtk pyxdg dbus-python pillow xlib ])
++ (with gnome2; [ gnome_python gnome_python_desktop ])
++ [ keybinder ];
+5 -5
View File
@@ -1,10 +1,10 @@
{ lib, pythonPackages }:
{ lib, python3Packages }:
pythonPackages.buildPythonApplication rec {
python3Packages.buildPythonApplication rec {
pname = "dotfiles";
version = "0.6.4";
src = pythonPackages.fetchPypi {
src = python3Packages.fetchPypi {
inherit version pname;
sha256 = "03qis6m9r2qh00sqbgwsm883s4bj1ibwpgk86yh4l235mdw8jywv";
};
@@ -12,8 +12,8 @@ pythonPackages.buildPythonApplication rec {
# No tests in archive
doCheck = false;
checkInputs = with pythonPackages; [ pytest ];
propagatedBuildInputs = with pythonPackages; [ click ];
checkInputs = with python3Packages; [ pytest ];
propagatedBuildInputs = with python3Packages; [ click ];
meta = with lib; {
description = "Easily manage your dotfiles";
+4 -2
View File
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, python, pkg-config, cmake, bluez, libusb1, curl
{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, bluez, libusb1, curl
, libiconv, gettext, sqlite
, dbiSupport ? false, libdbi ? null, libdbiDrivers ? null
, postgresSupport ? false, postgresql ? null
@@ -21,7 +21,9 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config cmake ];
buildInputs = [ python bluez libusb1 curl gettext sqlite libiconv ]
strictDeps = true;
buildInputs = [ bluez libusb1 curl gettext sqlite libiconv ]
++ optionals dbiSupport [ libdbi libdbiDrivers ]
++ optionals postgresSupport [ postgresql ];