diff --git a/HaPy-haskell/.gitignore b/HaPy-haskell/.gitignore new file mode 100644 index 0000000..8ee1bf9 --- /dev/null +++ b/HaPy-haskell/.gitignore @@ -0,0 +1 @@ +.stack-work diff --git a/HaPy-haskell/Foreign/HaPy.hs b/HaPy-haskell/Foreign/HaPy.hs index 55469cd..b6711a8 100644 --- a/HaPy-haskell/Foreign/HaPy.hs +++ b/HaPy-haskell/Foreign/HaPy.hs @@ -90,7 +90,7 @@ toForeignExp _ exp = fail "conversion failed: unknown type!" makeFunction :: (String -> String) -> (Name -> [FType] -> ClauseQ) -> ([FType] -> TypeQ) -> Name -> DecsQ makeFunction changeName makeClause makeType origName = do - VarI _ t _ _ <- reify origName + VarI _ t _ <- reify origName let types = map fromHaskellType $ toTypeList t name = mkName . changeName . nameBase $ origName cl = makeClause origName types diff --git a/HaPy-haskell/HaPy.cabal b/HaPy-haskell/HaPy.cabal index 443aae2..3e248c3 100644 --- a/HaPy-haskell/HaPy.cabal +++ b/HaPy-haskell/HaPy.cabal @@ -1,5 +1,5 @@ name: HaPy -version: 0.1.1.1 +version: 0.3.0.0 synopsis: Haskell bindings for Python description: Call Haskell functions from Python! homepage: https://github.com/sakana/HaPy @@ -18,6 +18,6 @@ library Foreign.HaPy.Internal extensions: TemplateHaskell c-sources: HaPy_init.c - build-depends: base >= 4.5 && < 4.9, + build-depends: base >= 4.5 && < 4.12, th-lift >= 0.5 && < 0.8, - template-haskell >= 2.7.0.0 && < 2.11.0.0 + template-haskell >= 2.11.0.0 && < 2.14.0.0 diff --git a/HaPy-haskell/stack.yaml b/HaPy-haskell/stack.yaml new file mode 100644 index 0000000..98f23cb --- /dev/null +++ b/HaPy-haskell/stack.yaml @@ -0,0 +1,3 @@ +resolver: lts-12.4 +packages: +- . diff --git a/HaPy-python/.gitignore b/HaPy-python/.gitignore new file mode 100644 index 0000000..52e4e61 --- /dev/null +++ b/HaPy-python/.gitignore @@ -0,0 +1,2 @@ +*.pyc +*.pyo diff --git a/README.md b/README.md index 703aca6..5ff35c0 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,14 @@ Common Errors: * Error: `Missing C library: HSrts-ghc7.8.2` (or similar) --> The version of the GHC RTS library that you specified in your cabal file doesn't match the version of GHC you're running. * When running your Python project: * `Symbol not found: _stg_IND_STATIC_info` or `undefined symbol: stg_forkOnzh` --> The GHC RTS library isn't specified as one of the extra-libraries in the cabal file of your Haskell project. See the [General Installation and Usage](#os-xgeneral-installation-and-usage) section above. + * ImportError on HaPy --> You need to install HaPy Python library to your PYTHONPATH. + * Cannot find ExampleModule error --> You probably need to put libHSExampleModule*.dylib or .so on your path or in this directory by symlink: + ``` + $ ln -s `find ../ -iname '*.dylib'` . + ``` + * dlopen error on `_stg_*` symbol --> Please check that `extra-libs:` section in `../haskell/*.cabal` file contains proper GHC RTS library reference (name varies between GHC versions.) * Anything else: please make an issue and I'll take a look! - FAQ: ----- None yet! Feel free to start an issue if there's something you don't understand. diff --git a/changelog b/changelog new file mode 100644 index 0000000..200d063 --- /dev/null +++ b/changelog @@ -0,0 +1,2 @@ +0.1.1.3 Jul 30 2018 + * Update to GHC 8.4, and Stack LTS 11.2 diff --git a/example/Makefile b/example/Makefile index 0a0bb5e..9934b0e 100644 --- a/example/Makefile +++ b/example/Makefile @@ -12,7 +12,7 @@ endif @echo endif @echo '>>> sudo pip install hapy-ffi' - @sudo pip install hapy-ffi + @pip install hapy-ffi @echo @$(MAKE) -C haskell all @echo diff --git a/example/haskell/.gitignore b/example/haskell/.gitignore new file mode 100644 index 0000000..8ee1bf9 --- /dev/null +++ b/example/haskell/.gitignore @@ -0,0 +1 @@ +.stack-work diff --git a/example/haskell/ExampleModule.cabal b/example/haskell/ExampleModule.cabal index 9870161..d719257 100644 --- a/example/haskell/ExampleModule.cabal +++ b/example/haskell/ExampleModule.cabal @@ -13,9 +13,14 @@ cabal-version: >=1.10 library exposed-modules: ExampleModule, Export other-extensions: ForeignFunctionInterface, TemplateHaskell - build-depends: base >=4.6 && <4.8, HaPy == 0.1.* + build-depends: base >=4.6 && <4.12, HaPy == 0.2.* default-language: Haskell2010 -- *** change this to your GHC version *** -- the make script will do this automatically - extra-libraries: HSrts-ghc7.8.2 + --extra-libraries: HSrts-ghc + --extra-libraries: HSrts_l + extra-libraries: HSrts + --ghc-options: -fPIC -pie -dynamic -shared -dylib-install-name=ExampleModule + ghc-options: -shared + -- Mac: -fPIC diff --git a/example/haskell/stack.yaml b/example/haskell/stack.yaml new file mode 100644 index 0000000..bef51c2 --- /dev/null +++ b/example/haskell/stack.yaml @@ -0,0 +1,4 @@ +resolver: lts-12.4 +packages: +- . +- ../../HaPy-haskell