Package libopenimageio: Specfile

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
%define _unpackaged_files_terminate_build 1
%define _stripped_files_terminate_build 1
%set_verify_elf_method strict

# TODO: dependency on Field3D

# TODO: build and run tests

%define oname openimageio
%define soname 2.5

Name:           lib%oname
Version:        2.5.7.0
Release:        alt1.1
Summary:        Library for reading and writing images
Group:          System/Libraries

License:        BSD-3-Clause and Apache-2.0
URL:            https://sites.google.com/site/openimageio/home

# https://github.com/OpenImageIO/oiio.git
Source0:        %name-%version.tar

# Images for test suite
#Source1:        oiio-images.tar.gz

Source2: %oname.watch

Patch1: %oname-alt-armh-disable-neon.patch
# https://github.com/AcademySoftwareFoundation/OpenImageIO/issues/4111
# revert simd change on aarch64
Patch2: 0001-perf-simd-faster-vint4-load-store-with-unsigned-char.patch
Patch2000: %oname-e2k.patch

BuildRequires(pre): rpm-build-python3
BuildRequires:  python3-devel
BuildRequires:  cmake gcc-c++
BuildRequires:  txt2man
BuildRequires:  qt6-base-devel
BuildRequires:  boost-devel boost-python3-devel boost-filesystem-devel boost-asio-devel
BuildRequires:  libGLEW-devel
BuildRequires:  openexr-devel imath-devel
BuildRequires:  libpng-devel libtiff-devel libjpeg-devel libturbojpeg-devel libopenjpeg2.0-devel
BuildRequires:  libgif-devel
BuildRequires:  libwebp-devel
BuildRequires:  libhdf5-devel
BuildRequires:  zlib-devel
BuildRequires:  libjasper-devel
BuildRequires:  libpugixml-devel
BuildRequires:  libraw-devel
BuildRequires:  librobin-map-devel
BuildRequires:  pybind11-devel
BuildRequires:  libsquish-devel
BuildRequires:  bzip2-devel
BuildRequires:  freetype2-devel
BuildRequires:  libfmt-devel
BuildRequires:  openvdb-devel
%ifnarch %e2k
BuildRequires:  libdcmtk-devel
%endif
BuildRequires:  libopencv-devel
BuildRequires: libavcodec-devel libavformat-devel libswscale-devel
BuildRequires: libheif-devel libPtex-devel

# WARNING: OpenColorIO and OpenImageIO are cross dependent.
# If an ABI incompatible update is done in one, the other also needs to be
# rebuilt.
BuildRequires:  libopencolorio2.0-devel

%description
OpenImageIO is a library for reading and writing images, and a bunch of related
classes, utilities, and applications. Main features include:
- Extremely simple but powerful ImageInput and ImageOutput APIs for reading and
  writing 2D images that is format agnostic.
- Format plugins for TIFF, JPEG/JFIF, OpenEXR, PNG, HDR/RGBE, Targa, JPEG-2000,
  DPX, Cineon, FITS, BMP, ICO, RMan Zfile, Softimage PIC, DDS, SGI,
  PNM/PPM/PGM/PBM, Field3d.
- An ImageCache class that transparently manages a cache so that it can access
  truly vast amounts of image data.

%package -n lib%oname%soname
Summary:        Library for reading and writing images
Group:          System/Libraries

%description -n lib%oname%soname
OpenImageIO is a library for reading and writing images, and a bunch of related
classes, utilities, and applications. Main features include:
- Extremely simple but powerful ImageInput and ImageOutput APIs for reading and
  writing 2D images that is format agnostic.
- Format plugins for TIFF, JPEG/JFIF, OpenEXR, PNG, HDR/RGBE, Targa, JPEG-2000,
  DPX, Cineon, FITS, BMP, ICO, RMan Zfile, Softimage PIC, DDS, SGI,
  PNM/PPM/PGM/PBM, Field3d.
- An ImageCache class that transparently manages a cache so that it can access
  truly vast amounts of image data.

%package -n python3-module-%oname
Summary:        Python-3 bindings for %oname
Group:          Development/Python3
Requires:       lib%oname%soname = %EVR

%description -n python3-module-%oname
Python bindings for %oname.

%package -n %oname-utils
Summary:        Command line utilities for %oname
Group:          Other
Requires:       lib%oname%soname = %EVR
Conflicts:      libxforms-demos

