KERN_PROC_PATHNAME is slightly different on NetBSD vs FreeBSD; handle this

difference correctly.  Bump package revision to 1.
This commit is contained in:
thorpej 2024-03-02 23:07:59 +00:00
parent 88e735d8f0
commit cdd1e51cf4
9 changed files with 48 additions and 21 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2024/02/29 02:03:20 thorpej Exp $
# $NetBSD: Makefile,v 1.3 2024/03/02 23:07:59 thorpej Exp $
# There are no release tags for icestorm
ICESTORM_VERSION=0.0.20240227
@ -8,6 +8,8 @@ CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_GITHUB:=YosysHQ/}
GITHUB_TAG= 1a40ae75d4eebee9cce73a2c4d634fd42ed0110f
PKGREVISION= 1
MAINTAINER= thorpej@NetBSD.org
HOMEPAGE= https://github.com/YosysHQ/icestorm
COMMENT= Lattice iCE40 FPGAs Bitstream Documentation and tools

View File

@ -1,7 +1,7 @@
$NetBSD: distinfo,v 1.2 2024/02/29 02:03:20 thorpej Exp $
$NetBSD: distinfo,v 1.3 2024/03/02 23:07:59 thorpej Exp $
BLAKE2s (icestorm-0.0.20240227-1a40ae75d4eebee9cce73a2c4d634fd42ed0110f.tar.gz) = 511978571885ce362c39616dfb1fcccd5a1df31562b8cbb925547f15d5853cce
SHA512 (icestorm-0.0.20240227-1a40ae75d4eebee9cce73a2c4d634fd42ed0110f.tar.gz) = f0bfbc0af651a5d1cc45ecc4ce6cb9f6a8fdf4797f17b2af7e70278f0786b8d063503606cbf624aee558a3e32a3dc7c595694ac335ce7b52bfece9b18b5543da
Size (icestorm-0.0.20240227-1a40ae75d4eebee9cce73a2c4d634fd42ed0110f.tar.gz) = 948430 bytes
SHA1 (patch-icebox_Makefile) = 2b99d8c0e780c3b22a0697bfbd9e5b0259e0839d
SHA1 (patch-icetime_iceutil.cc) = d5cd83337808631b148f64d9c2ac6157c0b4d823
SHA1 (patch-icetime_iceutil.cc) = 2391375f35fba6056e09a9f3a89afe5abbebc800

View File

