On 2018/07/06 21:41, joshua stein wrote:
> Crystal is a programming language like Ruby but statically 
> type-checked.  This is the 0.25.1 compiler and 0.8.1 of Shards, its 
> dependency manager.
> 
> Since it is compiled, it requires a pre-compiled bootstrap object 
> file of the compiler to link and produce a compiler binary, which it 
> then uses to compile itself all over again.  It also requires a ton 
> of memory, so there are ulimit cranks in the do-build stage to avoid 
> crashing.
> 
> This port was created and will be maintained by Wesley Moxam.  I 
> updated it to work post-6.3 which required modifying its mmap call 
> to pass MAP_STACK.  This has been merged upstream for the 0.25.1 
> release.

# clean up for install
post-patch:
        cd ${WRKSRC}/src && find . -type f -name \*.orig -exec rm "{}" \;

I think this is not used at the moment anyway, no .orig files in the tarballs.
Removing .orig files from the work directory is a pain if patches are
used because it stops "make patch; make update-patches" from working.
It's preferable to remove from PREFIX post-install (and since we have
find -delete now, it would be more efficient to use it).

        cd ${WRKSRC}/src && find . -type d -exec ${INSTALL_DATA_DIR} \
                "${PREFIX}/lib/crystal/{}" \;
        cd ${WRKSRC}/src && find . -type f -exec ${INSTALL_DATA} \
                "{}" "${PREFIX}/lib/crystal/{}" \;

that works, though most ports would use pax or cp rather than executing
install once per file. (not that the increased efficiency is likely to
be noticed in this port, but lines like this in ports tend to get
copy-and-pasted around the tree or used as justification for doing so
in other places where it is more likely to make a difference ;)

        cd ${WRKSRC}; \
                ulimit -Sd `ulimit -Hd`; ulimit -Ss `ulimit -Hs`; \
                CRYSTAL_CONFIG_PATH="lib:${TRUEPREFIX}/lib/crystal" \
                CXX=${CXX} ${MAKE_PROGRAM} ${ALL_TARGET}

I'd prefer to set the limit to roughly what it actually needs
(running the build under "/bin/time -l" will give an idea, though
raise it a bit above the actual value from there). That way if
somebody has a hardlimit that is too low they don't waste time
attempting to build and figuring out why it's segfaulting.

Reply via email to