Skip to content

Commit

Permalink
#3592 we want at least one h264 decoder enabled
Browse files Browse the repository at this point in the history
now that ffmpeg has been removed, build openh264 on RHEL and clones
  • Loading branch information
totaam committed Sep 3, 2023
1 parent 45de863 commit 49a05a4
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packaging/rpm/distros/almalinux.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ fake-cuda
xorg-x11-drv-dummy
gstreamer1-plugin-timestamp
libyuv
openh264


# default python:
python3-pynvml
python3-pyu2f
python3-uinput
Expand Down
4 changes: 4 additions & 0 deletions packaging/rpm/distros/arm64.list
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
fake-cuda
xorg-x11-drv-dummy
gstreamer1-plugin-timestamp
openh264


# default python:
python3-pycuda
python3-pynvml
python3-pyu2f
Expand Down
4 changes: 4 additions & 0 deletions packaging/rpm/distros/centos.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ fake-cuda
xorg-x11-drv-dummy
gstreamer1-plugin-timestamp
libyuv
openh264


# default python:
python3-pynvml
python3-pyu2f
python3-uinput
Expand Down
4 changes: 4 additions & 0 deletions packaging/rpm/distros/default.list
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
fake-cuda
xorg-x11-drv-dummy
gstreamer1-plugin-timestamp
openh264


# default python:
python3-pycuda
python3-pynvml
python3-pyu2f
Expand Down
3 changes: 3 additions & 0 deletions packaging/rpm/distros/fedora.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
fake-cuda
xorg-x11-drv-dummy
gstreamer1-plugin-timestamp


# default python:
python3-Cython
python3-pycuda
python3-pynvml
Expand Down
4 changes: 4 additions & 0 deletions packaging/rpm/distros/oraclelinux.list
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ xorg-x11-drv-dummy
gstreamer1-plugin-timestamp
libyuv
nasm
openh264


# default python:
python3-Cython
python3-pynvml
python3-pyu2f
Expand Down
3 changes: 3 additions & 0 deletions packaging/rpm/distros/riscv64.list
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
fake-cuda
xorg-x11-drv-dummy
gstreamer1-plugin-timestamp


# default python:
python3-pyu2f
python3-uinput
python3-pylsqpack
Expand Down
3 changes: 3 additions & 0 deletions packaging/rpm/distros/rockylinux.list
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ fake-cuda
xorg-x11-drv-dummy
gstreamer1-plugin-timestamp
libyuv
openh264

# default python:
python3-pynvml
python3-pyu2f
python3-uinput
Expand Down
68 changes: 68 additions & 0 deletions packaging/rpm/openh264.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
%define _disable_source_fetch 0

Name: openh264
Version: 2.3.1
Release: 2
Summary: H.264 codec library
License: BSD
URL: https://www.openh264.org/
Source0: https://github.com/cisco/openh264/archive/v%{version}/openh264-%{version}.tar.gz

BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: nasm

%description
OpenH264 is a codec library which supports H.264 encoding and decoding. It is
suitable for use in real time applications such as WebRTC.


%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}

%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%prep
sha256=`sha256sum %{SOURCE0} | awk '{print $1}'`
if [ "${sha256}" != "453afa66dacb560bc5fd0468aabee90c483741571bca820a39a1c07f0362dc32" ]; then
echo "invalid checksum for %{SOURCE0}"
exit 1
fi
%setup -q

%build
# Update the makefile with our build options
# Must be done in %%build in order to pick up correct LDFLAGS.
sed -i -e 's|^CFLAGS_OPT=.*$|CFLAGS_OPT=%{optflags}|' Makefile
sed -i -e 's|^PREFIX=.*$|PREFIX=%{_prefix}|' Makefile
sed -i -e 's|^LIBDIR_NAME=.*$|LIBDIR_NAME=%{_lib}|' Makefile
sed -i -e 's|^SHAREDLIB_DIR=.*$|SHAREDLIB_DIR=%{_libdir}|' Makefile
sed -i -e '/^CFLAGS_OPT=/i LDFLAGS=%{__global_ldflags}' Makefile

make %{?_smp_mflags}


%install
%make_install

# Remove static libraries
rm $RPM_BUILD_ROOT%{_libdir}/*.a

%files
%license LICENSE
%doc README.md
%{_libdir}/libopenh264.so.7
%{_libdir}/libopenh264.so.%{version}

%files devel
%{_includedir}/wels/
%{_libdir}/libopenh264.so
%{_libdir}/pkgconfig/openh264.pc

%changelog
* Sun Sep 03 2023 Antoine Martin <antoine@xpra.org> - 2.3.1-2
- initial packaging for RHEL and clones
8 changes: 6 additions & 2 deletions packaging/rpm/xpra.spec
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,11 @@ BuildRequires: pkgconfig(libyuv)
Requires: libyuv
BuildRequires: pkgconfig(libavif)
Requires: libavif
%if 0%{?fedora}
%ifnarch %{riscv}
BuildRequires: pkgconfig(openh264)
Requires: openh264
%endif
%if 0%{?fedora}
BuildRequires: pkgconfig(spng)
Requires: libspng
%endif
Expand Down Expand Up @@ -613,8 +615,10 @@ rm -rf $RPM_BUILD_ROOT
%{python3_sitearch}/xpra/codecs/v4l2
%{python3_sitearch}/xpra/codecs/vpx
%{python3_sitearch}/xpra/codecs/webp
%if 0%{?fedora}
%ifnarch %{riscv}
%{python3_sitearch}/xpra/codecs/openh264
%endif
%if 0%{?fedora}
%{python3_sitearch}/xpra/codecs/spng
%endif

Expand Down

0 comments on commit 49a05a4

Please sign in to comment.