git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #89439 from flokli/bpython-xclip

bpython: substituteAll the path to `which`

commit825721005a1d5a44a7b8aa076d69f6221147f52f authorFlorian Klink <flokli@flokli.de> dateTue 16 Jun 2020, 00:45 (6 years ago) parent550e47c7de3d93
2 files changed+43−1
pkgs/development/python-modules/bpython/clipboard-make-which-substitutable.patch+27 pkgs/development/python-modules/bpython/default.nix+16−1
pkgs/development/python-modules/bpython/clipboard-make-which-substitutable.patchnew file+27
@@ -0,0 +1,27 @@
1+From 6f544a5bd43446859754cb80e012af933b843db9 Mon Sep 17 00:00:00 2001
2+From: Florian Klink <flokli@flokli.de>
3+Date: Wed, 3 Jun 2020 22:05:34 +0200
4+Subject: [PATCH] clipboard: make which substitutable
5+
6+This is used to detect the presence of xclip and other clipboard
7+handling tools.
8+---
9+ bpython/clipboard.py | 2 +-
10+ 1 file changed, 1 insertion(+), 1 deletion(-)
11+
12+diff --git a/bpython/clipboard.py b/bpython/clipboard.py
13+index aee429b..f346429 100644
14+--- a/bpython/clipboard.py
15++++ b/bpython/clipboard.py
16+@@ -58,7 +58,7 @@ class OSXClipboard(object):
17+
18+ def command_exists(command):
19+ process = subprocess.Popen(
20+- ["which", command], stderr=subprocess.STDOUT, stdout=subprocess.PIPE
21++ ["@which@", command], stderr=subprocess.STDOUT, stdout=subprocess.PIPE
22+ )
23+ process.communicate()
24+
25+--
26+2.26.2
27+
pkgs/development/python-modules/bpython/default.nix+16−1
@@ -1,4 +1,14 @@
1−{ stdenv, buildPythonPackage, fetchPypi, pygments, greenlet, curtsies, urwid, requests, mock }:
1+{ stdenv
2+, buildPythonPackage
3+, fetchPypi
4+, curtsies
5+, greenlet
6+, mock
7+, pygments
8+, requests
9+, substituteAll
10+, urwid
11+, which }:
212
313buildPythonPackage rec {
414 pname = "bpython";
@@ -9,6 +19,11 @@ buildPythonPackage rec {
919 sha256 = "1764ikgj24jjq46s50apwkydqvy5a13adb2nbszk8kbci6df0v27";
1020 };
1121
22+ patches = [ (substituteAll {
23+ src = ./clipboard-make-which-substitutable.patch;
24+ which = "${which}/bin/which";
25+ })];
26+
1227 propagatedBuildInputs = [ curtsies greenlet pygments requests urwid ];
1328
1429 postInstall = ''