4 # Don't turn on systems if test suite fails.
5 # Test suite works fine with bundled libs, so the only way
6 # to turn on system libs is to make sure test suite works
8 %bcond_without system_admesh
9 %bcond_without system_poly2tri
10 %bcond_with system_polyclipping
12 %define admesh_ver 0.98.1
13 %define perl_encode_locale_ver 1.05
14 %define perl_threads_ver 2.00
16 %include /usr/lib/rpm/macros.perl
17 Summary: G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
18 Summary(pl.UTF-8): Generator G-code dla drukarek 3D (RepRap, Makerbot, Ultimaker itp.)
22 License: AGPL v3 (code), CC-BY (images)
23 Group: Applications/Engineering
24 Source0: https://github.com/alexrj/Slic3r/archive/%{version}.tar.gz
25 # Source0-md5: 05ac7b137cbb7b12f442776e4c12dcc2
26 Source1: %{name}.desktop
27 Source2: %{name}.appdata.xml
28 # Modify Build.PL so we are able to build this on Fedora
29 Patch0: %{name}-buildpl.patch
30 # Don't warn for Perl >= 5.16
31 # Use /usr/share/slic3r as datadir
32 # Those two are located at the same place at the code, so the patch is merged
33 Patch1: %{name}-nowarn-datadir.patch
34 Patch2: %{name}-english-locale.patch
35 Patch3: %{name}-linker.patch
36 Patch4: %{name}-clipper.patch
37 Patch5: boost-1.60.patch
38 Patch6: %{name}-boolcast.patch
39 Patch7: %{name}-opengl070.patch
40 Patch8: %{name}-wxclose.patch
41 URL: http://slic3r.org/
42 BuildRequires: ImageMagick
43 BuildRequires: boost-devel
44 BuildRequires: desktop-file-utils
45 BuildRequires: perl(ExtUtils::MakeMaker) >= 6.80
46 BuildRequires: perl(ExtUtils::ParseXS) >= 3.22
47 BuildRequires: perl(ExtUtils::Typemaps::Default) >= 1.05
48 BuildRequires: perl(Growl::GNTP) >= 0.15
49 BuildRequires: perl(Math::ConvexHull) >= 1.0.4
50 BuildRequires: perl(Math::Geometry::Voronoi) >= 1.3
51 BuildRequires: perl(Math::PlanePath) >= 53
52 BuildRequires: perl(Module::Build::WithXSpp) >= 0.14
53 BuildRequires: perl(Moo) >= 1.003001
54 BuildRequires: perl-Class-XSAccessor
55 BuildRequires: perl-Encode-Locale >= %{perl_encode_locale_ver}
56 BuildRequires: perl-ExtUtils-Typemap
57 BuildRequires: perl-IO-stringy
58 BuildRequires: perl-Math-ConvexHull-MonotoneChain
59 BuildRequires: perl-SVG
60 BuildRequires: perl-Wx
61 BuildRequires: perl-XML-SAX
62 BuildRequires: perl-XML-SAX-ExpatXS
63 BuildRequires: perl-devel >= 1:5.8.0
64 BuildRequires: perl-modules
65 BuildRequires: perl-threads >= %{perl_threads_ver}
66 %{?with_system_poly2tri:BuildRequires: poly2tri-devel}
67 %{?with_system_polyclipping:BuildRequires: polyclipping-devel >= 6.2.9}
68 BuildRequires: rpm-perlprov >= 4.1-13
69 %if %{with system_admesh}
70 BuildRequires: admesh-devel >= %{admesh_ver}
71 Requires: admesh-libs >= %{admesh_ver}
73 Requires: perl-Encode-Locale >= %{perl_encode_locale_ver}
74 Requires: perl-threads >= %{perl_threads_ver}
75 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
78 Slic3r is a G-code generator for 3D printers. It's compatible with
79 RepRaps, Makerbots, Ultimakers and many more machines. See the project
80 homepage at http://slic3r.org/ and the documentation on the Slic3r
81 wiki for more information.
83 %description -l pl.UTF-8
84 Slic3r to generator G-code dla drukarek 3D. Jest zgodny z urządzeniami
85 RepRap, Makerbot, Ultimaker i wieloma innymi. Więcej informacji można
86 znaleźć na stronie projektu http://slic3r.org/ oraz na wiki projektu
90 %setup -qn Slic3r-%{version}
96 %{?with_system_polyclipping:%patch4 -p1}
102 # Remove bundled admesh, clipper, poly2tri and boost
103 %{?with_system_admesh:%{__rm} -r xs/src/admesh}
104 %{?with_system_polyclipping:%{__rm} xs/src/clipper.*pp}
105 %{?with_system_poly2tri:%{__rm} -r xs/src/poly2tri}
106 %{__rm} -r xs/src/boost
110 %{?with_system_admesh:SYSTEM_ADMESH=1} \
111 %{?with_system_polyclipping:SYSTEM_POLYCLIPPING=1} \
112 %{?with_system_poly2tri:SYSTEM_POLY2TRI=1} \
113 %{__perl} ./Build.PL \
115 optimize="%{rpmcflags}"
121 ./Build test verbose=1
126 # the --gui runs no tests, it only checks requires
129 # prepare pngs in mutliple sizes
130 for res in 16 32 48 128 256; do
131 mkdir -p hicolor/${res}x${res}/apps
134 convert ../var/Slic3r.ico %{name}.png
135 cp %{name}-0.png 256x256/apps/%{name}.png
136 cp %{name}-1.png 128x128/apps/%{name}.png
137 cp %{name}-2.png 48x48/apps/%{name}.png
138 cp %{name}-3.png 32x32/apps/%{name}.png
139 cp %{name}-4.png 16x16/apps/%{name}.png
143 # To avoid "iCCP: Not recognized known sRGB profile that has been edited"
145 find . -type f -name "*.png" -exec convert {} -strip {} \;
149 rm -rf $RPM_BUILD_ROOT
151 ./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
153 find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \;
155 # I see no way of installing slic3r with it's build script
156 # So I copy the files around manually
157 install -d $RPM_BUILD_ROOT%{_bindir}
158 install -d $RPM_BUILD_ROOT%{perl_vendorlib}
159 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
160 install -d $RPM_BUILD_ROOT%{_datadir}/icons
161 install -d $RPM_BUILD_ROOT%{_datadir}/appdata
163 cp -a %{name}.pl $RPM_BUILD_ROOT%{_bindir}/%{name}
164 cp -a lib/* $RPM_BUILD_ROOT%{perl_vendorlib}
166 cp -a var/* $RPM_BUILD_ROOT%{_datadir}/%{name}
167 cp -r hicolor $RPM_BUILD_ROOT%{_datadir}/icons
168 desktop-file-install --dir=$RPM_BUILD_ROOT%{_desktopdir} %{SOURCE1}
170 cp %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml
172 %{_fixperms} $RPM_BUILD_ROOT*
175 rm -rf $RPM_BUILD_ROOT
178 %update_icon_cache hicolor
181 if [ $1 -eq 0 ] ; then
182 %update_icon_cache hicolor
186 %defattr(644,root,root,755)
188 %attr(755,root,root) %{_bindir}/%{name}
189 %{perl_vendorlib}/Slic3r*
190 %{perl_vendorarch}/Slic3r*
191 %{perl_vendorarch}/auto/Slic3r*
192 %{_iconsdir}/hicolor/*/apps/%{name}.png
193 %{_desktopdir}/%{name}.desktop
194 %{_datadir}/appdata/%{name}.appdata.xml