2020-03-31 15:00:49 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig
|
2019-11-15 04:08:10 +01:00
|
|
|
, boost, cereal, curl, eigen, expat, glew, libpng, tbb, wxGTK31
|
2019-05-21 14:16:25 +02:00
|
|
|
, gtest, nlopt, xorg, makeDesktopItem
|
2020-03-31 15:00:49 +02:00
|
|
|
, cgal_5, gmp, ilmbase, mpfr, qhull, openvdb, systemd
|
2019-05-21 14:16:25 +02:00
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "prusa-slicer";
|
2020-03-31 15:00:49 +02:00
|
|
|
version = "2.2.0";
|
2019-05-21 14:16:25 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkgconfig
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
boost
|
2019-09-23 19:33:04 +02:00
|
|
|
cereal
|
2020-03-31 15:00:49 +02:00
|
|
|
cgal_5
|
2019-05-21 14:16:25 +02:00
|
|
|
curl
|
2019-09-23 19:33:20 +02:00
|
|
|
eigen
|
2019-05-21 14:16:25 +02:00
|
|
|
expat
|
|
|
|
glew
|
2020-03-31 15:00:49 +02:00
|
|
|
gmp
|
|
|
|
ilmbase
|
2019-05-21 14:16:25 +02:00
|
|
|
libpng
|
2020-03-31 15:00:49 +02:00
|
|
|
mpfr
|
|
|
|
nlopt
|
|
|
|
openvdb
|
|
|
|
systemd
|
2019-05-21 14:16:25 +02:00
|
|
|
tbb
|
2019-11-15 04:08:10 +01:00
|
|
|
wxGTK31
|
2019-05-21 14:16:25 +02:00
|
|
|
xorg.libX11
|
|
|
|
] ++ checkInputs;
|
|
|
|
|
|
|
|
checkInputs = [ gtest ];
|
|
|
|
|
|
|
|
# The build system uses custom logic - defined in
|
2020-03-31 15:00:49 +02:00
|
|
|
# cmake/modules/FindNLopt.cmake in the package source - for finding the nlopt
|
|
|
|
# library, which doesn't pick up the package in the nix store. We
|
|
|
|
# additionally need to set the path via the NLOPT environment variable.
|
2019-09-09 01:38:31 +02:00
|
|
|
NLOPT = nlopt;
|
2019-05-21 14:16:25 +02:00
|
|
|
|
2020-03-31 15:00:49 +02:00
|
|
|
# Disable compiler warnings that clutter the build log.
|
2019-09-23 19:33:20 +02:00
|
|
|
# It seems to be a known issue for Eigen:
|
|
|
|
# http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-ignored-attributes";
|
|
|
|
|
2020-03-31 15:00:49 +02:00
|
|
|
# prusa-slicer uses dlopen on `libudev.so` at runtime
|
|
|
|
NIX_LDFLAGS = "-ludev";
|
|
|
|
|
2019-05-21 14:16:25 +02:00
|
|
|
prePatch = ''
|
|
|
|
# In nix ioctls.h isn't available from the standard kernel-headers package
|
2019-09-23 19:33:04 +02:00
|
|
|
# like in other distributions. The copy in glibc seems to be identical to the
|
|
|
|
# one in the kernel though, so we use that one instead.
|
2019-05-21 14:16:25 +02:00
|
|
|
sed -i 's|"/usr/include/asm-generic/ioctls.h"|<asm-generic/ioctls.h>|g' src/libslic3r/GCodeSender.cpp
|
2020-03-31 15:00:49 +02:00
|
|
|
|
2019-05-21 14:16:25 +02:00
|
|
|
# Since version 2.5.0 of nlopt we need to link to libnlopt, as libnlopt_cxx
|
|
|
|
# now seems to be integrated into the main lib.
|
2020-03-31 15:00:49 +02:00
|
|
|
sed -i 's|nlopt_cxx|nlopt|g' cmake/modules/FindNLopt.cmake
|
2019-05-21 14:16:25 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "prusa3d";
|
|
|
|
repo = "PrusaSlicer";
|
2020-03-31 15:00:49 +02:00
|
|
|
sha256 = "0954k9sm09y8qnz1jyswyysg10k54ywz8mswnwa4n2hnpq9qx73m";
|
2019-05-21 14:16:25 +02:00
|
|
|
rev = "version_${version}";
|
|
|
|
};
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DSLIC3R_FHS=1"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share/pixmaps/"
|
|
|
|
ln -s "$out/share/PrusaSlicer/icons/PrusaSlicer.png" "$out/share/pixmaps/PrusaSlicer.png"
|
|
|
|
mkdir -p "$out/share/applications"
|
|
|
|
cp "$desktopItem"/share/applications/* "$out/share/applications/"
|
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "PrusaSlicer";
|
|
|
|
exec = "prusa-slicer";
|
|
|
|
icon = "PrusaSlicer";
|
|
|
|
comment = "G-code generator for 3D printers";
|
|
|
|
desktopName = "PrusaSlicer";
|
|
|
|
genericName = "3D printer tool";
|
2020-06-25 04:18:37 +02:00
|
|
|
categories = "Development;";
|
2019-05-21 14:16:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "G-code generator for 3D printer";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/prusa3d/PrusaSlicer";
|
2019-05-21 14:16:25 +02:00
|
|
|
license = licenses.agpl3;
|
2020-03-31 15:00:49 +02:00
|
|
|
maintainers = with maintainers; [ moredread tweber ];
|
2019-05-21 14:16:25 +02:00
|
|
|
};
|
|
|
|
}
|