Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install happstack-server 6.5.3 on osx - missing libcryptopp

I'm trying to install the latest happstack-server on osx. They just added a dependency on libcryptopp, and I can't get it working.

~$ cabal install happstack-server
Resolving dependencies...
Configuring happstack-server-6.5.3...
cabal: Missing dependency on a foreign library:
* Missing C library: cryptopp
This problem can usually be solved by installing the system package that
provides this library (you may need the "-dev" version). If the library is
already installed but in a non-standard location then you can use the flags
--extra-include-dirs= and --extra-lib-dirs= to specify where it is.
cabal: Error: some packages failed to install:
happstack-server-6.5.3 failed during the configure step. The exception was:
ExitFailure 1

So, then I install libcryptopp with macports, which puts libcryptopp.a in /opt/local/lib

sudo port install libcryptopp

Then I install happstack-server again with --extra-lib-dirs

cabal install happstack-server --extra-lib-dirs=/opt/local/lib

It installs fine, everything seems to work until I actually run a happstack server.

~$ runhaskell Hello.hs
Hello.hs: <command line>: can't load .so/.DLL for: libcryptopp.dylib (dlopen(libcryptopp.dylib, 9): image not found)

What am I doing wrong? Or is this a bug with happstack? I don't even have a .dylib after installing the lib via macports, only a .a. ghc --make Hello.hs is even crazier

like image 395
Sean Clark Hess Avatar asked Jan 26 '12 14:01

Sean Clark Hess


2 Answers

How about:

g++ -fpic -nostartfiles -nostdlib -shared /usr/local/Cellar/cryptopp/5.6.1/lib/libcryptopp.a -o libcryptopp.dylib

like image 91
user1187902 Avatar answered Oct 23 '22 13:10

user1187902


as a brute-force approach, You can disable https flag in .cabal file of happstack-server:

file: happstack-server.cabal :

Flag https
    Default: False

configure/build/install happstack-server manually, them cabal install happstack.


(I use Archlinux, --extra-lib-dirs don't even work!)

like image 21
wuxb Avatar answered Oct 23 '22 13:10

wuxb