7 # There is a f3d overriden with EGL enabled vtk in top-level/all-packages.nix
8 # compiling with EGL enabled vtk will result in f3d running in headless mode
9 # See https://github.com/NixOS/nixpkgs/pull/324022. This may change later.
18 , withManual ? !stdenv.hostPlatform.isDarwin
19 , withPythonBinding ? false
22 stdenv.mkDerivation rec {
26 outputs = [ "out" ] ++ lib.optionals withManual [ "man" ];
28 src = fetchFromGitHub {
31 rev = "refs/tags/v${version}";
32 hash = "sha256-Mw40JyXZj+Q4a9dD5UnkUSdUfQGaV92gor8ynn86VJ8=";
37 ] ++ lib.optionals withManual [
41 ] ++ lib.optionals stdenv.hostPlatform.isElf [
42 # https://github.com/f3d-app/f3d/pull/1217
51 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
54 ] ++ lib.optionals withPythonBinding [
55 python3Packages.python
56 # Using C++ header files, not Python import
57 python3Packages.pybind11
61 # conflict between VTK and Nixpkgs;
62 # see https://github.com/NixOS/nixpkgs/issues/89167
63 "-DCMAKE_INSTALL_LIBDIR=lib"
64 "-DCMAKE_INSTALL_INCLUDEDIR=include"
65 "-DCMAKE_INSTALL_BINDIR=bin"
66 "-DF3D_MODULE_EXTERNAL_RENDERING=ON"
67 "-DF3D_PLUGIN_BUILD_ASSIMP=ON"
68 "-DF3D_PLUGIN_BUILD_OCCT=ON"
69 ] ++ lib.optionals withManual [
70 "-DF3D_LINUX_GENERATE_MAN=ON"
71 ] ++ lib.optionals withPythonBinding [
72 "-DF3D_BINDINGS_PYTHON=ON"
76 description = "Fast and minimalist 3D viewer using VTK";
77 homepage = "https://f3d-app.github.io/f3d";
78 changelog = "https://github.com/f3d-app/f3d/releases/tag/v${version}";
79 license = licenses.bsd3;
80 maintainers = with maintainers; [ bcdarwin pbsds ];
81 platforms = with platforms; unix;
83 # error: use of undeclared identifier 'NSMenuItem'
84 # adding AppKit does not solve it
85 broken = with stdenv.hostPlatform; isDarwin && isx86_64;