Hi ports --
Attached is a diff to unbreak and update the reference D compiler.
In addition, this update includes what I am hoping can serve as an LTS
bootstrap compiler. Very old versions of the D compiler, all the way
back to 2.076.1, can bootstrap the current D compiler. The bootstrap
compiler was built with -static using GDC 14.1 and therefore doesn't
have any library dependencies. I would like to be able to use this as an
LTS bootstrap compiler until either it no longer builds modern versions
of the D compiler or no longer runs on OpenBSD (or until I feel like
giving it an update). Should make updating as easy as cranking version
number, updating patches, and updating plist.
OK?
~Brian
Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/dmd/Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 Makefile
--- Makefile 9 Mar 2024 15:18:28 -0000 1.17
+++ Makefile 21 May 2024 00:34:49 -0000
@@ -1,15 +1,14 @@
-BROKEN= needs new bootstrap
-
# i386 forthcoming
ONLY_FOR_ARCHS = amd64
# No BT CFI yet.
USE_NOBTCFI = Yes
-V = 2.106.0
+V = 2.108.1
+BOOTSTRAP = 2.108.1
COMMENT = reference compiler for the D programming language
DISTFILES = dmd-${V}{v${V}}.tar.gz
-DISTFILES.boot= dmd-${V}-bootstrap.tar.gz
+DISTFILES.boot= dmd-${BOOTSTRAP}-bootstrap.tar.gz
DISTFILES.phobos = phobos-${V}{v${V}}.tar.gz
PKGNAME = dmd-${V}
CATEGORIES = lang
@@ -22,15 +21,13 @@ PERMIT_PACKAGE = Yes
WANTLIB += c c++abi execinfo m pthread
-SITES.boot = https://github.com/ibara/dmd/releases/download/bootstrap-${V}/
+SITES.boot =
https://github.com/ibara/dmd/releases/download/bootstrap-${BOOTSTRAP}/
SITES = https://github.com/dlang/dmd/archive/refs/tags/
SITES.phobos = https://github.com/dlang/phobos/archive/refs/tags/
USE_GMAKE = Yes
MAKE_ENV = HOST_CXX="${CXX}" \
- HOST_DMD="${WRKDIR}/dmd-bootstrap/openbsd/bin${MODEL}/dmd" \
- LD_LIBRARY_PATH="${WRKSRC}/dmd-bootstrap/openbsd/bin${MODEL}"
-MAKE_FILE = posix.mak
+ HOST_DMD="${WRKDIR}/dmd-bootstrap/openbsd/bin${MODEL}/dmd"
NO_TEST = Yes
@@ -45,21 +42,21 @@ MODEL = 32
post-extract:
mv ${WRKSRC}/dmd-${V} ${WRKSRC}/dmd
mv ${WRKSRC}/phobos-${V} ${WRKSRC}/phobos
- chmod 644 ${WRKDIR}/dmd-bootstrap/openbsd/bin64/lib*.so* # XXX
- cp /usr/lib/libc.so.98.* ${WRKDIR}/dmd-bootstrap/openbsd/bin64/ # XXX
# We need to do this manually.
# Yes, this is all really correct.
do-build:
cd ${WRKDIR}/phobos && \
- ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} -f ${MAKE_FILE} && \
- ${SETENV} ${MAKE_PROGRAM} -f ${MAKE_FILE} install
+ ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} && \
+ ${SETENV} ${MAKE_PROGRAM} install
cd ${WRKDIR}/dmd/druntime && \
- ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} -f ${MAKE_FILE} && \
- ${SETENV} ${MAKE_PROGRAM} -f ${MAKE_FILE} install
+ ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} && \
+ ${SETENV} ${MAKE_PROGRAM} install
mkdir ${WRKDIR}/install/openbsd/bin${MODEL}
cp ${WRKDIR}/dmd/generated/openbsd/release/${MODEL}/dmd \
${WRKDIR}/install/openbsd/bin${MODEL}
+ cd ${WRKDIR}/dmd/compiler/docs && \
+ ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} build
# We need to do this manually too.
do-install:
@@ -67,7 +64,8 @@ do-install:
${PREFIX}/bin
${INSTALL_DATA} ${WRKDIR}/install/openbsd/lib${MODEL}/libphobos2.a \
${PREFIX}/lib
- ${INSTALL_MAN} ${WRKDIR}/dmd-bootstrap/dmd.1 ${PREFIX}/man/man1
+ ${INSTALL_MAN} ${WRKSRC}/dmd/generated/docs/man/man1/dmd.1 \
+ ${PREFIX}/man/man1
${INSTALL_MAN} ${WRKDIR}/dmd/compiler/docs/man/man5/dmd.conf.5 \
${PREFIX}/man/man5
${INSTALL_DATA_DIR} ${PREFIX}/include/dmd
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/dmd/distinfo,v
retrieving revision 1.11
diff -u -p -r1.11 distinfo
--- distinfo 18 Dec 2023 22:20:58 -0000 1.11
+++ distinfo 21 May 2024 00:34:49 -0000
@@ -1,6 +1,6 @@
-SHA256 (dmd-2.106.0-bootstrap.tar.gz) =
lSsGN+CaT80zcTbEuUQHbFV0wL5DXikDGWFepL7/nbY=
-SHA256 (dmd-2.106.0.tar.gz) = EHlknEGpuODT6BxXPILYTNaHOzr8lbN9b1IGhCztx8k=
-SHA256 (phobos-2.106.0.tar.gz) = P5Ju4mkFwvb+RX560v5P6sjK2DxXGnCt6jC2zUpDZrY=
-SIZE (dmd-2.106.0-bootstrap.tar.gz) = 10233808
-SIZE (dmd-2.106.0.tar.gz) = 5936389
-SIZE (phobos-2.106.0.tar.gz) = 2761012
+SHA256 (dmd-2.108.1-bootstrap.tar.gz) =
5YU+4e1lVsILcYqtiWh60fUNZhOLuscH5BdobY8hxLM=
+SHA256 (dmd-2.108.1.tar.gz) = Rw6xKJV44XlSX5Ir6IAD1e0jEAC4qxLCe451A013/Lc=
+SHA256 (phobos-2.108.1.tar.gz) = bYAxAGqJd7rqXBleP3E0rOclGWK22IxgILf5M/7eYno=
+SIZE (dmd-2.108.1-bootstrap.tar.gz) = 11189652
+SIZE (dmd-2.108.1.tar.gz) = 5984240
+SIZE (phobos-2.108.1.tar.gz) = 2749901
Index: patches/patch-dmd_Makefile
===================================================================
RCS file: patches/patch-dmd_Makefile
diff -N patches/patch-dmd_Makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-dmd_Makefile 21 May 2024 00:34:49 -0000
@@ -0,0 +1,12 @@
+Index: dmd/Makefile
+--- dmd/Makefile.orig
++++ dmd/Makefile
+@@ -19,7 +19,7 @@
+
+ include compiler/src/osmodel.mak
+
+-INSTALL_DIR=$(shell pwd)/../install
++INSTALL_DIR=../install
+ ECTAGS_LANGS = Make,C,C++,D,Sh
+ ECTAGS_FILES = compiler/dmd/*.[chd] compiler/dmd/backend/*.[chd]
compiler/dmd/root/*.[chd]
+
Index: patches/patch-dmd_compiler_docs_Makefile
===================================================================
RCS file: patches/patch-dmd_compiler_docs_Makefile
diff -N patches/patch-dmd_compiler_docs_Makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-dmd_compiler_docs_Makefile 21 May 2024 00:34:49 -0000
@@ -0,0 +1,18 @@
+Index: dmd/compiler/docs/Makefile
+--- dmd/compiler/docs/Makefile.orig
++++ dmd/compiler/docs/Makefile
+@@ -4,7 +4,7 @@ DMD_MAN_PAGE=man/man1/dmd.1
+ DIFFABLE=0
+
+ build: $(GENERATED)/build
+- ./$(GENERATED)/build HOST_DMD="$(DMD)" DIFFABLE="$(DIFFABLE)" man
++ ./$(GENERATED)/build HOST_DMD="$(HOST_DMD)" DIFFABLE="$(DIFFABLE)" man
+
+ preview: $(GENERATED)/docs/$(DMD_MAN_PAGE)
+ man -l $(GENERATED)/docs/$(DMD_MAN_PAGE)
+@@ -13,4 +13,4 @@ $(GENERATED)/docs/%: $(GENERATED)/build
+ $(GENERATED)/build $@
+
+ $(GENERATED)/build: ../src/build.d
+- $(DMD) -of$@ ../src/build.d
++ $(HOST_DMD) -of$@ ../src/build.d
Index: patches/patch-dmd_compiler_src_dmd_link_d
===================================================================
RCS file: /cvs/ports/lang/dmd/patches/patch-dmd_compiler_src_dmd_link_d,v
retrieving revision 1.2
diff -u -p -r1.2 patch-dmd_compiler_src_dmd_link_d
--- patches/patch-dmd_compiler_src_dmd_link_d 18 Dec 2023 22:20:58 -0000
1.2
+++ patches/patch-dmd_compiler_src_dmd_link_d 21 May 2024 00:34:49 -0000
@@ -1,7 +1,7 @@
Index: dmd/compiler/src/dmd/link.d
--- dmd/compiler/src/dmd/link.d.orig
+++ dmd/compiler/src/dmd/link.d
-@@ -519,6 +519,12 @@ public int runLINK()
+@@ -509,6 +509,12 @@ public int runLINK(bool verbose, ErrorSink eSink)
if (driverParams.dll)
argv.push("-shared");
}
Index: patches/patch-dmd_druntime_Makefile
===================================================================
RCS file: patches/patch-dmd_druntime_Makefile
diff -N patches/patch-dmd_druntime_Makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-dmd_druntime_Makefile 21 May 2024 00:34:49 -0000
@@ -0,0 +1,24 @@
+Index: dmd/druntime/Makefile
+--- dmd/druntime/Makefile.orig
++++ dmd/druntime/Makefile
+@@ -85,11 +85,9 @@ MAKEFILE = $(firstword $(MAKEFILE_LIST))
+ DDOCFLAGS=-conf= -c -w -o- -Iimport -version=CoreDdoc
+
+ # Set CFLAGS
+-CFLAGS=$(if $(findstring $(OS),windows),,$(MODEL_FLAG) -fPIC -DHAVE_UNISTD_H)
++CFLAGS+=$(if $(findstring $(OS),windows),,$(MODEL_FLAG) -fPIC -DHAVE_UNISTD_H)
+ ifeq ($(BUILD),debug)
+ CFLAGS += -g
+-else
+- CFLAGS += -O3
+ endif
+ ifeq (solaris,$(OS))
+ CFLAGS+=-D_REENTRANT # for thread-safe errno
+@@ -520,7 +518,6 @@ benchmark-compile-only: $(ROOT)/benchmark$(DOTEXE) $(D
+ DMD=$(DMD) $< --repeat=0 --dflags="$(PHOBOS_DFLAGS) -de"
+
+ #################### test for undesired white spaces
##########################
+-MANIFEST = $(shell git ls-tree --name-only -r HEAD)
+
+ CWS_MAKEFILES = $(filter mak/% %.mak %/Makefile,$(MANIFEST))
+ NOT_MAKEFILES = $(filter-out $(CWS_MAKEFILES) src/rt/minit.obj
test/%.exp,$(MANIFEST))
Index: patches/patch-dmd_druntime_posix_mak
===================================================================
RCS file: patches/patch-dmd_druntime_posix_mak
diff -N patches/patch-dmd_druntime_posix_mak
--- patches/patch-dmd_druntime_posix_mak 18 Dec 2023 22:20:58 -0000
1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,24 +0,0 @@
-Index: dmd/druntime/posix.mak
---- dmd/druntime/posix.mak.orig
-+++ dmd/druntime/posix.mak
-@@ -65,11 +65,9 @@ MAKEFILE = $(firstword $(MAKEFILE_LIST))
- DDOCFLAGS=-conf= -c -w -o- -Isrc -Iimport -version=CoreDdoc
-
- # Set CFLAGS
--CFLAGS=$(MODEL_FLAG) -fPIC -DHAVE_UNISTD_H
-+CFLAGS+=$(MODEL_FLAG) -fPIC -DHAVE_UNISTD_H
- ifeq ($(BUILD),debug)
- CFLAGS += -g
--else
-- CFLAGS += -O3
- endif
- ifeq (solaris,$(OS))
- CFLAGS+=-D_REENTRANT # for thread-safe errno
-@@ -474,7 +472,6 @@ benchmark-compile-only: $(ROOT)/benchmark $(DMD)
- DMD=$(DMD) $< --repeat=0 --dflags="$(PHOBOS_DFLAGS) -de"
-
- #################### test for undesired white spaces
##########################
--MANIFEST = $(shell git ls-tree --name-only -r HEAD)
-
- CWS_MAKEFILES = $(filter mak/% %.mak %/Makefile,$(MANIFEST))
- NOT_MAKEFILES = $(filter-out $(CWS_MAKEFILES) src/rt/minit.obj
test/%.exp,$(MANIFEST))
Index: patches/patch-dmd_posix_mak
===================================================================
RCS file: patches/patch-dmd_posix_mak
diff -N patches/patch-dmd_posix_mak
--- patches/patch-dmd_posix_mak 13 Feb 2023 00:52:59 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,9 +0,0 @@
-Index: dmd/posix.mak
---- dmd/posix.mak.orig
-+++ dmd/posix.mak
-@@ -1,4 +1,4 @@
--INSTALL_DIR=$(PWD)/../install
-+INSTALL_DIR=../install
- ECTAGS_LANGS = Make,C,C++,D,Sh
- ECTAGS_FILES = compiler/dmd/*.[chd] compiler/dmd/backend/*.[chd]
compiler/dmd/root/*.[chd]
-
Index: patches/patch-phobos_Makefile
===================================================================
RCS file: patches/patch-phobos_Makefile
diff -N patches/patch-phobos_Makefile
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-phobos_Makefile 21 May 2024 00:34:49 -0000
@@ -0,0 +1,12 @@
+Index: phobos/Makefile
+--- phobos/Makefile.orig
++++ phobos/Makefile
+@@ -150,7 +150,7 @@ ifneq ($(USE_IMPORTC),1)
+ CC_OUTFILEFLAG := /Fo
+ CFLAGS := /nologo /Zl /GS- $(if $(findstring
$(BUILD),debug),/Z7,/O2)
+ else # Posix
+- CFLAGS := $(MODEL_FLAG) -fPIC -std=c11 $(if $(findstring
$(BUILD),debug),-g,-O3)
++ CFLAGS += $(MODEL_FLAG) -fPIC -std=c11
+ ifeq (osx64,$(OS)$(MODEL))
+ CFLAGS += --target=x86_64-darwin-apple # ARM cpu is
not supported by dmd
+ endif
Index: patches/patch-phobos_posix_mak
===================================================================
RCS file: patches/patch-phobos_posix_mak
diff -N patches/patch-phobos_posix_mak
--- patches/patch-phobos_posix_mak 13 Feb 2023 00:52:59 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
-Index: phobos/posix.mak
---- phobos/posix.mak.orig
-+++ phobos/posix.mak
-@@ -107,15 +107,13 @@ endif
- OUTFILEFLAG = -o
- NODEFAULTLIB=-defaultlib= -debuglib=
- ifeq (,$(findstring win,$(OS)))
-- CFLAGS=$(MODEL_FLAG) -fPIC -std=c11 -DHAVE_UNISTD_H
-+ CFLAGS+=$(MODEL_FLAG) -fPIC -std=c11 -DHAVE_UNISTD_H
- # Bundled with the system library on OSX, and doesn't work with >= MacOS 11
- ifneq (osx,$(OS))
- NODEFAULTLIB += -L-lpthread -L-lm
- endif
- ifeq ($(BUILD),debug)
- CFLAGS += -g
-- else
-- CFLAGS += -O3
- endif
- else
- ifeq ($(OS),win32)
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/lang/dmd/pkg/PLIST,v
retrieving revision 1.8
diff -u -p -r1.8 PLIST
--- pkg/PLIST 18 Dec 2023 22:20:58 -0000 1.8
+++ pkg/PLIST 21 May 2024 00:34:49 -0000
@@ -84,6 +84,7 @@ include/dmd/druntime/import/core/interna
include/dmd/druntime/import/core/internal/vararg/
include/dmd/druntime/import/core/internal/vararg/aarch64.d
include/dmd/druntime/import/core/internal/vararg/sysv_x64.d
+include/dmd/druntime/import/core/interpolation.d
include/dmd/druntime/import/core/lifetime.d
include/dmd/druntime/import/core/math.d
include/dmd/druntime/import/core/memory.d
@@ -103,6 +104,7 @@ include/dmd/druntime/import/core/stdc/lo
include/dmd/druntime/import/core/stdc/math.d
include/dmd/druntime/import/core/stdc/signal.d
include/dmd/druntime/import/core/stdc/stdarg.d
+include/dmd/druntime/import/core/stdc/stdatomic.d
include/dmd/druntime/import/core/stdc/stddef.d
include/dmd/druntime/import/core/stdc/stdint.d
include/dmd/druntime/import/core/stdc/stdio.d
@@ -200,6 +202,7 @@ include/dmd/druntime/import/core/sys/fre
include/dmd/druntime/import/core/sys/freebsd/execinfo.d
include/dmd/druntime/import/core/sys/freebsd/ifaddrs.d
include/dmd/druntime/import/core/sys/freebsd/net/
+include/dmd/druntime/import/core/sys/freebsd/net/if_.d
include/dmd/druntime/import/core/sys/freebsd/net/if_dl.d
include/dmd/druntime/import/core/sys/freebsd/netinet/
include/dmd/druntime/import/core/sys/freebsd/netinet/in_.d
@@ -580,6 +583,7 @@ include/dmd/phobos/etc/c/sqlite3.d
include/dmd/phobos/etc/c/zlib/
include/dmd/phobos/etc/c/zlib.d
include/dmd/phobos/etc/c/zlib/ChangeLog
+include/dmd/phobos/etc/c/zlib/LICENSE
include/dmd/phobos/etc/c/zlib/README
include/dmd/phobos/etc/c/zlib/adler32.c
include/dmd/phobos/etc/c/zlib/compress.c
@@ -602,8 +606,6 @@ include/dmd/phobos/etc/c/zlib/inflate.c
include/dmd/phobos/etc/c/zlib/inflate.h
include/dmd/phobos/etc/c/zlib/inftrees.c
include/dmd/phobos/etc/c/zlib/inftrees.h
-include/dmd/phobos/etc/c/zlib/linux.mak
-include/dmd/phobos/etc/c/zlib/osx.mak
include/dmd/phobos/etc/c/zlib/test/
include/dmd/phobos/etc/c/zlib/test/example.c
include/dmd/phobos/etc/c/zlib/test/infcover.c
@@ -611,8 +613,6 @@ include/dmd/phobos/etc/c/zlib/test/minig
include/dmd/phobos/etc/c/zlib/trees.c
include/dmd/phobos/etc/c/zlib/trees.h
include/dmd/phobos/etc/c/zlib/uncompr.c
-include/dmd/phobos/etc/c/zlib/win32.mak
-include/dmd/phobos/etc/c/zlib/win64.mak
include/dmd/phobos/etc/c/zlib/zconf.h
include/dmd/phobos/etc/c/zlib/zlib.3
include/dmd/phobos/etc/c/zlib/zlib.h