If GHC supports shared libraries, it always builds "dynamic" executable (small binary with lots of libraries in lib/ghc...), by adding --enable-shared and--enable-executable-dynamic configure flags. You can add new configure flags using CABAL_EXTRA_CONFIGURE_FLAGS but (AFAIK) these cannot be removed except by editing eclass itself - if you comment them out (lines 361 to 375 in current haskell-cabal.eclass file) it builds a standalone binary like before. Please add some way to do this in configuration (like new variable in make.conf or use-flag). We use only one haskell app (darcs) and since compile takes a lot of time and requires hundreds of megabytes of diskspace (ghc+deps), we do it only on one computer and copy the resulting binary to all others.
haskell-cabal.eclass has CABAL_EXTRA_CONFIGURE_FLAGS variable (also has a 'man haskell-cabal.eclass' entry). You can add CABAL_EXTRA_CONFIGURE_FLAGS=--disable-executable-dynamic to make.conf (or use it through package.env) $ CABAL_EXTRA_CONFIGURE_FLAGS=--disable-executable-dynamic ebuild darcs-2.14.0.ebuild clean install $ ldd /tmp/portage/dev-vcs/darcs-2.14.0/image/usr/bin/darcs linux-vdso.so.1 (0x00007ffc9cbe6000) libcurl.so.4 => /usr/lib64/libcurl.so.4 (0x00007fc73948d000) libz.so.1 => /lib64/libz.so.1 (0x00007fc739276000) libncursesw.so.6 => /lib64/libncursesw.so.6 (0x00007fc739008000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc738de8000) librt.so.1 => /lib64/librt.so.1 (0x00007fc738be0000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fc7389dc000) libgmp.so.10 => /usr/lib64/libgmp.so.10 (0x00007fc738765000) libm.so.6 => /lib64/libm.so.6 (0x00007fc7383d4000) libffi.so.6 => /usr/lib64/libffi.so.6 (0x00007fc7381cb000) libc.so.6 => /lib64/libc.so.6 (0x00007fc737e02000) libssl.so.1.0.0 => /usr/lib64/libssl.so.1.0.0 (0x00007fc737b94000) libcrypto.so.1.0.0 => /usr/lib64/libcrypto.so.1.0.0 (0x00007fc73775a000) /lib64/ld-linux-x86-64.so.2 (0x00007fc7396fe000) Is it good enough? Note: you will have to sort out transitive closure of dynamic non-haskell depends on your own. Disabling shared libraries completely is harder as template-haskell support really needs dynamic libraries if ghc itself is linked dynamically (default in gentoo).
I didn't think "conflicting" configure flags are possible, but obviously the last one has priority, so your suggestion works and does what I need; thank you very much and sorry for wasting your time. I close this as resolved/invalid, if some other status should be used please update it :).
INVALID status is fine. In gentoo EXTRA* variables are for users to override default (eclass/ebuild) behaviour. EXTRA* are never supposed to be set by ebuilds directly and always available for users. Perhaps we should advertise it a bit more in 'man haskell-cabal.eclass' with more useful examples. Examples I modelled after are EXTRA_ECONF (-> CABAL_EXTRA_CONFIGURE_FLAGS) and EXTRA_EMAKE (-> CABAL_EXTRA_BUILD_FLAGS).