Skip site navigation (1)Skip section navigation (2)
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>

index | next in thread | raw e-mail

Hi,

What’s the preferred way of making ports for projects that use Stack and don’t and won’t appear on Hackage?

I’ve got an app up on Github, so I set what’s needed and then the meat of my port is:


do-build:
  @(cd ${WRKSRC} && stack build)
do-install:
  @(cd ${WRKSRC} && stack install --local-bin-path=${STAGEDIR}${PREFIX}/bin)
post-install:
  @(${INSTALL_DATA} ${WRKDIR}/${PORTNAME}.cfg.sample ${STAGEDIR}${PREFIX}/etc)


For my company’s purposes, this is perfectly adequate, however stack (installed from devel/stack) doesn’t seem to honor —system-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’s 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’d like to contribute our tool to the ports tree since it’s a general-purpose thing but what I just mentioned seems like an obvious show-stopper.

Regards,
-Jesse

help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B62DE49-9516-4267-9DD1-31CDC37F9CC7>