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: e933c7875b7f
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b8f0c1836913
Choose a head ref
  • 5 commits
  • 8 files changed
  • 4 contributors

Commits on Mar 13, 2019

  1. python3Packages.qasm2image: require Python 3.5 at least

    According to `setup.py` in 0.8 older Python wouldn't work.
    Ma27 authored and Robert Schütz committed Mar 13, 2019
    Copy the full SHA
    16c2c6b View commit details
  2. pythonPackages.thumbor: 6.6.0 -> 6.7.0

    This patch ensures that the currently broken `thumbor`[1] package builds
    and works again.
    
    The following problems were fixed:
    
    * Rather than placing required packages (like `gifsicle` or `exiftool`)
      into the build input list, we reference them explicitly where needed
      to ensure that the package works after the build without further
      installs.
    
    * Skip the `test_redeye_applied` test case which is broken for a while
      now.
    
    [1] https://hydra.nixos.org/build/90290998
    Ma27 authored and Robert Schütz committed Mar 13, 2019
    Copy the full SHA
    8dac864 View commit details
  3. pythonPackages.cairocffi: support 1.0 and 0.9

    This patch ensures that Python2 can be used if cairocffi is used.
    Version 1.0 dropped Python 2 support.
    avnik authored and Robert Schütz committed Mar 13, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e878fd6 View commit details
  4. python3.pkgs.cairosvg: 2.2.1 -> 2.3.0

    Robert Schütz committed Mar 13, 2019
    Copy the full SHA
    01cb9b0 View commit details
  5. Merge pull request #56839 from avnik/fix/cairocffi

    Fix cairocffi build
    dotlambda authored Mar 13, 2019
    Copy the full SHA
    b8f0c18 View commit details
104 changes: 61 additions & 43 deletions pkgs/development/python-modules/cairocffi/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# FIXME: make gdk_pixbuf dependency optional
{ stdenv
, buildPythonPackage
, pythonOlder
, fetchPypi
, lib
, substituteAll
, makeFontsConf
, freefont_ttf
, pytest
, pytestrunner
, glibcLocales
, cairo
, cffi
@@ -15,46 +17,62 @@
, glib
, gdk_pixbuf }:

buildPythonPackage rec {
pname = "cairocffi";
version = "1.0.2";

src = fetchPypi {
inherit pname version;
sha256 = "01ac51ae12c4324ca5809ce270f9dd1b67f5166fe63bd3e497e9ea3ca91946ff";
};

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 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-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; [];
description = "cffi-based cairo bindings for Python";
};
}
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;
};
}
47 changes: 47 additions & 0 deletions pkgs/development/python-modules/cairocffi/dlopen-paths-0.9.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
commit 705dc9a55bd160625d9996e63fc7dc532d0ad0ab
Author: Alexander V. Nikolaev <avn@avnik.info>
Date: Sat Feb 6 08:09:06 2016 +0200

Patch dlopen() to allow direct paths to all required libs

This patch is NixOS specific

diff --git a/cairocffi/__init__.py b/cairocffi/__init__.py
index 718aa7f..1a1dcff 100644
--- a/cairocffi/__init__.py
+++ b/cairocffi/__init__.py
@@ -27,20 +27,22 @@ VERSION = '0.7.2'
version = '1.10.0'
version_info = (1, 10, 0)

+# Use hardcoded soname, because ctypes.util use gcc/objdump which shouldn't be required for runtime
+_LIBS = {
+ 'cairo': '@cairo@/lib/libcairo@ext@',
+ 'glib-2.0': '@glib@/lib/libglib-2.0@ext@',
+ 'gobject-2.0': '@glib@/lib/libgobject-2.0@ext@',
+ 'gdk_pixbuf-2.0': '@gdk_pixbuf@/lib/libgdk_pixbuf-2.0@ext@',
+}

-def dlopen(ffi, *names):
+def dlopen(ffi, name, *names):
"""Try various names for the same library, for different platforms."""
- for name in names:
- for lib_name in [name, 'lib' + name]:
- try:
- path = ctypes.util.find_library(lib_name)
- if path:
- lib = ffi.dlopen(path)
- if lib:
- return lib
- except OSError:
- pass
- raise OSError("dlopen() failed to load a library: %s" % ' / '.join(names))
+ path = _LIBS.get(name, None)
+ if path:
+ lib = ffi.dlopen(path)
+ if lib:
+ return lib
+ raise OSError("dlopen() failed to load a library: %s as %s" % (name, path))


