pkgsrc-WIP-changes archive

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

Add mono 6.0.0.313 with netbsd patches



Module Name:	pkgsrc-wip
Committed By:	Maya Rashish <maya%NetBSD.org@localhost>
Pushed By:	coypu
Date:		Thu Aug 1 12:35:47 2019 +0300
Changeset:	38ec7e21ebeb60fadf4088f712402289de08d0e9

Added Files:
	mono6/DESCR
	mono6/Makefile
	mono6/PLIST
	mono6/TODO
	mono6/buildlink3.mk
	mono6/distinfo
	mono6/patches/patch-configure.ac
	mono6/patches/patch-mcs_class_corlib_Test_Mono_MonoNativePlatformType.cs
	mono6/patches/patch-mono_metadata_icall.c
	mono6/patches/patch-mono_metadata_threads.c
	mono6/patches/patch-mono_mini_Makefile.am.in
	mono6/patches/patch-mono_native_Makefile.am
	mono6/patches/patch-mono_native_mono-native-platform.h
	mono6/patches/patch-mono_utils_mono-os-semaphore.h
	mono6/patches/patch-mono_utils_mono-state.c
	mono6/patches/patch-mono_utils_mono-utils-debug.c

Log Message:
Add mono 6.0.0.313 with netbsd patches

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=38ec7e21ebeb60fadf4088f712402289de08d0e9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 mono6/DESCR                                        |   6 +
 mono6/Makefile                                     | 181 +++++++++++++++++++++
 mono6/PLIST                                        |   0
 mono6/TODO                                         |   1 +
 mono6/buildlink3.mk                                |  17 ++
 mono6/distinfo                                     |  16 ++
 mono6/patches/patch-configure.ac                   |  38 +++++
 ...lass_corlib_Test_Mono_MonoNativePlatformType.cs |  15 ++
 mono6/patches/patch-mono_metadata_icall.c          |  16 ++
 mono6/patches/patch-mono_metadata_threads.c        |  20 +++
 mono6/patches/patch-mono_mini_Makefile.am.in       |  15 ++
 mono6/patches/patch-mono_native_Makefile.am        |  36 ++++
 .../patch-mono_native_mono-native-platform.h       |  16 ++
 mono6/patches/patch-mono_utils_mono-os-semaphore.h |  16 ++
 mono6/patches/patch-mono_utils_mono-state.c        |  14 ++
 mono6/patches/patch-mono_utils_mono-utils-debug.c  |  31 ++++
 16 files changed, 438 insertions(+)

