2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2021-01-05 17:05:55 +00:00
|
|
|
, buildPythonPackage
|
2021-03-15 08:37:03 +00:00
|
|
|
, toPythonModule
|
2021-01-05 17:05:55 +00:00
|
|
|
, pythonOlder
|
|
|
|
, pythonAtLeast
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pyparsing
|
|
|
|
, opencascade
|
|
|
|
, stdenv
|
|
|
|
, python
|
|
|
|
, cmake
|
|
|
|
, swig
|
|
|
|
, smesh
|
|
|
|
, freetype
|
|
|
|
, libGL
|
|
|
|
, libGLU
|
|
|
|
, libX11
|
|
|
|
, six
|
|
|
|
, pytest
|
|
|
|
, makeFontsConf
|
|
|
|
, freefont_ttf
|
|
|
|
, Cocoa
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
let
|
2021-03-15 08:37:03 +00:00
|
|
|
pythonocc-core-cadquery = toPythonModule (stdenv.mkDerivation {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pythonocc-core-cadquery";
|
|
|
|
version = "0.18.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CadQuery";
|
|
|
|
repo = "pythonocc-core";
|
|
|
|
# no proper release to to use, this commit copied from the Anaconda receipe
|
|
|
|
rev = "701e924ae40701cbe6f9992bcbdc2ef22aa9b5ab";
|
|
|
|
sha256 = "07zmiiw74dyj4v0ar5vqkvk30wzcpjjzbi04nsdk5mnlzslmyi6c";
|
|
|
|
};
|
|
|
|
|
2020-05-29 06:06:01 +00:00
|
|
|
nativeBuildInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
cmake
|
|
|
|
swig
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
python
|
|
|
|
opencascade
|
|
|
|
smesh
|
|
|
|
freetype
|
|
|
|
libGL
|
|
|
|
libGLU
|
|
|
|
libX11
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-Wno-dev"
|
|
|
|
"-DPYTHONOCC_INSTALL_DIRECTORY=${placeholder "out"}/${python.sitePackages}/OCC"
|
|
|
|
"-DSMESH_INCLUDE_PATH=${smesh}/include/smesh"
|
|
|
|
"-DSMESH_LIB_PATH=${smesh}/lib"
|
|
|
|
"-DPYTHONOCC_WRAP_SMESH=TRUE"
|
|
|
|
];
|
2021-03-15 08:37:03 +00:00
|
|
|
});
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cadquery";
|
2020-05-29 06:06:01 +00:00
|
|
|
version = "2.0";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CadQuery";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-05-29 06:06:01 +00:00
|
|
|
sha256 = "1n63b6cjjrdwdfmwq0zx1xabjnhndk9mgfkm4w7z9ardcfpvg84l";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
opencascade
|
|
|
|
];
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
pyparsing
|
|
|
|
pythonocc-core-cadquery
|
|
|
|
];
|
2020-05-29 06:06:01 +00:00
|
|
|
|
|
|
|
FONTCONFIG_FILE = makeFontsConf {
|
|
|
|
fontDirectories = [ freefont_ttf ];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-05-29 06:06:01 +00:00
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.6" || pythonAtLeast "3.8";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Parametric scripting language for creating and traversing CAD models";
|
|
|
|
homepage = "https://github.com/CadQuery/cadquery";
|
|
|
|
license = licenses.asl20;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ marcus7070 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|