summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrakuco <rakuco@FreeBSD.org>2015-09-07 11:12:32 +0000
committerrakuco <rakuco@FreeBSD.org>2015-09-07 11:12:32 +0000
commit433fb277a912325aae83e569a7c6de14468d34f5 (patch)
treee9c7625a42ec155f31c13d17bb43eea294e9a357
parent91e85f81275edbe71167999910f98e5248d4a41c (diff)
downloadFreeBSD-ports-433fb277a912325aae83e569a7c6de14468d34f5.zip
FreeBSD-ports-433fb277a912325aae83e569a7c6de14468d34f5.tar.gz
Add USES=libarchive, stop setting LDFLAGS.
1. Import a pull request I've just sent upstream that makes FindHelper.cmake behave better and stop using pkg-config's output directly as include and library paths. The consequence is that libraries like libarchive, libsndfile, jack etc are now found with their full path and we can stop setting LDFLAGS in Makefile. 2. Set USES=libarchive. Even though the port does not require any functionality that is only present in libarchive from ports, explicitly depending on a certain version makes things more consistent. Additionally, before this patch there would be no dependency on libarchive from ports but since the linker was previously called like this: c++ ... -o hydrogen -L/usr/local/lib -larchive -lsndfile ... so the port would end up linking against libarchive from ports when it was present (which is always, since devel/cmake depends on it). And with this patch we have c++ ... -o hydrogen -larchive /usr/local/lib/libsndfile.so ... which does link against libarchive from base, but then fails `make stage-qa', which expects all ports to link against ports libarchive. PR: 202905 Approved by: FreeBSD@ShaneWare.Biz (maintainer)
-rw-r--r--audio/hydrogen/Makefile5
-rw-r--r--audio/hydrogen/files/patch-cmake__FindHelper.cmake54
2 files changed, 56 insertions, 3 deletions
diff --git a/audio/hydrogen/Makefile b/audio/hydrogen/Makefile
index 9bf6dcc..5b4b18a 100644
--- a/audio/hydrogen/Makefile
+++ b/audio/hydrogen/Makefile
@@ -3,7 +3,7 @@
PORTNAME= hydrogen
PORTVERSION= 0.9.6.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= audio
MAINTAINER= FreeBSD@ShaneWare.Biz
@@ -20,12 +20,11 @@ GH_ACCOUNT= hydrogen-music
USE_QT4= corelib gui qmake_build linguist_build moc_build network \
qt3support rcc_build sql uic_build xml
-USES= cmake:outsource desktop-file-utils pkgconfig
+USES= cmake:outsource desktop-file-utils libarchive pkgconfig
CMAKE_ARGS+= -DTHREADS_HAVE_PTHREAD_ARG:BOOL=ON -DWANT_DEBUG:BOOL=OFF \
-DLIBSNDFILE_INCLUDE_DIR:STRING=${LOCALBASE}/include \
-DWANT_OSS:BOOL=ON
USE_LDCONFIG= yes
-LDFLAGS+= -L${LOCALBASE}/lib
OPTIONS_DEFINE= ALSA JACK LADSPA LASH PORTAUDIO PULSEAUDIO RDF
OPTIONS_DEFAULT= JACK LADSPA RDF
diff --git a/audio/hydrogen/files/patch-cmake__FindHelper.cmake b/audio/hydrogen/files/patch-cmake__FindHelper.cmake
new file mode 100644
index 0000000..23650b91
--- /dev/null
+++ b/audio/hydrogen/files/patch-cmake__FindHelper.cmake
@@ -0,0 +1,54 @@
+Sent upstream: https://github.com/hydrogen-music/hydrogen/pull/290
+
+cmake: Call find_path and find_library even if pkg-config calls work.
+
+Instead of calling pkg_check_modules() with the same prefix as the calls
+to find_library() and find_path(), pass PC_${prefix} to the former.
+
+This way, we are able to use the paths that might have been found by
+pkg-config as hints to the find_library and find_path calls. Doing so
+helps systems where the dependent libraries (libarchive, libsndfile etc)
+are not in the default linker path, as the linker is now called with the
+libraries' absolute path:
+
+c++ file1.o file2.o [...] -o hydrogen /usr/lib/libsndfile.so ...
+
+instead of
+
+c++ file1.o file2.o [...] -o hydrogen -lsndfile ...
+
+as the latter requires one to manually pass "-L/usr/local/lib" to CMake
+when configuring Hydrogen.
+
+While here, use HINTS instead of PATHS when calling the find_*()
+functions, as CMake's documentation says that "paths computed by system
+introspection" should use HINTS, not PATHS, which is for hardcoded
+paths.
+--- cmake/FindHelper.cmake.orig 2014-09-09 18:39:33 UTC
++++ cmake/FindHelper.cmake
+@@ -23,7 +23,7 @@ macro(FIND_HELPER prefix pkg_name header
+ FIND_PACKAGE(PkgConfig)
+ endif()
+ if(PKG_CONFIG_FOUND)
+- pkg_check_modules(${prefix} ${pkg_name})
++ pkg_check_modules(PC_${prefix} ${pkg_name})
+ #MESSAGE(STATUS " LDFLAGS ${${prefix}_LDFLAGS}" )
+ #MESSAGE(STATUS " CFLAGS ${${prefix}_CFLAGS}" )
+ #MESSAGE(STATUS " INCLUDEDIRS ${${prefix}_INCLUDE_DIRS}" )
+@@ -36,12 +36,14 @@ macro(FIND_HELPER prefix pkg_name header
+
+ find_path(${prefix}_INCLUDE_DIR
+ NAMES ${header}
+- PATHS ${${prefix}_INCLUDE_DIRS} ${${prefix}_INCLUDEDIR} ${${prefix}_INCLUDE_PATHS} ENV ${prefix}_INCLUDE
++ HINTS ${PC_${prefix}_INCLUDE_DIRS} ${PC_${prefix}_INCLUDEDIR} ${PC_${prefix}_INCLUDE_PATHS}
++ ENV ${prefix}_INCLUDE
+ )
+
+ find_library(${prefix}_LIBRARIES
+ NAMES ${lib}
+- PATHS ${${prefix}_LIBDIR} ${${prefix}_LIBRARY_DIRS} ${${prefix}_LIB_PATHS} ENV ${prefix}_PATH
++ HINTS ${PC_${prefix}_LIBDIR} ${PC_${prefix}_LIBRARY_DIRS} ${PC_${prefix}_LIB_PATHS}
++ ENV ${prefix}_PATH
+ )
+ endif()
+
OpenPOWER on IntegriCloud