svn commit: r395972 - in head: Mk/Uses audio/tagutil/files chinese/fcitx chinese/fcitx/files deskutils/libstreamanalyzer deskutils/libstreams editors/calligra irc/weechat irc/weechat-devel irc/weec...
Raphael Kubo da Costa
rakuco at FreeBSD.org
Thu Sep 3 15:44:17 UTC 2015
Author: rakuco
Date: Thu Sep 3 15:44:13 2015
New Revision: 395972
URL: https://svnweb.freebsd.org/changeset/ports/395972
Log:
Uses/iconv.mk: Set iconv-related CMake variables.
The way we deal with iconv in base and ports across different FreeBSD
releases is complicated: 9.x does not have iconv.h in base, 10.1 has it with
a different prototype for iconv(3) and later versions have the right
iconv(3) prototype. And, in some cases (USES=iconv:{translit,wchar_t}), we
must always use the libiconv port.
This is why there are so many checks in Uses/iconv.mk: we need to know the
situation we currently have in order to decide whether to pull iconv from
converters/libiconv, whether to just use its header (and pull the library
from base) or whether to use everything from base.
r384038 adjusted several CMake-based ports, but did so in a way that was not
very scalable and required a few intrusive patches to some ports. Most ports
that have both USES=cmake and USES=iconv use variations of FindIconv.cmake
that behave similarly. This change passes the header and library values we
really want to use to CMake using the most common variable names, bypassing
the calls to find_path() and find_library() that would sometimes end up
finding the wrong file. The few ports that use different variable names have
had their Makefiles adjusted (we manually pass the values we want via
CMAKE_ARGS).
Other changes:
- chinese/fcitx: Explicitly set LIBICONV_LIBC_HAS_ICONV_OPEN=OFF as we
always want the version from ports because of USES=iconv:wchar_t.
- editors/calligra: Explicitly use iconv:translit because Kexi needs it.
- irc/weechat and irc/weechat-devel: The FindIconv.cmake patches could not
be entirely removed because the check_library_exists() calls are wrong.
Sent upstream: https://github.com/weechat/weechat/pull/513
- textproc/ctpp2: Use iconv:translit when the TRANSLITERATE option is used.
PORTREVISION has been bumped in editors/calligra and textproc/ctpp2 because
their dependency list has changed in 10.2 and later as the ports version is
always used now.
PR: 202798
Reviewed by: antoine, tijl
Approved by: portmgr (antoine)
Deleted:
head/audio/tagutil/files/
head/chinese/fcitx/files/patch-cmake__FindLibiconv.cmake
head/mail/libvmime/files/patch-cmake__FindIconv.cmake
head/net-im/licq/files/patch-cmake-Modules-FindIconv.cmake
head/textproc/simplexml/files/patch-cmake__FindIconv.cmake
head/textproc/wbxml2/files/patch-cmake-modules-FindIconv.cmake
Modified:
head/Mk/Uses/iconv.mk
head/chinese/fcitx/Makefile
head/deskutils/libstreamanalyzer/Makefile
head/deskutils/libstreams/Makefile
head/editors/calligra/Makefile
head/irc/weechat-devel/Makefile
head/irc/weechat-devel/files/patch-cmake-FindIconv.cmake
head/irc/weechat/Makefile
head/irc/weechat/files/patch-cmake-FindIconv.cmake
head/textproc/ctpp2/Makefile
head/textproc/ctpp2/files/patch-CMakeLists.txt
head/textproc/simplexml/Makefile
Modified: head/Mk/Uses/iconv.mk
==============================================================================
--- head/Mk/Uses/iconv.mk Thu Sep 3 15:37:39 2015 (r395971)
+++ head/Mk/Uses/iconv.mk Thu Sep 3 15:44:13 2015 (r395972)
@@ -20,6 +20,8 @@ ICONV_LIB= -liconv
ICONV_PREFIX= ${LOCALBASE}
ICONV_CONFIGURE_ARG= --with-libiconv-prefix=${LOCALBASE}
ICONV_CONFIGURE_BASE= --with-libiconv=${LOCALBASE}
+ICONV_INCLUDE_PATH= ${LOCALBASE}/include
+ICONV_LIB_PATH= ${LOCALBASE}/lib/libiconv.so
.if ${iconv_ARGS:Mbuild}
BUILD_DEPENDS+= ${ICONV_CMD}:${PORTSDIR}/converters/libiconv
@@ -36,6 +38,8 @@ ICONV_LIB=
ICONV_PREFIX= /usr
ICONV_CONFIGURE_ARG=
ICONV_CONFIGURE_BASE=
+ICONV_INCLUDE_PATH= /usr/include
+ICONV_LIB_PATH= /usr/lib/libc.so
.if ${OPSYS} == DragonFly || (${OPSYS} == FreeBSD && (${OSVERSION} < 1001514 \
|| (${OSVERSION} >= 1100000 && ${OSVERSION} < 1100069))) \
@@ -45,8 +49,21 @@ CPPFLAGS+= -DLIBICONV_PLUG
CFLAGS+= -DLIBICONV_PLUG
CXXFLAGS+= -DLIBICONV_PLUG
OBJCFLAGS+= -DLIBICONV_PLUG
+ICONV_INCLUDE_PATH= ${LOCALBASE}/include
.endif
.endif
+# These are the most common names for the iconv-related variables found in
+# CMake-based ports. We set them here via CMAKE_ARGS to make sure that the best
+# combination is always used (ie. we prefer the version in libc whenever it is
+# available, and sometimes have to fall back to the iconv.h header from ports
+# while still using the library from base).
+CMAKE_ARGS+= -DICONV_INCLUDE_DIR=${ICONV_INCLUDE_PATH} \
+ -DICONV_LIBRARIES=${ICONV_LIB_PATH} \
+ -DICONV_LIBRARY=${ICONV_LIB_PATH} \
+ -DLIBICONV_INCLUDE_DIR=${ICONV_INCLUDE_PATH} \
+ -DLIBICONV_LIBRARIES=${ICONV_LIB_PATH} \
+ -DLIBICONV_LIBRARY=${ICONV_LIB_PATH}
+
.endif
Modified: head/chinese/fcitx/Makefile
==============================================================================
--- head/chinese/fcitx/Makefile Thu Sep 3 15:37:39 2015 (r395971)
+++ head/chinese/fcitx/Makefile Thu Sep 3 15:44:13 2015 (r395972)
@@ -50,6 +50,7 @@ TPUNC_DESC= Use traditional quotation ma
.include <bsd.port.options.mk>
CMAKE_ARGS+= -DENABLE_XDGAUTOSTART=OFF -DFORCE_ENCHANT=ON \
+ -DLIBICONV_LIBC_HAS_ICONV_OPEN=OFF \
-DDATADIR=${DATADIR} \
-DDOCSDIR=${DOCSDIR} \
-DGOBJECT_INTROSPECTION_GIRDIR=${PREFIX}/share/gir-1.0 \
Modified: head/deskutils/libstreamanalyzer/Makefile
==============================================================================
--- head/deskutils/libstreamanalyzer/Makefile Thu Sep 3 15:37:39 2015 (r395971)
+++ head/deskutils/libstreamanalyzer/Makefile Thu Sep 3 15:44:13 2015 (r395972)
@@ -36,10 +36,4 @@ post-patch:
${WRKSRC}/libstreamanalyzer/CMakeLists.txt
.include <${.CURDIR}/../strigi/Makefile.common>
-.include <bsd.port.pre.mk>
-
-.if empty(ICONV_LIB)
-CMAKE_ARGS+= -DICONV_LIBRARIES:STRING="/usr/lib/libc.so"
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Modified: head/deskutils/libstreams/Makefile
==============================================================================
--- head/deskutils/libstreams/Makefile Thu Sep 3 15:37:39 2015 (r395971)
+++ head/deskutils/libstreams/Makefile Thu Sep 3 15:44:13 2015 (r395972)
@@ -18,10 +18,4 @@ post-patch:
${WRKSRC}/libstreams/CMakeLists.txt
.include <${.CURDIR}/../strigi/Makefile.common>
-.include <bsd.port.pre.mk>
-
-.if empty(ICONV_LIB)
-CMAKE_ARGS+= -DICONV_LIBRARIES:STRING="/usr/lib/libc.so"
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Modified: head/editors/calligra/Makefile
==============================================================================
--- head/editors/calligra/Makefile Thu Sep 3 15:37:39 2015 (r395971)
+++ head/editors/calligra/Makefile Thu Sep 3 15:44:13 2015 (r395972)
@@ -2,7 +2,7 @@
PORTNAME= calligra
PORTVERSION= ${CALLIGRA_VERSION}
-PORTREVISION= 17
+PORTREVISION= 18
CATEGORIES= editors kde
MASTER_SITES= KDE/${CALLIGRA_BRANCH}/${PORTNAME}-${PORTVERSION}
DIST_SUBDIR= KDE
@@ -42,8 +42,8 @@ USE_QT4= corelib dbus designer_build gui
qt3support qtestlib_build script sql svg webkit xml xmlpatterns \
moc_build qmake_build rcc_build uic_build uic3_build
USE_SQLITE= 3
-USES= cmake:outsource cpe compiler:c++11-lang iconv jpeg perl5 pkgconfig tar:xz\
- shared-mime-info
+USES= cmake:outsource cpe compiler:c++11-lang iconv:translit jpeg \
+ perl5 pkgconfig shared-mime-info tar:xz
CMAKE_ARGS= -DCMAKE_INCLUDE_PATH:STRING="${QT_INCDIR} ${LOCALBASE}/include" \
-DPRODUCTSET:STRING="DESKTOP"
USE_LDCONFIG= yes
Modified: head/irc/weechat-devel/Makefile
==============================================================================
--- head/irc/weechat-devel/Makefile Thu Sep 3 15:37:39 2015 (r395971)
+++ head/irc/weechat-devel/Makefile Thu Sep 3 15:44:13 2015 (r395972)
@@ -22,7 +22,8 @@ CONFLICTS= weechat-0.3*
USE_LDCONFIG= yes
USES= cmake iconv ncurses
-CMAKE_ARGS+= -DENABLE_GUILE=no
+CMAKE_ARGS+= -DENABLE_GUILE=no \
+ -DICONV_INCLUDE_PATH=${ICONV_INCLUDE_PATH}
CFLAGS+= -I${LOCALBASE}/include -L${LOCALBASE}/lib
GITDESC= v0.4.3-14-gc324610
Modified: head/irc/weechat-devel/files/patch-cmake-FindIconv.cmake
==============================================================================
--- head/irc/weechat-devel/files/patch-cmake-FindIconv.cmake Thu Sep 3 15:37:39 2015 (r395971)
+++ head/irc/weechat-devel/files/patch-cmake-FindIconv.cmake Thu Sep 3 15:44:13 2015 (r395972)
@@ -1,63 +1,14 @@
---- cmake/FindIconv.cmake.orig 2014-02-13 15:09:35 UTC
+--- cmake/FindIconv.cmake
+++ cmake/FindIconv.cmake
-@@ -33,39 +33,24 @@ IF(ICONV_FOUND)
- set(ICONV_FIND_QUIETLY TRUE)
- ENDIF(ICONV_FOUND)
-
--INCLUDE(CheckLibraryExists)
- INCLUDE(CheckFunctionExists)
-
--FIND_PATH(ICONV_INCLUDE_PATH
-- NAMES iconv.h
-- PATHS /usr/include /usr/local/include /usr/pkg/include
--)
--
--FIND_LIBRARY(ICONV_LIBRARY
-- NAMES iconv
-- PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
--)
-+FIND_PATH(ICONV_INCLUDE_PATH iconv.h)
+@@ -48,9 +48,8 @@ find_library(ICONV_LIBRARY
IF(ICONV_INCLUDE_PATH)
-- IF(ICONV_LIBRARY)
+ IF(ICONV_LIBRARY)
- STRING(REGEX REPLACE "/[^/]*$" "" ICONV_LIB_PATH "${ICONV_LIBRARY}")
- CHECK_LIBRARY_EXISTS(iconv libiconv_open ${ICONV_LIB_PATH} LIBICONV_OPEN_FOUND)
- CHECK_LIBRARY_EXISTS(iconv iconv_open ${ICONV_LIB_PATH} ICONV_OPEN_FOUND)
-- IF(LIBICONV_OPEN_FOUND OR ICONV_OPEN_FOUND)
-- SET(ICONV_FOUND TRUE)
-- ENDIF(LIBICONV_OPEN_FOUND OR ICONV_OPEN_FOUND)
-- ELSE(ICONV_LIBRARY)
-- CHECK_FUNCTION_EXISTS(iconv_open ICONV_FOUND)
-- ENDIF(ICONV_LIBRARY)
-+ CHECK_FUNCTION_EXISTS(iconv ICONV_FOUND)
-+ IF(NOT ICONV_FOUND)
-+ FIND_LIBRARY(ICONV_LIBRARY NAMES iconv libiconv libiconv-2)
-+ IF(ICONV_LIBRARY)
-+ SET(ICONV_FOUND TRUE)
-+ ENDIF(ICONV_LIBRARY)
-+ ENDIF(NOT ICONV_FOUND)
- ENDIF(ICONV_INCLUDE_PATH)
-
- include(CheckCSourceCompiles)
-
--IF(ICONV_LIBRARY)
-- SET(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
-- SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_PATH})
--ENDIF(ICONV_LIBRARY)
--
-+SET(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
-+SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_PATH})
- SET(CMAKE_REQUIRED_FLAGS -Werror)
- check_c_source_compiles("
- #include <iconv.h>
-@@ -79,6 +64,10 @@ check_c_source_compiles("
- return 0;
- }
- " ICONV_2ARG_IS_CONST)
-+SET(CMAKE_REQUIRED_LIBRARIES)
-+SET(CMAKE_REQUIRED_INCLUDES)
-+SET(CMAKE_REQUIRED_FLAGS)
-+
- MARK_AS_ADVANCED(
- ICONV_INCLUDE_PATH
- ICONV_LIBRARY
++ CHECK_LIBRARY_EXISTS("${ICONV_LIBRARY}" libiconv_open "" LIBICONV_OPEN_FOUND)
++ CHECK_LIBRARY_EXISTS("${ICONV_LIBRARY}" iconv_open "" ICONV_OPEN_FOUND)
+ IF(LIBICONV_OPEN_FOUND OR ICONV_OPEN_FOUND)
+ SET(ICONV_FOUND TRUE)
+ ENDIF()
Modified: head/irc/weechat/Makefile
==============================================================================
--- head/irc/weechat/Makefile Thu Sep 3 15:37:39 2015 (r395971)
+++ head/irc/weechat/Makefile Thu Sep 3 15:44:13 2015 (r395972)
@@ -19,7 +19,8 @@ CONFLICTS= weechat-devel-[0-9]*
USE_LDCONFIG= yes
USES= cmake iconv ncurses
-CMAKE_ARGS+= -DENABLE_GUILE=no
+CMAKE_ARGS+= -DENABLE_GUILE=no \
+ -DICONV_INCLUDE_PATH=${ICONV_INCLUDE_PATH}
CFLAGS+= -I${LOCALBASE}/include -L${LOCALBASE}/lib
LIB_DEPENDS+= libcurl.so:${PORTSDIR}/ftp/curl \
Modified: head/irc/weechat/files/patch-cmake-FindIconv.cmake
==============================================================================
--- head/irc/weechat/files/patch-cmake-FindIconv.cmake Thu Sep 3 15:37:39 2015 (r395971)
+++ head/irc/weechat/files/patch-cmake-FindIconv.cmake Thu Sep 3 15:44:13 2015 (r395972)
@@ -1,63 +1,14 @@
---- cmake/FindIconv.cmake.orig 2015-01-25 07:40:23 UTC
+--- cmake/FindIconv.cmake
+++ cmake/FindIconv.cmake
-@@ -33,39 +33,24 @@ if(ICONV_FOUND)
- set(ICONV_FIND_QUIETLY TRUE)
- endif()
-
--include(CheckLibraryExists)
- include(CheckFunctionExists)
-
--find_path(ICONV_INCLUDE_PATH
-- NAMES iconv.h
-- PATHS /usr/include /usr/local/include /usr/pkg/include
--)
--
--find_library(ICONV_LIBRARY
-- NAMES iconv
-- PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
--)
-+find_path(ICONV_INCLUDE_PATH iconv.h)
+@@ -48,9 +48,8 @@ find_library(ICONV_LIBRARY
if(ICONV_INCLUDE_PATH)
-- if(ICONV_LIBRARY)
+ if(ICONV_LIBRARY)
- string(REGEX REPLACE "/[^/]*$" "" ICONV_LIB_PATH "${ICONV_LIBRARY}")
- check_library_exists(iconv libiconv_open ${ICONV_LIB_PATH} LIBICONV_OPEN_FOUND)
- check_library_exists(iconv iconv_open ${ICONV_LIB_PATH} ICONV_OPEN_FOUND)
-- if(LIBICONV_OPEN_FOUND OR ICONV_OPEN_FOUND)
-- set(ICONV_FOUND TRUE)
-- endif()
-- else()
-- check_function_exists(iconv_open ICONV_FOUND)
-- endif()
-+ check_function_exists(iconv ICONV_FOUND)
-+ if(NOT ICONV_FOUND)
-+ find_library(ICONV_LIBRARY NAMES iconv libiconv libiconv-2)
-+ if(ICONV_LIBRARY)
-+ set(ICONV_FOUND TRUE)
-+ endif(ICONV_LIBRARY)
-+ endif(NOT ICONV_FOUND)
- endif()
-
- include(CheckCSourceCompiles)
-
--if(ICONV_LIBRARY)
-- set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
-- set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_PATH})
--endif()
--
-+set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
-+set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_PATH})
- set(CMAKE_REQUIRED_FLAGS -Werror)
- check_c_source_compiles("
- #include <iconv.h>
-@@ -80,6 +65,10 @@ check_c_source_compiles("
- }
- " ICONV_2ARG_IS_CONST)
-
-+set(CMAKE_REQUIRED_LIBRARIES)
-+set(CMAKE_REQUIRED_INCLUDES)
-+set(CMAKE_REQUIRED_FLAGS)
-+
- mark_as_advanced(
- ICONV_INCLUDE_PATH
- ICONV_LIBRARY
++ check_library_exists("${ICONV_LIBRARY}" libiconv_open "" LIBICONV_OPEN_FOUND)
++ check_library_exists("${ICONV_LIBRARY}" iconv_open "" ICONV_OPEN_FOUND)
+ if(LIBICONV_OPEN_FOUND OR ICONV_OPEN_FOUND)
+ set(ICONV_FOUND TRUE)
+ endif()
Modified: head/textproc/ctpp2/Makefile
==============================================================================
--- head/textproc/ctpp2/Makefile Thu Sep 3 15:37:39 2015 (r395971)
+++ head/textproc/ctpp2/Makefile Thu Sep 3 15:44:13 2015 (r395972)
@@ -3,16 +3,17 @@
PORTNAME= ctpp2
PORTVERSION= 2.8.3
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= textproc devel
MASTER_SITES= http://ctpp.havoc.ru/download/
MAINTAINER= vg at FreeBSD.org
COMMENT= C++ library to use templates in C/C++ projects, version 2
-USES= cmake gettext iconv compiler:c++11-lang
+USES= cmake gettext compiler:c++11-lang
USE_LDCONFIG= yes
+CMAKE_ARGS= -DICONV_INCLUDE=${ICONV_INCLUDE_PATH}
PLIST_SUB+= PORTVERSION=${PORTVERSION}
OPTIONS_DEFINE= DEBUG DISCARD_ILSEQ DOCS MD5 OPTIMIZATION TRANSLITERATE
@@ -36,15 +37,11 @@ DISCARD_ILSEQ_CMAKE_ON= -DICONV_DISCARD_
DISCARD_ILSEQ_CMAKE_OFF= -DICONV_DISCARD_ILSEQ=OFF
TRANSLITERATE_CMAKE_ON= -DICONV_TRANSLITERATE=ON
TRANSLITERATE_CMAKE_OFF= -DICONV_TRANSLITERATE=OFF
+TRANSLITERATE_USES= iconv:translit
+TRANSLITERATE_USES_OFF= iconv
OPTIMIZATION_CMAKE_ON= -DENABLE_OPTIMIZATION=ON
OPTIMIZATION_CMAKE_OFF= -DENABLE_OPTIMIZATION=OFF
PORTDOCS= template_language.html
-.include <bsd.port.pre.mk>
-
-.if empty(ICONV_LIB)
-CMAKE_ARGS+= -DSKIP_ICONV_LIRARY:STRING=ON
-.endif
-
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Modified: head/textproc/ctpp2/files/patch-CMakeLists.txt
==============================================================================
--- head/textproc/ctpp2/files/patch-CMakeLists.txt Thu Sep 3 15:37:39 2015 (r395971)
+++ head/textproc/ctpp2/files/patch-CMakeLists.txt Thu Sep 3 15:44:13 2015 (r395972)
@@ -8,15 +8,6 @@
# Build optimized code for following CPU (default i386)
#SET(CPU_TUNE "i686")
-@@ -272,7 +273,7 @@
- INCLUDE_DIRECTORIES(${ICONV_INCLUDE})
-
- IF (NOT "${SKIP_ICONV_LIRARY}" MATCHES "ON")
-- FIND_LIBRARY(ICONV_LIBRARY NAMES iconv PATHS /lib
-+ FIND_LIBRARY(ICONV_LIBRARY NAMES iconv libiconv c PATHS /lib
- /opt/lib
- /usr/lib
- /usr/local/lib
@@ -660,6 +661,8 @@
SET_TESTS_PROPERTIES(Calls_D PROPERTIES DEPENDS Calls_R)
ENDIF (DIFF_EXECUTABLE)
Modified: head/textproc/simplexml/Makefile
==============================================================================
--- head/textproc/simplexml/Makefile Thu Sep 3 15:37:39 2015 (r395971)
+++ head/textproc/simplexml/Makefile Thu Sep 3 15:44:13 2015 (r395972)
@@ -17,6 +17,8 @@ LIB_DEPENDS= libexpat.so:${PORTSDIR}/tex
USES= cmake iconv
USE_LDCONFIG= yes
+CMAKE_ARGS= -DIconv_LIBRARY=${ICONV_LIB_PATH}
+
WRKSRC= ${WRKDIR}/${PORTNAME}
.if defined(WITH_DEBUG)
More information about the svn-ports-all
mailing list