media-sound/csound-9999: updated
authorMiroslav Šulc <fordfrog@gentoo.org>
Sun, 15 Dec 2019 14:08:01 +0000 (15:08 +0100)
committerMiroslav Šulc <fordfrog@gentoo.org>
Sun, 15 Dec 2019 14:09:06 +0000 (15:09 +0100)
 1) updated to eapi7
 2) removed python2_7, added python3_{5,6,7,8}
 3) removed temporarily java use flag as building java interface
    does not work atm due to missing configuration variables
 4) updated and organized deps
 5) removed csoundac use flag as it does not have corresponding
    configuration in cmake
 6) added most of configurable options from cmake for future
    reference
 7) reorganized cmake flags so they match the alphabetical order
    of their names so they can be easily match in cmake-gui
    for example
 8) added -DFAIL_MISSING=ON so that the ebuild fails when a dep
    is missing
 9) removed cmake flags that are not present anymore
10) added selection of correct lua implementation based
    on lua and luajit use flags

Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
media-sound/csound/csound-9999.ebuild

index c0694b7cd5cceb72bd599f2fb2cfc3ba57147725..825888b23593da59093e29bba4aecdedc183a3e6 100644 (file)
@@ -1,9 +1,9 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
-PYTHON_COMPAT=( python2_7 )
+PYTHON_COMPAT=( python3_{5,6,7,8} )
 inherit cmake-utils java-pkg-opt-2 python-single-r1 toolchain-funcs
 
 if [[ ${PV} == "9999" ]]; then
@@ -24,30 +24,45 @@ HOMEPAGE="https://csound.github.io/"
 
 LICENSE="LGPL-2.1 doc? ( FDL-1.2+ )"
 SLOT="0"
-IUSE="+alsa beats chua csoundac curl +cxx debug doc double-precision dssi examples
-fltk +fluidsynth +image jack java keyboard linear lua luajit nls osc portaudio
+# java doesn't work atm as it needs to have some variables specified to work, see src_configure
+# mp3 doesnt work as media-sound/lame does not install cmake file
+IUSE="+alsa beats chua curl +cxx debug doc double-precision dssi examples
+fltk +fluidsynth +image jack keyboard linear lua luajit nls osc portaudio
 portaudio portmidi pulseaudio python samples static-libs stk test +threads +utils
 vim-syntax websocket"
 
 IUSE_LANGS=" de en_US es es_CO fr it ro ru"
 
 REQUIRED_USE="
-       csoundac? ( || ( lua python ) )
-       java? ( cxx )
        linear? ( double-precision )
        lua? ( cxx )
        python? ( ${PYTHON_REQUIRED_USE} cxx )
 "
+#      java? ( cxx )
 
-RDEPEND="
+BDEPEND="
+       dev-libs/boost:=
+       sys-devel/flex
+       virtual/yacc
+       chua? ( dev-libs/boost )
+       python? ( dev-lang/swig )
+       nls? ( sys-devel/gettext )
+       test? (
+               dev-util/cunit
+               ${PYTHON_DEPS}
+       )
+"
+# linear currently works only with sci-mathematics-gmm-5.1
+#   https://github.com/csound/csound/issues/920
+# currently not used deps due to some issues
+#      java? ( virtual/jdk:* )
+#      mp3? ( media-sound/lame )
+CDEPEND="
+       dev-cpp/eigen:3
        >=media-libs/libsndfile-1.0.16
        media-libs/libsamplerate
+       sys-libs/zlib
        alsa? ( media-libs/alsa-lib )
