--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ --- games-strategy/0ad/0ad-0.0.23b_alpha.ebuild +++ games-strategy/0ad/0ad-0.0.23b_alpha.ebuild @@ -18,7 +18,7 @@ LICENSE="GPL-2 LGPL-2.1 MIT CC-BY-SA-3.0 ZLIB" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="editor +lobby nvtt pch test" +IUSE="editor +lobby nvtt pch system-mozjs test" RESTRICT="test" RDEPEND=" @@ -42,7 +42,8 @@ x11-libs/libXcursor editor? ( x11-libs/wxGTK:${WX_GTK_VER}[X,opengl] ) lobby? ( >=net-libs/gloox-1.0.20 ) - nvtt? ( media-gfx/nvidia-texture-tools )" + nvtt? ( media-gfx/nvidia-texture-tools ) + system-mozjs? ( dev-lang/spidermonkey:38 )" DEPEND="${RDEPEND} ${PYTHON_DEPS} virtual/pkgconfig @@ -69,6 +70,7 @@ $(usex test "" "--without-tests") $(usex editor "--atlas" "") $(usex lobby "" "--without-lobby") + $(usex system-mozjs "--with-system-mozjs38" "") --collada --bindir="/usr/bin" --libdir="/usr/$(get_libdir)"/${PN} @@ -101,14 +103,20 @@ tc-export AR # build bundled and patched spidermonkey - cd libraries/source/spidermonkey || die - JOBS="${MAKEOPTS}" ./build.sh || die - cd "${S}" || die + if [ ! use system-mozjs ]; then + cd libraries/source/spidermonkey || die + JOBS="${MAKEOPTS}" ./build.sh || die + cd "${S}" || die + fi # build 3rd party fcollada emake -C libraries/source/fcollada/src # build 0ad + if [ ! use system-mozjs ]; then + CFLAGS="${CFLAGS} -I/usr/include/mozjs-38/" + CXXFLAGS="${CXXFLAGS} -I/usr/include/mozjs-38/" + fi emake -C build/workspaces/gcc verbose=1 } @@ -126,7 +134,7 @@ exeinto /usr/$(get_libdir)/${PN} doexe binaries/system/libCollada.so - doexe libraries/source/spidermonkey/lib/*.so + ! use system-mozjs && doexe libraries/source/spidermonkey/lib/*.so use editor && doexe binaries/system/libAtlasUI.so dodoc binaries/system/readme.txt