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