File mingw64-libvpx.spec of Package mingw64-libvpx

#
# spec file for package mingw64-libvpx
#
# Copyright (c) 2025, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define realname libvpx
Name:           mingw64-%{realname}
Version:        1.15.0
Release:        0
Summary:        VP8/VP9 codec library
License:        BSD-3-Clause AND GPL-2.0-or-later
Group:          Productivity/Multimedia/Other
URL:            https://www.webmproject.org/
Source0:        https://github.com/webmproject/libvpx/archive/refs/tags/v%{version}.tar.gz#/%{realname}-%{version}.tar.gz
# https://aur.archlinux.org/cgit/aur.git/tree/0001-enable-shared-on.mingw.patch?h=mingw-w64-libvpx
Patch0:         0001-enable-shared-on.mingw.patch
# https://aur.archlinux.org/cgit/aur.git/tree/0005-fix-exports.mingw.patch?h=mingw-w64-libvpx
Patch1:         0005-fix-exports.mingw.patch
BuildRequires:  mingw64-cross-gcc-c++
BuildRequires:  yasm
%_mingw64_package_header_debug
BuildArch:      noarch

%description
WebM is an open, royalty-free, media file format designed for the web.

WebM defines the file container structure, video and audio formats.
WebM files consist of video streams compressed with the VP8 video codec
and audio streams compressed with the Vorbis audio codec.
The WebM file structure is based on the Matroska container.

%package -n mingw64-libvpx1
Summary:        VP8/VP9 codec library
License:        BSD-3-Clause
Group:          System/Libraries

%description -n mingw64-libvpx1
WebM is an open, royalty-free, media file format designed for the web.

WebM defines the file container structure, video and audio formats.
WebM files consist of video streams compressed with the VP8 video codec
and audio streams compressed with the Vorbis audio codec.
The WebM file structure is based on the Matroska container.

%package devel
Summary:        Development files for libvpx, a VP8/VP9 codec library
License:        BSD-3-Clause AND GPL-2.0-or-later
Group:          Development/Languages/C and C++
Requires:       mingw64-libvpx1 = %{version}

%package -n mingw64-vpx-tools
Summary:        Utilities from the VP8/VP9 codec library
License:        BSD-3-Clause AND GPL-2.0-or-later
Group:          Productivity/Multimedia/Other

%description -n mingw64-vpx-tools
This package contains utilities around the vp8 codec sdk.

WebM is an open, royalty-free, media file format designed for the web.

WebM defines the file container structure, video and audio formats.
WebM files consist of video streams compressed with the VP8 video codec
and audio streams compressed with the Vorbis audio codec.
The WebM file structure is based on the Matroska container.

%description devel
Development headers and library

WebM is an open, royalty-free, media file format designed for the web.

WebM defines the file container structure, video and audio formats.
WebM files consist of video streams compressed with the VP8 video codec
and audio streams compressed with the Vorbis audio codec.
The WebM file structure is based on the Matroska container.

%_mingw64_debug_package

%prep
%autosetup -p1 -n %{realname}-%{version}

%build
%define _lto_cflags %{nil}
mkdir -p build && cd build
export CFLAGS="%{optflags} -fno-asynchronous-unwind-tables"
export CROSS="/usr/bin/x86_64-w64-mingw32-"
../configure \
    --target=x86_64-win64-gcc \
    --prefix=%{_mingw64_prefix} \
    --libdir=%{_mingw64_libdir} \
    --disable-docs \
    --disable-install-docs \
    --disable-install-srcs \
    --disable-unit-tests \
    --enable-shared \
    --disable-static \
    --enable-pic \
    --enable-postproc \
    --enable-runtime-cpu-detect \
    --enable-vp8 \
    --enable-vp9 \
    --enable-vp9-highbitdepth \
    --enable-vp9-temporal-denoising
%{_mingw64_make} %{?_smp_mflags} verbose=yes GEN_EXAMPLES=

%install
cd build
%{_mingw64_make_install} verbose=yes DESTDIR=%{buildroot} install

%files -n mingw64-libvpx1
%license LICENSE
%doc AUTHORS README CHANGELOG
%{_mingw64_bindir}/libvpx-1.dll

%files -n mingw64-vpx-tools
%{_mingw64_bindir}/vpxdec.exe
%{_mingw64_bindir}/vpxenc.exe

%files devel
%{_mingw64_includedir}/vpx
%{_mingw64_libdir}/libvpx.dll.a
%{_mingw64_libdir}/pkgconfig/vpx.pc

%changelog
openSUSE Build Service is sponsored by