]> git.pld-linux.org Git - packages/slic3r.git/blob - slic3r.spec
a32563c931844c2dc15efa90d7327aef279a5723
[packages/slic3r.git] / slic3r.spec
1 %bcond_without  tests
2 %bcond_with     system_poly2tri
3 #
4 %include        /usr/lib/rpm/macros.perl
5 Summary:        G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
6 Name:           slic3r
7 Version:        1.2.8
8 Release:        1
9 License:        AGPLv3 and CC-BY
10 # Images are CC-BY, code is AGPLv3
11 Group:          Applications/Engineering
12 URL:            http://slic3r.org/
13 Source0:        https://github.com/alexrj/Slic3r/archive/%{version}.tar.gz
14 # Source0-md5:  8b9902eb089d5ce59b25a2c9b711ec69
15 Source1:        %{name}.desktop
16 Source2:        %{name}.appdata.xml
17 # Modify Build.PL so we are able to build this on Fedora
18 Patch0:         %{name}-buildpl.patch
19 # Don't warn for Perl >= 5.16
20 # Use /usr/share/slic3r as datadir
21 # Those two are located at the same place at the code, so the patch is merged
22 Patch1:         %{name}-nowarn-datadir.patch
23 Patch2:         %{name}-english-locale.patch
24 Patch3:         %{name}-linker.patch
25 Patch4:         %{name}-clear-error.patch
26 Patch5:         %{name}-test-out-of-memory.patch
27 Patch6:         %{name}-clipper.patch
28 Patch7:         %{name}-admesh.patch
29 BuildRequires:  ImageMagick
30 BuildRequires:  admesh-devel >= 0.98.1
31 BuildRequires:  boost-devel
32 BuildRequires:  desktop-file-utils
33 BuildRequires:  perl(ExtUtils::MakeMaker) >= 6.80
34 BuildRequires:  perl(ExtUtils::ParseXS) >= 3.22
35 BuildRequires:  perl(ExtUtils::Typemaps::Default) >= 1.05
36 BuildRequires:  perl(Growl::GNTP) >= 0.15
37 BuildRequires:  perl(Math::ConvexHull) >= 1.0.4
38 BuildRequires:  perl(Math::Geometry::Voronoi) >= 1.3
39 BuildRequires:  perl(Math::PlanePath) >= 53
40 BuildRequires:  perl(Module::Build::WithXSpp) >= 0.14
41 BuildRequires:  perl(Moo) >= 1.003001
42 BuildRequires:  perl-Class-XSAccessor
43 BuildRequires:  perl-Encode-Locale
44 BuildRequires:  perl-ExtUtils-Typemap
45 BuildRequires:  perl-IO-stringy
46 BuildRequires:  perl-Math-ConvexHull-MonotoneChain
47 BuildRequires:  perl-SVG
48 BuildRequires:  perl-Wx
49 BuildRequires:  perl-XML-SAX
50 BuildRequires:  perl-XML-SAX-ExpatXS
51 BuildRequires:  perl-devel >= 1:5.8.0
52 BuildRequires:  perl-modules
53 %{?with_system_poly2tri:BuildRequires:  poly2tri-devel}
54 BuildRequires:  polyclipping-devel >= 6.2.0
55 BuildRequires:  rpm-perlprov >= 4.1-13
56 Requires:       admesh-libs >= 0.97.5
57 Requires:       perl-threads >= 2.00
58 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
59
60 %description
61 Slic3r is a G-code generator for 3D printers. It's compatible with
62 RepRaps, Makerbots, Ultimakers and many more machines. See the project
63 homepage at slic3r.org and the documentation on the Slic3r wiki for
64 more information.
65
66 %prep
67 %setup -qn Slic3r-%{version}
68
69 %patch0 -p1
70 %patch1 -p1
71 %patch2 -p1
72 %if %{with system_poly2tri}
73 %patch3 -p1
74 %else
75 %patch7 -p1
76 %endif
77 #%patch4 -p1
78 #%patch5 -p1
79 %patch6 -p1
80
81 # Remove bundled admesh, clipper, poly2tri and boost
82 rm -rf xs/src/admesh
83 rm xs/src/clipper.*pp
84 %{?with_system_poly2tri:rm -rf xs/src/poly2tri}
85 rm -rf xs/src/boost
86
87 %build
88 cd xs
89 %{__perl} ./Build.PL installdirs=vendor optimize="$RPM_OPT_FLAGS"
90 ./Build
91 cd ..
92
93 %if %{with tests}
94 cd xs
95 ./Build test verbose=1
96 cd -
97 SLIC3R_NO_AUTO=1 perl Build.PL installdirs=vendor
98 # the --gui runs no tests, it only checks requires
99 %endif
100
101 # prepare pngs in mutliple sizes
102 for res in 16 32 48 128 256; do
103   mkdir -p hicolor/${res}x${res}/apps
104 done
105 cd hicolor
106 convert ../var/Slic3r.ico %{name}.png
107 cp %{name}-0.png 256x256/apps/%{name}.png
108 cp %{name}-1.png 128x128/apps/%{name}.png
109 cp %{name}-2.png 48x48/apps/%{name}.png
110 cp %{name}-3.png 32x32/apps/%{name}.png
111 cp %{name}-4.png 16x16/apps/%{name}.png
112 rm %{name}-*.png
113 cd -
114
115 # To avoid "iCCP: Not recognized known sRGB profile that has been edited"
116 cd var
117 find . -type f -name "*.png" -exec convert {} -strip {} \;
118 cd -
119
120 %install
121 rm -rf $RPM_BUILD_ROOT
122 cd xs
123 ./Build install destdir=$RPM_BUILD_ROOT create_packlist=0
124 cd -
125 find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \;
126
127 # I see no way of installing slic3r with it's build script
128 # So I copy the files around manually
129 install -d $RPM_BUILD_ROOT%{_bindir}
130 install -d $RPM_BUILD_ROOT%{perl_vendorlib}
131 install -d $RPM_BUILD_ROOT%{_datadir}/%{name}
132 install -d $RPM_BUILD_ROOT%{_datadir}/icons
133 install -d $RPM_BUILD_ROOT%{_datadir}/appdata
134
135 cp -a %{name}.pl $RPM_BUILD_ROOT%{_bindir}/%{name}
136 cp -a lib/* $RPM_BUILD_ROOT%{perl_vendorlib}
137
138 cp -a var/* $RPM_BUILD_ROOT%{_datadir}/%{name}
139 cp -r hicolor $RPM_BUILD_ROOT%{_datadir}/icons
140 desktop-file-install --dir=$RPM_BUILD_ROOT%{_desktopdir} %{SOURCE1}
141
142 cp %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml
143
144 %{_fixperms} $RPM_BUILD_ROOT*
145
146 %post
147 /sbin/ldconfig
148 %update_icon_cache hicolor
149
150 %postun
151 /sbin/ldconfig
152 if [ $1 -eq 0 ] ; then
153         %update_icon_cache hicolor
154 fi
155
156 %clean
157 rm -rf $RPM_BUILD_ROOT
158
159 %files
160 %defattr(644,root,root,755)
161 %doc README.md
162 %attr(755,root,root) %{_bindir}/%{name}
163 %{perl_vendorlib}/Slic3r*
164 %{perl_vendorarch}/Slic3r*
165 %{perl_vendorarch}/auto/Slic3r*
166 %{_iconsdir}/hicolor/*/apps/%{name}.png
167 %{_desktopdir}/%{name}.desktop
168 %{_datadir}/appdata/%{name}.appdata.xml
169 %{_datadir}/%{name}
This page took 0.053659 seconds and 2 git commands to generate.