%description -n %oname-utils
Command-line tools to manipulate and get information on images using the
%{name} library.


%package -n %oname-iv
Summary:        %oname based image viewer
Group:          Other
Requires:       lib%oname%soname = %EVR

%description -n %oname-iv
A really nice image viewer, iv, based on %oname classes (and so will work
with any formats for which plugins are available).


%package devel
Summary:        Documentation for %oname
Group:          Development/Other
Requires:       lib%oname%soname = %EVR
%ifnarch armh
Requires:       python3-module-%oname = %EVR
Requires:       %oname-utils = %EVR
Requires:       %oname-iv = %EVR
%endif
Requires:       libopencv-devel

%description devel
Development files for package %name


%prep
%setup
%ifarch armh
%patch1 -p1
%endif
%ifarch aarch64
%patch2 -p1 -R
%endif
%ifarch %e2k
%patch2000 -p1
# simplifies the patch
sed -i '/#if OIIO_SIMD_SSE >= 4/{N;/_mm_dp_ps/s/#if /&!defined(__e2k__) \&\& /}' \
	src/include/OpenImageIO/simd.h
%endif

# Remove bundled pugixml
rm -fr src/include/OpenImageIO/detail/pugixml/

# Install test images
#rm -rf ../oiio-images && mkdir ../oiio-images && pushd ../oiio-images
#tar --strip-components=1 -xzf #{SOURCE1}

%build
%add_optflags -D_FILE_OFFSET_BITS=64

# disable debugging stuff
%add_optflags -DNDEBUG
%ifarch %e2k
%add_optflags -mno-sse4.2 -mno-avx
%endif

# set -DCMAKE_BUILD_TYPE=RelWithDebInfo to skip stripping debuginfo from python modules built via pybind11
%cmake \
	-DINCLUDE_INSTALL_DIR:PATH=%_includedir/%oname \
	-DPYTHON_VERSION=%_python3_version \
	-DINSTALL_DOCS:BOOL=FALSE \
	-DINSTALL_FONTS:BOOL=FALSE \
	-DUSE_EXTERNAL_PUGIXML:BOOL=TRUE \
	-DSTOP_ON_WARNING:BOOL=FALSE \
	-DOPENJPEG_INCLUDE_DIR=$(pkg-config --variable=includedir libopenjp2) \
	-DOpenGL_GL_PREFERENCE=GLVND \
	-DVERBOSE=TRUE \
	-DOIIO_BUILD_TESTS:BOOL=FALSE \
	-DPLUGIN_SEARCH_PATH=%_libdir/OpenImageIO-%soname \
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
	-DOIIO_USING_IMATH=3 \
%ifarch armh
	-DBUILD_OIIOUTIL_ONLY:BOOL=TRUE \
	-DBUILD_DOCS:BOOL=FALSE \
%else
	-DBUILD_DOCS:BOOL=TRUE \
	-DCMAKE_CXX_STANDARD=17 \
%endif
	%nil

%cmake_build

%install
%cmake_install

