Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Oct 2019 10:38:44 +0400
From:      Gleb Popov <6yearold@gmail.com>
To:        Jesse Kempf <jesse.kempf@doublecrown.co>
Cc:        haskell@freebsd.org
Subject:   Re: Packaging stack projects as ports
Message-ID:  <CALH631m1%2BH1P-1j4-pJxWoTSe83rTm%2BkNGLnKV4pn1SgNnsSTg@mail.gmail.com>
In-Reply-To: <3B62DE49-9516-4267-9DD1-31CDC37F9CC7@doublecrown.co>
References:  <3B62DE49-9516-4267-9DD1-31CDC37F9CC7@doublecrown.co>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Oct 27, 2019 at 11:53 PM Jesse Kempf <jesse.kempf@doublecrown.co>
wrote:

> Hi,
>
> What=E2=80=99s the preferred way of making ports for projects that use St=
ack and
> don=E2=80=99t and won=E2=80=99t appear on Hackage?
>

Stack projects should also have a .cabal file, so the port looks almost the
same. You just only need to override MASTER_SITES and set it to GitHub
instead of Hackage. See lang/elm port for an example. There are also some
auxiliary Makefile targets to aid porting in Mk/Uses/cabal.mk, take a look
at that too.


> 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 st=
ack
> (installed from devel/stack) doesn=E2=80=99t seem to honor =E2=80=94syste=
m-ghc and so
> always installs its own version of GHC.


It turns out that you need both --system-ghc and --no-install-ghc to build
using system GHC with Stack.

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 application=
s.
> And, finally, stack installs its own version of GHC into the invoking
> user=E2=80=99s home directory, not only affecting files outside `/usr/loc=
al` 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=
=99s a
> general-purpose thing but what I just mentioned seems like an obvious
> show-stopper.
>

That's great, feel free to ask for help there, or at #haskell-FreeBSD IRC
channel at Freenode.


> Regards,
> -Jesse
> _______________________________________________
> freebsd-haskell@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-haskell
> To unsubscribe, send any mail to "freebsd-haskell-unsubscribe@freebsd.org=
"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALH631m1%2BH1P-1j4-pJxWoTSe83rTm%2BkNGLnKV4pn1SgNnsSTg>