2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
2022-07-14 12:49:19 +00:00
|
|
|
, stdenv
|
2022-04-27 09:35:20 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, cython
|
|
|
|
, ninja
|
|
|
|
, setuptools-scm
|
|
|
|
, setuptools
|
|
|
|
, fetchPypi
|
|
|
|
, gn
|
|
|
|
, pytestCheckHook
|
2022-07-14 12:49:19 +00:00
|
|
|
, xcodebuild
|
|
|
|
, ApplicationServices
|
|
|
|
, OpenGL
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "skia-pathops";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "0.7.4";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
pname = "skia-pathops";
|
|
|
|
inherit version;
|
|
|
|
extension = "zip";
|
2022-12-17 10:02:37 +00:00
|
|
|
sha256 = "sha256-Ci/e6Ht62wGMv6bpXvnkKZ7WOwCAvidnejD/77ypE1A=";
|
2022-04-27 09:35:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "build_cmd = [sys.executable, build_skia_py, build_dir]" \
|
|
|
|
'build_cmd = [sys.executable, build_skia_py, "--no-fetch-gn", "--no-virtualenv", "--gn-path", "${gn}/bin/gn", build_dir]'
|
2022-10-21 18:38:19 +00:00
|
|
|
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
|
|
|
|
substituteInPlace src/cpp/skia-builder/skia/gn/skia/BUILD.gn \
|
|
|
|
--replace "-march=armv7-a" "-march=armv8-a" \
|
|
|
|
--replace "-mfpu=neon" "" \
|
|
|
|
--replace "-mthumb" ""
|
|
|
|
substituteInPlace src/cpp/skia-builder/skia/src/core/SkOpts.cpp \
|
|
|
|
--replace "defined(SK_CPU_ARM64)" "0"
|
2022-04-27 09:35:20 +00:00
|
|
|
'';
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
nativeBuildInputs = [ cython ninja setuptools-scm ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ xcodebuild ];
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ ApplicationServices OpenGL ];
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ setuptools ];
|
|
|
|
|
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pathops" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Python access to operations on paths using the Skia library";
|
|
|
|
homepage = "https://skia.org/dev/present/pathops";
|
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
maintainers = [ lib.maintainers.BarinovMaxim ];
|
|
|
|
};
|
|
|
|
}
|