git: 1f2cf638840d - main - lang/harec: add port of the Hare compiler written in C11

From: Stefan Eßer <se_at_FreeBSD.org>
Date: Sat, 30 Apr 2022 09:41:55 UTC
The branch main has been updated by se:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1f2cf638840ddd88b84b30458140e7964ebcba50

commit 1f2cf638840ddd88b84b30458140e7964ebcba50
Author:     Stefan Eßer <se@FreeBSD.org>
AuthorDate: 2022-04-30 09:35:56 +0000
Commit:     Stefan Eßer <se@FreeBSD.org>
CommitDate: 2022-04-30 09:35:56 +0000

    lang/harec: add port of the Hare compiler written in C11
    
    The Hare programming language is a simple systems programming
    language that is currently under development. It supports code
    generation for amd64, aarch64, and riscv64 targets, but this
    port is currently limited to amd64 due to lack of testing on
    other FreeBSD architectures.
---
 lang/Makefile        |  1 +
 lang/harec/Makefile  | 37 +++++++++++++++++++++++++++++++++++++
 lang/harec/distinfo  |  3 +++
 lang/harec/pkg-descr |  9 +++++++++
 lang/harec/pkg-plist |  4 ++++
 5 files changed, 54 insertions(+)

diff --git a/lang/Makefile b/lang/Makefile
index 5e37d6ff8a7d..9b5e6ba19833 100644
--- a/lang/Makefile
+++ b/lang/Makefile
@@ -121,6 +121,7 @@
     SUBDIR += guile1
     SUBDIR += guile2
     SUBDIR += halide
+    SUBDIR += harec
     SUBDIR += haskell-mode.el
     SUBDIR += hermes
     SUBDIR += hla
diff --git a/lang/harec/Makefile b/lang/harec/Makefile
new file mode 100644
index 000000000000..45623dd27603
--- /dev/null
+++ b/lang/harec/Makefile
@@ -0,0 +1,37 @@
+PORTNAME=	harec
+PORTVERSION=	g20220428
+CATEGORIES=	lang
+MASTER_SITES=	https://git.sr.ht/~sircmpwn/${PORTNAME}/archive/
+DISTNAME=	e5fb517
+DIST_SUBDIR=	hare
+
+MAINTAINER=	se@FreeBSD.org
+COMMENT=	Hare compiler written in C11
+
+LICENSE=	AGPLv3
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+ONLY_FOR_ARCHS=	amd64 # aarch64 riscv64
+
+BUILD_DEPENDS=	qbe:devel/qbe
+RUN_DEPENDS=	qbe:devel/qbe
+
+USES=		compiler:c11
+
+WRKSRC=		${WRKDIR}/${PORTNAME}-${DISTNAME}
+
+OPTIONS_DEFINE=	DOCS
+
+do-build:
+		${MKDIR} ${WRKSRC}/build
+		cd ${WRKSRC}/build && CFLAGS="${CFLAGS}" ../configure --prefix=${PREFIX} && make
+
+do-install:
+		${INSTALL_PROGRAM} ${WRKSRC}/build/harec ${STAGEDIR}${PREFIX}/bin
+		${MKDIR} ${STAGEDIR}${DOCSDIR}
+		${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${STAGEDIR}${DOCSDIR}
+
+#do-test:
+#		cd ${WRKSRC}/build && make check
+
+.include <bsd.port.mk>
diff --git a/lang/harec/distinfo b/lang/harec/distinfo
new file mode 100644
index 000000000000..b9454358f738
--- /dev/null
+++ b/lang/harec/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1651310936
+SHA256 (hare/e5fb517.tar.gz) = 12694873b5c356b7962fba3a838167141a60dd8db713e715cf6f1eb25aa12944
+SIZE (hare/e5fb517.tar.gz) = 155242
diff --git a/lang/harec/pkg-descr b/lang/harec/pkg-descr
new file mode 100644
index 000000000000..78320088de25
--- /dev/null
+++ b/lang/harec/pkg-descr
@@ -0,0 +1,9 @@
+This is the Hare compiler written in C.
+
+Hare is a systems programming language designed to be simple, stable,
+and robust. Hare uses a static type system, manual memory management,
+and a minimal runtime. It is well-suited to writing operating systems,
+system tools, compilers, networking software, and other low-level,
+high performance tasks.
+
+WWW: https://harelang.org/
diff --git a/lang/harec/pkg-plist b/lang/harec/pkg-plist
new file mode 100644
index 000000000000..900ae4e1b7e2
--- /dev/null
+++ b/lang/harec/pkg-plist
@@ -0,0 +1,4 @@
+bin/harec
+%%PORTDOCS%%%%DOCSDIR%%/declaration_solver.txt
+%%PORTDOCS%%%%DOCSDIR%%/env.txt
+%%PORTDOCS%%%%DOCSDIR%%/runtime.txt