%ifnarch armh
# Move man pages to the right directory
mkdir -p %buildroot%_man1dir
cp -a %_cmake__builddir/src/doc/*.1 %buildroot%_man1dir
%endif

mkdir -p %buildroot%_libdir/OpenImageIO-%soname

%files -n lib%oname%soname
%doc CHANGES.md README.md
%doc LICENSE.md THIRD-PARTY.md
%_libdir/libOpenImageIO_Util.so.%{soname}
%_libdir/libOpenImageIO_Util.so.%{soname}.*
%_libdir/OpenImageIO-%soname
%ifnarch armh
%_libdir/libOpenImageIO.so.%{soname}
%_libdir/libOpenImageIO.so.%{soname}.*

%files -n python3-module-%oname
%python3_sitelibdir/OpenImageIO

%files -n %oname-utils
%_bindir/*
%_man1dir/*.1*
%exclude %_bindir/iv
%exclude %_man1dir/iv.1*

%files -n %oname-iv
%_bindir/iv
%_man1dir/iv.1*
%endif

%files devel
%ifnarch armh
%_libdir/libOpenImageIO.so
%endif
%_libdir/libOpenImageIO_Util.so
%_includedir/*
%_libdir/pkgconfig/OpenImageIO.pc
%_libdir/cmake/*

%changelog
* Tue Feb 20 2024 Ilya Kurdyukov <ilyakurdyukov@altlinux.org> 2.5.7.0-alt1.1
- Updated patch for Elbrus.

* Wed Jan 24 2024 L.A. Kostis <lakostis@altlinux.ru> 2.5.7.0-alt1
- 2.5.7.0.
- aarch64: revert simd optimisations (see upstream issue #4111).

* Thu Nov 16 2023 L.A. Kostis <lakostis@altlinux.ru> 2.5.5.0-alt2
- Build: use C++17 for new openvdb.
- BR: added Ptex.

* Tue Nov 07 2023 L.A. Kostis <lakostis@altlinux.ru> 2.5.5.0-alt1
- Updated to upstream version 2.5.5.0.

* Tue Nov 07 2023 L.A. Kostis <lakostis@altlinux.ru> 2.4.17.0-alt1
- Updated to upstream version 2.4.17.0.

* Wed Oct 25 2023 L.A. Kostis <lakostis@altlinux.ru> 2.4.16.0-alt1
- Updated to upstream version 2.4.16.0.

* Tue Sep 05 2023 L.A. Kostis <lakostis@altlinux.ru> 2.4.15.0-alt1
- Updated to upstream version 2.4.15.0.

* Thu Jul 13 2023 L.A. Kostis <lakostis@altlinux.ru> 2.4.13.0-alt1
- Updated to upstream version 2.4.13.0.
- qt5->qt6.
- armh: provide only _Util library.

* Thu Jul 06 2023 L.A. Kostis <lakostis@altlinux.ru> 2.3.21.0-alt3
- NMU: apply fix in unordered_map_concurrent (upstream PR #3485).

* Thu Mar 23 2023 Ilya Kurdyukov <ilyakurdyukov@altlinux.org> 2.3.21.0-alt2.1
- Patch for Elbrus.

* Mon Mar 20 2023 Alexander Burmatov <thatman@altlinux.org> 2.3.21.0-alt2
- Fix build requires.

* Mon Nov 28 2022 Ivan A. Melnikov <iv@altlinux.org> 2.3.21.0-alt1
- Updated to upstream version 2.3.21.0
  (fixes CVE-2022-36354, CVE-2022-41977, CVE-2022-41639, CVE-2022-41988)

* Wed Sep 14 2022 Ivan A. Melnikov <iv@altlinux.org> 2.3.19.0-alt1
- Updated to upstream version 2.3.19.0.

* Thu Feb 10 2022 Aleksei Nikiforov <darktemplar@altlinux.org> 2.3.12.0-alt1
- Updated to upstream version 2.3.12.0.

* Tue Jan 18 2022 Aleksei Nikiforov <darktemplar@altlinux.org> 2.3.11.0-alt1
- Updated to upstream version 2.3.11.0.

* Thu Dec 16 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.3.10.1-alt1
- Updated to upstream version 2.3.10.1.

* Wed Sep 29 2021 Ilya Kurdyukov <ilyakurdyukov@altlinux.org> 2.3.7.2-alt2
- E2K: enabled OpenCV, fixed issue with Clang

* Mon Sep 06 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.3.7.2-alt1
- Updated to upstream version 2.3.7.2.

* Mon Aug 09 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.17.0-alt1
- Updated to upstream version 2.2.17.0.

* Wed Jul 07 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.16.0-alt1
- Updated to upstream version 2.2.16.0.

* Thu Jun 10 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.15.1-alt1
- Updated to upstream version 2.2.15.1.

* Fri Jun 04 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.15.0-alt3
- Updated dependencies.
- Specified default plugin search path.

* Thu Jun 03 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.15.0-alt2
- Rebuilt with opencolorio-2.0.1.

* Wed Jun 02 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.15.0-alt1
- Updated to upstream version 2.2.15.0.

* Tue Apr 27 2021 Arseny Maslennikov <arseny@altlinux.org> 2.2.13.1-alt1.1
- NMU: spec: adapted to new cmake macros.

* Thu Apr 08 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.13.1-alt1
- Updated to upstream version 2.2.13.1.

* Mon Mar 15 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.12.0-alt1
- Updated to upstream version 2.2.12.0.

* Mon Feb 08 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.11.1-alt1
- Updated to upstream version 2.2.11.1.

* Tue Jan 19 2021 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.10.1-alt1
- Updated to upstream version 2.2.10.1.

* Wed Dec 02 2020 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.9.0-alt1
- Updated to upstream version 2.2.9.0.

* Wed Oct 07 2020 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.7.0-alt1
- Updated to upstream version 2.2.7.0.

* Fri Sep 11 2020 Aleksei Nikiforov <darktemplar@altlinux.org> 2.2.6.1-alt1
- Updated to upstream version 2.2.6.1.

* Thu Sep 03 2020 Aleksei Nikiforov <darktemplar@altlinux.org> 2.1.18.1-alt2
- Updated conflicts (Closes: #38878).

* Thu Aug 13 2020 Michael Shigorin <mike@altlinux.org> 2.1.18.1-alt1.1
- E2K: fix build of this library's clients

* Wed Aug 05 2020 Aleksei Nikiforov <darktemplar@altlinux.org> 2.1.18.1-alt1
- Updated to upstream version 2.1.18.1.

* Mon Jul 06 2020 Aleksei Nikiforov <darktemplar@altlinux.org> 2.1.17.0-alt1
- Updated to upstream version 2.1.17.0.

* Thu Jun 25 2020 Michael Shigorin <mike@altlinux.org> 2.1.16.0-alt4
- E2K: don't miss %%optflags while working around SIMD issue
  (thx darktemplar@)

* Mon Jun 22 2020 Michael Shigorin <mike@altlinux.org> 2.1.16.0-alt3
- E2K: avoid BR: dcmtk, opencv for now (not available yet)

* Fri Jun 19 2020 Sergey Bolshakov <sbolshakov@altlinux.ru> 2.1.16.0-alt2
- fixed packaging on armh

* Thu Jun 04 2020 Aleksei Nikiforov <darktemplar@altlinux.org> 2.1.16.0-alt1
- Updated to upstream version 2.1.16.0.

* Mon Apr 13 2020 Aleksei Nikiforov <darktemplar@altlinux.org> 2.1.13.0-alt1
- Updated to upstream version 2.1.13.0.

* Thu Jul 25 2019 Ivan A. Melnikov <iv@altlinux.org> 2.0.9-alt2
- Link with libatomic on mipsel.

* Fri Jul 12 2019 Aleksei Nikiforov <darktemplar@altlinux.org> 2.0.9-alt1
- Updated to upstream version 2.0.9.

* Mon May 27 2019 Aleksei Nikiforov <darktemplar@altlinux.org> 2.0.8-alt1
- Updated to upstream version 2.0.8.

* Sun Jan 20 2019 Anton Farygin <rider@altlinux.ru> 1.8.15-alt2
- rebuilt for libdcmtk14

* Tue Oct 23 2018 Aleksei Nikiforov <darktemplar@altlinux.org> 1.8.15-alt1
- Initial build for ALT.

* Tue Oct 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.15-1
- Update to 1.8.15.

* Mon Sep 24 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.14-2
- Remove python2 module and replace with python3 module.

* Mon Sep 03 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.14-1
- Update to 1.8.14.

* Wed Jul 18 2018 Simone Caronni <negativo17@gmail.com> - 1.8.12-3
- Rebuild for LibRaw update.

* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Fri Jun 01 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.12-1
- Update to 1.8.12.

* Mon Apr 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.10-1
- Update to 1.8.10.

* Fri Mar 02 2018 Adam Williamson <awilliam@redhat.com> - 1.8.9-2
- Rebuild for opencv 3.4.1

* Thu Mar 01 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.9-1
- Update to 1.8.9

* Fri Feb 23 2018 Peter Robinson <pbrobinson@fedoraproject.org> 1.8.8-3
- Rebuild

* Tue Feb 13 2018 Sandro Mani <manisandro@gmail.com> - 1.8.8-2
- Rebuild (giflib)

* Fri Feb 02 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.8-1
- Update to 1.8.8.

* Thu Jan 18 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-3
- Add openjpeg2 to build dependencies.
- Re-enable dcmtk for 32bit arches.

* Sat Jan 13 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-2
- Rebuild for OpenColorIO 1.1.0.

* Wed Jan 03 2018 Richard Shaw <hobbes1069@gmail.com> - 1.8.7-1
- Update to latest upstream release.
- Disable building with dcmtk until fixed, see:
  https://github.com/OpenImageIO/oiio/issues/1841

* Thu Nov 02 2017 Richard Shaw <hobbes1069@gmail.com> - 1.8.6-1
- Update to latest upstream release.
- Add dcmtk to build to enable DICOM plugin.