opencollada-1.6.31.ebuild 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils cmake-utils
  5. DESCRIPTION="Stream based read/write library for COLLADA files"
  6. HOMEPAGE="http://www.opencollada.org/"
  7. SRC_URI="https://github.com/KhronosGroup/OpenCOLLADA/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  8. LICENSE="MIT"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~ppc64 ~x86"
  11. IUSE="expat static-libs"
  12. # This is still needed to have so version numbers
  13. MY_SOVERSION="1.6"
  14. RDEPEND="dev-libs/libpcre
  15. dev-libs/zziplib
  16. media-libs/lib3ds
  17. sys-libs/zlib
  18. expat? ( dev-libs/expat )
  19. !expat? ( dev-libs/libxml2 )"
  20. DEPEND="${RDEPEND}
  21. virtual/pkgconfig"
  22. S="${WORKDIR}"/OpenCOLLADA-${PV}
  23. # This is needed or you get an error on install
  24. BUILD_DIR="${S}"/build
  25. PATCHES=(
  26. "${FILESDIR}"/${PN}-0_p864-expat.patch
  27. "${FILESDIR}"/${PN}-1.2.2-soversion.patch
  28. "${FILESDIR}"/${PN}-1.2.2-no-undefined.patch
  29. "${FILESDIR}"/${PN}-1.2.2-libdir.patch
  30. )
  31. src_prepare() {
  32. edos2unix CMakeLists.txt
  33. default
  34. # Remove bundled depends that have portage equivalents
  35. rm -rv Externals/{expat,lib3ds,LibXML,pcre,zlib,zziplib} || die
  36. # Remove unused build systems
  37. rm -v Makefile scripts/{unixbuild.sh,vcproj2cmake.rb} || die
  38. find "${S}" -name SConscript -delete || die
  39. }
  40. src_configure() {
  41. local mycmakeargs=(
  42. -DUSE_SHARED=ON
  43. -DUSE_STATIC=$(usex static-libs ON OFF)
  44. -DUSE_EXPAT=$(usex expat ON OFF)
  45. -DUSE_LIBXML=$(usex !expat ON OFF)
  46. -Dsoversion=${MY_SOVERSION}
  47. )
  48. cmake-utils_src_configure
  49. }
  50. src_install() {
  51. cmake-utils_src_install
  52. echo "LDPATH=/usr/$(get_libdir)/opencollada" > "${T}"/99${PN} || die "echo failed"
  53. doenvd "${T}"/99${PN}
  54. dobin build/bin/OpenCOLLADAValidator
  55. }