On 2023/03/31 19:52:41 +0200, Volker Schlecht <[email protected]> 
wrote:
> * Remove explicit handling of erlang/21 which has been moved to the attic
> * Adds a MODERL_MODULES mechanism to fetch erlang/elixir libs from
> hex.pm like we do for go and rust. First consumer could be lang/lfe
> if accepted.
> 
> I'll look into adapting devel/rebar3 (from which most of the ideas were
> taken) if this gets accepted.
> 
> Copying op@ - I included his most recent suggestions before the 7.3
> lock.
>
> Index: erlang.port.mk
> [...]
> +.  if ! empty(MODERL_MODULES)
> +.    for _m _v in ${MODERL_MODULES}
> +MODERL_SETUP_WORKSPACE += mkdir -p ${WRKDIR}/${MODERL_DIST_SUBDIR}/${_m}; \
> +             tar xf ${FULLDISTDIR}/${_m}-${_v}.tar -C 
> ${WRKDIR}/${MODERL_DIST_SUBDIR}/${_m}; \
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

it's missing a ${MODERL_DIST_SUBDIR} in between

> +             mkdir -p ${WRKSRC}/_checkouts/${_m}; \
> +             mkdir -p ${WRKSRC}/_build/default/lib; \
> +             tar xzf ${WRKDIR}/${MODERL_DIST_SUBDIR}/${_m}/contents.tar.gz 
> -C ${WRKSRC}/_checkouts/${_m}; \
> +             cp -r ${WRKSRC}/_checkouts/${_m} ${WRKSRC}/_build/default/lib/;
> +.    endfor
> +MODERLANG_post-extract += ${MODERL_SETUP_WORKSPACE}
> +.  endif
> +

you've lost the .if here so...

> +DISTFILES += ${MODERL_DISTFILES}
> +.  endif

...this .endif is dangling :)


I still had the previous patch locally so I'm reattaching it
integrated the first hunk (erlang21) that I was missing.  I'm also
re-attaching lang/lfe.  Both are ok op@ to be committed/imported :-)

(I'd like for someone else with more experience with the
infrastructure to review the erlang.port.mk changes)

Thanks!

Index: erlang.port.mk
===================================================================
RCS file: /home/cvs/ports/lang/erlang/erlang.port.mk,v
retrieving revision 1.32
diff -u -p -r1.32 erlang.port.mk
--- erlang.port.mk      15 Mar 2023 09:21:20 -0000      1.32
+++ erlang.port.mk      15 Mar 2023 09:25:25 -0000
@@ -118,15 +118,39 @@ pre-configure:
 .if ${CONFIGURE_STYLE:L} == "rebar3"
 # Some modules bundle their own rebar escript, force them to use the system
 # rebar instead.
-# While here, remove the deps{} block from rebar.config, we cannot download
-# dependencies on the fly (blocked by systrace) and it obfuscates dependency
-# management from the ports Makefile.
 .  if ! target(pre-build)
 pre-build:
        @cp -f ${REBAR_BIN} ${WRKSRC}/rebar3
-       @perl -pi -e 'BEGIN{undef $$/;} s/{deps,.*?]}.//smg' 
${WRKSRC}/rebar.config
 .  endif
 .endif
+
+# Add possibility to include additional build or test dependencies from 
+# https://hex.pm. Ripped from go.port.mk and devel/rebar3.
+MASTER_SITE_ATHENS =   https://repo.hex.pm/tarballs/
+
+MODERL_MASTER_SITEN =  9
+MASTER_SITES${MODERL_MASTER_SITEN} ?= ${MASTER_SITE_ATHENS}
+MODERL_DIST_SUBDIR ?=  hex_modules
+
+.  for _m _v in ${MODERL_MODULES}
+MODERL_DISTFILES += 
${MODERL_DIST_SUBDIR}/{}${_m}-${_v}.tar:${MODERL_MASTER_SITEN}
+.  endfor
+
+.  if ! empty(MODERL_MODULES)
+.    for _m _v in ${MODERL_MODULES}
+MODERL_SETUP_WORKSPACE += mkdir -p ${WRKDIR}/${MODERL_DIST_SUBDIR}/${_m}; \
+               tar xf ${FULLDISTDIR}/${_m}-${_v}.tar -C 
${WRKDIR}/${MODERL_DIST_SUBDIR}/${_m}; \
+               mkdir -p ${WRKSRC}/_checkouts/${_m}; \
+               mkdir -p ${WRKSRC}/_build/default/lib; \
+               tar xzf ${WRKDIR}/${MODERL_DIST_SUBDIR}/${_m}/contents.tar.gz 
-C ${WRKSRC}/_checkouts/${_m}; \
+               cp -r ${WRKSRC}/_checkouts/${_m} ${WRKSRC}/_build/default/lib/;
+.    endfor
+MODERLANG_post-extract += ${MODERL_SETUP_WORKSPACE}
+.  endif
+
+.  if defined(MODERL_DISTFILES)
+DISTFILES += ${MODERL_DISTFILES}
+.  endif
 
 # Regression test handling:
 # If nothing is explicitly set, then MODERL_TEST=Yes and default


Attachment: lfe.tar.gz
Description: GNU Zip compressed data

Reply via email to