# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
+# As upstream (and we aswell) are not allowed to redistribute scansyn,
+# we have to repackage the tarball. For that purpose use `bash files/repackage.sh version`
+# Reference: https://github.com/csound/csound/issues/1148
+
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8} )
# requires specific alsa settings
RESTRICT="test"
+PATCHES=(
+ "${FILESDIR}/csound-6.13.0-xdg-open.patch"
+)
+
pkg_setup() {
if use python || use test ; then
python-single-r1_pkg_setup
--- /dev/null
+Source: https://build.opensuse.org/package/view_file/openSUSE:Factory/csound/csound-6.08-xdg-open.patch
+Index: csound-6.12.2/installer/misc/vim/cshelp
+===================================================================
+--- csound-6.12.2.orig/installer/misc/vim/cshelp 2018-11-07 16:05:23.000000000 +0200
++++ csound-6.12.2/installer/misc/vim/cshelp 2019-04-05 15:32:23.670308342 +0200
+@@ -3,7 +3,9 @@
+ BROWSER_CMD=""
+
+ if [ "${DISPLAY}" != "" ] ; then
+- if ( which links | grep -q -G -e "^/usr" ) ; then
++ if ( which xdg-open | grep -E -e "^(/usr)?/bin" ); then
++ BROWSER_CMD="xdg-open" ;
++ elif ( which links | grep -q -G -e "^/usr" ) ; then
+ BROWSER_CMD="links -g" ;
+ elif ( which konqueror | grep -q -G -e "^/opt" ) ; then
+ BROWSER_CMD="konqueror" ;
+@@ -38,5 +40,5 @@ else
+ OPNAME="${1}" ;
+ fi
+
+-exec ${BROWSER_CMD} "/usr/local/share/doc/csound/manual/${OPNAME}.html"
++exec ${BROWSER_CMD} "/usr/share/doc/csound-manual/${OPNAME}.html"
+
+
--- /dev/null
+#! /bin/bash
+
+# Adjusted from OpenSUSE script
+# Source: https://build.opensuse.org/package/view_file/openSUSE:Factory/csound/pre_checkin.sh
+
+VERSION="${1}"
+
+if [[ -z "${VERSION}" ]]; then
+ echo "Version must be specified"
+ exit 1
+fi
+
+rm -f *.tar.*
+
+wget https://github.com/csound/csound/archive/${VERSION}.tar.gz || exit 1
+
+echo -e "\n\nUnpacking tarball\n"
+tar -xf ${VERSION}.tar.gz
+
+echo -e "Removing undistibutable files\n"
+rm -f csound-${VERSION}/Opcodes/scansyn*
+
+echo -e "Creating distributable tarball\n"
+tar -acf csound-${VERSION}-distibutable.tar.xz csound-${VERSION}
+
+echo -e "Cleaning up\n"
+rm -rf csound-${VERSION} ${VERSION}.tar.gz
+
+if ! test -e ${VERSION}.tar.gz; then
+ echo "success"
+ exit 0
+else
+ echo "error"
+ exit 1
+fi