python3Packages.kivy: Small improvements

- Get guaranteed-correct output of mtdev with library file via lib.getLib
- Move all environment variables into env attrset
- Drop meta-wide "with lib"

OPNA2608 7e34e7d6 d8380109

Changed files
+22 -18
pkgs
development
python-modules
+22 -18
pkgs/development/python-modules/kivy/default.nix
···
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace kivy/lib/mtdev.py \
-
--replace-fail "LoadLibrary('libmtdev.so.1')" "LoadLibrary('${mtdev}/lib/libmtdev.so.1')"
+
--replace-fail "LoadLibrary('libmtdev.so.1')" "LoadLibrary('${lib.getLib mtdev}/lib/libmtdev.so.1')"
'';
build-system = [
···
filetype
];
-
KIVY_NO_CONFIG = 1;
-
KIVY_NO_ARGS = 1;
-
KIVY_NO_FILELOG = 1;
-
# prefer pkg-config over hardcoded framework paths
-
USE_OSX_FRAMEWORKS = 0;
-
# work around python distutils compiling C++ with $CC (see issue #26709)
-
env.NIX_CFLAGS_COMPILE = toString (
-
lib.optionals stdenv.cc.isGNU [
-
"-Wno-error=incompatible-pointer-types"
-
]
-
++ lib.optionals stdenv.hostPlatform.isDarwin [
-
"-I${lib.getInclude stdenv.cc.libcxx}/include/c++/v1"
-
]
-
);
+
env = {
+
KIVY_NO_CONFIG = 1;
+
KIVY_NO_ARGS = 1;
+
KIVY_NO_FILELOG = 1;
+
+
# prefer pkg-config over hardcoded framework paths
+
USE_OSX_FRAMEWORKS = 0;
+
+
# work around python distutils compiling C++ with $CC (see issue #26709)
+
NIX_CFLAGS_COMPILE = toString (
+
lib.optionals stdenv.cc.isGNU [
+
"-Wno-error=incompatible-pointer-types"
+
]
+
++ lib.optionals stdenv.hostPlatform.isDarwin [
+
"-I${lib.getInclude stdenv.cc.libcxx}/include/c++/v1"
+
]
+
);
+
};
/*
We cannot run tests as Kivy tries to import itself before being fully
···
doCheck = false;
pythonImportsCheck = [ "kivy" ];
-
meta = with lib; {
+
meta = {
changelog = "https://github.com/kivy/kivy/releases/tag/${src.tag}";
description = "Library for rapid development of hardware-accelerated multitouch applications";
homepage = "https://github.com/kivy/kivy";
-
license = licenses.mit;
-
maintainers = with maintainers; [ risson ];
+
license = lib.licenses.mit;
+
maintainers = with lib.maintainers; [ risson ];
};
}