Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: python311Packages.nerfstudio: init at 1.1.2 #320599

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions pkgs/by-name/di/directxmath/package.nix
Original file line number Diff line number Diff line change
@@ -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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rev = "feb2024";
rev = "refs/tags/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;
};
}
134 changes: 134 additions & 0 deletions pkgs/by-name/fi/filament/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
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}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
rev = "v${version}";
rev = "refs/tags/v${version}";

hash = "sha256-hKyyYSGvQnaS8vnYkm92PiSeMvjcIXza11ZvymhC+zk=";
};

# 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)
'';

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 "\\|" [
"draco"
"robin-map"

# 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"
]
}\).*$//' CMakeLists.txt

substituteInPlace CMakeLists.txt \
--replace-fail "# Sub-projects" "# Sub-projects
$extraFindPackages"

# Uses the otherwise undeclared uint32_t:
sed -i "1i#include <cstdint>" tools/glslminifier/src/GlslMinify.h

# An undeclared snprintf
sed -i "1i#include <stdio.h>" third_party/vkmemalloc/tnt/../include/vk_mem_alloc.h

# std::memcpy
sed -i "1i#include <cstring>" 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 .
'';

nativeBuildInputs = [
cmake
python3Packages.python
spirv-tools
spirv-cross
];
buildInputs =
[
# assimp
draco
glslang
gtest
# imgui
meshoptimizer
robin-map
spirv-headers
stb
]
++ 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; {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
meta = with lib; {
meta = {

description = "Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2";
description = "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; [ ];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you add yourself ?

mainProgram = "filament";
platforms = platforms.all;
};
}
25 changes: 25 additions & 0 deletions pkgs/by-name/li/liblzf/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
lib,
stdenv,
fetchzip,
}:

stdenv.mkDerivation {
name = "liblzf";
src = fetchzip {
urls = [
"http://dist.schmorp.de/liblzf/Attic/liblzf-3.6.tar.gz"
];
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;
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From f5afa1c4c47db3ea3b24f9eb33a4efceafa10e3e Mon Sep 17 00:00:00 2001
From: Someone Serge <[email protected]>
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

66 changes: 66 additions & 0 deletions pkgs/by-name/op/open3d/Findfilament.cmake
Original file line number Diff line number Diff line change
@@ -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)
18 changes: 18 additions & 0 deletions pkgs/by-name/op/open3d/Findliblzf.cmake
Original file line number Diff line number Diff line change
@@ -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)
Loading