uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,80 @@
{ lib
, arrow
, buildPythonPackage
, fetchFromGitHub
, freetype
, glibcLocales
, libjpeg
, pillow
, pocket
, pyfiglet
, pysocks
, python
, python-dateutil
, requests
, twitter
, zlib
}:
buildPythonPackage rec {
pname = "rainbowstream";
version = "1.5.5";
src = fetchFromGitHub {
owner = "orakaro";
repo = pname;
# Request for tagging, https://github.com/orakaro/rainbowstream/issues/314
rev = "96141fac10675e0775d703f65a59c4477a48c57e";
sha256 = "0j0qcc428lk9b3l0cr2j418gd6wd5k4160ham2zn2mmdmxn5bldg";
};
buildInputs = [
freetype
glibcLocales
libjpeg
zlib
];
propagatedBuildInputs = [
arrow
pillow
pocket
pyfiglet
pysocks
python-dateutil
requests
twitter
];
patches = [ ./image.patch ];
postPatch = ''
clib=$out/${python.sitePackages}/rainbowstream/image.so
substituteInPlace rainbowstream/c_image.py \
--replace @CLIB@ $clib
sed -i 's/requests.*"/requests"/' setup.py
'';
LC_ALL = "en_US.UTF-8";
postInstall = ''
mkdir -p $out/lib
cc -fPIC -shared -o $clib rainbowstream/image.c
for prog in "$out/bin/"*; do
wrapProgram "$prog" \
--prefix PYTHONPATH : "$PYTHONPATH"
done
'';
# Project has no tests
doCheck = false;
pythonImportsCheck = [ "rainbowstream" ];
meta = with lib; {
description = "Streaming command-line twitter client";
homepage = "https://github.com/orakaro/rainbowstream";
license = licenses.mit;
maintainers = with maintainers; [ thoughtpolice ];
};
}

View file

@ -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