On Thu, Jun 02, 2016 at 05:43:54PM +1200, [email protected] wrote:
> Hi ports@,
>
> Could anyone please check and maybe even commit MLton compiler port to the
> ports tree?
>
> The updated version is attached.
>
> Comments and help with testing are much appreciated.
>
I just read the port. no test for now.
About patches files, it would be great if you could add comment inside
for telling minimal purpose of the patch. For what I saw, it is mostly
for generate binary using C codegen, but some others are not.
Do you consider to push openbsd specific stuff to upstream ?
- some parts of patches/patch-Makefile
- patches/patch-runtime_platform_openbsd_c
About PLIST, I saw lot of .orig files inside it (222 files). Is it
expected ?
Others comments for ports Makefile inlined.
--
Sebastien Marie
> COMMENT = MLton compiler
> V = 20130715
> DISTNAME = mlton-${V}
> REVISION = 1
REVISION isn't need for new port: the entire line could be removed.
> CATEGORIES = lang
>
> MAINTAINER = Alexander Abushkevich <[email protected]>
> HOMEPAGE = http://mlton.org
>
> DISTFILES = on-${V}-release${EXTRACT_SUFX}:0
> SUPFILES = mlton-${V}-bootstrap-OpenBSD-${OSREV}-${MACHINE_ARCH}.tar.gz:1
>
> .if defined(SUPFILES)
> DISTFILES += ${SUPFILES}
> .endif
I think the .if logic around DISTFILES could be removed as SUPFILES is
always defined.
> MASTER_SITES0 = https://github.com/MLton/mlton/archive/
> MASTER_SITES1 = https://extensibl.com/pub/mlton/
>
> ONLY_FOR_ARCHS = amd64
>
> # BSD/MIT
> PERMIT_PACKAGE_CDROM = Yes
> PERMIT_PACKAGE_FTP = Yes
> PERMIT_DISTFILES_FTP = Yes
according to ports/infrastructure/templates/Makefile.template:
If all PERMIT_* are Yes, just setting 'PERMIT_PACKAGE_CDROM=Yes' is
enough.
you could remove PERMIT_PACKAGE_FTP and PERMIT_DISTFILES_FTP lines.
>
> WRKDIST = ${WRKDIR}/mlton-on-$V-release
>
> USE_GMAKE = Yes
> MODULES += gnu
> WANTLIB += c m gmp
> BUILD_DEPENDS = shells/bash archivers/gtar
> LIB_DEPENDS = devel/gmp
> MAKE_ENV = PATH=${PATH}:${WRKBUILD}/build/bin/:${WRKBUILD}/mllex/
I am unsure about setting directly PATH inside MAKE_ENV. Some ports guru
could confirm if there are any problem with that.
>
> do-build:
> cd ${WRKBUILD} && WITH_GMP=/usr/local ${GMAKE} dirs runtime
I didn't found any "WITH_GMP" string inside source dir. Is it required ?
>
> .if ! exists( ${WRKBUILD}/bootstrap )
> cd ${WRKBUILD} && cp -r ../bootstrap .
> .endif
personally I would move the bootstrap copying stuff in a post-extract
target as `bootstrap' dir comes from downloaded SUPFILES.
else, any particular reason to use cp instead of mv ?
> cd ${WRKBUILD} && ${MAKE} -C bootstrap compile_bootstrap
> cd ${WRKBUILD} && cp bootstrap/mlton-compile build/lib/
> cd ${WRKBUILD} && cp bootstrap/yacc.grm.* mlyacc/src/
>
> cd ${WRKBUILD} && ${GMAKE} basis-no-check script mlbpathmap constants
> libraries
> cd ${WRKBUILD} && PATH=${PATH}:${WRKBUILD}/mllex/ ${GMAKE} tools
> cd ${WRKBUILD} && ${GMAKE} install
could you separated build and install target ?
>
> # Instructions on how to generate bootstrap files:
> BOOTSTRAP_DIR= ${WRKDIR}/bootstrap-new/bootstrap
> bootstrap: fake
> cd ${WRKBUILD} && ${GMAKE} # First round of compilation
> # Recompile mlton with itself, keep intermediary files for further use
> as bootstrap.
> # Extra recompilation cycle makes sense when MLton versions change.
> cd ${WRKBUILD}/mlton && ${GMAKE} clean
> cd ${WRKBUILD}/mlton && rm -f mlton-compile
> cd ${WRKBUILD} && PATH=${PATH}:${WRKBUILD}/build/bin/ COMPILE_ARGS="
> -keep g " ${GMAKE}
>
> # Archive bootstrap files
> mkdir -p ${BOOTSTRAP_DIR}
> cp ${WRKBUILD}/mlton/*.c ${BOOTSTRAP_DIR}
> cp ${WRKBUILD}/mlyacc/src/yacc.grm.* ${BOOTSTRAP_DIR}
> cp ${WRKBUILD}/bootstrap/Makefile ${BOOTSTRAP_DIR}
> cp ${WRKBUILD}/bootstrap/README ${BOOTSTRAP_DIR}
> cd ${WRKDIR}/bootstrap-new/ && tar zcf
> mlton-${V}-bootstrap-OpenBSD-${OSREV}-${MACHINE_ARCH}.tar.gz bootstrap
>
>
> .include <bsd.port.mk>
>