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:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
127
pkgs/development/python-modules/pysdl2/PySDL2-dll.patch
Normal file
127
pkgs/development/python-modules/pysdl2/PySDL2-dll.patch
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
diff --git a/sdl2/dll.py b/sdl2/dll.py
|
||||
index 6e30259..12e1f7d 100644
|
||||
--- a/sdl2/dll.py
|
||||
+++ b/sdl2/dll.py
|
||||
@@ -145,7 +145,7 @@ class DLL(object):
|
||||
"""Function wrapper around the different DLL functions. Do not use or
|
||||
instantiate this one directly from your user code.
|
||||
"""
|
||||
- def __init__(self, libinfo, libnames, path=None):
|
||||
+ def __init__(self, libinfo, libfile):
|
||||
self._dll = None
|
||||
self._deps = None
|
||||
self._libname = libinfo
|
||||
@@ -157,11 +157,12 @@ class DLL(object):
|
||||
"SDL2_image": 2001,
|
||||
"SDL2_gfx": 1003
|
||||
}
|
||||
- foundlibs = _findlib(libnames, path)
|
||||
- dllmsg = "PYSDL2_DLL_PATH: %s" % (os.getenv("PYSDL2_DLL_PATH") or "unset")
|
||||
- if len(foundlibs) == 0:
|
||||
- raise RuntimeError("could not find any library for %s (%s)" %
|
||||
- (libinfo, dllmsg))
|
||||
+ #foundlibs = _findlib(libnames, path)
|
||||
+ #dllmsg = "PYSDL2_DLL_PATH: %s" % (os.getenv("PYSDL2_DLL_PATH") or "unset")
|
||||
+ #if len(foundlibs) == 0:
|
||||
+ # raise RuntimeError("could not find any library for %s (%s)" %
|
||||
+ # (libinfo, dllmsg))
|
||||
+ foundlibs = [ libfile ]
|
||||
for libfile in foundlibs:
|
||||
try:
|
||||
self._dll = CDLL(libfile)
|
||||
@@ -185,19 +186,19 @@ class DLL(object):
|
||||
(foundlibs, libinfo))
|
||||
if _using_ms_store_python():
|
||||
self._deps = _preload_deps(libinfo, self._libfile)
|
||||
- if path is not None and sys.platform in ("win32",) and \
|
||||
- path in self._libfile:
|
||||
- os.environ["PATH"] = "%s;%s" % (path, os.environ["PATH"])
|
||||
+ #if path is not None and sys.platform in ("win32",) and \
|
||||
+ # path in self._libfile:
|
||||
+ # os.environ["PATH"] = "%s;%s" % (path, os.environ["PATH"])
|
||||
|
||||
def bind_function(self, funcname, args=None, returns=None, added=None):
|
||||
"""Binds the passed argument and return value types to the specified
|
||||
function. If the version of the loaded library is older than the
|
||||
version where the function was added, an informative exception will
|
||||
be raised if the bound function is called.
|
||||
|
||||
Args:
|
||||
funcname (str): The name of the function to bind.
|
||||
args (List or None, optional): The data types of the C function's
|
||||
arguments. Should be 'None' if function takes no arguments.
|
||||
returns (optional): The return type of the bound C function. Should
|
||||
be 'None' if function returns 'void'.
|
||||
@@ -288,7 +289,7 @@ def nullfunc(*args):
|
||||
return
|
||||
|
||||
try:
|
||||
- dll = DLL("SDL2", ["SDL2", "SDL2-2.0", "SDL2-2.0.0"], os.getenv("PYSDL2_DLL_PATH"))
|
||||
+ dll = DLL("SDL2", "@sdl2@")
|
||||
except RuntimeError as exc:
|
||||
raise ImportError(exc)
|
||||
|
||||
diff --git a/sdl2/sdlgfx.py b/sdl2/sdlgfx.py
|
||||
index 090752e..a8a7488 100644
|
||||
--- a/sdl2/sdlgfx.py
|
||||
+++ b/sdl2/sdlgfx.py
|
||||
@@ -50,8 +50,7 @@ __all__ = [
|
||||
|
||||
|
||||
try:
|
||||
- dll = DLL("SDL2_gfx", ["SDL2_gfx", "SDL2_gfx-1.0"],
|
||||
- os.getenv("PYSDL2_DLL_PATH"))
|
||||
+ dll = DLL("SDL2_gfx", "@sdl2_gfx@")
|
||||
except RuntimeError as exc:
|
||||
raise ImportError(exc)
|
||||
|
||||
diff --git a/sdl2/sdlimage.py b/sdl2/sdlimage.py
|
||||
index a6884e8..95d96df 100644
|
||||
--- a/sdl2/sdlimage.py
|
||||
+++ b/sdl2/sdlimage.py
|
||||
@@ -32,15 +32,14 @@ __all__ = [
|
||||
"IMG_LoadXCF_RW", "IMG_LoadWEBP_RW", "IMG_LoadXPM_RW",
|
||||
"IMG_LoadXV_RW", "IMG_ReadXPMFromArray",
|
||||
"IMG_GetError", "IMG_SetError", "IMG_SaveJPG", "IMG_SaveJPG_RW",
|
||||
-
|
||||
+
|
||||
# Python Functions
|
||||
"get_dll_file"
|
||||
]
|
||||
|
||||
|
||||
try:
|
||||
- dll = DLL("SDL2_image", ["SDL2_image", "SDL2_image-2.0"],
|
||||
- os.getenv("PYSDL2_DLL_PATH"))
|
||||
+ dll = DLL("SDL2_image", "@sdl2_image@")
|
||||
except RuntimeError as exc:
|
||||
raise ImportError(exc)
|
||||
|
||||
diff --git a/sdl2/sdlmixer.py b/sdl2/sdlmixer.py
|
||||
index 9ad9b85..1c36289 100644
|
||||
--- a/sdl2/sdlmixer.py
|
||||
+++ b/sdl2/sdlmixer.py
|
||||
@@ -76,8 +76,7 @@ __all__ = [
|
||||
]
|
||||
|
||||
try:
|
||||
- dll = DLL("SDL2_mixer", ["SDL2_mixer", "SDL2_mixer-2.0"],
|
||||
- os.getenv("PYSDL2_DLL_PATH"))
|
||||
+ dll = DLL("SDL2_mixer", "@sdl2_mixer@")
|
||||
except RuntimeError as exc:
|
||||
raise ImportError(exc)
|
||||
|
||||
diff --git a/sdl2/sdlttf.py b/sdl2/sdlttf.py
|
||||
index 9c2d951..bd5a16a 100644
|
||||
--- a/sdl2/sdlttf.py
|
||||
+++ b/sdl2/sdlttf.py
|
||||
@@ -54,8 +54,7 @@ __all__ = [
|
||||
|
||||
|
||||
try:
|
||||
- dll = DLL("SDL2_ttf", ["SDL2_ttf", "SDL2_ttf-2.0"],
|
||||
- os.getenv("PYSDL2_DLL_PATH"))
|
||||
+ dll = DLL("SDL2_ttf", "@sdl2_ttf@")
|
||||
except RuntimeError as exc:
|
||||
raise ImportError(exc)
|
||||
|
||||
40
pkgs/development/python-modules/pysdl2/default.nix
Normal file
40
pkgs/development/python-modules/pysdl2/default.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ stdenv, lib, substituteAll, fetchPypi, buildPythonPackage, SDL2, SDL2_ttf, SDL2_image, SDL2_gfx, SDL2_mixer }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "PySDL2";
|
||||
version = "0.9.11";
|
||||
# The tests use OpenGL using find_library, which would have to be
|
||||
# patched; also they seem to actually open X windows and test stuff
|
||||
# like "screensaver disabling", which would have to be cleverly
|
||||
# sandboxed. Disable for now.
|
||||
doCheck = false;
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "93e51057d39fd583b80001d42b21d5a3f71e30d489d85924d944b2c7350e2da6";
|
||||
};
|
||||
|
||||
# Deliberately not in propagated build inputs; users can decide
|
||||
# which library they want to include.
|
||||
buildInputs = [ SDL2_ttf SDL2_image SDL2_gfx SDL2_mixer ];
|
||||
propagatedBuildInputs = [ SDL2 ];
|
||||
patches = [
|
||||
(substituteAll ({
|
||||
src = ./PySDL2-dll.patch;
|
||||
} // builtins.mapAttrs (_: pkg: "${pkg}/lib/lib${pkg.pname}${stdenv.hostPlatform.extensions.sharedLibrary}") {
|
||||
# substituteAll keys must start lowercase
|
||||
sdl2 = SDL2;
|
||||
sdl2_ttf = SDL2_ttf;
|
||||
sdl2_image = SDL2_image;
|
||||
sdl2_gfx = SDL2_gfx;
|
||||
sdl2_mixer = SDL2_mixer;
|
||||
}))
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "A wrapper around the SDL2 library and as such similar to the discontinued PySDL project";
|
||||
homepage = "https://github.com/marcusva/py-sdl2";
|
||||
license = lib.licenses.publicDomain;
|
||||
maintainers = with lib.maintainers; [ pmiddend ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue