pkgsrc-WIP-changes archive

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

Add ponyc version 0.30.0, patched for NetBSD support



Module Name:	pkgsrc-wip
Committed By:	Maya Rashish <maya%NetBSD.org@localhost>
Pushed By:	coypu
Date:		Sat Aug 3 17:43:36 2019 +0300
Changeset:	f3684226959231c2ad7d74cb0b724cb831aaacf9

Added Files:
	ponyc/DESCR
	ponyc/Makefile
	ponyc/PLIST
	ponyc/distinfo
	ponyc/patches/patch-Makefile
	ponyc/patches/patch-src_common_platform.h
	ponyc/patches/patch-src_common_pony_detail_atomics.h
	ponyc/patches/patch-src_libponyc_pkg_package.c
	ponyc/patches/patch-src_libponyc_pkg_program.c
	ponyc/patches/patch-src_libponyc_platform_paths.c
	ponyc/patches/patch-src_libponyrt_mem_alloc.c
	ponyc/patches/patch-src_libponyrt_platform_threads.c

Log Message:
Add ponyc version 0.30.0, patched for NetBSD support

and for functioning after 'make install'.

Pony is an open-source, object-oriented, actor-model, capabilities-secure,
high-performance programming language.

What makes Pony different?

Really type safe. There’s a mathematical proof and everything.

Pony is memory safe. There are no dangling pointers and no buffer
overruns. The language doesn’t even have the concept of null!

There are no runtime exceptions. All exceptions have defined
semantics, and they are always caught.

Pony doesn’t have locks nor atomic operations or anything like
that. Instead, the type system ensures at compile time that your
concurrent program can never have data races. So you can write
highly concurrent code and never get it wrong.

Deadlock-Free. This one is easy because Pony has no locks at all!
So they definitely don’t deadlock, because they don’t exist!  Native
Code. Pony is an ahead-of-time (AOT) compiled language. There is
no interpreter nor virtual machine.

Pony programs can natively call C libraries. Our compiler is able
to generate a C-header file for Pony libraries. Consequently, C/C++
programs can natively call Pony programs!

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

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

diffstat:
 ponyc/DESCR                                        |  26 +++
 ponyc/Makefile                                     |  33 ++++
 ponyc/PLIST                                        | 189 +++++++++++++++++++++
 ponyc/distinfo                                     |  14 ++
 ponyc/patches/patch-Makefile                       |  58 +++++++
 ponyc/patches/patch-src_common_platform.h          |  16 ++
 .../patches/patch-src_common_pony_detail_atomics.h |  19 +++
 ponyc/patches/patch-src_libponyc_pkg_package.c     |  37 ++++
 ponyc/patches/patch-src_libponyc_pkg_program.c     |  20 +++
 ponyc/patches/patch-src_libponyc_platform_paths.c  |  21 +++
 ponyc/patches/patch-src_libponyrt_mem_alloc.c      |  16 ++
 .../patches/patch-src_libponyrt_platform_threads.c |  27 +++
 12 files changed, 476 insertions(+)

