[MacPorts] #66874: building expat via autotools leaves cmake files unprocessed

MacPorts noreply at macports.org
Wed Feb 8 20:17:50 UTC 2023


#66874: building expat via autotools leaves cmake files unprocessed
--------------------+--------------------
 Reporter:  RJVB    |      Owner:  (none)
     Type:  defect  |     Status:  new
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  expat
--------------------+--------------------
 Working on upgrading audacity I ran into an issue with port:expat. On my
 system, building it with autotools (and +universal) as the port is written
 leaves the installed file `expat-config-version.cmake` with the following
 un(pre)processed block:

 {{{
 # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P
 set, ignore it:
 #ifndef __LP64__
 if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "4" STREQUAL "")
 #else
 if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
 #endif
   return()
 endif()

 # check that the installed version has the same 32/64bit-ness as the one
 which is currently searching:
 #ifndef __LP64__
 if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "4")
   math(EXPR installedBits "4 * 8")
 #else
 if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
   math(EXPR installedBits "8 * 8")
 #endif
   set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
   set(PACKAGE_VERSION_UNSUITABLE TRUE)
 endif()
 }}}

 cmake will evidently choke on the #ifndef statements.

 I'm not seeing this in default build nor in the buildbot version.

 It seems something goes wrong during the muniversal merging of the
 destroots: the files are correct but evidently different from each other
 in the `destroot-xx` dirs. It looks like `/usr/bin/diff` is the culprit
 for the mangled result.

 The easy solution here would be to build using cmake but that would
 introduce a circular dependency, so a hand-coded solution must be found in
 the post-destroot phase. CMake must have bit-width checking features. Or
 simply install the version created by the cmake build because that lacks
 the entire offending section (which appears dispensable anyway).

-- 
Ticket URL: <https://trac.macports.org/ticket/66874>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list