pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/rust-analyzer lang/rust-analyzer: do the previous...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/845f23df14bf
branches:  trunk
changeset: 386590:845f23df14bf
user:      he <he%pkgsrc.org@localhost>
date:      Mon Oct 10 19:04:52 2022 +0000

description:
lang/rust-analyzer: do the previous ... properly.

Linux x32 has a quirk in the libc crate, so that gets duplicated here.
Also, fix the path to the file to be patched.  Ride previous revision bump.

diffstat:

 lang/rust-analyzer/distinfo                                      |   4 +-
 lang/rust-analyzer/patches/patch-vendor_kqueue-1.0.6_src_time.rs |  27 +++++----
 2 files changed, 18 insertions(+), 13 deletions(-)

diffs (72 lines):

diff -r 1ac09366966b -r 845f23df14bf lang/rust-analyzer/distinfo
--- a/lang/rust-analyzer/distinfo       Mon Oct 10 18:28:48 2022 +0000
+++ b/lang/rust-analyzer/distinfo       Mon Oct 10 19:04:52 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.18 2022/10/10 08:08:28 he Exp $
+$NetBSD: distinfo,v 1.19 2022/10/10 19:04:52 he Exp $
 
 BLAKE2s (addr2line-0.17.0.crate) = f7fa3b016f0e80c4ea9967f8947de15edc9fa39d0c0cdea692dccd0c41c28039
 SHA512 (addr2line-0.17.0.crate) = ef3bbd7c6d1dfdd0b47e3be1fb4c8b15ed61a769bed7e80dce80461a1ee13ef21c75e62e9a66328504f862341f1e808abec5790ac79784e18655afcc16206b95
@@ -513,4 +513,4 @@
 BLAKE2s (xshell-macros-0.2.2.crate) = 21b45d4c73fe60a536e4762405e28a321e64fe7411890a36ebdd9f35774c14a9
 SHA512 (xshell-macros-0.2.2.crate) = a477f18810d2b647c78cbc06d59b8b84817ee5e54cc8785897ecae743d263c6d0fab3563f66aed6a5e81b790bab317871162513c8ff14364d936afaa082f1ff4
 Size (xshell-macros-0.2.2.crate) = 2848 bytes
-SHA1 (patch-vendor_kqueue-1.0.6_src_time.rs) = d46b71aebe930dd01effe2f81cfa13f823285e93
+SHA1 (patch-vendor_kqueue-1.0.6_src_time.rs) = bc6df7987e0c4b2677d4c6015d2779dc8e9de170
diff -r 1ac09366966b -r 845f23df14bf lang/rust-analyzer/patches/patch-vendor_kqueue-1.0.6_src_time.rs
--- a/lang/rust-analyzer/patches/patch-vendor_kqueue-1.0.6_src_time.rs  Mon Oct 10 18:28:48 2022 +0000
+++ b/lang/rust-analyzer/patches/patch-vendor_kqueue-1.0.6_src_time.rs  Mon Oct 10 19:04:52 2022 +0000
@@ -1,20 +1,20 @@
-$NetBSD: patch-vendor_kqueue-1.0.6_src_time.rs,v 1.1 2022/10/10 08:08:28 he Exp $
+$NetBSD: patch-vendor_kqueue-1.0.6_src_time.rs,v 1.2 2022/10/10 19:04:52 he Exp $
 
 Use the timespec component types instead of hardcoding int lengths.
+...except Linux has a quirk.
 
---- vendor/kqueue-1.0.6/src/time.rs.orig       1973-11-29 21:33:09.000000000 +0000
-+++ vendor/kqueue-1.0.6/src/time.rs
-@@ -1,32 +1,11 @@
-+use libc::time_t;
-+use libc::c_long;
- use libc::timespec;
+--- ../vendor/kqueue-1.0.6/src/time.rs.orig    1973-11-29 21:33:09.000000000 +0000
++++ ../vendor/kqueue-1.0.6/src/time.rs
+@@ -1,32 +1,15 @@
+-use libc::timespec;
++use libc::{timespec, time_t, c_long};
  use std::time::Duration;
  
 -#[cfg(not(all(
 -    any(target_os = "freebsd", target_os = "macos"),
 -    any(target_arch = "x86", target_arch = "powerpc")
 -)))]
- pub(crate) fn duration_to_timespec(d: Duration) -> timespec {
+-pub(crate) fn duration_to_timespec(d: Duration) -> timespec {
 -    let tv_sec = d.as_secs() as i64;
 -    let tv_nsec = d.subsec_nanos() as i64;
 -
@@ -28,16 +28,21 @@
 -
 -    timespec { tv_sec, tv_nsec }
 -}
--
++// Linux x32 compatibility, ref. libc/src/unix/mod.rs
++#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))]
++type NSec = i64;
++#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))]
++type NSec = c_long;
+ 
 -#[cfg(all(
 -    any(target_os = "freebsd", target_os = "macos"),
 -    any(target_arch = "x86", target_arch = "powerpc")
 -))]
--pub(crate) fn duration_to_timespec(d: Duration) -> timespec {
+ pub(crate) fn duration_to_timespec(d: Duration) -> timespec {
 -    let tv_sec = d.as_secs() as i32;
 -    let tv_nsec = d.subsec_nanos() as i32;
 +    let tv_sec = d.as_secs() as time_t;
-+    let tv_nsec = d.subsec_nanos() as c_long;
++    let tv_nsec = d.subsec_nanos() as NSec;
  
      if tv_sec.is_negative() {
          panic!("Duration seconds is negative");



Home | Main Index | Thread Index | Old Index