From 6909fb9a94431facc1188b374b04b33cf679d79c Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Sun, 16 Jun 2024 21:40:03 +0000 Subject: [PATCH 1/8] nerfstudio: init at 1.1.2 --- ...locatable-target_include_directories.patch | 490 ++++++++++++++++++ pkgs/by-name/fi/filament/package.nix | 157 ++++++ pkgs/by-name/li/liblzf/package.nix | 14 + pkgs/by-name/op/open3d/package.nix | 135 +++++ pkgs/by-name/st/stdgpu/package.nix | 30 ++ .../libraries/boringssl/default.nix | 24 +- .../python-modules/fpsample/default.nix | 48 ++ .../python-modules/gsplat/default.nix | 39 ++ .../python-modules/nerfacc/default.nix | 66 +++ .../python-modules/nerfstudio/default.nix | 203 ++++++++ .../python-modules/newrawpy/default.nix | 39 ++ .../nuscenes-devkit/default.nix | 68 +++ pkgs/tools/graphics/spirv-cross/default.nix | 8 + pkgs/top-level/python-packages.nix | 12 + 14 files changed, 1325 insertions(+), 8 deletions(-) create mode 100644 pkgs/by-name/fi/filament/0002-cmake-relocatable-target_include_directories.patch create mode 100644 pkgs/by-name/fi/filament/package.nix create mode 100644 pkgs/by-name/li/liblzf/package.nix create mode 100644 pkgs/by-name/op/open3d/package.nix create mode 100644 pkgs/by-name/st/stdgpu/package.nix create mode 100644 pkgs/development/python-modules/fpsample/default.nix create mode 100644 pkgs/development/python-modules/gsplat/default.nix create mode 100644 pkgs/development/python-modules/nerfacc/default.nix create mode 100644 pkgs/development/python-modules/nerfstudio/default.nix create mode 100644 pkgs/development/python-modules/newrawpy/default.nix create mode 100644 pkgs/development/python-modules/nuscenes-devkit/default.nix diff --git a/pkgs/by-name/fi/filament/0002-cmake-relocatable-target_include_directories.patch b/pkgs/by-name/fi/filament/0002-cmake-relocatable-target_include_directories.patch new file mode 100644 index 0000000000000..8e2bd47e5cfb9 --- /dev/null +++ b/pkgs/by-name/fi/filament/0002-cmake-relocatable-target_include_directories.patch @@ -0,0 +1,490 @@ +From 9846c94c84c9986855e785833a4d5f8803abd043 Mon Sep 17 00:00:00 2001 +From: Someone Serge +Date: Sat, 15 Jun 2024 23:33:27 +0000 +Subject: [PATCH 2/2] cmake: relocatable target_include_directories() + +--- + libs/bluegl/CMakeLists.txt | 4 ++-- + libs/bluevk/CMakeLists.txt | 4 ++-- + libs/camutils/CMakeLists.txt | 4 ++-- + libs/filabridge/CMakeLists.txt | 4 ++-- + libs/filaflat/CMakeLists.txt | 4 ++-- + libs/filagui/CMakeLists.txt | 4 ++-- + libs/filamat/CMakeLists.txt | 4 ++-- + libs/filamentapp/CMakeLists.txt | 4 ++-- + libs/filameshio/CMakeLists.txt | 4 ++-- + libs/geometry/CMakeLists.txt | 4 ++-- + libs/gltfio/CMakeLists.txt | 8 ++++---- + libs/ibl/CMakeLists.txt | 6 +++--- + libs/iblprefilter/CMakeLists.txt | 4 ++-- + libs/image/CMakeLists.txt | 4 ++-- + libs/imageio/CMakeLists.txt | 14 +++++++------- + libs/ktxreader/CMakeLists.txt | 4 ++-- + libs/matdbg/CMakeLists.txt | 4 ++-- + libs/math/CMakeLists.txt | 4 ++-- + libs/mathio/CMakeLists.txt | 4 ++-- + libs/uberz/CMakeLists.txt | 4 ++-- + libs/utils/CMakeLists.txt | 4 ++-- + libs/viewer/CMakeLists.txt | 2 +- + 22 files changed, 51 insertions(+), 51 deletions(-) + +diff --git a/libs/bluegl/CMakeLists.txt b/libs/bluegl/CMakeLists.txt +index 02a3676c9..0e9880b72 100644 +--- a/libs/bluegl/CMakeLists.txt ++++ b/libs/bluegl/CMakeLists.txt +@@ -45,13 +45,13 @@ else() + endif() + + # specify where our headers are +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + # we're building a library + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + + # specify where the public headers of this library are +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + if (WIN32) +diff --git a/libs/bluevk/CMakeLists.txt b/libs/bluevk/CMakeLists.txt +index bc5986e64..2eb626612 100644 +--- a/libs/bluevk/CMakeLists.txt ++++ b/libs/bluevk/CMakeLists.txt +@@ -19,13 +19,13 @@ else() + message(FATAL_ERROR "Platform not supported. BlueVK supports Linux, Android, MacOS X, and Windows.") + endif() + +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + + target_link_libraries(${TARGET} utils math) + +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + # test_bluevk is not supported on mobile or Windows +diff --git a/libs/camutils/CMakeLists.txt b/libs/camutils/CMakeLists.txt +index 97ed05f74..7097a4c87 100644 +--- a/libs/camutils/CMakeLists.txt ++++ b/libs/camutils/CMakeLists.txt +@@ -24,13 +24,13 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + + target_link_libraries(${TARGET} PUBLIC math) + +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + # ================================================================================================== +diff --git a/libs/filabridge/CMakeLists.txt b/libs/filabridge/CMakeLists.txt +index 515103320..06e5f961e 100644 +--- a/libs/filabridge/CMakeLists.txt ++++ b/libs/filabridge/CMakeLists.txt +@@ -18,10 +18,10 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + target_link_libraries(${TARGET} utils) +diff --git a/libs/filaflat/CMakeLists.txt b/libs/filaflat/CMakeLists.txt +index 378c31c8a..d6b586403 100644 +--- a/libs/filaflat/CMakeLists.txt ++++ b/libs/filaflat/CMakeLists.txt +@@ -18,10 +18,10 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} ${HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + target_link_libraries(${TARGET} filabridge utils) +diff --git a/libs/filagui/CMakeLists.txt b/libs/filagui/CMakeLists.txt +index 55f3d867f..395f287ac 100644 +--- a/libs/filagui/CMakeLists.txt ++++ b/libs/filagui/CMakeLists.txt +@@ -81,14 +81,14 @@ list(APPEND RESGEN_SOURCE ${DUMMY_SRC}) + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + include_directories(${GENERATION_ROOT}) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS} ${RESGEN_SOURCE}) + + target_link_libraries(${TARGET} PUBLIC imgui filament) + +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + # ================================================================================================== +diff --git a/libs/filamat/CMakeLists.txt b/libs/filamat/CMakeLists.txt +index 2fc20d7e9..40dbf1935 100644 +--- a/libs/filamat/CMakeLists.txt ++++ b/libs/filamat/CMakeLists.txt +@@ -77,12 +77,12 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + include_directories(${CMAKE_BINARY_DIR}) + + # Filamat + add_library(${TARGET} STATIC ${HDRS} ${PRIVATE_HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + target_link_libraries(${TARGET} shaders filabridge utils smol-v) + +diff --git a/libs/filamentapp/CMakeLists.txt b/libs/filamentapp/CMakeLists.txt +index 2e0e95b7d..625d23248 100644 +--- a/libs/filamentapp/CMakeLists.txt ++++ b/libs/filamentapp/CMakeLists.txt +@@ -136,13 +136,13 @@ set_target_properties(filamentapp-resources PROPERTIES FOLDER Samples/Resources) + # Include and target definitions + # ================================================================================================== + +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + + target_link_libraries(${TARGET} PUBLIC ${LIBS} filamentapp-resources) + +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + target_include_directories(${TARGET} PRIVATE ${GENERATION_ROOT}) + +diff --git a/libs/filameshio/CMakeLists.txt b/libs/filameshio/CMakeLists.txt +index 61847cd51..df1c7c6fa 100644 +--- a/libs/filameshio/CMakeLists.txt ++++ b/libs/filameshio/CMakeLists.txt +@@ -18,9 +18,9 @@ set(SRCS src/MeshReader.cpp) + # ================================================================================================== + # Includes and target definition + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + target_link_libraries(${TARGET} + PRIVATE meshoptimizer +diff --git a/libs/geometry/CMakeLists.txt b/libs/geometry/CMakeLists.txt +index aa9b5b1db..9393748a3 100644 +--- a/libs/geometry/CMakeLists.txt ++++ b/libs/geometry/CMakeLists.txt +@@ -23,7 +23,7 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + +@@ -35,7 +35,7 @@ set(GEOMETRY_DEPS + target_link_libraries(${TARGET} PUBLIC math utils) + target_link_libraries(${TARGET} PRIVATE ${GEOMETRY_DEPS}) + +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + # ================================================================================================== +diff --git a/libs/gltfio/CMakeLists.txt b/libs/gltfio/CMakeLists.txt +index 4d383dc8b..72ad8c9ab 100644 +--- a/libs/gltfio/CMakeLists.txt ++++ b/libs/gltfio/CMakeLists.txt +@@ -171,19 +171,19 @@ set(DUMMY_SRC "${RESOURCE_DIR}/dummy.c") + add_custom_command(OUTPUT ${DUMMY_SRC} COMMAND echo "//" > ${DUMMY_SRC}) + + add_library(uberarchive ${DUMMY_SRC} ${RESGEN_SOURCE}) +-target_include_directories(uberarchive PUBLIC ${RESOURCE_DIR}) ++target_include_directories(uberarchive PUBLIC $$) + set_target_properties(uberarchive PROPERTIES FOLDER Libs) + + # ================================================================================================== + # Build the "core" library (no filamat) + # ================================================================================================== + +-include_directories(${PUBLIC_HDR_DIR} ${RESOURCE_DIR}) ++include_directories($$ $$) + link_libraries(math utils filament cgltf stb ktxreader geometry tsl uberzlib) + + add_library(gltfio_core STATIC ${PUBLIC_HDRS} ${SRCS}) + +-target_include_directories(gltfio_core PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(gltfio_core PUBLIC $$) + set_target_properties(gltfio_core PROPERTIES FOLDER Libs) + + target_compile_definitions(gltfio_core PUBLIC -DGLTFIO_DRACO_SUPPORTED=1) +@@ -205,7 +205,7 @@ if (NOT WEBGL AND NOT ANDROID AND NOT IOS) + # ================================================================================================== + add_library(${TARGET} STATIC ${PUBLIC_HDRS} src/JitShaderProvider.cpp) + target_link_libraries(${TARGET} PUBLIC filamat gltfio_core) +- target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++ target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + if (NOT MSVC) + target_compile_options(${TARGET} PRIVATE -Wno-deprecated-register) +diff --git a/libs/ibl/CMakeLists.txt b/libs/ibl/CMakeLists.txt +index 7027e6e91..bdb36af4d 100644 +--- a/libs/ibl/CMakeLists.txt ++++ b/libs/ibl/CMakeLists.txt +@@ -31,16 +31,16 @@ set(SRCS + # ================================================================================================== + # Target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} ${PUBLIC_HDRS} ${PRIVATE_HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + target_link_libraries(${TARGET} math utils) + + add_library(${TARGET}-lite ${PUBLIC_HDRS} ${PRIVATE_HDRS} ${SRCS}) + target_compile_definitions(${TARGET}-lite PUBLIC -DFILAMENT_IBL_LITE=1) +-target_include_directories(${TARGET}-lite PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET}-lite PUBLIC $$) + set_target_properties(${TARGET}-lite PROPERTIES FOLDER Libs) + target_link_libraries(${TARGET}-lite math utils) + +diff --git a/libs/iblprefilter/CMakeLists.txt b/libs/iblprefilter/CMakeLists.txt +index 23de8317b..cfe2fa673 100644 +--- a/libs/iblprefilter/CMakeLists.txt ++++ b/libs/iblprefilter/CMakeLists.txt +@@ -79,7 +79,7 @@ endif() + # Includes & target definition + # ================================================================================================== + # specify where our headers are +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + include_directories(${GENERATION_ROOT}) + include_directories(src) + +@@ -87,7 +87,7 @@ include_directories(src) + add_library(${TARGET} STATIC ${PRIVATE_HDRS} ${PUBLIC_HDRS} ${SRCS}) + + # specify where the public headers of this library are +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + # ================================================================================================== +diff --git a/libs/image/CMakeLists.txt b/libs/image/CMakeLists.txt +index ffb26a094..cbda74d74 100644 +--- a/libs/image/CMakeLists.txt ++++ b/libs/image/CMakeLists.txt +@@ -25,13 +25,13 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + + target_link_libraries(${TARGET} PUBLIC math utils) + +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + # ================================================================================================== +diff --git a/libs/imageio/CMakeLists.txt b/libs/imageio/CMakeLists.txt +index 47544655b..d813ef462 100644 +--- a/libs/imageio/CMakeLists.txt ++++ b/libs/imageio/CMakeLists.txt +@@ -8,11 +8,11 @@ set(PUBLIC_HDR_DIR include) + # Sources and headers + # ================================================================================================== + set(PUBLIC_HDRS +- include/imageio/BasisEncoder.h +- include/imageio/HDRDecoder.h +- include/imageio/ImageDecoder.h +- include/imageio/ImageDiffer.h +- include/imageio/ImageEncoder.h ++ $$/imageio/BasisEncoder.h ++ $$/imageio/HDRDecoder.h ++ $$/imageio/ImageDecoder.h ++ $$/imageio/ImageDiffer.h ++ $$/imageio/ImageEncoder.h + ) + + set(SRCS +@@ -26,11 +26,11 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + target_link_libraries(${TARGET} PUBLIC image math png tinyexr utils z basis_encoder) +diff --git a/libs/ktxreader/CMakeLists.txt b/libs/ktxreader/CMakeLists.txt +index 83a630ade..c3ecd3160 100644 +--- a/libs/ktxreader/CMakeLists.txt ++++ b/libs/ktxreader/CMakeLists.txt +@@ -20,13 +20,13 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + + target_link_libraries(${TARGET} PUBLIC utils image filament basis_transcoder) + +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + # ================================================================================================== +diff --git a/libs/matdbg/CMakeLists.txt b/libs/matdbg/CMakeLists.txt +index e58058548..05815da2e 100644 +--- a/libs/matdbg/CMakeLists.txt ++++ b/libs/matdbg/CMakeLists.txt +@@ -68,7 +68,7 @@ set_target_properties(matdbg_resources PROPERTIES FOLDER Libs) + # Include and target definitions + # ================================================================================================== + +-include_directories(${PUBLIC_HDR_DIR} ${RESOURCE_DIR}) ++include_directories($$ ${RESOURCE_DIR}) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + +@@ -88,7 +88,7 @@ target_link_libraries(${TARGET} PUBLIC + + target_include_directories(${TARGET} PRIVATE ${filamat_SOURCE_DIR}/src) + +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + # ================================================================================================== +diff --git a/libs/math/CMakeLists.txt b/libs/math/CMakeLists.txt +index 838aa2d53..52ad60c8d 100644 +--- a/libs/math/CMakeLists.txt ++++ b/libs/math/CMakeLists.txt +@@ -37,11 +37,11 @@ set(SRCS src/dummy.cpp) + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + target_compile_options(${TARGET} PRIVATE ${OPTIMIZATION_FLAGS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + # ================================================================================================== +diff --git a/libs/mathio/CMakeLists.txt b/libs/mathio/CMakeLists.txt +index 4ad5126fc..d612e27d8 100644 +--- a/libs/mathio/CMakeLists.txt ++++ b/libs/mathio/CMakeLists.txt +@@ -16,11 +16,11 @@ set(SRCS src/ostream.cpp) + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + target_compile_options(${TARGET} PRIVATE ${OPTIMIZATION_FLAGS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + target_link_libraries(${TARGET} PRIVATE math) + +diff --git a/libs/uberz/CMakeLists.txt b/libs/uberz/CMakeLists.txt +index e73e724d3..bee0ac639 100644 +--- a/libs/uberz/CMakeLists.txt ++++ b/libs/uberz/CMakeLists.txt +@@ -21,13 +21,13 @@ set(SRCS + # ================================================================================================== + # Include and target definitions + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + + target_link_libraries(${TARGET} PUBLIC math utils filabridge zstd) + +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + # ================================================================================================== +diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt +index d2f96fe6c..b3fec04af 100644 +--- a/libs/utils/CMakeLists.txt ++++ b/libs/utils/CMakeLists.txt +@@ -100,10 +100,10 @@ endif() + # ================================================================================================== + # Includes and target definition + # ================================================================================================== +-include_directories(${PUBLIC_HDR_DIR}) ++include_directories($$) + + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + target_link_libraries(${TARGET} PUBLIC tsl) + +diff --git a/libs/viewer/CMakeLists.txt b/libs/viewer/CMakeLists.txt +index cfc969988..c4b483339 100644 +--- a/libs/viewer/CMakeLists.txt ++++ b/libs/viewer/CMakeLists.txt +@@ -31,7 +31,7 @@ set(SRCS + # ================================================================================================== + add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) + target_link_libraries(${TARGET} PUBLIC imgui filament gltfio_core filagui jsmn civetweb) +-target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) ++target_include_directories(${TARGET} PUBLIC $$) + set_target_properties(${TARGET} PROPERTIES FOLDER Libs) + + if (FILAMENT_SAMPLES_STEREO_TYPE STREQUAL "instanced") +-- +2.44.0 + diff --git a/pkgs/by-name/fi/filament/package.nix b/pkgs/by-name/fi/filament/package.nix new file mode 100644 index 0000000000000..dde6fa04352f9 --- /dev/null +++ b/pkgs/by-name/fi/filament/package.nix @@ -0,0 +1,157 @@ +{ + lib, + clangStdenv, + fetchFromGitHub, + cmake, + assimp, + libGL, + python3Packages, + spirv-tools, + spirv-cross, + spirv-headers, + glslang, + draco, + gtest, + robin-map, + meshoptimizer, + xorg, + imgui, + stb, +}: + +clangStdenv.mkDerivation rec { + pname = "filament"; + version = "1.52.3"; + + src = fetchFromGitHub { + owner = "google"; + repo = "filament"; + rev = "v${version}"; + hash = "sha256-hKyyYSGvQnaS8vnYkm92PiSeMvjcIXza11ZvymhC+zk="; + }; + + patches = [ ./0002-cmake-relocatable-target_include_directories.patch ]; + + extraFindPackages = '' + find_package(tsl-robin-map REQUIRED GLOBAL) + add_library(tsl ALIAS tsl::robin_map) + + find_package(draco REQUIRED GLOBAL) + add_library(dracodec ALIAS draco::draco_static) + + # find_package(SPIRV-Tools REQUIRED GLOBAL) + # find_package(spirv_cross_core REQUIRED GLOBAL) + # find_package(spirv_cross_glsl REQUIRED GLOBAL) + # find_package(spirv_cross_msl REQUIRED GLOBAL) + # find_package(glslang REQUIRED GLOBAL) + ''; + + postPatch = '' + # Hard-codes libc++ for no reason, then fails with a warning-error about + # the unused -stdlib argument + sed -i 's/^.*libc++.*$//' CMakeLists.txt + + # Upstream vendors everything in the good world, + # but most of the time their target_link_libraries() works + # out of the box with out buildInputs simply because the sonames match + sed -i 's/^.*add_subdirectory.*EXTERNAL.*\(${ + lib.concatStringsSep "\\|" [ + # "assimp" + # "stb" + "draco" + # "meshoptimizer" + "robin-map" + # They vendor an outdated imgui with different interfaces + # "imgui" + "libgtest" + # "spirv-tools" + # "glslang" + # "spirv-cross" + ] + }\).*$//' CMakeLists.txt + + substituteInPlace CMakeLists.txt \ + --replace-fail "# Sub-projects" "# Sub-projects + $extraFindPackages" + + # Uses the otherwise undeclared uint32_t: + sed -i "1i#include " tools/glslminifier/src/GlslMinify.h + + # An undeclared snprintf + sed -i "1i#include " third_party/vkmemalloc/tnt/../include/vk_mem_alloc.h + + # std::memcpy + sed -i "1i#include " libs/gltfio/src/extended/TangentsJobExtended.cpp + + # Add a detailed trace to an otherwise obscure script + sed -i "2iset -x" build/linux/combine-static-libs.sh + + # Otherwise CMake fails to execute build/linux/combine-static-libs.sh + patchShebangs . + + while IFS= read -r -d $'\0' path ; do + sed -i "s/$installTargetsPattern/\1 EXPORT filament_target /" "$path" + done < <( find libs/ -iname CMakeLists.txt -print0 ) + + grep "install(TARGETS" $(find -iname CMakeLists.txt) + + cat << \EOF >> CMakeLists.txt + include(CMakePackageConfigHelpers) + configure_package_config_file(filament-config.cmake.in filament-config.cmake INSTALL_DESTINATION ''${CMAKE_INSTALL_LIBDIR}/cmake/filament) + install( + EXPORT filament_target FILE filament-targets.cmake + DESTINATION ''${CMAKE_INSTALL_LIBDIR}/cmake/''${PROJECT_NAME}) + EOF + cat << \EOF >> filament-config.cmake.in + include("''${CMAKE_CURRENT_LIST_DIR}/imgui-targets.cmake") + EOF + + cat libs/filameshio/CMakeLists.txt + ''; + + # installTargetsPattern = ''\(install(TARGETS[[:space:]]\+\([$][^$)[:space:]]\+\|[^)A-Z]\+\)\+[^)A-Z]*\)''; + installTargetsPattern = ''\(install(TARGETS[[:space:]]\+\([$][{]\?[^$)[:space:]]\+[}]\?[^[:space:])]*\|[^$}{)A-Z]\+\)[[:space:]]*\)''; + + nativeBuildInputs = [ + cmake + python3Packages.python + spirv-tools + spirv-cross + ]; + buildInputs = + [ + spirv-headers + glslang + # assimp + stb + draco + gtest + robin-map + meshoptimizer + # imgui + ] + ++ lib.optionals clangStdenv.hostPlatform.isLinux [ + libGL + xorg.libX11 + xorg.libXext + xorg.libXi + xorg.libXxf86vm + ]; + + # Upstream hard-codes -Werror someplace that's hard to identify + NIX_CFLAGS_COMPILE = [ "-Wno-error" ]; + + cmakeFlags = [ + # https://github.com/isl-org/Open3D/blob/f7161f4949d1a9c2b016899d2f8c7bdbfd6bf6f9/3rdparty/filament/filament_build.cmake#L74C11-L74C50 + (lib.cmakeFeature "FILAMENT_OPENGL_HANDLE_ARENA_SIZE_IN_MB" "20") + ]; + + meta = with lib; { + description = "Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2"; + homepage = "https://github.com/google/filament"; + license = licenses.asl20; + maintainers = with maintainers; [ ]; + mainProgram = "filament"; + platforms = platforms.all; + }; +} diff --git a/pkgs/by-name/li/liblzf/package.nix b/pkgs/by-name/li/liblzf/package.nix new file mode 100644 index 0000000000000..c4434fad063f7 --- /dev/null +++ b/pkgs/by-name/li/liblzf/package.nix @@ -0,0 +1,14 @@ +{ + stdenv, + fetchzip, +}: + +stdenv.mkDerivation { + name = "liblzf"; + src = fetchzip { + urls = [ + "http://dist.schmorp.de/liblzf/Attic/liblzf-3.6.tar.gz" + ]; + hash = "sha256-m5MZfYAT9AtAXh2zk3lZasTfTGVbY8KWnyeftMaLanQ="; + }; +} diff --git a/pkgs/by-name/op/open3d/package.nix b/pkgs/by-name/op/open3d/package.nix new file mode 100644 index 0000000000000..29ca145fc7625 --- /dev/null +++ b/pkgs/by-name/op/open3d/package.nix @@ -0,0 +1,135 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + withPython ? false, + ispc, + jsoncpp, + vulkan-loader, + vulkan-headers, + glfw3, + xorg, + assimp, + blas, + curl, + eigen, + embree, + glew, + imgui, + nasm, + libjpeg, + filament, + libjpeg_turbo, + libpng, + libz, + liblzf, + msgpack, + nanoflann, + boringssl, + qhull, + stdgpu, + tbb, + draco, + vtk, + zeromq, + config, + cudaSupport ? false, +}: + +let + buildPkg = p: p.__spliced.buildHost or p; +in + +stdenv.mkDerivation rec { + pname = "open3d"; + version = "0.18.0"; + + src = fetchFromGitHub { + owner = "isl-org"; + repo = "Open3D"; + rev = "v${version}"; + hash = "sha256-VMykWYfWUzhG+Db1I/9D1GTKd3OzmSXvwzXwaZnu8uI="; + }; + + postPatch = '' + substituteInPlace "cmake/Open3DFetchISPCCompiler.cmake" \ + --replace-fail \ + 'DOWNLOAD_DIR "''${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/ispc"' \ + ' + DOWNLOAD_DIR "''${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/ispc" + FIND_PACKAGE_ARGS ispc + ' + cat << \EOF > 3rdparty/jsoncpp/jsoncpp.cmake + find_package(jsoncpp REQUIRED) + add_library(jsoncpp ALIAS jsoncpp_lib) + EOF + ''; + + nativeBuildInputs = [ + cmake + ispc + nasm + ]; + + buildInputs = [ + jsoncpp + assimp + blas + curl + eigen + embree + glew + glfw3 + imgui + libjpeg + libjpeg_turbo + libpng + msgpack + nanoflann + boringssl + qhull + tbb + draco # tinygltf + vtk + vulkan-headers + vulkan-loader + xorg.libX11 + xorg.libXrandr + xorg.libXinerama + xorg.libXcursor + zeromq + libz + liblzf + filament + ] ++ lib.optionals cudaSupport [ stdgpu ]; + + preConfigure = '' + # Set all of the USE_SYSTEM_* variables + while IFS= read name ; do + cmakeFlags+=" -D''${name}:BOOL=ON" + done < <(grep '\bUSE_SYSTEM[_a-zA-Z0-9]\+\b' --only-matching CMakeLists.txt) + export cmakeFlags + ''; + + cmakeFlags = [ + (lib.cmakeBool "BUILD_PYTHON_MODULE" withPython) + (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) + (lib.cmakeFeature "FETCHCONTENT_TRY_FIND_PACKAGE_MODE" "ALWAYS") + (lib.cmakeFeature "CMAKE_ISPC_COMPILER" (lib.getExe (buildPkg ispc))) + (lib.cmakeFeature "BORINGSSL_ROOT_DIR" "${lib.getDev boringssl}") + + # Doesn't seem to generate a `*Config.cmake` file + (lib.cmakeFeature "filament_DIR" "${lib.getDev filament}") + ]; + + meta = { + description = "Open3D: A Modern Library for 3D Data Processing"; + homepage = "https://github.com/isl-org/Open3D/"; + changelog = "https://github.com/isl-org/Open3D/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ SomeoneSerge ]; + mainProgram = "open3d"; + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/by-name/st/stdgpu/package.nix b/pkgs/by-name/st/stdgpu/package.nix new file mode 100644 index 0000000000000..dedbfb3dd6a8c --- /dev/null +++ b/pkgs/by-name/st/stdgpu/package.nix @@ -0,0 +1,30 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, +}: + +stdenv.mkDerivation rec { + pname = "stdgpu"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "stotko"; + repo = "stdgpu"; + rev = version; + hash = "sha256-avjNeo5E/ENIVqpe+VxvH6QmbA3OVJ7TPjLUSt1qWkY="; + }; + + nativeBuildInputs = [ cmake ]; + + meta = { + description = "Stdgpu: Efficient STL-like Data Structures on the GPU"; + homepage = "https://github.com/stotko/stdgpu"; + changelog = "https://github.com/stotko/stdgpu/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ SomeoneSerge ]; + mainProgram = "stdgpu"; + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/development/libraries/boringssl/default.nix b/pkgs/development/libraries/boringssl/default.nix index 9bb0967bd5c6e..30e9bf71d98ba 100644 --- a/pkgs/development/libraries/boringssl/default.nix +++ b/pkgs/development/libraries/boringssl/default.nix @@ -43,17 +43,25 @@ buildGoModule { # CMAKE_OSX_ARCHITECTURES is set to x86_64 by Nix, but it confuses boringssl on aarch64-linux. cmakeFlags = [ "-GNinja" ] ++ lib.optionals (stdenv.isLinux) [ "-DCMAKE_OSX_ARCHITECTURES=" ]; - installPhase = '' - mkdir -p $bin/bin $dev $out/lib + installPhase = "ninjaInstallPhase"; + postInstall = '' + [[ -d ''${!outputDev}/include ]] || exit 1 + [[ -f ''${!outputBin}/bin/bssl ]] || exit 1 + [[ -f ''${!outputLib}/lib/libssl.a ]] || exit 1 + [[ -f ''${!outputLib}/lib/libcrypto.a ]] || exit 1 + install --mode=444 decrepit/libdecrepit.a ''${!outputLib}/lib/libdecrepit.a + ''; + # installPhase = '' + # mkdir -p $bin/bin $dev $out/lib - mv tool/bssl $bin/bin + # mv tool/bssl $bin/bin - mv ssl/libssl.a $out/lib - mv crypto/libcrypto.a $out/lib - mv decrepit/libdecrepit.a $out/lib + # mv ssl/libssl.a $out/lib + # mv crypto/libcrypto.a $out/lib + # mv decrepit/libdecrepit.a $out/lib - mv ../include $dev - ''; + # mv ../include $dev + # ''; outputs = [ "out" "bin" "dev" ]; diff --git a/pkgs/development/python-modules/fpsample/default.nix b/pkgs/development/python-modules/fpsample/default.nix new file mode 100644 index 0000000000000..476e17f304e55 --- /dev/null +++ b/pkgs/development/python-modules/fpsample/default.nix @@ -0,0 +1,48 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + cargo, + patchelf, + rustPlatform, + rustc, + numpy, +}: + +buildPythonPackage rec { + pname = "fpsample"; + version = "0.3.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "leonardodalinky"; + repo = "fpsample"; + rev = "v${version}"; + hash = "sha256-3Z5CZsnXjVFYkUBs1hTNuMCr60HUHSgLueq6Ew0EgiI="; + }; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-rwy+co9QiURje0yj7/dw5wrgt/KMWO6DKHqWKcUwbYU="; + }; + + nativeBuildInputs = [ + cargo + patchelf + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + rustc + ]; + + dependencies = [ numpy ]; + + pythonImportsCheck = [ "fpsample" ]; + + meta = { + description = "Python efficient farthest point sampling (FPS) library. Compatible with numpy"; + homepage = "https://github.com/leonardodalinky/fpsample"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ SomeoneSerge ]; + }; +} diff --git a/pkgs/development/python-modules/gsplat/default.nix b/pkgs/development/python-modules/gsplat/default.nix new file mode 100644 index 0000000000000..4bc3eef05ddc4 --- /dev/null +++ b/pkgs/development/python-modules/gsplat/default.nix @@ -0,0 +1,39 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + wheel, + glm, +}: + +buildPythonPackage rec { + pname = "gsplat"; + version = "1.0.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "nerfstudio-project"; + repo = "gsplat"; + rev = "v${version}"; + hash = "sha256-nORMH0KIeK4yQn6RSzF7Wf11WaV8mPPQKgfe5RZEvWU="; + }; + + build-system = [ + setuptools + wheel + ]; + + buildInputs = [ + glm + ]; + + pythonImportsCheck = [ "gsplat" ]; + + meta = with lib; { + description = "CUDA accelerated rasterization of gaussian splatting"; + homepage = "https://github.com/nerfstudio-project/gsplat"; + license = licenses.asl20; + maintainers = with maintainers; [ ]; + }; +} diff --git a/pkgs/development/python-modules/nerfacc/default.nix b/pkgs/development/python-modules/nerfacc/default.nix new file mode 100644 index 0000000000000..70cb65daf45b4 --- /dev/null +++ b/pkgs/development/python-modules/nerfacc/default.nix @@ -0,0 +1,66 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + stdenv, + wheel, + which, + torch, + rich, + typing-extensions, + config, + cudaSupport ? config.cudaSupport, + cudaPackages, +}: + +buildPythonPackage rec { + pname = "nerfacc"; + version = "0.5.3"; + pyproject = true; + stdenv = if cudaSupport then cudaPackages.backendStdenv else stdenv; + + src = fetchFromGitHub { + owner = "nerfstudio-project"; + repo = "nerfacc"; + rev = "v${version}"; + hash = "sha256-bXN4R+INs+RTjTkH2QbcZ97T9/rRyE2VwZvEeqYyY4M="; + }; + + build-system = [ + setuptools + wheel + ]; + + nativeBuildInputs = lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + which + ]; + + dependencies = [ + torch + rich + typing-extensions + ]; + + buildInputs = [ (lib.getOutput "cxxdev" torch) ]; + + env = + { + BUILD_NO_CUDA = if cudaSupport then "0" else "1"; + } + // lib.optionalAttrs cudaSupport { + CUDA_HOME = "${cudaPackages.cuda_nvcc.__spliced.buildHost or cudaPackages.cuda_nvcc}"; + TORCH_CUDA_ARCH_LIST = "${lib.concatStringsSep ";" torch.cudaCapabilities}"; + }; + + pythonImportsCheck = [ "nerfacc" ]; + + meta = { + description = "A General NeRF Acceleration Toolbox in PyTorch"; + homepage = "https://github.com/nerfstudio-project/nerfacc"; + changelog = "https://github.com/nerfstudio-project/nerfacc/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ SomeoneSerge ]; + }; +} diff --git a/pkgs/development/python-modules/nerfstudio/default.nix b/pkgs/development/python-modules/nerfstudio/default.nix new file mode 100644 index 0000000000000..945ea2b41f6b8 --- /dev/null +++ b/pkgs/development/python-modules/nerfstudio/default.nix @@ -0,0 +1,203 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + wheel, + appdirs, + av, + awscli, + comet-ml ? null, + cryptography, + fpsample, + gdown, + gsplat, + h5py, + imageio, + importlib-metadata, + ipywidgets, + jaxtyping, + jupyterlab, + matplotlib, + mediapy, + msgpack, + msgpack-numpy, + nerfacc, + newrawpy, + ninja, + nuscenes-devkit, + open3d, + opencv-python, + packaging, + pathos, + pillow, + plotly, + protobuf, + pymeshlab, + pyngrok, + pyquaternion, + python-socketio, + pytorch-msssim, + rawpy, + requests, + rich, + scikit-image, + splines, + tensorboard, + timm, + torch, + torchmetrics, + torchvision, + trimesh, + typing-extensions, + tyro, + viser, + wandb, + xatlas, + diffusers, + opencv-stubs, + pre-commit, + projectaria-tools, + pycolmap, + pyright, + pytest, + pytest-xdist, + ruff, + sshconf, + transformers, + typeguard, + furo, + ipython, + myst-nb, + nbconvert, + nbformat, + readthedocs-sphinx-search, + sphinx, + sphinx-argparse, + sphinx-copybutton, + sphinx-design, + sphinxemoji, + sphinxext-opengraph, + accelerate, + bitsandbytes, + sentencepiece, +}: + +buildPythonPackage rec { + pname = "nerfstudio"; + version = "1.1.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "nerfstudio-project"; + repo = "nerfstudio"; + rev = "v${version}"; + hash = "sha256-/RUzs/8gDxdel0L3Gif+1d2dpcUNAAYZuSwmHfhjZrI="; + }; + + build-system = [ + setuptools + wheel + ]; + + dependencies = [ + appdirs + av + awscli + comet-ml + cryptography + fpsample + gdown + gsplat + h5py + imageio + importlib-metadata + ipywidgets + jaxtyping + jupyterlab + matplotlib + mediapy + msgpack + msgpack-numpy + nerfacc + newrawpy + ninja + nuscenes-devkit + open3d + opencv-python + packaging + pathos + pillow + plotly + protobuf + pymeshlab + pyngrok + pyquaternion + python-socketio + pytorch-msssim + rawpy + requests + rich + scikit-image + splines + tensorboard + timm + torch + torchmetrics + torchvision + trimesh + typing-extensions + tyro + viser + wandb + xatlas + ]; + + passthru.optional-dependencies = { + dev = [ + diffusers + opencv-stubs + pre-commit + projectaria-tools + pycolmap + pyright + pytest + pytest-xdist + ruff + sshconf + torch + transformers + typeguard + ]; + docs = [ + furo + ipython + myst-nb + nbconvert + nbformat + readthedocs-sphinx-search + sphinx + sphinx-argparse + sphinx-copybutton + sphinx-design + sphinxemoji + sphinxext-opengraph + ]; + gen = [ + accelerate + bitsandbytes + diffusers + sentencepiece + transformers + ]; + }; + + pythonImportsCheck = [ "nerfstudio" ]; + + meta = { + description = "A collaboration friendly studio for NeRFs"; + homepage = "https://github.com/nerfstudio-project/nerfstudio"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ SomeoneSerge ]; + }; +} diff --git a/pkgs/development/python-modules/newrawpy/default.nix b/pkgs/development/python-modules/newrawpy/default.nix new file mode 100644 index 0000000000000..7b0d4d6b58bb4 --- /dev/null +++ b/pkgs/development/python-modules/newrawpy/default.nix @@ -0,0 +1,39 @@ +# Introduced as a dependency for python3Packages.nerfstudio + +{ lib +, buildPythonPackage +, fetchPypi +, setuptools +, wheel +, numpy +}: + +buildPythonPackage rec { + pname = "newrawpy"; + version = "1.0.0b0"; + pyproject = true; + + # Using PyPi because there are no git tags on GitHub + src = fetchPypi { + inherit pname version; + hash = "sha256-/oCrFqLMX3YNEsEwYFuUhGdGwXddJLQNg55PumVc5V8="; + }; + + build-system = [ + setuptools + wheel + ]; + + dependencies = [ + numpy + ]; + + pythonImportsCheck = [ "newrawpy" ]; + + meta = with lib; { + description = "RAW image processing for Python, a wrapper for libraw"; + homepage = "https://pypi.org/project/newrawpy/"; + license = licenses.unfree; # FIXME: nix-init did not found a license + maintainers = with maintainers; [ ]; + }; +} diff --git a/pkgs/development/python-modules/nuscenes-devkit/default.nix b/pkgs/development/python-modules/nuscenes-devkit/default.nix new file mode 100644 index 0000000000000..7903541b7f42a --- /dev/null +++ b/pkgs/development/python-modules/nuscenes-devkit/default.nix @@ -0,0 +1,68 @@ +# Introduced as a dependency for python3Packages.nerfstudio + +{ + lib, + stdenv, + fetchFromGitHub, + buildPythonPackage, + + setuptools, + wheel, + cachetools, + descartes, + fire, + matplotlib, + numpy, + opencv4, + pillow, + pyquaternion, + scikit-learn, + scipy, + shapely, + tqdm, + parameterized, +}: + +stdenv.mkDerivation rec { + pname = "nuscenes-devkit"; + version = "1.1.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "nutonomy"; + repo = "nuscenes-devkit"; + rev = version; + hash = "sha256-1EW/9KZskWI+BXhHs2aiX+OfiJY3aGrqyRweQ7gTLZU="; + }; + + sourceRoot = "${src.name}/setup"; + + build-system = [ + setuptools + wheel + ]; + + dependencies = [ + cachetools + descartes + fire + matplotlib + numpy + opencv4 + pillow + pyquaternion + scikit-learn + scipy + shapely + tqdm + parameterized + ]; + + meta = { + description = "The devkit of the nuScenes dataset"; + homepage = "https://github.com/nutonomy/nuscenes-devkit"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ SomeoneSerge ]; + mainProgram = "nuscenes-devkit"; + }; +} diff --git a/pkgs/tools/graphics/spirv-cross/default.nix b/pkgs/tools/graphics/spirv-cross/default.nix index aec81ac9c4063..89cd1ad25adb1 100644 --- a/pkgs/tools/graphics/spirv-cross/default.nix +++ b/pkgs/tools/graphics/spirv-cross/default.nix @@ -11,6 +11,14 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-UEXKzx1NXCInOnI96Z1hfrpyoWdb3BOGEKstX1gVzIo="; }; + # Modify the cmake export's installation path for cmake's setup hook to detect it + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace \ + ' ''${CMAKE_INSTALL_DATAROOTDIR}/''${config_name}/cmake' \ + ' ''${CMAKE_INSTALL_DATAROOTDIR}/cmake/''${config_name}' + ''; + nativeBuildInputs = [ cmake python3 ]; postFixup = '' diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ed6b0afba04ee..139e4c9d63742 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4532,6 +4532,8 @@ self: super: with self; { fpdf2 = callPackage ../development/python-modules/fpdf2 { }; + fpsample = callPackage ../development/python-modules/fpsample { }; + fpylll = callPackage ../development/python-modules/fpylll { }; fpyutils = callPackage ../development/python-modules/fpyutils { }; @@ -5212,6 +5214,8 @@ self: super: with self; { gsm0338 = callPackage ../development/python-modules/gsm0338 { }; + gsplat = callPackage ../development/python-modules/gsplat { }; + gspread = callPackage ../development/python-modules/gspread { }; gssapi = callPackage ../development/python-modules/gssapi { @@ -8762,6 +8766,10 @@ self: super: with self; { neoteroi-mkdocs = callPackage ../development/python-modules/neoteroi-mkdocs { }; + nerfacc = callPackage ../development/python-modules/nerfacc { }; + + nerfstudio = callPackage ../development/python-modules/nerfstudio { }; + nessclient = callPackage ../development/python-modules/nessclient { }; nest = toPythonModule(pkgs.nest-mpi.override { withPython = true; python3 = python; }); @@ -8808,6 +8816,8 @@ self: super: with self; { newick = callPackage ../development/python-modules/newick { }; + newrawpy = callPackage ../development/python-modules/newrawpy { }; + nexia = callPackage ../development/python-modules/nexia { }; nextcloudmonitor = callPackage ../development/python-modules/nextcloudmonitor { }; @@ -9012,6 +9022,8 @@ self: super: with self; { nunavut = callPackage ../development/python-modules/nunavut { }; + nuscenes-devkit = callPackages ../development/python-modules/nuscenes-devkit { }; + nutils = callPackage ../development/python-modules/nutils { }; nvchecker = callPackage ../development/python-modules/nvchecker { }; From cec46d3b0693f4d3603cd270e234d57b0acccb49 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Mon, 17 Jun 2024 19:18:35 +0000 Subject: [PATCH 2/8] fixup! nerfstudio: init at 1.1.2 --- pkgs/by-name/di/directxmath/package.nix | 36 ++ ...locatable-target_include_directories.patch | 490 ------------------ pkgs/by-name/fi/filament/package.nix | 55 +- pkgs/by-name/li/liblzf/package.nix | 11 + ...1-cmake-correct-msgpack-package-name.patch | 25 + pkgs/by-name/op/open3d/Findfilament.cmake | 66 +++ pkgs/by-name/op/open3d/Findliblzf.cmake | 18 + pkgs/by-name/op/open3d/package.nix | 30 +- pkgs/by-name/uv/uvatlas/package.nix | 36 ++ .../libraries/directx-headers/default.nix | 77 ++- pkgs/development/libraries/draco/default.nix | 5 +- 11 files changed, 303 insertions(+), 546 deletions(-) create mode 100644 pkgs/by-name/di/directxmath/package.nix delete mode 100644 pkgs/by-name/fi/filament/0002-cmake-relocatable-target_include_directories.patch create mode 100644 pkgs/by-name/op/open3d/0001-cmake-correct-msgpack-package-name.patch create mode 100644 pkgs/by-name/op/open3d/Findfilament.cmake create mode 100644 pkgs/by-name/op/open3d/Findliblzf.cmake create mode 100644 pkgs/by-name/uv/uvatlas/package.nix diff --git a/pkgs/by-name/di/directxmath/package.nix b/pkgs/by-name/di/directxmath/package.nix new file mode 100644 index 0000000000000..6ed5a1897d5b7 --- /dev/null +++ b/pkgs/by-name/di/directxmath/package.nix @@ -0,0 +1,36 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + open3d, +}: + +stdenv.mkDerivation rec { + pname = "directxmath"; + version = "2024-02"; + + src = fetchFromGitHub { + owner = "microsoft"; + repo = "DirectXMath"; + rev = "feb2024"; + hash = "sha256-BXiI6h3rGRwDjOXMm6OLSgxXVZJnmAZ4wTFZL2RrwRA="; + }; + + nativeBuildInputs = [ cmake ]; + + # WSL stubs taken from + # https://github.com/isl-org/Open3D/blob/ad17a26332d93c0de4bd67218d0134c9deab7b93/3rdparty/uvatlas/uvatlas.cmake#L44-L46 + postInstall = '' + cp ${open3d.src}/3rdparty/uvatlas/sal.h "''${!outputDev}/include/directxmath/" + ''; + + meta = { + description = "DirectXMath is an all inline SIMD C++ linear algebra library for use in games and graphics apps"; + homepage = "https://github.com/microsoft/DirectXMath"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ SomeoneSerge ]; + mainProgram = "directxmath"; + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/by-name/fi/filament/0002-cmake-relocatable-target_include_directories.patch b/pkgs/by-name/fi/filament/0002-cmake-relocatable-target_include_directories.patch deleted file mode 100644 index 8e2bd47e5cfb9..0000000000000 --- a/pkgs/by-name/fi/filament/0002-cmake-relocatable-target_include_directories.patch +++ /dev/null @@ -1,490 +0,0 @@ -From 9846c94c84c9986855e785833a4d5f8803abd043 Mon Sep 17 00:00:00 2001 -From: Someone Serge -Date: Sat, 15 Jun 2024 23:33:27 +0000 -Subject: [PATCH 2/2] cmake: relocatable target_include_directories() - ---- - libs/bluegl/CMakeLists.txt | 4 ++-- - libs/bluevk/CMakeLists.txt | 4 ++-- - libs/camutils/CMakeLists.txt | 4 ++-- - libs/filabridge/CMakeLists.txt | 4 ++-- - libs/filaflat/CMakeLists.txt | 4 ++-- - libs/filagui/CMakeLists.txt | 4 ++-- - libs/filamat/CMakeLists.txt | 4 ++-- - libs/filamentapp/CMakeLists.txt | 4 ++-- - libs/filameshio/CMakeLists.txt | 4 ++-- - libs/geometry/CMakeLists.txt | 4 ++-- - libs/gltfio/CMakeLists.txt | 8 ++++---- - libs/ibl/CMakeLists.txt | 6 +++--- - libs/iblprefilter/CMakeLists.txt | 4 ++-- - libs/image/CMakeLists.txt | 4 ++-- - libs/imageio/CMakeLists.txt | 14 +++++++------- - libs/ktxreader/CMakeLists.txt | 4 ++-- - libs/matdbg/CMakeLists.txt | 4 ++-- - libs/math/CMakeLists.txt | 4 ++-- - libs/mathio/CMakeLists.txt | 4 ++-- - libs/uberz/CMakeLists.txt | 4 ++-- - libs/utils/CMakeLists.txt | 4 ++-- - libs/viewer/CMakeLists.txt | 2 +- - 22 files changed, 51 insertions(+), 51 deletions(-) - -diff --git a/libs/bluegl/CMakeLists.txt b/libs/bluegl/CMakeLists.txt -index 02a3676c9..0e9880b72 100644 ---- a/libs/bluegl/CMakeLists.txt -+++ b/libs/bluegl/CMakeLists.txt -@@ -45,13 +45,13 @@ else() - endif() - - # specify where our headers are --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - # we're building a library - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - - # specify where the public headers of this library are --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - if (WIN32) -diff --git a/libs/bluevk/CMakeLists.txt b/libs/bluevk/CMakeLists.txt -index bc5986e64..2eb626612 100644 ---- a/libs/bluevk/CMakeLists.txt -+++ b/libs/bluevk/CMakeLists.txt -@@ -19,13 +19,13 @@ else() - message(FATAL_ERROR "Platform not supported. BlueVK supports Linux, Android, MacOS X, and Windows.") - endif() - --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - - target_link_libraries(${TARGET} utils math) - --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - # test_bluevk is not supported on mobile or Windows -diff --git a/libs/camutils/CMakeLists.txt b/libs/camutils/CMakeLists.txt -index 97ed05f74..7097a4c87 100644 ---- a/libs/camutils/CMakeLists.txt -+++ b/libs/camutils/CMakeLists.txt -@@ -24,13 +24,13 @@ set(SRCS - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - - target_link_libraries(${TARGET} PUBLIC math) - --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - # ================================================================================================== -diff --git a/libs/filabridge/CMakeLists.txt b/libs/filabridge/CMakeLists.txt -index 515103320..06e5f961e 100644 ---- a/libs/filabridge/CMakeLists.txt -+++ b/libs/filabridge/CMakeLists.txt -@@ -18,10 +18,10 @@ set(SRCS - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - target_link_libraries(${TARGET} utils) -diff --git a/libs/filaflat/CMakeLists.txt b/libs/filaflat/CMakeLists.txt -index 378c31c8a..d6b586403 100644 ---- a/libs/filaflat/CMakeLists.txt -+++ b/libs/filaflat/CMakeLists.txt -@@ -18,10 +18,10 @@ set(SRCS - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} ${HDRS} ${SRCS}) --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - target_link_libraries(${TARGET} filabridge utils) -diff --git a/libs/filagui/CMakeLists.txt b/libs/filagui/CMakeLists.txt -index 55f3d867f..395f287ac 100644 ---- a/libs/filagui/CMakeLists.txt -+++ b/libs/filagui/CMakeLists.txt -@@ -81,14 +81,14 @@ list(APPEND RESGEN_SOURCE ${DUMMY_SRC}) - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - include_directories(${GENERATION_ROOT}) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS} ${RESGEN_SOURCE}) - - target_link_libraries(${TARGET} PUBLIC imgui filament) - --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - # ================================================================================================== -diff --git a/libs/filamat/CMakeLists.txt b/libs/filamat/CMakeLists.txt -index 2fc20d7e9..40dbf1935 100644 ---- a/libs/filamat/CMakeLists.txt -+++ b/libs/filamat/CMakeLists.txt -@@ -77,12 +77,12 @@ set(SRCS - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - include_directories(${CMAKE_BINARY_DIR}) - - # Filamat - add_library(${TARGET} STATIC ${HDRS} ${PRIVATE_HDRS} ${SRCS}) --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - target_link_libraries(${TARGET} shaders filabridge utils smol-v) - -diff --git a/libs/filamentapp/CMakeLists.txt b/libs/filamentapp/CMakeLists.txt -index 2e0e95b7d..625d23248 100644 ---- a/libs/filamentapp/CMakeLists.txt -+++ b/libs/filamentapp/CMakeLists.txt -@@ -136,13 +136,13 @@ set_target_properties(filamentapp-resources PROPERTIES FOLDER Samples/Resources) - # Include and target definitions - # ================================================================================================== - --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - - target_link_libraries(${TARGET} PUBLIC ${LIBS} filamentapp-resources) - --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - target_include_directories(${TARGET} PRIVATE ${GENERATION_ROOT}) - -diff --git a/libs/filameshio/CMakeLists.txt b/libs/filameshio/CMakeLists.txt -index 61847cd51..df1c7c6fa 100644 ---- a/libs/filameshio/CMakeLists.txt -+++ b/libs/filameshio/CMakeLists.txt -@@ -18,9 +18,9 @@ set(SRCS src/MeshReader.cpp) - # ================================================================================================== - # Includes and target definition - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - target_link_libraries(${TARGET} - PRIVATE meshoptimizer -diff --git a/libs/geometry/CMakeLists.txt b/libs/geometry/CMakeLists.txt -index aa9b5b1db..9393748a3 100644 ---- a/libs/geometry/CMakeLists.txt -+++ b/libs/geometry/CMakeLists.txt -@@ -23,7 +23,7 @@ set(SRCS - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - -@@ -35,7 +35,7 @@ set(GEOMETRY_DEPS - target_link_libraries(${TARGET} PUBLIC math utils) - target_link_libraries(${TARGET} PRIVATE ${GEOMETRY_DEPS}) - --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - # ================================================================================================== -diff --git a/libs/gltfio/CMakeLists.txt b/libs/gltfio/CMakeLists.txt -index 4d383dc8b..72ad8c9ab 100644 ---- a/libs/gltfio/CMakeLists.txt -+++ b/libs/gltfio/CMakeLists.txt -@@ -171,19 +171,19 @@ set(DUMMY_SRC "${RESOURCE_DIR}/dummy.c") - add_custom_command(OUTPUT ${DUMMY_SRC} COMMAND echo "//" > ${DUMMY_SRC}) - - add_library(uberarchive ${DUMMY_SRC} ${RESGEN_SOURCE}) --target_include_directories(uberarchive PUBLIC ${RESOURCE_DIR}) -+target_include_directories(uberarchive PUBLIC $$) - set_target_properties(uberarchive PROPERTIES FOLDER Libs) - - # ================================================================================================== - # Build the "core" library (no filamat) - # ================================================================================================== - --include_directories(${PUBLIC_HDR_DIR} ${RESOURCE_DIR}) -+include_directories($$ $$) - link_libraries(math utils filament cgltf stb ktxreader geometry tsl uberzlib) - - add_library(gltfio_core STATIC ${PUBLIC_HDRS} ${SRCS}) - --target_include_directories(gltfio_core PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(gltfio_core PUBLIC $$) - set_target_properties(gltfio_core PROPERTIES FOLDER Libs) - - target_compile_definitions(gltfio_core PUBLIC -DGLTFIO_DRACO_SUPPORTED=1) -@@ -205,7 +205,7 @@ if (NOT WEBGL AND NOT ANDROID AND NOT IOS) - # ================================================================================================== - add_library(${TARGET} STATIC ${PUBLIC_HDRS} src/JitShaderProvider.cpp) - target_link_libraries(${TARGET} PUBLIC filamat gltfio_core) -- target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+ target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - if (NOT MSVC) - target_compile_options(${TARGET} PRIVATE -Wno-deprecated-register) -diff --git a/libs/ibl/CMakeLists.txt b/libs/ibl/CMakeLists.txt -index 7027e6e91..bdb36af4d 100644 ---- a/libs/ibl/CMakeLists.txt -+++ b/libs/ibl/CMakeLists.txt -@@ -31,16 +31,16 @@ set(SRCS - # ================================================================================================== - # Target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} ${PUBLIC_HDRS} ${PRIVATE_HDRS} ${SRCS}) --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - target_link_libraries(${TARGET} math utils) - - add_library(${TARGET}-lite ${PUBLIC_HDRS} ${PRIVATE_HDRS} ${SRCS}) - target_compile_definitions(${TARGET}-lite PUBLIC -DFILAMENT_IBL_LITE=1) --target_include_directories(${TARGET}-lite PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET}-lite PUBLIC $$) - set_target_properties(${TARGET}-lite PROPERTIES FOLDER Libs) - target_link_libraries(${TARGET}-lite math utils) - -diff --git a/libs/iblprefilter/CMakeLists.txt b/libs/iblprefilter/CMakeLists.txt -index 23de8317b..cfe2fa673 100644 ---- a/libs/iblprefilter/CMakeLists.txt -+++ b/libs/iblprefilter/CMakeLists.txt -@@ -79,7 +79,7 @@ endif() - # Includes & target definition - # ================================================================================================== - # specify where our headers are --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - include_directories(${GENERATION_ROOT}) - include_directories(src) - -@@ -87,7 +87,7 @@ include_directories(src) - add_library(${TARGET} STATIC ${PRIVATE_HDRS} ${PUBLIC_HDRS} ${SRCS}) - - # specify where the public headers of this library are --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - # ================================================================================================== -diff --git a/libs/image/CMakeLists.txt b/libs/image/CMakeLists.txt -index ffb26a094..cbda74d74 100644 ---- a/libs/image/CMakeLists.txt -+++ b/libs/image/CMakeLists.txt -@@ -25,13 +25,13 @@ set(SRCS - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - - target_link_libraries(${TARGET} PUBLIC math utils) - --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - # ================================================================================================== -diff --git a/libs/imageio/CMakeLists.txt b/libs/imageio/CMakeLists.txt -index 47544655b..d813ef462 100644 ---- a/libs/imageio/CMakeLists.txt -+++ b/libs/imageio/CMakeLists.txt -@@ -8,11 +8,11 @@ set(PUBLIC_HDR_DIR include) - # Sources and headers - # ================================================================================================== - set(PUBLIC_HDRS -- include/imageio/BasisEncoder.h -- include/imageio/HDRDecoder.h -- include/imageio/ImageDecoder.h -- include/imageio/ImageDiffer.h -- include/imageio/ImageEncoder.h -+ $$/imageio/BasisEncoder.h -+ $$/imageio/HDRDecoder.h -+ $$/imageio/ImageDecoder.h -+ $$/imageio/ImageDiffer.h -+ $$/imageio/ImageEncoder.h - ) - - set(SRCS -@@ -26,11 +26,11 @@ set(SRCS - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - target_link_libraries(${TARGET} PUBLIC image math png tinyexr utils z basis_encoder) -diff --git a/libs/ktxreader/CMakeLists.txt b/libs/ktxreader/CMakeLists.txt -index 83a630ade..c3ecd3160 100644 ---- a/libs/ktxreader/CMakeLists.txt -+++ b/libs/ktxreader/CMakeLists.txt -@@ -20,13 +20,13 @@ set(SRCS - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - - target_link_libraries(${TARGET} PUBLIC utils image filament basis_transcoder) - --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - # ================================================================================================== -diff --git a/libs/matdbg/CMakeLists.txt b/libs/matdbg/CMakeLists.txt -index e58058548..05815da2e 100644 ---- a/libs/matdbg/CMakeLists.txt -+++ b/libs/matdbg/CMakeLists.txt -@@ -68,7 +68,7 @@ set_target_properties(matdbg_resources PROPERTIES FOLDER Libs) - # Include and target definitions - # ================================================================================================== - --include_directories(${PUBLIC_HDR_DIR} ${RESOURCE_DIR}) -+include_directories($$ ${RESOURCE_DIR}) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - -@@ -88,7 +88,7 @@ target_link_libraries(${TARGET} PUBLIC - - target_include_directories(${TARGET} PRIVATE ${filamat_SOURCE_DIR}/src) - --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - # ================================================================================================== -diff --git a/libs/math/CMakeLists.txt b/libs/math/CMakeLists.txt -index 838aa2d53..52ad60c8d 100644 ---- a/libs/math/CMakeLists.txt -+++ b/libs/math/CMakeLists.txt -@@ -37,11 +37,11 @@ set(SRCS src/dummy.cpp) - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - target_compile_options(${TARGET} PRIVATE ${OPTIMIZATION_FLAGS}) --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - # ================================================================================================== -diff --git a/libs/mathio/CMakeLists.txt b/libs/mathio/CMakeLists.txt -index 4ad5126fc..d612e27d8 100644 ---- a/libs/mathio/CMakeLists.txt -+++ b/libs/mathio/CMakeLists.txt -@@ -16,11 +16,11 @@ set(SRCS src/ostream.cpp) - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - target_compile_options(${TARGET} PRIVATE ${OPTIMIZATION_FLAGS}) --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - target_link_libraries(${TARGET} PRIVATE math) - -diff --git a/libs/uberz/CMakeLists.txt b/libs/uberz/CMakeLists.txt -index e73e724d3..bee0ac639 100644 ---- a/libs/uberz/CMakeLists.txt -+++ b/libs/uberz/CMakeLists.txt -@@ -21,13 +21,13 @@ set(SRCS - # ================================================================================================== - # Include and target definitions - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - - target_link_libraries(${TARGET} PUBLIC math utils filabridge zstd) - --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - # ================================================================================================== -diff --git a/libs/utils/CMakeLists.txt b/libs/utils/CMakeLists.txt -index d2f96fe6c..b3fec04af 100644 ---- a/libs/utils/CMakeLists.txt -+++ b/libs/utils/CMakeLists.txt -@@ -100,10 +100,10 @@ endif() - # ================================================================================================== - # Includes and target definition - # ================================================================================================== --include_directories(${PUBLIC_HDR_DIR}) -+include_directories($$) - - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - target_link_libraries(${TARGET} PUBLIC tsl) - -diff --git a/libs/viewer/CMakeLists.txt b/libs/viewer/CMakeLists.txt -index cfc969988..c4b483339 100644 ---- a/libs/viewer/CMakeLists.txt -+++ b/libs/viewer/CMakeLists.txt -@@ -31,7 +31,7 @@ set(SRCS - # ================================================================================================== - add_library(${TARGET} STATIC ${PUBLIC_HDRS} ${SRCS}) - target_link_libraries(${TARGET} PUBLIC imgui filament gltfio_core filagui jsmn civetweb) --target_include_directories(${TARGET} PUBLIC ${PUBLIC_HDR_DIR}) -+target_include_directories(${TARGET} PUBLIC $$) - set_target_properties(${TARGET} PROPERTIES FOLDER Libs) - - if (FILAMENT_SAMPLES_STEREO_TYPE STREQUAL "instanced") --- -2.44.0 - diff --git a/pkgs/by-name/fi/filament/package.nix b/pkgs/by-name/fi/filament/package.nix index dde6fa04352f9..86f6a17fb66fc 100644 --- a/pkgs/by-name/fi/filament/package.nix +++ b/pkgs/by-name/fi/filament/package.nix @@ -30,20 +30,14 @@ clangStdenv.mkDerivation rec { hash = "sha256-hKyyYSGvQnaS8vnYkm92PiSeMvjcIXza11ZvymhC+zk="; }; - patches = [ ./0002-cmake-relocatable-target_include_directories.patch ]; - + # If you wish to un-vendor e.g. spirv-*, you could add extra find_package()s + # and ALIAS libs here, so as to match the phony targets declared in third_party/: extraFindPackages = '' find_package(tsl-robin-map REQUIRED GLOBAL) add_library(tsl ALIAS tsl::robin_map) find_package(draco REQUIRED GLOBAL) add_library(dracodec ALIAS draco::draco_static) - - # find_package(SPIRV-Tools REQUIRED GLOBAL) - # find_package(spirv_cross_core REQUIRED GLOBAL) - # find_package(spirv_cross_glsl REQUIRED GLOBAL) - # find_package(spirv_cross_msl REQUIRED GLOBAL) - # find_package(glslang REQUIRED GLOBAL) ''; postPatch = '' @@ -56,14 +50,19 @@ clangStdenv.mkDerivation rec { # out of the box with out buildInputs simply because the sonames match sed -i 's/^.*add_subdirectory.*EXTERNAL.*\(${ lib.concatStringsSep "\\|" [ - # "assimp" - # "stb" "draco" - # "meshoptimizer" "robin-map" - # They vendor an outdated imgui with different interfaces + + # They vendor an outdated imgui with different interfaces, + # so we can't use ours: # "imgui" + "libgtest" + + # Failed to un-vendor for various reasons: + # "assimp" + # "stb" + # "meshoptimizer" # "spirv-tools" # "glslang" # "spirv-cross" @@ -88,30 +87,8 @@ clangStdenv.mkDerivation rec { # Otherwise CMake fails to execute build/linux/combine-static-libs.sh patchShebangs . - - while IFS= read -r -d $'\0' path ; do - sed -i "s/$installTargetsPattern/\1 EXPORT filament_target /" "$path" - done < <( find libs/ -iname CMakeLists.txt -print0 ) - - grep "install(TARGETS" $(find -iname CMakeLists.txt) - - cat << \EOF >> CMakeLists.txt - include(CMakePackageConfigHelpers) - configure_package_config_file(filament-config.cmake.in filament-config.cmake INSTALL_DESTINATION ''${CMAKE_INSTALL_LIBDIR}/cmake/filament) - install( - EXPORT filament_target FILE filament-targets.cmake - DESTINATION ''${CMAKE_INSTALL_LIBDIR}/cmake/''${PROJECT_NAME}) - EOF - cat << \EOF >> filament-config.cmake.in - include("''${CMAKE_CURRENT_LIST_DIR}/imgui-targets.cmake") - EOF - - cat libs/filameshio/CMakeLists.txt ''; - # installTargetsPattern = ''\(install(TARGETS[[:space:]]\+\([$][^$)[:space:]]\+\|[^)A-Z]\+\)\+[^)A-Z]*\)''; - installTargetsPattern = ''\(install(TARGETS[[:space:]]\+\([$][{]\?[^$)[:space:]]\+[}]\?[^[:space:])]*\|[^$}{)A-Z]\+\)[[:space:]]*\)''; - nativeBuildInputs = [ cmake python3Packages.python @@ -120,15 +97,15 @@ clangStdenv.mkDerivation rec { ]; buildInputs = [ - spirv-headers - glslang # assimp - stb draco + glslang gtest - robin-map - meshoptimizer # imgui + meshoptimizer + robin-map + spirv-headers + stb ] ++ lib.optionals clangStdenv.hostPlatform.isLinux [ libGL diff --git a/pkgs/by-name/li/liblzf/package.nix b/pkgs/by-name/li/liblzf/package.nix index c4434fad063f7..771e0ebae9c77 100644 --- a/pkgs/by-name/li/liblzf/package.nix +++ b/pkgs/by-name/li/liblzf/package.nix @@ -1,4 +1,5 @@ { + lib, stdenv, fetchzip, }: @@ -11,4 +12,14 @@ stdenv.mkDerivation { ]; hash = "sha256-m5MZfYAT9AtAXh2zk3lZasTfTGVbY8KWnyeftMaLanQ="; }; + meta = { + description = "A small data compression library"; + homepage = "http://software.schmorp.de/pkg/liblzf.html"; + license = lib.licenses.bsd2 // { + # Alternatively available under gpl2 + url = "http://cvs.schmorp.de/liblzf/LICENSE?revision=1.7&view=markup"; + }; + maintainers = with lib.maintainers; [ SomeoneSerge ]; + platforms = lib.platforms.all; + }; } diff --git a/pkgs/by-name/op/open3d/0001-cmake-correct-msgpack-package-name.patch b/pkgs/by-name/op/open3d/0001-cmake-correct-msgpack-package-name.patch new file mode 100644 index 0000000000000..a89bf63c63dd7 --- /dev/null +++ b/pkgs/by-name/op/open3d/0001-cmake-correct-msgpack-package-name.patch @@ -0,0 +1,25 @@ +From f5afa1c4c47db3ea3b24f9eb33a4efceafa10e3e Mon Sep 17 00:00:00 2001 +From: Someone Serge +Date: Mon, 17 Jun 2024 02:54:29 +0000 +Subject: [PATCH] cmake: correct msgpack package name + +--- + 3rdparty/find_dependencies.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake +index 45555b83a..40266805d 100644 +--- a/3rdparty/find_dependencies.cmake ++++ b/3rdparty/find_dependencies.cmake +@@ -1446,7 +1446,7 @@ endif() + # msgpack + if(USE_SYSTEM_MSGPACK) + open3d_find_package_3rdparty_library(3rdparty_msgpack +- PACKAGE msgpack-cxx ++ PACKAGE msgpack + TARGETS msgpack-cxx + ) + if(NOT 3rdparty_msgpack_FOUND) +-- +2.44.0 + diff --git a/pkgs/by-name/op/open3d/Findfilament.cmake b/pkgs/by-name/op/open3d/Findfilament.cmake new file mode 100644 index 0000000000000..eb1e98cd4ff65 --- /dev/null +++ b/pkgs/by-name/op/open3d/Findfilament.cmake @@ -0,0 +1,66 @@ +cmake_policy(PUSH) + +find_library( + FILAMENT_LIBRARY + NAMES filament + HINTS ${filament_DIR} + PATH_SUFFIXES lib lib/x86_64) + +find_library( + FILAMENT_GEOMETRY_LIBRARY + NAMES geometry + HINTS ${filament_DIR} + PATH_SUFFIXES lib lib/x86_64) + +find_library( + FILAMENT_IMAGE_LIBRARY + NAMES image + HINTS ${filament_DIR} + PATH_SUFFIXES lib lib/x86_64) + +find_path( + FILAMENT_INCLUDE_DIR FilamentAPI.h + HINTS ${filament_DIR} + PATH_SUFFIXES include/filament) +find_path( + FILAMENT_GEOMETRY_INCLUDE_DIR TangentSpaceMesh.h + HINTS ${filament_DIR} + PATH_SUFFIXES include/geometry) +find_path( + FILAMENT_IMAGE_INCLUDE_DIR Ktx1Bundle.h + HINTS ${filament_DIR} + PATH_SUFFIXES include/image) + +find_program( + FILAMENT_MATC + NAMES matc + HINTS ${filament_DIR}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + filament + REQUIRED_VARS FILAMENT_LIBRARY FILAMENT_GEOMETRY_LIBRARY + FILAMENT_IMAGE_LIBRARY FILAMENT_MATC FILAMENT_INCLUDE_DIR) +if(filament_FOUND) + if(NOT TARGET filament::filament) + add_library(filament::filament INTERFACE IMPORTED) + target_link_libraries(filament::filament INTERFACE "${FILAMENT_LIBRARY}") + target_include_directories(filament::filament SYSTEM + INTERFACE "${FILAMENT_INCLUDE_DIR}") + endif() + if(NOT TARGET filament::geometry) + add_library(filament::geometry INTERFACE IMPORTED) + target_link_libraries(filament::geometry + INTERFACE "${FILAMENT_GEOMETRY_LIBRARY}") + target_include_directories(filament::geometry SYSTEM + INTERFACE "${FILAMENT_GEOMETRY_INCLUDE_DIR}") + endif() + if(NOT TARGET filament::image) + add_library(filament::image INTERFACE IMPORTED) + target_link_libraries(filament::image INTERFACE "${FILAMENT_IMAGE_LIBRARY}") + target_include_directories(filament::image SYSTEM + INTERFACE "${FILAMENT_IMAGE_INCLUDE_DIR}") + endif() +endif() + +cmake_policy(POP) diff --git a/pkgs/by-name/op/open3d/Findliblzf.cmake b/pkgs/by-name/op/open3d/Findliblzf.cmake new file mode 100644 index 0000000000000..b2e43a8c12047 --- /dev/null +++ b/pkgs/by-name/op/open3d/Findliblzf.cmake @@ -0,0 +1,18 @@ +cmake_policy(PUSH) +find_library( + LIBLZF_LIBRARY + NAMES lzf + PATH_SUFFIXES lib) +find_path(LIBLZF_INCLUDE_DIR lzf.h PATH_SUFFIXES include) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(liblzf REQUIRED_VARS LIBLZF_LIBRARY + LIBLZF_INCLUDE_DIR) +if(liblzf_FOUND) + if(NOT TARGET liblzf::liblzf) + add_library(liblzf::liblzf INTERFACE IMPORTED) + target_link_libraries(liblzf::liblzf INTERFACE "${LIBLZF_LIBRARY}") + target_include_directories(liblzf::liblzf SYSTEM + INTERFACE "${LIBLZF_INCLUDE_DIR}") + endif() +endif() +cmake_policy(POP) diff --git a/pkgs/by-name/op/open3d/package.nix b/pkgs/by-name/op/open3d/package.nix index 29ca145fc7625..6aa548b6775df 100644 --- a/pkgs/by-name/op/open3d/package.nix +++ b/pkgs/by-name/op/open3d/package.nix @@ -25,6 +25,7 @@ libz, liblzf, msgpack, + fmt, nanoflann, boringssl, qhull, @@ -52,6 +53,8 @@ stdenv.mkDerivation rec { hash = "sha256-VMykWYfWUzhG+Db1I/9D1GTKd3OzmSXvwzXwaZnu8uI="; }; + patches = [ ./0001-cmake-correct-msgpack-package-name.patch ]; + postPatch = '' substituteInPlace "cmake/Open3DFetchISPCCompiler.cmake" \ --replace-fail \ @@ -64,8 +67,16 @@ stdenv.mkDerivation rec { find_package(jsoncpp REQUIRED) add_library(jsoncpp ALIAS jsoncpp_lib) EOF + + rm -rf build/filament + mkdir -p cmake/ + cp ${./Findfilament.cmake} ./cmake/Findfilament.cmake + cp ${./Findliblzf.cmake} ./cmake/Findliblzf.cmake + addToSearchPath CMAKE_MODULE_PATH $PWD/cmake ''; + cmakeBuildDir = "builddir"; # build/ is checked in git + nativeBuildInputs = [ cmake ispc @@ -73,35 +84,36 @@ stdenv.mkDerivation rec { ]; buildInputs = [ - jsoncpp assimp blas + boringssl curl + draco.tinygltf eigen embree + filament + fmt glew glfw3 imgui + jsoncpp libjpeg libjpeg_turbo + liblzf libpng + libz msgpack nanoflann - boringssl qhull tbb - draco # tinygltf vtk vulkan-headers vulkan-loader xorg.libX11 - xorg.libXrandr - xorg.libXinerama xorg.libXcursor + xorg.libXinerama + xorg.libXrandr zeromq - libz - liblzf - filament ] ++ lib.optionals cudaSupport [ stdgpu ]; preConfigure = '' @@ -120,7 +132,7 @@ stdenv.mkDerivation rec { (lib.cmakeFeature "BORINGSSL_ROOT_DIR" "${lib.getDev boringssl}") # Doesn't seem to generate a `*Config.cmake` file - (lib.cmakeFeature "filament_DIR" "${lib.getDev filament}") + (lib.cmakeFeature "filament_DIR" "${lib.getDev filament}/share/cmake") ]; meta = { diff --git a/pkgs/by-name/uv/uvatlas/package.nix b/pkgs/by-name/uv/uvatlas/package.nix new file mode 100644 index 0000000000000..db845a88eac00 --- /dev/null +++ b/pkgs/by-name/uv/uvatlas/package.nix @@ -0,0 +1,36 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + directxmath, + directx-headers, +}: + +stdenv.mkDerivation rec { + pname = "uvatlas"; + version = "2024.06"; + + src = fetchFromGitHub { + owner = "Microsoft"; + repo = "UVAtlas"; + rev = "jun2024"; + hash = "sha256-2rnhs/1yUd187+W8A3GoHZ5z7W5lxo7Y35rCg5Vgflc="; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ + directxmath + directx-headers + ]; + + meta = { + description = "UVAtlas isochart texture atlas"; + homepage = "https://github.com/Microsoft/UVAtlas"; + changelog = "https://github.com/Microsoft/UVAtlas/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ SomeoneSerge ]; + mainProgram = "uvatlas"; + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/development/libraries/directx-headers/default.nix b/pkgs/development/libraries/directx-headers/default.nix index 061d18d15016a..5737ef17fa6be 100644 --- a/pkgs/development/libraries/directx-headers/default.nix +++ b/pkgs/development/libraries/directx-headers/default.nix @@ -1,4 +1,13 @@ -{ lib, stdenv, fetchFromGitHub, meson, ninja }: +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + meson, + ninja, + pkg-config, +}: + stdenv.mkDerivation rec { pname = "directx-headers"; version = "1.614.0"; @@ -10,16 +19,70 @@ stdenv.mkDerivation rec { hash = "sha256-0LaN9D3cKVacMJhZCe9oxDPHpd1jdCAV0ImG2rSgnxc="; }; - nativeBuildInputs = [ meson ninja ]; + # Build using meson but do generate a directx-headers-config.cmake + postPatch = '' + cat << \EOF > directx-headers.cmake.in + @PACKAGE_INIT@ + + find_library(DX_HEADERS_LIBRARY + NAMES d3dx12-format-properties + HINTS "@PACKAGE_CMAKE_INSTALL_LIBDIR@") + find_library(DX_GUIDS_LIBRARY + NAMES DirectX-Guids + HINTS "@PACKAGE_CMAKE_INSTALL_LIBDIR@") + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(directx-headers REQUIRED_VARS DX_HEADERS_LIBRARY DX_GUIDS_LIBRARY) + + if (directx-headers_FOUND) + if (NOT TARGET Microsoft::DirectX-Headers) + add_library(Microsoft::DirectX-Headers INTERFACE IMPORTED) + target_link_libraries(Microsoft::DirectX-Headers INTERFACE "''${DX_HEADERS_LIBRARY}") + target_include_directories(Microsoft::DirectX-Headers INTERFACE "@DIRECTX_HEADERS_INCLUDE_DIRS@") + endif() + if (NOT TARGET Microsoft::DirectX-Guids) + add_library(Microsoft::DirectX-Guids INTERFACE IMPORTED) + target_link_libraries(Microsoft::DirectX-Guids INTERFACE "''${DX_GUIDS_LIBRARY}") + target_include_directories(Microsoft::DirectX-Guids INTERFACE "@DIRECTX_HEADERS_INCLUDE_DIRS@") + endif() + endif() + EOF + + cat << \EOF >> meson.build + cmake = import('cmake') + cmake.write_basic_package_version_file(name: 'directx-headers', version: meson.project_version()) + conf = configuration_data() + install_inc_dirs = [] + foreach d : install_inc_subdirs + install_inc_dirs += [join_paths(get_option('prefix'), get_option('includedir'), d)] + endforeach + conf.set('DIRECTX_HEADERS_INCLUDE_DIRS', ';'.join(install_inc_dirs)) + conf.set('PACKAGE_CMAKE_INSTALL_LIBDIR', join_paths(get_option('prefix'), get_option('libdir'))) + cmake.configure_package_config_file( + name: 'directx-headers', + input: 'directx-headers.cmake.in', + configuration: conf + ) + EOF + ''; + + nativeBuildInputs = [ + cmake + meson + ninja + pkg-config + ]; + + dontUseCmakeConfigure = true; # tests require WSL2 - mesonFlags = [ "-Dbuild-test=false" ]; + mesonFlags = [ (lib.mesonBool "build-test" false) ]; - meta = with lib; { + meta = { description = "Official D3D12 headers from Microsoft"; homepage = "https://github.com/microsoft/DirectX-Headers"; - license = licenses.mit; - maintainers = with maintainers; [ k900 ]; - platforms = platforms.all; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ k900 ]; + platforms = lib.platforms.all; }; } diff --git a/pkgs/development/libraries/draco/default.nix b/pkgs/development/libraries/draco/default.nix index 677c7e636986d..20fa30e9cb089 100644 --- a/pkgs/development/libraries/draco/default.nix +++ b/pkgs/development/libraries/draco/default.nix @@ -54,7 +54,10 @@ stdenv.mkDerivation (finalAttrs: { "-include cstdint" ]; - passthru.updateScript = nix-update-script { }; + passthru = { + inherit tinygltf; + updateScript = nix-update-script { }; + }; meta = with lib; { description = "Library for compressing and decompressing 3D geometric meshes and point clouds"; From 56dfd7cccfd950c8ed49f4a7c44cfe6bec744a37 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 18 Jun 2024 00:25:19 +0000 Subject: [PATCH 3/8] fixup! fixup! nerfstudio: init at 1.1.2 --- pkgs/by-name/op/open3d/package.nix | 52 ++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/op/open3d/package.nix b/pkgs/by-name/op/open3d/package.nix index 6aa548b6775df..35e381b7ead70 100644 --- a/pkgs/by-name/op/open3d/package.nix +++ b/pkgs/by-name/op/open3d/package.nix @@ -11,6 +11,7 @@ glfw3, xorg, assimp, + pkg-config, blas, curl, eigen, @@ -18,6 +19,7 @@ glew, imgui, nasm, + tinyobjloader, libjpeg, filament, libjpeg_turbo, @@ -55,6 +57,28 @@ stdenv.mkDerivation rec { patches = [ ./0001-cmake-correct-msgpack-package-name.patch ]; + extraCmakeFindModules = [ + ./Findfilament.cmake + ./Findliblzf.cmake + ]; + extraFindPackages = '' + # find_package(jsoncpp REQUIRED GLOBAL) + # add_library(jsoncpp ALIAS jsoncpp_lib) + + find_package(msgpack REQUIRED GLOBAL) + find_package(TinyGLTF REQUIRED GLOBAL) + add_library(TinyGLTF::TinyGLTF ALIAS tinygltf::tinygltf) + + # find_package(ZeroMQ REQUIRED GLOBAL) + # libzmq, libzmq-static + # add_library(Open3D::3rdparty_zeromq ALIAS libzmq-static) + + # find_package(PkgConfig REQUIRED) + # pkg_check_modules(LIBCURL libcurl REQUIRED IMPORTED_TARGET) + # add_library(ext_curl ALIAS PkgConfig::LIBCURL) + ''; + passAsFile = [ "extraFindPackages" ]; + postPatch = '' substituteInPlace "cmake/Open3DFetchISPCCompiler.cmake" \ --replace-fail \ @@ -63,16 +87,25 @@ stdenv.mkDerivation rec { DOWNLOAD_DIR "''${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/ispc" FIND_PACKAGE_ARGS ispc ' - cat << \EOF > 3rdparty/jsoncpp/jsoncpp.cmake - find_package(jsoncpp REQUIRED) - add_library(jsoncpp ALIAS jsoncpp_lib) - EOF + + substituteInPlace 3rdparty/find_dependencies.cmake \ + --replace-fail \ + 'include(''${Open3D_3RDPARTY_DIR}/uvatlas/uvatlas.cmake)' \ + '# include(''${Open3D_3RDPARTY_DIR}/uvatlas/uvatlas.cmake)' + + sed -i "1r $extraFindPackagesPath" 3rdparty/find_dependencies.cmake rm -rf build/filament + + echo "Installing extraCmakeFindModules" >&2 mkdir -p cmake/ - cp ${./Findfilament.cmake} ./cmake/Findfilament.cmake - cp ${./Findliblzf.cmake} ./cmake/Findliblzf.cmake - addToSearchPath CMAKE_MODULE_PATH $PWD/cmake + for path in $extraCmakeFindModules ; do + # Strip the hash bit to get the basename + name="$(echo "$path" | sed 's|${builtins.storeDir}[^-]\+-||')" + echo "Installing $path to ./cmake/$name" >&2 + cp "$path" ./cmake/"$name" + done + addToSearchPath CMAKE_MODULE_PATH "$PWD/cmake" ''; cmakeBuildDir = "builddir"; # build/ is checked in git @@ -81,6 +114,7 @@ stdenv.mkDerivation rec { cmake ispc nasm + pkg-config ]; buildInputs = [ @@ -106,6 +140,7 @@ stdenv.mkDerivation rec { nanoflann qhull tbb + tinyobjloader vtk vulkan-headers vulkan-loader @@ -133,6 +168,9 @@ stdenv.mkDerivation rec { # Doesn't seem to generate a `*Config.cmake` file (lib.cmakeFeature "filament_DIR" "${lib.getDev filament}/share/cmake") + + # Should work without this but it doesn't + (lib.cmakeFeature "TinyGLTF_DIR" "${lib.getDev draco.tinygltf}/lib/cmake") ]; meta = { From 6d192c8a0bead98a27e238e601b86e8def03e287 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 18 Jun 2024 00:26:17 +0000 Subject: [PATCH 4/8] fixup! fixup! fixup! nerfstudio: init at 1.1.2 --- pkgs/by-name/op/open3d/package.nix | 47 ++++++++++++------------------ 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/pkgs/by-name/op/open3d/package.nix b/pkgs/by-name/op/open3d/package.nix index 35e381b7ead70..3f7a06761a525 100644 --- a/pkgs/by-name/op/open3d/package.nix +++ b/pkgs/by-name/op/open3d/package.nix @@ -2,42 +2,42 @@ lib, stdenv, fetchFromGitHub, - cmake, - withPython ? false, - ispc, - jsoncpp, - vulkan-loader, - vulkan-headers, - glfw3, - xorg, assimp, - pkg-config, blas, + boringssl, + cmake, + config, + cudaSupport ? config.cudaSupport, curl, + draco, eigen, embree, + filament, + fmt, glew, + glfw3, imgui, - nasm, - tinyobjloader, + ispc, + jsoncpp, libjpeg, - filament, libjpeg_turbo, + liblzf, libpng, libz, - liblzf, msgpack, - fmt, nanoflann, - boringssl, + nasm, + pkg-config, qhull, stdgpu, tbb, - draco, + tinyobjloader, vtk, + vulkan-headers, + vulkan-loader, + withPython ? false, + xorg, zeromq, - config, - cudaSupport ? false, }: let @@ -62,20 +62,9 @@ stdenv.mkDerivation rec { ./Findliblzf.cmake ]; extraFindPackages = '' - # find_package(jsoncpp REQUIRED GLOBAL) - # add_library(jsoncpp ALIAS jsoncpp_lib) - find_package(msgpack REQUIRED GLOBAL) find_package(TinyGLTF REQUIRED GLOBAL) add_library(TinyGLTF::TinyGLTF ALIAS tinygltf::tinygltf) - - # find_package(ZeroMQ REQUIRED GLOBAL) - # libzmq, libzmq-static - # add_library(Open3D::3rdparty_zeromq ALIAS libzmq-static) - - # find_package(PkgConfig REQUIRED) - # pkg_check_modules(LIBCURL libcurl REQUIRED IMPORTED_TARGET) - # add_library(ext_curl ALIAS PkgConfig::LIBCURL) ''; passAsFile = [ "extraFindPackages" ]; From f72faf57354381dc985ef1e88417f86194991736 Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 18 Jun 2024 01:47:23 +0000 Subject: [PATCH 5/8] poisson-recon: init at 16.04 --- pkgs/by-name/op/open3d/package.nix | 2 + pkgs/by-name/po/poisson-recon/package.nix | 49 +++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 pkgs/by-name/po/poisson-recon/package.nix diff --git a/pkgs/by-name/op/open3d/package.nix b/pkgs/by-name/op/open3d/package.nix index 3f7a06761a525..4f495edd20fad 100644 --- a/pkgs/by-name/op/open3d/package.nix +++ b/pkgs/by-name/op/open3d/package.nix @@ -28,6 +28,7 @@ nanoflann, nasm, pkg-config, + poisson-recon, qhull, stdgpu, tbb, @@ -127,6 +128,7 @@ stdenv.mkDerivation rec { libz msgpack nanoflann + poisson-recon qhull tbb tinyobjloader diff --git a/pkgs/by-name/po/poisson-recon/package.nix b/pkgs/by-name/po/poisson-recon/package.nix new file mode 100644 index 0000000000000..b2c604974bcf0 --- /dev/null +++ b/pkgs/by-name/po/poisson-recon/package.nix @@ -0,0 +1,49 @@ +{ + lib, + stdenv, + fetchFromGitHub, + libpng, + libjpeg, + zlib, + boost, +}: + +stdenv.mkDerivation rec { + pname = "poisson-recon"; + version = "16.04"; + + src = fetchFromGitHub { + owner = "mkazhdan"; + repo = "PoissonRecon"; + # Commit msg says "Version 16.04", there's just no tag + rev = "e04a91d40093dd80669afb07f7d3f586db063ee9"; + hash = "sha256-vTwU84yFaAwojGMFowf0AoSCNhKHkXL32kNY4WH5goY="; + }; + + buildInputs = [ + boost + libpng + libjpeg + zlib + ]; + + preConfigure = '' + for path in "''${pkgsHostTarget[@]}" ; do + if [[ -d "$path/include" ]] ; then + NIX_CFLAGS_COMPILE+=" -I$path/include" + fi + done + NIX_CFLAGS_COMPILE+=" -I$PWD" + NIX_CFLAGS_COMPILE+=" -I$PWD/Src" + export NIX_CFLAGS_COMPILE + ''; + + meta = { + description = "Poisson Surface Reconstruction"; + homepage = "https://github.com/isl-org/Open3D-PoissonRecon"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ SomeoneSerge ]; + mainProgram = "poisson-recon"; + platforms = lib.platforms.all; + }; +} From ead454f48452b2ef11ac5f7bc4679d1bda602cdb Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 18 Jun 2024 16:43:54 +0000 Subject: [PATCH 6/8] fixup! nerfstudio: init at 1.1.2 --- pkgs/by-name/on/one-dpl/package.nix | 31 +++ pkgs/by-name/op/open3d/Findfilament.cmake | 3 +- pkgs/by-name/op/open3d/package.nix | 184 +++++++++++++----- pkgs/by-name/po/poisson-recon/package.nix | 31 +++ .../python-modules/nerfacc/default.nix | 4 +- pkgs/top-level/all-packages.nix | 1 + 6 files changed, 204 insertions(+), 50 deletions(-) create mode 100644 pkgs/by-name/on/one-dpl/package.nix diff --git a/pkgs/by-name/on/one-dpl/package.nix b/pkgs/by-name/on/one-dpl/package.nix new file mode 100644 index 0000000000000..87d70a72faabe --- /dev/null +++ b/pkgs/by-name/on/one-dpl/package.nix @@ -0,0 +1,31 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + tbbLatest, + }: + + stdenv.mkDerivation rec { + pname = "one-dpl"; + version = "2022.5.0-rc1"; + + src = fetchFromGitHub { + owner = "oneapi-src"; + repo = "oneDPL"; + rev = "oneDPL-${version}"; + hash = "sha256-deaCe2Ih8bG6HeTIbPDCD0qd/Gi7frjRifrB8rwulAw="; + }; + + nativeBuildInputs = [ cmake ]; + buildInputs = [ tbbLatest ]; + + meta = { + description = "OneAPI DPC++ Library (oneDPL) https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/dpc-library.html"; + homepage = "https://github.com/oneapi-src/oneDPL"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ SomeoneSerge ]; + mainProgram = "one-dpl"; + platforms = lib.platforms.all; + }; + } diff --git a/pkgs/by-name/op/open3d/Findfilament.cmake b/pkgs/by-name/op/open3d/Findfilament.cmake index eb1e98cd4ff65..9379da0b2fab5 100644 --- a/pkgs/by-name/op/open3d/Findfilament.cmake +++ b/pkgs/by-name/op/open3d/Findfilament.cmake @@ -34,7 +34,8 @@ find_path( find_program( FILAMENT_MATC NAMES matc - HINTS ${filament_DIR}) + HINTS ${filament_DIR} + PATH_SUFFIXES bin) include(FindPackageHandleStandardArgs) find_package_handle_standard_args( diff --git a/pkgs/by-name/op/open3d/package.nix b/pkgs/by-name/op/open3d/package.nix index 4f495edd20fad..651647bd752e9 100644 --- a/pkgs/by-name/op/open3d/package.nix +++ b/pkgs/by-name/op/open3d/package.nix @@ -16,31 +16,45 @@ fmt, glew, glfw3, + minizip, imgui, ispc, jsoncpp, + lapack, libjpeg, libjpeg_turbo, liblzf, libpng, libz, + mesa, + mkl, msgpack, nanoflann, nasm, + one-dpl, + openblas, pkg-config, poisson-recon, qhull, stdgpu, - tbb, + tbbLatest, tinyobjloader, vtk, vulkan-headers, vulkan-loader, + withMkl ? blas.provider.pname == "mkl", withPython ? false, xorg, zeromq, + open3DRendering ? "gui", }: +assert builtins.elem open3DRendering [ + "headless" + "gui" + null +]; + let buildPkg = p: p.__spliced.buildHost or p; in @@ -48,6 +62,11 @@ in stdenv.mkDerivation rec { pname = "open3d"; version = "0.18.0"; + outputs = [ + "bin" + "out" + "dev" + ]; src = fetchFromGitHub { owner = "isl-org"; @@ -66,6 +85,13 @@ stdenv.mkDerivation rec { find_package(msgpack REQUIRED GLOBAL) find_package(TinyGLTF REQUIRED GLOBAL) add_library(TinyGLTF::TinyGLTF ALIAS tinygltf::tinygltf) + + set(POISSON_INCLUDE_DIRS "${lib.getDev poisson-recon}/include") + + find_package(oneDPL REQUIRED GLOBAL) + add_library(3rdparty_onedpl ALIAS oneDPL) + add_library(ext_parallelstl ALIAS oneDPL) + set(PARALLELSTL_INCLUDE_DIRS "${lib.getDev one-dpl}/include/") ''; passAsFile = [ "extraFindPackages" ]; @@ -81,11 +107,22 @@ stdenv.mkDerivation rec { substituteInPlace 3rdparty/find_dependencies.cmake \ --replace-fail \ 'include(''${Open3D_3RDPARTY_DIR}/uvatlas/uvatlas.cmake)' \ - '# include(''${Open3D_3RDPARTY_DIR}/uvatlas/uvatlas.cmake)' + '# include(''${Open3D_3RDPARTY_DIR}/uvatlas/uvatlas.cmake)' \ + --replace-fail \ + "GLEW::GLEW" \ + "GLEW::glew" \ + --replace-fail \ + "PACKAGE GLEW" \ + "PACKAGE glew" \ + --replace-fail \ + "/usr/bin/matc" \ + "${lib.getExe' filament "matc"}" sed -i "1r $extraFindPackagesPath" 3rdparty/find_dependencies.cmake rm -rf build/filament + echo "" > 3rdparty/possionrecon/possionrecon.cmake + echo "" > 3rdparty/parallelstl/parallelstl.cmake echo "Installing extraCmakeFindModules" >&2 mkdir -p cmake/ @@ -98,6 +135,11 @@ stdenv.mkDerivation rec { addToSearchPath CMAKE_MODULE_PATH "$PWD/cmake" ''; + NIX_CFLAGS_COMPILE = [ + # Remove noise + "-Wno-int-to-pointer-cast" + ]; + cmakeBuildDir = "builddir"; # build/ is checked in git nativeBuildInputs = [ @@ -107,64 +149,112 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = [ - assimp - blas - boringssl - curl - draco.tinygltf - eigen - embree - filament - fmt - glew - glfw3 - imgui - jsoncpp - libjpeg - libjpeg_turbo - liblzf - libpng - libz - msgpack - nanoflann - poisson-recon - qhull - tbb - tinyobjloader - vtk - vulkan-headers - vulkan-loader - xorg.libX11 - xorg.libXcursor - xorg.libXinerama - xorg.libXrandr - zeromq - ] ++ lib.optionals cudaSupport [ stdgpu ]; + buildInputs = + [ + assimp + blas + boringssl + curl + draco.tinygltf + eigen + embree + filament + fmt + glew + glfw3 + imgui + jsoncpp + lapack + libjpeg + libjpeg_turbo + liblzf + libpng + libz + msgpack + nanoflann + one-dpl + poisson-recon + qhull + tbbLatest + tinyobjloader + vtk + vulkan-headers + vulkan-loader + xorg.libX11 + xorg.libXcursor + xorg.libXinerama + xorg.libXrandr + minizip # unzip.h + zeromq + ] + ++ lib.optionals (open3DRendering == "headless") [ + mesa + mesa.osmesa + ] + ++ lib.optionals cudaSupport [ stdgpu ] + ++ lib.optionals withMkl [ + # Currently, the blas/lapack shims do not expose original package info + # (e.g. the original cmake configs) + mkl + ] + ++ lib.optionals (!withMkl) [ openblas ]; preConfigure = '' # Set all of the USE_SYSTEM_* variables while IFS= read name ; do + if [[ "$cmakeFlags" == *"$name":BOOL* ]] ; then + continue + fi cmakeFlags+=" -D''${name}:BOOL=ON" done < <(grep '\bUSE_SYSTEM[_a-zA-Z0-9]\+\b' --only-matching CMakeLists.txt) export cmakeFlags ''; - cmakeFlags = [ - (lib.cmakeBool "BUILD_PYTHON_MODULE" withPython) - (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) - (lib.cmakeFeature "FETCHCONTENT_TRY_FIND_PACKAGE_MODE" "ALWAYS") - (lib.cmakeFeature "CMAKE_ISPC_COMPILER" (lib.getExe (buildPkg ispc))) - (lib.cmakeFeature "BORINGSSL_ROOT_DIR" "${lib.getDev boringssl}") + cmakeFlags = + [ + (lib.cmakeBool "BUILD_PYTHON_MODULE" withPython) + (lib.cmakeBool "FETCHCONTENT_FULLY_DISCONNECTED" true) + (lib.cmakeFeature "FETCHCONTENT_TRY_FIND_PACKAGE_MODE" "ALWAYS") + (lib.cmakeBool "DEVELOPER_BUILD" false) - # Doesn't seem to generate a `*Config.cmake` file - (lib.cmakeFeature "filament_DIR" "${lib.getDev filament}/share/cmake") + # `USE_BLAS && USE_SYSTEM_BLAS` means `find_package(BLAS)`; + # `!USE_BLAS && USE_SYSTEM_BLAS` means "download MKL from anaconda"; + # `USE_BLAS && !USE_SYSTEM_BLAS` means "build a vendored copy of openblas". + (lib.cmakeBool "USE_SYSTEM_BLAS" true) + (lib.cmakeBool "USE_BLAS" (!withMkl)) # "Use BLAS/LAPACK instead of MKL" - # Should work without this but it doesn't - (lib.cmakeFeature "TinyGLTF_DIR" "${lib.getDev draco.tinygltf}/lib/cmake") - ]; + # TBD; these fetch additional vendored dependencies + (lib.cmakeBool "WITH_IPPICV" false) # "Intel Performance Primitives" + (lib.cmakeBool "BUILD_WEBRTC" false) # A "WebRTC visualizer" + (lib.cmakeBool "BUILD_VTK_FROM_SOURCE" false) + (lib.cmakeBool "OPEN3D_USE_ONEAPI_PACKAGES" withMkl) + (lib.cmakeBool "BUILD_SYCL_MODULE" false) # "Build SYCL module with Intel oneAPI" + (lib.cmakeBool "PREFER_OSX_HOMEBREW" false) + (lib.cmakeFeature "POISSON_INCLUDE_DIRS" "${lib.getDev poisson-recon}/include") + + (lib.cmakeFeature "CMAKE_ISPC_COMPILER" (lib.getExe (buildPkg ispc))) + (lib.cmakeFeature "BORINGSSL_ROOT_DIR" "${lib.getDev boringssl}") + + # Doesn't seem to generate a `*Config.cmake` file + (lib.cmakeFeature "filament_DIR" "${lib.getDev filament}/share/cmake") + (lib.cmakeFeature "FILAMENT_PRECOMPILED_ROOT" "${lib.getLib filament}") + + # Should work without this but it doesn't + (lib.cmakeFeature "TinyGLTF_DIR" "${lib.getDev draco.tinygltf}/lib/cmake") + + (lib.cmakeBool "BUILD_GUI" (open3DRendering == "gui")) + (lib.cmakeBool "ENABLE_HEADLESS_RENDERING" (open3DRendering == "headless")) + ] + ++ lib.optionals (open3DRendering == "headless") [ + (lib.cmakeFeature "OSMESA_INCLUDE_DIR" "${lib.getDev mesa}/include") + (lib.cmakeFeature "OSMESA_ROOT" "${lib.getDev mesa}") + # (lib.cmakeFeature "OSMESA_ROOT" "${lib.getOutput "osmesa" mesa}") + # Somehow, open3d overrides OSMESA_INCLUDE_DIR if it locates OSMESA_LIBRARY via OSMESA_ROOT + (lib.cmakeFeature "OSMESA_LIBRARY" "${lib.getOutput "osmesa" mesa}/lib/libOSMesa${stdenv.hostPlatform.extensions.sharedLibrary}") + ]; meta = { + broken = withMkl || cudaSupport; description = "Open3D: A Modern Library for 3D Data Processing"; homepage = "https://github.com/isl-org/Open3D/"; changelog = "https://github.com/isl-org/Open3D/blob/${src.rev}/CHANGELOG.md"; diff --git a/pkgs/by-name/po/poisson-recon/package.nix b/pkgs/by-name/po/poisson-recon/package.nix index b2c604974bcf0..ebe4fa3f54b2a 100644 --- a/pkgs/by-name/po/poisson-recon/package.nix +++ b/pkgs/by-name/po/poisson-recon/package.nix @@ -38,6 +38,37 @@ stdenv.mkDerivation rec { export NIX_CFLAGS_COMPILE ''; + # E.g. Open3D uses "#include "PoissonRecon/Src/PointStreamData.h" + includePrefix = "PoissonRecon"; + + installPhase = '' + runHook preInstall + + while IFS= read -r -d $'\0' path ; do + if [[ ! -d "''${!outputLib}/lib" ]] ; then + mkdir -p "''${!outputLib}/lib" + fi + cp "$path" "''${!outputLib}/lib"/ + done < <( find \( -iname '*.so' -o -iname '*.a' \) -print0 ) + + while IFS= read -r -d $'\0' relPath ; do + local dirName="''${includePrefix}/$(dirname "$relPath")" + if [[ ! -d "''${!outputInclude}/include/$dirName" ]] ; then + mkdir -p "''${!outputInclude}/include/$dirName" + fi + cp "$relPath" "''${!outputInclude}/include/$includePrefix/$relPath" + done < <( find \( -iname '*.h' -o -iname '*.inl' \) -print0 ) + + while IFS= read -r -d $'\0' relPath ; do + if [[ ! -d "''${!outputBin}/bin" ]] ; then + mkdir -p "''${!outputBin}/bin" + fi + cp "$relPath" "''${!outputBin}/bin" + done < <( find \( -executable -a -type f \) -print0 ) + + runHook postInstall + ''; + meta = { description = "Poisson Surface Reconstruction"; homepage = "https://github.com/isl-org/Open3D-PoissonRecon"; diff --git a/pkgs/development/python-modules/nerfacc/default.nix b/pkgs/development/python-modules/nerfacc/default.nix index 70cb65daf45b4..66df05083451e 100644 --- a/pkgs/development/python-modules/nerfacc/default.nix +++ b/pkgs/development/python-modules/nerfacc/default.nix @@ -12,13 +12,13 @@ config, cudaSupport ? config.cudaSupport, cudaPackages, -}: +}@inputs: buildPythonPackage rec { pname = "nerfacc"; version = "0.5.3"; pyproject = true; - stdenv = if cudaSupport then cudaPackages.backendStdenv else stdenv; + stdenv = if cudaSupport then cudaPackages.backendStdenv else inputs.stdenv; src = fetchFromGitHub { owner = "nerfstudio-project"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3168d602e1b96..4d19213a7caa4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16888,6 +16888,7 @@ with pkgs; tbb_2021_11 = callPackage ../development/libraries/tbb { }; # many packages still fail with latest version tbb = tbb_2020_3; + tbbLatest = tbb_2021_11; terra = callPackage ../development/compilers/terra { inherit (darwin) libobjc; From 85036cabd2c3ee0eb491c95570168817f5c801ac Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 18 Jun 2024 19:10:17 +0000 Subject: [PATCH 7/8] fixup! fixup! nerfstudio: init at 1.1.2 --- pkgs/by-name/op/open3d/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/op/open3d/package.nix b/pkgs/by-name/op/open3d/package.nix index 651647bd752e9..a9e568cfccbd1 100644 --- a/pkgs/by-name/op/open3d/package.nix +++ b/pkgs/by-name/op/open3d/package.nix @@ -3,6 +3,7 @@ stdenv, fetchFromGitHub, assimp, + uvatlas, blas, boringssl, cmake, @@ -118,6 +119,10 @@ stdenv.mkDerivation rec { "/usr/bin/matc" \ "${lib.getExe' filament "matc"}" + substituteInPlace cpp/open3d/t/io/file_format/FilePCD.cpp cpp/open3d/io/file_format/FilePCD.cpp \ + --replace-fail \ + '' \ + '' sed -i "1r $extraFindPackagesPath" 3rdparty/find_dependencies.cmake rm -rf build/filament @@ -138,6 +143,10 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = [ # Remove noise "-Wno-int-to-pointer-cast" + + # Whatever is wrogn with their buld system + "-I${lib.getDev liblzf}/include" + "-I${lib.getDev embree}/include" ]; cmakeBuildDir = "builddir"; # build/ is checked in git @@ -154,6 +163,7 @@ stdenv.mkDerivation rec { assimp blas boringssl + uvatlas curl draco.tinygltf eigen From e84b60ee8ea184d1e4e311aeab405ed00196319b Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Wed, 30 Oct 2024 23:35:21 +0100 Subject: [PATCH 8/8] fixup! fixup! fixup! nerfstudio: init at 1.1.2 --- pkgs/by-name/st/stdgpu/package.nix | 77 +++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/st/stdgpu/package.nix b/pkgs/by-name/st/stdgpu/package.nix index dedbfb3dd6a8c..f98c55fb735b7 100644 --- a/pkgs/by-name/st/stdgpu/package.nix +++ b/pkgs/by-name/st/stdgpu/package.nix @@ -3,28 +3,91 @@ stdenv, fetchFromGitHub, cmake, + thrust, + config, + cudaPackages ? {}, + cudaSupport ? config.cudaSupport or false, }: -stdenv.mkDerivation rec { +let + + benchmark_src = fetchFromGitHub { + owner = "google"; + repo = "benchmark"; + rev = "refs/tags/v1.8.4"; + hash = "sha256-O+1ZHaNHSkKz3PlKDyI94LqiLtjyrKxjOIi8Q236/MI="; + }; + + googletest_src = fetchFromGitHub { + owner = "google"; + repo = "googletest"; + rev = "refs/tags/v1.14.0"; + hash = "sha256-t0RchAHTJbuI5YW4uyBPykTvcjy90JW9AOPNjIhwh6U="; + }; + +in + +stdenv.mkDerivation (finalAttrs: { pname = "stdgpu"; version = "1.3.0"; src = fetchFromGitHub { owner = "stotko"; repo = "stdgpu"; - rev = version; + rev = finalAttrs.version; hash = "sha256-avjNeo5E/ENIVqpe+VxvH6QmbA3OVJ7TPjLUSt1qWkY="; }; - nativeBuildInputs = [ cmake ]; + # prefetch google/benchmark and google/googletest + postPatch = lib.optionalString finalAttrs.doCheck '' + substituteInPlace benchmarks/CMakeLists.txt \ + --replace-fail \ + "URL https://github.com/google/benchmark/archive/${benchmark_src.rev}.zip" \ + "SOURCE_DIR ${benchmark_src}" + + substituteInPlace tests/CMakeLists.txt \ + --replace-fail \ + "URL https://github.com/google/googletest/archive/${googletest_src.rev}.zip" \ + "SOURCE_DIR ${googletest_src}" + ''; + + nativeBuildInputs = [ + cmake + ] ++ lib.optionals cudaSupport [ + cudaPackages.cuda_nvcc + cudaPackages.cuda_cudart + cudaPackages.cuda_cccl.dev # thrust + ]; + + cmakeFlags = [ + (lib.cmakeBool "BUILD_SHARED_LIBS" true) + (lib.cmakeBool "STDGPU_BUILD_TESTS" finalAttrs.doCheck) + (lib.cmakeBool "STDGPU_BUILD_BENCHMARKS" finalAttrs.doCheck) + (lib.cmakeBool "STDGPU_BACKEND_OPENMP" true) + (lib.cmakeBool "STDGPU_BACKEND_HIP" false) # TODO + (lib.cmakeBool "STDGPU_BACKEND_CUDA" cudaSupport) + ] ++ lib.optionals cudaSupport [ + # otherwise determined at build time in ./cmake/cuda/compute_capability.cpp + (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" ( + lib.concatStringsSep ";" (with cudaPackages.flags; map dropDot cudaCapabilities) + )) + (lib.cmakeFeature "STDGPU_CUDA_COMPUTE_CAPABILITIES" ( + lib.concatStringsSep ";" (with cudaPackages.flags; map dropDot cudaCapabilities) + )) + ]; + + # requires a CUDA device + # also https://github.com/stotko/stdgpu/pull/292 is required to build tests with cuda12, it cannot be cherry-picked + doCheck = false; meta = { - description = "Stdgpu: Efficient STL-like Data Structures on the GPU"; + description = "Efficient STL-like Data Structures on the GPU"; homepage = "https://github.com/stotko/stdgpu"; - changelog = "https://github.com/stotko/stdgpu/blob/${src.rev}/CHANGELOG.md"; + changelog = "https://github.com/stotko/stdgpu/blob/${finalAttrs.src.rev}/CHANGELOG.md"; license = lib.licenses.asl20; - maintainers = with lib.maintainers; [ SomeoneSerge ]; + maintainers = with lib.maintainers; [ SomeoneSerge pbsds ]; mainProgram = "stdgpu"; platforms = lib.platforms.all; + broken = !cudaSupport; # cpu-mode requires nvcc to be present }; -} +})