Date: Sun, 27 Oct 2019 12:53:46 -0700 From: Jesse Kempf <jesse.kempf@doublecrown.co> To: haskell@freebsd.org Subject: Packaging stack projects as ports Message-ID: <3B62DE49-9516-4267-9DD1-31CDC37F9CC7@doublecrown.co>
next in thread | raw e-mail | index | archive | help
Hi,
What=E2=80=99s the preferred way of making ports for projects that use =
Stack and don=E2=80=99t and won=E2=80=99t appear on Hackage?
I=E2=80=99ve got an app up on Github, so I set what=E2=80=99s needed and =
then the meat of my port is:
do-build:
@(cd ${WRKSRC} && stack build)
do-install:
@(cd ${WRKSRC} && stack install =
--local-bin-path=3D${STAGEDIR}${PREFIX}/bin)
post-install:
@(${INSTALL_DATA} ${WRKDIR}/${PORTNAME}.cfg.sample =
${STAGEDIR}${PREFIX}/etc)
For my company=E2=80=99s purposes, this is perfectly adequate, however =
stack (installed from devel/stack) doesn=E2=80=99t seem to honor =
=E2=80=94system-ghc and so always installs its own version of GHC. On =
the one hand, this means that the app will be built with the correct =
compiler for Stackage snapshot. On the other hand, this means that port =
compiling is slow and more memory intensive than it needs to be because =
compiling GHC is more resource intensive than compiling small =
applications. And, finally, stack installs its own version of GHC into =
the invoking user=E2=80=99s home directory, not only affecting files =
outside `/usr/local` but also meaning that `make package` and `sudo make =
package` will build and install GHC twice.
We=E2=80=99d like to contribute our tool to the ports tree since it=E2=80=99=
s a general-purpose thing but what I just mentioned seems like an =
obvious show-stopper.
Regards,
-Jesse=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B62DE49-9516-4267-9DD1-31CDC37F9CC7>
