Добавлен нестабильный slic3r
This commit is contained in:
parent
3ac786a017
commit
f940b067f4
1 changed files with 84 additions and 0 deletions
84
pkgs/misc/slic3r/default.nix
Normal file
84
pkgs/misc/slic3r/default.nix
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
{ lib, stdenv, fetchFromGitHub, perl, makeWrapper
|
||||||
|
, makeDesktopItem, which, perlPackages, boost
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
version = "unstable";
|
||||||
|
pname = "slic3r";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "slic3r";
|
||||||
|
repo = "Slic3r";
|
||||||
|
rev = "026c1380e0ad12176dd2fc8cdf8f6f181deeb071";
|
||||||
|
hash = "sha256-4ss6Kau7tx2WRkhFTvoeOUb65X1ka+8TsFtDI40/0Mo=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ makeWrapper which ];
|
||||||
|
buildInputs =
|
||||||
|
[boost] ++
|
||||||
|
(with perlPackages; [ perl
|
||||||
|
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";
|
||||||
|
categories = [ "Development" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
|
||||||
|
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/"
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = with 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.'';
|
||||||
|
homepage = "https://slic3r.org/";
|
||||||
|
license = licenses.agpl3;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
maintainers = with maintainers; [ bjornfor ];
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue