Control: tags -1 +patch

On Sat, Feb 9, 2019 at 9:13 AM Andreas Tille <ti...@debian.org> wrote:
> I've now read logs of #920900 and #898820.  The latter even is
> mentioning that fis-gtm depends icu-config.  I wonder if someone
> who has experience with cmake could lend a helping hand how to
> replace icu-config by pkg-config.
 Proper patch is attached.

> The naive approach to simply remove the icu-config
> check from CMakeLists.txt ended up in
>
> ...
> -- Installing: 
> /build/fis-gtm-6.3-005/debian/fis-gtm-6.3-005-stage1/usr/lib/x86_64-linux-gnu/fis-gtm/V6.3-005_x86_64/GDETEMPL.o
> CMake Error at cmake_install.cmake:763 (file):
>   file INSTALL cannot find
>   "/build/fis-gtm-6.3-005/obj-x86_64-linux-gnu/utf8/GDEGET.o".
 This might be a different issue. Going to check it as well.

Laszlo/GCS
--- fis-gtm-6.3-005.orig/CMakeLists.txt
+++ fis-gtm-6.3-005/CMakeLists.txt
@@ -737,24 +737,9 @@ install(FILES ${scripts}
   PERMISSIONS ${install_permissions_script}
   )
 
-find_program(ICUCONFIG NAMES icu-config)
-if(ICUCONFIG)
-  execute_process(
-    COMMAND ${ICUCONFIG} --version
-    OUTPUT_VARIABLE icu_version
-    RESULT_VARIABLE icu_failed
-    OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
-  if(icu_failed)
-    message(FATAL_ERROR "Command\n ${ICUCONFIG} --version\nfailed (${icu_failed}).")
-  elseif("x${icu_version}" MATCHES "^x([0-9]+\\.[0-9]+)")
-    set(gtm_icu_version "${CMAKE_MATCH_1}")
-  else()
-    message(FATAL_ERROR "Command\n ${ICUCONFIG} --version\nproduced unrecognized output:\n ${icu_version}")
-  endif()
-else()
-  message(FATAL_ERROR "Unable to find 'icu-config'.  Set ICUCONFIG in CMake cache.")
-endif()
+find_package(PkgConfig REQUIRED)
+PKG_CHECK_MODULES(ICU REQUIRED icu-io)
+set(gtm_icu_version "${ICU_VERSION}")
 
 find_program(LOCALECFG NAMES locale)
 if(LOCALECFG)
--- fis-gtm-6.3-005.orig/sr_unix/gtmprofile.gtc
+++ fis-gtm-6.3-005/sr_unix/gtmprofile.gtc
@@ -75,11 +75,11 @@ if [ $gtm_dist != "$old_gtm_dist" ] ; th
     else gtmroutines=$gtm_dist ; fi
     export gtmroutines
     # Set $gtm_icu_version if icu-config is available - should be set before checking for UTF-8 mode
-    if [ -z "$gtm_icu_version" -a -n "`which icu-config`" ] ; then
-	gtm_icu_version=`icu-config --version | gtm_chset=M $gtm_dist/mumps -run %XCMD 'Read x Write $FNumber(x*$Select(+x>5:.1,1:1),"",1)'`
+    if [ -z "$gtm_icu_version" -a -n "`which pkg-config`" ] ; then
+	gtm_icu_version=`pkg-config --modversion icu-io | gtm_chset=M $gtm_dist/mumps -run %XCMD 'Read x Write $FNumber(x*$Select(+x>5:.1,1:1),"",1)'`
         export gtm_icu_version
 	# Add library path to LD_LIBRARY_PATH
-	extendlibpath=`icu-config --libdir`
+	extendlibpath=`pkg-config --libs-only-L icu-io`
 	if [ "" = "$LD_LIBRARY_PATH" ]; then LD_LIBRARY_PATH="$extendlibpath"; else LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$extendlibpath";fi; export LD_LIBRARY_PATH
 	if [ "ibm" = "$arch" ]; then
 		if [ "" = "$LIBPATH" ]; then LIBPATH="$extendlibpath"; else LIBPATH="$LIBPATH:$extendlibpath";fi; export LIBPATH;

Reply via email to