@ -1,9 +1,9 @@
$NetBSD: patch-icetime_iceutil.cc,v 1.1 2024/02/28 06:02:39 thorpej Exp $
$NetBSD: patch-icetime_iceutil.cc,v 1.2 2024/03/02 23:07:59 thorpej Exp $
On NetBSD, also use KERN_PROC_PATHNAME to get the path to the executable.
--- icetime/iceutil.cc.orig 2024-02-27 14:44:02.760248201 +0000
+++ icetime/iceutil.cc 2024-02-27 14:45:11.872738091 +0000
--- icetime/iceutil.cc.orig 2023-12-12 12:01:19.000000000 +0000
+++ icetime/iceutil.cc 2024-03-02 22:37:27.137509507 +0000
@@ -32,7 +32,7 @@
# include <unistd.h>
#endif
@ -13,7 +13,7 @@ On NetBSD, also use KERN_PROC_PATHNAME to get the path to the executable.
# include <sys/sysctl.h>
#endif
@@ -51,7 +51,7 @@ std::string proc_self_dirname()
@@ -51,10 +51,14 @@ std::string proc_self_dirname()
buflen--;
return std::string(path, buflen);
}
@ -21,4 +21,11 @@ On NetBSD, also use KERN_PROC_PATHNAME to get the path to the executable.
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
std::string proc_self_dirname()
{
+#ifdef __NetBSD__
+ int mib[4] = {CTL_KERN, KERN_PROC_ARGS, getpid(), KERN_PROC_PATHNAME};
+#else
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
+#endif
size_t buflen;
char *buffer;
std::string path;

View File

@ -1,6 +1,6 @@
$NetBSD: distinfo,v 1.1 2024/02/28 06:31:57 thorpej Exp $
$NetBSD: distinfo,v 1.2 2024/03/02 23:07:59 thorpej Exp $
BLAKE2s (nextpnr-0.7.tar.gz) = 27dfd76a6c8bc84b3178083a1b21bf4d542387a29ebaf533553121ac6c31a486
SHA512 (nextpnr-0.7.tar.gz) = feb190d3a656c7bcdd2bcc1def9972e2c9bec7171a064308b16260240ce9f552eb03d907ef7d032a17ae7ef7e869950e7399c61df22ba36484a4cf2ef7ce7de2
Size (nextpnr-0.7.tar.gz) = 4711765 bytes
SHA1 (patch-common_kernel_command.cc) = 8e5125d465a23992a0f13b0a4e7e59efaa1e48d5
SHA1 (patch-common_kernel_command.cc) = 48c0536839f18583d7be190c16a97d6537d80172

View File

@ -1,4 +1,4 @@
# $NetBSD: nextpnr.mk,v 1.2 2024/02/29 01:59:34 thorpej Exp $
# $NetBSD: nextpnr.mk,v 1.3 2024/03/02 23:07:59 thorpej Exp $
NEXTPNR_VERSION=0.7
DISTNAME= nextpnr-${NEXTPNR_VERSION}
@ -9,6 +9,8 @@ GITHUB_PROJECT= nextpnr
GITHUB_TAG= ${DISTNAME}
WRKSRC= ${WRKDIR}/nextpnr-${DISTNAME}
PKGREVISION?= 1
MAINTAINER?= thorpej@NetBSD.org
HOMEPAGE= https://github.com/YosysHQ/nextpnr
COMMENT?= A portable FPGA place and route tool

View File

@ -1,9 +1,9 @@
$NetBSD: patch-common_kernel_command.cc,v 1.1 2024/02/28 06:31:58 thorpej Exp $
$NetBSD: patch-common_kernel_command.cc,v 1.2 2024/03/02 23:08:00 thorpej Exp $
On NetBSD, also use KERN_PROC_PATHNAME to get the path to the executable.
--- common/kernel/command.cc.orig 2024-02-28 04:07:47.135026596 +0000
+++ common/kernel/command.cc 2024-02-28 04:08:20.420487475 +0000
--- common/kernel/command.cc.orig 2024-01-23 13:00:29.000000000 +0000
+++ common/kernel/command.cc 2024-03-02 22:33:39.900391210 +0000
@@ -61,7 +61,7 @@
#include <unistd.h>
#endif
@ -13,7 +13,7 @@ On NetBSD, also use KERN_PROC_PATHNAME to get the path to the executable.
#include <sys/sysctl.h>
#endif
@@ -90,7 +90,7 @@ std::string proc_self_dirname()
@@ -90,10 +90,14 @@ std::string proc_self_dirname()
buflen--;
return std::string(path, buflen);
}
@ -21,4 +21,11 @@ On NetBSD, also use KERN_PROC_PATHNAME to get the path to the executable.
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
std::string proc_self_dirname()
{
+#ifdef __NetBSD__
+ int mib[4] = {CTL_KERN, KERN_PROC_ARGS, getpid(), KERN_PROC_PATHNAME};
+#else
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
+#endif
size_t buflen;
char *buffer;
std::string path;

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.1 2024/03/02 02:03:37 thorpej Exp $
# $NetBSD: Makefile,v 1.2 2024/03/02 23:08:00 thorpej Exp $
YOSYS_VERSION= 0.38
YOSYS_TAG= yosys-${YOSYS_VERSION}
@ -10,6 +10,8 @@ GITHUB_TAG= ${YOSYS_TAG}
WRKSRC= ${WRKDIR}/yosys-${YOSYS_TAG}
EXTRACT_SUFX= .tar.gz # needed early
PKGREVISION= 1
MAINTAINER= thorpej@NetBSD.org
HOMEPAGE= https://github.com/YosysHQ/yosys
COMMENT= Yosys Open SYnthesis Suite

View File

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.1 2024/03/02 02:03:37 thorpej Exp $
$NetBSD: distinfo,v 1.2 2024/03/02 23:08:00 thorpej Exp $
BLAKE2s (abc-yosys-0.38.tar.gz) = 4bfbb01053192c417143c922de5a4f1d823aba17a6f818a20cacddb56772f486
SHA512 (abc-yosys-0.38.tar.gz) = 4f13454658a538085b5aebec0c92aa32f45fd0fa2777fa2180471120af336dd17b4007fab4597bdff787d29581635b698be373e81a504b9998576b0e55c8a191
@ -7,4 +7,4 @@ BLAKE2s (yosys-0.38.tar.gz) = bf794aef85cd8133d2ef4a47b802c6fb0a9c0744df2aa3c63f
SHA512 (yosys-0.38.tar.gz) = d41b81593a717bfd71c3120bb823a8bfb739f485e1a1ca3055e743e3f9f7406aa3c883a5a001183613f9ac05aaee222dafe39a594ead68c1c2fd74c3b2a84038
Size (yosys-0.38.tar.gz) = 2709217 bytes
SHA1 (patch-abc_Makefile) = b4cbe6b905f26e8bf7980e230edc87e12efced99
SHA1 (patch-kernel_yosys.cc) = 2b55d9e10350506ece747309ad22c2a003f714f8
SHA1 (patch-kernel_yosys.cc) = 35784013f6232990ff8c320ea43a0394baf03c90

View File

@ -1,9 +1,9 @@
$NetBSD: patch-kernel_yosys.cc,v 1.1 2024/03/02 02:03:37 thorpej Exp $
$NetBSD: patch-kernel_yosys.cc,v 1.2 2024/03/02 23:08:00 thorpej Exp $
On NetBSD, also use KERN_PROC_PATHNAME to get the path to the executable.
--- kernel/yosys.cc.orig 2024-02-29 13:30:05.586482076 +0000
+++ kernel/yosys.cc 2024-02-29 13:30:54.466426964 +0000
--- kernel/yosys.cc.orig 2024-02-09 07:16:24.000000000 +0000
+++ kernel/yosys.cc 2024-03-02 22:13:47.305319491 +0000
@@ -55,7 +55,7 @@
# include <glob.h>
#endif
@ -13,7 +13,7 @@ On NetBSD, also use KERN_PROC_PATHNAME to get the path to the executable.
# include <sys/sysctl.h>
#endif
@@ -917,7 +917,7 @@ std::string proc_self_dirname()
@@ -917,10 +917,14 @@ std::string proc_self_dirname()
buflen--;
return std::string(path, buflen);
}
@ -21,4 +21,11 @@ On NetBSD, also use KERN_PROC_PATHNAME to get the path to the executable.
+#elif defined(__FreeBSD__) || defined(__NetBSD__)
std::string proc_self_dirname()
{
+#ifdef __NetBSD__
+ int mib[4] = {CTL_KERN, KERN_PROC_ARGS, getpid(), KERN_PROC_PATHNAME};
+#else
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
+#endif
size_t buflen;
char *buffer;
std::string path;