1{
2 buildPythonPackage,
3 fetchpatch,
4 horizon-eda,
5 pycairo,
6 python,
7 pythonOlder,
8}:
9
10let
11 base = horizon-eda.passthru.base;
12in
13buildPythonPackage {
14 inherit (base)
15 pname
16 version
17 src
18 meta
19 env
20 ;
21
22 pyproject = false;
23
24 disabled = pythonOlder "3.9";
25
26 patches = [
27 # Replaces osmesa with EGL_PLATFORM_SURFACELESS_MESA
28 (fetchpatch {
29 url = "https://github.com/horizon-eda/horizon/commit/663a8adaa1cb7eae7a824de07df8909bc33677c3.patch";
30 hash = "sha256-g0rP9NBDdDijh35Y2h4me9N5R/mjCn+2w7uhnv9bweY=";
31 })
32 ];
33
34 buildInputs = base.buildInputs ++ [
35 python
36 ];
37
38 propagatedBuildInputs = [ pycairo ];
39
40 nativeBuildInputs = base.nativeBuildInputs;
41
42 ninjaFlags = [ "horizon.so" ];
43
44 installPhase = ''
45 runHook preInstall
46
47 mkdir -p $out/${python.sitePackages}
48 cp horizon.so $out/${python.sitePackages}
49
50 runHook postInstall
51 '';
52
53 enableParallelBuilding = true;
54}