From 0dbfbd466231c0b31184bb8739e731bd2e67a6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Mon, 17 Jan 2022 02:00:00 +0100 Subject: [PATCH] python39Packages.cairocffi: combine default.nix+generic.nix, add SuperSandro2000 as maintainer No longer required after removal of python 2 version --- .../python-modules/cairocffi/default.nix | 65 +++++++++++++++++-- .../python-modules/cairocffi/generic.nix | 63 ------------------ 2 files changed, 58 insertions(+), 70 deletions(-) delete mode 100644 pkgs/development/python-modules/cairocffi/generic.nix diff --git a/pkgs/development/python-modules/cairocffi/default.nix b/pkgs/development/python-modules/cairocffi/default.nix index 8e26517ba218..f216b8732a57 100644 --- a/pkgs/development/python-modules/cairocffi/default.nix +++ b/pkgs/development/python-modules/cairocffi/default.nix @@ -12,16 +12,67 @@ , cairo , cffi , numpy -, withXcffib ? false, xcffib +, withXcffib ? false +, xcffib , python , glib , gdk-pixbuf -}@args: +}: -import ./generic.nix ({ +buildPythonPackage rec { + pname = "cairocffi"; version = "1.2.0"; - sha256 = "sha256-mpebUAxkyBef7ChvM36P5kTsovLNBYYM4LYtJfIuoUA="; - dlopen_patch = ./dlopen-paths.patch; + disabled = pythonOlder "3.5"; - inherit withXcffib; -} // args) + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-mpebUAxkyBef7ChvM36P5kTsovLNBYYM4LYtJfIuoUA="; + }; + + LC_ALL = "en_US.UTF-8"; + + # checkPhase require at least one 'normal' font and one 'monospace', + # otherwise glyph tests fails + FONTCONFIG_FILE = makeFontsConf { + fontDirectories = [ freefont_ttf ]; + }; + + propagatedBuildInputs = [ cairo cffi ] ++ lib.optional withXcffib xcffib; + propagatedNativeBuildInputs = [ cffi ]; + + # pytestCheckHook does not work + checkInputs = [ numpy pytest glibcLocales ]; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace "pytest-runner" "" \ + --replace "pytest-cov" "" \ + --replace "pytest-flake8" "" \ + --replace "pytest-isort" "" \ + --replace "--flake8 --isort" "" + ''; + + checkPhase = '' + py.test $out/${python.sitePackages} + ''; + + patches = [ + # OSError: dlopen() failed to load a library: gdk-pixbuf-2.0 / gdk-pixbuf-2.0-0 + (substituteAll { + src = ./dlopen-paths.patch; + ext = stdenv.hostPlatform.extensions.sharedLibrary; + cairo = cairo.out; + glib = glib.out; + gdk_pixbuf = gdk-pixbuf.out; + }) + ./fix_test_scaled_font.patch + ]; + + meta = with lib; { + homepage = "https://github.com/SimonSapin/cairocffi"; + license = licenses.bsd3; + maintainers = with maintainers; [ SuperSandro2000 ]; + description = "cffi-based cairo bindings for Python"; + }; +} diff --git a/pkgs/development/python-modules/cairocffi/generic.nix b/pkgs/development/python-modules/cairocffi/generic.nix deleted file mode 100644 index 004cf8ae7841..000000000000 --- a/pkgs/development/python-modules/cairocffi/generic.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ version -, sha256 -, dlopen_patch -, disabled ? false -, ... -}@args: - -with args; - -buildPythonPackage rec { - pname = "cairocffi"; - inherit version disabled; - - src = fetchPypi { - inherit pname version sha256; - }; - - LC_ALL = "en_US.UTF-8"; - - # checkPhase require at least one 'normal' font and one 'monospace', - # otherwise glyph tests fails - FONTCONFIG_FILE = makeFontsConf { - fontDirectories = [ freefont_ttf ]; - }; - - propagatedBuildInputs = [ cairo cffi ] ++ lib.optional withXcffib xcffib; - propagatedNativeBuildInputs = [ cffi ]; - - # pytestCheckHook does not work - checkInputs = [ numpy pytest glibcLocales ]; - - postPatch = '' - substituteInPlace setup.cfg \ - --replace "pytest-runner" "" \ - --replace "pytest-cov" "" \ - --replace "pytest-flake8" "" \ - --replace "pytest-isort" "" \ - --replace "--flake8 --isort" "" - ''; - - checkPhase = '' - py.test $out/${python.sitePackages} - ''; - - patches = [ - # OSError: dlopen() failed to load a library: gdk-pixbuf-2.0 / gdk-pixbuf-2.0-0 - (substituteAll { - src = dlopen_patch; - ext = stdenv.hostPlatform.extensions.sharedLibrary; - cairo = cairo.out; - glib = glib.out; - gdk_pixbuf = gdk-pixbuf.out; - }) - ./fix_test_scaled_font.patch - ]; - - meta = with lib; { - homepage = "https://github.com/SimonSapin/cairocffi"; - license = licenses.bsd3; - maintainers = with maintainers; []; - description = "cffi-based cairo bindings for Python"; - }; -}