Skip to content

Commit

Permalink
Add nanobind 2.2.0 and 2.4.0 (#3459)
Browse files Browse the repository at this point in the history
  • Loading branch information
keith authored Dec 18, 2024
1 parent 121f755 commit 7a5f0ea
Show file tree
Hide file tree
Showing 11 changed files with 243 additions and 1 deletion.
9 changes: 9 additions & 0 deletions modules/nanobind/2.2.0/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module(
name = "nanobind",
version = "2.2.0",
compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "robin-map", version = "1.3.0")
bazel_dep(name = "rules_python", version = "0.36.0")
66 changes: 66 additions & 0 deletions modules/nanobind/2.2.0/patches/add_build_file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
diff --git a/BUILD.bazel b/BUILD.bazel
new file mode 100644
index 0000000..9e13986
--- /dev/null
+++ b/BUILD.bazel
@@ -0,0 +1,60 @@
+config_setting(
+ name = "msvc_compiler",
+ flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc-cl"},
+)
+
+cc_library(
+ name = "nanobind",
+ srcs = [
+ "include/nanobind/stl/detail/nb_dict.h",
+ "include/nanobind/stl/detail/nb_list.h",
+ "include/nanobind/stl/detail/traits.h",
+ "src/buffer.h",
+ "src/common.cpp",
+ "src/error.cpp",
+ "src/hash.h",
+ "src/implicit.cpp",
+ "src/nb_enum.cpp",
+ "src/nb_func.cpp",
+ "src/nb_internals.cpp",
+ "src/nb_internals.h",
+ "src/nb_ndarray.cpp",
+ "src/nb_static_property.cpp",
+ "src/nb_type.cpp",
+ "src/trampoline.cpp",
+ ],
+ hdrs = glob(
+ include = [
+ "include/nanobind/*.h",
+ "include/nanobind/eigen/*.h",
+ "include/nanobind/stl/*.h",
+ "include/nanobind/stl/detail/*.h",
+ ],
+ allow_empty = False,
+ ),
+ additional_linker_inputs = select({
+ "@platforms//os:macos": [":cmake/darwin-ld-cpython.sym"],
+ "//conditions:default": [],
+ }),
+ copts = select({
+ ":msvc_compiler": ["/std:c++17"],
+ "//conditions:default": [
+ "--std=c++17",
+ "-fexceptions",
+ "-frtti",
+ ],
+ }),
+ includes = ["include"],
+ linkopts = select({
+ "@platforms//os:macos": [
+ "-Wl,@$(location :cmake/darwin-ld-cpython.sym)",
+ ],
+ "//conditions:default": [],
+ }),
+ strip_include_prefix = "include",
+ visibility = ["//visibility:public"],
+ deps = [
+ "@robin-map//:robin-map",
+ "@rules_python//python/cc:current_py_cc_headers",
+ ],
+)
15 changes: 15 additions & 0 deletions modules/nanobind/2.2.0/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/MODULE.bazel b/MODULE.bazel
new file mode 100644
index 0000000..0f3af81
--- /dev/null
+++ b/MODULE.bazel
@@ -0,0 +1,9 @@
+module(
+ name = "nanobind",
+ version = "2.2.0",
+ compatibility_level = 1,
+)
+
+bazel_dep(name = "platforms", version = "0.0.10")
+bazel_dep(name = "robin-map", version = "1.3.0")
+bazel_dep(name = "rules_python", version = "0.36.0")
20 changes: 20 additions & 0 deletions modules/nanobind/2.2.0/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
- windows
bazel:
- 8.x
- 7.x
- 6.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_flags:
- '--process_headers_in_dependencies'
build_targets:
- '@nanobind//:nanobind'
10 changes: 10 additions & 0 deletions modules/nanobind/2.2.0/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"integrity": "sha256-v7/H5XWfFmnk3bSHUrHdxWR9FDDpRhTW+GJt8dUI5lo=",
"strip_prefix": "nanobind-2.2.0",
"url": "https://github.com/wjakob/nanobind/archive/refs/tags/v2.2.0.tar.gz",
"patch_strip": 1,
"patches": {
"add_build_file.patch": "sha256-Zk/5dnSPAx20c73AFLo/x57QxYZ6RnRToAbVzNiFnSo=",
"module_dot_bazel.patch": "sha256-QAk5sP3cFaj3aXUQH6MAaFcq9TzH/7db6tMHov/n+lk="
}
}
9 changes: 9 additions & 0 deletions modules/nanobind/2.4.0/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module(
name = "nanobind",
version = "2.4.0",
compatibility_level = 1,
)

bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "robin-map", version = "1.3.0")
bazel_dep(name = "rules_python", version = "0.36.0")
66 changes: 66 additions & 0 deletions modules/nanobind/2.4.0/patches/add_build_file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
diff --git a/BUILD.bazel b/BUILD.bazel
new file mode 100644
index 0000000..9e13986
--- /dev/null
+++ b/BUILD.bazel
@@ -0,0 +1,60 @@
+config_setting(
+ name = "msvc_compiler",
+ flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc-cl"},
+)
+
+cc_library(
+ name = "nanobind",
+ srcs = [
+ "include/nanobind/stl/detail/nb_dict.h",
+ "include/nanobind/stl/detail/nb_list.h",
+ "include/nanobind/stl/detail/traits.h",
+ "src/buffer.h",
+ "src/common.cpp",
+ "src/error.cpp",
+ "src/hash.h",
+ "src/implicit.cpp",
+ "src/nb_enum.cpp",
+ "src/nb_func.cpp",
+ "src/nb_internals.cpp",
+ "src/nb_internals.h",
+ "src/nb_ndarray.cpp",
+ "src/nb_static_property.cpp",
+ "src/nb_type.cpp",
+ "src/trampoline.cpp",
+ ],
+ hdrs = glob(
+ include = [
+ "include/nanobind/*.h",
+ "include/nanobind/eigen/*.h",
+ "include/nanobind/stl/*.h",
+ "include/nanobind/stl/detail/*.h",
+ ],
+ allow_empty = False,
+ ),
+ additional_linker_inputs = select({
+ "@platforms//os:macos": [":cmake/darwin-ld-cpython.sym"],
+ "//conditions:default": [],
+ }),
+ copts = select({
+ ":msvc_compiler": ["/std:c++17"],
+ "//conditions:default": [
+ "--std=c++17",
+ "-fexceptions",
+ "-frtti",
+ ],
+ }),
+ includes = ["include"],
+ linkopts = select({
+ "@platforms//os:macos": [
+ "-Wl,@$(location :cmake/darwin-ld-cpython.sym)",
+ ],
+ "//conditions:default": [],
+ }),
+ strip_include_prefix = "include",
+ visibility = ["//visibility:public"],
+ deps = [
+ "@robin-map//:robin-map",
+ "@rules_python//python/cc:current_py_cc_headers",
+ ],
+)
15 changes: 15 additions & 0 deletions modules/nanobind/2.4.0/patches/module_dot_bazel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/MODULE.bazel b/MODULE.bazel
new file mode 100644
index 0000000..0f3af81
--- /dev/null
+++ b/MODULE.bazel
@@ -0,0 +1,9 @@
+module(
+ name = "nanobind",
+ version = "2.4.0",
+ compatibility_level = 1,
+)
+
+bazel_dep(name = "platforms", version = "0.0.10")
+bazel_dep(name = "robin-map", version = "1.3.0")
+bazel_dep(name = "rules_python", version = "0.36.0")
20 changes: 20 additions & 0 deletions modules/nanobind/2.4.0/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
matrix:
platform:
- debian10
- ubuntu2004
- macos
- macos_arm64
- windows
bazel:
- 8.x
- 7.x
- 6.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_flags:
- '--process_headers_in_dependencies'
build_targets:
- '@nanobind//:nanobind'
10 changes: 10 additions & 0 deletions modules/nanobind/2.4.0/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"integrity": "sha256-uzXertfvrFAp7R4ziApBVjg1L3V9SSB6jmAT/vtsSac=",
"strip_prefix": "nanobind-2.4.0",
"url": "https://github.com/wjakob/nanobind/archive/refs/tags/v2.4.0.tar.gz",
"patch_strip": 1,
"patches": {
"add_build_file.patch": "sha256-Zk/5dnSPAx20c73AFLo/x57QxYZ6RnRToAbVzNiFnSo=",
"module_dot_bazel.patch": "sha256-gkA6phB5+AIiXkQ5fOQwyNzyMrIWdKtf7QaJ0/stjj8="
}
}
4 changes: 3 additions & 1 deletion modules/nanobind/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
],
"versions": [
"1.2.0",
"2.1.0"
"2.1.0",
"2.2.0",
"2.4.0"
],
"yanked_versions": {}
}

0 comments on commit 7a5f0ea

Please sign in to comment.