diffs:
diff --git a/mono6/DESCR b/mono6/DESCR
new file mode 100644
index 0000000000..d9952fef61
--- /dev/null
+++ b/mono6/DESCR
@@ -0,0 +1,6 @@
+The Mono Project is an open development initiative sponsored by Ximian
+that is working to develop an open source, Unix version of the Microsoft
+.NET development platform.  Its objective is to enable Unix developers to
+build and deploy cross-platform .NET Applications.  The project will
+implement various technologies developed by Microsoft that have now been
+submitted to the ECMA for standardization.
diff --git a/mono6/Makefile b/mono6/Makefile
new file mode 100644
index 0000000000..7049817e13
--- /dev/null
+++ b/mono6/Makefile
@@ -0,0 +1,181 @@
+# $NetBSD: Makefile,v 1.168 2016/02/24 16:48:09 jperkin Exp $
+
+DISTNAME=	mono-6.0.0.313
+CATEGORIES=	lang
+MASTER_SITES=	https://download.mono-project.com/sources/mono/
+EXTRACT_SUFX=	.tar.xz
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://www.mono-project.com/
+COMMENT=	Open source implementation of the .NET Development Framework
+LICENSE=	mit AND gnu-gpl-v2 AND gnu-lgpl-v2 AND apache-2.0
+
+WRKSRC=		${WRKDIR}/${DISTNAME}
+
+BUILD_DEPENDS+=	p5-XML-Parser-[0-9]*:../../textproc/p5-XML-Parser
+CONFLICTS=	pnet-[0-9]* mcsim-[0-9]* lc-[0-9]*
+ALL_ENV+=	MONO_SHARED_DIR=${WRKDIR} PLATFORM=
+
+USE_TOOLS+=	bash:run bison gmake gtar msgfmt perl:run pkg-config autoconf automake
+USE_LIBTOOL=	yes
+USE_LANGUAGES+=	c c99 c++
+EXTRACT_USING=	gtar
+
+GNU_CONFIGURE=		yes
+CONFIGURE_ARGS+=	--sysconfdir=${PKG_SYSCONFDIR} --with-icu=yes
+CONFIGURE_ARGS+=	--disable-dtrace
+
+MAKE_FLAGS+=		PERL=${PERL5:Q} mandir=${PREFIX}/${PKGMANDIR}
+UNLIMIT_RESOURCES=	datasize stacksize memorysize
+
+PKGCONFIG_OVERRIDE+=	mono-uninstalled.pc.in data/cecil.pc.in
+PKGCONFIG_OVERRIDE+=	data/dotnet.pc.in data/dotnet35.pc.in data/mint.pc.in
+PKGCONFIG_OVERRIDE+=	data/monodoc.pc.in
+PKGCONFIG_OVERRIDE+=	data/mono-cairo.pc.in data/mono-lineeditor.pc.in
+PKGCONFIG_OVERRIDE+=	data/mono-nunit.pc.in data/mono-options.pc.in
+PKGCONFIG_OVERRIDE+=	data/mono.pc.in
+PKGCONFIG_OVERRIDE+=	data/reactive.pc.in
+PKGCONFIG_OVERRIDE+=	data/system.web.extensions_1.0.pc.in
+PKGCONFIG_OVERRIDE+=	data/system.web.extensions.design_1.0.pc.in
+PKGCONFIG_OVERRIDE+=	data/system.web.mvc.pc.in data/wcf.pc.in
+
+REPLACE_PERL+=	mono/benchmark/test-driver
+REPLACE_PERL+=	mono/cil/make-opcodes-def.pl
+REPLACE_PERL+=	mono/tests/stress-runner.pl
+
+REPLACE_PYTHON+=	scripts/mono-heapviz
+
+REPLACE_BASH+=	mono/arch/arm/dpiops.sh
+REPLACE_BASH+=	mono/arch/arm/vfpops.sh
+REPLACE_BASH+=	scripts/mono-find-provides.in scripts/mono-find-requires.in
+REPLACE_BASH+=	scripts/mono-test-install web/mono-build-w32.sh
+REPLACE_BASH+=	mcs/class/Mono.Cairo/Samples/gtk/compile.sh
+REPLACE_BASH+=	mcs/class/Mono.Cairo/Samples/png/compile.sh
+REPLACE_BASH+=	mcs/class/Mono.Cairo/Samples/win32/compile.sh
+REPLACE_BASH+=	mcs/class/Mono.Cairo/Samples/x11/compile.sh
+REPLACE_BASH+=	libgc/mkinstalldirs
+REPLACE_BASH+=	mcs/mkinstalldirs mkinstalldirs
+
+EGDIR=		${PREFIX}/share/examples/mono
+CONF_FILES=	${EGDIR}/config ${PKG_SYSCONFDIR}/mono/config
+CONF_FILES+=	${EGDIR}/browscap.ini ${PKG_SYSCONFDIR}/mono/browscap.ini
+CONF_FILES+=	${EGDIR}/2.0/DefaultWsdlHelpGenerator.aspx \
+			${PKG_SYSCONFDIR}/mono/2.0/DefaultWsdlHelpGenerator.aspx
+CONF_FILES+=	${EGDIR}/2.0/machine.config \
+			${PKG_SYSCONFDIR}/mono/2.0/machine.config
+CONF_FILES+=	${EGDIR}/mconfig/config.xml \
+			${PKG_SYSCONFDIR}/mono/mconfig/config.xml
+CONF_FILES+=	${EGDIR}/2.0/settings.map \
+			${PKG_SYSCONFDIR}/mono/2.0/settings.map
+CONF_FILES+=	${EGDIR}/2.0/web.config \
+			${PKG_SYSCONFDIR}/mono/2.0/web.config
+CONF_FILES+=	${EGDIR}/2.0/Browsers/Compat.browser \
+			${PKG_SYSCONFDIR}/mono/2.0/Browsers/Compat.browser
+CONF_FILES+=	${EGDIR}/4.0/DefaultWsdlHelpGenerator.aspx \
+			${PKG_SYSCONFDIR}/mono/4.0/DefaultWsdlHelpGenerator.aspx
+CONF_FILES+=	${EGDIR}/4.0/machine.config \
+			${PKG_SYSCONFDIR}/mono/4.0/machine.config
+CONF_FILES+=	${EGDIR}/4.0/settings.map \
+			${PKG_SYSCONFDIR}/mono/4.0/settings.map
+CONF_FILES+=	${EGDIR}/4.0/web.config \
+			${PKG_SYSCONFDIR}/mono/4.0/web.config
+CONF_FILES+=	${EGDIR}/4.0/Browsers/Compat.browser \
+			${PKG_SYSCONFDIR}/mono/4.0/Browsers/Compat.browser
+CONF_FILES+=	${EGDIR}/4.5/DefaultWsdlHelpGenerator.aspx \
+			${PKG_SYSCONFDIR}/mono/4.5/DefaultWsdlHelpGenerator.aspx
+CONF_FILES+=	${EGDIR}/4.5/machine.config \
+			${PKG_SYSCONFDIR}/mono/4.5/machine.config
+CONF_FILES+=	${EGDIR}/4.5/settings.map \
+			${PKG_SYSCONFDIR}/mono/4.5/settings.map
+CONF_FILES+=	${EGDIR}/4.5/web.config  ${PKG_SYSCONFDIR}/mono/4.5/web.config
+CONF_FILES+=	${EGDIR}/4.5/Browsers/Compat.browser \
+			${PKG_SYSCONFDIR}/mono/4.5/Browsers/Compat.browser
+
+MAKE_DIRS+=	${PKG_SYSCONFDIR}/mono/2.0
+MAKE_DIRS+=	${PKG_SYSCONFDIR}/mono/2.0/Browsers
+MAKE_DIRS+=	${PKG_SYSCONFDIR}/mono/4.0
+MAKE_DIRS+=	${PKG_SYSCONFDIR}/mono/4.0/Browsers
+MAKE_DIRS+=	${PKG_SYSCONFDIR}/mono/4.5
+MAKE_DIRS+=	${PKG_SYSCONFDIR}/mono/4.5/Browsers
+MAKE_DIRS+=	${PKG_SYSCONFDIR}/mono/mconfig
+
+INSTALLATION_DIRS+=	share/examples/mono/4.5
+
+TEST_TARGET=	check
+
+SUBST_CLASSES+=			fix-prefix
+SUBST_STAGE.fix-prefix=		post-patch
+SUBST_MESSAGE.fix-prefix=	Fixing relative prefix
+SUBST_FILES.fix-prefix=		${PKGCONFIG_OVERRIDE}
+SUBST_SED.fix-prefix=		-e 's,$${pcfiledir}/../..,\@prefix\@,g'
+
+SUBST_CLASSES+=			fix-mcs
+SUBST_STAGE.fix-mcs=		post-patch
+SUBST_MESSAGE.fix-mcs=		Fixing mcs default prefix
+SUBST_FILES.fix-mcs=		mcs/build/config-default.make
+SUBST_VARS.fix-mcs=		PREFIX PKGMANDIR
+
+SUBST_CLASSES+=			fix-cfgdir
+SUBST_STAGE.fix-cfgdir=		post-patch
+SUBST_MESSAGE.fix-cfgdir=	Fixing configuration files install dir
+SUBST_FILES.fix-cfgdir=		mcs/tools/mconfig/Makefile
+SUBST_SED.fix-cfgdir=		-e 's,$$(sysconfdir)/mono,${EGDIR},g'
+
+SUBST_CLASSES+=			fix-libx11
+SUBST_STAGE.fix-libx11=		pre-configure
+SUBST_MESSAGE.fix-libx11=	Fixing libX11 search path configuration
+SUBST_FILES.fix-libx11=		configure
+SUBST_VARS.fix-libx11=		X11BASE
+
+.include "../../mk/bsd.prefs.mk"
+
+# XXX remove
+MAKE_ENV+=	V=1
+
+# We patched makefiles, regen
+pre-configure:
+	${RUN} cd ${WRKSRC} && ${SH} ./autogen.sh
+
+.if ${OPSYS} == "SunOS"
+CFLAGS+=		-D_XOPEN_SOURCE=600
+CONFIGURE_ARGS+=	--with-mcs-docs=no
+CONFIGURE_ARGS+=	--with-sgen=no
+CONFIGURE_ARGS+=	--with-sigaltstack=no
+CONFIGURE_ENV+=		ac_cv_func_getdomainname=no
+CONFIGURE_ENV+=		ac_cv_func_setdomainname=no
+ULIMIT_CMD_datasize=	ulimit -d 524288
+ULIMIT_CMD_stacksize=	ulimit -s 10240
+.elif ${OPSYS} == "NetBSD"
+# Available as a libc symbol, but no declaration.
+# XXX learn about getvfsstat
+CONFIGURE_ENV+=		ac_cv_func_getfsstat=no
+.endif
+
+.if ${MACHINE_ARCH:M*i[34]86*}
+# for gcc byte atomic builtins
+GNU_ARCH.i386=		i586
+CFLAGS+=		-march=i586
+.endif
+
+post-install:
+	${INSTALL_DATA} ${WRKSRC}/data/net_4_5/DefaultWsdlHelpGenerator.aspx \
+		${DESTDIR}${EGDIR}/4.5/DefaultWsdlHelpGenerator.aspx
+	${INSTALL_DATA} ${WRKSRC}/data/net_4_5/machine.config \
+		${DESTDIR}${EGDIR}/4.5/machine.config
+	${INSTALL_DATA} ${WRKSRC}/data/net_4_5/settings.map \
+		${DESTDIR}${EGDIR}/4.5/settings.map
+	${INSTALL_DATA} ${WRKSRC}/data/net_4_5/web.config \
+		${DESTDIR}${EGDIR}/4.5/web.config
+.if ${OPSYS} == "Darwin"
+	for lib in mcs.exe.dylib mscorlib.dll.dylib; do \
+		install_name_tool -id ${PREFIX}/lib/mono/4.5/$$lib \
+		    ${DESTDIR}${PREFIX}/lib/mono/4.5/$$lib; \
+	done
+.endif
+
+.include "../../devel/gettext-lib/buildlink3.mk"
+.include "../../lang/python/application.mk"
+.include "../../textproc/icu/buildlink3.mk"
+.include "../../textproc/libxml2/buildlink3.mk"
+.include "../../textproc/libxslt/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/mono6/PLIST b/mono6/PLIST
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/mono6/TODO b/mono6/TODO
new file mode 100644
index 0000000000..d0826e0b7e
--- /dev/null
+++ b/mono6/TODO
@@ -0,0 +1 @@
+- Build does not complete yet
diff --git a/mono6/buildlink3.mk b/mono6/buildlink3.mk
new file mode 100644
index 0000000000..67f22c708f
--- /dev/null
+++ b/mono6/buildlink3.mk
@@ -0,0 +1,17 @@
+# $NetBSD: buildlink3.mk,v 1.52 2015/05/21 20:03:23 kefren Exp $
+
+BUILDLINK_TREE+=	mono
+
+.if !defined(MONO_BUILDLINK3_MK)
+MONO_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.mono+=	mono>=4
+BUILDLINK_ABI_DEPENDS.mono?=	mono>=4.0.1
+BUILDLINK_PKGSRCDIR.mono?=	../../lang/mono
+ALL_ENV+=			MONO_SHARED_DIR=${WRKDIR}
+BUILDLINK_CONTENTS_FILTER.mono=	${EGREP} '(^include/|^lib/)'
+
+.include "../../textproc/icu/buildlink3.mk"
+.endif # MONO_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-mono
diff --git a/mono6/distinfo b/mono6/distinfo
new file mode 100644
index 0000000000..d491531c93
--- /dev/null
+++ b/mono6/distinfo
@@ -0,0 +1,16 @@
+$NetBSD: distinfo,v 1.107 2015/11/03 22:50:39 agc Exp $
+
+SHA1 (mono-6.0.0.313.tar.xz) = c5cccad2cb5be936f23e46b95df7628013e29e3c
+RMD160 (mono-6.0.0.313.tar.xz) = 801e5128561d2e95a6736cdfce040d8850be4e2f
+SHA512 (mono-6.0.0.313.tar.xz) = a1de452eb1c6edba503723217a4b5839563d154ff0c01852b551a41b3c98b5b617637e4e435de87bf275cfdce4066e70bfc763b607882f0b42e14196d7d5c156
+Size (mono-6.0.0.313.tar.xz) = 218124872 bytes
+SHA1 (patch-configure.ac) = cc4f5bf80495c3248a161d1b857e2aa63a437e4e
+SHA1 (patch-mcs_class_corlib_Test_Mono_MonoNativePlatformType.cs) = 3368edee232b184879091df3d68daf4900f744c2
+SHA1 (patch-mono_metadata_icall.c) = 292c7bc4c959a3a5c1a982ccf2bc26a5300a0730
+SHA1 (patch-mono_metadata_threads.c) = 5b55d0b3b5e506bf08ac14712f44a8db4594b254
+SHA1 (patch-mono_mini_Makefile.am.in) = d8d7e61587a018ebe42d3365a2c061e1ecba9695
+SHA1 (patch-mono_native_Makefile.am) = 47e57623ebfce32f13a5fc1c19a0dbcb31dad8d4
+SHA1 (patch-mono_native_mono-native-platform.h) = 845c921b4a84146b78f4f94c9380890892f5ff29
+SHA1 (patch-mono_utils_mono-os-semaphore.h) = b850911945c95be804e9462263d558ef702831ca
+SHA1 (patch-mono_utils_mono-state.c) = 6a6d83e1779a5167e8f22ba1dedce9b3203705c4
+SHA1 (patch-mono_utils_mono-utils-debug.c) = 30b0ab55c9227705026a8edd1e4bb693ae4f9953
diff --git a/mono6/patches/patch-configure.ac b/mono6/patches/patch-configure.ac
new file mode 100644
index 0000000000..e916aa0fa7
--- /dev/null
+++ b/mono6/patches/patch-configure.ac
@@ -0,0 +1,38 @@
+$NetBSD$
+
+Add netbsd support
+https://github.com/mono/mono/pull/15938
+
+--- configure.ac.orig	2019-07-18 07:52:31.000000000 +0000
++++ configure.ac
+@@ -6177,6 +6177,22 @@ elif test x$platform_android = xyes; the
+ 	MONO_NATIVE_PLATFORM=android
+ 
+ 	MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_ANDROID"
++elif case $host_os in netbsd*) true;; *) false;; esac; then
++	mono_native_text="NetBSD"
++	MONO_NATIVE_CC=$CC
++	MONO_NATIVE_CXX=$CXX
++	MONO_NATIVE_CPPFLAGS=$CPPFLAGS
++	MONO_NATIVE_CXXFLAGS=$CXXFLAGS
++	MONO_NATIVE_CFLAGS=$CFLAGS
++	MONO_NATIVE_LDFLAGS=$LDFLAGS
++
++	mono_native=yes
++	mono_native_compat=no
++	MONO_NATIVE_PLATFORM=netbsd
++	AC_MSG_CHECKING([Mono.Native support])
++	AC_MSG_RESULT(netbsd)
++
++	MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_NETBSD"
+ else
+ 	mono_native=no
+ 	mono_native_text="no"
+@@ -6218,6 +6234,7 @@ AM_CONDITIONAL(MONO_NATIVE_PLATFORM_IOS,
+ AM_CONDITIONAL(MONO_NATIVE_PLATFORM_LINUX, test x$MONO_NATIVE_PLATFORM = xlinux)
+ AM_CONDITIONAL(MONO_NATIVE_PLATFORM_AIX, test x$MONO_NATIVE_PLATFORM = xaix)
+ AM_CONDITIONAL(MONO_NATIVE_PLATFORM_ANDROID, test x$MONO_NATIVE_PLATFORM = xandroid)
++AM_CONDITIONAL(MONO_NATIVE_PLATFORM_NETBSD, test x$MONO_NATIVE_PLATFORM = xnetbsd)
+ 
+ MONO_NATIVE_PLATFORM_TYPE_COMPAT="$MONO_NATIVE_PLATFORM_TYPE | MONO_NATIVE_PLATFORM_TYPE_COMPAT"
+ MONO_NATIVE_PLATFORM_TYPE_UNIFIED="$MONO_NATIVE_PLATFORM_TYPE | MONO_NATIVE_PLATFORM_TYPE_UNIFIED"
diff --git a/mono6/patches/patch-mcs_class_corlib_Test_Mono_MonoNativePlatformType.cs b/mono6/patches/patch-mcs_class_corlib_Test_Mono_MonoNativePlatformType.cs
new file mode 100644
index 0000000000..df03d7a622
--- /dev/null
+++ b/mono6/patches/patch-mcs_class_corlib_Test_Mono_MonoNativePlatformType.cs
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Add netbsd support
+https://github.com/mono/mono/pull/15938
+
+--- mcs/class/corlib/Test/Mono/MonoNativePlatformType.cs.orig	2019-07-18 07:46:07.000000000 +0000
++++ mcs/class/corlib/Test/Mono/MonoNativePlatformType.cs
+@@ -36,6 +36,7 @@ namespace Mono
+ 		MONO_NATIVE_PLATFORM_TYPE_IOS		= 2,
+ 		MONO_NATIVE_PLATFORM_TYPE_LINUX		= 3,
+ 		MONO_NATIVE_PLATFORM_TYPE_AIX		= 4,
++		MONO_NATIVE_PLATFORM_TYPE_NETBSD	= 8,
+ 
+ 		MONO_NATIVE_PLATFORM_TYPE_IPHONE	= 0x100,
+ 		MONO_NATIVE_PLATFORM_TYPE_TV		= 0x200,
diff --git a/mono6/patches/patch-mono_metadata_icall.c b/mono6/patches/patch-mono_metadata_icall.c
new file mode 100644
index 0000000000..849b91738c
--- /dev/null
+++ b/mono6/patches/patch-mono_metadata_icall.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+NetBSD will side-load <stdbool.h> which must have #define bool _Bool.
+This causes some problems with the C preprocessor usage here. undef it.
+
+--- mono/metadata/icall.c.orig	2019-07-18 07:46:08.000000000 +0000
++++ mono/metadata/icall.c
+@@ -117,6 +117,8 @@
+ #include "icall-decl.h"
+ #include "mono/utils/mono-threads-coop.h"
+ 
++#undef bool
++
+ //#define MONO_DEBUG_ICALLARRAY
+ 
+ #ifdef MONO_DEBUG_ICALLARRAY
diff --git a/mono6/patches/patch-mono_metadata_threads.c b/mono6/patches/patch-mono_metadata_threads.c
new file mode 100644
index 0000000000..3c991acc69
--- /dev/null
+++ b/mono6/patches/patch-mono_metadata_threads.c
@@ -0,0 +1,20 @@
+$NetBSD$
+
+If sched_get_priority_{min,max} error, don't try to set a priority.
+NetBSD doesn't like SCHED_OTHER + 0 priority, and will error here.
+
+https://github.com/mono/mono/pull/15898
+
+--- mono/metadata/threads.c.orig	2019-07-18 07:46:08.000000000 +0000
++++ mono/metadata/threads.c
+@@ -740,6 +740,10 @@ mono_thread_internal_set_priority (MonoI
+ #else
+ 	min = sched_get_priority_min (policy);
+ 	max = sched_get_priority_max (policy);
++
++	/* Not tunable. Bail out */
++	if ((min == -1) || (max == -1))
++		return;
+ #endif
+ 	MONO_EXIT_GC_SAFE;
+ 
diff --git a/mono6/patches/patch-mono_mini_Makefile.am.in b/mono6/patches/patch-mono_mini_Makefile.am.in
new file mode 100644
index 0000000000..f5ce580957
--- /dev/null
+++ b/mono6/patches/patch-mono_mini_Makefile.am.in
@@ -0,0 +1,15 @@
+$NetBSD$
+
+This is a JIT, we're using old boehm-gc that maps stuff RWX.
+We're going to need RWX mappings.
+
+--- mono/mini/Makefile.am.in.orig	2019-07-18 07:46:08.000000000 +0000
++++ mono/mini/Makefile.am.in
+@@ -126,6 +126,7 @@ endif
+ if DISABLE_EXECUTABLES
+ else
+ mono: mono-$(mono_bin_suffix)
++	-paxctl +m mono-$(mono_bin_suffix)
+ 	ln -sf $< $@
+ 
+ mono.exe: mono-$(mono_bin_suffix).exe
diff --git a/mono6/patches/patch-mono_native_Makefile.am b/mono6/patches/patch-mono_native_Makefile.am
new file mode 100644
index 0000000000..60491b5542
--- /dev/null
+++ b/mono6/patches/patch-mono_native_Makefile.am
@@ -0,0 +1,36 @@
+$NetBSD$
+
+Add netbsd support
+https://github.com/mono/mono/pull/15938
+
+--- mono/native/Makefile.am.orig	2019-07-18 07:46:08.000000000 +0000
++++ mono/native/Makefile.am
+@@ -49,6 +49,8 @@ linux_sources = $(unix_sources)
+ 
+ aix_sources = $(unix_sources)
+ 
++netbsd_sources = $(unix_sources)
++
+ android_sources = \
+ 	pal-android.h \
+ 	pal-android.c \
+@@ -86,7 +88,7 @@ macos_sources += $(gss_sources)
+ ios_sources += $(gss_sources)
+ endif
+ 
+-EXTRA_libmono_native_la_SOURCES = $(common_sources) $(macos_sources) $(ios_sources) $(linux_sources) $(aix_sources) $(unix_sources) $(gss_sources)
++EXTRA_libmono_native_la_SOURCES = $(common_sources) $(macos_sources) $(ios_sources) $(linux_sources) $(aix_sources) $(netbsd_sources) $(unix_sources) $(gss_sources)
+ 
+ if MONO_NATIVE_PLATFORM_MACOS
+ platform_sources = $(macos_sources)
+@@ -102,6 +104,10 @@ platform_sources = $(aix_sources)
+ else
+ if MONO_NATIVE_PLATFORM_ANDROID
+ platform_sources = $(android_sources)
++else
++if MONO_NATIVE_PLATFORM_NETBSD
++platform_sources = $(netbsd_sources)
++endif
+ endif
+ endif
+ endif
diff --git a/mono6/patches/patch-mono_native_mono-native-platform.h b/mono6/patches/patch-mono_native_mono-native-platform.h
new file mode 100644
index 0000000000..fcba1c693b
--- /dev/null
+++ b/mono6/patches/patch-mono_native_mono-native-platform.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Add netbsd support
+https://github.com/mono/mono/pull/15938
+
+--- mono/native/mono-native-platform.h.orig	2019-07-18 07:46:08.000000000 +0000
++++ mono/native/mono-native-platform.h
+@@ -11,6 +11,8 @@ typedef enum {
+ 	MONO_NATIVE_PLATFORM_TYPE_LINUX		= 3,
+ 	MONO_NATIVE_PLATFORM_TYPE_AIX		= 4,
+ 	MONO_NATIVE_PLATFORM_TYPE_ANDROID	= 5,
++	MONO_NATIVE_PLATFORM_TYPE_FREEBSD	= 6,
++	MONO_NATIVE_PLATFORM_TYPE_NETBSD	= 8,
+ 
+ 	MONO_NATIVE_PLATFORM_TYPE_IPHONE	= 0x100,
+ 	MONO_NATIVE_PLATFORM_TYPE_TV		= 0x200,
diff --git a/mono6/patches/patch-mono_utils_mono-os-semaphore.h b/mono6/patches/patch-mono_utils_mono-os-semaphore.h
new file mode 100644
index 0000000000..ad558008a3
--- /dev/null
+++ b/mono6/patches/patch-mono_utils_mono-os-semaphore.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+XXX netbsd will return EBUSY if we try to destroy a semaphore
+that something is waiting on. This apparently occurs in practice.
+
+--- mono/utils/mono-os-semaphore.h.orig	2019-07-18 07:46:08.000000000 +0000
++++ mono/utils/mono-os-semaphore.h
+@@ -190,6 +190,8 @@ mono_os_sem_destroy (MonoSemType *sem)
+ 	int res;
+ 
+ 	res = sem_destroy (sem);
++	if ((res != 0) && (errno = EBUSY))
++		res = 0;
+ 	if (G_UNLIKELY (res != 0))
+ 		g_error ("%s: sem_destroy failed with \"%s\" (%d)", __func__, g_strerror (errno), errno);
+ }
diff --git a/mono6/patches/patch-mono_utils_mono-state.c b/mono6/patches/patch-mono_utils_mono-state.c
new file mode 100644
index 0000000000..97add8c115
--- /dev/null
+++ b/mono6/patches/patch-mono_utils_mono-state.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+sys/stat.h for S_IRUSR etc.
+
+--- mono/utils/mono-state.c.orig	2019-07-18 07:46:08.000000000 +0000
++++ mono/utils/mono-state.c
+@@ -17,6 +17,7 @@
+ #include <mono/metadata/object-internals.h>
+ 
+ #include <sys/param.h>
++#include <sys/stat.h>
+ #include <fcntl.h>
+ #include <utils/mono-threads-debug.h>
+ 
diff --git a/mono6/patches/patch-mono_utils_mono-utils-debug.c b/mono6/patches/patch-mono_utils_mono-utils-debug.c
new file mode 100644
index 0000000000..6697dfa51e
--- /dev/null
+++ b/mono6/patches/patch-mono_utils_mono-utils-debug.c
@@ -0,0 +1,31 @@
+$NetBSD$
+
+Learn to use kinfo_proc2 on netbsd
+
+--- mono/utils/mono-utils-debug.c.orig	2019-07-18 07:46:08.000000000 +0000
++++ mono/utils/mono-utils-debug.c
+@@ -27,10 +27,11 @@ mono_is_usermode_native_debugger_present
+ #include <errno.h>
+ #include <mono/utils/mono-errno.h>
+ #include <fcntl.h>
+-#if defined (__APPLE__)
++#if defined (__APPLE__) || defined (__NetBSD__)
+ #include <sys/sysctl.h>
+ #endif
+ #if defined (__NetBSD__)
++#include <sys/proc.h>
+ #include <kvm.h>
+ #endif
+ #if defined (_AIX)
+@@ -78,8 +79,9 @@ mono_is_usermode_native_debugger_present
+ 	if (!kd)
+ 		return FALSE;
+ 	int count = 0;
+-	struct kinfo_proc const * const info = kvm_getprocs (kd, KERN_PROC_PID, getpid (), &count);
+-	gboolean const traced = info && count > 0 && (info->kp_proc.p_slflag & PSL_TRACED);
++	int nproc;
++	struct kinfo_proc2 const * const info = kvm_getproc2 (kd, KERN_PROC_PID, getpid (), sizeof(struct kinfo_proc2), &count);
++	gboolean const traced = info && count > 0 && (info->p_flag & P_TRACED);
+ 	kvm_close (kd);
+ 	return traced;
+ 


Home | Main Index | Thread Index | Old Index