diff --git a/slic3r-1.3.0-fixtest.patch b/slic3r-1.3.0-fixtest.patch new file mode 100644 index 0000000..6fa81bd --- /dev/null +++ b/slic3r-1.3.0-fixtest.patch @@ -0,0 +1,11 @@ +diff -up Slic3r-1.3.0/t/gcode.t.fixtest Slic3r-1.3.0/t/gcode.t +--- Slic3r-1.3.0/t/gcode.t.fixtest 2018-06-25 11:59:06.226705956 -0400 ++++ Slic3r-1.3.0/t/gcode.t 2018-06-25 11:59:42.289840358 -0400 +@@ -186,6 +186,7 @@ use Slic3r::Test; + { + my $config = Slic3r::Config->new_from_defaults; + $config->set('gcode_flavor', 'sailfish'); ++ $config->set('layer_height', '0.4'); + my $print = Slic3r::Test::init_print('20mm_cube', config => $config, scale_xyz => [1,1, 1/(20/$config->layer_height) ]); + $test->($print, 'one layer object'); + } diff --git a/slic3r-clipper.patch b/slic3r-clipper.patch index 820ef87..be8e593 100644 --- a/slic3r-clipper.patch +++ b/slic3r-clipper.patch @@ -1,18 +1,18 @@ diff --git a/xs/src/libslic3r/ClipperUtils.hpp b/xs/src/libslic3r/ClipperUtils.hpp -index ab144f2..86331ac 100644 +index ddd551c..8149366 100644 --- a/xs/src/libslic3r/ClipperUtils.hpp +++ b/xs/src/libslic3r/ClipperUtils.hpp @@ -2,7 +2,7 @@ #define slic3r_ClipperUtils_hpp_ - #include + #include -#include "clipper.hpp" +#include #include "ExPolygon.hpp" #include "Polygon.hpp" #include "Surface.hpp" diff --git a/xs/src/libslic3r/Geometry.cpp b/xs/src/libslic3r/Geometry.cpp -index 827029a..e5b54bb 100644 +index 7bcb644..5258485 100644 --- a/xs/src/libslic3r/Geometry.cpp +++ b/xs/src/libslic3r/Geometry.cpp @@ -3,7 +3,7 @@ @@ -22,16 +22,29 @@ index 827029a..e5b54bb 100644 -#include "clipper.hpp" +#include #include + #include #include - #include +diff --git a/xs/src/libslic3r/SVG.hpp b/xs/src/libslic3r/SVG.hpp +index fbb5e37..bb9f4cc 100644 +--- a/xs/src/libslic3r/SVG.hpp ++++ b/xs/src/libslic3r/SVG.hpp +@@ -2,7 +2,7 @@ + #define slic3r_SVG_hpp_ + + #include "libslic3r.h" +-#include "clipper.hpp" ++#include + #include "ExPolygon.hpp" + #include "Line.hpp" + #include "TriangleMesh.hpp" diff --git a/xs/xsp/Clipper.xsp b/xs/xsp/Clipper.xsp -index d9530f7..3ba2448 100644 +index 7bbbdb8..8b52133 100644 --- a/xs/xsp/Clipper.xsp +++ b/xs/xsp/Clipper.xsp @@ -2,7 +2,7 @@ %{ - #include + #include -#include "clipper.hpp" +#include #include "libslic3r/ClipperUtils.hpp" diff --git a/slic3r-datadir.patch b/slic3r-datadir.patch index f438564..6dc17ae 100644 --- a/slic3r-datadir.patch +++ b/slic3r-datadir.patch @@ -2,12 +2,12 @@ diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 154af90..ef8274c 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm -@@ -30,7 +30,7 @@ warn "Running Slic3r under Perl 5.16 is not supported nor recommended\n" - if $^V == v5.16; +@@ -42,7 +42,7 @@ warn "Running Slic3r under Perl 5.16 is neither supported nor recommended\n" use FindBin; --our $var = decode_path($FindBin::Bin) . "/var"; -+our $var = "/usr/share/slic3r"; - - use Moo 1.003001; - + # Path to the images. +-my $varpath = decode_path($FindBin::Bin) . "/var"; ++my $varpath = "/usr/share/slic3r"; + if ($^O eq 'darwin' && !-d $varpath) { + $varpath = decode_path($FindBin::Bin) . "/../Resources/var"; + } diff --git a/slic3r-english-locale.patch b/slic3r-english-locale.patch index d01a79a..4c21b2a 100644 --- a/slic3r-english-locale.patch +++ b/slic3r-english-locale.patch @@ -1,12 +1,12 @@ diff --git a/slic3r.pl b/slic3r.pl -index a533250..814d8b7 100755 +index 11dc2fa..80e6dc7 100755 --- a/slic3r.pl +++ b/slic3r.pl -@@ -11,6 +11,7 @@ BEGIN { +@@ -13,6 +13,7 @@ use File::Basename qw(basename); use Getopt::Long qw(:config no_auto_abbrev); use List::Util qw(first); - use POSIX qw(setlocale LC_NUMERIC); + use POSIX qw(setlocale LC_NUMERIC ceil); +$ENV{LC_NUMERIC} = 'en_US.UTF-8'; use Slic3r; + use Slic3r::Geometry qw(epsilon X Y Z deg2rad); use Time::HiRes qw(gettimeofday tv_interval); - $|++; diff --git a/slic3r-linker.patch b/slic3r-linker.patch index 91f9e60..f1304b4 100644 --- a/slic3r-linker.patch +++ b/slic3r-linker.patch @@ -1,15 +1,15 @@ -diff --git a/xs/Build.PL b/xs/Build.PL -index bc18bc5..9e2ce40 100644 ---- a/xs/Build.PL -+++ b/xs/Build.PL -@@ -41,6 +41,10 @@ my $build = Module::Build::WithXSpp->new( - Module::Build::WithXSpp 0.13 - )}, - extra_compiler_flags => \@cflags, -+ extra_linker_flags => [qw( -+ -ladmesh -+ -lpoly2tri -+ )], - - # Provides extra C typemaps that are auto-merged - extra_typemap_modules => { +diff -up Slic3r-1.3.0/xs/Build.PL.linker Slic3r-1.3.0/xs/Build.PL +--- Slic3r-1.3.0/xs/Build.PL.linker 2018-05-08 18:47:09.000000000 -0400 ++++ Slic3r-1.3.0/xs/Build.PL 2018-06-25 10:48:55.421774896 -0400 +@@ -30,6 +30,11 @@ push @cflags, qw(-std=c++11); + + my @ldflags = (); + ++if (defined $ENV{SYSTEM_LIBS}) { ++ my $syslibs = $ENV{SYSTEM_LIBS}; ++ push @ldflags, split(' ', $syslibs); ++} ++ + if ($linux && (defined $ENV{SLIC3R_STATIC} && $ENV{SLIC3R_STATIC})) { + push @ldflags, qw(-static-libgcc -static-libstdc++); + if ($ENV{TRAVIS}) { diff --git a/slic3r.spec b/slic3r.spec index b4b1376..d9622f5 100644 --- a/slic3r.spec +++ b/slic3r.spec @@ -1,6 +1,11 @@ +%global use_system_admesh 0 +%global use_system_expat 1 +%global use_system_polyclipping 1 +%global use_system_poly2tri 1 + Name: slic3r -Version: 1.2.9 -Release: 18%{?dist} +Version: 1.3.0 +Release: 2%{?dist} Summary: G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.) License: AGPLv3 and CC-BY # Images are CC-BY, code is AGPLv3 @@ -15,22 +20,8 @@ Patch0: %{name}-buildpl.patch Patch1: %{name}-datadir.patch Patch2: %{name}-english-locale.patch Patch3: %{name}-linker.patch -#Patch4: %{name}-clipper.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1306668 -# https://github.com/alexrj/Slic3r/issues/3117#issuecomment-187767676 -Patch5: %{name}-boost160.patch - -# Patch to manually cast too bool, fix FTBFS -# Will report upstream -Patch6: %{name}-boolcast.patch - -# https://bugzilla.redhat.com/show_bug.cgi?id=1285807 -# https://github.com/alexrj/Slic3r/commit/1a09ae81db06602050ae83620268efa33ed14da1 -Patch7: %{name}-wxclose.patch - -# https://github.com/alexrj/Slic3r/pull/3575 -Patch8: %{name}-opengl070.patch +Patch4: %{name}-clipper.patch +Patch5: %{name}-1.3.0-fixtest.patch Source1: %{name}.desktop Source2: %{name}.appdata.xml @@ -39,10 +30,13 @@ BuildRequires: gcc-c++ BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl(Class::XSAccessor) +BuildRequires: perl(Devel::CheckLib) +BuildRequires: perl(Devel::Peek) BuildRequires: perl(Encode::Locale) >= 1.05 +BuildRequires: perl(ExtUtils::CppGuess) BuildRequires: perl(ExtUtils::CBuilder) BuildRequires: perl(ExtUtils::MakeMaker) >= 6.80 -BuildRequires: perl(ExtUtils::ParseXS) >= 3.22 +BuildRequires: perl(ExtUtils::ParseXS) >= 3.35 BuildRequires: perl(ExtUtils::Typemaps::Default) >= 1.05 BuildRequires: perl(ExtUtils::Typemaps) >= 1.00 BuildRequires: perl(File::Basename) @@ -51,6 +45,7 @@ BuildRequires: perl(Getopt::Long) BuildRequires: perl(Growl::GNTP) >= 0.15 BuildRequires: perl(IO::Scalar) BuildRequires: perl(List::Util) +BuildRequires: perl(local::lib) BuildRequires: perl(Math::PlanePath) >= 53 BuildRequires: perl(Module::Build::WithXSpp) >= 0.14 BuildRequires: perl(Moo) >= 1.003001 @@ -61,26 +56,51 @@ BuildRequires: perl(Storable) BuildRequires: perl(SVG) BuildRequires: perl(Test::Harness) BuildRequires: perl(Test::More) +BuildRequires: perl(Thread::Queue) BuildRequires: perl(Thread::Semaphore) BuildRequires: perl(threads) >= 1.96 +BuildRequires: perl(threads::shared) BuildRequires: perl(Time::HiRes) BuildRequires: perl(Unicode::Normalize) BuildRequires: perl(Wx) BuildRequires: perl(XML::SAX) BuildRequires: perl(XML::SAX::ExpatXS) +%if %{use_system_admesh} BuildRequires: admesh-devel >= 0.98.1 +Requires: admesh-libs >= 0.98.1 +%else +Provides: bundled(admesh) = 0.98 +%endif + +%if %{use_system_expat} +BuildRequires: expat-devel >= 2.2.0 +%else +Provides: bundled(expat) = 2.2.0 +%endif + +%if %{use_system_polyclipping} +#BuildRequires: polyclipping-devel >= 6.4.2 +%else +Provides: bundled(polyclipping) = 6.4.2 +%endif + +%if %{use_system_poly2tri} +BuildRequires: poly2tri-devel +%else +Provides: bundled(poly2tri) = 0.0 +%endif + BuildRequires: boost-devel +BuildRequires: boost-nowide-devel BuildRequires: desktop-file-utils -BuildRequires: poly2tri-devel -#BuildRequires: polyclipping-devel >= 6.2.0 BuildRequires: ImageMagick - +Requires: perl(Growl::GNTP) >= 0.15 +# Not packaged in Fedora. +# It's only used for magically finding octoprint servers. +# Requires: perl(Net::Bonjour) Requires: perl(XML::SAX) Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) -Requires: admesh-libs >= 0.98.1 -Provides: bundled(polyclipping) = 6.2.9 - %description Slic3r is a G-code generator for 3D printers. It's compatible with RepRaps, @@ -94,21 +114,55 @@ for more information. %patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch3 -p1 -#%%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 - -# Remove bundled admesh, clipper, poly2tri and boost +%patch3 -p1 -b .linker +%if %{use_system_polyclipping} +%patch4 -p1 +%endif +%patch5 -p1 -b .fixtest + +# Optional removals +%if %{use_system_admesh} rm -rf xs/src/admesh +sed -i '/src\/admesh/d' xs/MANIFEST +%endif + +%if %{use_system_expat} +rm -rf xs/src/expat +sed -i '/src\/expat/d' xs/MANIFEST +# These are the files with hardcoded expat/expat.h includes +sed -i 's|expat/expat.h|expat.h|g' xs/src/libslic3r/IO/AMF.cpp +sed -i 's|expat/expat.h|expat.h|g' xs/src/libslic3r/IO/TMF.hpp +%endif + +%if %{use_system_polyclipping} #rm xs/src/clipper.*pp +export SYSTEM_LIBS="${SYSTEM_LIBS} -lpolyclipping" +%endif + +%if %{use_system_poly2tri} rm -rf xs/src/poly2tri +sed -i '/src\/poly2tri/d' xs/MANIFEST +%endif + +# We always do boost. rm -rf xs/src/boost +sed -i '/src\/boost\/nowide/d' xs/MANIFEST %build +%if %{use_system_admesh} +export SYSTEM_LIBS="${SYSTEM_LIBS} -ladmesh" +%endif + +%if %{use_system_expat} +export SYSTEM_LIBS="${SYSTEM_LIBS} -lexpat" +%endif + +%if %{use_system_poly2tri} +export SYSTEM_LIBS="${SYSTEM_LIBS} -lpoly2tri" +%endif + cd xs +[[ ! -z "${SYSTEM_LIBS}" ]] && echo "SYSTEM_LIBS is ${SYSTEM_LIBS}" perl ./Build.PL installdirs=vendor optimize="$RPM_OPT_FLAGS" ./Build cd - @@ -165,10 +219,6 @@ cd - SLIC3R_NO_AUTO=1 perl Build.PL installdirs=vendor # the --gui runs no tests, it only checks requires -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - %files %doc README.md %{_bindir}/%{name} @@ -184,6 +234,13 @@ SLIC3R_NO_AUTO=1 perl Build.PL installdirs=vendor %{_datadir}/%{name} %changelog +* Mon Jun 25 2018 Tom Callaway - 1.3.0-2 +- conditionalize bundled bits +- fix t/gcode.t (needed to define config->layer_height before trying to use it) + +* Thu May 31 2018 Miro HronĨok - 1.3.0-1 +- Update to 1.3.0 + * Tue Mar 06 2018 Petr Pisar - 1.2.9-18 - Adapt to removing GCC from a build root (bug #1547165) diff --git a/sources b/sources index a83feaf..e6da8b9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -05ac7b137cbb7b12f442776e4c12dcc2 1.2.9.tar.gz +SHA512 (1.3.0.tar.gz) = ff0f7747e166826ff1c53220974ee9d3a217d0e19964dbe4a5fa3e81f262a6810a47632686b7f1b3128384ae05c6f98d8aab980524079bdf9811445fe23a0f0d