Skip to content

Commit

Permalink
media-sound/csound: [QA] Various fixes
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.6, Repoman-2.3.2
  • Loading branch information
SoapGentoo committed Jun 3, 2017
1 parent 2120232 commit aea24fb
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 53 deletions.
60 changes: 33 additions & 27 deletions media-sound/csound/csound-6.08.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@
# Distributed under the terms of the GNU General Public License v2

EAPI=6

PYTHON_COMPAT=( python2_7 )
inherit eutils multilib java-pkg-opt-2 cmake-utils toolchain-funcs versionator python-single-r1

DESCRIPTION="A sound design and signal processing system providing facilities for composition and performance"
inherit eutils java-pkg-opt-2 toolchain-funcs versionator python-single-r1 cmake-utils

if [[ ${PV} == *9999 ]]; then
EGIT_REPO_URI="https://github.com/csound/csound.git"
inherit git-r3
else
SRC_URI="https://github.com/csound/csound/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi

DESCRIPTION="A sound design and signal processing system for composition and performance"
HOMEPAGE="http://csound.github.io/"
SRC_URI="https://github.com/csound/csound/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+alsa beats chua csoundac curl +cxx debug double-precision dssi examples
fltk +fluidsynth +image jack java keyboard linear lua luajit nls osc openmp
portaudio portmidi pulseaudio python samples score static-libs stk tcl test
Expand Down Expand Up @@ -46,7 +54,7 @@ RDEPEND="
fltk? ( x11-libs/fltk:1[threads?] )
image? ( media-libs/libpng:0= )
jack? ( media-sound/jack-audio-connection-kit )
java? ( virtual/jdk )
java? ( virtual/jdk:* )
keyboard? ( x11-libs/fltk:1[threads?] )
linear? ( sci-mathematics/gmm )
lua? (
Expand Down Expand Up @@ -81,6 +89,8 @@ DEPEND="${RDEPEND}
# requires specific alsa settings
RESTRICT="test"

PATCHES=( "${FILESDIR}"/csound-6.05-python.patch )

pkg_pretend() {
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
}
Expand All @@ -94,28 +104,21 @@ pkg_setup() {
}

src_prepare() {
local PATCHES=( "${FILESDIR}"/csound-6.05-python.patch )
cmake-utils_src_prepare

sed -e '/set(PLUGIN_INSTALL_DIR/s/-${APIVERSION}//' \
-e '/-O3/d' \
-i CMakeLists.txt || die

local lang
for lang in ${LANGS} ; do
if ! use linguas_${lang} ; then
sed -i "/compile_po(${lang}/d" po/CMakeLists.txt || die
fi
done

default
}

src_configure() {
local myconf=()

use python && myconf+=( "-DPYTHON_MODULE_INSTALL_DIR=$(python_get_sitedir)" )

[[ $(get_libdir) == "lib64" ]] && myconf+=( -DUSE_LIB64=ON )

local mycmakeargs=(
-DUSE_ALSA=$(usex alsa)
-DBUILD_CSBEATS=$(usex beats)
Expand Down Expand Up @@ -157,28 +160,31 @@ src_configure() {
-DBUILD_WEBSOCKET_OPCODE=$(usex websocket)
-DNEED_PORTTIME=OFF
-DBUILD_RELEASE=ON
"${myconf[@]}"
)

cmake-utils_src_configure
}
use python && mycmakeargs+=(
-DPYTHON_MODULE_INSTALL_DIR="$(python_get_sitedir)"
)

src_test() {
cmake-utils_src_test
[[ $(get_libdir) == "lib64" ]] && mycmakeargs+=(
-DUSE_LIB64=ON
)

cmake-utils_src_configure
}

src_install() {
cmake-utils_src_install
dodoc AUTHORS ChangeLog README.md Release_Notes/*
dodoc -r Release_Notes/.

# Generate env.d file
if use double-precision ; then
echo OPCODEDIR64=/usr/$(get_libdir)/${PN}/plugins64 > "${T}"/62${PN}
else
echo OPCODEDIR=/usr/$(get_libdir)/${PN}/plugins > "${T}"/62${PN}
cat > "${T}"/62${PN} <<-_EOF_ || die
OPCODEDIR$(usex double-precision 64 '')="${EPREFIX}/usr/$(get_libdir)/${PN}/plugins$(usex double-precision 64 '')"
CSSTRNGS="${EPREFIX}/usr/share/locale"
_EOF_
if use stk ; then
echo RAWWAVE_PATH=\"${EPREFIX}/usr/share/csound/rawwaves\" >> "${T}"/62${PN} || die
fi
echo "CSSTRNGS=/usr/share/locale" >> "${T}"/62${PN}
use stk && echo "RAWWAVE_PATH=/usr/share/csound/rawwaves" >> "${T}"/62${PN}
doenvd "${T}"/62${PN}

if use examples ; then
Expand All @@ -196,7 +202,7 @@ src_install() {
fi

# rename extract to csound_extract (bug #247394)
mv "${ED}"/usr/bin/{extract,csound_extract} || die
mv "${ED%/}"/usr/bin/{,csound_}extract || die

use python && python_optimize
}
Expand Down
50 changes: 24 additions & 26 deletions media-sound/csound/csound-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
# Distributed under the terms of the GNU General Public License v2

EAPI=6

PYTHON_COMPAT=( python2_7 )
inherit eutils multilib java-pkg-opt-2 cmake-utils toolchain-funcs versionator python-single-r1

if [[ ${PV} == "9999" ]] ; then
inherit eutils java-pkg-opt-2 toolchain-funcs versionator python-single-r1 cmake-utils

if [[ ${PV} == *9999 ]]; then
EGIT_REPO_URI="https://github.com/csound/csound.git"
inherit git-r3
else
SRC_URI="https://github.com/csound/csound/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi

DESCRIPTION="A sound design and signal processing system providing facilities for composition and performance"
DESCRIPTION="A sound design and signal processing system for composition and performance"
HOMEPAGE="http://csound.github.io/"

LICENSE="LGPL-2.1"
Expand Down Expand Up @@ -52,7 +54,7 @@ RDEPEND="
fltk? ( x11-libs/fltk:1[threads?] )
image? ( media-libs/libpng:0= )
jack? ( media-sound/jack-audio-connection-kit )
java? ( virtual/jdk )
java? ( virtual/jdk:* )
keyboard? ( x11-libs/fltk:1[threads?] )
linear? ( sci-mathematics/gmm )
lua? (
Expand Down Expand Up @@ -100,28 +102,21 @@ pkg_setup() {
}

src_prepare() {
local PATCHES=( "${FILESDIR}"/csound-6.05-python.patch )
cmake-utils_src_prepare

sed -e '/set(PLUGIN_INSTALL_DIR/s/-${APIVERSION}//' \
-e '/-O3/d' \
-i CMakeLists.txt || die

local lang
for lang in ${LANGS} ; do
if ! use linguas_${lang} ; then
sed -i "/compile_po(${lang}/d" po/CMakeLists.txt || die
fi
done

default
}

src_configure() {
local myconf=()

use python && myconf+=( "-DPYTHON_MODULE_INSTALL_DIR=$(python_get_sitedir)" )

[[ $(get_libdir) == "lib64" ]] && myconf+=( -DUSE_LIB64=ON )

local mycmakeargs=(
-DUSE_ALSA=$(usex alsa)
-DBUILD_CSBEATS=$(usex beats)
Expand Down Expand Up @@ -163,28 +158,31 @@ src_configure() {
-DBUILD_WEBSOCKET_OPCODE=$(usex websocket)
-DNEED_PORTTIME=OFF
-DBUILD_RELEASE=ON
"${myconf[@]}"
)

cmake-utils_src_configure
}
use python && mycmakeargs+=(
-DPYTHON_MODULE_INSTALL_DIR="$(python_get_sitedir)"
)

src_test() {
cmake-utils_src_test
[[ $(get_libdir) == "lib64" ]] && mycmakeargs+=(
-DUSE_LIB64=ON
)

cmake-utils_src_configure
}

src_install() {
cmake-utils_src_install
dodoc AUTHORS ChangeLog README.md Release_Notes/*
dodoc -r Release_Notes/.

# Generate env.d file
if use double-precision ; then
echo OPCODEDIR64=/usr/$(get_libdir)/${PN}/plugins64 > "${T}"/62${PN}
else
echo OPCODEDIR=/usr/$(get_libdir)/${PN}/plugins > "${T}"/62${PN}
cat > "${T}"/62${PN} <<-_EOF_ || die
OPCODEDIR$(usex double-precision 64 '')="${EPREFIX}/usr/$(get_libdir)/${PN}/plugins$(usex double-precision 64 '')"
CSSTRNGS="${EPREFIX}/usr/share/locale"
_EOF_
if use stk ; then
echo RAWWAVE_PATH=\"${EPREFIX}/usr/share/csound/rawwaves\" >> "${T}"/62${PN} || die
fi
echo "CSSTRNGS=/usr/share/locale" >> "${T}"/62${PN}
use stk && echo "RAWWAVE_PATH=/usr/share/csound/rawwaves" >> "${T}"/62${PN}
doenvd "${T}"/62${PN}

if use examples ; then
Expand All @@ -202,7 +200,7 @@ src_install() {
fi

# rename extract to csound_extract (bug #247394)
mv "${ED}"/usr/bin/{extract,csound_extract} || die
mv "${ED%/}"/usr/bin/{,csound_}extract || die

use python && python_optimize
}
Expand Down

0 comments on commit aea24fb

Please sign in to comment.