%global orig slic3r Name: %{orig}-prusa3d Version: 1.41.3 Release: 1%{?dist} Summary: G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.) License: AGPLv3 and CC-BY # Images are CC-BY, code is AGPLv3 URL: https://github.com/prusa3d/Slic3r Source0: https://github.com/prusa3d/Slic3r/archive/version_%{version}.tar.gz # Modify Build.PL so we are able to build this on Fedora Patch0: %{orig}-buildpl.patch # Use /usr/share/slic3r as datadir Patch1: %{orig}-datadir.patch Patch2: %{orig}-english-locale.patch Patch3: %{orig}-linker.patch #Patch4: %%{orig}-clipper.patch Patch5: %{orig}-nlopt-fix.patch Patch6: %{orig}-wayland.patch Patch7: %{orig}-boost169.patch Source1: %{name}.desktop Source2: %{name}.appdata.xml # This Slic3r does not support big endian # https://github.com/prusa3d/Slic3r/commit/2085a482c76d88bfbb7ed8b5c598ff9f7ed8788f # Does not seem to like wxWidgets on armv7hl or aarch64 either ExcludeArch: ppc64 ppc64p7 s390x armv7hl aarch64 BuildRequires: boost-devel BuildRequires: cmake BuildRequires: curl-devel BuildRequires: desktop-file-utils BuildRequires: eigen3-devel BuildRequires: expat-devel BuildRequires: gcc-c++ BuildRequires: glew-devel BuildRequires: gtest-devel BuildRequires: ImageMagick BuildRequires: NLopt-devel BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl(Alien::wxWidgets) # The Build.PL uses this, but we don't use it, so nah. # BuildRequires: perl(App::cpanminus) BuildRequires: perl(Class::XSAccessor) BuildRequires: perl(Devel::CheckLib) BuildRequires: perl(Encode::Locale) >= 1.05 BuildRequires: perl(ExtUtils::CBuilder) BuildRequires: perl(ExtUtils::Embed) BuildRequires: perl(ExtUtils::MakeMaker) >= 6.80 BuildRequires: perl(ExtUtils::ParseXS) >= 3.22 BuildRequires: perl(ExtUtils::Typemaps::Default) >= 1.05 BuildRequires: perl(ExtUtils::Typemaps::Basic) BuildRequires: perl(ExtUtils::Typemaps) >= 1.00 BuildRequires: perl(File::Basename) BuildRequires: perl(File::Spec) BuildRequires: perl(Getopt::Long) BuildRequires: perl(Growl::GNTP) >= 0.15 BuildRequires: perl(IO::Scalar) BuildRequires: perl(List::Util) BuildRequires: perl(Math::PlanePath) >= 53 BuildRequires: perl(Module::Build::WithXSpp) >= 0.14 BuildRequires: perl(Moo) >= 1.003001 BuildRequires: perl(parent) BuildRequires: perl(POSIX) BuildRequires: perl(Scalar::Util) BuildRequires: perl(Storable) BuildRequires: perl(SVG) BuildRequires: perl(Test::Harness) BuildRequires: perl(Test::More) BuildRequires: perl(Thread::Semaphore) BuildRequires: perl(threads) >= 1.96 BuildRequires: perl(Time::HiRes) BuildRequires: perl(Unicode::Normalize) BuildRequires: perl(Wx) BuildRequires: perl(XML::SAX) BuildRequires: perl(XML::SAX::ExpatXS) # BuildRequires: poly2tri-devel BuildRequires: qhull-devel BuildRequires: tbb-devel BuildRequires: wxBase3-devel BuildRequires: wxGTK3-devel #BuildRequires: admesh-devel >= 0.98.1 #BuildRequires: polyclipping-devel >= 6.2.0 Requires: perl(XML::SAX) Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) #Requires: admesh-libs >= 0.98.1 Requires: hicolor-icon-theme # For faster slicing Recommends: perl(Thread::Queue) # Fedora polyclipping version is not compatible Provides: bundled(polyclipping) = 6.2.9 # Easier just to leave this in place Provides: bundled(poly2tri) # Upstream has custom patches, reluctant to send to upstream Provides: bundled(admesh-libs) = 0.98.1 %description This is Slic3r Prusa Edition, a modified version of Slic3r adding more features not only useful for the Prusa printers. Slic3r is a G-code generator for 3D printers. It's compatible with RepRaps, Makerbots, Ultimakers and many more machines. See the project homepage at slic3r.org and the documentation on the Slic3r wiki for more information. %prep %setup -qn Slic3r-version_%{version} # %%patch0 -p1 %patch1 -p1 -b .datadir # %%patch2 -p1 -b .english # %%patch3 -p1 -b .linker #%%patch4 -p1 %if %{?fedora} < 30 %patch5 -p1 -b .nloptfix %endif %patch6 -p1 -b .wayland %patch7 -p1 -b .boost169 # Remove bundled libs #rm -rf xs/src/admesh #rm xs/src/clipper.*pp # rm -rf xs/src/poly2tri # rm -rf xs/src/boost # rm -rf xs/src/glew # There is also Shiny, a profiler. But it's basically ifdefed out. # Fix the version sed -i 's/#define SLIC3R_VERSION .*$/#define SLIC3R_VERSION "%{version}"/' xs/src/libslic3r/libslic3r.h # Fix the shebang sed -i 's|#!/usr/bin/env perl|#!%{__perl}|' %{orig}.pl ##################### # Move it to a separate namespace, so it does not conflict with the slic3r package mv lib/Slic3r lib/Slic3rPrusa mv lib/Slic3r.pm lib/Slic3rPrusa.pm mv xs/lib/Slic3r xs/lib/Slic3rPrusa # Perl find . \( -name '*.pm' -o -name '*.t' -o -name '*.pl' -o -name '*.PL' -o -name '*.xsp' -o -name '*.map' \) -exec \ sed -i -e 's/Slic3r::/Slic3rPrusa::/g' \ -e 's/package Slic3r;/package Slic3rPrusa;/g' \ -e 's/{Slic3r};/{Slic3rPrusa};/g' \ -e 's/use Slic3r;/use Slic3rPrusa;/g' \ {} \; sed -i 's|/Slic3r/|/Slic3rPrusa/|g' xs/CMakeLists.txt sed -i 's|lib/Slic3r|lib/Slic3rPrusa|g' CMakeLists.txt # C++ find xs/src \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) -exec \ sed -i -e 's/Slic3r::/Slic3rPrusa::/g' \ -e 's/namespace Slic3r/namespace Slic3rPrusa/g' \ -e 's/MsgUpdateSlic3rPrusa/MsgUpdateSlic3r/g' \ {} \; find src \( -name '*.cpp' -o -name '*.c' -o -name '*.hpp' -o -name '*.h' \) -exec \ sed -i -e 's/Slic3r::/Slic3rPrusa::/g' \ -e 's/namespace Slic3r/namespace Slic3rPrusa/g' \ -e 's/MsgUpdateSlic3rPrusa/MsgUpdateSlic3r/g' \ {} \; # Settings directory sed -i 's/GetUserDataDir)/GetUserDataDir)."Prusa"/' lib/Slic3rPrusa/GUI.pm ##################### %build # perl ./Build.PL installdirs=vendor optimize="$RPM_OPT_FLAGS" mkdir Build pushd Build %{cmake} .. -DCMAKE_BUILD_TYPE=Release %{make_build} popd # prepare pngs in mutliple sizes for res in 16 24 32 48 128; do mkdir -p hicolor/${res}x${res}/apps done cd hicolor convert ../resources/icons/Slic3r.ico %{name}.png cp %{name}-0.png 128x128/apps/%{name}.png cp %{name}-2.png 48x48/apps/%{name}.png cp %{name}-3.png 32x32/apps/%{name}.png cp %{name}-4.png 24x24/apps/%{name}.png cp %{name}-5.png 16x16/apps/%{name}.png rm %{name}-*.png cd - # To avoid "iCCP: Not recognized known sRGB profile that has been edited" cd resources/icons/ find . -type f -name "*.png" -exec convert {} -strip {} \; cd - %install pushd Build %{make_install} popd %if 0 ./Build install destdir=%{buildroot} create_packlist=0 cd - find %{buildroot} -type f -name '*.bs' -size 0 -exec rm -f {} \; # I see no way of installing slic3r with it's build script # So I copy the files around manually mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{perl_vendorlib} cp -a %{orig}.pl %{buildroot}%{_bindir}/%{name} cp -ar lib/* %{buildroot}%{perl_vendorlib} %endif mkdir -p %{buildroot}%{_datadir}/%{name} cp -a resources/* %{buildroot}%{_datadir}/%{name} mkdir -p %{buildroot}%{_datadir}/icons mkdir -p %{buildroot}%{_datadir}/appdata cp -r hicolor %{buildroot}%{_datadir}/icons desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1} cp %{SOURCE2} %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml mv %{buildroot}/usr/lib/slic3r-prusa3d/* %{buildroot}%{perl_vendorarch}/ mv %{buildroot}%{perl_vendorlib}/Slic3r %{buildroot}%{perl_vendorlib}/Slic3rPrusa %{_fixperms} %{buildroot}* %files %doc README.md %{_bindir}/%{name} %{perl_vendorlib}/Slic3rPrusa* %{perl_vendorarch}/Slic3rPrusa* %{perl_vendorarch}/auto/Slic3rPrusa* %{_datadir}/icons/hicolor/*/apps/%{name}.png %{_datadir}/applications/%{name}.desktop %{_datadir}/appdata/%{name}.appdata.xml %{_datadir}/%{name} %changelog * Fri Feb 15 2019 Jason L Tibbitts III - 1.41.3-1 - Update to 1.41.3. * Sat Feb 02 2019 Fedora Release Engineering - 1.41.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Wed Jan 30 2019 Jonathan Wakely - 1.41.0-3 - Rebuilt and patched for Boost 1.69 * Sun Dec 23 2018 Miro Hrončok - 1.41.0-2 - Set GDK_BACKEND=x11 to prevent crashes on Wayland (#1661324) * Mon Oct 1 2018 Tom Callaway - 1.41.0-1 - update to 1.41.0 * Sat Jul 14 2018 Fedora Release Engineering - 1.33.8-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Sat Jun 30 2018 Jitka Plesnikova - 1.33.8-11 - Perl 5.28 rebuild * Tue Jun 05 2018 Jitka Plesnikova - 1.33.8-10 - Add missing BR perl(ExtUtils::CBuilder) * Fri Feb 09 2018 Fedora Release Engineering - 1.33.8-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Thu Jan 18 2018 Igor Gnatenko - 1.33.8-8 - Remove obsolete scriptlets - Rebuilt for new boost * Thu Aug 03 2017 Fedora Release Engineering - 1.33.8-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 1.33.8-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Wed Jul 19 2017 Jonathan Wakely - 1.33.8-5 - Rebuilt for s390x binutils bug * Tue Jul 18 2017 Jonathan Wakely - 1.33.8-4 - Rebuilt for Boost 1.64 * Thu Jun 08 2017 Jitka Plesnikova - 1.33.8-3 - Perl 5.26 re-rebuild of bootstrapped packages * Mon May 15 2017 Fedora Release Engineering - 1.33.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild * Wed Feb 22 2017 Miro Hrončok - 1.33.8-1 - Update to 1.33.8 - Mention it's a fork in the description and appdata file - Require hicolor-icon-theme - Exclude big endian arches * Sat Dec 17 2016 Miro Hrončok - 1.31.6-1 - Update to 1.31.6 - Bundle admesh - Recommend Thread::Queue for faster slicing - Unbundle glew * Fri Nov 11 2016 Miro Hrončok - 1.31.4-1 - New package adapted from the slic3r package