[Haskell-cafe] mysql (hsql-mysql-1.7) on Linux with GHC 8.3 - cabal issues

Anton Tayanovskyy anton.tayanovskyy at gmail.com
Thu Oct 2 10:37:49 EDT 2008


Hello,

I had some difficulty building hsql and hsql-mysql (native driver)
packages under GHC 8.3 on Fedora 9. Namely, they do not install with
cabal install, because of a few API changes. Is this considered all
right as GHC 8.3 is still experimental, or should the packages be
updated? If so, can somebody please do it. I love when things just
work with cabal install!

The problem looks very basic -- just some Cabal file
incompatibilities. However I am not experienced with the Cabal build
process, so I'll just write what I did to get it to work on my
platform, maybe it will help someone.

== hsql.cabal ==

name:		hsql
version:	1.7
license:	BSD3
author:		Krasimir Angelov <ka2_mail at yahoo.com>
category:	Database
description:	Simple library for database access from Haskell.
exposed-modules:
	Database.HSQL,
	Database.HSQL.Types
build-depends:	base, old-time
build-type:	Simple
ghc-options:    -O2
extensions:     ForeignFunctionInterface, TypeSynonymInstances, CPP,
RankNTypes, DeriveDataTypeable


== hsql-mysql.cabal ==

name:		 hsql-mysql
version:	 1.7
license:	 BSD3
author:		 Krasimir Angelov <kr.angelov at gmail.com>
category:	 Database
description: 	 MySQL driver for HSQL.
ghc-options:     -O2
build-depends: 	 base, hsql, Cabal, old-time
extensions:      ForeignFunctionInterface, CPP
include-dirs:    Database/HSQL, /usr/include/mysql
build-type:	 Simple
extra-source-files: Database/HSQL/HsMySQL.h
extra-libraries: mysqlclient
extra-lib-dirs:	 /usr/lib/mysql
exposed-modules:
	Database.HSQL.MySQL


== hsql-mysql*/Setup.lhs ==

#!/usr/bin/runghc

\begin{code}
import Distribution.Simple

main = defaultMain
\end{code}


Of course this hsql-mysql.cabal should not mention Fedora-specific
locations as /usr/lib/mysql and /usr/include/mysql but I don't know
how to make that generic. The original version had a big custom
Setup.lhs file which wouldn't compile with the new Cabal and which I
couldn't tweak myself.


Thanks,


--A


More information about the Haskell-Cafe mailing list