Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b517554ea648
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 180c68d88a6f
Choose a head ref
  • 1 commit
  • 4 files changed
  • 1 contributor

Commits on Mar 19, 2019

  1. Copy the full SHA
    180c68d View commit details
26 changes: 26 additions & 0 deletions pkgs/development/python-modules/cairocffi/0_9.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# FIXME: make gdk_pixbuf dependency optional
{ stdenv
, buildPythonPackage
, pythonOlder
, fetchPypi
, lib
, substituteAll
, makeFontsConf
, freefont_ttf
, pytest
, pytestrunner
, glibcLocales
, cairo
, cffi
, withXcffib ? false, xcffib
, python
, glib
, gdk_pixbuf
}@args:

import ./generic.nix ({
version = "0.9.0";
sha256 = "15386c3a9e08823d6826c4491eaccc7b7254b1dc587a3b9ce60c350c3f990337";
dlopen_patch = ./dlopen-paths-0.9.patch;
inherit withXcffib;
} // args)
71 changes: 10 additions & 61 deletions pkgs/development/python-modules/cairocffi/default.nix
Original file line number Diff line number Diff line change
@@ -15,64 +15,13 @@
, withXcffib ? false, xcffib
, python
, glib
, gdk_pixbuf }:

let
generic = { version, sha256, dlopen_patch, disabled ? false }:
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 ];
};

checkInputs = [ pytest pytestrunner glibcLocales ];
propagatedBuildInputs = [ cairo cffi ] ++ lib.optional withXcffib xcffib;

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";
};
};
in
{
cairocffi_1_0 = generic {
version = "1.0.2";
sha256 = "01ac51ae12c4324ca5809ce270f9dd1b67f5166fe63bd3e497e9ea3ca91946ff";
dlopen_patch = ./dlopen-paths.patch;
disabled = pythonOlder "3.5";
};

cairocffi_0_9 = generic {
version = "0.9.0";
sha256 = "15386c3a9e08823d6826c4491eaccc7b7254b1dc587a3b9ce60c350c3f990337";
dlopen_patch = ./dlopen-paths-0.9.patch;
};
}
, gdk_pixbuf
}@args:

import ./generic.nix ({
version = "1.0.2";
sha256 = "01ac51ae12c4324ca5809ce270f9dd1b67f5166fe63bd3e497e9ea3ca91946ff";
dlopen_patch = ./dlopen-paths.patch;
disabled = pythonOlder "3.5";
inherit withXcffib;
} // args)
51 changes: 51 additions & 0 deletions pkgs/development/python-modules/cairocffi/generic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{ 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 ];
};

checkInputs = [ pytest pytestrunner glibcLocales ];
propagatedBuildInputs = [ cairo cffi ] ++ lib.optional withXcffib xcffib;

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";
};
}
7 changes: 4 additions & 3 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
@@ -1323,9 +1323,10 @@ in {
canmatrix = callPackage ../development/python-modules/canmatrix {};


cairocffi = let
inherit (callPackage ../development/python-modules/cairocffi {}) cairocffi_1_0 cairocffi_0_9;
in if isPy3k then cairocffi_1_0 else cairocffi_0_9;
cairocffi = if isPy3k then
callPackage ../development/python-modules/cairocffi {}
else
callPackage ../development/python-modules/cairocffi/0_9.nix {};

cairosvg = if isPy3k then
callPackage ../development/python-modules/cairosvg {}