summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorkfg2020-07-17 18:18:27 +0200
committerkfg2020-07-17 18:18:27 +0200
commit5128ed115671223e60a47d025e8f61956f0e1589 (patch)
tree2afea06b268ac4bcb9fec988aa413a6b74c9ccff
downloadaur-5128ed115671223e60a47d025e8f61956f0e1589.tar.gz
Initial import
-rw-r--r--.SRCINFO21
-rw-r--r--PKGBUILD170
2 files changed, 191 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..daaa1c645f4c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,21 @@
+pkgbase = mingw-w64-rav1e
+ pkgdesc = An AV1 encoder focused on speed and safety (mingw-w64)
+ pkgver = 0.3.3
+ pkgrel = 1
+ url = https://github.com/xiph/rav1e/
+ arch = any
+ license = BSD
+ makedepends = cargo-c
+ makedepends = git
+ makedepends = nasm
+ makedepends = mingw-w64-gcc
+ makedepends = mingw-w64-rust
+ depends = mingw-w64-crt
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ source = git+https://github.com/xiph/rav1e.git#tag=80573d2bf733494b69c27cc3fd87f4b31e71d1d1
+ sha256sums = SKIP
+
+pkgname = mingw-w64-rav1e
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e884bbc36e0e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,170 @@
+# Maintainer: Karl-Felix Glatzer <karl.glatzer@gmx.de>
+# Contributor: Maxime Gauduin <alucryd@archlinux.org>
+# Contributor: Daniel Bermond <dbermond@archlinux.org>
+# Contributor: Chocobo1 <chocobo1@archlinux.net>
+
+pkgname=mingw-w64-rav1e
+pkgver=0.3.3
+pkgrel=1
+pkgdesc='An AV1 encoder focused on speed and safety (mingw-w64)'
+arch=(any)
+url=https://github.com/xiph/rav1e/
+license=(BSD)
+depends=(
+ mingw-w64-crt
+)
+options=(!strip !buildflags staticlibs)
+makedepends=(
+ cargo-c
+ git
+ nasm
+ mingw-w64-gcc
+ mingw-w64-rust
+)
+_tag=80573d2bf733494b69c27cc3fd87f4b31e71d1d1
+source=(git+https://github.com/xiph/rav1e.git#tag=${_tag})
+sha256sums=(SKIP)
+_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
+
+pkgver() {
+ cd rav1e
+
+ git describe --tags | sed 's/^v//'
+}
+
+prepare() {
+ if [[ -d "${RUST_PATH}" ]] ; then
+ export PATH="${RUST_PATH}:${PATH}"
+ else
+ export PATH="/opt/rust/bin:${PATH}"
+ fi
+ if [[ ! -d "${CARGO_HOME}" ]] ; then
+ export CARGO_HOME="/opt/rust/cargo"
+ fi
+
+ for _arch in ${_architectures}; do
+ if [[ ${_arch} = i686-w64-mingw32 ]] ; then
+ export CARGO_BUILD_TARGET=i686-pc-windows-gnu
+ fi
+ if [[ ${_arch} = x86_64-w64-mingw32 ]] ; then
+ export CARGO_BUILD_TARGET=x86_64-pc-windows-gnu
+ fi
+
+ cd "${srcdir}"
+
+ cp -r rav1e build-${_arch}
+
+ cd "$srcdir/build-${_arch}"
+
+ cargo fetch \
+ --locked \
+ --manifest-path ./Cargo.toml
+ done
+}
+
+build() {
+ if [[ -d "${RUST_PATH}" ]] ; then
+ export PATH="${RUST_PATH}:${PATH}"
+ else
+ export PATH="/opt/rust/bin:${PATH}"
+ fi
+ if [[ ! -d "${CARGO_HOME}" ]] ; then
+ export CARGO_HOME="/opt/rust/cargo"
+ fi
+
+ cd "${srcdir}/rav1e"
+ for _arch in ${_architectures}; do
+ if [[ ${_arch} = i686-w64-mingw32 ]] ; then
+ export CARGO_BUILD_TARGET=i686-pc-windows-gnu
+ fi
+ if [[ ${_arch} = x86_64-w64-mingw32 ]] ; then
+ export CARGO_BUILD_TARGET=x86_64-pc-windows-gnu
+ fi
+
+ cd "${srcdir}/build-${_arch}"
+
+ cargo build \
+ --release \
+ --frozen \
+ --manifest-path ./Cargo.toml
+
+ cargo cbuild \
+ --release \
+ --frozen \
+ --target $CARGO_BUILD_TARGET \
+ --dlltool ${_arch}-dlltool \
+ --prefix=/usr/${_arch} \
+ --manifest-path ./Cargo.toml
+ done
+}
+
+check() {
+ if [[ -d "${RUST_PATH}" ]] ; then
+ export PATH="${RUST_PATH}:${PATH}"
+ else
+ export PATH="/opt/rust/bin:${PATH}"
+ fi
+ if [[ ! -d "${CARGO_HOME}" ]] ; then
+ export CARGO_HOME="/opt/rust/cargo"
+ fi
+
+ cd "${srcdir}/rav1e"
+ for _arch in ${_architectures}; do
+ if [[ ${_arch} = i686-w64-mingw32 ]] ; then
+ export CARGO_BUILD_TARGET=i686-pc-windows-gnu
+ fi
+ if [[ ${_arch} = x86_64-w64-mingw32 ]] ; then
+ export CARGO_BUILD_TARGET=x86_64-pc-windows-gnu
+ fi
+
+ cd "${srcdir}/build-${_arch}"
+ cargo test \
+ --release \
+ --frozen \
+ --manifest-path ./Cargo.toml
+ done
+}
+
+package() {
+ if [[ -d "${RUST_PATH}" ]] ; then
+ export PATH="${RUST_PATH}:${PATH}"
+ else
+ export PATH="/opt/rust/bin:${PATH}"
+ fi
+ if [[ ! -d "${CARGO_HOME}" ]] ; then
+ export CARGO_HOME="/opt/rust/cargo"
+ fi
+
+ cd "${srcdir}/rav1e"
+ for _arch in ${_architectures}; do
+ if [[ ${_arch} = i686-w64-mingw32 ]] ; then
+ export CARGO_BUILD_TARGET=i686-pc-windows-gnu
+ fi
+ if [[ ${_arch} = x86_64-w64-mingw32 ]] ; then
+ export CARGO_BUILD_TARGET=x86_64-pc-windows-gnu
+ fi
+
+ cd "${srcdir}/build-${_arch}"
+
+ cargo install \
+ --frozen \
+ --offline \
+ --no-track \
+ --path . \
+ --root "${pkgdir}"/usr/${_arch}
+ cargo cinstall \
+ --release \
+ --frozen \
+ --target $CARGO_BUILD_TARGET \
+ --dlltool ${_arch}-dlltool \
+ --prefix /usr/${_arch} \
+ --destdir "${pkgdir}"
+ install -Dm 644 LICENSE PATENTS -t "${pkgdir}"/usr/${_arch}/share/licenses/rav1e/
+
+ ${_arch}-strip -s "${pkgdir}"/usr/${_arch}/bin/*.exe
+ ${_arch}-strip --strip-unneeded "${pkgdir}"/usr/${_arch}/bin/*.dll
+ ${_arch}-strip -g "${pkgdir}"/usr/${_arch}/lib/*.a
+ done
+}
+
+# vim: ts=2 sw=2 et: