On Fri, Jan 19, 2018 at 02:18:53PM +0000, Jeremie Courreges-Anglas wrote:
> 
> Once again I've been bitten by the special handling of DEBUG done in
> cmake.port.mk.
> 
> First, cmake might use different CFLAGS in debug and release mode (this
> is usually specified by upstream in CMakeLists.txt).  Those CFLAGS might
> be undesirable or even unusable on OpenBSD (iirc some stuff might try to
> link against valgrind or ubsan / whatever).  Those might be useful but
> IMO you shouldn't get to use them when all you want is to rebuild a port
> with DEBUG=-g, ie debug symbols.
> 
> Also the release/debug difference means that some ports just won't
> package because of file names changes:
> 
> --8<--
> ===>  Building package for libical-3.0.1
> Create /usr/ports/packages/amd64/all/libical-3.0.1.tgz
> Creating package libical-3.0.1
> Error: change in plist
> | If the old and new builds were done correctly
> | (fully up-to-date ports tree including relevant MODULES)
> | then someone probably forgot to bump a REVISION.
> | (see bsd.port.mk(5), PACKAGE_REPOSITORY)
> --- /usr/ports/plist/amd64/libical-3.0.1
> +++ /usr/ports/plist/amd64/libical-3.0.1-new
> @@ -74,7 +74,7 @@
>  lib/cmake/LibIcal/
>  lib/cmake/LibIcal/LibIcalConfig.cmake
>  lib/cmake/LibIcal/LibIcalConfigVersion.cmake
> -lib/cmake/LibIcal/LibIcalTargets-release.cmake
> +lib/cmake/LibIcal/LibIcalTargets-debug.cmake
>  lib/cmake/LibIcal/LibIcalTargets.cmake
>  lib/girepository-1.0/
>  lib/girepository-1.0/ICalGLib-3.0.typelib
> *** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:1943 
> '/usr/ports/packages/amd64/all/libical-3.0.1.tgz')
> *** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2440 
> '_internal-package')
> *** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2419 'package')
> *** Error 1 in /usr/ports/textproc/libical 
> (/usr/ports/infrastructure/mk/bsd.port.mk:3421 'repackage')
> -->8--
> 
>   $ pkglocate  release.cmake | wc -l
>        150
> 
> I think it's fair to say that the ports tree is not ready to use
> cmake with DEBUG=-g.  This could be fixed in theory, but someone has to
> do the work*, and is does not invalidate my first point.
> 
> So here's the simple diff that does less and makes DEBUG=-g actually
> usable.
> 
> ok?
> 
> 
> 
> Index: cmake.port.mk
> ===================================================================
> RCS file: /d/cvs/ports/devel/cmake/cmake.port.mk,v
> retrieving revision 1.62
> diff -u -p -p -u -r1.62 cmake.port.mk
> --- cmake.port.mk     28 Nov 2017 10:26:00 -0000      1.62
> +++ cmake.port.mk     8 Jan 2018 09:37:03 -0000
> @@ -76,13 +76,8 @@ MODCMAKE_configure=        cd ${WRKBUILD} && ${
>               -G ${_MODCMAKE_GEN} ${CONFIGURE_ARGS} ${WRKSRC}
>  
>  .if !defined(CONFIGURE_ARGS) || ! ${CONFIGURE_ARGS:M*CMAKE_BUILD_TYPE*}
> -.  if defined(DEBUG)
> -CONFIGURE_ARGS += -DCMAKE_BUILD_TYPE:String=Debug
> -MODCMAKE_BUILD_SUFFIX =      -debug.cmake
> -.  else
>  CONFIGURE_ARGS += -DCMAKE_BUILD_TYPE:String=Release
>  MODCMAKE_BUILD_SUFFIX =      -release.cmake
> -.  endif
>  .endif
>  SUBST_VARS +=        MODCMAKE_BUILD_SUFFIX
>  
> 
> * why isn't MODCMAKE_BUILD_SUFFIX properly substituted in all PLISTs?

I think that's the main issue isn't it?
We can probably fix the framework to do so.

-- 
Antoine

Reply via email to