[MacPorts] #72120: libavif @1.2.0: Parse error. Expected a newline, got identifier with text "ninstall". (was: libavif @1.2.0 Fails to build)
MacPorts
noreply at macports.org
Fri Feb 28 10:36:51 UTC 2025
#72120: libavif @1.2.0: Parse error. Expected a newline, got identifier with text
"ninstall".
-------------------------+-------------------------------------------------
Reporter: JohnFHall | Owner: mascguy
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.10.5
Resolution: | Keywords: leopard snowleopard lion
| mountainlion mavericks yosemite elcapitan
Port: libavif | sierra highsierra mojave catalina
-------------------------+-------------------------------------------------
Changes (by ryandesign):
* keywords: =>
leopard snowleopard lion mountainlion mavericks yosemite elcapitan
sierra highsierra mojave catalina
Old description:
> {{{
> :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:\\
> :info:configure Parse error. Expected a newline, got identifier with
> text "ninstall".\\
> :info:configure -- Configuring incomplete, errors occurred!\\
> :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\\
> :info:configure Exit code: 1\\
> :error:configure Failed to configure libavif: configure failure: command
> execution failed\\
> :debug:configure Error code: NONE\\
> :debug:configure Backtrace: configure failure: command execution failed\\
> :debug:configure while executing\\
> :debug:configure "$procedure $targetname"\\
> :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.\\
> }}}
New description:
{{{
: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:
:info:configure Parse error. Expected a newline, got identifier with
text "ninstall".
:info:configure -- Configuring incomplete, errors occurred!
: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
:info:configure Exit code: 1
:error:configure Failed to configure libavif: configure failure: command
execution failed
:debug:configure Error code: NONE
:debug:configure Backtrace: configure failure: command execution failed
:debug:configure while executing
:debug:configure "$procedure $targetname"
: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.
}}}
--
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:
{{{#!cmake
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.
--
Ticket URL: <https://trac.macports.org/ticket/72120#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list