diff options
author | Raphael Kubo da Costa <rakuco@FreeBSD.org> | 2015-11-27 01:21:13 +0800 |
---|---|---|
committer | Raphael Kubo da Costa <rakuco@FreeBSD.org> | 2015-11-27 01:21:13 +0800 |
commit | 1624e7c81f253fa81c85a206aa6bd4bffdf19593 (patch) | |
tree | 34a8acd5f73e37259390676aff3cb9d2d9fcb0e8 /multimedia | |
parent | 0685c2bba482e1ff5b9b728dea8c23ef74b681ea (diff) | |
download | freebsd-ports-gnome-1624e7c81f253fa81c85a206aa6bd4bffdf19593.tar.gz freebsd-ports-gnome-1624e7c81f253fa81c85a206aa6bd4bffdf19593.tar.zst freebsd-ports-gnome-1624e7c81f253fa81c85a206aa6bd4bffdf19593.zip |
Fix the build with the upcoming CMake 3.4.0.
It is not clear if this is intentional or not, but with CMake 3.4.0
environment variables such as CXXFLAGS are passed to the compiler after the
directories added via the include_directories() command. In practice, this
means that we then end up with the following command-line:
${CXX} ... -I/usr/local/include ...
-I/usr/local/include/ffmpeg0/libavcodec
-I/usr/local/include/ffmpeg0 ...
which fails because of the following chain of events:
* The port brings in multimedia/ffmpeg indirectly.
* The source code includes headers as <avformat.h> like that, which turn
into /usr/local/include/ffmpeg0/libavformat/avformat.h to the compiler.
* Headers like avformat.h itself include other headers with
"libavcodec/avcodec.h", which, given the compiler command-line above,
becomes /usr/local/include/libavcodec/avcodec.h, coming from
multimedia/ffmpeg, not multimedia/ffmpeg0.
Fix it by making the port behave as it should have from the beginning:
* Stop setting C{PP,XX}FLAGS in the Makefile, as it does not help.
* Include the ffmpeg-related headers before the others, so that
/usr/local/include comes after them.
* Adjust patch-cmake so that it works correctly with the setup in ports:
instead of setting the <LIB>_LAVC variables which assume there is a
separate libavcodec installed, make the code fall back to the
<LIB>_FF_LAVC ones, which are set when there's a libavcodec inside an
ffmpeg tree (our case with ffmpeg0). This also takes care of setting
FFMPEG_INCLUDE_DIR with /usr/local/include/ffmpeg0 and passing it in the
right place in the command-line.
Tested with both CMake 3.3.1 and 3.4.0.
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/k9copy-kde4/Makefile | 4 | ||||
-rw-r--r-- | multimedia/k9copy-kde4/files/patch-CMakeLists.txt | 15 | ||||
-rw-r--r-- | multimedia/k9copy-kde4/files/patch-cmake | 9 |
3 files changed, 18 insertions, 10 deletions
diff --git a/multimedia/k9copy-kde4/Makefile b/multimedia/k9copy-kde4/Makefile index 6c4cae9713ef..a1ed67e9a7b7 100644 --- a/multimedia/k9copy-kde4/Makefile +++ b/multimedia/k9copy-kde4/Makefile @@ -21,10 +21,6 @@ USES= cmake gettext USE_KDE4= kdeprefix kdelibs automoc4 USE_QT4= moc_build qmake_build rcc_build uic_build -CFLAGS= -I${LOCALBASE}/include/ffmpeg0 -CPPFLAGS= -I${LOCALBASE}/include/ffmpeg0 -CXXFLAGS= -I${LOCALBASE}/include/ffmpeg0 - OPTIONS_DEFINE= MENCODER MPLAYER DVDAUTHOR MENCODER_DESC= MEncoder support MPLAYER_DESC= MPlayer support diff --git a/multimedia/k9copy-kde4/files/patch-CMakeLists.txt b/multimedia/k9copy-kde4/files/patch-CMakeLists.txt index 4f9fcabc2ee2..d98eb86a7c26 100644 --- a/multimedia/k9copy-kde4/files/patch-CMakeLists.txt +++ b/multimedia/k9copy-kde4/files/patch-CMakeLists.txt @@ -15,6 +15,21 @@ #FINDLIBDVDREAD("dvdread/ifo_types.h" "dvdread") FINDAVFORMAT("avformat") +@@ -78,12 +86,12 @@ include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/src/player + ${CMAKE_CURRENT_SOURCE_DIR}/src/subtitles + ${CMAKE_CURRENT_SOURCE_DIR}/src/dvdread +-${KDE4_INCLUDES} ${QT_INCLUDES} +- #${LIBDVDREAD_INCLUDE_DIR}/dvdread + ${AVCODEC_INCLUDE_DIR} + ${AVFORMAT_INCLUDE_DIR} + ${FFMPEGSCALE_INCLUDE_DIR} + ${FFMPEG_INCLUDE_DIR} ++${KDE4_INCLUDES} ${QT_INCLUDES} ++ #${LIBDVDREAD_INCLUDE_DIR}/dvdread + ) + + @@ -318,7 +326,7 @@ diff --git a/multimedia/k9copy-kde4/files/patch-cmake b/multimedia/k9copy-kde4/files/patch-cmake index 33ab9799b6ab..4e5836107cb5 100644 --- a/multimedia/k9copy-kde4/files/patch-cmake +++ b/multimedia/k9copy-kde4/files/patch-cmake @@ -1,6 +1,6 @@ --- cmake/FindAvcodec.cmake.orig 2009-12-06 08:13:37.000000000 -0200 +++ cmake/FindAvcodec.cmake 2013-10-21 20:25:43.852646966 -0200 -@@ -6,21 +6,21 @@ +@@ -6,21 +6,20 @@ SET (FFMPEG_INCLUDE_DIR "") IF (AVCODEC_INCLUDE_DIR_FF) @@ -8,7 +8,6 @@ + SET (AVCODEC_INCLUDE_DIR "${AVCODEC_INCLUDE_DIR_FF}/ffmpeg0") ELSE (AVCODEC_INCLUDE_DIR_FF) - FIND_PATH(AVCODEC_INCLUDE_DIR_LAVC "libavcodec/avcodec.h" PATHS) -+ FIND_PATH(AVCODEC_INCLUDE_DIR_LAVC "ffmpeg0/libavcodec/avcodec.h" PATHS) IF (AVCODEC_INCLUDE_DIR_LAVC) - SET (AVCODEC_INCLUDE_DIR "${AVCODEC_INCLUDE_DIR_LAVC}/libavcodec") + SET (AVCODEC_INCLUDE_DIR "${AVCODEC_INCLUDE_DIR_LAVC}/ffmpeg0/libavcodec") @@ -31,7 +30,7 @@ SET(INC_FOUND TRUE) --- cmake/FindAvformat.cmake.orig 2009-12-06 08:13:37.000000000 -0200 +++ cmake/FindAvformat.cmake 2013-10-21 20:25:23.140646773 -0200 -@@ -2,22 +2,22 @@ +@@ -2,22 +2,21 @@ FIND_PATH(AVFORMAT_INCLUDE_DIR_FF "ffmpeg/avformat.h" PATHS) IF (AVFORMAT_INCLUDE_DIR_FF) @@ -39,7 +38,6 @@ + SET (AVFORMAT_INCLUDE_DIR "${AVCODEC_INCLUDE_DIR_FF}/ffmpeg0") ELSE (AVFORMAT_INCLUDE_DIR_FF) - FIND_PATH(AVFORMAT_INCLUDE_DIR_LAVC "libavformat/avformat.h" PATHS) -+ FIND_PATH(AVFORMAT_INCLUDE_DIR_LAVC "ffmpeg0/libavformat/avformat.h" PATHS) IF (AVFORMAT_INCLUDE_DIR_LAVC) - SET (AVFORMAT_INCLUDE_DIR "${AVFORMAT_INCLUDE_DIR_LAVC}/libavformat") + SET (AVFORMAT_INCLUDE_DIR "${AVFORMAT_INCLUDE_DIR_LAVC}/ffmpeg0/libavformat") @@ -62,7 +60,7 @@ SET(INC_FOUND TRUE) --- cmake/FindFFmpegScale.cmake.orig 2009-12-06 08:13:37.000000000 -0200 +++ cmake/FindFFmpegScale.cmake 2013-10-21 20:26:07.389647103 -0200 -@@ -3,22 +3,22 @@ +@@ -3,22 +3,21 @@ FIND_PATH(FFMPEGSCALE_INCLUDE_DIR_FF "ffmpeg/swscale.h" PATHS) IF (FFMPEGSCALE_INCLUDE_DIR_FF) @@ -70,7 +68,6 @@ + SET (FFMPEGSCALE_INCLUDE_DIR "${FFMPEGSCALE_INCLUDE_DIR_FF}/ffmpeg0") ELSE (FFMPEGSCALE_INCLUDE_DIR_FF) - FIND_PATH(FFMPEGSCALE_INCLUDE_DIR_LAVC "libswscale/swscale.h" PATHS) -+ FIND_PATH(FFMPEGSCALE_INCLUDE_DIR_LAVC "ffmpeg0/libswscale/swscale.h" PATHS) IF (FFMPEGSCALE_INCLUDE_DIR_LAVC) - SET (FFMPEGSCALE_INCLUDE_DIR "${FFMPEGSCALE_INCLUDE_DIR_LAVC}/libswscale") + SET (FFMPEGSCALE_INCLUDE_DIR "${FFMPEGSCALE_INCLUDE_DIR_LAVC}/ffmpeg0/libswscale") |