File slic3r-prusa-edition.spec of Package slic3r-prusa-edition
#
# spec file for package slic3r-prusa-edition
#
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define bname slic3r
Name: slic3r-prusa-edition
Version: 1.38.3
Release: 0
Summary: G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
License: AGPL-3.0 and CC-BY-3.0
Group: Hardware/Printing
# Images are CC-BY, code is AGPLv3
Url: https://www.prusaprinters.org/introducing-slic3r-prusa-edition/
# see _service file
Source0: Slic3r-%{version}.tar.xz
Source1: %{name}.desktop
Source2: %{name}.appdata.xml
Patch0: slic3r-buildpl.patch
Patch1: slic3r-nowarn-datadir.patch
Patch2: threads.patch
Patch3: slic3r-xs-linkperl.patch
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: eigen3-devel
BuildRequires: glew-devel
BuildRequires: libboost_filesystem-devel
BuildRequires: libboost_locale-devel
BuildRequires: libboost_log-devel
BuildRequires: libboost_thread-devel
BuildRequires: libexpat-devel
BuildRequires: perl(Boost::Geometry::Utils) >= 0.06
BuildRequires: perl(Class::XSAccessor)
BuildRequires: perl(File::Spec)
BuildRequires: perl(Growl::GNTP)
BuildRequires: perl(IO::Scalar)
BuildRequires: perl(List::Util)
BuildRequires: perl(Math::Clipper) >= 1.17
BuildRequires: perl(Math::ConvexHull) >= 1.0.4
BuildRequires: perl(Math::ConvexHull::MonotoneChain)
BuildRequires: perl(Math::Geometry::Voronoi)
BuildRequires: perl(Math::PlanePath)
BuildRequires: perl(Module::Build)
BuildRequires: perl(Moo) >= 0.091009
BuildRequires: perl(Net::DBus)
BuildRequires: perl(SVG)
BuildRequires: perl(Scalar::Util)
BuildRequires: perl(Test::More)
BuildRequires: perl(Wx)
BuildRequires: perl(XML::SAX)
BuildRequires: perl(XML::SAX::ExpatXS)
BuildRequires: perl(parent)
BuildRequires: perl(Encode::Locale)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.80
BuildRequires: perl(ExtUtils::ParseXS) >= 3.22
BuildRequires: perl(Module::Build::WithXSpp) >= 0.14
BuildRequires: perl(ExtUtils::Typemaps::Default)
BuildRequires: tbb-devel
BuildRequires: ImageMagick
BuildRequires: wxWidgets-3_0-nostl-devel
Requires: perl(Class::XSAccessor)
Requires: perl(Growl::GNTP)
Requires: perl(Net::DBus)
Requires: perl(XML::SAX)
Requires: perl(Moo) >= 0.091009
Requires: perl(Boost::Geometry::Utils)
Requires: perl(Encode::Locale)
Requires: perl(local::lib)
Requires: perl(Math::Geometry::Voronoi)
Requires: perl(Math::PlanePath::ArchimedeanChords)
Requires: perl(Math::ConvexHull::MonotoneChain)
Requires: perl(Wx)
Recommends: perl(Wx::GLCanvas)
Recommends: perl(OpenGL)
%description
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.
%package gui
Summary: Slic3r GUI
Requires: font(:lang=en)
Requires: perl(LWP::UserAgent)
Requires: perl(OpenGL)
Requires: perl(Wx::GLCanvas)
%description gui
Slic3r is a G-code generator for 3D printers. This package contains the GUI.
%prep
%setup -qn Slic3r-%{version}
#%%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
export SLIC3R_NO_AUTO=1
perl Build.PL installdirs=vendor optimize="$RPM_OPT_FLAGS"
perl Build.PL installdirs=vendor optimize="$RPM_OPT_FLAGS" --gui
%cmake
%make_jobs
cd -
# prepare pngs in mutliple sizes
for res in 22 32 48 64 128; do
mkdir -p hicolor/${res}x${res}/apps
done
cd hicolor
convert ../var/Slic3r.ico %{name}.png
cp %{name}-0.png 128x128/apps/%{name}.png
cp %{name}-1.png 64x64/apps/%{name}.png
cp %{name}-2.png 48x48/apps/%{name}.png
cp %{name}-3.png 32x32/apps/%{name}.png
cp %{name}-4.png 22x22/apps/%{name}.png
rm %{name}-*.png
%install
# 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}
mkdir -p %{buildroot}%{_datadir}/%{name}
mkdir -p %{buildroot}%{_datadir}/icons
mkdir -p %{buildroot}%{_datadir}/metainfo
sed -i -e 's#/usr/bin/env .*#/usr/bin/perl#' %{bname}.pl
cp -a %{bname}.pl %{buildroot}%{_bindir}/%{name}
cp -ar lib/* %{buildroot}%{perl_vendorlib}
cp -ar local-lib/lib/perl5/* %{buildroot}%{perl_vendorlib}
cp -a var/* %{buildroot}%{_datadir}/%{name}
cp -r hicolor %{buildroot}%{_datadir}/icons
# delete MacOS/Windows and some unused icons
rm %{buildroot}%{_datadir}/%{name}/{Slic3r.icns,Slic3r*.ico,joystick.png,package_green.png}
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
install -m 0644 -t %{buildroot}%{_datadir}/metainfo %{SOURCE2}
%check
#cd xs
#./Build test
#cd -
#SLIC3R_NO_AUTO=1 perl Build.PL installdirs=vendor
# the --gui runs no tests, it only checks requires
%files
%doc README.md
%{_bindir}/%{name}
%{perl_vendorlib}/Slic3r*
%{_datadir}/%{name}
%{_datadir}/metainfo/%{name}*
%{perl_vendorarch}/Slic3r*
%{perl_vendorarch}/auto/Slic3r*
%files gui
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%changelog