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: use timespec co...
details: https://anonhg.NetBSD.org/pkgsrc/rev/9f60236fb5a9
branches: trunk
changeset: 386569:9f60236fb5a9
user: he <he%pkgsrc.org@localhost>
date: Mon Oct 10 08:08:28 2022 +0000
description:
lang/rust-analyzer: use timespec component types from the libc crate.
Should help with general portability to 32-bit ports, since we
import the timespec component types (time_t and c_long) from the
libc crate instead of hardcoding the integer lengths.
Bump PKGREVISION.
diffstat:
lang/rust-analyzer/Makefile | 3 +-
lang/rust-analyzer/distinfo | 3 +-
lang/rust-analyzer/patches/patch-vendor_kqueue-1.0.6_src_time.rs | 43 ++++++++++
3 files changed, 47 insertions(+), 2 deletions(-)
diffs (74 lines):
diff -r e92f327ec21e -r 9f60236fb5a9 lang/rust-analyzer/Makefile
--- a/lang/rust-analyzer/Makefile Mon Oct 10 08:06:51 2022 +0000
+++ b/lang/rust-analyzer/Makefile Mon Oct 10 08:08:28 2022 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.15 2022/09/05 19:09:12 adam Exp $
+# $NetBSD: Makefile,v 1.16 2022/10/10 08:08:28 he Exp $
DISTNAME= rust-analyzer-2022-08-22
PKGNAME= ${DISTNAME:C/-2([0-9]*)-([0-9]*)-([0-9]*)/-0.0.2\1.\2.\3/}
+PKGREVISION= 1
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_GITHUB:=rust-lang/}
GITHUB_TAG= ${DISTNAME:S/rust-analyzer-//}
diff -r e92f327ec21e -r 9f60236fb5a9 lang/rust-analyzer/distinfo
--- a/lang/rust-analyzer/distinfo Mon Oct 10 08:06:51 2022 +0000
+++ b/lang/rust-analyzer/distinfo Mon Oct 10 08:08:28 2022 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.17 2022/09/05 19:09:12 adam Exp $
+$NetBSD: distinfo,v 1.18 2022/10/10 08:08:28 he Exp $
BLAKE2s (addr2line-0.17.0.crate) = f7fa3b016f0e80c4ea9967f8947de15edc9fa39d0c0cdea692dccd0c41c28039
SHA512 (addr2line-0.17.0.crate) = ef3bbd7c6d1dfdd0b47e3be1fb4c8b15ed61a769bed7e80dce80461a1ee13ef21c75e62e9a66328504f862341f1e808abec5790ac79784e18655afcc16206b95
@@ -513,3 +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
diff -r e92f327ec21e -r 9f60236fb5a9 lang/rust-analyzer/patches/patch-vendor_kqueue-1.0.6_src_time.rs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust-analyzer/patches/patch-vendor_kqueue-1.0.6_src_time.rs Mon Oct 10 08:08:28 2022 +0000
@@ -0,0 +1,43 @@
+$NetBSD: patch-vendor_kqueue-1.0.6_src_time.rs,v 1.1 2022/10/10 08:08:28 he Exp $
+
+Use the timespec component types instead of hardcoding int lengths.
+
+--- 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;
+ 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 {
+- let tv_sec = d.as_secs() as i64;
+- let tv_nsec = d.subsec_nanos() as i64;
+-
+- if tv_sec.is_negative() {
+- panic!("Duration seconds is negative");
+- }
+-
+- if tv_nsec.is_negative() {
+- panic!("Duration nsecs is negative");
+- }
+-
+- timespec { tv_sec, tv_nsec }
+-}
+-
+-#[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 {
+- 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;
+
+ if tv_sec.is_negative() {
+ panic!("Duration seconds is negative");
Home |
Main Index |
Thread Index |
Old Index