pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/freerdp2 simplify the conditional for getting numb...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/bac6c9df4424
branches:  trunk
changeset: 451816:bac6c9df4424
user:      jdolecek <jdolecek%pkgsrc.org@localhost>
date:      Sun May 02 08:26:49 2021 +0000

description:
simplify the conditional for getting number of CPUs - simply use
_SC_NPROCESSORS_ONLN whenever available, this covers also NetBSD; change
the #ifdef conditional for HW_NCPU to check for HW_NCPU rather than
explicit list of FreeBSD/OpenBSD

diffstat:

 net/freerdp2/Makefile                                       |   4 +-
 net/freerdp2/distinfo                                       |   4 +-
 net/freerdp2/patches/patch-winpr_libwinpr_sysinfo_sysinfo.c |  21 +++++++++---
 3 files changed, 20 insertions(+), 9 deletions(-)

diffs (63 lines):

diff -r 9377d4d1b624 -r bac6c9df4424 net/freerdp2/Makefile
--- a/net/freerdp2/Makefile     Sun May 02 08:17:57 2021 +0000
+++ b/net/freerdp2/Makefile     Sun May 02 08:26:49 2021 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.17 2021/04/21 13:25:08 adam Exp $
+# $NetBSD: Makefile,v 1.18 2021/05/02 08:26:49 jdolecek Exp $
 
 DISTNAME=      freerdp-2.1.2
 PKGNAME=       ${DISTNAME:S/freerdp-/freerdp2-/1}
-PKGREVISION=   3
+PKGREVISION=   4
 CATEGORIES=    net
 MASTER_SITES=  https://pub.freerdp.com/releases/
 
diff -r 9377d4d1b624 -r bac6c9df4424 net/freerdp2/distinfo
--- a/net/freerdp2/distinfo     Sun May 02 08:17:57 2021 +0000
+++ b/net/freerdp2/distinfo     Sun May 02 08:26:49 2021 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.4 2020/11/01 00:20:05 markd Exp $
+$NetBSD: distinfo,v 1.5 2021/05/02 08:26:49 jdolecek Exp $
 
 SHA1 (freerdp-2.1.2.tar.gz) = e9b82c39080c69686a82db99a27cdeee1cfe4e5e
 RMD160 (freerdp-2.1.2.tar.gz) = 7b0d340ed9f5f6d549ce6ac790190ce84a690f0c
 SHA512 (freerdp-2.1.2.tar.gz) = 6d72b9138b4a4ae6a0a092371624b5a9b73ff914a4c42c73ace63e3f794f6bbca9a84e03d5e92c89bdb945ba2cc8200b4790b685f59d115d67b78a87a6ecab96
 Size (freerdp-2.1.2.tar.gz) = 6877052 bytes
 SHA1 (patch-channels_rdpdr_client_rdpdr__main.c) = 4358d4cd4b9293a27f3edafb94e7759e133ecd5f
-SHA1 (patch-winpr_libwinpr_sysinfo_sysinfo.c) = 858cfba03a902e1e6900a2d1ee2bcf7429227d3d
+SHA1 (patch-winpr_libwinpr_sysinfo_sysinfo.c) = b0fc583b02c3f416eb9d0f7cb140c4c69b3bdaef
diff -r 9377d4d1b624 -r bac6c9df4424 net/freerdp2/patches/patch-winpr_libwinpr_sysinfo_sysinfo.c
--- a/net/freerdp2/patches/patch-winpr_libwinpr_sysinfo_sysinfo.c       Sun May 02 08:17:57 2021 +0000
+++ b/net/freerdp2/patches/patch-winpr_libwinpr_sysinfo_sysinfo.c       Sun May 02 08:26:49 2021 +0000
@@ -1,15 +1,26 @@
-$NetBSD: patch-winpr_libwinpr_sysinfo_sysinfo.c,v 1.1 2019/09/15 12:55:14 nia Exp $
+$NetBSD: patch-winpr_libwinpr_sysinfo_sysinfo.c,v 1.2 2021/05/02 08:26:49 jdolecek Exp $
 
-Support NetBSD.
+Use _SC_NPROCESSORS_ONLN if available, remove OS-specific ifdef for it,
+and also for HW_NCPU. Technically NetBSD would need to be added to the HW_NCPU
+#idef, but no longer needed since it has _SC_NPROCESSORS_ONLN.
 
---- winpr/libwinpr/sysinfo/sysinfo.c.orig      2018-11-20 10:43:51.000000000 +0000
+--- winpr/libwinpr/sysinfo/sysinfo.c.orig      2021-05-01 22:46:16.616257099 +0000
 +++ winpr/libwinpr/sysinfo/sysinfo.c
-@@ -142,7 +142,7 @@ static DWORD GetNumberOfProcessors(void)
+@@ -132,7 +132,7 @@ static DWORD GetNumberOfProcessors(void)
+ #if defined(ANDROID)
+       return android_getCpuCount();
+       /* TODO: iOS */
+-#elif defined(__linux__) || defined(__sun) || defined(_AIX)
++#elif defined(_SC_NPROCESSORS_ONLN)
+       numCPUs = (DWORD)sysconf(_SC_NPROCESSORS_ONLN);
+ #elif defined(__MACOSX__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
+     defined(__OpenBSD__) || defined(__DragonFly__)
+@@ -140,7 +140,7 @@ static DWORD GetNumberOfProcessors(void)
                int mib[4];
                size_t length = sizeof(numCPUs);
                mib[0] = CTL_HW;
 -#if defined(__FreeBSD__) || defined(__OpenBSD__)
-+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
++#if defined(HW_NCPU)
                mib[1] = HW_NCPU;
  #else
                mib[1] = HW_AVAILCPU;



Home | Main Index | Thread Index | Old Index