pythonPackages.cairocffi: move out of python-modules.nix

+67 -53
+1 -1
pkgs/applications/window-managers/qtile/default.nix
··· 1 { stdenv, fetchFromGitHub, python27Packages, glib, cairo, pango, pkgconfig, libxcb, xcbutilcursor }: 2 3 let cairocffi-xcffib = python27Packages.cairocffi.override { 4 - pythonPath = [ python27Packages.xcffib ]; 5 }; 6 in 7
··· 1 { stdenv, fetchFromGitHub, python27Packages, glib, cairo, pango, pkgconfig, libxcb, xcbutilcursor }: 2 3 let cairocffi-xcffib = python27Packages.cairocffi.override { 4 + withXcffib = true; 5 }; 6 in 7
+65
pkgs/development/python-modules/cairocffi/default.nix
···
··· 1 + { buildPythonPackage 2 + , fetchurl 3 + , makeFontsConf 4 + , freefont_ttf 5 + , pytest 6 + , glibcLocales 7 + , cairo 8 + , cffi 9 + , withXcffib ? false, xcffib 10 + , python 11 + , fetchpatch 12 + , glib 13 + , gdk_pixbuf }: 14 + 15 + buildPythonPackage rec { 16 + name = "cairocffi-0.7.2"; 17 + 18 + src = fetchurl { 19 + url = "mirror://pypi/c/cairocffi/${name}.tar.gz"; 20 + sha256 = "e42b4256d27bd960cbf3b91a6c55d602defcdbc2a73f7317849c80279feeb975"; 21 + }; 22 + 23 + LC_ALL = "en_US.UTF-8"; 24 + 25 + # checkPhase require at least one 'normal' font and one 'monospace', 26 + # otherwise glyph tests fails 27 + FONTCONFIG_FILE = makeFontsConf { 28 + fontDirectories = [ freefont_ttf ]; 29 + }; 30 + 31 + checkInputs = [ pytest glibcLocales ]; 32 + propagatedBuildInputs = [ cairo cffi ] ++ lib.optional withXcffib xcffib; 33 + 34 + checkPhase = '' 35 + py.test $out/${python.sitePackages} 36 + ''; 37 + 38 + # FIXME: make gdk_pixbuf dependency optional 39 + # Happens with 0.7.1 and 0.7.2 40 + # OSError: dlopen() failed to load a library: gdk_pixbuf-2.0 / gdk_pixbuf-2.0-0 41 + 42 + patches = [ 43 + # This patch from PR substituted upstream 44 + (fetchpatch { 45 + url = "https://github.com/avnik/cairocffi/commit/2266882e263c5efc87350cf016d117b2ec6a1d59.patch"; 46 + sha256 = "0gb570z3ivf1b0ixsk526n3h29m8c5rhjsiyam7rr3x80dp65cdl"; 47 + }) 48 + 49 + ./dlopen-paths.patch 50 + ./fix_test_scaled_font.patch 51 + ]; 52 + 53 + postPatch = '' 54 + # Hardcode cairo library path 55 + substituteInPlace cairocffi/__init__.py --subst-var-by cairo ${cairo.out} 56 + substituteInPlace cairocffi/__init__.py --subst-var-by glib ${glib.out} 57 + substituteInPlace cairocffi/__init__.py --subst-var-by gdk_pixbuf ${gdk_pixbuf.out} 58 + ''; 59 + 60 + meta = { 61 + homepage = https://github.com/SimonSapin/cairocffi; 62 + license = "bsd"; 63 + description = "cffi-based cairo bindings for Python"; 64 + }; 65 + }
+1 -52
pkgs/top-level/python-packages.nix
··· 2052 2053 canmatrix = callPackage ../development/python-modules/canmatrix {}; 2054 2055 - cairocffi = buildPythonPackage rec { 2056 - name = "cairocffi-0.7.2"; 2057 - 2058 - src = pkgs.fetchurl { 2059 - url = "mirror://pypi/c/cairocffi/${name}.tar.gz"; 2060 - sha256 = "e42b4256d27bd960cbf3b91a6c55d602defcdbc2a73f7317849c80279feeb975"; 2061 - }; 2062 - 2063 - LC_ALL = "en_US.UTF-8"; 2064 - 2065 - # checkPhase require at least one 'normal' font and one 'monospace', 2066 - # otherwise glyph tests fails 2067 - FONTCONFIG_FILE = pkgs.makeFontsConf { 2068 - fontDirectories = [ pkgs.freefont_ttf ]; 2069 - }; 2070 - 2071 - buildInputs = with self; [ pytest pkgs.glibcLocales ]; 2072 - propagatedBuildInputs = with self; [ pkgs.cairo cffi ]; 2073 - 2074 - checkPhase = '' 2075 - py.test $out/${python.sitePackages} 2076 - ''; 2077 - 2078 - # FIXME: make gdk_pixbuf dependency optional (as wel as xcfffi) 2079 - # Happens with 0.7.1 and 0.7.2 2080 - # OSError: dlopen() failed to load a library: gdk_pixbuf-2.0 / gdk_pixbuf-2.0-0 2081 - 2082 - patches = [ 2083 - # This patch from PR substituted upstream 2084 - (pkgs.fetchpatch { 2085 - url = "https://github.com/avnik/cairocffi/commit/2266882e263c5efc87350cf016d117b2ec6a1d59.patch"; 2086 - sha256 = "0gb570z3ivf1b0ixsk526n3h29m8c5rhjsiyam7rr3x80dp65cdl"; 2087 - }) 2088 - 2089 - ../development/python-modules/cairocffi/dlopen-paths.patch 2090 - ../development/python-modules/cairocffi/fix_test_scaled_font.patch 2091 - ]; 2092 - 2093 - postPatch = '' 2094 - # Hardcode cairo library path 2095 - substituteInPlace cairocffi/__init__.py --subst-var-by cairo ${pkgs.cairo.out} 2096 - substituteInPlace cairocffi/__init__.py --subst-var-by glib ${pkgs.glib.out} 2097 - substituteInPlace cairocffi/__init__.py --subst-var-by gdk_pixbuf ${pkgs.gdk_pixbuf.out} 2098 - ''; 2099 - 2100 - meta = { 2101 - homepage = https://github.com/SimonSapin/cairocffi; 2102 - license = "bsd"; 2103 - description = "cffi-based cairo bindings for Python"; 2104 - }; 2105 - }; 2106 - 2107 2108 cairosvg = buildPythonPackage rec { 2109 version = "1.0.18";
··· 2052 2053 canmatrix = callPackage ../development/python-modules/canmatrix {}; 2054 2055 + cairocffi = callPackage ../development/python-modules/cairocffi {}; 2056 2057 cairosvg = buildPythonPackage rec { 2058 version = "1.0.18";