On Mon, Sep 23, 2019 at 11:39:51PM +0200, Matthias Kilian wrote:
> Still to clarify / fix:
> 
> - architecture-dependent directories in hs-ports.

Which can be "fixed" by this one (a better fix would be to patch ghc-pkg
and/or cabal to use libdir/libsubdir for shared libraries the same way
as for static libraries and to drop the $arch-$os-$compiler patterns):

Index: ghc.port.mk
===================================================================
RCS file: /cvs/ports/lang/ghc/ghc.port.mk,v
retrieving revision 1.43
diff -u -p -r1.43 ghc.port.mk
--- ghc.port.mk 10 Sep 2019 13:51:21 -0000      1.43
+++ ghc.port.mk 24 Sep 2019 09:34:24 -0000
@@ -64,13 +64,15 @@ MODGHC_SETUP_CONF_ENV ?=
 MODGHC_SETUP_CONF_ARGS +=      --datasubdir=hs-\$$pkgid
 MODGHC_SETUP_CONF_ARGS +=      --docdir=\$$datadir/doc/hs-\$$pkgid
 MODGHC_SETUP_CONF_ARGS +=      --libsubdir=ghc/\$$pkgid
+MODGHC_SETUP_CONF_ARGS +=      --dynlibdir=${PREFIX}/lib/ghc/\$$pkgid
 MODGHC_SETUP_CONF_ARGS +=      --enable-library-profiling
 .  else
 # Override Cabal defaults, which are $arch-$os-$compiler/$pkgid for
-# datasubdir and libsubdir and $datadir/doc/$arch-$os-$compiler/$pkgid
-# for docdir.
+# datasubdir and libsubdir, $datadir/doc/$arch-$os-$compiler/$pkgid
+# for docdir and ${PREFIX}/lib/$arch-$os-$compiler/$pkgid for dynlibdir.
 MODGHC_SETUP_CONF_ARGS +=      --datasubdir=\$$pkgid
 MODGHC_SETUP_CONF_ARGS +=      --libsubdir=\$$pkgid
+MODGHC_SETUP_CONF_ARGS +=      --dynlibdir=${PREFIX}/lib/ghc/\$$pkgid
 MODGHC_SETUP_CONF_ARGS +=      --docdir=\$$datadir/doc/\$$pkgid
 .  endif
 

> - the libffi shared library  built from the bundled ffi; not sure wether
>   this is a problem or not, but it looks a little bit scary.

And indeed. After a few iterations of fixing plists of hs-ports (after
the dynlibdir patch above), with pkg_delete -a in between, I ran into
build errors like this one:

===>  Configuring for hs-vector-0.12.0.3
ld.so: ghc: can't load library 'libffi.so.1.2'
Killed 

The ghc binary was linked against our system libffi (from devel/libffi),
and after the pkg_delete -a and a restart of dpb, this was missing. So
I'll now try to build ghc using our libffi instead of the bundled one.

Ciao,
        Kili

Reply via email to