2019-11-27 00:50:43 +00:00
|
|
|
{ lib, stdenv, fetchgit, perl, makeWrapper
|
|
|
|
, makeDesktopItem, which, perlPackages, boost
|
2014-01-02 16:53:57 +00:00
|
|
|
}:
|
2013-04-28 11:59:00 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-11-17 20:13:28 +00:00
|
|
|
version = "1.3.0";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "slic3r";
|
2013-04-28 11:59:00 +01:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "git://github.com/alexrj/Slic3r";
|
2018-11-17 20:13:28 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "1pg4jxzb7f58ls5s8mygza8kqdap2c50kwlsdkf28bz1xi611zbi";
|
2013-04-28 11:59:00 +01:00
|
|
|
};
|
|
|
|
|
2018-12-14 15:40:36 +00:00
|
|
|
buildInputs =
|
|
|
|
[boost] ++
|
2018-11-17 20:13:28 +00:00
|
|
|
(with perlPackages; [ perl makeWrapper which
|
2018-12-14 15:40:36 +00:00
|
|
|
EncodeLocale MathClipper ExtUtilsXSpp
|
2013-04-28 11:59:00 +01:00
|
|
|
MathConvexHullMonotoneChain MathGeometryVoronoi MathPlanePath Moo
|
2014-08-20 15:27:47 +01:00
|
|
|
IOStringy ClassXSAccessor Wx GrowlGNTP NetDBus ImportInto XMLSAX
|
2016-07-18 19:58:58 +01:00
|
|
|
ExtUtilsMakeMaker OpenGL WxGLCanvas ModuleBuild LWP
|
2018-06-10 21:19:40 +01:00
|
|
|
ExtUtilsCppGuess ModuleBuildWithXSpp ExtUtilsTypemapsDefault
|
2018-11-17 20:13:28 +00:00
|
|
|
DevelChecklib locallib
|
|
|
|
]);
|
2013-04-28 11:59:00 +01:00
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "slic3r";
|
|
|
|
exec = "slic3r";
|
|
|
|
icon = "slic3r";
|
|
|
|
comment = "G-code generator for 3D printers";
|
|
|
|
desktopName = "Slic3r";
|
|
|
|
genericName = "3D printer tool";
|
2020-06-25 03:18:37 +01:00
|
|
|
categories = "Development;";
|
2013-04-28 11:59:00 +01:00
|
|
|
};
|
|
|
|
|
2018-11-17 20:13:28 +00:00
|
|
|
prePatch = ''
|
|
|
|
# In nix ioctls.h isn't available from the standard kernel-headers package
|
|
|
|
# on other distributions. As the copy in glibc seems to be identical to the
|
|
|
|
# one in the kernel, we use that one instead.
|
|
|
|
sed -i 's|"/usr/include/asm-generic/ioctls.h"|<asm-generic/ioctls.h>|g' xs/src/libslic3r/GCodeSender.cpp
|
|
|
|
'';
|
|
|
|
|
2019-11-27 00:50:43 +00:00
|
|
|
# note the boost-compile-error is fixed in
|
|
|
|
# https://github.com/slic3r/Slic3r/commit/90f108ae8e7a4315f82e317f2141733418d86a68
|
|
|
|
# this patch can be probably be removed in the next version after 1.3.0
|
|
|
|
patches = lib.optional (lib.versionAtLeast boost.version "1.56.0") ./boost-compile-error.patch;
|
|
|
|
|
2014-08-20 15:27:47 +01:00
|
|
|
buildPhase = ''
|
|
|
|
export SLIC3R_NO_AUTO=true
|
2017-09-04 21:01:04 +01:00
|
|
|
export LD=$CXX
|
2014-08-20 15:27:47 +01:00
|
|
|
export PERL5LIB="./xs/blib/arch/:./xs/blib/lib:$PERL5LIB"
|
|
|
|
|
2014-11-15 18:22:18 +00:00
|
|
|
substituteInPlace Build.PL \
|
|
|
|
--replace "0.9918" "0.9923" \
|
|
|
|
--replace "eval" ""
|
|
|
|
|
2014-08-20 15:27:47 +01:00
|
|
|
pushd xs
|
|
|
|
perl Build.PL
|
|
|
|
perl Build
|
|
|
|
popd
|
|
|
|
|
2014-11-15 18:22:18 +00:00
|
|
|
perl Build.PL --gui
|
2014-08-20 15:27:47 +01:00
|
|
|
'';
|
2013-04-28 11:59:00 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/share/slic3r/"
|
|
|
|
cp -r * "$out/share/slic3r/"
|
2014-08-20 15:27:47 +01:00
|
|
|
wrapProgram "$out/share/slic3r/slic3r.pl" \
|
|
|
|
--prefix PERL5LIB : "$out/share/slic3r/xs/blib/arch:$out/share/slic3r/xs/blib/lib:$PERL5LIB"
|
2013-04-28 11:59:00 +01:00
|
|
|
mkdir -p "$out/bin"
|
|
|
|
ln -s "$out/share/slic3r/slic3r.pl" "$out/bin/slic3r"
|
|
|
|
mkdir -p "$out/share/pixmaps/"
|
|
|
|
ln -s "$out/share/slic3r/var/Slic3r.png" "$out/share/pixmaps/slic3r.png"
|
|
|
|
mkdir -p "$out/share/applications"
|
|
|
|
cp "$desktopItem"/share/applications/* "$out/share/applications/"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "G-code generator for 3D printers";
|
|
|
|
longDescription = ''
|
|
|
|
Slic3r is the tool you need to convert a digital 3D model into printing
|
|
|
|
instructions for your 3D printer. It cuts the model into horizontal
|
|
|
|
slices (layers), generates toolpaths to fill them and calculates the
|
|
|
|
amount of material to be extruded.'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://slic3r.org/";
|
2013-04-28 11:59:00 +01:00
|
|
|
license = licenses.agpl3;
|
|
|
|
platforms = platforms.linux;
|
2020-05-09 10:25:07 +01:00
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2013-04-28 11:59:00 +01:00
|
|
|
};
|
|
|
|
}
|