diff --git a/expressions/OCP/default.nix b/expressions/OCP/default.nix index f929d5d..ebb67b8 100644 --- a/expressions/OCP/default.nix +++ b/expressions/OCP/default.nix @@ -22,8 +22,7 @@ let # We need to use an unmodified version number for the dist-utils version so # that the version check in cadquery works - # remember to change version number in dump_symbols.py as well - base-version = "7.6.3"; + base-version = "7.7.0"; version = "v${base-version}-git-${src.shortRev}"; vtk_main_version = lib.versions.majorMinor vtk_9.version; diff --git a/expressions/OCP/dump_symbols.py b/expressions/OCP/dump_symbols.py index 27cba91..88b5fd8 100644 --- a/expressions/OCP/dump_symbols.py +++ b/expressions/OCP/dump_symbols.py @@ -5,7 +5,7 @@ prefix = sys.argv[1] prefix_linux = Path(prefix).expand() -libs = prefix_linux.glob('**/libTK*.so.7.6.3') +libs = prefix_linux.glob('**/libTK*.so.*') exported_symbols = [] diff --git a/expressions/build123d.nix b/expressions/build123d.nix new file mode 100644 index 0000000..73cae64 --- /dev/null +++ b/expressions/build123d.nix @@ -0,0 +1,11 @@ +{ buildPythonPackage, src, ocp, ocp-stubs, setuptools, typing-extensions, svgpathtools, numpy, anytree, ezdxf }: + +buildPythonPackage rec { + pname = "build123d"; + version = if (builtins.hasAttr "rev" src) then src.shortRev else "local-dev"; + format = "pyproject"; + inherit src; + + patches = [ ./no-git-dep.diff ]; + propagatedBuildInputs = [ ocp ocp-stubs setuptools typing-extensions svgpathtools numpy anytree ezdxf ]; +} diff --git a/expressions/no-git-dep.diff b/expressions/no-git-dep.diff new file mode 100644 index 0000000..ebe9192 --- /dev/null +++ b/expressions/no-git-dep.diff @@ -0,0 +1,19 @@ +diff --git a/pyproject.toml b/pyproject.toml +index 737f549..4aa8d8f 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -36,10 +36,10 @@ classifiers = [ + ] + + dependencies = [ +- "cadquery-ocp ~= 7.7.0a0", +- "OCP-stubs @ git+https://github.com/CadQuery/OCP-stubs@7.7.0", +- "typing_extensions >= 4.4.0, <5", +- "numpy >= 1.24.1, <2", ++ "ocp ~= 7.7.0a0", ++ "OCP-stubs", ++ "typing_extensions >= 4.3.0, <5", ++ "numpy >= 1.23.3, <2", + "svgpathtools >= 1.5.1, <2", + "anytree >= 2.8.0, <3", + "ezdxf >= 1.0.0, < 2" diff --git a/expressions/opencascade-occt/default.nix b/expressions/opencascade-occt/default.nix index 0ca958f..354a55c 100644 --- a/expressions/opencascade-occt/default.nix +++ b/expressions/opencascade-occt/default.nix @@ -18,7 +18,7 @@ , freetype , freeimage , fontconfig - , tbb + , tbb_2021_8 , rapidjson , glew }: @@ -27,13 +27,13 @@ let in stdenv.mkDerivation rec { pname = "opencascade-occt"; - version = "7.6.3"; + version = "7.7.0"; commit = "V${builtins.replaceStrings ["."] ["_"] version}"; src = fetchurl { name = "occt-${commit}.tar.gz"; url = "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=${commit};sf=tgz"; - sha256 = "sha256-ZXkz6MLUMTRb+uyJNEmbzuOOR6JPqvSAJl9A6F2ExJw="; + hash = "sha256-aEWhf+X0CzaFpXG+l+VpZgXeI8x6vxD4pkTSFjcRxv8="; }; nativeBuildInputs = [ cmake ninja ]; @@ -50,7 +50,7 @@ in freetype freeimage fontconfig - tbb + tbb_2021_8 rapidjson glew ] ++ vtk_9.buildInputs; diff --git a/expressions/py-overrides.nix b/expressions/py-overrides.nix index 6cee176..0e1ad1a 100644 --- a/expressions/py-overrides.nix +++ b/expressions/py-overrides.nix @@ -11,6 +11,7 @@ , nlopt_nonpython , casadi_nonpython , pybind11-stubgen-src + , build123d-src }: self: super: rec { clang = self.callPackage ./clang.nix { src = llvm-src; @@ -133,4 +134,18 @@ sha256 = "611bb273cd68f3b993fabdc4064fc858c5b47a973cb5aa7999ec1ba405c87cd7"; }; }); + + svgpathtools = super.buildPythonPackage rec { + pname = "svgpathtools"; + version = "1.6.0"; + src = super.python.pkgs.fetchPypi { + inherit pname version; + hash = "sha256-wLk07tKayusJmIr7TRXFmENmhHI24huAwHnY7bWsDE4="; + }; + propagatedBuildInputs = with super.python.pkgs; [ numpy scipy svgwrite ]; + }; + + build123d = self.callPackage ./build123d.nix { + src = build123d-src; + }; } diff --git a/flake.lock b/flake.lock index 70a7359..2ace87e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,21 @@ { "nodes": { + "build123d-src": { + "flake": false, + "locked": { + "lastModified": 1682021925, + "narHash": "sha256-JexdOUsUN90rW6cKfEs2fW4lHE4A/01xRv2kcz1n3gk=", + "owner": "gumyr", + "repo": "build123d", + "rev": "dcb5278843f5801edd6796824dae6bbc2496104e", + "type": "github" + }, + "original": { + "owner": "gumyr", + "repo": "build123d", + "type": "github" + } + }, "cadquery-src": { "flake": false, "locked": { @@ -68,11 +84,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1673134516, - "narHash": "sha256-mAZQKqkNQbBmJnmUU0blOfkKlgMSSVyPHdeWeuKad8U=", + "lastModified": 1681920287, + "narHash": "sha256-+/d6XQQfhhXVfqfLROJoqj3TuG38CAeoT6jO1g9r1k0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f6f44561884c3470e2b783683d5dbac42dfc833b", + "rev": "645bc49f34fa8eff95479f0345ff57e55b53437e", "type": "github" }, "original": { @@ -85,15 +101,16 @@ "ocp-src": { "flake": false, "locked": { - "lastModified": 1663655329, - "narHash": "sha256-43gM7vpVbSrStG1Fg36IKWgZvTIWgqd0C6vfm5iwQ4w=", + "lastModified": 1677335656, + "narHash": "sha256-y4lq0tUY+t6gL2DgQq28uD8a1Cvj7dTUzyoyWAA4J4g=", "owner": "cadquery", "repo": "ocp", - "rev": "6b7b7325ab4599a8ba9049f176f099574fe64dfc", + "rev": "690c394abf32617f0c044159ad8a89480d40b240", "type": "github" }, "original": { "owner": "cadquery", + "ref": "7.7.0.0", "repo": "ocp", "type": "github" } @@ -101,15 +118,16 @@ "ocp-stubs-src": { "flake": false, "locked": { - "lastModified": 1663656588, - "narHash": "sha256-3SQxefbGDX6tTqDC420vbxDJh56JkSnbYhoRWTd2/3Y=", + "lastModified": 1672527176, + "narHash": "sha256-m9Rg36GYlYfwEfF0PQJWEXf8TyM5HmjeuhJCODiurvY=", "owner": "cadquery", "repo": "ocp-stubs", - "rev": "24323f86ff87ac82902ef6ad34123b051bf207b1", + "rev": "e838ff400d5ee2f4a0579d2a713b19311855288f", "type": "github" }, "original": { "owner": "cadquery", + "ref": "7.7.0", "repo": "ocp-stubs", "type": "github" } @@ -148,6 +166,7 @@ }, "root": { "inputs": { + "build123d-src": "build123d-src", "cadquery-src": "cadquery-src", "cq-editor-src": "cq-editor-src", "flake-utils": "flake-utils", diff --git a/flake.nix b/flake.nix index 8fc86a8..6ad9512 100644 --- a/flake.nix +++ b/flake.nix @@ -13,11 +13,11 @@ flake = false; }; ocp-src = { - url = "github:cadquery/ocp"; + url = "github:cadquery/ocp/7.7.0.0"; flake = false; }; ocp-stubs-src = { - url = "github:cadquery/ocp-stubs"; + url = "github:cadquery/ocp-stubs/7.7.0"; flake = false; }; pywrap-src = { @@ -32,6 +32,10 @@ url = "github:CadQuery/pybind11-stubgen"; flake = false; }; + build123d-src = { + url = "github:gumyr/build123d"; + flake = false; + }; }; outputs = { self, nixpkgs, flake-utils, ... } @ inputs: @@ -51,7 +55,7 @@ stdenv = pkgs.stdenv; # not currently used, can probably be removed unless I have to control GCC version again in the future }; # I'm quite worried about how I handle this VTK. Python -> VTK (for Python bindings) -> OCCT -> Python(OCP) - new_vtk_9 = pkgs.libsForQt5.callPackage ./expressions/VTK { enablePython = true; pythonInterpreter = python; }; + new_vtk_9 = pkgs.libsForQt5.callPackage ./expressions/VTK { enablePython = true; pythonInterpreter = python; ffmpeg = pkgs.ffmpeg_4; }; opencascade-occt = pkgs.callPackage ./expressions/opencascade-occt { inherit (gccSet) stdenv; vtk_9 = new_vtk_9; @@ -70,7 +74,7 @@ }; py-overrides = import expressions/py-overrides.nix { inherit gccSet; - inherit (inputs) llvm-src pywrap-src ocp-src ocp-stubs-src cadquery-src pybind11-stubgen-src; + inherit (inputs) llvm-src pywrap-src ocp-src ocp-stubs-src cadquery-src pybind11-stubgen-src build123d-src; inherit (pkgs) fetchFromGitHub; vtk_9_nonpython = new_vtk_9; occt = opencascade-occt; @@ -121,6 +125,7 @@ # ++ [ pytest ] # ++ cadquery.nativeBuildInputs # )); + build123d = python.withPackages ( ps: with ps; [ build123d ]); inherit python opencascade-occt; };