[packages/libultrahdr] - new

qboosh qboosh at pld-linux.org
Wed Dec 3 19:50:50 CET 2025


commit b9fcfb7950496d7fc55004738d871f8cf3c825a6
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Dec 3 19:50:53 2025 +0100

    - new

 libultrahdr-opt.patch |  38 +++++++++++++++++
 libultrahdr.spec      | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 152 insertions(+)
---
diff --git a/libultrahdr.spec b/libultrahdr.spec
new file mode 100644
index 0000000..2a62165
--- /dev/null
+++ b/libultrahdr.spec
@@ -0,0 +1,114 @@
+# TODO: actually package java part, then enable bcond by default
+#
+# Conditional build:
+%bcond_with	java	# Java interface (JNI wrapper+Java classes)
+#
+Summary:	Library for encoding and decoding ultrahdr images
+Summary(pl.UTF-8):	Biblioteka do kodowania i dekodowania obrazów ultrahdr
+Name:		libultrahdr
+Version:	1.4.0
+Release:	1
+License:	Apache v2.0
+Group:		Libraries
+#Source0Download: https://github.com/google/libultrahdr/releases
+Source0:	https://github.com/google/libultrahdr/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	ddfbb3e6ff777d62f2d696d644c90a72
+Patch0:		%{name}-opt.patch
+URL:		https://github.com/google/libultrahdr
+BuildRequires:	cmake >= 3.15
+%{?with_java:BuildRequires:	jdk}
+BuildRequires:	libjpeg-devel
+BuildRequires:	libstdc++-devel >= 6:7
+BuildRequires:	rpmbuild(macros) >= 1.605
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+libultrahdr is an image compression library that uses gain map
+technology to store and distribute HDR images. Conceptually on the
+encoding side, the library accepts SDR and HDR rendition of an image
+and from these a Gain Map (quotient between the two renditions) is
+computed. The library then uses backward compatible means to store the
+base image (SDR), gain map image and some associated metadata. Legacy
+readers that do not support handling the gain map image and/or
+metadata, will display the base image. Readers that support the format
+combine the base image with the gain map and render a high dynamic
+range image on compatible displays.
+
+%description -l pl.UTF-8
+libultrahdr to biblioteka kompresji obrazu, wykorzystująca technikę
+mapy wzmocnień do przechowywania i dystrybucji obrazów HDR.
+Koncepcyjnie po stronie kodowania biblioteka przyjmuje wersje SDR oraz
+HDR obrazu i wylicza z nich mapę wzmocnień (współczynnik między dwoma
+wersjami). Następnie wykorzystując wstecznie zgodne metody zapisuje
+obraz podstawowy (SDR), obraz mapy wzmocnień oraz trochę powiązanych
+metadanych. Starsze czytniki, nie obsługujące obrazu mapy wzmocnień
+i/lub metadanych, wyświetlą obraz podstawowy. Czytniki obsługujące
+format połączą obraz podstawowy z mapą wzmocnień i na zgodnym ekranie
+wyświetlą obraz HDR.
+
+%package devel
+Summary:	Header files for libuhdr library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki libuhdr
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+Requires:	libjpeg-devel
+
+%description devel
+Header files for libuhdr library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki libuhdr.
+
+%package static
+Summary:	Static libuhdr library
+Summary(pl.UTF-8):	Statyczna biblioteka libuhdr
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static libuhdr library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka libuhdr.
+
+%prep
+%setup -q
+%patch -P0 -p1
+
+%build
+# .pc file generation expects relative INCLUDEDIR/LIBDIR
+%cmake -B build \
+	-DCMAKE_INSTALL_INCLUDEDIR=include \
+	-DCMAKE_INSTALL_LIBDIR=%{_lib} \
+	%{?with_java:-DUHDR_BUILD_JAVA=ON}
+
+%{__make} -C build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc DESCRIPTION README.md
+%attr(755,root,root) %{_bindir}/ultrahdr_app
+%{_libdir}/libuhdr.so.*.*.*
+%ghost %{_libdir}/libuhdr.so.1
+
+%files devel
+%defattr(644,root,root,755)
+%{_libdir}/libuhdr.so
+%{_includedir}/ultrahdr_api.h
+%{_pkgconfigdir}/libuhdr.pc
+
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libuhdr.a
diff --git a/libultrahdr-opt.patch b/libultrahdr-opt.patch
new file mode 100644
index 0000000..5d3cb2a
--- /dev/null
+++ b/libultrahdr-opt.patch
@@ -0,0 +1,38 @@
+--- libultrahdr-1.4.0/CMakeLists.txt.orig	2025-01-10 20:31:48.000000000 +0100
++++ libultrahdr-1.4.0/CMakeLists.txt	2025-12-02 21:56:01.121420164 +0100
+@@ -271,35 +271,6 @@ else()
+   add_compile_options(-fdata-sections)
+   add_compile_options(-fomit-frame-pointer)
+   add_compile_options(-ffp-contract=fast)
+-  if(ARCH STREQUAL "i386")
+-    add_compile_options(-m32)
+-    add_compile_options(-march=i386)
+-    add_compile_options(-mtune=generic)
+-  elseif(ARCH STREQUAL "amd64")
+-    add_compile_options(-m64)
+-    add_compile_options(-march=x86-64)
+-    add_compile_options(-mtune=generic)
+-  elseif(ARCH STREQUAL "arm")
+-    add_compile_options(-march=armv7-a)
+-    add_compile_options(-marm)
+-    if(NOT ANDROID_ABI)
+-      add_compile_options(-mfloat-abi=hard)
+-    endif()
+-    add_compile_options(-mfpu=neon-vfpv3)
+-    add_compile_options(-fno-lax-vector-conversions)
+-  elseif(ARCH STREQUAL "aarch64")
+-    add_compile_options(-march=armv8-a)
+-    add_compile_options(-fno-lax-vector-conversions)
+-  elseif(ARCH STREQUAL "riscv64")
+-    add_compile_options(-march=rv64gc)
+-    add_compile_options(-mabi=lp64d)
+-  elseif(ARCH STREQUAL "riscv32")
+-    add_compile_options(-march=rv32gc)
+-    add_compile_options(-mabi=ilp32d)
+-  elseif(ARCH STREQUAL "loong64")
+-    add_compile_options(-march=loongarch64)
+-    add_compile_options(-mabi=lp64d)
+-  endif()
+ 
+   if(UHDR_ENABLE_WERROR)
+     CheckCompilerOption("-Werror" SUPPORTS_WERROR)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/libultrahdr.git/commitdiff/b9fcfb7950496d7fc55004738d871f8cf3c825a6




More information about the pld-cvs-commit mailing list