1 |
commit: e2f4fcdd819a8b4812c2aacd303a28654d575ece |
2 |
Author: Daniel Mueller <deso <AT> posteo <DOT> net> |
3 |
AuthorDate: Mon May 27 18:18:32 2019 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 28 02:36:21 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2f4fcdd |
7 |
|
8 |
app-crypt/nitrocli: Add patch for build failure with Rust 1.35 |
9 |
|
10 |
With dev-lang/rust-1.35 (or higher, presumably) nitrocli fails to build |
11 |
because of a unused comments that are flagged starting with this |
12 |
version. |
13 |
The change has been fixed upstream and with this change we add a patch |
14 |
back porting the fix to 0.2.3. |
15 |
|
16 |
Closes: https://bugs.gentoo.org/686870 |
17 |
Signed-off-by: Daniel Müller <deso <AT> posteo.net> |
18 |
Closes: https://github.com/gentoo/gentoo/pull/12119 |
19 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
20 |
|
21 |
.../files/nitrocli_-_fix-rust-1.35-build.patch | 52 ++++++++++++++++++++++ |
22 |
app-crypt/nitrocli/nitrocli-0.2.3-r1.ebuild | 5 +++ |
23 |
2 files changed, 57 insertions(+) |
24 |
|
25 |
diff --git a/app-crypt/nitrocli/files/nitrocli_-_fix-rust-1.35-build.patch b/app-crypt/nitrocli/files/nitrocli_-_fix-rust-1.35-build.patch |
26 |
new file mode 100644 |
27 |
index 00000000000..d5da3b1f48d |
28 |
--- /dev/null |
29 |
+++ b/app-crypt/nitrocli/files/nitrocli_-_fix-rust-1.35-build.patch |
30 |
@@ -0,0 +1,52 @@ |
31 |
+From 5383aa73b339e6a53ff027ee6012a3428f67466a Mon Sep 17 00:00:00 2001 |
32 |
+From: Daniel Mueller <deso@××××××.net> |
33 |
+Date: Fri, 24 May 2019 17:39:14 -0700 |
34 |
+Subject: [PATCH] Allow for unused doc comments on macros |
35 |
+ |
36 |
+With Rust 1.35 we get compile errors due to doc comments that are added |
37 |
+to macro invocations but not actually included in the expanded output. |
38 |
+The rustc wrongly assumes that we want to document the resulting code |
39 |
+and not just provide details about the invocation itself. |
40 |
+This change explicitly allows for those cases. Alternatively we could |
41 |
+have "downgraded" the doc comments to normal comments or removed them |
42 |
+altogether. There is little difference between those alternatives. |
43 |
+--- |
44 |
+ nitrocli/src/args.rs | 2 ++ |
45 |
+ nitrocli/src/pinentry.rs | 1 + |
46 |
+ 2 files changed, 3 insertions(+) |
47 |
+ |
48 |
+diff --git a/nitrocli/src/args.rs b/nitrocli/src/args.rs |
49 |
+index 7f0bfc..7e4f83 100644 |
50 |
+--- a/nitrocli/src/args.rs |
51 |
++++ b/nitrocli/src/args.rs |
52 |
+@@ -101,6 +101,7 @@ impl<'io> Stdio for ExecCtx<'io> { |
53 |
+ } |
54 |
+ |
55 |
+ /// The available Nitrokey models. |
56 |
++#[allow(unused_doc_comments)] |
57 |
+ Enum! {DeviceModel, [ |
58 |
+ Pro => "pro", |
59 |
+ Storage => "storage" |
60 |
+@@ -116,6 +117,7 @@ impl From<DeviceModel> for nitrokey::Model { |
61 |
+ } |
62 |
+ |
63 |
+ /// A top-level command for nitrocli. |
64 |
++#[allow(unused_doc_comments)] |
65 |
+ Enum! {Command, [ |
66 |
+ Config => ("config", config), |
67 |
+ Lock => ("lock", lock), |
68 |
+diff --git a/nitrocli/src/pinentry.rs b/nitrocli/src/pinentry.rs |
69 |
+index 837032..8bab65 100644 |
70 |
+--- a/nitrocli/src/pinentry.rs |
71 |
++++ b/nitrocli/src/pinentry.rs |
72 |
+@@ -30,6 +30,7 @@ type CowStr = borrow::Cow<'static, str>; |
73 |
+ /// |
74 |
+ /// The available PIN types correspond to the PIN types used by the Nitrokey devices: user and |
75 |
+ /// admin. |
76 |
++#[allow(unused_doc_comments)] |
77 |
+ Enum! {PinType, [ |
78 |
+ Admin => "admin", |
79 |
+ User => "user" |
80 |
+-- |
81 |
+2.21.0 |
82 |
+ |
83 |
|
84 |
diff --git a/app-crypt/nitrocli/nitrocli-0.2.3-r1.ebuild b/app-crypt/nitrocli/nitrocli-0.2.3-r1.ebuild |
85 |
index 40b62ff2d19..fb74af29209 100644 |
86 |
--- a/app-crypt/nitrocli/nitrocli-0.2.3-r1.ebuild |
87 |
+++ b/app-crypt/nitrocli/nitrocli-0.2.3-r1.ebuild |
88 |
@@ -67,6 +67,11 @@ RDEPEND=" |
89 |
RESTRICT="test" |
90 |
QA_FLAGS_IGNORED="/usr/bin/nitrocli" |
91 |
|
92 |
+src_prepare() { |
93 |
+ eapply -p2 "${FILESDIR}/${PN}_-_fix-rust-1.35-build.patch" |
94 |
+ default |
95 |
+} |
96 |
+ |
97 |
src_install() { |
98 |
cargo_src_install --path=. |