Switch to regular upstream sources for package build

- Enable more codecs
This commit is contained in:
Neal Gompa 2025-06-13 04:59:00 -04:00
commit 0d0e82fef2
8 changed files with 20 additions and 4545 deletions

View file

@ -5,24 +5,3 @@ demux, stream, filter and play pretty much anything that humans and machines
have created. It supports the most obscure ancient formats up to the cutting
edge. No matter if they were designed by some standards committee, the
community or a corporation.
## Creating the 'free' tarball
1. Update the `Version` in the spec file.
2. Set the `Release` to 0 in the spec file.
3. Set `pkg_suffix` to `%nil`
4. Do a full build locally: `fedpkg mockbuild --with full_build`
5. Run `./ffmpeg_update_free_sources.sh results_ffmpeg/7.0/0.fc40/build.log`
This will update the `ffmpeg_free_sources` file list.
Note that header files will need to be manually added
to the `ffmpeg_free_sources` file list.
6. Run `./ffmpeg_gen_free_tarball.sh` to create the tarball.
7. Set `pkg_suffix` to `-free` again
8. Set the `Release` to 1 in the spec file.
9. Do a scratch build.
OR
1. Edit `ffmpeg_free_sources` and add missing files
2. Run `./ffmpeg_gen_free_tarball.sh` to create the tarball.
3. Do a scratch build.

View file

@ -1,4 +1,5 @@
## module name # reason for enablement in ffmpeg (usually there is another package that already got legal review)
aac
aasc
libfdk_aac # fdk-aac-free
ac3
@ -113,6 +114,7 @@ dfa
dfpwm
dirac # dirac
dnxhd
dnxhr
dolby_e
dpx
dsd_lsbf
@ -330,6 +332,7 @@ pictor
pjs
png # libpng
ppm # trivial
prores
prosumer
psd
ptx

View file

@ -38,6 +38,7 @@ cljr
dca
dfpwm
dnxhd
dnxhr
dpx
dvbsub
dvdsub
@ -146,6 +147,9 @@ pgmyuv # trivial
phm # trivial
png # libpng
ppm # trivial
prores
prores_aw
prores_ks
qoi
qtrle
r10k # trivial

View file

