pythonPackages.cadquery: use CadQuery fork of pythonocc

This commit is contained in:
Marcus Boyd 2019-08-07 16:27:37 +09:30
parent 1e05f75522
commit f29905dbdf

View File

@ -1,11 +1,66 @@
{ lib { lib
, buildPythonPackage , buildPythonPackage
, isPy3k
, pythonOlder
, fetchFromGitHub , fetchFromGitHub
, pyparsing , pyparsing
, opencascade_oce , opencascade
, pythonocc-core , stdenv
, python
, cmake
, swig
, ninja
, smesh
, freetype
, libGL
, libGLU
, libX11
, six
}: }:
let
pythonocc-core-cadquery = stdenv.mkDerivation {
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";
};
nativeBuildInputs = [
cmake
swig
ninja
];
buildInputs = [
python
opencascade
smesh
freetype
libGL
libGLU
libX11
];
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"
];
};
in
buildPythonPackage rec { buildPythonPackage rec {
pname = "cadquery"; pname = "cadquery";
version = "2.0RC0"; version = "2.0RC0";
@ -14,22 +69,25 @@ buildPythonPackage rec {
owner = "CadQuery"; owner = "CadQuery";
repo = pname; repo = pname;
rev = version; rev = version;
sha256 = "1s5arr8w1mn60isaf44diqf72vyscy5ihns3072h16ysbl0b509s"; sha256 = "1xgd00rih0gjcnlrf9s6r5a7ypjkzgf2xij2b6436i76h89wmir3";
}; };
buildInputs = [ buildInputs = [
opencascade_oce opencascade
]; ];
propagatedBuildInputs = [ propagatedBuildInputs = [
pyparsing pyparsing
pythonocc-core pythonocc-core-cadquery
]; ];
# Build errors on 2.7 and >=3.8 (officially only supports 3.6 and 3.7).
disabled = !(isPy3k && (pythonOlder "3.8"));
meta = with lib; { meta = with lib; {
description = "Parametric scripting language for creating and traversing CAD models"; description = "Parametric scripting language for creating and traversing CAD models";
homepage = https://github.com/CadQuery/cadquery; homepage = "https://github.com/CadQuery/cadquery";
license = licenses.asl20; license = licenses.asl20;
maintainers = [ maintainers.costrouc ]; maintainers = with maintainers; [ costrouc marcus7070 ];
}; };
} }