2023-07-15 17:15:38 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, perl, makeWrapper
|
2023-04-12 12:48:02 +00:00
|
|
|
, makeDesktopItem, which, perlPackages, boost, wrapGAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "1.3.0";
|
|
|
|
pname = "slic3r";
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alexrj";
|
|
|
|
repo = "Slic3r";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = version;
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-cf0QTOzhLyTcbJryCQoTVzU8kfrPV6SLpqi4s36X5N0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper which wrapGAppsHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs =
|
|
|
|
[boost] ++
|
2022-09-09 14:08:57 +00:00
|
|
|
(with perlPackages; [ perl
|
2020-04-24 23:36:52 +00:00
|
|
|
EncodeLocale MathClipper ExtUtilsXSpp
|
|
|
|
MathConvexHullMonotoneChain MathGeometryVoronoi MathPlanePath Moo
|
|
|
|
IOStringy ClassXSAccessor Wx GrowlGNTP NetDBus ImportInto XMLSAX
|
|
|
|
ExtUtilsMakeMaker OpenGL WxGLCanvas ModuleBuild LWP
|
|
|
|
ExtUtilsCppGuess ModuleBuildWithXSpp ExtUtilsTypemapsDefault
|
|
|
|
DevelChecklib locallib
|
|
|
|
]);
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "slic3r";
|
|
|
|
exec = "slic3r";
|
|
|
|
icon = "slic3r";
|
|
|
|
comment = "G-code generator for 3D printers";
|
|
|
|
desktopName = "Slic3r";
|
|
|
|
genericName = "3D printer tool";
|
2022-03-05 16:20:37 +00:00
|
|
|
categories = [ "Development" ];
|
2020-04-24 23:36:52 +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
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://web.archive.org/web/20230606220657if_/https://sources.debian.org/data/main/s/slic3r/1.3.0%2Bdfsg1-5/debian/patches/Drop-error-admesh-works-correctly-on-little-endian-machin.patch";
|
|
|
|
hash = "sha256-+F94jzMFBdI++SKgyEZTBaHFVbjxWwgJa8YVbpK0euI=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://web.archive.org/web/20230606220036if_/https://sources.debian.org/data/main/s/slic3r/1.3.0+dfsg1-5/debian/patches/0006-Fix-FTBFS-with-Boost-1.71.patch";
|
|
|
|
hash = "sha256-4jvNccttig5YI1hXSANAWxVz6C4+kowlacMXVCpFgOo=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://web.archive.org/web/20230606220054if_/https://sources.debian.org/data/main/s/slic3r/1.3.0+dfsg1-5/debian/patches/fix_boost_174.patch";
|
|
|
|
hash = "sha256-aSmxc2htmrla9l/DIRWeKdBW0LTV96wMUZSLLNjgbzY=";
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
export SLIC3R_NO_AUTO=true
|
|
|
|
export LD=$CXX
|
|
|
|
export PERL5LIB="./xs/blib/arch/:./xs/blib/lib:$PERL5LIB"
|
|
|
|
|
|
|
|
substituteInPlace Build.PL \
|
|
|
|
--replace "0.9918" "0.9923" \
|
|
|
|
--replace "eval" ""
|
|
|
|
|
|
|
|
pushd xs
|
|
|
|
perl Build.PL
|
|
|
|
perl Build
|
|
|
|
popd
|
|
|
|
|
|
|
|
perl Build.PL --gui
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/share/slic3r/"
|
|
|
|
cp -r * "$out/share/slic3r/"
|
|
|
|
wrapProgram "$out/share/slic3r/slic3r.pl" \
|
|
|
|
--prefix PERL5LIB : "$out/share/slic3r/xs/blib/arch:$out/share/slic3r/xs/blib/lib:$PERL5LIB"
|
|
|
|
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/"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "G-code generator for 3D printers";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "slic3r";
|
2020-04-24 23:36:52 +00:00
|
|
|
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.'';
|
|
|
|
homepage = "https://slic3r.org/";
|
2024-04-21 15:54:59 +00:00
|
|
|
license = licenses.agpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2020-05-15 21:57:56 +00:00
|
|
|
maintainers = with maintainers; [ bjornfor ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|