1
0
flewkey-overlay/dev-libs/juce/juce-6.1.6.ebuild

89 lines
2.6 KiB
Bash
Raw Normal View History

# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/juce-framework/JUCE.git"
else
MY_PN="JUCE"
MY_P="${MY_PN}-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="https://github.com/juce-framework/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64"
fi
DESCRIPTION="A cross-platform C++ framework"
HOMEPAGE="https://juce.com/"
LICENSE="juce-6"
SLOT="6.1.6"
IUSE="+projucer extras examples"
DEPEND="
media-libs/alsa-lib
media-libs/freetype:2
net-libs/webkit-gtk
net-misc/curl
"
RDEPEND="
${DEPEND}
app-eselect/eselect-juce
"
BDEPEND="
>=dev-util/cmake-3.12
virtual/pkgconfig
"
src_configure() {
local mycmakeargs=(
"-DJUCE_BUILD_EXAMPLES="$(usex examples ON OFF)
)
if use projucer || use extras ; then
mycmakeargs+=("-DJUCE_BUILD_EXTRAS=ON")
else
mycmakeargs+=("-DJUCE_BUILD_EXTRAS=OFF")
fi
if use projucer && ! use extras ; then
cd extras
cmake_comment_add_subdirectory AudioPerformanceTest
cmake_comment_add_subdirectory AudioPluginHost
cmake_comment_add_subdirectory BinaryBuilder
cmake_comment_add_subdirectory NetworkGraphicsDemo
cmake_comment_add_subdirectory UnitTestRunner
cd ..
fi
cmake_src_configure
}
src_install() {
# Install JUCE to /opt
dodir /opt
cp -r "${S}/" "${D}/opt/${P}/" || die
# Move programs to JUCE folder
cp "${BUILD_DIR}/tools/extras/Build/juceaide/juceaide_artefacts/Debug/juceaide" "${D}/opt/${P}/"
if use projucer || use extras ; then
cp "${BUILD_DIR}/extras/Projucer/Projucer_artefacts/${CMAKE_BUILD_TYPE}/Projucer" "${D}/opt/${P}/"
fi
if use extras ; then
cp "${BUILD_DIR}/extras/AudioPerformanceTest/AudioPerformanceTest_artefacts/${CMAKE_BUILD_TYPE}/AudioPerformanceTest" "${D}/opt/${P}/"
cp "${BUILD_DIR}/extras/AudioPluginHost/AudioPluginHost_artefacts/${CMAKE_BUILD_TYPE}/AudioPluginHost" "${D}/opt/${P}/"
cp "${BUILD_DIR}/extras/BinaryBuilder/BinaryBuilder_artefacts/${CMAKE_BUILD_TYPE}/BinaryBuilder" "${D}/opt/${P}/"
cp "${BUILD_DIR}/extras/NetworkGraphicsDemo/NetworkGraphicsDemo_artefacts/${CMAKE_BUILD_TYPE}/NetworkGraphicsDemo" "${D}/opt/${P}/"
cp "${BUILD_DIR}/extras/UnitTestRunner/UnitTestRunner_artefacts/${CMAKE_BUILD_TYPE}/UnitTestRunner" "${D}/opt/${P}/"
fi
}
pkg_postinst() {
if [[ ! -f ${EROOT}/usr/bin/juceaide ]]; then
eselect juceaide set "${P}"
einfo "${P} set as the default juceaide version"
fi
if use projucer && [[ ! -f ${EROOT}/usr/bin/Projucer ]]; then
eselect projucer set "${P}"
einfo "${P} set as the default Projucer version"
fi
}