--- /dev/null
+Respect user CXXFLAGS setting.
+
+--- a/src/CMakeLists.txt 2019-05-06 15:09:19.010755505 +0200
++++ b/src/CMakeLists.txt 2019-05-06 15:14:11.668510627 +0200
+@@ -307,28 +307,28 @@
+ endif(READLINE_FOUND)
+
+ # set platform specific compiler flags
+-if (BuildFor0ld_X86)
+- set (OurCxxFlags ${BuildOptions_X86})
+-else (BuildFor0ld_X86)
+- if (BuildForAMD_X86_64)
+- set (OurCxxFlags ${BuildOptions_X86_64AMD})
+- else (BuildForAMD_X86_64)
+- if (BuildForCore2_X86_64)
+- set (OurCxxFlags ${BuildOptions_X86_64Core2})
+- else (BuildForCore2_X86_64)
+- if (BuildForNEON)
+- set (OurCxxFlags ${BuildOptions_NEON})
+- else (BuildForNEON)
+- if (BuildForThisCPU)
+- set (OurCxxFlags ${BuildOptionsThisCPU})
+- else (BuildForThisCPU)
+- set (OurCxxFlags ${BuildOptionsBasic})
+- endif (BuildForThisCPU)
+- endif (BuildForNEON)
+- endif (BuildForCore2_X86_64)
+- endif (BuildForAMD_X86_64)
+-endif (BuildFor0ld_X86)
+-set (CMAKE_CXX_FLAGS "${OurCxxFlags} ${CMAKE_CXX_FLAGS}")
++# if (BuildFor0ld_X86)
++# set (OurCxxFlags ${BuildOptions_X86})
++# else (BuildFor0ld_X86)
++# if (BuildForAMD_X86_64)
++# set (OurCxxFlags ${BuildOptions_X86_64AMD})
++# else (BuildForAMD_X86_64)
++# if (BuildForCore2_X86_64)
++# set (OurCxxFlags ${BuildOptions_X86_64Core2})
++# else (BuildForCore2_X86_64)
++# if (BuildForNEON)
++# set (OurCxxFlags ${BuildOptions_NEON})
++# else (BuildForNEON)
++# if (BuildForThisCPU)
++# set (OurCxxFlags ${BuildOptionsThisCPU})
++# else (BuildForThisCPU)
++# set (OurCxxFlags ${BuildOptionsBasic})
++# endif (BuildForThisCPU)
++# endif (BuildForNEON)
++# endif (BuildForCore2_X86_64)
++# endif (BuildForAMD_X86_64)
++# endif (BuildFor0ld_X86)
++# set (CMAKE_CXX_FLAGS "${OurCxxFlags} ${CMAKE_CXX_FLAGS}")
+
+ if (BuildForDebug)
+ set (CMAKE_BUILD_TYPE "Debug")
+@@ -330,8 +330,8 @@
+ message (STATUS "DEBUG Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+ else (BuildForDebug)
+ set (CMAKE_BUILD_TYPE "Release")
+- set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptionsRelease})
+- message (STATUS "RELEASE Build, flags: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
++ # set (CMAKE_CXX_FLAGS_RELEASE ${BuildOptionsRelease})
++ message (STATUS "RELEASE Build, flags: ${CMAKE_CXX_FLAGS}")
+ endif (BuildForDebug)
+
+ configure_file(
--- /dev/null
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake-utils xdg
+
+DESCRIPTION="Software synthesizer based on ZynAddSubFX"
+HOMEPAGE="https://yoshimi.github.io/"
+SRC_URI="https://github.com/${PN^}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+lv2"
+
+BDEPEND="virtual/pkgconfig"
+RDEPEND="
+ >=dev-libs/mxml-2.5
+ >=media-libs/alsa-lib-1.0.17
+ media-libs/fontconfig
+ media-libs/libsndfile
+ sci-libs/fftw:3.0=
+ sys-libs/ncurses:0=
+ sys-libs/readline:0=
+ sys-libs/zlib
+ virtual/jack
+ x11-libs/cairo[X]
+ x11-libs/fltk:1[opengl]
+ lv2? ( media-libs/lv2 )
+"
+DEPEND="${RDEPEND}
+ dev-libs/boost
+"
+
+CMAKE_USE_DIR="${WORKDIR}/${P}/src"
+
+PATCHES=( "${FILESDIR}"/${P}-cxxflags.patch )
+
+DOCS=( Changelog README.txt )
+
+src_prepare() {
+ cmake-utils_src_prepare
+ # respect doc dir
+ sed -e "s#/doc/yoshimi#/doc/${PF}#" -i src/CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DLV2Plugin=$(usex lv2)
+ )
+ cmake-utils_src_configure
+}