Haskell inline-c multi-step build/link with Cabal -


i writing ffi-heavy library uses inline-c, , build process is:

  • run ghc on inline-c files, produce c
  • compile c produced in previous step dynamic libraries
  • compile haskell interface while linking both object files produced in step 2 , dynlibs of wrapped library.

question: i'm doing above in makefile (see https://github.com/ocramz/petsc-hs/blob/master/makefile ), i'd package in cabal file (working version : https://github.com/ocramz/petsc-hs/blob/master/petsc-hs.cabal).

sub-questions:

  • how 1 control build/link sequence in cabal?
  • are relative paths supported in cabal? couldn't find mentioned in guide , bash-like ~ doesn't work

thank in advance pointers

how 1 control build/link sequence in cabal?

you can use build-type: custom in cabal file , control custom setup.hs.

have @ userhooks data type of phases of cabal can control.

some examples:

are relative paths supported in cabal? couldn't find mentioned in guide , bash-like ~ doesn't work

if library external cabal package, consider using pkg-config on unix/linux systems have cabal locate library. see answers question: how specify dependency on external c library in .cabal?

if library part of cabal package, check out blog post , related github repo shows how write custom setup.hs file build , install library in right place cabal:


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -