29 , spacenavSupport ? stdenv.isLinux, libspnav
41 src = fetchFromGitHub {
44 rev = "${pname}-${version}";
45 sha256 = "sha256-2tOLqpFt5klFPxHNONnHVzBKEFWn4+ufx/MU+eYbliA=";
50 name = "CVE-2022-0496.patch";
51 url = "https://github.com/openscad/openscad/commit/00a4692989c4e2f191525f73f24ad8727bacdf41.patch";
52 sha256 = "sha256-q3SLj2b5aM/IQ8vIDj4iVcwCajgyJ5juNV/KN35uxfI=";
55 name = "CVE-2022-0497.patch";
56 url = "https://github.com/openscad/openscad/commit/84addf3c1efbd51d8ff424b7da276400bbfa1a4b.patch";
57 sha256 = "sha256-KNEVu10E2d4G2x+FJcuHo2tjD8ygMRuhUcW9NbN98bM=";
61 nativeBuildInputs = [ bison flex pkg-config gettext qmake wrapGAppsHook];
64 eigen boost glew opencsg cgal_4 mpfr gmp glib
65 harfbuzz lib3mf libzip double-conversion freetype fontconfig
66 qtbase qtmultimedia qscintilla cairo
67 ] ++ lib.optionals stdenv.isLinux [ libGLU libGL wayland wayland-protocols qtwayland ]
68 ++ lib.optional stdenv.isDarwin qtmacextras
69 ++ lib.optional spacenavSupport libspnav
72 qmakeFlags = [ "VERSION=${version}" ] ++
73 lib.optionals spacenavSupport [
75 "SPNAV_INCLUDEPATH=${libspnav}/include"
76 "SPNAV_LIBPATH=${libspnav}/lib"
79 enableParallelBuilding = true;
82 make objects/parser.cxx
85 postInstall = lib.optionalString stdenv.isDarwin ''
86 mkdir $out/Applications
87 mv $out/bin/*.app $out/Applications
88 rmdir $out/bin || true
90 mv --target-directory=$out/Applications/OpenSCAD.app/Contents/Resources \
91 $out/share/openscad/{examples,color-schemes,locale,libraries,fonts,templates}
93 rmdir $out/share/openscad
97 description = "3D parametric model compiler";
99 OpenSCAD is a software for creating solid 3D CAD objects. It is free
100 software and available for Linux/UNIX, MS Windows and macOS.
102 Unlike most free software for creating 3D models (such as the famous
103 application Blender) it does not focus on the artistic aspects of 3D
104 modelling but instead on the CAD aspects. Thus it might be the
105 application you are looking for when you are planning to create 3D models of
106 machine parts but pretty sure is not what you are looking for when you are more
107 interested in creating computer-animated movies.
109 homepage = "https://openscad.org/";
110 license = lib.licenses.gpl2;
111 platforms = lib.platforms.unix;
112 maintainers = with lib.maintainers; [ bjornfor raskin gebner ];
113 mainProgram = "openscad";