Skip to content

Commit

Permalink
Rename produced libraries (Do not merge)
Browse files Browse the repository at this point in the history
  • Loading branch information
belijzajac committed Jun 12, 2023
1 parent 54c94fc commit a430275
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion blst/csharp.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ index d5fa3dc..0a77983 100644
FIELD_ELEMENTS_PER_BLOB ?= 4096
INCLUDE_DIRS = ../../src ../../blst/bindings
-TARGETS = ckzg.c ../../src/c_kzg_4844.c ../../blst/$(BLST_OBJ)
+TARGETS = ckzg.c ../../../../target/release/librust-kzg-blst.a
+TARGETS = ckzg.c ../../../../target/release/rust_kzg_blst.a

CFLAGS += -O2 -Wall -Wextra -shared
CFLAGS += -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB)
Expand Down
2 changes: 1 addition & 1 deletion blst/go.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ index aa7f141..7f0f01e 100644
+// #endif
+// #include <stdlib.h>
+// #include "c_kzg_4844.h"
+// #cgo LDFLAGS: -L${SRCDIR}/../../../../target/release -lrust-kzg-blst -lm
+// #cgo LDFLAGS: -L${SRCDIR}/../../../../target/release -lrust_kzg_blst -lm
import "C"

import (
Expand Down
2 changes: 1 addition & 1 deletion blst/java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ index 4eb21ce..184e501 100644
INCLUDE_DIRS = ../../src ../../blst/bindings

-TARGETS=c_kzg_4844_jni.c ../../src/c_kzg_4844.c ../../lib/libblst.a
+TARGETS=c_kzg_4844_jni.c ../../../../target/release/librust-kzg-blst.a
+TARGETS=c_kzg_4844_jni.c ../../../../target/release/rust_kzg_blst.a

CC_FLAGS=
OPTIMIZATION_LEVEL=-O2
Expand Down
2 changes: 1 addition & 1 deletion blst/nodejs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ index 69be3ef..8213dd7 100644
"<!@(node -p \"require('node-addon-api').include\")"
],
+ "libraries": [
+ "<(module_root_dir)/../../../../target/release/librust-kzg-blst.a"
+ "<(module_root_dir)/../../../../target/release/rust_kzg_blst.a"
+ ],
"defines": ["NAPI_DISABLE_CPP_EXCEPTIONS"],
"conditions": [
Expand Down
2 changes: 1 addition & 1 deletion blst/python.patch
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ index bf969cb..9179129 100644
- library_dirs=["../../lib"],
- libraries=["blst"])])
+ library_dirs=["../../lib", "../../../../target/release"],
+ libraries=["rust-kzg-blst"])])
+ libraries=["rust_kzg_blst"])])

if __name__ == "__main__":
main()
Expand Down
2 changes: 2 additions & 0 deletions blst/run-c-kzg-4844-benches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ else
cargo rustc --release --crate-type=staticlib
fi

mv ../target/release/librust_kzg_blst.a ../target/release/rust_kzg_blst.a

###################### cloning c-kzg-4844 ######################

print_msg "Cloning c-kzg-4844"
Expand Down
2 changes: 2 additions & 0 deletions blst/run-c-kzg-4844-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ else
cargo rustc --release --crate-type=staticlib
fi

mv ../target/release/librust_kzg_blst.a ../target/release/rust_kzg_blst.a

###################### cloning c-kzg-4844 ######################

print_msg "Removing existing c-kzg-4844"
Expand Down
2 changes: 1 addition & 1 deletion blst/rust.patch
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ index d2dba36..ac4153f 100644
// Finally, tell cargo this provides ckzg
- println!("cargo:rustc-link-lib=ckzg");
+ println!("cargo:rustc-link-search={}", rust_kzg_target_dir.display());
+ println!("cargo:rustc-link-lib=rust-kzg-blst");
+ println!("cargo:rustc-link-lib=rust_kzg_blst");
}

fn make_bindings<P>(
Expand Down
2 changes: 1 addition & 1 deletion mcl/kzg/csharp.patch
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ index d5fa3dc..0a77983 100644
FIELD_ELEMENTS_PER_BLOB ?= 4096
INCLUDE_DIRS = ../../src ../../blst/bindings
-TARGETS = ckzg.c ../../src/c_kzg_4844.c ../../blst/$(BLST_OBJ)
+TARGETS = ckzg.c ../../../../../target/release/librust-kzg-mcl.a
+TARGETS = ckzg.c ../../../../../target/release/rust_kzg_mcl.a

CFLAGS += -O2 -Wall -Wextra -shared
CFLAGS += -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB)
Expand Down
2 changes: 1 addition & 1 deletion mcl/kzg/go.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ index aa7f141..1357122 100644
+// #endif
+// #include <stdlib.h>
+// #include "c_kzg_4844.h"
+// #cgo LDFLAGS: -L${SRCDIR}/../../../../../target/release -L${SRCDIR}/../../lib -lrust-kzg-mcl -lstdc++ -lblst -lm
+// #cgo LDFLAGS: -L${SRCDIR}/../../../../../target/release -L${SRCDIR}/../../lib -lrust_kzg_mcl -lstdc++ -lblst -lm
import "C"

import (
Expand Down
2 changes: 1 addition & 1 deletion mcl/kzg/java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ index 4eb21ce..184e501 100644
INCLUDE_DIRS = ../../src ../../blst/bindings

-TARGETS=c_kzg_4844_jni.c ../../src/c_kzg_4844.c ../../lib/libblst.a
+TARGETS=c_kzg_4844_jni.c ../../../../../target/release/librust-kzg-mcl.a
+TARGETS=c_kzg_4844_jni.c ../../../../../target/release/rust_kzg_mcl.a

CC_FLAGS=
OPTIMIZATION_LEVEL=-O2
Expand Down
2 changes: 1 addition & 1 deletion mcl/kzg/nodejs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ index 69be3ef..8213dd7 100644
"<!@(node -p \"require('node-addon-api').include\")"
],
+ "libraries": [
+ "<(module_root_dir)/../../../../../target/release/librust-kzg-mcl.a"
+ "<(module_root_dir)/../../../../../target/release/rust_kzg_mcl.a"
+ ],
"defines": ["NAPI_DISABLE_CPP_EXCEPTIONS"],
"conditions": [
Expand Down
2 changes: 1 addition & 1 deletion mcl/kzg/python.patch
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ index bf969cb..9179129 100644
- library_dirs=["../../lib"],
- libraries=["blst"])])
+ library_dirs=["../../lib", "../../../../../target/release"],
+ libraries=["rust-kzg-mcl", "stdc++"])])
+ libraries=["rust_kzg_mcl", "stdc++"])])

if __name__ == "__main__":
main()
Expand Down
2 changes: 2 additions & 0 deletions mcl/kzg/run-c-kzg-4844-benches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ else
cargo rustc --release --crate-type=staticlib
fi

mv ../../target/release/librust_kzg_mcl.a ../../target/release/rust_kzg_mcl.a

###################### cloning c-kzg-4844 ######################

print_msg "Cloning c-kzg-4844"
Expand Down
2 changes: 2 additions & 0 deletions mcl/kzg/run-c-kzg-4844-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ else
cargo rustc --release --crate-type=staticlib
fi

mv ../../target/release/librust_kzg_mcl.a ../../target/release/rust_kzg_mcl.a

###################### cloning c-kzg-4844 ######################

print_msg "Cloning c-kzg-4844"
Expand Down
2 changes: 1 addition & 1 deletion mcl/kzg/rust.patch
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ index d2dba36..ac4153f 100644
// Finally, tell cargo this provides ckzg
- println!("cargo:rustc-link-lib=ckzg");
+ println!("cargo:rustc-link-search={}", rust_kzg_target_dir.display());
+ println!("cargo:rustc-link-lib=rust-kzg-mcl");
+ println!("cargo:rustc-link-lib=rust_kzg_mcl");
}

fn make_bindings<P>(
Expand Down

0 comments on commit a430275

Please sign in to comment.