Changes between Version 1 and Version 2 of Ticket #72120


Ignore:
Timestamp:
Feb 28, 2025, 10:36:51 AM (12 months ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

Your log shows this is happening while libavif is trying to configure a copy of libargparse that it has downloaded. While this step works for me on macOS 12, we don't want ports downloading things themselves. We have libargparse in MacPorts as a separate port; the libavif port should be fixed to use that instead of downloading and building its own copy, which will solve the problem you're having building it.

The problem probably happens because in libavif-1.2.0/cmake/Modules/LocalLibargparse.cmake it does this:

    FetchContent_Declare(
        libargparse
        GIT_REPOSITORY "https://github.com/kmurray/libargparse.git"
        GIT_TAG ${AVIF_LIBARGPARSE_GIT_TAG}
        # TODO(vrabaud) remove once CMake 3.13 is not supported anymore.
        PATCH_COMMAND
            sed -i.bak -e
            "s:install.*:include(GNUInstallDirs)\\\\ninstall(TARGETS libargparse RUNTIME DESTINATION \\\\$\\\\{CMAKE_INSTALL_BINDIR\\\\} LIBRARY DESTINATION \\\\$\\\\{CMAKE_INSTALL_LIBDIR\\\\} ARCHIVE DESTINATION \\\\$\\\\{CMAKE_INSTALL_LIBDIR\\\\}):"
            CMakeLists.txt
        UPDATE_COMMAND ""
    )

So, after downloading libargparse, it uses sed to modify some of the code in CMakeLists.txt. That modification is not being performed correctly on your system for some reason. The \\\\ninstall part of the replacement sed is supposed to be making in the file is supposed to be interpreted as a newline followed by install, but in your case, it's becoming literally ninstall. I see that you are running on macOS 10.13, and we see the same problem on our build machines running macOS 10.15 and earlier (e.g. https://build.macports.org/builders/ports-10.15_x86_64-builder/builds/206841/steps/install-port/logs/stdio) but not on macOS 11 or later. Presumably the version of BSD sed included with macOS 10.15 and earlier doesn't support the specific replacement syntax being used here.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #72120

    • Property Keywords leopard snowleopard lion mountainlion mavericks yosemite elcapitan sierra highsierra mojave catalina added
    • Property Summary changed from libavif @1.2.0 Fails to build to libavif @1.2.0: Parse error. Expected a newline, got identifier with text "ninstall".
  • Ticket #72120 – Description

    v1 v2  
    11{{{
    2 :info:configure CMake Error at /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libavif/libavif/work/build/_deps/libargparse-src/CMakeLists.txt:24:\\
    3 :info:configure   Parse error.  Expected a newline, got identifier with text "ninstall".\\
    4 :info:configure -- Configuring incomplete, errors occurred!\\
    5 :info:configure Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libavif/libavif/work/build" && /opt/local/bin/cmake -G "Ninja" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DAVIF_BUILD_APPS:BOOL=ON -DAVIF_CODEC_AOM=SYSTEM -DAVIF_CODEC_DAV1D=SYSTEM -DAVIF_CODEC_LIBGAV1=OFF -DAVIF_CODEC_RAV1E=OFF -DAVIF_CODEC_SVT=SYSTEM -DAVIF_ENABLE_WERROR:BOOL=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DCMAKE_OSX_SYSROOT="/" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libavif/libavif/work/libavif-1.2.0\\
    6 :info:configure Exit code: 1\\
    7 :error:configure Failed to configure libavif: configure failure: command execution failed\\
    8 :debug:configure Error code: NONE\\
    9 :debug:configure Backtrace: configure failure: command execution failed\\
    10 :debug:configure     while executing\\
    11 :debug:configure "$procedure $targetname"\\
    12 :error:configure See /opt/local/var/macports\\/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libavif/libavif/main.log for details.\\
     2:info:configure CMake Error at /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libavif/libavif/work/build/_deps/libargparse-src/CMakeLists.txt:24:
     3:info:configure   Parse error.  Expected a newline, got identifier with text "ninstall".
     4:info:configure -- Configuring incomplete, errors occurred!
     5:info:configure Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libavif/libavif/work/build" && /opt/local/bin/cmake -G "Ninja" -DCMAKE_BUILD_TYPE=MacPorts -DCMAKE_INSTALL_PREFIX="/opt/local" -DCMAKE_INSTALL_NAME_DIR="/opt/local/lib" -DCMAKE_SYSTEM_PREFIX_PATH="/opt/local;/usr" -DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" -DCMAKE_OBJC_COMPILER="$CC" -DCMAKE_OBJCXX_COMPILER="$CXX" -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_POLICY_DEFAULT_CMP0060=NEW -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_COLOR_MAKEFILE=ON -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_MODULE_PATH="/opt/local/share/cmake/Modules" -DCMAKE_PREFIX_PATH="/opt/local/share/cmake/Modules" -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON -DCMAKE_INSTALL_RPATH="/opt/local/lib" -Wno-dev -DAVIF_BUILD_APPS:BOOL=ON -DAVIF_CODEC_AOM=SYSTEM -DAVIF_CODEC_DAV1D=SYSTEM -DAVIF_CODEC_LIBGAV1=OFF -DAVIF_CODEC_RAV1E=OFF -DAVIF_CODEC_SVT=SYSTEM -DAVIF_ENABLE_WERROR:BOOL=OFF -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.13" -DCMAKE_OSX_SYSROOT="/" /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libavif/libavif/work/libavif-1.2.0
     6:info:configure Exit code: 1
     7:error:configure Failed to configure libavif: configure failure: command execution failed
     8:debug:configure Error code: NONE
     9:debug:configure Backtrace: configure failure: command execution failed
     10:debug:configure     while executing
     11:debug:configure "$procedure $targetname"
     12:error:configure See /opt/local/var/macports\\/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_multimedia_libavif/libavif/main.log for details.
    1313}}}