]> git.pld-linux.org Git - packages/kodi.git/blob - kodi.spec
backported upstream fix for libfmt 9
[packages/kodi.git] / kodi.spec
1 # TODO:
2 #  - fix build flags - some files are compiled with -O3 and without rpm*flags
3 #  - add and/or fix users/groups permissions
4 #  - split to subpackages?
5 # - bundled ffmpeg build (tools/depends/target/ffmpeg/autobuild.sh) enables nonfree & gpl!
6 #
7 # Conditional build:
8 # Features:
9 %bcond_with     airtunes        # AirTunes support
10 %bcond_without  dvdcss          # DVDCSS support
11 %bcond_without  gbm             # GBM platform
12 %bcond_without  optical_drive   # optical drive
13 %bcond_without  upnp            # UPnP support
14 %bcond_without  x11             # X11 platform
15 %ifarch %{arm} aarch64
16 %bcond_without  gles            # OpenGL rendering
17 %else
18 %bcond_with     gles            # OpenGLES rendering
19 %endif
20 %bcond_with     gold            # Use gold linker
21 %bcond_without  wayland         # Wayland platform
22 # System libs:
23 %bcond_without  system_ffmpeg   # build with system ffmpeg
24 # CPU instructions
25 %bcond_with     avx             # use AVX instructions
26 %bcond_with     avx2            # use AVX2 instructions
27 %bcond_with     neon            # use NEON instructions
28 %bcond_with     sse             # use SSE instructions
29 %bcond_with     sse2            # use SSE2 instructions
30 %bcond_with     sse3            # use SSE3 instructions
31 %bcond_with     ssse3           # use SSSE3 instructions
32 %bcond_with     sse41           # use SSE4.1 instructions
33 %bcond_with     sse42           # use SSE4.2 instructions
34
35 %ifarch %{arm_with_neon}
36 %define         with_neon       1
37 %endif
38 %ifarch %{x86_with_sse}
39 %define         with_sse        1
40 %endif
41 %ifarch %{x86_with_sse2}
42 %define         with_sse2       1
43 %endif
44
45 %define codename Matrix
46 #define subver  rc1
47 Summary:        Kodi is a free and open source media-player and entertainment hub
48 Name:           kodi
49 Version:        19.4
50 Release:        3
51 License:        GPL v2+ and GPL v3+
52 Group:          Applications/Multimedia
53 #Source0Download: https://github.com/xbmc/xbmc/releases
54 Source0:        https://github.com/xbmc/xbmc/archive/%{version}-%{codename}.tar.gz
55 # Source0-md5:  a668854505eff3ca5ed9f33e3ac91c80
56 Patch0:         disable-static.patch
57 Patch1:         libdvd.patch
58 Patch2:         libfmt9.patch
59 URL:            https://kodi.tv/
60 BuildRequires:  EGL-devel
61 %{?with_gbm:BuildRequires:      Mesa-libgbm-devel}
62 # for eglextchromium.h
63 %{?with_x11:BuildRequires:      Mesa-libEGL-devel}
64 %if %{without gles}
65 BuildRequires:  OpenGL-GLU-devel
66 BuildRequires:  OpenGL-devel
67 %if %{with x11}
68 BuildRequires:  OpenGL-GLX-devel
69 %endif
70 %endif
71 %{?with_gles:BuildRequires:     OpenGLES-devel}
72 BuildRequires:  alsa-lib-devel >= 1.0.27
73 BuildRequires:  avahi-devel
74 BuildRequires:  bluez-libs-devel >= 4.99
75 BuildRequires:  cmake >= 3.4
76 BuildRequires:  crossguid-devel
77 BuildRequires:  curl-devel
78 %{!?with_system_ffmpeg:BuildRequires:   dav1d-devel}
79 BuildRequires:  dbus-devel
80 # libavcodec >= 58.91.100 libavfilter >= 7.85.100 libavformat >= 58.45.100 libavutil >= 56.51.100 libpostproc >= 55.7.100 libswscale >= 5.7.100 libswresample >= 3.7.100
81 %{?with_system_ffmpeg:BuildRequires:    ffmpeg-devel >= 4.3}
82 BuildRequires:  flatbuffers-devel >= 1.9.0
83 BuildRequires:  fontconfig-devel
84 BuildRequires:  freetype-devel
85 BuildRequires:  fribidi-devel
86 BuildRequires:  fstrcmp-devel >= 0.7
87 BuildRequires:  gettext-tools
88 BuildRequires:  giflib-devel >= 5
89 BuildRequires:  jre
90 BuildRequires:  lcms2-devel
91 BuildRequires:  libass-devel
92 BuildRequires:  libatomic-devel
93 BuildRequires:  libbluray-devel >= 0.9.3
94 BuildRequires:  libcap-devel
95 BuildRequires:  libcdio-c++-devel >= 2.1.0
96 BuildRequires:  libcdio-devel >= 2.1.0
97 BuildRequires:  libcec-devel >= 3.0.0
98 BuildRequires:  libdrm-devel >= 2.4.95
99 %{?with_dvdcss:BuildRequires:   libdvdcss-devel >= 1.4.1}
100 BuildRequires:  libdvdnav-devel
101 BuildRequires:  libdvdread-devel
102 BuildRequires:  libfmt-devel >= 6.1.2
103 %{?with_gbm:BuildRequires:      libinput-devel}
104 BuildRequires:  libjpeg-devel
105 BuildRequires:  libmicrohttpd-devel >= 0.9.40
106 BuildRequires:  libnfs-devel
107 BuildRequires:  libplist-devel >= 2.0
108 BuildRequires:  libpng-devel
109 BuildRequires:  libsmbclient-devel
110 BuildRequires:  libstdc++-devel >= 6:5
111 BuildRequires:  libudfread-devel >= 1.0.0
112 BuildRequires:  libuuid-devel
113 BuildRequires:  libva-devel
114 BuildRequires:  libva-drm-devel
115 %{?with_wayland:BuildRequires:  libva-wayland-devel}
116 %{?with_x11:BuildRequires:      libva-x11-devel}
117 %if %{with x11} && %{without gles}
118 BuildRequires:  libvdpau-devel
119 %endif
120 BuildRequires:  libxml2-devel >= 2.0
121 BuildRequires:  libxslt-devel
122 BuildRequires:  lirc-devel
123 BuildRequires:  lzo-devel >= 2
124 BuildRequires:  mysql-devel
125 BuildRequires:  openssl-devel >= 1.0.2
126 BuildRequires:  pcre-cxx-devel
127 BuildRequires:  pkgconfig
128 BuildRequires:  pulseaudio-devel >= 11.0.0
129 BuildRequires:  python3-devel >= 1:3.8
130 BuildRequires:  rapidjson-devel >= 1.1.0
131 BuildRequires:  rpm-build >= 4.6
132 BuildRequires:  rpm-pythonprov
133 BuildRequires:  rpmbuild(macros) >= 2.007
134 BuildRequires:  sed >= 4.0
135 BuildRequires:  spdlog-devel >= 1.5.0
136 BuildRequires:  sqlite3-devel
137 BuildRequires:  swig
138 BuildRequires:  taglib-devel >= 1.9.0
139 BuildRequires:  tinyxml-devel >= 2.6.2
140 BuildRequires:  udev-devel
141 %if %{with wayland}
142 BuildRequires:  wayland-protocols >= 1.7
143 BuildRequires:  waylandpp-devel >= 0.2.2
144 %endif
145 %if %{with x11}
146 BuildRequires:  xorg-lib-libX11-devel
147 BuildRequires:  xorg-lib-libXext-devel
148 BuildRequires:  xorg-lib-libXrandr-devel
149 %endif
150 %if %{with gbm} || %{with wayland}
151 BuildRequires:  xorg-lib-libxkbcommon-devel >= 0.4.1
152 %endif
153 BuildRequires:  zlib-devel
154 Requires:       %{name}-common = %{version}-%{release}
155 Requires:       alsa-lib >= 1.0.27
156 Requires:       desktop-file-utils
157 Requires:       ffmpeg-libs >= 4.3
158 Requires:       flatbuffers >= 1.9.0
159 Requires:       hicolor-icon-theme
160 Requires:       libbluray >= 0.9.3
161 Requires:       libcdio >= 2.1.0
162 Requires:       libcdio-c++ >= 2.1.0
163 Requires:       libcec >= 3.0.0
164 Requires:       libdrm >= 2.4.95
165 %{?with_dvdcss:Requires:        libdvdcss >= 1.4.1}
166 Requires:       libfmt >= 6.1.2
167 Requires:       libmicrohttpd >= 0.9.40
168 Requires:       libplist >= 2.0
169 Requires:       libudfread >= 1.0.0
170 Requires:       lsb-release
171 Requires:       openssl >= 1.0.2
172 Requires:       pulseaudio-libs >= 11.0.0
173 Requires:       spdlog >= 1.5.0
174 Requires:       taglib >= 1.9.0
175 Requires:       tinyxml >= 2.6.2
176 %{?with_wayland:Requires:       waylandpp >= 0.2.2}
177 %if %{with gbm} || %{with wayland}
178 Requires:       xorg-lib-libxkbcommon >= 0.4.1
179 %endif
180 Obsoletes:      xbmc < 14.0
181 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
182
183 # debug enabled causes oom on i686/x32
184 %define         _enable_debug_packages  0
185
186 %description
187 Kodi Entertainment Center (formerly XBMC) is a free and open-source
188 media player software developed by the XBMC Foundation, a non-profit
189 technology consortium. Kodi is available for multiple operating
190 systems and hardware platforms, with a software 10-foot user interface
191 for use with televisions and remote controls. It allows users to play
192 and view most videos, music, such as podcasts from the internet, and
193 all common digital media files from local and network storage media.
194
195 %package common
196 Summary:        Common files for Kodi
197 BuildArch:      noarch
198
199 %description common
200 Common files for Kodi.
201
202 %package devel
203 Summary:        Header files for Kodi
204 Group:          Development/Libraries
205 Requires:       %{name}-common = %{version}-%{release}
206
207 %description devel
208 Header files for Kodi.
209
210 %prep
211 %setup -q -n xbmc-%{version}%{?subver}-%{codename}
212 %patch0 -p1
213 %patch1 -p1
214 %patch2 -p1
215
216 %{__rm} -r lib/win32
217
218 %if %{without system_ffmpeg}
219 #ln -s %{SOURCE1} tools/depends/target/ffmpeg/ffmpeg-2.4.4-%{codename}.tar.gz
220 %endif
221
222 %build
223 %cmake -B build \
224         -DAPP_RENDER_SYSTEM=%{!?with_gles:gl}%{?with_gles:gles} \
225         -DCORE_PLATFORM_NAME="%{?with_gbm:GBM;}%{?with_x11:X11;}%{?with_wayland:WAYLAND;}" \
226         %{cmake_on_off airtunes ENABLE_AIRTUNES} \
227         %{cmake_on_off dvdcss ENABLE_DVDCSS} \
228         -DENABLE_INTERNAL_CROSSGUID:BOOL=OFF \
229         -DENABLE_INTERNAL_DAV1D:BOOL=OFF \
230         -DENABLE_INTERNAL_FFMPEG:BOOL=%{?with_system_ffmpeg:OFF}%{!?with_system_ffmpeg:ON} \
231         -DENABLE_INTERNAL_FLATBUFFERS:BOOL=OFF \
232         -DENABLE_INTERNAL_FMT:BOOL=OFF \
233         -DENABLE_INTERNAL_FSTRCMP:BOOL=OFF \
234         -DENABLE_INTERNAL_LIBDVD:BOOL=OFF \
235         -DENABLE_INTERNAL_RapidJSON:BOOL=OFF \
236         -DENABLE_INTERNAL_SPDLOG:BOOL=OFF \
237         -DENABLE_INTERNAL_UDFREAD:BOOL=OFF \
238         %{cmake_on_off gold ENABLE_LDGOLD} \
239         -DENABLE_TESTING:BOOL=OFF \
240         %{cmake_on_off optical_drive ENABLE_OPTICAL} \
241         %{cmake_on_off upnp ENABLE_UPNP} \
242         %{cmake_on_off avx ENABLE_AVX} \
243         %{cmake_on_off avx2 ENABLE_AVX2} \
244         %{cmake_on_off neon ENABLE_NEON} \
245         %{cmake_on_off sse ENABLE_SSE} \
246         %{cmake_on_off sse2 ENABLE_SSE2} \
247         %{cmake_on_off sse3 ENABLE_SSE3} \
248         %{cmake_on_off ssse3 ENABLE_SSSE3} \
249         %{cmake_on_off sse41 ENABLE_SSE4_1} \
250         %{cmake_on_off sse42 ENABLE_SSE4_2}
251
252 %{__make} -C build
253
254 %install
255 rm -rf $RPM_BUILD_ROOT
256
257 install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/addons
258
259 %{__make} -C build install \
260         DESTDIR=$RPM_BUILD_ROOT
261
262 %{__rm} $RPM_BUILD_ROOT%{_docdir}/{version.txt,README.Linux.md,LICENSE.md}
263
264 # not packaged
265 %{__rm} $RPM_BUILD_ROOT%{_prefix}/lib/firewalld/services/kodi-*.xml
266
267 %clean
268 rm -rf $RPM_BUILD_ROOT
269
270 %post
271 %update_icon_cache hicolor
272 %update_desktop_database
273
274 %postun
275 %update_icon_cache hicolor
276 %update_desktop_database_postun
277
278 %files
279 %defattr(644,root,root,755)
280 %doc README.md docs/README.Linux.md
281 %attr(755,root,root) %{_bindir}/JsonSchemaBuilder
282 %attr(755,root,root) %{_bindir}/TexturePacker
283 %attr(755,root,root) %{_bindir}/kodi
284 %attr(755,root,root) %{_bindir}/kodi-standalone
285 %{_datadir}/%{name}/addons
286 %{_datadir}/%{name}/media
287 %{_datadir}/%{name}/privacy-policy.txt
288 %{_datadir}/%{name}/system
289 %{_datadir}/%{name}/userdata
290 %attr(755,root,root) %{_libdir}/%{name}
291 %{_desktopdir}/kodi.desktop
292 %{_iconsdir}/hicolor/*/apps/%{name}.png
293 %{_datadir}/metainfo/org.xbmc.kodi.metainfo.xml
294 %{_datadir}/xsessions/kodi.desktop
295
296 %files common
297 %defattr(644,root,root,755)
298 %dir %{_datadir}/%{name}
299
300 %files devel
301 %defattr(644,root,root,755)
302 %{_includedir}/kodi
303 %{_datadir}/%{name}/cmake
This page took 0.060885 seconds and 4 git commands to generate.