diffs:
diff --git a/ponyc/DESCR b/ponyc/DESCR
new file mode 100644
index 0000000000..920f660d45
--- /dev/null
+++ b/ponyc/DESCR
@@ -0,0 +1,26 @@
+Pony is an open-source, object-oriented, actor-model, capabilities-secure,
+high-performance programming language.
+
+What makes Pony different?
+
+Really type safe. There’s a mathematical proof and everything.
+
+Pony is memory safe. There are no dangling pointers and no buffer
+overruns. The language doesn’t even have the concept of null!
+
+There are no runtime exceptions. All exceptions have defined
+semantics, and they are always caught.
+
+Pony doesn’t have locks nor atomic operations or anything like
+that. Instead, the type system ensures at compile time that your
+concurrent program can never have data races. So you can write
+highly concurrent code and never get it wrong.
+
+Deadlock-Free. This one is easy because Pony has no locks at all!
+So they definitely don’t deadlock, because they don’t exist!  Native
+Code. Pony is an ahead-of-time (AOT) compiled language. There is
+no interpreter nor virtual machine.
+
+Pony programs can natively call C libraries. Our compiler is able
+to generate a C-header file for Pony libraries. Consequently, C/C++
+programs can natively call Pony programs!
diff --git a/ponyc/Makefile b/ponyc/Makefile
new file mode 100644
index 0000000000..84b2c513d3
--- /dev/null
+++ b/ponyc/Makefile
@@ -0,0 +1,33 @@
+# $NetBSD$
+
+GITHUB_PROJECT=	ponyc
+DISTNAME=	0.30.0
+PKGNAME=	${GITHUB_PROJECT}-${DISTNAME}
+CATEGORIES=	lang
+MASTER_SITES=	${MASTER_SITE_GITHUB:=ponylang/}
+DIST_SUBDIR=	${GITHUB_PROJECT}
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://www.ponylang.io/
+COMMENT=	object-oriented, actor-model, capabilities-secure, high-performance programming language
+LICENSE=	2-clause-bsd
+
+WRKSRC=		${WRKDIR}/ponyc-0.30.0
+USE_TOOLS+=	pkg-config gmake
+USE_LANGUAGES=	c c++11
+
+MAKE_ENV+=	prefix=${PREFIX}
+MAKE_ENV+=	default_pic=true
+.for P in ${LP64PLATFORMS}
+.if ${MACHINE_PLATFORM:M${P}}
+MAKE_ENV+=	bits=64
+.endif
+.endfor
+
+CFLAGS.NetBSD+=	-DAVOID_128BIT_ATOMICS=1
+
+PKGCONFIG_OVERRIDE+=	lib/gbenchmark/cmake/benchmark.pc.in
+
+# XXX REQUIRES LLVM 7 RIGHT NOW!
+.include "../../lang/llvm/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/ponyc/PLIST b/ponyc/PLIST
new file mode 100644
index 0000000000..416b8fe3a7
--- /dev/null
+++ b/ponyc/PLIST
@@ -0,0 +1,189 @@
+@comment $NetBSD$
+bin/ponyc
+include/pony.h
+include/pony/detail/atomics.h
+lib/libponyc.a
+lib/libponyrt.a
+lib/pony/${PKGVERSION}/bin/ponyc
+lib/pony/${PKGVERSION}/include/pony.h
+lib/pony/${PKGVERSION}/include/pony/detail/atomics.h
+lib/pony/${PKGVERSION}/lib/native/libponyc.a
+lib/pony/${PKGVERSION}/lib/native/libponyrt.a
+lib/pony/${PKGVERSION}/packages/assert/assert.pony
+lib/pony/${PKGVERSION}/packages/backpressure/auth.pony
+lib/pony/${PKGVERSION}/packages/backpressure/backpressure.pony
+lib/pony/${PKGVERSION}/packages/buffered/_test.pony
+lib/pony/${PKGVERSION}/packages/buffered/benchmarks/main.pony
+lib/pony/${PKGVERSION}/packages/buffered/buffered.pony
+lib/pony/${PKGVERSION}/packages/buffered/reader.pony
+lib/pony/${PKGVERSION}/packages/buffered/writer.pony
+lib/pony/${PKGVERSION}/packages/builtin/_arithmetic.pony
+lib/pony/${PKGVERSION}/packages/builtin/_to_string.pony
+lib/pony/${PKGVERSION}/packages/builtin/ambient_auth.pony
+lib/pony/${PKGVERSION}/packages/builtin/any.pony
+lib/pony/${PKGVERSION}/packages/builtin/array.pony
+lib/pony/${PKGVERSION}/packages/builtin/asio_event.pony
+lib/pony/${PKGVERSION}/packages/builtin/bool.pony
+lib/pony/${PKGVERSION}/packages/builtin/builtin.pony
+lib/pony/${PKGVERSION}/packages/builtin/compare.pony
+lib/pony/${PKGVERSION}/packages/builtin/disposable_actor.pony
+lib/pony/${PKGVERSION}/packages/builtin/do_not_optimise.pony
+lib/pony/${PKGVERSION}/packages/builtin/env.pony
+lib/pony/${PKGVERSION}/packages/builtin/float.pony
+lib/pony/${PKGVERSION}/packages/builtin/iterator.pony
+lib/pony/${PKGVERSION}/packages/builtin/maybe_pointer.pony
+lib/pony/${PKGVERSION}/packages/builtin/none.pony
+lib/pony/${PKGVERSION}/packages/builtin/platform.pony
+lib/pony/${PKGVERSION}/packages/builtin/pointer.pony
+lib/pony/${PKGVERSION}/packages/builtin/read_seq.pony
+lib/pony/${PKGVERSION}/packages/builtin/real.pony
+lib/pony/${PKGVERSION}/packages/builtin/seq.pony
+lib/pony/${PKGVERSION}/packages/builtin/signed.pony
+lib/pony/${PKGVERSION}/packages/builtin/source_loc.pony
+lib/pony/${PKGVERSION}/packages/builtin/std_stream.pony
+lib/pony/${PKGVERSION}/packages/builtin/stdin.pony
+lib/pony/${PKGVERSION}/packages/builtin/string.pony
+lib/pony/${PKGVERSION}/packages/builtin/stringable.pony
+lib/pony/${PKGVERSION}/packages/builtin/unsigned.pony
+lib/pony/${PKGVERSION}/packages/builtin_test/_test.pony
+lib/pony/${PKGVERSION}/packages/builtin_test/_test_valtrace.pony
+lib/pony/${PKGVERSION}/packages/bureaucracy/_test.pony
+lib/pony/${PKGVERSION}/packages/bureaucracy/custodian.pony
+lib/pony/${PKGVERSION}/packages/bureaucracy/registrar.pony
+lib/pony/${PKGVERSION}/packages/capsicum/cap.pony
+lib/pony/${PKGVERSION}/packages/capsicum/cap_rights.pony
+lib/pony/${PKGVERSION}/packages/cli/_test.pony
+lib/pony/${PKGVERSION}/packages/cli/cli.pony
+lib/pony/${PKGVERSION}/packages/cli/command.pony
+lib/pony/${PKGVERSION}/packages/cli/command_help.pony
+lib/pony/${PKGVERSION}/packages/cli/command_parser.pony
+lib/pony/${PKGVERSION}/packages/cli/command_spec.pony
+lib/pony/${PKGVERSION}/packages/cli/env_vars.pony
+lib/pony/${PKGVERSION}/packages/collections/_test.pony
+lib/pony/${PKGVERSION}/packages/collections/flag.pony
+lib/pony/${PKGVERSION}/packages/collections/hashable.pony
+lib/pony/${PKGVERSION}/packages/collections/heap.pony
+lib/pony/${PKGVERSION}/packages/collections/list.pony
+lib/pony/${PKGVERSION}/packages/collections/list_node.pony
+lib/pony/${PKGVERSION}/packages/collections/map.pony
+lib/pony/${PKGVERSION}/packages/collections/persistent/_bits.pony
+lib/pony/${PKGVERSION}/packages/collections/persistent/_map_node.pony
+lib/pony/${PKGVERSION}/packages/collections/persistent/_test.pony
+lib/pony/${PKGVERSION}/packages/collections/persistent/_vec_node.pony
+lib/pony/${PKGVERSION}/packages/collections/persistent/benchmarks/main.pony
+lib/pony/${PKGVERSION}/packages/collections/persistent/list.pony
+lib/pony/${PKGVERSION}/packages/collections/persistent/map.pony
+lib/pony/${PKGVERSION}/packages/collections/persistent/persistent.pony
+lib/pony/${PKGVERSION}/packages/collections/persistent/set.pony
+lib/pony/${PKGVERSION}/packages/collections/persistent/vec.pony
+lib/pony/${PKGVERSION}/packages/collections/range.pony
+lib/pony/${PKGVERSION}/packages/collections/reverse.pony
+lib/pony/${PKGVERSION}/packages/collections/ring_buffer.pony
+lib/pony/${PKGVERSION}/packages/collections/set.pony
+lib/pony/${PKGVERSION}/packages/collections/sort.pony
+lib/pony/${PKGVERSION}/packages/debug/debug.pony
+lib/pony/${PKGVERSION}/packages/encode/base64/_test.pony
+lib/pony/${PKGVERSION}/packages/encode/base64/base64.pony
+lib/pony/${PKGVERSION}/packages/files/_file_des.pony
+lib/pony/${PKGVERSION}/packages/files/_test.pony
+lib/pony/${PKGVERSION}/packages/files/directory.pony
+lib/pony/${PKGVERSION}/packages/files/file.pony
+lib/pony/${PKGVERSION}/packages/files/file_caps.pony
+lib/pony/${PKGVERSION}/packages/files/file_info.pony
+lib/pony/${PKGVERSION}/packages/files/file_lines.pony
+lib/pony/${PKGVERSION}/packages/files/file_mode.pony
+lib/pony/${PKGVERSION}/packages/files/file_path.pony
+lib/pony/${PKGVERSION}/packages/files/file_stream.pony
+lib/pony/${PKGVERSION}/packages/files/files.pony
+lib/pony/${PKGVERSION}/packages/files/path.pony
+lib/pony/${PKGVERSION}/packages/format/_format_float.pony
+lib/pony/${PKGVERSION}/packages/format/_format_int.pony
+lib/pony/${PKGVERSION}/packages/format/_test.pony
+lib/pony/${PKGVERSION}/packages/format/align.pony
+lib/pony/${PKGVERSION}/packages/format/format.pony
+lib/pony/${PKGVERSION}/packages/format/format_spec.pony
+lib/pony/${PKGVERSION}/packages/format/prefix_spec.pony
+lib/pony/${PKGVERSION}/packages/ini/_test.pony
+lib/pony/${PKGVERSION}/packages/ini/ini.pony
+lib/pony/${PKGVERSION}/packages/ini/ini_map.pony
+lib/pony/${PKGVERSION}/packages/itertools/_test.pony
+lib/pony/${PKGVERSION}/packages/itertools/iter.pony
+lib/pony/${PKGVERSION}/packages/itertools/itertools.pony
+lib/pony/${PKGVERSION}/packages/json/_json_print.pony
+lib/pony/${PKGVERSION}/packages/json/_test.pony
+lib/pony/${PKGVERSION}/packages/json/json.pony
+lib/pony/${PKGVERSION}/packages/json/json_doc.pony
+lib/pony/${PKGVERSION}/packages/json/json_type.pony
+lib/pony/${PKGVERSION}/packages/logger/_test.pony
+lib/pony/${PKGVERSION}/packages/logger/logger.pony
+lib/pony/${PKGVERSION}/packages/math/fibonacci.pony
+lib/pony/${PKGVERSION}/packages/net/_test.pony
+lib/pony/${PKGVERSION}/packages/net/auth.pony
+lib/pony/${PKGVERSION}/packages/net/dns.pony
+lib/pony/${PKGVERSION}/packages/net/net.pony
+lib/pony/${PKGVERSION}/packages/net/net_address.pony
+lib/pony/${PKGVERSION}/packages/net/ossocket.pony
+lib/pony/${PKGVERSION}/packages/net/ossockopt.pony
+lib/pony/${PKGVERSION}/packages/net/tcp_connection.pony
+lib/pony/${PKGVERSION}/packages/net/tcp_connection_notify.pony
+lib/pony/${PKGVERSION}/packages/net/tcp_listen_notify.pony
+lib/pony/${PKGVERSION}/packages/net/tcp_listener.pony
+lib/pony/${PKGVERSION}/packages/net/udp_notify.pony
+lib/pony/${PKGVERSION}/packages/net/udp_socket.pony
+lib/pony/${PKGVERSION}/packages/options/_test.pony
+lib/pony/${PKGVERSION}/packages/options/env_vars.pony
+lib/pony/${PKGVERSION}/packages/options/options.pony
+lib/pony/${PKGVERSION}/packages/ponybench/_aggregator.pony
+lib/pony/${PKGVERSION}/packages/ponybench/_output_manager.pony
+lib/pony/${PKGVERSION}/packages/ponybench/_results.pony
+lib/pony/${PKGVERSION}/packages/ponybench/_runner.pony
+lib/pony/${PKGVERSION}/packages/ponybench/benchmark.pony
+lib/pony/${PKGVERSION}/packages/ponybench/pony_bench.pony
+lib/pony/${PKGVERSION}/packages/ponytest/_color.pony
+lib/pony/${PKGVERSION}/packages/ponytest/_group.pony
+lib/pony/${PKGVERSION}/packages/ponytest/_test_record.pony
+lib/pony/${PKGVERSION}/packages/ponytest/_test_runner.pony
+lib/pony/${PKGVERSION}/packages/ponytest/pony_test.pony
+lib/pony/${PKGVERSION}/packages/ponytest/test_helper.pony
+lib/pony/${PKGVERSION}/packages/ponytest/test_list.pony
+lib/pony/${PKGVERSION}/packages/ponytest/unit_test.pony
+lib/pony/${PKGVERSION}/packages/process/_pipe.pony
+lib/pony/${PKGVERSION}/packages/process/_process.pony
+lib/pony/${PKGVERSION}/packages/process/_test.pony
+lib/pony/${PKGVERSION}/packages/process/auth.pony
+lib/pony/${PKGVERSION}/packages/process/process_monitor.pony
+lib/pony/${PKGVERSION}/packages/process/process_notify.pony
+lib/pony/${PKGVERSION}/packages/promises/_test.pony
+lib/pony/${PKGVERSION}/packages/promises/_then.pony
+lib/pony/${PKGVERSION}/packages/promises/fulfill.pony
+lib/pony/${PKGVERSION}/packages/promises/promise.pony
+lib/pony/${PKGVERSION}/packages/random/_test.pony
+lib/pony/${PKGVERSION}/packages/random/benchmarks/main.pony
+lib/pony/${PKGVERSION}/packages/random/dice.pony
+lib/pony/${PKGVERSION}/packages/random/mt.pony
+lib/pony/${PKGVERSION}/packages/random/random.pony
+lib/pony/${PKGVERSION}/packages/random/splitmix64.pony
+lib/pony/${PKGVERSION}/packages/random/xoroshiro.pony
+lib/pony/${PKGVERSION}/packages/random/xorshift.pony
+lib/pony/${PKGVERSION}/packages/serialise/_test.pony
+lib/pony/${PKGVERSION}/packages/serialise/serialise.pony
+lib/pony/${PKGVERSION}/packages/signals/_test.pony
+lib/pony/${PKGVERSION}/packages/signals/sig.pony
+lib/pony/${PKGVERSION}/packages/signals/signal_handler.pony
+lib/pony/${PKGVERSION}/packages/signals/signal_notify.pony
+lib/pony/${PKGVERSION}/packages/stdlib/_test.pony
+lib/pony/${PKGVERSION}/packages/strings/_test.pony
+lib/pony/${PKGVERSION}/packages/strings/common_prefix.pony
+lib/pony/${PKGVERSION}/packages/term/ansi.pony
+lib/pony/${PKGVERSION}/packages/term/ansi_notify.pony
+lib/pony/${PKGVERSION}/packages/term/ansi_term.pony
+lib/pony/${PKGVERSION}/packages/term/readline.pony
+lib/pony/${PKGVERSION}/packages/term/readline_notify.pony
+lib/pony/${PKGVERSION}/packages/time/_test.pony
+lib/pony/${PKGVERSION}/packages/time/_timing_wheel.pony
+lib/pony/${PKGVERSION}/packages/time/nanos.pony
+lib/pony/${PKGVERSION}/packages/time/posix_date.pony
+lib/pony/${PKGVERSION}/packages/time/time.pony
+lib/pony/${PKGVERSION}/packages/time/timer.pony
+lib/pony/${PKGVERSION}/packages/time/timer_notify.pony
+lib/pony/${PKGVERSION}/packages/time/timers.pony
diff --git a/ponyc/distinfo b/ponyc/distinfo
new file mode 100644
index 0000000000..ac165befa6
--- /dev/null
+++ b/ponyc/distinfo
@@ -0,0 +1,14 @@
+$NetBSD$
+
+SHA1 (ponyc/0.30.0.tar.gz) = 1a421c996c9f75bf70569d49bc73602752b8a889
+RMD160 (ponyc/0.30.0.tar.gz) = 1df124e2fe655a5f7b9d8601fb7937585d494be5
+SHA512 (ponyc/0.30.0.tar.gz) = fbf59a687e85d02ddcc5c8f56911005e2aaa5721c97f17f1cb5209f7a8de8e19182dce6aa2d6a9373d03e4cd7161ee595b3229b3b2443dbd647d59ce4e6cc435
+Size (ponyc/0.30.0.tar.gz) = 1398063 bytes
+SHA1 (patch-Makefile) = e7be27e216493b10014b5accb914823e1ae9874a
+SHA1 (patch-src_common_platform.h) = e18163348f15a5efb4ba1953605e76172fbd6737
+SHA1 (patch-src_common_pony_detail_atomics.h) = b7427e76af99bc2545420a3751e91a79ecf7802a
+SHA1 (patch-src_libponyc_pkg_package.c) = e3866195e22b0d49dd429e45d539c9082754021b
+SHA1 (patch-src_libponyc_pkg_program.c) = 63f1fdb777fffe3b36494720535e257c2aec7cd5
+SHA1 (patch-src_libponyc_platform_paths.c) = 893947e4916b34f3445f315cb983b19729540a2b
+SHA1 (patch-src_libponyrt_mem_alloc.c) = 4847bd20c6c1de7af798f7fb19b6d877b043097f
+SHA1 (patch-src_libponyrt_platform_threads.c) = b55d1453bb2bb255ca806d56374f340c2f871ec7
diff --git a/ponyc/patches/patch-Makefile b/ponyc/patches/patch-Makefile
new file mode 100644
index 0000000000..4e5024fb07
--- /dev/null
+++ b/ponyc/patches/patch-Makefile
@@ -0,0 +1,58 @@
+$NetBSD$
+
+Add NetBSD
+
+Avoid -Werror, avoid tuning for the package builder (create
+portable binaries)
+Only error is on netbsd:
+/usr/include/unwind.h:94:9: note: expected '_Unwind_Ptr {aka void *}' but argument is of type 'uintptr_t {aka long unsigned int}'
+ void    _Unwind_SetIP(struct _Unwind_Context *, _Unwind_Ptr);
+         ^~~~~~~~~~~~~
+
+Grab ldflags from llvm-config --ldflags, instead of assuming
+the output of llvm.libdir is only one argument we can prepend -L
+to.
+
+--- Makefile.orig	2019-07-27 10:37:45.000000000 +0000
++++ Makefile
+@@ -27,6 +27,11 @@ else
+     CXX = c++
+   endif
+ 
++  ifeq ($(UNAME_S),NetBSD)
++    OSTYPE = bsd
++    CXX = c++
++  endif
++
+   ifeq ($(UNAME_S),DragonFly)
+     OSTYPE = bsd
+     CXX = c++
+@@ -119,7 +124,7 @@ else
+ endif
+ 
+ LIB_EXT ?= a
+-BUILD_FLAGS = -march=$(arch) -mtune=$(tune) -Werror -Wconversion \
++BUILD_FLAGS = -Wconversion \
+   -Wno-sign-conversion -Wextra -Wall
+ LINKER_FLAGS = -march=$(arch) -mtune=$(tune) $(LDFLAGS)
+ AR_FLAGS ?= rcs
+@@ -319,8 +324,8 @@ ifneq ($(MAKECMDGOALS),clean)
+   # (2) the linker flags necessary to link against the prebuilt libraries
+   # (3) a list of include directories for a set of libraries
+   # (4) a list of the libraries to link against
+-  llvm.libdir := $(CROSS_SYSROOT)$(subst -L,,$(shell $(LLVM_CONFIG) --ldflags $(LLVM_LINK_STATIC)))
+-  llvm.ldflags := -L$(llvm.libdir)
++  llvm.libdir := $(CROSS_SYSROOT)$(shell $(LLVM_CONFIG) --libdir)
++  llvm.ldflags := $(CROSS_SYSROOT)$(shell $(LLVM_CONFIG) --ldflags)
+ 
+   # Set rpath for ponyc if we're dynamically linking LLVM_VENDOR
+   ifeq (,$(LLVM_LINK_STATIC))
+@@ -394,7 +399,7 @@ ifeq ($(runtime-bitcode),yes)
+ endif
+ 
+ makefile_abs_path := $(realpath $(lastword $(MAKEFILE_LIST)))
+-packages_abs_src := $(shell dirname $(makefile_abs_path))/packages
++packages_abs_src := $(ponydir)/packages
+ 
+ $(shell mkdir -p $(PONY_BUILD_DIR))
+ $(info Building into $(PONY_BUILD_DIR))
diff --git a/ponyc/patches/patch-src_common_platform.h b/ponyc/patches/patch-src_common_platform.h
new file mode 100644
index 0000000000..7ef56e26d9
--- /dev/null
+++ b/ponyc/patches/patch-src_common_platform.h
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Add NetBSD
+
+--- src/common/platform.h.orig	2019-07-27 10:37:45.000000000 +0000
++++ src/common/platform.h
+@@ -34,6 +34,9 @@
+ #elif defined(__DragonFly__)
+ #  define PLATFORM_IS_BSD
+ #  define PLATFORM_IS_DRAGONFLY
++#elif defined(__NetBSD__)
++#  define PLATFORM_IS_BSD
++#  define PLATFORM_IS_NETBSD
+ #elif defined(__OpenBSD__)
+ #  define PLATFORM_IS_BSD
+ #  define PLATFORM_IS_OPENBSD
diff --git a/ponyc/patches/patch-src_common_pony_detail_atomics.h b/ponyc/patches/patch-src_common_pony_detail_atomics.h
new file mode 100644
index 0000000000..ba186b2e37
--- /dev/null
+++ b/ponyc/patches/patch-src_common_pony_detail_atomics.h
@@ -0,0 +1,19 @@
+$NetBSD$
+
+Add an option to request no 128bit atomics.
+
+-- with GCC, this unconditionally emits a call to libatomic.
+On NetBSD, no libatomic is supplied, so we can't provide it even on CPUs
+with 128bit atomics.
+
+--- src/common/pony/detail/atomics.h.orig	2019-07-27 10:37:45.000000000 +0000
++++ src/common/pony/detail/atomics.h
+@@ -91,7 +91,7 @@ namespace ponyint_atomics
+ #  define PONY_ABA_PROTECTED_PTR_DECLARE(T)
+ #  define PONY_ABA_PROTECTED_PTR(T) ponyint_atomics::aba_protected_ptr_t<T>
+ #else
+-#  if defined(__LP64__) || defined(_WIN64)
++#  if !defined(AVOID_128BIT_ATOMICS) && (defined(__LP64__) || defined(_WIN64))
+ #    define PONY_DOUBLEWORD __int128_t
+ #  else
+ #    define PONY_DOUBLEWORD int64_t
diff --git a/ponyc/patches/patch-src_libponyc_pkg_package.c b/ponyc/patches/patch-src_libponyc_pkg_package.c
new file mode 100644
index 0000000000..aedfba7856
--- /dev/null
+++ b/ponyc/patches/patch-src_libponyc_pkg_package.c
@@ -0,0 +1,37 @@
+$NetBSD$
+
+Look for packages where they end up being installed.
+Look for pony libraries in PREFIX/lib
+
+--- src/libponyc/pkg/package.c.orig	2019-07-27 10:37:45.000000000 +0000
++++ src/libponyc/pkg/package.c
+@@ -698,6 +698,10 @@ static bool add_exec_dir(pass_opt_t* opt
+   snprintf(lib_path, lib_len, "../lib/%s", link_arch);
+ 
+   success = add_relative_path(path, lib_path, opt);
++  if(!success)
++    return false;
++
++  success = add_relative_path(path, "../lib", opt);
+ 
+   ponyint_pool_free_size(lib_len, lib_path);
+ 
+@@ -721,7 +725,7 @@ static bool add_exec_dir(pass_opt_t* opt
+ #ifdef PLATFORM_IS_WINDOWS
+   success = add_relative_path(path, "..\\packages", opt);
+ #else
+-  success = add_relative_path(path, "../packages", opt);
++  success = add_relative_path(path, "../lib/pony/" PONY_VERSION "/packages", opt);
+ #endif
+ 
+   if(!success)
+@@ -756,8 +760,7 @@ bool package_init(pass_opt_t* opt)
+ 
+   // Finally we add OS specific paths.
+ #ifdef PLATFORM_IS_POSIX_BASED
+-  add_path("/usr/local/lib", opt);
+-  add_path("/opt/local/lib", opt);
++  add_path(PREFIX "lib", opt);
+ #endif
+ 
+   // Convert all the safe packages to their full paths.
diff --git a/ponyc/patches/patch-src_libponyc_pkg_program.c b/ponyc/patches/patch-src_libponyc_pkg_program.c
new file mode 100644
index 0000000000..e9aee26c27
--- /dev/null
+++ b/ponyc/patches/patch-src_libponyc_pkg_program.c
@@ -0,0 +1,20 @@
+$NetBSD$
+
+--- src/libponyc/pkg/program.c.orig	2019-07-27 10:37:45.000000000 +0000
++++ src/libponyc/pkg/program.c
+@@ -202,13 +202,13 @@ void program_lib_build_args(ast_t* progr
+     const char* libpath = strlist_data(p);
+     append_to_args(data, path_preamble);
+     append_to_args(data, libpath);
+-    append_to_args(data, " ");
++    append_to_args(data, "../ ");
+ 
+     if(rpath_preamble != NULL)
+     {
+       append_to_args(data, rpath_preamble);
+       append_to_args(data, libpath);
+-      append_to_args(data, " ");
++      append_to_args(data, "../lib ");
+     }
+   }
+ 
diff --git a/ponyc/patches/patch-src_libponyc_platform_paths.c b/ponyc/patches/patch-src_libponyc_platform_paths.c
new file mode 100644
index 0000000000..8e7923872c
--- /dev/null
+++ b/ponyc/patches/patch-src_libponyc_platform_paths.c
@@ -0,0 +1,21 @@
+$NetBSD$
+
+Add NetBSD way of finding current executable path
+
+--- src/libponyc/platform/paths.c.orig	2019-07-27 10:37:45.000000000 +0000
++++ src/libponyc/platform/paths.c
+@@ -265,6 +265,14 @@ bool get_compiler_exe_path(char* output_
+     }
+     free(tofree);
+   }
++#elif defined PLATFORM_IS_NETBSD
++  const int mib[] = {
++    CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME,
++  };
++
++  size_t len = MAXPATHLEN;
++  int r = sysctl(mib, 4, output_path, &len, NULL, 0);
++  success = (r == 0);
+ #elif defined PLATFORM_IS_BSD
+   int mib[4];
+   mib[0] = CTL_KERN;
diff --git a/ponyc/patches/patch-src_libponyrt_mem_alloc.c b/ponyc/patches/patch-src_libponyrt_mem_alloc.c
new file mode 100644
index 0000000000..629e1232d7
--- /dev/null
+++ b/ponyc/patches/patch-src_libponyrt_mem_alloc.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Provide fallback to MAP_ALIGNED_SUPER for NetBSD.
+
+--- src/libponyrt/mem/alloc.c.orig	2019-07-27 10:37:45.000000000 +0000
++++ src/libponyrt/mem/alloc.c
+@@ -36,6 +36,9 @@ void* ponyint_virt_alloc(size_t bytes)
+   p = mmap(0, bytes, PROT_READ | PROT_WRITE,
+     MAP_PRIVATE | MAP_ANON, -1, 0);
+ #elif defined(PLATFORM_IS_BSD)
++#ifndef MAP_ALIGNED_SUPER
++#define MAP_ALIGNED_SUPER 0
++#endif
+   p = mmap(0, bytes, PROT_READ | PROT_WRITE,
+     MAP_PRIVATE | MAP_ANON | MAP_ALIGNED_SUPER, -1, 0);
+ #endif
diff --git a/ponyc/patches/patch-src_libponyrt_platform_threads.c b/ponyc/patches/patch-src_libponyrt_platform_threads.c
new file mode 100644
index 0000000000..539cb02d5a
--- /dev/null
+++ b/ponyc/patches/patch-src_libponyrt_platform_threads.c
@@ -0,0 +1,27 @@
+$NetBSD$
+
+pthread_np.h is freebsd+openbsd+dragonfly, no netbsd.
+provide fallback for PTHREAD_STACK_MIN (XXX is the value reasonable)
+
+--- src/libponyrt/platform/threads.c.orig	2019-07-27 10:37:45.000000000 +0000
++++ src/libponyrt/platform/threads.c
+@@ -10,7 +10,7 @@
+ #include <sys/mman.h>
+ #endif
+ 
+-#if defined(PLATFORM_IS_BSD)
++#if defined(PLATFORM_IS_FREEBSD) || defined(PLATFORM_IS_DRAGONFLY) || defined(PLATFORM_IS_OPENBSD)
+ #include <pthread_np.h>
+ #endif
+ #if defined(PLATFORM_IS_FREEBSD)
+@@ -176,6 +176,10 @@ bool ponyint_thread_create(pony_thread_i
+   pthread_attr_t* attr_p = &attr;
+   pthread_attr_init(attr_p);
+ 
++#ifndef PTHREAD_STACK_MIN
++#define PTHREAD_STACK_MIN 0x1000
++#endif
++
+   // Some systems, e.g., macOS, hav a different default default
+   // stack size than the typical system's RLIMIT_STACK.
+   // Let's use RLIMIT_STACK's current limit if it is sane.


Home | Main Index | Thread Index | Old Index