Skip to content

Commit 7a5f0ea

Browse files
authored
Add nanobind 2.2.0 and 2.4.0 (#3459)
1 parent 121f755 commit 7a5f0ea

File tree

11 files changed

+243
-1
lines changed

11 files changed

+243
-1
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module(
2+
name = "nanobind",
3+
version = "2.2.0",
4+
compatibility_level = 1,
5+
)
6+
7+
bazel_dep(name = "platforms", version = "0.0.10")
8+
bazel_dep(name = "robin-map", version = "1.3.0")
9+
bazel_dep(name = "rules_python", version = "0.36.0")
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
diff --git a/BUILD.bazel b/BUILD.bazel
2+
new file mode 100644
3+
index 0000000..9e13986
4+
--- /dev/null
5+
+++ b/BUILD.bazel
6+
@@ -0,0 +1,60 @@
7+
+config_setting(
8+
+ name = "msvc_compiler",
9+
+ flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc-cl"},
10+
+)
11+
+
12+
+cc_library(
13+
+ name = "nanobind",
14+
+ srcs = [
15+
+ "include/nanobind/stl/detail/nb_dict.h",
16+
+ "include/nanobind/stl/detail/nb_list.h",
17+
+ "include/nanobind/stl/detail/traits.h",
18+
+ "src/buffer.h",
19+
+ "src/common.cpp",
20+
+ "src/error.cpp",
21+
+ "src/hash.h",
22+
+ "src/implicit.cpp",
23+
+ "src/nb_enum.cpp",
24+
+ "src/nb_func.cpp",
25+
+ "src/nb_internals.cpp",
26+
+ "src/nb_internals.h",
27+
+ "src/nb_ndarray.cpp",
28+
+ "src/nb_static_property.cpp",
29+
+ "src/nb_type.cpp",
30+
+ "src/trampoline.cpp",
31+
+ ],
32+
+ hdrs = glob(
33+
+ include = [
34+
+ "include/nanobind/*.h",
35+
+ "include/nanobind/eigen/*.h",
36+
+ "include/nanobind/stl/*.h",
37+
+ "include/nanobind/stl/detail/*.h",
38+
+ ],
39+
+ allow_empty = False,
40+
+ ),
41+
+ additional_linker_inputs = select({
42+
+ "@platforms//os:macos": [":cmake/darwin-ld-cpython.sym"],
43+
+ "//conditions:default": [],
44+
+ }),
45+
+ copts = select({
46+
+ ":msvc_compiler": ["/std:c++17"],
47+
+ "//conditions:default": [
48+
+ "--std=c++17",
49+
+ "-fexceptions",
50+
+ "-frtti",
51+
+ ],
52+
+ }),
53+
+ includes = ["include"],
54+
+ linkopts = select({
55+
+ "@platforms//os:macos": [
56+
+ "-Wl,@$(location :cmake/darwin-ld-cpython.sym)",
57+
+ ],
58+
+ "//conditions:default": [],
59+
+ }),
60+
+ strip_include_prefix = "include",
61+
+ visibility = ["//visibility:public"],
62+
+ deps = [
63+
+ "@robin-map//:robin-map",
64+
+ "@rules_python//python/cc:current_py_cc_headers",
65+
+ ],
66+
+)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/MODULE.bazel b/MODULE.bazel
2+
new file mode 100644
3+
index 0000000..0f3af81
4+
--- /dev/null
5+
+++ b/MODULE.bazel
6+
@@ -0,0 +1,9 @@
7+
+module(
8+
+ name = "nanobind",
9+
+ version = "2.2.0",
10+
+ compatibility_level = 1,
11+
+)
12+
+
13+
+bazel_dep(name = "platforms", version = "0.0.10")
14+
+bazel_dep(name = "robin-map", version = "1.3.0")
15+
+bazel_dep(name = "rules_python", version = "0.36.0")
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
matrix:
2+
platform:
3+
- debian10
4+
- ubuntu2004
5+
- macos
6+
- macos_arm64
7+
- windows
8+
bazel:
9+
- 8.x
10+
- 7.x
11+
- 6.x
12+
tasks:
13+
verify_targets:
14+
name: Verify build targets
15+
platform: ${{ platform }}
16+
bazel: ${{ bazel }}
17+
build_flags:
18+
- '--process_headers_in_dependencies'
19+
build_targets:
20+
- '@nanobind//:nanobind'

modules/nanobind/2.2.0/source.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"integrity": "sha256-v7/H5XWfFmnk3bSHUrHdxWR9FDDpRhTW+GJt8dUI5lo=",
3+
"strip_prefix": "nanobind-2.2.0",
4+
"url": "https://github.com/wjakob/nanobind/archive/refs/tags/v2.2.0.tar.gz",
5+
"patch_strip": 1,
6+
"patches": {
7+
"add_build_file.patch": "sha256-Zk/5dnSPAx20c73AFLo/x57QxYZ6RnRToAbVzNiFnSo=",
8+
"module_dot_bazel.patch": "sha256-QAk5sP3cFaj3aXUQH6MAaFcq9TzH/7db6tMHov/n+lk="
9+
}
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module(
2+
name = "nanobind",
3+
version = "2.4.0",
4+
compatibility_level = 1,
5+
)
6+
7+
bazel_dep(name = "platforms", version = "0.0.10")
8+
bazel_dep(name = "robin-map", version = "1.3.0")
9+
bazel_dep(name = "rules_python", version = "0.36.0")
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
diff --git a/BUILD.bazel b/BUILD.bazel
2+
new file mode 100644
3+
index 0000000..9e13986
4+
--- /dev/null
5+
+++ b/BUILD.bazel
6+
@@ -0,0 +1,60 @@
7+
+config_setting(
8+
+ name = "msvc_compiler",
9+
+ flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc-cl"},
10+
+)
11+
+
12+
+cc_library(
13+
+ name = "nanobind",
14+
+ srcs = [
15+
+ "include/nanobind/stl/detail/nb_dict.h",
16+
+ "include/nanobind/stl/detail/nb_list.h",
17+
+ "include/nanobind/stl/detail/traits.h",
18+
+ "src/buffer.h",
19+
+ "src/common.cpp",
20+
+ "src/error.cpp",
21+
+ "src/hash.h",
22+
+ "src/implicit.cpp",
23+
+ "src/nb_enum.cpp",
24+
+ "src/nb_func.cpp",
25+
+ "src/nb_internals.cpp",
26+
+ "src/nb_internals.h",
27+
+ "src/nb_ndarray.cpp",
28+
+ "src/nb_static_property.cpp",
29+
+ "src/nb_type.cpp",
30+
+ "src/trampoline.cpp",
31+
+ ],
32+
+ hdrs = glob(
33+
+ include = [
34+
+ "include/nanobind/*.h",
35+
+ "include/nanobind/eigen/*.h",
36+
+ "include/nanobind/stl/*.h",
37+
+ "include/nanobind/stl/detail/*.h",
38+
+ ],
39+
+ allow_empty = False,
40+
+ ),
41+
+ additional_linker_inputs = select({
42+
+ "@platforms//os:macos": [":cmake/darwin-ld-cpython.sym"],
43+
+ "//conditions:default": [],
44+
+ }),
45+
+ copts = select({
46+
+ ":msvc_compiler": ["/std:c++17"],
47+
+ "//conditions:default": [
48+
+ "--std=c++17",
49+
+ "-fexceptions",
50+
+ "-frtti",
51+
+ ],
52+
+ }),
53+
+ includes = ["include"],
54+
+ linkopts = select({
55+
+ "@platforms//os:macos": [
56+
+ "-Wl,@$(location :cmake/darwin-ld-cpython.sym)",
57+
+ ],
58+
+ "//conditions:default": [],
59+
+ }),
60+
+ strip_include_prefix = "include",
61+
+ visibility = ["//visibility:public"],
62+
+ deps = [
63+
+ "@robin-map//:robin-map",
64+
+ "@rules_python//python/cc:current_py_cc_headers",
65+
+ ],
66+
+)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/MODULE.bazel b/MODULE.bazel
2+
new file mode 100644
3+
index 0000000..0f3af81
4+
--- /dev/null
5+
+++ b/MODULE.bazel
6+
@@ -0,0 +1,9 @@
7+
+module(
8+
+ name = "nanobind",
9+
+ version = "2.4.0",
10+
+ compatibility_level = 1,
11+
+)
12+
+
13+
+bazel_dep(name = "platforms", version = "0.0.10")
14+
+bazel_dep(name = "robin-map", version = "1.3.0")
15+
+bazel_dep(name = "rules_python", version = "0.36.0")
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
matrix:
2+
platform:
3+
- debian10
4+
- ubuntu2004
5+
- macos
6+
- macos_arm64
7+
- windows
8+
bazel:
9+
- 8.x
10+
- 7.x
11+
- 6.x
12+
tasks:
13+
verify_targets:
14+
name: Verify build targets
15+
platform: ${{ platform }}
16+
bazel: ${{ bazel }}
17+
build_flags:
18+
- '--process_headers_in_dependencies'
19+
build_targets:
20+
- '@nanobind//:nanobind'

modules/nanobind/2.4.0/source.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"integrity": "sha256-uzXertfvrFAp7R4ziApBVjg1L3V9SSB6jmAT/vtsSac=",
3+
"strip_prefix": "nanobind-2.4.0",
4+
"url": "https://github.com/wjakob/nanobind/archive/refs/tags/v2.4.0.tar.gz",
5+
"patch_strip": 1,
6+
"patches": {
7+
"add_build_file.patch": "sha256-Zk/5dnSPAx20c73AFLo/x57QxYZ6RnRToAbVzNiFnSo=",
8+
"module_dot_bazel.patch": "sha256-gkA6phB5+AIiXkQ5fOQwyNzyMrIWdKtf7QaJ0/stjj8="
9+
}
10+
}

0 commit comments

Comments
 (0)