From 802115d0227228b66b691f3b85b30b868976e8eb Mon Sep 17 00:00:00 2001 From: Atemu Date: Mon, 21 Nov 2022 17:39:26 +0100 Subject: [PATCH] dar: unbreak on Darwin Error with LLVM stdenv on aarch64-darwin: libtool: compile: clang++ -DHAVE_CONFIG_H -I. -I../.. -DLIBDAR_MODE=64 -DDAR_LOCALEDIR=\"/nix/store/waclhq32gacp2010gyjx17f9h6xpsf8d-dar-2.7.7/share/locale\" -I/nix/store/1m4gsx4p4fl5xpg0h8splmwz7j2y3cbp-gpgme-1.18.0-dev/include -I/nix/store/fpc4g6ql1mx4na5rkjhik5f2wixymzhy-libassuan-2.5.5-dev/include -I/nix/store/qhznxypyfh3w5xdbxxd2n47d9c8jr2bx-libgpg-error-1.45-dev/include -g -O2 -c parallel_block_compressor.cpp -D__DYNAMIC__ -fno-common -DPIC -o .libs/parallel_block_compressor.o In file included from parallel_tronconneuse.cpp:28: In file included from ./parallel_tronconneuse.hpp:39: In file included from /nix/store/3lsnbsiwzy2gzga1m2bszb7r9d6wraz2-libcxx-11.1.0-dev/include/c++/v1/string:506: In file included from /nix/store/3lsnbsiwzy2gzga1m2bszb7r9d6wraz2-libcxx-11.1.0-dev/include/c++/v1/string_view:175: In file included from /nix/store/3lsnbsiwzy2gzga1m2bszb7r9d6wraz2-libcxx-11.1.0-dev/include/c++/v1/__string:57: In file included from /nix/store/3lsnbsiwzy2gzga1m2bszb7r9d6wraz2-libcxx-11.1.0-dev/include/c++/v1/algorithm:643: /nix/store/3lsnbsiwzy2gzga1m2bszb7r9d6wraz2-libcxx-11.1.0-dev/include/c++/v1/memory:3455:7: error: exception specification of overriding function is more lax than base version class __shared_ptr_emplace ^ /nix/store/3lsnbsiwzy2gzga1m2bszb7r9d6wraz2-libcxx-11.1.0-dev/include/c++/v1/memory:4291:26: note: in instantiation of template class 'std::__1::__shared_ptr_emplace>' requested here ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...); ^ parallel_tronconneuse.cpp:102:15: note: in instantiation of function template specialization 'std::__1::make_shared' requested here waiter = make_shared(num_workers + 2); // +1 for crypto_reade thread, +1 this thread ^ /nix/store/3lsnbsiwzy2gzga1m2bszb7r9d6wraz2-libcxx-11.1.0-dev/include/c++/v1/memory:3364:13: note: overridden virtual function is here virtual ~__shared_weak_count(); ^ 1 error generated. make[3]: *** [Makefile:1383: parallel_tronconneuse.lo] Error 1 --- pkgs/tools/backup/dar/default.nix | 17 ++++++++++++++--- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/backup/dar/default.nix b/pkgs/tools/backup/dar/default.nix index 41ecdd1ea780..3652529805c6 100644 --- a/pkgs/tools/backup/dar/default.nix +++ b/pkgs/tools/backup/dar/default.nix @@ -1,13 +1,20 @@ -{ lib, stdenv, fetchurl +{ lib, gccStdenv, fetchurl , which , attr, e2fsprogs , curl, libargon2, librsync, libthreadar , gpgme, libgcrypt, openssl , bzip2, lz4, lzo, xz, zlib +, CoreFoundation }: with lib; +let + # Fails to build with clang on Darwin: + # error: exception specification of overriding function is more lax than base version + stdenv = gccStdenv; +in + stdenv.mkDerivation rec { version = "2.7.7"; pname = "dar"; @@ -25,7 +32,12 @@ stdenv.mkDerivation rec { curl librsync libthreadar gpgme libargon2 libgcrypt openssl bzip2 lz4 lzo xz zlib - ] ++ optionals stdenv.isLinux [ attr e2fsprogs ]; + ] ++ optionals stdenv.isLinux [ + attr + e2fsprogs + ] ++ optionals stdenv.isDarwin [ + CoreFoundation + ]; configureFlags = [ "--disable-birthtime" @@ -45,7 +57,6 @@ stdenv.mkDerivation rec { hardeningDisable = [ "format" ]; meta = { - broken = stdenv.isDarwin; homepage = "http://dar.linux.free.fr"; description = "Disk ARchiver, allows backing up files into indexed archives"; maintainers = with maintainers; [ izorkin ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4f48ad8215f6..bb7b2bfd548d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5780,7 +5780,9 @@ with pkgs; daq = callPackage ../applications/networking/ids/daq { }; - dar = callPackage ../tools/backup/dar { }; + dar = callPackage ../tools/backup/dar { + inherit (darwin.apple_sdk.frameworks) CoreFoundation; + }; darkhttpd = callPackage ../servers/http/darkhttpd { };