nixpkgs/pkgs/by-name/op/openscad-unstable/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

149 lines
3.2 KiB
Nix
Raw Normal View History

2024-01-25 03:08:11 +00:00
{ lib
, clangStdenv
, llvmPackages
, fetchFromGitHub
, cmake
, ninja
, pkg-config
, bison
, boost
, cairo
, cgal_5
, clipper2
, double-conversion
, eigen
, flex
, fontconfig
, freetype
2024-02-23 06:15:16 +00:00
, ghostscript
2024-01-25 03:08:11 +00:00
, glib
, glm
, gmp
, harfbuzz
, hidapi
, lib3mf
, libGLU
, libICE
, libSM
, libsForQt5
, libspnav
, libzip
, manifold
2024-02-23 06:15:16 +00:00
, mesa
2024-01-25 03:08:11 +00:00
, mpfr
, python3
, tbb_2021_11
2024-01-25 03:08:11 +00:00
, wayland
, wayland-protocols
, wrapGAppsHook3
2024-02-23 06:15:16 +00:00
, xorg
, mimalloc
, opencsg
2024-01-25 03:08:11 +00:00
}:
# clang consume much less RAM than GCC
clangStdenv.mkDerivation rec {
pname = "openscad-unstable";
version = "2024-11-18";
2024-01-25 03:08:11 +00:00
src = fetchFromGitHub {
owner = "openscad";
repo = "openscad";
rev = "d65040e820ace5685554c40a7e584125b7df409e";
hash = "sha256-dIZhye1tycDMpJxjIUPioeTah2XS95jkr8HgGgZc5CU=";
fetchSubmodules = true; # Only really need sanitizers-cmake and MCAD
2024-01-25 03:08:11 +00:00
};
2024-02-23 06:15:16 +00:00
patches = [ ./test.diff ];
2024-01-25 03:08:11 +00:00
nativeBuildInputs = [
2024-02-23 06:15:16 +00:00
(python3.withPackages (ps: with ps; [ numpy pillow ]))
2024-01-25 03:08:11 +00:00
bison
2024-02-23 06:15:16 +00:00
cmake
2024-01-25 03:08:11 +00:00
flex
libsForQt5.qt5.wrapQtAppsHook
llvmPackages.bintools
wrapGAppsHook3
2024-02-23 06:15:16 +00:00
ninja
pkg-config
2024-01-25 03:08:11 +00:00
];
buildInputs = with libsForQt5; with qt5; [
clipper2
glm
tbb_2021_11
mimalloc
2024-01-25 03:08:11 +00:00
boost
cairo
cgal_5
double-conversion
eigen
fontconfig
freetype
2024-02-23 06:15:16 +00:00
ghostscript
2024-01-25 03:08:11 +00:00
glib
gmp
opencsg
2024-01-25 03:08:11 +00:00
harfbuzz
hidapi
lib3mf
libspnav
libzip
manifold
2024-01-25 03:08:11 +00:00
mpfr
qscintilla
qtbase
qtmultimedia
]
2024-02-23 06:15:16 +00:00
++ lib.optionals clangStdenv.hostPlatform.isLinux [
xorg.libXdmcp
libICE
libSM
wayland
wayland-protocols
qtwayland
libGLU
]
2024-01-25 03:08:11 +00:00
++ lib.optional clangStdenv.hostPlatform.isDarwin qtmacextras
;
cmakeFlags = [
"-DEXPERIMENTAL=ON" # enable experimental options
"-DSNAPSHOT=ON" # nightly icons
"-DUSE_BUILTIN_OPENCSG=OFF"
"-DUSE_BUILTIN_MANIFOLD=OFF"
2024-01-25 03:08:11 +00:00
"-DOPENSCAD_VERSION=\"${builtins.replaceStrings ["-"] ["."] version}\""
"-DCMAKE_UNITY_BUILD=OFF" # broken compile with unity
2024-01-25 03:08:11 +00:00
# IPO
"-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld"
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON"
];
2024-02-23 06:15:16 +00:00
doCheck = true;
nativeCheckInputs = [
mesa.llvmpipeHook
];
2024-02-23 06:15:16 +00:00
checkPhase = ''
# some fontconfig issues cause pdf output to have wrong font
ctest -j$NIX_BUILD_CORES -E pdfexporttest.\*
'';
2024-01-25 03:08:11 +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";
};
}