cairo = dlopen(ffi, 'cairo', 'cairo-2')
21 changes: 10 additions & 11 deletions pkgs/development/python-modules/cairocffi/dlopen-paths.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
commit 705dc9a55bd160625d9996e63fc7dc532d0ad0ab
commit 0435bc2577d4b18f54b78b2f5185abb2b2005982
Author: Alexander V. Nikolaev <avn@avnik.info>
Date: Sat Feb 6 08:09:06 2016 +0200

@@ -7,12 +7,12 @@ Date: Sat Feb 6 08:09:06 2016 +0200
This patch is NixOS specific

diff --git a/cairocffi/__init__.py b/cairocffi/__init__.py
index 718aa7f..1a1dcff 100644
index 6061973..3538a58 100644
--- a/cairocffi/__init__.py
+++ b/cairocffi/__init__.py
@@ -27,20 +27,22 @@ VERSION = '0.7.2'
version = '1.10.0'
version_info = (1, 10, 0)
@@ -21,19 +21,22 @@ VERSION = __version__ = (Path(__file__).parent / 'VERSION').read_text().strip()
version = '1.16.0'
version_info = (1, 16, 0)

+# Use hardcoded soname, because ctypes.util use gcc/objdump which shouldn't be required for runtime
+_LIBS = {
@@ -26,13 +26,12 @@ index 718aa7f..1a1dcff 100644
+def dlopen(ffi, name, *names):
"""Try various names for the same library, for different platforms."""
- for name in names:
- for lib_name in [name, 'lib' + name]:
- for lib_name in (name, 'lib' + name):
- try:
- path = ctypes.util.find_library(lib_name)
- if path:
- lib = ffi.dlopen(path)
- if lib:
- return lib
- lib = ffi.dlopen(path or lib_name)
- if lib:
- return lib
- except OSError:
- pass
- raise OSError("dlopen() failed to load a library: %s" % ' / '.join(names))
@@ -44,4 +43,4 @@ index 718aa7f..1a1dcff 100644
+ raise OSError("dlopen() failed to load a library: %s as %s" % (name, path))


cairo = dlopen(ffi, 'cairo', 'cairo-2')
cairo = dlopen(ffi, 'cairo', 'cairo-2', 'cairo-gobject-2', 'cairo.so.2')
18 changes: 4 additions & 14 deletions pkgs/development/python-modules/cairosvg/default.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,21 @@
{ stdenv, buildPythonPackage, fetchPypi, isPy3k, fetchpatch
, cairocffi, cssselect2, defusedxml, pillow, tinycss2
, pytestrunner, pytestcov, pytest-flake8, pytest-isort }:
, pytest, pytestrunner, pytestcov, pytest-flake8, pytest-isort }:

buildPythonPackage rec {
pname = "CairoSVG";
version = "2.2.1";
version = "2.3.0";

disabled = !isPy3k;

src = fetchPypi {
inherit pname version;
sha256 = "93c5b3204478c4e20c4baeb33807db5311b4420c21db2f21034a6deda998cb14";
sha256 = "66f333ef5dc79fdfbd3bbe98adc791b1f854e0461067d202fa7b15de66d517ec";
};

patches = [
# Fix tests. Remove with the next release
(fetchpatch {
url = https://github.com/Kozea/CairoSVG/commit/1f403ad229f0e2782d6427a79f0fbeb6b76148b6.patch;
sha256 = "1dxpj5zh8wmx9f8pj11hrixd5jlaqq5xlcdnbl462bh29zj18l26";
})
];

LC_ALL="en_US.UTF-8";

propagatedBuildInputs = [ cairocffi cssselect2 defusedxml pillow tinycss2 ];

checkInputs = [ pytestrunner pytestcov pytest-flake8 pytest-isort ];
checkInputs = [ pytest pytestrunner pytestcov pytest-flake8 pytest-isort ];

meta = with stdenv.lib; {
homepage = https://cairosvg.org;
3 changes: 3 additions & 0 deletions pkgs/development/python-modules/qasm2image/default.nix
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
, svgwrite
, colorama
, python
, pythonOlder
}:

buildPythonPackage rec {
@@ -21,6 +22,8 @@ buildPythonPackage rec {
sha256 = "1bnkzv7wrdvrq71dmsqanb3v2hcsxh5zaglfcxm2d9zzpmvb4a2n";
};

disabled = pythonOlder "3.5";

propagatedBuildInputs = [
cairocffi
cairosvg
Loading