summary refs log tree commit diff
path: root/pkgs/development/python-modules/rainbowstream
diff options
context:
space:
mode:
authorCharles Strahan <charles.c.strahan@gmail.com>2015-07-12 17:46:44 -0400
committerVladimír Čunát <vcunat@gmail.com>2015-07-20 10:06:17 +0200
commit617c5fcaf012b3f8278c1bf8642c40396cf916fa (patch)
tree4f456b259053f3fd53c9d623b54c3847bfd181c6 /pkgs/development/python-modules/rainbowstream
parent1fee4ce381f2bb7eda196bb6a1725fe03824e788 (diff)
downloadnixlib-617c5fcaf012b3f8278c1bf8642c40396cf916fa.tar
nixlib-617c5fcaf012b3f8278c1bf8642c40396cf916fa.tar.gz
nixlib-617c5fcaf012b3f8278c1bf8642c40396cf916fa.tar.bz2
nixlib-617c5fcaf012b3f8278c1bf8642c40396cf916fa.tar.lz
nixlib-617c5fcaf012b3f8278c1bf8642c40396cf916fa.tar.xz
nixlib-617c5fcaf012b3f8278c1bf8642c40396cf916fa.tar.zst
nixlib-617c5fcaf012b3f8278c1bf8642c40396cf916fa.zip
rainbowstream: purify (close #8791)
This obviates the need for `cc` to be available at run time.
Diffstat (limited to 'pkgs/development/python-modules/rainbowstream')
-rw-r--r--pkgs/development/python-modules/rainbowstream/image.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/rainbowstream/image.patch b/pkgs/development/python-modules/rainbowstream/image.patch
new file mode 100644
index 000000000000..215152ae4fb1
--- /dev/null
+++ b/pkgs/development/python-modules/rainbowstream/image.patch
@@ -0,0 +1,18 @@
+diff --git a/rainbowstream/c_image.py b/rainbowstream/c_image.py
+index f050150..a0fb77d 100644
+--- a/rainbowstream/c_image.py
++++ b/rainbowstream/c_image.py
+@@ -12,11 +12,7 @@ def call_c():
+     """
+     Call the C program for converting RGB to Ansi colors
+     """
+-    library = expanduser('~/.image.so')
+-    sauce = join(dirname(__file__), 'image.c')
+-    if not exists(library) or getmtime(sauce) > getmtime(library):
+-        build = "cc -fPIC -shared -o %s %s" % (library, sauce)
+-        os.system(build + " >/dev/null 2>&1")
++    library = '@CLIB@'
+     image_c = ctypes.cdll.LoadLibrary(library)
+     image_c.init()
+     return image_c.rgb_to_ansi
+