libfreeaptx-9999.ebuild 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit flag-o-matic toolchain-funcs git-r3
  5. DESCRIPTION="libopenaptx library without the additional license restriction"
  6. HOMEPAGE="https://github.com/iamthehorker/libfreeaptx"
  7. if [[ ${PV} == "9999" ]] ; then
  8. EGIT_REPO_URI="https://github.com/iamthehorker/${PN}"
  9. else
  10. SRC_URI="https://github.com/iamthehorker/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  11. KEYWORDS="~amd64"
  12. RESTRICT="mirror"
  13. fi
  14. LICENSE="LGPL-2.1+"
  15. SLOT="0"
  16. IUSE="cpu_flags_x86_avx2"
  17. src_compile() {
  18. tc-export CC AR
  19. use cpu_flags_x86_avx2 && append-cflags "-mavx2"
  20. emake \
  21. PREFIX="${EPREFIX}"/usr \
  22. LIBDIR=$(get_libdir) \
  23. CFLAGS="${CFLAGS}" \
  24. LDFLAGS="${LDFLAGS}" \
  25. ARFLAGS="${ARFLAGS} -rcs" \
  26. all
  27. }
  28. src_install() {
  29. emake \
  30. PREFIX="${EPREFIX}"/usr \
  31. DESTDIR="${D}" \
  32. LIBDIR="$(get_libdir)" \
  33. CFLAGS="${CFLAGS}" \
  34. LDFLAGS="${LDFLAGS}" \
  35. ARFLAGS="${ARFLAGS} -rcs" \
  36. install
  37. rm -f "${ED}/usr/$(get_libdir)"/libfreeaptx.a || die "Failed to remove static lib"
  38. }