2024-02-07 01:22:34 +00:00
|
|
|
{ lib
|
|
|
|
, clangStdenv
|
|
|
|
, llvmPackages
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, bison
|
|
|
|
, boost
|
|
|
|
, cairo
|
|
|
|
, cgal_5
|
|
|
|
, clipper2
|
|
|
|
, double-conversion
|
|
|
|
, eigen
|
|
|
|
, flex
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
2024-04-21 15:54:59 +00:00
|
|
|
, ghostscript
|
2024-02-07 01:22:34 +00:00
|
|
|
, glib
|
|
|
|
, glm
|
|
|
|
, gmp
|
|
|
|
, harfbuzz
|
|
|
|
, hidapi
|
|
|
|
, lib3mf
|
|
|
|
, libGLU
|
|
|
|
, libICE
|
|
|
|
, libSM
|
|
|
|
, libsForQt5
|
|
|
|
, libspnav
|
|
|
|
, libzip
|
2024-09-26 11:04:55 +00:00
|
|
|
, manifold
|
2024-04-21 15:54:59 +00:00
|
|
|
, mesa
|
2024-02-07 01:22:34 +00:00
|
|
|
, mpfr
|
|
|
|
, python3
|
2024-04-21 15:54:59 +00:00
|
|
|
, tbb_2021_11
|
2024-02-07 01:22:34 +00:00
|
|
|
, wayland
|
|
|
|
, wayland-protocols
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2024-04-21 15:54:59 +00:00
|
|
|
, xorg
|
2024-09-26 11:04:55 +00:00
|
|
|
, mimalloc
|
|
|
|
, opencsg
|
2024-02-07 01:22:34 +00:00
|
|
|
}:
|
|
|
|
# clang consume much less RAM than GCC
|
|
|
|
clangStdenv.mkDerivation rec {
|
|
|
|
pname = "openscad-unstable";
|
2024-09-26 11:04:55 +00:00
|
|
|
version = "2024-09-22";
|
2024-02-07 01:22:34 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "openscad";
|
|
|
|
repo = "openscad";
|
2024-09-26 11:04:55 +00:00
|
|
|
rev = "1cf4e97ed488d606c823f107dcc361f218aa84ca";
|
|
|
|
hash = "sha256-5WzLAQnjH+4JjJhh9pCgY3j8+lyNPrtY9a104tzkglo=";
|
|
|
|
fetchSubmodules = true; # Only really need sanitizers-cmake and MCAD
|
2024-02-07 01:22:34 +00:00
|
|
|
};
|
2024-09-26 11:04:55 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = [ ./test.diff ];
|
2024-09-26 11:04:55 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
nativeBuildInputs = [
|
2024-04-21 15:54:59 +00:00
|
|
|
(python3.withPackages (ps: with ps; [ numpy pillow ]))
|
2024-02-07 01:22:34 +00:00
|
|
|
bison
|
2024-04-21 15:54:59 +00:00
|
|
|
cmake
|
2024-02-07 01:22:34 +00:00
|
|
|
flex
|
|
|
|
libsForQt5.qt5.wrapQtAppsHook
|
|
|
|
llvmPackages.bintools
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2024-04-21 15:54:59 +00:00
|
|
|
ninja
|
|
|
|
pkg-config
|
2024-02-07 01:22:34 +00:00
|
|
|
];
|
|
|
|
buildInputs = with libsForQt5; with qt5; [
|
|
|
|
clipper2
|
|
|
|
glm
|
2024-04-21 15:54:59 +00:00
|
|
|
tbb_2021_11
|
2024-09-26 11:04:55 +00:00
|
|
|
mimalloc
|
2024-02-07 01:22:34 +00:00
|
|
|
boost
|
|
|
|
cairo
|
|
|
|
cgal_5
|
|
|
|
double-conversion
|
|
|
|
eigen
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2024-04-21 15:54:59 +00:00
|
|
|
ghostscript
|
2024-02-07 01:22:34 +00:00
|
|
|
glib
|
|
|
|
gmp
|
2024-09-26 11:04:55 +00:00
|
|
|
opencsg
|
2024-02-07 01:22:34 +00:00
|
|
|
harfbuzz
|
|
|
|
hidapi
|
|
|
|
lib3mf
|
|
|
|
libspnav
|
|
|
|
libzip
|
2024-09-26 11:04:55 +00:00
|
|
|
manifold
|
2024-02-07 01:22:34 +00:00
|
|
|
mpfr
|
|
|
|
qscintilla
|
|
|
|
qtbase
|
|
|
|
qtmultimedia
|
|
|
|
]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals clangStdenv.hostPlatform.isLinux [
|
2024-04-21 15:54:59 +00:00
|
|
|
xorg.libXdmcp
|
|
|
|
libICE
|
|
|
|
libSM
|
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
qtwayland
|
|
|
|
libGLU
|
|
|
|
]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optional clangStdenv.hostPlatform.isDarwin qtmacextras
|
2024-02-07 01:22:34 +00:00
|
|
|
;
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DEXPERIMENTAL=ON" # enable experimental options
|
|
|
|
"-DSNAPSHOT=ON" # nightly icons
|
2024-09-26 11:04:55 +00:00
|
|
|
"-DUSE_BUILTIN_OPENCSG=OFF"
|
|
|
|
"-DUSE_BUILTIN_MANIFOLD=OFF"
|
2024-02-07 01:22:34 +00:00
|
|
|
"-DOPENSCAD_VERSION=\"${builtins.replaceStrings ["-"] ["."] version}\""
|
|
|
|
"-DCMAKE_UNITY_BUILD=ON" # faster build
|
|
|
|
# IPO
|
|
|
|
"-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld"
|
|
|
|
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON"
|
|
|
|
];
|
2024-07-27 06:49:29 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
doCheck = true;
|
2024-07-27 06:49:29 +00:00
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
mesa.llvmpipeHook
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
checkPhase = ''
|
|
|
|
# some fontconfig issues cause pdf output to have wrong font
|
|
|
|
ctest -j$NIX_BUILD_CORES -E pdfexporttest.\*
|
|
|
|
'';
|
2024-02-07 01:22:34 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "3D parametric model compiler (unstable)";
|
|
|
|
longDescription = ''
|
|
|
|
OpenSCAD is a software for creating solid 3D CAD objects. It is free
|
|
|
|
software and available for Linux/UNIX, MS Windows and macOS.
|
|
|
|
|
|
|
|
Unlike most free software for creating 3D models (such as the famous
|
|
|
|
application Blender) it does not focus on the artistic aspects of 3D
|
|
|
|
modelling but instead on the CAD aspects. Thus it might be the
|
|
|
|
application you are looking for when you are planning to create 3D models of
|
|
|
|
machine parts but pretty sure is not what you are looking for when you are more
|
|
|
|
interested in creating computer-animated movies.
|
|
|
|
'';
|
|
|
|
homepage = "https://openscad.org/";
|
|
|
|
# note that the *binary license* is gpl3 due to CGAL
|
|
|
|
license = lib.licenses.gpl3;
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = with lib.maintainers; [ pca006132 raskin ];
|
|
|
|
mainProgram = "openscad";
|
|
|
|
};
|
|
|
|
}
|