Index: erlang.port.mk
===================================================================
RCS file: /cvs/ports/lang/erlang/erlang.port.mk,v
retrieving revision 1.34
diff -u -p -r1.34 erlang.port.mk
--- erlang.port.mk 16 Jun 2023 14:21:34 -0000 1.34
+++ erlang.port.mk 1 Jul 2023 14:21:27 -0000
@@ -5,25 +5,35 @@ CATEGORIES += lang/erlang
USE_GMAKE ?= Yes
# Default Erlang version to use if MODERL_VERSION is not set.
-# XXX: Keep in sync with devel/rebar3/Makefile
MODERL_DEFAULT_VERSION =25
# If the port already has flavors, append ours to it unless the port requires
# a specific version of Erlang.
.if !defined(MODERL_VERSION) && !defined(FLAVORS)
-FLAVORS ?= erlang25
-.else
-FLAVORS += erlang25
+FLAVORS ?= erlang25 erlang26
+FLAVOR ?= erlang25
+.elif !defined(MODERL_VERSION)
+FLAVORS += erlang25 erlang26
.endif
FLAVOR?= # empty
# When no flavor is explicitly set, assume MODERL_DEFAULT_VERSION
+.if ${FLAVOR:Merlang25}
+MODERL_VERSION = 25
+_MODERL_FLAVOR = ${FLAVOR}
+.elif ${FLAVOR:Merlang26}
+MODERL_VERSION = 26
+_MODERL_FLAVOR = ${FLAVOR}
+.else
MODERL_VERSION ?= ${MODERL_DEFAULT_VERSION}
_MODERL_FLAVOR ?= # empty
+.endif
.if ${MODERL_VERSION} == 25
_MODERL_FLAVOR = erlang25
+.elif ${MODERL_VERSION} == 26
+_MODERL_FLAVOR = erlang26
.else
ERRORS += "Invalid MODERL_VERSION set: ${MODERL_VERSION}."
.endif
@@ -34,7 +44,7 @@ CONFIGURE_STYLE = rebar3
.endif
.if ${CONFIGURE_STYLE} == "rebar3"
-MODERL_BUILD_DEPENDS += devel/rebar3
+MODERL_BUILD_DEPENDS += rebar3-*-${_MODERL_FLAVOR}:devel/rebar3
REBAR_BIN ?= ${LOCALBASE}/bin/rebar3-${MODERL_VERSION}
# Make sure rebar gets called as 'rebar3', otherwise escript tries to call the
# binary name (e.g. rebar3-25) as the script entrypoint.
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/rebar3/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- Makefile 29 Jun 2023 15:02:00 -0000 1.11
+++ Makefile 1 Jul 2023 14:20:34 -0000
@@ -7,37 +7,26 @@ CATEGORIES = devel
HOMEPAGE = https://www.rebar3.org
MAINTAINER = Volker Schlecht <openbsd-ports@schlecht.dev>
+REVISION = 0
+
# APLv2
PERMIT_PACKAGE = Yes
-FLAVORS = erlang25 erlang26
-FLAVOR ?= erlang25
-
-MASTER_SITES1 = https://repo.hex.pm/tarballs/
+MODULES = lang/erlang
-.if ${FLAVOR:Merlang25} || ${FLAVOR:Merlang26}
-_EV = ${FLAVOR:C/.*([0-9][0-9]+\$)/\1/}
-RUN_DEPENDS = lang/erlang/${_EV}
-ERL_VERSION = ${_EV}
-.else
-ERRORS += "Invalid FLAVOR set: ${FLAVOR}"
-.endif
+# Avoid default value of rebar3
+CONFIGURE_STYLE = None
EXTRACT_ONLY = rebar3-${GH_TAGNAME}.tar.gz
# for tests
-HEX_MODULES += \
- meck 0.8.13
+MODERL_MODULES = meck 0.8.13
DISTFILES = rebar3-{}${GH_TAGNAME}.tar.gz
-.for _m _v in ${HEX_MODULES}
-DISTFILES += ${_m}-${_v}.tar:1
-.endfor
BUILD_DEPENDS += ${RUN_DEPENDS}
-SUBST_VARS = ERL_VERSION
-
+PORTHOME= ${WRKDIR}
pre-configure:
${SUBST_CMD} ${WRKSRC}/bootstrap \
@@ -49,18 +38,9 @@ do-build:
cd ${WRKBUILD} && ${SETENV} ${MAKE_ENV} ${WRKSRC}/bootstrap
do-install:
- ${INSTALL_SCRIPT} ${WRKSRC}/rebar3 ${PREFIX}/bin/rebar3-${ERL_VERSION}
+ ${INSTALL_SCRIPT} ${WRKSRC}/rebar3 ${PREFIX}/bin/rebar3-${MODERL_VERSION}
-PORTHOME= ${WRKDIR}
do-test:
-.for _m _v in ${HEX_MODULES}
- mkdir -p ${WRKDIR}/${_m}
- tar xf ${FULLDISTDIR}/${_m}-${_v}.tar -C ${WRKDIR}/${_m}
-
- mkdir -p ${WRKSRC}/_checkouts/${_m}
- tar xzf ${WRKDIR}/${_m}/contents.tar.gz -C ${WRKSRC}/_checkouts/${_m}
- cp -r ${WRKSRC}/_checkouts/${_m} ${WRKSRC}/_build/default/lib/
-.endfor
cd ${WRKSRC} && \
${SETENV} ${ALL_TEST_ENV} ./rebar3 escriptize && \
${SETENV} ${ALL_TEST_ENV} ./rebar3 ct
Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/rebar3/distinfo,v
retrieving revision 1.5
diff -u -p -r1.5 distinfo
--- distinfo 29 Jun 2023 15:02:00 -0000 1.5
+++ distinfo 1 Jul 2023 14:20:34 -0000
@@ -1,4 +1,4 @@
-SHA256 (meck-0.8.13.tar) = 008BPBVttRrVfMVWiRuXIOahwd9f4uFa+ZnITWzr6xo=
+SHA256 (hex_modules/meck-0.8.13.tar) = 008BPBVttRrVfMVWiRuXIOahwd9f4uFa+ZnITWzr6xo=
SHA256 (rebar3-3.22.0.tar.gz) = KLJWA4tEXsgY0swzAAsyF/QqlGIZ7eVatZcFA7/PZkc=
-SIZE (meck-0.8.13.tar) = 34304
+SIZE (hex_modules/meck-0.8.13.tar) = 34304
SIZE (rebar3-3.22.0.tar.gz) = 797341
Index: patches/patch-apps_rebar_src_rebar_prv_escriptize_erl
===================================================================
RCS file: /cvs/ports/devel/rebar3/patches/patch-apps_rebar_src_rebar_prv_escriptize_erl,v
retrieving revision 1.1
diff -u -p -r1.1 patch-apps_rebar_src_rebar_prv_escriptize_erl
--- patches/patch-apps_rebar_src_rebar_prv_escriptize_erl 15 Mar 2023 13:15:13 -0000 1.1
+++ patches/patch-apps_rebar_src_rebar_prv_escriptize_erl 1 Jul 2023 14:20:34 -0000
@@ -8,7 +8,7 @@ Index: apps/rebar/src/rebar_prv_escripti
EscriptSections =
[ {shebang,
- def("#!", State, escript_shebang, "#!/usr/bin/env escript\n")}
-+ def("#!", State, escript_shebang, "#!/usr/bin/env escript${ERL_VERSION}\n")}
++ def("#!", State, escript_shebang, "#!/usr/bin/env escript${MODERL_VERSION}\n")}
, {comment, def("%%", State, escript_comment, "%%\n")}
, {emu_args, def("%%!", State, escript_emu_args, DefaultEmuArgs)}
, {archive, Files, []} ],
Index: patches/patch-bootstrap
===================================================================
RCS file: /cvs/ports/devel/rebar3/patches/patch-bootstrap,v
retrieving revision 1.2
diff -u -p -r1.2 patch-bootstrap
--- patches/patch-bootstrap 11 Mar 2022 18:53:09 -0000 1.2
+++ patches/patch-bootstrap 1 Jul 2023 14:20:34 -0000
@@ -5,7 +5,7 @@ Index: bootstrap
+++ bootstrap
@@ -1,4 +1,4 @@
-#!/usr/bin/env escript
-+#!/usr/bin/env escript${ERL_VERSION}
++#!/usr/bin/env escript${MODERL_VERSION}
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
Index: patches/patch-vendor_relx_priv_templates_bin
===================================================================
RCS file: /cvs/ports/devel/rebar3/patches/patch-vendor_relx_priv_templates_bin,v
retrieving revision 1.1
diff -u -p -r1.1 patch-vendor_relx_priv_templates_bin
--- patches/patch-vendor_relx_priv_templates_bin 15 Mar 2023 13:15:13 -0000 1.1
+++ patches/patch-vendor_relx_priv_templates_bin 1 Jul 2023 14:20:34 -0000
@@ -8,7 +8,7 @@ Index: vendor/relx/priv/templates/bin
ERTS_DIR="$__erts_dir";
else
- __erl="$(command -v erl)"
-+ __erl="$(command -v erl${ERL_VERSION})"
++ __erl="$(command -v erl${MODERL_VERSION})"
code="io:format(\"~s\", [code:root_dir()]), halt()."
__erl_root="$("$__erl" -boot no_dot_erlang -noshell -eval "$code")"
ERTS_DIR="$__erl_root/erts-$ERTS_VSN"
Index: patches/patch-vendor_relx_priv_templates_extended_bin
===================================================================
RCS file: /cvs/ports/devel/rebar3/patches/patch-vendor_relx_priv_templates_extended_bin,v
retrieving revision 1.1
diff -u -p -r1.1 patch-vendor_relx_priv_templates_extended_bin
--- patches/patch-vendor_relx_priv_templates_extended_bin 15 Mar 2023 13:15:13 -0000 1.1
+++ patches/patch-vendor_relx_priv_templates_extended_bin 1 Jul 2023 14:20:34 -0000
@@ -8,7 +8,7 @@ Index: vendor/relx/priv/templates/extend
ERTS_DIR="$__erts_dir";
else
- __erl="$(command -v erl)"
-+ __erl="$(command -v erl${ERL_VERSION})"
++ __erl="$(command -v erl${MODERL_VERSION})"
code="io:format(\"~s\", [code:root_dir()]), halt()."
__erl_root="$("$__erl" -boot no_dot_erlang -sasl errlog_type error -noshell -eval "$code")"
ERTS_DIR="$__erl_root/erts-$ERTS_VSN"
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/rebar3/pkg/PLIST,v
retrieving revision 1.3
diff -u -p -r1.3 PLIST
--- pkg/PLIST 16 Jan 2023 18:21:24 -0000 1.3
+++ pkg/PLIST 1 Jul 2023 14:20:34 -0000
@@ -1,2 +1,4 @@
@pkgpath devel/rebar
-bin/rebar3-${ERL_VERSION}
+@conflict rebar3-*-erlang{$MODERL_VERSION}<${V}
+@option no-default-conflict
+bin/rebar3-${MODERL_VERSION}
Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/gleam/Makefile,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile
--- Makefile 13 Jun 2023 20:03:19 -0000 1.2
+++ Makefile 1 Jul 2023 14:53:07 -0000
@@ -3,6 +3,7 @@ COMMENT = statically typed language for
GH_ACCOUNT = gleam-lang
GH_PROJECT = gleam
GH_TAGNAME = v0.29.0
+REVISION = 0
HOMEPAGE = https://gleam.run
@@ -16,7 +17,6 @@ PERMIT_PACKAGE = Yes
MODULES = devel/cargo \
lang/erlang
BUILD_DEPENDS = security/rust-ring
-RUN_DEPENDS = lang/erlang/25
COMPILER = base-clang ports-gcc
WANTLIB += ${MODCARGO_WANTLIB} m
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/lang/gleam/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 PLIST
--- pkg/PLIST 25 Apr 2023 19:50:47 -0000 1.1.1.1
+++ pkg/PLIST 1 Jul 2023 14:53:07 -0000
@@ -1,3 +1,4 @@
+@pkgpath lang/gleam
@bin bin/gleam
share/doc/gleam/
share/doc/gleam/LICENSE
Here's an update to erlang.port.mk that enables the erlang26 FLAVOR for
erlang ports.
The idea is that if a specific MODERL_VERSION is set on a port, the port
will only be built for that version of erlang, otherwise the port will
be built with erlang25 and erlang26 flavors.
MODERL_VERSION is set for
* lang/lfe
* net/rabbitmq
* lang/elixir
* benchmarks/tsung
Those are unaffected by this change, and will be transitioned at a later
time.
Unfortunately this change does impact
* lang/gleam
which needs a minor adaptation to make that work (attached).
With that in place, the devel/rebar3 port can be simplified, because it
can reuse the MODERL_MODULES mechanism, that was largely taken over from
that port.
Also, since erlang/25 and erlang/26 can coexist, so should
rebar3-erlang25 and rebar3-erlang26, thus @option no-default-conflict.
Unfortunately that's a lot of stuff that needs to happen together, and I
had to do some things with @pkpaths and pkgstems that I'm not 100%
certain about, so feedback is highly welcome and probably direly needed
:-)
Tested on amd64.
No comments:
Post a Comment