From owner-svn-ports-all@freebsd.org Thu Nov 26 17:21:15 2015 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B2B1A3AD09; Thu, 26 Nov 2015 17:21:15 +0000 (UTC) (envelope-from rakuco@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7E9612D1; Thu, 26 Nov 2015 17:21:14 +0000 (UTC) (envelope-from rakuco@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAQHLEIT088595; Thu, 26 Nov 2015 17:21:14 GMT (envelope-from rakuco@FreeBSD.org) Received: (from rakuco@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAQHLDtE088592; Thu, 26 Nov 2015 17:21:13 GMT (envelope-from rakuco@FreeBSD.org) Message-Id: <201511261721.tAQHLDtE088592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rakuco set sender to rakuco@FreeBSD.org using -f From: Raphael Kubo da Costa Date: Thu, 26 Nov 2015 17:21:13 +0000 (UTC) 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 X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Nov 2015 17:21:15 -0000 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 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 _LAVC variables which assume there is a separate libavcodec installed, make the code fall back to the _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")