Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / cadquery / default.nix
blob1eb8f73b7a776dd68772e2d0f5a8adfff9d06c32
1 { lib
2 , buildPythonPackage
3 , toPythonModule
4 , pythonOlder
5 , pythonAtLeast
6 , fetchFromGitHub
7 , pyparsing
8 , opencascade-occt
9 , stdenv
10 , python
11 , cmake
12 , swig
13 , freetype
14 , libGL
15 , libGLU
16 , libX11
17 , six
18 , pytest
19 , makeFontsConf
20 , freefont_ttf
21 , Cocoa
24 let
25   pythonocc-core-cadquery = toPythonModule (stdenv.mkDerivation {
26     pname = "pythonocc-core-cadquery";
27     version = "0.18.2";
29     src = fetchFromGitHub {
30       owner = "CadQuery";
31       repo = "pythonocc-core";
32       # no proper release to to use, this commit copied from the Anaconda receipe
33       rev = "701e924ae40701cbe6f9992bcbdc2ef22aa9b5ab";
34       sha256 = "07zmiiw74dyj4v0ar5vqkvk30wzcpjjzbi04nsdk5mnlzslmyi6c";
35     };
37     nativeBuildInputs = [
38       cmake
39       swig
40     ];
42     buildInputs = [
43       python
44       opencascade-occt
45       freetype
46       libGL
47       libGLU
48       libX11
49     ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
51     propagatedBuildInputs = [
52       six
53     ];
55     cmakeFlags = [
56       "-Wno-dev"
57       "-DPYTHONOCC_INSTALL_DIRECTORY=${placeholder "out"}/${python.sitePackages}/OCC"
58     ];
59   });
62   buildPythonPackage rec {
63     pname = "cadquery";
64     version = "2.0";
66     src = fetchFromGitHub {
67       owner = "CadQuery";
68       repo = pname;
69       rev = version;
70       sha256 = "1n63b6cjjrdwdfmwq0zx1xabjnhndk9mgfkm4w7z9ardcfpvg84l";
71     };
73     buildInputs = [
74       opencascade-occt
75     ];
77     propagatedBuildInputs = [
78       pyparsing
79       pythonocc-core-cadquery
80     ];
82     FONTCONFIG_FILE = makeFontsConf {
83       fontDirectories = [ freefont_ttf ];
84     };
86     nativeCheckInputs = [
87       pytest
88     ];
90     disabled = pythonOlder "3.6" || pythonAtLeast "3.8";
92     meta = with lib; {
93       description = "Parametric scripting language for creating and traversing CAD models";
94       homepage = "https://github.com/CadQuery/cadquery";
95       license = licenses.asl20;
96       maintainers = with maintainers; [ marcus7070 ];
97       broken = true;
98     };
99   }