Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Nov 2015 17:21:13 +0000 (UTC)
From:      Raphael Kubo da Costa <rakuco@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r402460 - in head/multimedia/k9copy-kde4: . files
Message-ID:  <201511261721.tAQHLDtE088592@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rakuco
Date: Thu Nov 26 17:21:13 2015
New Revision: 402460
URL: https://svnweb.freebsd.org/changeset/ports/402460

Log:
  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.

Modified:
  head/multimedia/k9copy-kde4/Makefile
  head/multimedia/k9copy-kde4/files/patch-CMakeLists.txt
  head/multimedia/k9copy-kde4/files/patch-cmake

Modified: head/multimedia/k9copy-kde4/Makefile
==============================================================================
--- head/multimedia/k9copy-kde4/Makefile	Thu Nov 26 17:14:53 2015	(r402459)
+++ head/multimedia/k9copy-kde4/Makefile	Thu Nov 26 17:21:13 2015	(r402460)
@@ -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

Modified: head/multimedia/k9copy-kde4/files/patch-CMakeLists.txt
==============================================================================
--- head/multimedia/k9copy-kde4/files/patch-CMakeLists.txt	Thu Nov 26 17:14:53 2015	(r402459)
+++ head/multimedia/k9copy-kde4/files/patch-CMakeLists.txt	Thu Nov 26 17:21:13 2015	(r402460)
@@ -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 @@
  
  

Modified: head/multimedia/k9copy-kde4/files/patch-cmake
==============================================================================
--- head/multimedia/k9copy-kde4/files/patch-cmake	Thu Nov 26 17:14:53 2015	(r402459)
+++ head/multimedia/k9copy-kde4/files/patch-cmake	Thu Nov 26 17:21:13 2015	(r402460)
@@ -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")



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511261721.tAQHLDtE088592>