media-sound/wav2json: Respect CFLAGS/LDFLAGS/CXX

Closes: https://bugs.gentoo.org/727778
Closes: https://bugs.gentoo.org/724844
Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Jakov Smolic
2021-04-30 17:14:37 +01:00
committed by Sam James
parent 739225cf19
commit aa97c3df1c
2 changed files with 47 additions and 7 deletions

View File

@@ -0,0 +1,35 @@
--- a/Makefile
+++ b/Makefile
@@ -4,23 +4,7 @@ UNAME := $(shell uname)
BINARY=../bin/$(UNAME)/wav2json
SRC=../src
-ifeq ($(UNAME), Linux)
LD_PLATFORM_FLAGS=-lboost_program_options -lsndfile
-CC=g++
-endif
-ifeq ($(UNAME), Darwin)
-CC=clang++
-LD_PLATFORM_FLAGS=\
- /usr/local/lib/libboost_program_options-mt.a \
- /usr/local/lib/libsndfile.a \
- /usr/local/lib/libogg.a \
- /usr/local/lib/libvorbis.a \
- /usr/local/lib/libvorbisenc.a \
- /usr/local/lib/libFLAC.a
-
-INCLUDES=\
- -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/X11/include/
-endif
ifdef USE_FLOAT
LD_PLATFORM_FLAGS+=-DUSE_FLOAT
@@ -42,7 +26,7 @@ $(SRC)/version.hpp: Makefile version.txt
$(BINARY): $(SRC)/*.cpp $(SRC)/*.hpp $(SRC)/version.hpp
mkdir -p `dirname $(BINARY)`
- $(CC) -O3 -Wall -Werror -std=c++11 $(SRC)/*.cpp $(INCLUDES) $(LD_PLATFORM_FLAGS) -o $(BINARY)
+ $(CXX) $(LDFLAGS) $(CXXFLAGS) $(CPPFLAGS) -Wall -std=c++11 $(SRC)/*.cpp $(INCLUDES) $(LD_PLATFORM_FLAGS) -o $(BINARY)
../examples/%.json : ../example_data/%.wav
$(BINARY) $+ --precision 2 --channels left right mid side min max -o $@

View File

@@ -1,26 +1,31 @@
# Copyright 1999-2016 Gentoo Foundation
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
EAPI=7
inherit toolchain-funcs
COMMIT_ID="e412923f1f792408e8ae1096ca40fb5307ddfc74"
DESCRIPTION="Generate waveformjs.org compatible json data out of wav files"
HOMEPAGE="https://github.com/beschulz/wav2json"
SRC_URI="https://github.com/beschulz/wav2json/archive/${COMMIT_ID}.tar.gz -> ${P}.tar.gz"
S=${WORKDIR}/${PN}-${COMMIT_ID}/build
S="${WORKDIR}/${PN}-${COMMIT_ID}/build"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND="
dev-libs/boost:=
media-libs/libsndfile
"
media-libs/libsndfile:="
RDEPEND="${DEPEND}"
PATCHES=( "${FILESDIR}"/${P}-Makefile.patch )
src_configure() {
tc-export CXX
}
src_install() {
dobin ../bin/Linux/wav2json
}