media-libs/dav1d: Add new package
authorNiklas Haas <git@haasn.xyz>
Thu, 27 Sep 2018 14:43:20 +0000 (16:43 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Fri, 28 Sep 2018 12:00:51 +0000 (12:00 +0000)
This is a new AV1 decoder by VideoLAN. There is no tagged release yet,
so this commit only adds the 9999 ebuild.

Signed-off-by: Niklas Haas <git@haasn.xyz>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
media-libs/dav1d/dav1d-9999.ebuild [new file with mode: 0644]
media-libs/dav1d/metadata.xml [new file with mode: 0644]

diff --git a/media-libs/dav1d/dav1d-9999.ebuild b/media-libs/dav1d/dav1d-9999.ebuild
new file mode 100644 (file)
index 0000000..2f6ff4e
--- /dev/null
@@ -0,0 +1,52 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+SCM=""
+if [[ "${PV}" == "9999" ]]; then
+       SCM="git-r3"
+       EGIT_REPO_URI="https://code.videolan.org/videolan/dav1d"
+else
+       KEYWORDS="~amd64"
+       SRC_URI="https://code.videolan.org/videolan/dav1d/-/archive/${PV}/${P}.tar.bz2"
+fi
+
+inherit ${SCM} meson ninja-utils multilib-minimal
+
+DESCRIPTION="dav1d is an AV1 Decoder :)"
+HOMEPAGE="https://code.videolan.org/videolan/dav1d"
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="+8bit +10bit +asm"
+
+ASM_DEPEND=">=dev-lang/nasm-2.13"
+RDEPEND=""
+DEPEND="${RDEPEND}
+       asm? (
+               abi_x86_32? ( ${ASM_DEPEND} )
+               abi_x86_64? ( ${ASM_DEPEND} )
+       )"
+
+DOCS=( README.md doc/PATENTS )
+
+multilib_src_configure() {
+       local -a bits=()
+       use 8bit  && bits+=( 8 )
+       use 10bit && bits+=( 10 )
+
+       local emesonargs=(
+               -D bitdepths=$(IFS=,; echo "${bits[*]}")
+               -D build_asm=$(usex asm true false)
+       )
+       meson_src_configure
+}
+
+multilib_src_compile() {
+       eninja
+}
+
+multilib_src_install() {
+       DESTDIR="${D}" eninja install
+}
diff --git a/media-libs/dav1d/metadata.xml b/media-libs/dav1d/metadata.xml
new file mode 100644 (file)
index 0000000..726e757
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <use>
+               <flag name="8bit">Add support for decoding 8-bit AV1.</flag>
+               <flag name="10bit">Add support for building 10-bit AV1.</flag>
+               <flag name="asm">Enable custom x86 assembly for faster decoding.</flag>
+       </use>
+       <upstream>
+               <bugs-to>https://code.videolan.org/videolan/dav1d/issues</bugs-to>
+       </upstream>
+</pkgmetadata>