media-sound/csound: fix underlinking on libm
authorSergey Popov <pinkbyte@gentoo.org>
Fri, 27 Nov 2015 13:05:51 +0000 (16:05 +0300)
committerSergey Popov <pinkbyte@gentoo.org>
Fri, 27 Nov 2015 13:05:51 +0000 (16:05 +0300)
Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Gentoo-Bug: 566064

Package-Manager: portage-2.2.23

media-sound/csound/csound-6.05.0.ebuild
media-sound/csound/files/csound-6.05-underlinking.patch [new file with mode: 0644]

index 02e99b959cc32c6eb923440b273738c1a4367050..1249920cb6c09f91c6255997666f64cff894a2c6 100644 (file)
@@ -94,6 +94,9 @@ pkg_setup() {
 src_prepare() {
        epatch "${FILESDIR}"/csound-6.05-python.patch
 
+       # bug #566064
+       epatch "${FILESDIR}"/csound-6.05-underlinking.patch
+
        sed -e '/set(PLUGIN_INSTALL_DIR/s/-${APIVERSION}//' \
                -e '/-O3/d' \
                -i CMakeLists.txt || die
diff --git a/media-sound/csound/files/csound-6.05-underlinking.patch b/media-sound/csound/files/csound-6.05-underlinking.patch
new file mode 100644 (file)
index 0000000..eac83f2
--- /dev/null
@@ -0,0 +1,53 @@
+commit a4b1930b506274e328ee26cd6287965cb496062b
+Author: Steven Yi <stevenyi@gmail.com>
+Date:   Mon Sep 28 18:21:22 2015 -0400
+
+    modified make_utility and targets for csound-bin and mixer-bin to use add libm for linking when on Linux [fixes #526]
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2b16079..18a6ad1 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -97,6 +97,10 @@ endfunction(make_executable)
+ function(make_utility name srcs)
+     make_executable(${name} "${srcs}" "${CSOUNDLIB}")
+     add_dependencies(${name} ${CSOUNDLIB})
++ 
++    if(LINUX)
++        target_link_libraries(${name} m)
++    endif()
+ endfunction()
+ 
+ 
+diff --git a/frontends/CMakeLists.txt b/frontends/CMakeLists.txt
+index d0e3a21..b31f37a 100644
+--- a/frontends/CMakeLists.txt
++++ b/frontends/CMakeLists.txt
+@@ -43,6 +43,9 @@ endfunction(make_plugin_frontend)
+ 
+ # We need a different name to avoid clashes with float libcsound
+ make_executable(csound-bin "${CS_MAIN_SRCS}" "${CSOUNDLIB}" csound)
++if(LINUX)
++  target_link_libraries(csound-bin m)
++endif()
+ 
+ message(STATUS "Building csLadspa")
+ 
+diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt
+index 25089cc..ebf0aa5 100644
+--- a/util/CMakeLists.txt
++++ b/util/CMakeLists.txt
+@@ -23,9 +23,11 @@ if(BUILD_UTILITIES)
+     make_utility(hetro       het_main.c)\r
+     make_utility(lpanal      lpc_main.c)\r
+     make_utility(lpc_export  lpcx_main.c)\r
+-    target_link_libraries(lpc_export m)\r
+     make_utility(lpc_import  lpci_main.c)\r
+-    make_executable(mixer-bin   mixer_main.c   "${CSOUNDLIB}" mixer)\r
++    if(LINUX)\r
++      make_executable(mixer-bin   mixer_main.c   "${CSOUNDLIB}" mixer)\r
++    endif()\r
++    target_link_libraries(mixer-bin m)\r
+     make_utility(pvanal      pvc_main.c)\r
+     make_utility(pvlook      pvl_main.c)\r
+     make_utility(pv_export   pvx_main.c)\r