@ -69,6 +69,9 @@
%global _lto_cflags %{nil}
%endif
# FIXME: GCC says there's incompatible pointer casts going on in libavdevice...
%global build_type_safety_c 2
%global av_codec_soversion 61
%global av_device_soversion 61
%global av_filter_soversion 10
@ -82,21 +85,17 @@ Name: ffmpeg
%global pkg_name %{name}%{?pkg_suffix}
Version: 7.1.1
Release: 3%{?dist}
Release: 4%{?dist}
Summary: A complete solution to record, convert and stream audio and video
License: GPL-3.0-or-later
URL: https://ffmpeg.org/
Source0: ffmpeg%{?pkg_suffix}-%{version}.tar.xz
Source2: https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz.asc
Source0: https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz
Source1: https://ffmpeg.org/releases/ffmpeg-%{version}.tar.xz.asc
# https://ffmpeg.org/ffmpeg-devel.asc
# gpg2 --import --import-options import-export,import-minimal ffmpeg-devel.asc > ./ffmpeg.keyring
Source3: ffmpeg.keyring
Source4: ffmpeg_free_sources
Source2: ffmpeg.keyring
Source20: enable_decoders
Source21: enable_encoders
# Scripts for generating tarballs
Source90: ffmpeg_update_free_sources.sh
Source91: ffmpeg_gen_free_tarball.sh
# Fixes for reduced codec selection on free build
Patch1: ffmpeg-codec-choice.patch
@ -532,7 +531,7 @@ This subpackage contains the headers for FFmpeg libswscale.
%prep
%if %{with upstream_tarball}
%{gpgverify} --keyring='%{SOURCE3}' --signature='%{SOURCE2}' --data='%{SOURCE0}'
%{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data='%{SOURCE0}'
%endif
%autosetup -S git_am
@ -859,6 +858,10 @@ rm -rf %{buildroot}%{_datadir}/%{name}/examples
%{_mandir}/man3/libswscale.3*
%changelog
* Fri Jun 13 2025 Neal Gompa <ngompa@fedoraproject.org> - 7.1.1-4
- Switch to regular upstream sources for package build
- Enable more codecs
* Sat Mar 22 2025 Songsong Zhang <U2FsdGVkX1@gmail.com> - 7.1.1-3
- Add missing source files for riscv64

File diff suppressed because it is too large Load diff

View file

@ -1,130 +0,0 @@
#!/bin/bash
#
# Copyright (c) 2022 Andreas Schneider <asn@cryptomilk.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# shellcheck disable=2181
export LC_COLLATE="C.UTF-8"
FF_PKGNAME="ffmpeg"
FF_PKGNAME_SUFFIX="-free"
FF_VERSION="$(rpmspec -P ./*.spec | grep ^Version | sed -e 's/Version:[ ]*//g')"
FF_TARBALL_URL="https://ffmpeg.org/releases/${FF_PKGNAME}-${FF_VERSION}.tar.xz"
FF_TARBALL="$(basename "${FF_TARBALL_URL}")"
FF_GPG_ARMOR_FILE="${FF_TARBALL}.asc"
FF_PKG_DIR="$(pwd)"
FF_KEYRING="${FF_PKG_DIR}/ffmpeg.keyring"
FF_TMPDIR=$(mktemp --tmpdir -d ffmpeg-XXXXXXXX)
FF_PATH="${FF_TMPDIR}/${FF_PKGNAME}-${FF_VERSION}"
cleanup_tmpdir() {
# shellcheck disable=2164
popd 2>/dev/null
rm -rf "${FF_TMPDIR}"
}
trap cleanup_tmpdir SIGINT
cleanup_and_exit()
{
cleanup_tmpdir
if test "$1" = 0 -o -z "$1"; then
exit 0
else
# shellcheck disable=2086
exit ${1}
fi
}
if [[ ! -w "${FF_TARBALL}" ]]; then
echo ">>> Downloading tarball"
wget "${FF_TARBALL_URL}"
fi
if [[ ! -w "${FF_TARBALL}.asc" ]]; then
echo ">>> Downloading signature"
wget "${FF_TARBALL_URL}.asc"
fi
echo ">>> Verifying ${FF_TARBALL} GPG signature"
gpgv2 --quiet --keyring "${FF_KEYRING}" "${FF_GPG_ARMOR_FILE}" "${FF_TARBALL}"
if [ $? -ne 0 ]; then
echo "ERROR: GPG signature verification failed"
cleanup_and_exit 1
fi
echo
echo ">>> Unpacking ${FF_TARBALL}"
tar -xf "${FF_TARBALL}" -C "${FF_TMPDIR}"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to unpack ${FF_TARBALL}"
cleanup_and_exit 1
fi
if [[ ! -r ffmpeg_free_sources ]]; then
echo "ERROR: ffmpeg_free_sources doesn't exist!"
cleanup_and_exit 1
fi
readarray -t keepfiles < ffmpeg_free_sources
pushd "${FF_PATH}" || cleanup_and_exit 1
echo
echo ">>> Cleaning up sources for new tarball ..."
# Get file list from ffmpeg
mapfile -d '' filelist < <(find ./ -type f -printf '%P\0')
# Sort arrays
readarray -t keepfiles_sorted < <(printf '%s\0' "${keepfiles[@]}" | sort -z | xargs -0n1)
readarray -t filelist_sorted < <(printf '%s\0' "${filelist[@]}" | sort -z | xargs -0n1)
# Compare arrays and remove files which are left over
comm -2 -3 -z <(printf '%s\0' "${filelist_sorted[@]}") <(printf '%s\0' "${keepfiles_sorted[@]}") | xargs -0 rm -f
readarray -t removed_files < <(comm -1 -3 -z <(printf '%s\0' "${filelist_sorted[@]}") <(printf '%s\0' "${keepfiles_sorted[@]}") | xargs -0n1)
if [[ "${#removed_files[@]}" -ge 1 ]]; then
if [[ "${#removed_files[@]}" -eq 1 ]] && [[ -z "${removed_files[0]}" ]]; then
echo "... done"
else
echo "File not in upstream tarball anymore (please cleanup 'ffmpeg_free_sources'):"
for f in "${removed_files[@]}"; do
if [[ -z "${f}" ]]; then
continue
fi
echo " * ${f}"
done
fi
fi
echo
popd || cleanup_and_exit 1 # /FF_PATH
pushd "${FF_TMPDIR}" || cleanup_and_exit 1
echo ">>> Create new tarball ${FF_PKGNAME}${FF_PKGNAME_SUFFIX}-${FF_VERSION}.tar.xz ..."
tar -cJf "${FF_PKG_DIR}/${FF_PKGNAME}${FF_PKGNAME_SUFFIX}-${FF_VERSION}.tar.xz" "${FF_PKGNAME}-${FF_VERSION}"
if [ $? -ne 0 ]; then
echo "ERROR: Creating tarball failed"
cleanup_and_exit 1
fi
popd || cleanup_and_exit 1 # /FF_TMPDIR
du -sh "${FF_PKGNAME}${FF_PKGNAME_SUFFIX}-${FF_VERSION}.tar.xz"
echo
cleanup_and_exit 0

View file

@ -1,60 +0,0 @@
#!/bin/bash
#
# Copyright (c) 2022 Andreas Schneider <asn@cryptomilk.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# shellcheck disable=2181
export LC_COLLATE="C.UTF-8"
cleanup_and_exit()
{
if test "$1" = 0 -o -z "$1"; then
exit 0
else
# shellcheck disable=2086
exit ${1}
fi
}
echo ">>> Collect information from ${1}"
build_log="$(readlink -f "${1}")"
if [[ -z "${build_log}" ]] || [[ ! -r "${build_log}" ]]; then
echo "Build log doesn't exist: %{build_log}"
cleanup_and_exit 1
fi
asm_files="$(grep "^gcc.*\.c$" "${build_log}" | awk 'NF>1{print $NF}' | sort)"
c_files="$(grep "^nasm.*\.asm$" "${build_log}" | awk 'NF>1{print $NF}' | sort)"
# shellcheck disable=2206
new_sources=(${asm_files}
${c_files})
# Sort arrays
readarray -t new_sources_sorted < <(printf '%s\0' "${new_sources[@]}" | sort -z | xargs -0n1)
# Create a backup for a diff
cp -a ffmpeg_free_sources ffmpeg_free_sources.orig
cp -a ffmpeg_free_sources ffmpeg_free_sources.new
printf "%s\n" "${new_sources_sorted[@]}" >> ffmpeg_free_sources.new
# Update ffmpeg_free_sources
echo ">>> Updating ffmpeg_free_sources"
sort < ffmpeg_free_sources.new | uniq | sed '/^$/d' > ffmpeg_free_sources
echo ">>> Differences in file list"
diff -u ffmpeg_free_sources.orig ffmpeg_free_sources
rm -f ffmpeg_free_sources.new
cleanup_and_exit 0

View file

@ -1,3 +1,3 @@
SHA512 (ffmpeg-free-7.1.1.tar.xz) = 997e867dd07ac1d228ce20b5c60e6d1a2c3d155b7af381fd0c80b594ccf6f002c7e660f775185be41cf94c8753e74633f99999f6327388f3feb2d8d5aa19dd88
SHA512 (ffmpeg-7.1.1.tar.xz) = 42486e485c8fc6f3ec61598a1a7cb40360535762b3fcf28c10d7c6840bc55afe3334434912746e69eef862d3cedf45a02953bde73d38547d2d9a7a38a65e123a
SHA512 (ffmpeg-7.1.1.tar.xz.asc) = 480846fd939d00f2ea90c0256081519a6996c7a990d0f66444a7ae1bce2e5ad6380f5d751efc9bde18da9c4d34738ade57dd66288b989dfd074c484562e20e75
SHA512 (ffmpeg.keyring) = 9b36506835db36f776b7ddb53ad6fa9e915e6ca2f9c7cfebe8eb45513e1036a985283590a840ca313a111bf35dc3731f68885aaafb1fb7011ec433cc119e5165