187 lines
4.7 KiB
RPMSpec
187 lines
4.7 KiB
RPMSpec
# globals for x264-0.164-20231001git31e19f92.tar.bz2
|
|
%global api 164
|
|
%global gitdate 20231001
|
|
%global gitversion 31e19f92
|
|
|
|
%global snapshot %{gitdate}git%{gitversion}
|
|
%global gver .%{gitdate}git%{gitversion}
|
|
%global branch stable
|
|
|
|
# The marco defination logic as below:
|
|
# _with_bootstrap to 1
|
|
# ==> set _without_* to 1
|
|
# ==> Don't require gpac/zlib/*-devel
|
|
%define _with_bootstrap 1
|
|
|
|
%if %{_with_bootstrap}
|
|
%define _without_gpac 1
|
|
%define _without_libavformat 1
|
|
%define _without_libswscale 1
|
|
%endif
|
|
#Whitelist of arches with dedicated ASM code
|
|
%global asmarch x86_64 armv7hl armv7hnl ppc64le aarch64 i686 ppc64
|
|
%ifnarch %{asmarch}
|
|
%global _without_asm 1
|
|
%endif
|
|
|
|
Summary: H264/AVC video streams encoder
|
|
Name: x264
|
|
Version: 0.%{api}
|
|
Release: 1%{?gver}%{?_with_bootstrap:_bootstrap}
|
|
License: GPLv2+
|
|
URL: https://www.videolan.org/developers/x264.html
|
|
Source0: %{name}-0.%{api}-%{snapshot}.tar.bz2
|
|
Source1: x264-snapshot.sh
|
|
Source2: version.h
|
|
|
|
# don't remove config.h and don't re-run version.sh
|
|
Patch0: x264-nover.patch
|
|
# add 10b suffix to high bit depth build
|
|
Patch1: x264-10b.patch
|
|
Patch11: x264-opencl.patch
|
|
|
|
BuildRequires: gcc
|
|
%{!?_without_gpac:BuildRequires: gpac-devel-static zlib-devel openssl-devel libpng-devel libjpeg-devel xz-devel libglvnd-devel mesa-libGLU-devel faad2-devel libmad-devel xvidcore-devel a52dec-devel libvorbis-devel libtheora-devel openjpeg2-devel}
|
|
%{!?_without_libavformat:BuildRequires: ffmpeg-devel}
|
|
%{?_with_ffmpegsource:BuildRequires: ffmpegsource-devel}
|
|
# https://bugzilla.rpmfusion.org/show_bug.cgi?id=3975
|
|
%ifarch armv7hl armv7hnl
|
|
BuildRequires: execstack
|
|
%endif
|
|
%ifarch %{asmarch}
|
|
BuildRequires: nasm
|
|
%endif
|
|
BuildRequires: bash-completion
|
|
# we need to enforce the exact EVR for an ISA - not only the same ABI
|
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
|
|
%description
|
|
x264 is a free library for encoding H264/AVC video streams, written from
|
|
scratch.
|
|
|
|
This package contains the frontend.
|
|
|
|
%package libs
|
|
Summary: Library for encoding H264/AVC video streams
|
|
Recommends: %{_libdir}/libOpenCL.so.1
|
|
|
|
%description libs
|
|
x264 is a free library for encoding H264/AVC video streams, written from
|
|
scratch.
|
|
|
|
%package devel
|
|
Summary: Development files for the x264 library
|
|
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
|
Requires: pkgconfig
|
|
|
|
%description devel
|
|
x264 is a free library for encoding H264/AVC video streams, written from
|
|
scratch.
|
|
|
|
This package contains the development files.
|
|
|
|
%global x_configure \
|
|
%configure \\\
|
|
--host=%{_host} \\\
|
|
--prefix=%{_prefix} \\\
|
|
--exec-prefix=%{_exec_prefix} \\\
|
|
--bindir=%{_bindir} \\\
|
|
--includedir=%{_includedir} \\\
|
|
--libdir=%{_libdir} \\\
|
|
%{?_without_libavformat:--disable-lavf} \\\
|
|
%{?_without_libswscale:--disable-swscale} \\\
|
|
%{!?_with_ffmpegsource:--disable-ffms} \\\
|
|
--enable-debug \\\
|
|
--enable-shared \\\
|
|
--system-libx264 \\\
|
|
--enable-pic
|
|
|
|
%prep
|
|
%setup -q -c -n %{name}-0.%{api}-%{snapshot}
|
|
pushd %{name}-0.%{api}-%{snapshot}
|
|
cp %{SOURCE2} .
|
|
%patch0 -p1 -b .nover
|
|
%patch1 -p1 -b .10b
|
|
%patch11 -p1 -b .opencl
|
|
popd
|
|
|
|
variants="generic generic10"
|
|
|
|
for variant in $variants ; do
|
|
rm -rf ${variant}
|
|
cp -pr %{name}-0.%{api}-%{snapshot} ${variant}
|
|
done
|
|
|
|
|
|
%build
|
|
%set_build_flags
|
|
pushd generic
|
|
%{x_configure}\
|
|
%{?_without_asm:--disable-asm}
|
|
|
|
%make_build
|
|
popd
|
|
|
|
pushd generic10
|
|
%{x_configure}\
|
|
%{?_without_asm:--disable-asm}\
|
|
--disable-cli\
|
|
--disable-opencl \
|
|
--bit-depth=10
|
|
|
|
%make_build
|
|
popd
|
|
|
|
%install
|
|
# NOTE: the order is important here! We want the generic devel stuff
|
|
for variant in generic10 generic ; do
|
|
pushd ${variant}
|
|
%make_install
|
|
popd
|
|
done
|
|
|
|
#Fix timestamp on x264 generated headers
|
|
touch -r generic/version.h %{buildroot}%{_includedir}/x264.h %{buildroot}%{_includedir}/x264_config.h
|
|
|
|
# https://bugzilla.rpmfusion.org/show_bug.cgi?id=3975
|
|
%ifarch armv7hl armv7hnl
|
|
execstack -c %{buildroot}%{_libdir}/libx264{,10b}.so.%{api}
|
|
%endif
|
|
|
|
install -dm755 %{buildroot}%{_pkgdocdir}
|
|
install -pm644 generic/{AUTHORS,COPYING} %{buildroot}%{_pkgdocdir}/
|
|
|
|
%ldconfig_scriptlets libs
|
|
|
|
|
|
%files
|
|
%{_bindir}/x264
|
|
%dir %{_datadir}/bash-completion
|
|
%dir %{_datadir}/bash-completion/completions
|
|
%{_datadir}/bash-completion/completions/x264
|
|
|
|
%files libs
|
|
%dir %{_pkgdocdir}
|
|
%{_pkgdocdir}/AUTHORS
|
|
%license %{_pkgdocdir}/COPYING
|
|
%{_libdir}/libx264.so.%{api}
|
|
%{_libdir}/libx26410b.so.%{api}
|
|
|
|
%files devel
|
|
%doc generic/doc/*
|
|
%{_includedir}/x264.h
|
|
%{_includedir}/x264_config.h
|
|
%{_libdir}/libx264.so
|
|
%{_libdir}/libx26410b.so
|
|
%{_libdir}/pkgconfig/%{name}.pc
|
|
|
|
%changelog
|
|
* Wed Oct 18 2023 li weigang <weigangli99@gmail.com> - 0.164-1
|
|
- update to version 0.164
|
|
|
|
* Tue Dec 21 2021 Chenxi Mao <chenxi.mao@suse.com> - 0.157-13
|
|
- x264: fix build error
|
|
|
|
* Fri May 07 2021 weidong <weidong@uniontech.com> - 0.157-12.20190717git34c06d1
|
|
- Initial package.
|