haskoin / secp256k1-haskell

Haskell bindings for secp256k1 library
Other
24 stars 36 forks source link

Bundling the native library source #16

Closed psibi closed 4 years ago

psibi commented 5 years ago

Right now, the library requires secp256k1 to be available in the system for it to build. This creates additional overhead for us when we use base Docker image( and also on the developer machine). Would the library be open to bundle the C code along with it which will be controlled via a cabal flag (the default being the current behaviour: using the system library).

I can send a PR for the same if the devs are okay about this.

psibi commented 5 years ago

Any update on this ?

jprupp commented 5 years ago

I used to have the library included like this. But I wasn't comfortable with the way I set the build up. If you are more comfortable with the build system and have a more elegant solution to embed the C code with the Haskell bindings then I will accept a pull request.

psibi commented 5 years ago

@xenog I looked on the git history to see the previous solution. I see that git submodule was used to track the upstream code and use a custom Setup.hs to buid it. In my experience I would prefer this solution instead of a custom Setup.hs:

Does that sound acceptable to you or would you prefer a custom Setup.hs route (I personally would prefer a simpler approach) ?

jprupp commented 5 years ago

There is some magic that happens in the original library. Some C code is generated via the upstream build script that is needed for it to work. I am not a C developer, nor do I have an interest in digging too deeply here, which is why I removed the library.