-       csoundac? (
-               x11-libs/fltk:1[threads?]
-               dev-cpp/eigen:3
-               dev-libs/boost:=
-       )
        curl? ( net-misc/curl )
        dssi? (
                media-libs/dssi
@@ -56,10 +71,9 @@ RDEPEND="
        fluidsynth? ( media-sound/fluidsynth:= )
        fltk? ( x11-libs/fltk:1[threads?] )
        image? ( media-libs/libpng:0= )
-       jack? ( media-sound/jack-audio-connection-kit )
-       java? ( virtual/jdk:* )
+       jack? ( virtual/jack )
        keyboard? ( x11-libs/fltk:1[threads?] )
-       linear? ( sci-mathematics/gmm )
+       linear? ( =sci-mathematics/gmm-5.1* )
        lua? (
                luajit? ( dev-lang/luajit:2 )
                !luajit? ( dev-lang/lua:0 )
@@ -73,17 +87,8 @@ RDEPEND="
        utils? ( !media-sound/snd )
        websocket? ( net-libs/libwebsockets )
 "
-DEPEND="${RDEPEND}
-       sys-devel/flex
-       virtual/yacc
-       chua? ( dev-libs/boost )
-       csoundac? ( dev-lang/swig )
-       nls? ( sys-devel/gettext )
-       test? (
-               dev-util/cunit
-               ${PYTHON_DEPS}
-       )
-"
+RDEPEND="${CDEPEND}"
+DEPEND="${CDEPEND}"
 
 if [[ ${PV} != "9999" ]]; then
        DEPEND+="doc? ( app-arch/unzip )"
@@ -106,6 +111,7 @@ src_prepare() {
                -i CMakeLists.txt || die
 
        local lang
+
        for lang in ${IUSE_LANGS} ; do
                if ! has ${lang} ${LINGUAS-${lang}} ; then
                        sed -i "/compile_po(${lang}/d" po/CMakeLists.txt || die
@@ -115,45 +121,97 @@ src_prepare() {
 
 src_configure() {
        local mycmakeargs=(
-               -DUSE_ALSA=$(usex alsa)
-               -DBUILD_CSBEATS=$(usex beats)
+               #-DBUILD_BELA=OFF
+               #-DBUILD_BUCHLA_OPCODES=ON
                -DBUILD_CHUA_OPCODES=$(usex chua)
-               -DBUILD_CSOUND_AC=$(usex csoundac)
-               -DBUILD_CSOUND_AC_LUA_INTERFACE=$(usex csoundac $(usex lua))
-               -DBUILD_CSOUND_AC_PYTHON_INTERFACE=$(usex csoundac $(usex python))
+               -DBUILD_CSBEATS=$(usex beats)
+               #-DBUILD_CUDA_OPCODES=OFF
                -DBUILD_CXX_INTERFACE=$(usex cxx)
-               -DUSE_CURL=$(usex curl)
-               -DNEW_PARSER_DEBUG=$(usex debug)
-               -DUSE_DOUBLE=$(usex double-precision)
                -DBUILD_DSSI_OPCODES=$(usex dssi)
+               #-DBUILD_EMUGENS_OPCODES=ON
+               #-DBUILD_EXCITER_OPCODES=ON
+               -DBUILD_FAUST_OPCODES=OFF
                -DBUILD_FLUID_OPCODES=$(usex fluidsynth)
-               -DUSE_FLTK=$(usex fltk)
+               #-DBUILD_FRAMEBUFFER_OPCODES=ON
+               #-DBUILD_HDF5_OPCODES=ON
                -DBUILD_IMAGE_OPCODES=$(usex image)
-               -DUSE_JACK=$(usex jack)
                -DBUILD_JACK_OPCODES=$(usex jack)
-               -DBUILD_JAVA_INTERFACE=$(usex java)
-               -DBUILD_VIRTUAL_KEYBOARD=$(usex keyboard)
+               -DBUILD_JAVA_INTERFACE=OFF
                -DBUILD_LINEAR_ALGEBRA_OPCODES=$(usex linear)
-               -DBUILD_LUA_OPCODES=$(usex lua)
                -DBUILD_LUA_INTERFACE=$(usex lua)
-               -DUSE_GETTEXT=$(usex nls)
+               -DBUILD_MP3OUT_OPCODE=OFF
+               -DBUILD_MULTI_CORE=$(usex threads)
+               #-DBUULD_OPENCL_OPCODES=OFF
                -DBUILD_OSC_OPCODES=$(usex osc)
-               -DUSE_PORTAUDIO=$(usex portaudio)
-               -DUSE_PORTMIDI=$(usex portmidi)
-               -DUSE_PULSEAUDIO=$(usex pulseaudio)
-               -DBUILD_PYTHON_OPCODES=$(usex python)
+               -DBUILD_P5GLOVE_OPCODES=OFF
+               #-DBUILD_PADSYNTH_OPCODES=ON
+               #-DBUILD_PLATEREV_OPCODES=ON
+               #-DBUILD_PVSGENDY_OPCODE=OFF
                -DBUILD_PYTHON_INTERFACE=$(usex python)
+               -DBUILD_PYTHON_OPCODES=$(usex python)
+               -DBUILD_RELEASE=ON
+               #-DBUILD_SCANSYN_OPCODES=ON
+               #-DBUILD_SELECT_OPCODE=ON
+               #-DBUILD_SERIAL_OPCODES=ON
+               -DBUILD_SHARED_LIBS=ON
+               #-DBUILD_STACK_OPCODES=ON
                -DBUILD_STATIC_LIBRARY=$(usex static-libs)
+               -DBUILD_STATIC_LIBRARY=$(usex test)
                -DBUILD_STK_OPCODES=$(usex stk)
                -DBUILD_TESTS=$(usex test)
-               -DBUILD_STATIC_LIBRARY=$(usex test)
-               -DBUILD_MULTI_CORE=$(usex threads)
                -DBUILD_UTILITIES=$(usex utils)
+               -DBUILD_VIRTUAL_KEYBOARD=$(usex keyboard)
+               #-DBUILD_VST4CS_OPCODES=OFF
                -DBUILD_WEBSOCKET_OPCODE=$(usex websocket)
+               -DBUILD_WIIMOTE_OPCODES=OFF
+               -DBUILD_WINSOUND=OFF
+
+               -DFAIL_MISSING=ON
                -DNEED_PORTTIME=OFF
-               -DBUILD_RELEASE=ON
+               -DNEW_PARSER_DEBUG=$(usex debug)
+
+               -DUSE_ALSA=$(usex alsa)
+               #-DUSE_ATOMIC_BUILTIN=ON
+               #-DUSE_AUDIOUNIT=ON
+               #-DUSE_COMPILER_OPTIMIZATIONS=ON
+               #-DUSE_COREMIDI=ON
+               -DUSE_CURL=$(usex curl)
+               -DUSE_DOUBLE=$(usex double-precision)
+               -DUSE_FLTK=$(usex fltk)
+               -DUSE_GETTEXT=$(usex nls)
+               -DUSE_GIT_COMMIT=ON
+               #_DUSE_IPMIDI=ON
+               #-DUSE_LRINT=ON
+               -DUSE_JACK=$(usex jack)
+               -DUSE_PORTAUDIO=$(usex portaudio)
+               -DUSE_PORTMIDI=$(usex portmidi)
+               -DUSE_PULSEAUDIO=$(usex pulseaudio)
+
        )
 
+       #use java && mycmakeargs+=(
+               #-DJAVA_INCLUDE_PATH="${JAVA_HOME}/include"
+               #-DJAVA_AWT_LIBRARY="?"
+               #-DJAVA_JVM_LIBRARY="?"
+               #-DJAVA_INCLUDE_PATH2="?"
+               #-DJAVA_AWT_INCLUDE_PATH="?"
+       #)
+
+       # set the library that we want to use
+       if use lua ; then
+               local package
+
+               if use luajit ; then
+                       package="luajit"
+               else
+                       package="lua"
+               fi
+
+               mycmakeargs+=(
+                       -DLUA_LIBRARY="$(pkg-config --variable=libdir ${package})/lib$(pkg-config --variable=libname ${package}).so"
+               )
+       fi
+
        use python && mycmakeargs+=(
                -DPYTHON_MODULE_INSTALL_DIR="$(python_get_sitedir)"
        )
@@ -194,7 +252,7 @@ src_install() {
        fi
 
        # rename extract to csound_extract (bug #247394)
-       mv "${ED%/}"/usr/bin/{,csound_}extract || die
+       mv "${ED}"/usr/bin/{,csound_}extract || die
 
        use python && python_optimize