commit:     61790034799954c4799fa3fc68d45ccc47282d52
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 23 03:14:00 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 23 03:14:03 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61790034

media-libs/libfreeaptx: initial import (fork of media-libs/libopenaptx)

Bug: https://bugs.gentoo.org/791259
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/libfreeaptx/Manifest                    |  1 +
 .../files/libfreeaptx-0.1.1-fix-version.patch      | 20 +++++++++
 media-libs/libfreeaptx/libfreeaptx-0.1.1.ebuild    | 50 ++++++++++++++++++++++
 media-libs/libfreeaptx/libfreeaptx-9999.ebuild     | 49 +++++++++++++++++++++
 media-libs/libfreeaptx/metadata.xml                | 15 +++++++
 5 files changed, 135 insertions(+)

diff --git a/media-libs/libfreeaptx/Manifest b/media-libs/libfreeaptx/Manifest
new file mode 100644
index 00000000000..308669f5c72
--- /dev/null
+++ b/media-libs/libfreeaptx/Manifest
@@ -0,0 +1 @@
+DIST libfreeaptx-0.1.1.tar.gz 27902 BLAKE2B 
0aa015b0317db7f6dd61ae667cc1b7b10c7f7457d057144c1457572a214891848b81512960eb8643138c638a0f691b53a7bbcb36ad434ac29335d92b108a43fa
 SHA512 
53dd7f348120fea0425b365f26668925dd435a8a3a0c5e98476764a452c7d729f2a3556e953c557d0ccaaa65391265c8c3c61fc29377cf60079fa0bed2cc20b1

diff --git a/media-libs/libfreeaptx/files/libfreeaptx-0.1.1-fix-version.patch 
b/media-libs/libfreeaptx/files/libfreeaptx-0.1.1-fix-version.patch
new file mode 100644
index 00000000000..0a738fd9c81
--- /dev/null
+++ b/media-libs/libfreeaptx/files/libfreeaptx-0.1.1-fix-version.patch
@@ -0,0 +1,20 @@
+Report the correct version rather than the old libopenaptx version (left over 
from the fork point).
+https://github.com/iamthehorker/libfreeaptx/commit/c176b7de9c2017d0fc1877659cea3bb6c330aafa.patch
+
+From: Hunter <[email protected]>
+Date: Mon, 9 Aug 2021 23:51:49 -0400
+Subject: [PATCH] Fixed libfreeaptx reporting wrong version number
+
+--- a/freeaptx.h
++++ b/freeaptx.h
+@@ -22,8 +22,8 @@
+ #define freeaptx_H
+ 
+ #define freeaptx_MAJOR 0
+-#define freeaptx_MINOR 2
+-#define freeaptx_PATCH 0
++#define freeaptx_MINOR 1
++#define freeaptx_PATCH 1
+ 
+ #include <stddef.h>
+ 

diff --git a/media-libs/libfreeaptx/libfreeaptx-0.1.1.ebuild 
b/media-libs/libfreeaptx/libfreeaptx-0.1.1.ebuild
new file mode 100644
index 00000000000..e761be0ee4d
--- /dev/null
+++ b/media-libs/libfreeaptx/libfreeaptx-0.1.1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Reverse-engineered aptX and aptX HD library (fork of libopenaptx)"
+HOMEPAGE="https://github.com/iamthehorker/libfreeaptx";
+
+if [[ ${PV} == "9999" ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/iamthehorker/${PN}";
+else
+       SRC_URI="https://github.com/iamthehorker/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64"
+fi
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+IUSE="cpu_flags_x86_avx2"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-fix-version.patch
+)
+
+src_compile() {
+       tc-export CC AR
+
+       use cpu_flags_x86_avx2 && append-cflags "-mavx2"
+
+       emake \
+               PREFIX="${EPREFIX}"/usr \
+               LIBDIR=$(get_libdir) \
+               CFLAGS="${CFLAGS}" \
+               LDFLAGS="${LDFLAGS}" \
+               ARFLAGS="${ARFLAGS} -rcs" \
+               all
+}
+
+src_install() {
+       emake \
+               PREFIX="${EPREFIX}"/usr \
+               DESTDIR="${D}" \
+               LIBDIR="$(get_libdir)" \
+               CFLAGS="${CFLAGS}" \
+               LDFLAGS="${LDFLAGS}" \
+               ARFLAGS="${ARFLAGS} -rcs" \
+               install
+}

diff --git a/media-libs/libfreeaptx/libfreeaptx-9999.ebuild 
b/media-libs/libfreeaptx/libfreeaptx-9999.ebuild
new file mode 100644
index 00000000000..f849a9cc545
--- /dev/null
+++ b/media-libs/libfreeaptx/libfreeaptx-9999.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Reverse-engineered aptX and aptX HD library (fork of libopenaptx)"
+HOMEPAGE="https://github.com/iamthehorker/libfreeaptx";
+
+if [[ ${PV} == "9999" ]] ; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/iamthehorker/${PN}";
+else
+       SRC_URI="https://github.com/iamthehorker/${PN}/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64"
+fi
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+
+IUSE="cpu_flags_x86_avx2"
+
+src_compile() {
+       tc-export CC AR
+
+       use cpu_flags_x86_avx2 && append-cflags "-mavx2"
+
+       emake \
+               PREFIX="${EPREFIX}"/usr \
+               LIBDIR=$(get_libdir) \
+               CFLAGS="${CFLAGS}" \
+               LDFLAGS="${LDFLAGS}" \
+               ARFLAGS="${ARFLAGS} -rcs" \
+               all
+}
+
+src_install() {
+       emake \
+               PREFIX="${EPREFIX}"/usr \
+               DESTDIR="${D}" \
+               LIBDIR="$(get_libdir)" \
+               CFLAGS="${CFLAGS}" \
+               LDFLAGS="${LDFLAGS}" \
+               ARFLAGS="${ARFLAGS} -rcs" \
+               install
+
+       rm -f "${ED}/usr/$(get_libdir)"/libopenaptx.a || die "Failed to remove 
static lib"
+}

diff --git a/media-libs/libfreeaptx/metadata.xml 
b/media-libs/libfreeaptx/metadata.xml
new file mode 100644
index 00000000000..889e237efe9
--- /dev/null
+++ b/media-libs/libfreeaptx/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Sam James</name>
+       </maintainer>
+       <maintainer type="project">
+               <email>[email protected]</email>
+               <name>Gentoo Codec Project</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">iamthehorker/libfreeaptx</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to