lol

arrayfire: avoid FetchContent downloading stuff

+82 -37
+1 -7
pkgs/development/libraries/arrayfire/default.nix
··· 10 10 , fmt_9 11 11 , forge 12 12 , freeimage 13 - , git 14 13 , gtest 15 14 , lapack 16 15 , lib ··· 131 130 132 131 # ArrayFire have a repo with assets for the examples. Since we don't build 133 132 # the examples anyway, remove the dependency on assets. 134 - patches = [ ./no-assets.patch ]; 133 + patches = [ ./no-assets.patch ./no-download.patch ]; 135 134 136 135 postPatch = '' 137 136 mkdir -p ./extern/af_glad-src ··· 209 208 210 209 nativeBuildInputs = [ 211 210 cmake 212 - # ArrayFire have their own CMake functions for downloading the 213 - # dependencies, and it uses git. Even though we bypass that system by 214 - # downloading the dependencies beforehand, CMake files still invoke git for 215 - # checking... 216 - git 217 211 pkg-config 218 212 python3 219 213 ];
+12 -18
pkgs/development/libraries/arrayfire/no-assets.patch
··· 1 1 diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index deafa7a75..b9ca54621 100644 2 + index 12d6e557c..cc004555d 100644 3 3 --- a/CMakeLists.txt 4 4 +++ b/CMakeLists.txt 5 - @@ -320,11 +320,11 @@ if(NOT TARGET nonstd::span-lite) 5 + @@ -321,11 +321,6 @@ if(NOT TARGET nonstd::span-lite) 6 6 7 7 endif() 8 8 ··· 11 11 - REF master 12 12 -) 13 13 -set(ASSETS_DIR ${${assets_prefix}_SOURCE_DIR}) 14 - +# af_dep_check_and_populate(${assets_prefix} 15 - +# URI https://github.com/arrayfire/assets.git 16 - +# REF master 17 - +# ) 18 - +# set(ASSETS_DIR ${${assets_prefix}_SOURCE_DIR}) 19 14 20 15 # when crosscompiling use the bin2cpp file from the native bin directory 21 16 if(CMAKE_CROSSCOMPILING) 22 - @@ -477,13 +477,13 @@ install(FILES ${ArrayFire_BINARY_DIR}/include/af/version.h 23 - # source files does not depend on AF_BUILD_EXAMPLES 24 - # when AF_BUILD_EXAMPLES is OFF, the examples source is installed without 25 - # building the example executables 17 + @@ -473,18 +468,6 @@ install(FILES ${ArrayFire_BINARY_DIR}/include/af/version.h 18 + DESTINATION "${AF_INSTALL_INC_DIR}/af/" 19 + COMPONENT headers) 20 + 21 + -# install the examples irrespective of the AF_BUILD_EXAMPLES value 22 + -# only the examples source files are installed, so the installation of these 23 + -# source files does not depend on AF_BUILD_EXAMPLES 24 + -# when AF_BUILD_EXAMPLES is OFF, the examples source is installed without 25 + -# building the example executables 26 26 -install(DIRECTORY examples/ #NOTE The slash at the end is important 27 27 - DESTINATION ${AF_INSTALL_EXAMPLE_DIR} 28 28 - COMPONENT examples) 29 - +# install(DIRECTORY examples/ #NOTE The slash at the end is important 30 - +# DESTINATION ${AF_INSTALL_EXAMPLE_DIR} 31 - +# COMPONENT examples) 32 - 29 + - 33 30 -install(DIRECTORY ${ASSETS_DIR}/examples/ #NOTE The slash at the end is important 34 31 - DESTINATION ${AF_INSTALL_EXAMPLE_DIR} 35 32 - COMPONENT examples) 36 - +#install(DIRECTORY ${ASSETS_DIR}/examples/ #NOTE The slash at the end is important 37 - +# DESTINATION ${AF_INSTALL_EXAMPLE_DIR} 38 - +# COMPONENT examples) 39 33 40 34 install(DIRECTORY "${ArrayFire_SOURCE_DIR}/LICENSES/" 41 35 DESTINATION LICENSES
+31
pkgs/development/libraries/arrayfire/no-download.patch
··· 1 + diff --git a/CMakeModules/AFconfigure_deps_vars.cmake b/CMakeModules/AFconfigure_deps_vars.cmake 2 + index aac332f5a..e9e711159 100644 3 + --- a/CMakeModules/AFconfigure_deps_vars.cmake 4 + +++ b/CMakeModules/AFconfigure_deps_vars.cmake 5 + @@ -94,7 +94,7 @@ macro(af_dep_check_and_populate dep_prefix) 6 + URL ${adcp_args_URI} 7 + URL_HASH ${adcp_args_REF} 8 + DOWNLOAD_COMMAND \"\" 9 + - UPDATE_DISCONNECTED ON 10 + + UPDATE_COMMAND \"\" 11 + SOURCE_DIR "${ArrayFire_SOURCE_DIR}/extern/${dep_prefix}-src" 12 + BINARY_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-build" 13 + SUBBUILD_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-subbuild" 14 + @@ -104,7 +104,7 @@ macro(af_dep_check_and_populate dep_prefix) 15 + QUIET 16 + URL ${adcp_args_URI} 17 + DOWNLOAD_COMMAND \"\" 18 + - UPDATE_DISCONNECTED ON 19 + + UPDATE_COMMAND \"\" 20 + SOURCE_DIR "${ArrayFire_SOURCE_DIR}/extern/${dep_prefix}-src" 21 + BINARY_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-build" 22 + SUBBUILD_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-subbuild" 23 + @@ -116,7 +116,7 @@ macro(af_dep_check_and_populate dep_prefix) 24 + GIT_REPOSITORY ${adcp_args_URI} 25 + GIT_TAG ${adcp_args_REF} 26 + DOWNLOAD_COMMAND \"\" 27 + - UPDATE_DISCONNECTED ON 28 + + UPDATE_COMMAND \"\" 29 + SOURCE_DIR "${ArrayFire_SOURCE_DIR}/extern/${dep_prefix}-src" 30 + BINARY_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-build" 31 + SUBBUILD_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-subbuild"
+7 -12
pkgs/development/libraries/forge/default.nix
··· 5 5 , fontconfig 6 6 , freeimage 7 7 , freetype 8 - , git 9 8 , glfw3 10 9 , glm 11 10 , lib ··· 32 31 owner = "arrayfire"; 33 32 repo = "glad"; 34 33 rev = "b94680aee5b8ce01ae1644c5f2661769366c765a"; 35 - sha256 = "sha256-CrZy76gOGMpy9f1NuMK4tokZ57U//zYeNH5ZYY0SC2U="; 34 + hash = "sha256-CrZy76gOGMpy9f1NuMK4tokZ57U//zYeNH5ZYY0SC2U="; 36 35 }; 37 36 37 + # This patch ensures that Forge does not try to fetch glad from GitHub and 38 + # uses our sources that we've checked out via Nix. 39 + patches = [ ./no-download-glad.patch ]; 40 + 38 41 postPatch = '' 39 - mkdir -p ./extern/fg_glad-src 40 - cp -R --no-preserve=mode,ownership ${glad}/* ./extern/fg_glad-src/ 42 + mkdir -p ./extern 43 + cp -R --no-preserve=mode,ownership ${glad} ./extern/fg_glad-src 41 44 ln -s ${opencl-clhpp} ./extern/cl2hpp 42 - 43 - substituteInPlace CMakeModules/ForgeConfigureDepsVars.cmake \ 44 - --replace 'set(BUILD_OFFLINE OFF)' 'set(BUILD_OFFLINE ON)' 45 45 ''; 46 46 47 47 cmakeFlags = [ "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" ]; 48 48 49 49 nativeBuildInputs = [ 50 50 cmake 51 - # ArrayFire have their own CMake functions for downloading the 52 - # dependencies, and it uses git. Even though we bypass that system by 53 - # downloading the dependencies beforehand, CMake files still invoke git for 54 - # checking... 55 - git 56 51 pkg-config 57 52 ]; 58 53
+31
pkgs/development/libraries/forge/no-download-glad.patch
··· 1 + diff --git a/CMakeModules/ForgeConfigureDepsVars.cmake b/CMakeModules/ForgeConfigureDepsVars.cmake 2 + index ee5c2fc..2f75181 100644 3 + --- a/CMakeModules/ForgeConfigureDepsVars.cmake 4 + +++ b/CMakeModules/ForgeConfigureDepsVars.cmake 5 + @@ -84,7 +84,7 @@ macro(fg_dep_check_and_populate dep_prefix) 6 + URL ${fdcp_args_URI} 7 + URL_HASH ${fdcp_args_REF} 8 + DOWNLOAD_COMMAND \"\" 9 + - UPDATE_DISCONNECTED ON 10 + + UPDATE_COMMAND \"\" 11 + SOURCE_DIR "${Forge_SOURCE_DIR}/extern/${dep_prefix}-src" 12 + BINARY_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-build" 13 + SUBBUILD_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-subbuild" 14 + @@ -94,7 +94,7 @@ macro(fg_dep_check_and_populate dep_prefix) 15 + QUIET 16 + URL ${fdcp_args_URI} 17 + DOWNLOAD_COMMAND \"\" 18 + - UPDATE_DISCONNECTED ON 19 + + UPDATE_COMMAND \"\" 20 + SOURCE_DIR "${Forge_SOURCE_DIR}/extern/${dep_prefix}-src" 21 + BINARY_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-build" 22 + SUBBUILD_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-subbuild" 23 + @@ -106,7 +106,7 @@ macro(fg_dep_check_and_populate dep_prefix) 24 + GIT_REPOSITORY ${fdcp_args_URI} 25 + GIT_TAG ${fdcp_args_REF} 26 + DOWNLOAD_COMMAND \"\" 27 + - UPDATE_DISCONNECTED ON 28 + + UPDATE_COMMAND \"\" 29 + SOURCE_DIR "${Forge_SOURCE_DIR}/extern/${dep_prefix}-src" 30 + BINARY_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-build" 31 + SUBBUILD_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-subbuild"