From 1c905fa8812a78fb4eea7317b3270bf155bd6677 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 9 Apr 2024 06:41:04 +0200 Subject: [PATCH 1/3] cling: cleanup --- pkgs/development/interpreters/cling/default.nix | 5 +---- .../cling/force-install-cling-targets.patch | 16 ---------------- 2 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 pkgs/development/interpreters/cling/force-install-cling-targets.patch diff --git a/pkgs/development/interpreters/cling/default.nix b/pkgs/development/interpreters/cling/default.nix index 08909063ce46..cb0d66c67719 100644 --- a/pkgs/development/interpreters/cling/default.nix +++ b/pkgs/development/interpreters/cling/default.nix @@ -1,6 +1,5 @@ { cmake , fetchFromGitHub -, fetchgit , git , lib , libffi @@ -53,7 +52,7 @@ let clingSrc = fetchFromGitHub { owner = "root-project"; repo = "cling"; - rev = "v1.0"; + rev = "v${version}"; sha256 = "sha256-Ye8EINzt+dyNvUIRydACXzb/xEPLm0YSkz08Xxw3xp4="; }; @@ -66,8 +65,6 @@ let patches = [ ./no-clang-cpp.patch - - # ./force-install-cling-targets.patch ]; nativeBuildInputs = [ python3 git cmake ]; diff --git a/pkgs/development/interpreters/cling/force-install-cling-targets.patch b/pkgs/development/interpreters/cling/force-install-cling-targets.patch deleted file mode 100644 index 627e2593298e..000000000000 --- a/pkgs/development/interpreters/cling/force-install-cling-targets.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/tools/cling/cmake/modules/CMakeLists.txt b/tools/cling/cmake/modules/CMakeLists.txt ---- a/tools/cling/cmake/modules/CMakeLists.txt -+++ b/tools/cling/cmake/modules/CMakeLists.txt -@@ -54,10 +54,8 @@ set(CLING_CONFIG_EXPORTS_FILE) - - if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) - get_property(cling_has_exports GLOBAL PROPERTY CLING_HAS_EXPORTS) -- if(cling_has_exports) -- install(EXPORT ClingTargets DESTINATION ${CLING_INSTALL_PACKAGE_DIR} -- COMPONENT cling-cmake-exports) -- endif() -+ install(EXPORT ClingTargets DESTINATION ${CLING_INSTALL_PACKAGE_DIR} -+ COMPONENT cling-cmake-exports) - - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClingConfig.cmake From 18c40a3873b361636e0d13957e5995dca06797bf Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 9 Apr 2024 06:41:44 +0200 Subject: [PATCH 2/3] cling: fix runtime error on aarch64-linux --- pkgs/development/interpreters/cling/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/cling/default.nix b/pkgs/development/interpreters/cling/default.nix index cb0d66c67719..a53335fc4de6 100644 --- a/pkgs/development/interpreters/cling/default.nix +++ b/pkgs/development/interpreters/cling/default.nix @@ -122,7 +122,7 @@ let "-l" "${llvmPackages_13.libcxx}/lib/libc++.so" ] else [ "-I" "${gcc-unwrapped}/include/c++/${gcc-unwrapped.version}" - "-I" "${gcc-unwrapped}/include/c++/${gcc-unwrapped.version}/x86_64-unknown-linux-gnu" + "-I" "${gcc-unwrapped}/include/c++/${gcc-unwrapped.version}/${stdenv.hostPlatform.config}" ]; # The flags passed to the wrapped cling should From 811a1b144a03ab80ee86fcece764fa47f055909d Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Tue, 9 Apr 2024 06:41:52 +0200 Subject: [PATCH 3/3] cling: fix runtime error on darwin --- pkgs/development/interpreters/cling/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/cling/default.nix b/pkgs/development/interpreters/cling/default.nix index a53335fc4de6..a5a3de81bd5a 100644 --- a/pkgs/development/interpreters/cling/default.nix +++ b/pkgs/development/interpreters/cling/default.nix @@ -27,7 +27,7 @@ # Build with libc++ (LLVM) rather than stdlibc++ (GCC). # This is experimental and not all features work. -, useLLVMLibcxx ? false +, useLLVMLibcxx ? clangStdenv.isDarwin }: let @@ -119,7 +119,7 @@ let cxxFlags = if useLLVMLibcxx then [ "-I" "${lib.getDev llvmPackages_13.libcxx}/include/c++/v1" "-L" "${llvmPackages_13.libcxx}/lib" - "-l" "${llvmPackages_13.libcxx}/lib/libc++.so" + "-l" "${llvmPackages_13.libcxx}/lib/libc++${stdenv.hostPlatform.extensions.sharedLibrary}" ] else [ "-I" "${gcc-unwrapped}/include/c++/${gcc-unwrapped.version}" "-I" "${gcc-unwrapped}/include/c++/${gcc-unwrapped.version}/${stdenv.hostPlatform.config}"