uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
111
pkgs/development/python-modules/weasyprint/default.nix
Normal file
111
pkgs/development/python-modules/weasyprint/default.nix
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
{ buildPythonPackage
|
||||
, fetchPypi
|
||||
, fetchpatch
|
||||
, pytestCheckHook
|
||||
, brotli
|
||||
, cairosvg
|
||||
, flit-core
|
||||
, fonttools
|
||||
, pydyf
|
||||
, pyphen
|
||||
, cffi
|
||||
, cssselect
|
||||
, lxml
|
||||
, html5lib
|
||||
, tinycss
|
||||
, zopfli
|
||||
, glib
|
||||
, harfbuzz
|
||||
, pango
|
||||
, fontconfig
|
||||
, lib
|
||||
, stdenv
|
||||
, ghostscript
|
||||
, isPy3k
|
||||
, substituteAll
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "weasyprint";
|
||||
version = "54.3";
|
||||
disabled = !isPy3k;
|
||||
|
||||
format = "pyproject";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit version;
|
||||
pname = "weasyprint";
|
||||
sha256 = "sha256-4E2gQGMFZsRMqiAgM/B/hYdl9TZwkEWoCXOfPQSOidY=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./library-paths.patch;
|
||||
fontconfig = "${fontconfig.lib}/lib/libfontconfig${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||
pangoft2 = "${pango.out}/lib/libpangoft2-1.0${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||
gobject = "${glib.out}/lib/libgobject-2.0${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||
pango = "${pango.out}/lib/libpango-1.0${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||
pangocairo = "${pango.out}/lib/libpangocairo-1.0${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||
harfbuzz = "${harfbuzz.out}/lib/libharfbuzz${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||
})
|
||||
# Disable tests for new Ghostscript
|
||||
# Remove when next version is released
|
||||
(fetchpatch {
|
||||
url = "https://github.com/Kozea/WeasyPrint/commit/e544398b00d76bc0317ea7e2abe40dc46b380910.patch";
|
||||
sha256 = "sha256-oQO3j9Mo1x98WaLPROxsOn0qkeYRJrCx5QWWKoHvabE=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
flit-core
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
brotli
|
||||
cairosvg
|
||||
cffi
|
||||
cssselect
|
||||
fonttools
|
||||
html5lib
|
||||
lxml
|
||||
flit-core
|
||||
pydyf
|
||||
pyphen
|
||||
tinycss
|
||||
zopfli
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
pytestCheckHook
|
||||
ghostscript
|
||||
];
|
||||
|
||||
disabledTests = [
|
||||
# needs the Ahem font (fails on macOS)
|
||||
"test_font_stretch"
|
||||
# sensitive to sandbox environments
|
||||
"test_tab_size"
|
||||
"test_tabulation_character"
|
||||
"test_linear_gradients_5"
|
||||
"test_linear_gradients_12"
|
||||
];
|
||||
|
||||
FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace "--isort --flake8 --cov --no-cov-on-fail" ""
|
||||
'';
|
||||
|
||||
preCheck = ''
|
||||
# Fontconfig wants to create a cache.
|
||||
export HOME=$TMPDIR
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://weasyprint.org/";
|
||||
description = "Converts web documents to PDF";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ elohmeier ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
diff --git a/weasyprint/text/ffi.py b/weasyprint/text/ffi.py
|
||||
index 0734cbea..22e31a5e 100644
|
||||
--- a/weasyprint/text/ffi.py
|
||||
+++ b/weasyprint/text/ffi.py
|
||||
@@ -387,22 +387,11 @@ def _dlopen(ffi, *names):
|
||||
return ffi.dlopen(names[0]) # pragma: no cover
|
||||
|
||||
|
||||
-gobject = _dlopen(
|
||||
- ffi, 'gobject-2.0-0', 'gobject-2.0', 'libgobject-2.0-0',
|
||||
- 'libgobject-2.0.so.0', 'libgobject-2.0.dylib', 'libgobject-2.0-0.dll')
|
||||
-pango = _dlopen(
|
||||
- ffi, 'pango-1.0-0', 'pango-1.0', 'libpango-1.0-0', 'libpango-1.0.so.0',
|
||||
- 'libpango-1.0.dylib', 'libpango-1.0-0.dll')
|
||||
-harfbuzz = _dlopen(
|
||||
- ffi, 'harfbuzz', 'harfbuzz-0.0', 'libharfbuzz-0',
|
||||
- 'libharfbuzz.so.0', 'libharfbuzz.so.0', 'libharfbuzz.0.dylib',
|
||||
- 'libharfbuzz-0.dll')
|
||||
-fontconfig = _dlopen(
|
||||
- ffi, 'fontconfig-1', 'fontconfig', 'libfontconfig', 'libfontconfig.so.1',
|
||||
- 'libfontconfig-1.dylib', 'libfontconfig-1.dll')
|
||||
-pangoft2 = _dlopen(
|
||||
- ffi, 'pangoft2-1.0-0', 'pangoft2-1.0', 'libpangoft2-1.0-0',
|
||||
- 'libpangoft2-1.0.so.0', 'libpangoft2-1.0.dylib', 'libpangoft2-1.0-0.dll')
|
||||
+gobject = _dlopen(ffi, '@gobject@')
|
||||
+pango = _dlopen(ffi, '@pango@')
|
||||
+harfbuzz = _dlopen(ffi, '@harfbuzz@')
|
||||
+fontconfig = _dlopen(ffi, '@fontconfig@')
|
||||
+pangoft2 = _dlopen(ffi, '@pangoft2@')
|
||||
|
||||
gobject.g_type_init()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue