ports/contrib (3.5): cbindgen: 0.14.1 -> 0.14.2
commit 2e0b3cfdce0af4aa442cd4207936ddb156a83b7e Author: Danny Rawlins <monster.romster@gmail.com> Date: Fri May 1 23:44:14 2020 +1000 cbindgen: 0.14.1 -> 0.14.2 diff --git a/cbindgen/.signature b/cbindgen/.signature index b952b06be..beb705569 100644 --- a/cbindgen/.signature +++ b/cbindgen/.signature @@ -1,6 +1,5 @@ untrusted comment: verify with /etc/ports/contrib.pub -RWSagIOpLGJF3xCf2TI1DXJYvmieZjBmtc5RRkLc6qD/k4PslHodviGG8HF4v/EN3n25PcX3bmjNKRenu6Oe+jVd6eUPxNgqnwo= -SHA256 (Pkgfile) = c8dc68db940ab5f98ac4d7b1090f8a0ccb8cf71f295d9f5798c49191bfe66719 +RWSagIOpLGJF3yaXQH1zZPhx+vR2oB1cAIeWGLERimm6mBBBbR+bJu+6dhfJ7n2R48JDePWtowyQElSMZYAfwSKvfQ76pNQLfAQ= +SHA256 (Pkgfile) = eaedcb3c3533cbff12f6a7eb092711ee804c961690c82380a65298bb69474627 SHA256 (.footprint) = fd60992957bd0010460d49684c69464200651af797acdb98547f4847fc9f3f3c -SHA256 (cbindgen-v0.14.1.tar.gz) = 43674216b0668501e5c4582d60341e9445a3fe9e35831311dcfff7a223264a4b -SHA256 (firefox.patch) = d260660e51a751c9dd6a3bc721c31898f01fe6a373963d37e272f35ffc34b6e8 +SHA256 (cbindgen-v0.14.2.tar.gz) = 8047238adf82fbd33d92c362585de24d80fe594cab0909c5bf91d046f1b598ff diff --git a/cbindgen/Pkgfile b/cbindgen/Pkgfile index 7ef1b23cf..0b2374107 100644 --- a/cbindgen/Pkgfile +++ b/cbindgen/Pkgfile @@ -5,17 +5,13 @@ # Optional: sccache name=cbindgen -version=0.14.1 +version=0.14.2 release=1 -source=(https://github.com/eqrion/cbindgen/archive/v$version/$name-v$version.tar.gz - firefox.patch) +source=(https://github.com/eqrion/cbindgen/archive/v$version/$name-v$version.tar.gz) build() { cd $name-$version - # https://github.com/eqrion/cbindgen/issues/500 - patch -p1 -R -i $SRC/firefox.patch - prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache mkdir "$PKGMK_SOURCE_DIR/rust" || true export CARGO_HOME="$PKGMK_SOURCE_DIR/rust" diff --git a/cbindgen/firefox.patch b/cbindgen/firefox.patch deleted file mode 100644 index ffb06cc76..000000000 --- a/cbindgen/firefox.patch +++ /dev/null @@ -1,255 +0,0 @@ -From ec1631f3e47686e6e0c1b7641bb08b0e39c59250 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@crisal.io> -Date: Tue, 31 Mar 2020 17:41:48 +0200 -Subject: [PATCH] Allow excluding monomorph structs in C mode. - -Fixes #500. ---- - src/bindgen/library.rs | 4 +++- - .../both/exclude_generic_monomorph.c | 15 ++++++++++++ - .../both/exclude_generic_monomorph.compat.c | 23 +++++++++++++++++++ - .../expectations/exclude_generic_monomorph.c | 15 ++++++++++++ - .../exclude_generic_monomorph.compat.c | 23 +++++++++++++++++++ - .../exclude_generic_monomorph.cpp | 15 ++++++++++++ - .../tag/exclude_generic_monomorph.c | 15 ++++++++++++ - .../tag/exclude_generic_monomorph.compat.c | 23 +++++++++++++++++++ - tests/rust/exclude_generic_monomorph.rs | 10 ++++++++ - tests/rust/exclude_generic_monomorph.toml | 11 +++++++++ - 10 files changed, 153 insertions(+), 1 deletion(-) - create mode 100644 tests/expectations/both/exclude_generic_monomorph.c - create mode 100644 tests/expectations/both/exclude_generic_monomorph.compat.c - create mode 100644 tests/expectations/exclude_generic_monomorph.c - create mode 100644 tests/expectations/exclude_generic_monomorph.compat.c - create mode 100644 tests/expectations/exclude_generic_monomorph.cpp - create mode 100644 tests/expectations/tag/exclude_generic_monomorph.c - create mode 100644 tests/expectations/tag/exclude_generic_monomorph.compat.c - create mode 100644 tests/rust/exclude_generic_monomorph.rs - create mode 100644 tests/rust/exclude_generic_monomorph.toml - -diff --git a/src/bindgen/library.rs b/src/bindgen/library.rs -index 0cdd07ea..4cb0b8b8 100644 ---- a/src/bindgen/library.rs -+++ b/src/bindgen/library.rs -@@ -54,7 +54,6 @@ impl Library { - } - - pub fn generate(mut self) -> Result<Bindings, Error> { -- self.remove_excluded(); - self.transfer_annotations(); - self.simplify_standard_types(); - -@@ -67,7 +66,10 @@ impl Library { - - if self.config.language == Language::C { - self.instantiate_monomorphs(); -+ self.remove_excluded(); - self.resolve_declaration_types(); -+ } else { -+ self.remove_excluded(); - } - - self.rename_items(); -diff --git a/tests/expectations/both/exclude_generic_monomorph.c b/tests/expectations/both/exclude_generic_monomorph.c -new file mode 100644 -index 00000000..2d43ce15 ---- /dev/null -+++ b/tests/expectations/both/exclude_generic_monomorph.c -@@ -0,0 +1,15 @@ -+#include <stdint.h> -+ -+typedef uint64_t Option_Foo; -+ -+ -+#include <stdarg.h> -+#include <stdbool.h> -+#include <stdint.h> -+#include <stdlib.h> -+ -+typedef struct Bar { -+ Option_Foo foo; -+} Bar; -+ -+void root(Bar f); -diff --git a/tests/expectations/both/exclude_generic_monomorph.compat.c b/tests/expectations/both/exclude_generic_monomorph.compat.c -new file mode 100644 -index 00000000..76a0a3bb ---- /dev/null -+++ b/tests/expectations/both/exclude_generic_monomorph.compat.c -@@ -0,0 +1,23 @@ -+#include <stdint.h> -+ -+typedef uint64_t Option_Foo; -+ -+ -+#include <stdarg.h> -+#include <stdbool.h> -+#include <stdint.h> -+#include <stdlib.h> -+ -+typedef struct Bar { -+ Option_Foo foo; -+} Bar; -+ -+#ifdef __cplusplus -+extern "C" { -+#endif // __cplusplus -+ -+void root(Bar f); -+ -+#ifdef __cplusplus -+} // extern "C" -+#endif // __cplusplus -diff --git a/tests/expectations/exclude_generic_monomorph.c b/tests/expectations/exclude_generic_monomorph.c -new file mode 100644 -index 00000000..e7178367 ---- /dev/null -+++ b/tests/expectations/exclude_generic_monomorph.c -@@ -0,0 +1,15 @@ -+#include <stdint.h> -+ -+typedef uint64_t Option_Foo; -+ -+ -+#include <stdarg.h> -+#include <stdbool.h> -+#include <stdint.h> -+#include <stdlib.h> -+ -+typedef struct { -+ Option_Foo foo; -+} Bar; -+ -+void root(Bar f); -diff --git a/tests/expectations/exclude_generic_monomorph.compat.c b/tests/expectations/exclude_generic_monomorph.compat.c -new file mode 100644 -index 00000000..062e71ca ---- /dev/null -+++ b/tests/expectations/exclude_generic_monomorph.compat.c -@@ -0,0 +1,23 @@ -+#include <stdint.h> -+ -+typedef uint64_t Option_Foo; -+ -+ -+#include <stdarg.h> -+#include <stdbool.h> -+#include <stdint.h> -+#include <stdlib.h> -+ -+typedef struct { -+ Option_Foo foo; -+} Bar; -+ -+#ifdef __cplusplus -+extern "C" { -+#endif // __cplusplus -+ -+void root(Bar f); -+ -+#ifdef __cplusplus -+} // extern "C" -+#endif // __cplusplus -diff --git a/tests/expectations/exclude_generic_monomorph.cpp b/tests/expectations/exclude_generic_monomorph.cpp -new file mode 100644 -index 00000000..e7178367 ---- /dev/null -+++ b/tests/expectations/exclude_generic_monomorph.cpp -@@ -0,0 +1,15 @@ -+#include <stdint.h> -+ -+typedef uint64_t Option_Foo; -+ -+ -+#include <stdarg.h> -+#include <stdbool.h> -+#include <stdint.h> -+#include <stdlib.h> -+ -+typedef struct { -+ Option_Foo foo; -+} Bar; -+ -+void root(Bar f); -diff --git a/tests/expectations/tag/exclude_generic_monomorph.c b/tests/expectations/tag/exclude_generic_monomorph.c -new file mode 100644 -index 00000000..32686ad9 ---- /dev/null -+++ b/tests/expectations/tag/exclude_generic_monomorph.c -@@ -0,0 +1,15 @@ -+#include <stdint.h> -+ -+typedef uint64_t Option_Foo; -+ -+ -+#include <stdarg.h> -+#include <stdbool.h> -+#include <stdint.h> -+#include <stdlib.h> -+ -+struct Bar { -+ Option_Foo foo; -+}; -+ -+void root(struct Bar f); -diff --git a/tests/expectations/tag/exclude_generic_monomorph.compat.c b/tests/expectations/tag/exclude_generic_monomorph.compat.c -new file mode 100644 -index 00000000..27408515 ---- /dev/null -+++ b/tests/expectations/tag/exclude_generic_monomorph.compat.c -@@ -0,0 +1,23 @@ -+#include <stdint.h> -+ -+typedef uint64_t Option_Foo; -+ -+ -+#include <stdarg.h> -+#include <stdbool.h> -+#include <stdint.h> -+#include <stdlib.h> -+ -+struct Bar { -+ Option_Foo foo; -+}; -+ -+#ifdef __cplusplus -+extern "C" { -+#endif // __cplusplus -+ -+void root(struct Bar f); -+ -+#ifdef __cplusplus -+} // extern "C" -+#endif // __cplusplus -diff --git a/tests/rust/exclude_generic_monomorph.rs b/tests/rust/exclude_generic_monomorph.rs -new file mode 100644 -index 00000000..78fd1973 ---- /dev/null -+++ b/tests/rust/exclude_generic_monomorph.rs -@@ -0,0 +1,10 @@ -+#[repr(transparent)] -+pub struct Foo(NonZeroU64); -+ -+#[repr(C)] -+pub struct Bar { -+ foo: Option<Foo>, -+} -+ -+#[no_mangle] -+pub extern "C" fn root(f: Bar) {} -diff --git a/tests/rust/exclude_generic_monomorph.toml b/tests/rust/exclude_generic_monomorph.toml -new file mode 100644 -index 00000000..82d33617 ---- /dev/null -+++ b/tests/rust/exclude_generic_monomorph.toml -@@ -0,0 +1,11 @@ -+language = "C" -+header = """ -+#include <stdint.h> -+ -+typedef uint64_t Option_Foo; -+""" -+ -+[export] -+exclude = [ -+ "Option_Foo", -+]
participants (1)
-
crux@crux.nu