Failure to Build From Source using the AUR package: darling-dmg-git
Build Log
```console
$ makepkg --cleanbuild --sign -f
==> Making package: darling-dmg-git v1.0.4.r97.ga36bf0c-1 (Mon 19 Aug 2024 07:14:48 AM MDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Updating darling-dmg git repo...
==> Validating source files with sha256sums...
darling-dmg ... Skipped
==> Removing existing $srcdir/ directory...
==> Extracting sources...
-> Creating working copy of darling-dmg git repo...
Cloning into 'darling-dmg'...
done.
==> Starting prepare()...
==> Starting pkgver()...
==> Removing existing $pkgdir/ directory...
==> Starting build()...
CMake Warning (dev) at CMakeLists.txt:1 (project):
cmake_minimum_required() should be called prior to this top-level project()
call. Please see the cmake-commands(7) manual for usage documentation of
both commands.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.1.1")
-- Found LibXml2: /usr/lib/libxml2.so
CMake Warning (dev) at CMakeLists.txt:53 (find_package):
Policy CMP0167 is not set: The FindBoost module is removed. Run "cmake
--help-policy CMP0167" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Found Boost: /usr/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0") found components: unit_test_framework
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /home/exampleuser/src/pub/pkgbuild/darling-dmg-git/src/darling-dmg/build
[ 9%] Building CXX object CMakeFiles/CacheTest.dir/src/Reader.cpp.o
[ 9%] Building CXX object CMakeFiles/dmg.dir/src/unichar.cpp.o
[ 12%] Building CXX object CMakeFiles/dmg.dir/src/HFSVolume.cpp.o
[ 15%] Building CXX object CMakeFiles/CacheTest.dir/src/CacheZone.cpp.o
[ 18%] Building CXX object CMakeFiles/CacheTest.dir/src/CachedReader.cpp.o
[ 9%] Building CXX object CMakeFiles/dmg.dir/src/FileReader.cpp.o
[ 21%] Building CXX object CMakeFiles/CacheTest.dir/test/CacheTest.cpp.o
[ 25%] Building CXX object CMakeFiles/dmg.dir/src/Reader.cpp.o
[ 28%] Building CXX object CMakeFiles/CacheTest.dir/src/MemoryReader.cpp.o
In file included from /usr/include/unicode/unistr.h:39,
from /home/exampleuser/src/pub/pkgbuild/darling-dmg-git/src/darling-dmg/src/unichar.cpp:3:
/usr/include/unicode/stringpiece.h:133:29: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type
133 | typename = std::enable_if_t<
| ^~~~~~~~~~~
/usr/include/unicode/stringpiece.h:133:24: note: ‘std::enable_if_t’ is only available from C++14 onwards
133 | typename = std::enable_if_t<
| ^~~
/usr/include/unicode/stringpiece.h:133:40: error: expected ‘>’ before ‘<’ token
133 | typename = std::enable_if_t<
| ^
In file included from /usr/include/unicode/uenum.h:25,
from /usr/include/unicode/ucnv.h:52,
from /home/exampleuser/src/pub/pkgbuild/darling-dmg-git/src/darling-dmg/src/unichar.cpp:4:
/usr/include/unicode/localpointer.h:561:26: error: parameter declared ‘auto’
561 | template
| ^~~~
/usr/include/unicode/localpointer.h:573:76: error: template argument 2 is invalid
573 | explicit LocalOpenPointer(std::unique_ptr &&p)
| ^
/usr/include/unicode/localpointer.h:583:78: error: template argument 2 is invalid
583 | LocalOpenPointer &operator=(std::unique_ptr &&p) {
| ^
/usr/include/unicode/localpointer.h:599:59: error: template argument 2 is invalid
599 | operator std::unique_ptr () && {
| ^
/usr/include/unicode/uenum.h:69:1: note: invalid template non-type parameter
69 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUEnumerationPointer, UEnumeration, uenum_close);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unicode/ucnv.h:597:1: note: invalid template non-type parameter
597 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUConverterPointer, UConverter, ucnv_close);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 31%] Building CXX object CMakeFiles/dmg.dir/src/AppleDisk.cpp.o
[ 34%] Building CXX object CMakeFiles/dmg.dir/src/SubReader.cpp.o
[ 37%] Building CXX object CMakeFiles/dmg.dir/src/HFSBTree.cpp.o
[ 40%] Building CXX object CMakeFiles/dmg.dir/src/HFSFork.cpp.o
make[2]: *** [CMakeFiles/dmg.dir/build.make:76: CMakeFiles/dmg.dir/src/unichar.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/dmg.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 43%] Linking CXX executable CacheTest
[ 43%] Built target CacheTest
make: *** [Makefile:146: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
```
It seems that there are 2 issues building on this system:
CMake complains about the policy for FindBoost due to behavior change on newer versions of CMake
Some code appears to now be using features from C++ 17, but the CMakeLists.txt currently has: -std=c++11
This may or may not affect other distros with older toolchain & lib versions. However, I figured that I would post here the problem and link a pull request with the solution I found which worked for me.
Failure to Build From Source using the AUR package:
darling-dmg-git
Build Log
```console $ makepkg --cleanbuild --sign -f ==> Making package: darling-dmg-git v1.0.4.r97.ga36bf0c-1 (Mon 19 Aug 2024 07:14:48 AM MDT) ==> Checking runtime dependencies... ==> Checking buildtime dependencies... ==> Retrieving sources... -> Updating darling-dmg git repo... ==> Validating source files with sha256sums... darling-dmg ... Skipped ==> Removing existing $srcdir/ directory... ==> Extracting sources... -> Creating working copy of darling-dmg git repo... Cloning into 'darling-dmg'... done. ==> Starting prepare()... ==> Starting pkgver()... ==> Removing existing $pkgdir/ directory... ==> Starting build()... CMake Warning (dev) at CMakeLists.txt:1 (project): cmake_minimum_required() should be called prior to this top-level project() call. Please see the cmake-commands(7) manual for usage documentation of both commands. This warning is for project developers. Use -Wno-dev to suppress it. -- The C compiler identification is GNU 14.2.1 -- The CXX compiler identification is GNU 14.2.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PkgConfig: /usr/bin/pkg-config (found version "2.1.1") -- Found LibXml2: /usr/lib/libxml2.so CMake Warning (dev) at CMakeLists.txt:53 (find_package): Policy CMP0167 is not set: The FindBoost module is removed. Run "cmake --help-policy CMP0167" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. -- Found Boost: /usr/lib/cmake/Boost-1.83.0/BoostConfig.cmake (found version "1.83.0") found components: unit_test_framework -- Configuring done (0.4s) -- Generating done (0.0s) -- Build files have been written to: /home/exampleuser/src/pub/pkgbuild/darling-dmg-git/src/darling-dmg/build [ 9%] Building CXX object CMakeFiles/CacheTest.dir/src/Reader.cpp.o [ 9%] Building CXX object CMakeFiles/dmg.dir/src/unichar.cpp.o [ 12%] Building CXX object CMakeFiles/dmg.dir/src/HFSVolume.cpp.o [ 15%] Building CXX object CMakeFiles/CacheTest.dir/src/CacheZone.cpp.o [ 18%] Building CXX object CMakeFiles/CacheTest.dir/src/CachedReader.cpp.o [ 9%] Building CXX object CMakeFiles/dmg.dir/src/FileReader.cpp.o [ 21%] Building CXX object CMakeFiles/CacheTest.dir/test/CacheTest.cpp.o [ 25%] Building CXX object CMakeFiles/dmg.dir/src/Reader.cpp.o [ 28%] Building CXX object CMakeFiles/CacheTest.dir/src/MemoryReader.cpp.o In file included from /usr/include/unicode/unistr.h:39, from /home/exampleuser/src/pub/pkgbuild/darling-dmg-git/src/darling-dmg/src/unichar.cpp:3: /usr/include/unicode/stringpiece.h:133:29: error: ‘enable_if_t’ in namespace ‘std’ does not name a template type 133 | typename = std::enable_if_t< | ^~~~~~~~~~~ /usr/include/unicode/stringpiece.h:133:24: note: ‘std::enable_if_t’ is only available from C++14 onwards 133 | typename = std::enable_if_t< | ^~~ /usr/include/unicode/stringpiece.h:133:40: error: expected ‘>’ before ‘<’ token 133 | typename = std::enable_if_t< | ^ In file included from /usr/include/unicode/uenum.h:25, from /usr/include/unicode/ucnv.h:52, from /home/exampleuser/src/pub/pkgbuild/darling-dmg-git/src/darling-dmg/src/unichar.cpp:4: /usr/include/unicode/localpointer.h:561:26: error: parameter declared ‘auto’ 561 | template
| ^~~~
/usr/include/unicode/localpointer.h:573:76: error: template argument 2 is invalid
573 | explicit LocalOpenPointer(std::unique_ptr &&p)
| ^
/usr/include/unicode/localpointer.h:583:78: error: template argument 2 is invalid
583 | LocalOpenPointer &operator=(std::unique_ptr &&p) {
| ^
/usr/include/unicode/localpointer.h:599:59: error: template argument 2 is invalid
599 | operator std::unique_ptr () && {
| ^
/usr/include/unicode/uenum.h:69:1: note: invalid template non-type parameter
69 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUEnumerationPointer, UEnumeration, uenum_close);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/unicode/ucnv.h:597:1: note: invalid template non-type parameter
597 | U_DEFINE_LOCAL_OPEN_POINTER(LocalUConverterPointer, UConverter, ucnv_close);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 31%] Building CXX object CMakeFiles/dmg.dir/src/AppleDisk.cpp.o
[ 34%] Building CXX object CMakeFiles/dmg.dir/src/SubReader.cpp.o
[ 37%] Building CXX object CMakeFiles/dmg.dir/src/HFSBTree.cpp.o
[ 40%] Building CXX object CMakeFiles/dmg.dir/src/HFSFork.cpp.o
make[2]: *** [CMakeFiles/dmg.dir/build.make:76: CMakeFiles/dmg.dir/src/unichar.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:113: CMakeFiles/dmg.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 43%] Linking CXX executable CacheTest
[ 43%] Built target CacheTest
make: *** [Makefile:146: all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
```
It seems that there are 2 issues building on this system:
FindBoost
due to behavior change on newer versions of CMakeCMakeLists.txt
currently has:-std=c++11
This may or may not affect other distros with older toolchain & lib versions. However, I figured that I would post here the problem and link a pull request with the solution I found which worked for me.