From 887724370128d5a93b33879ea952b0a9bec17e11 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Fri, 13 Aug 2021 09:51:10 +0200 Subject: [PATCH 1/8] Add tests to CI --- .github/workflows/build-majestic.yml | 34 +++++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 9dca7b1ed..8f94a84df 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -11,20 +11,32 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install build tools - run: | - sudo apt-get update - sudo apt-get install -y \ - autoconf \ - automake \ - autotools-dev \ - g++ \ - libtool \ - make + # All these are already available in GitHub runner + # - name: Install build tools + # run: | + # sudo apt-get update + # sudo apt-get install -y \ + # autoconf \ + # automake \ + # libtool \ + # make \ + # g++ - - name: Build package + - name: Build runtime working-directory: ./src/runtime/c run: | autoreconf -i ./configure make + make install + + - name: Setup Haskell + uses: haskell/actions/setup@v1 + # with: + # ghc-version: '8.6' + # cabal-version: '2.4.1.0' + + - name: Run testsuite + working-directory: ./src/runtime/haskell + run: | + cabal test From d8e1e2c37d9cdd49a22931202cee9b09b5318c51 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Fri, 13 Aug 2021 09:53:17 +0200 Subject: [PATCH 2/8] Add sudo to make install --- .github/workflows/build-majestic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 8f94a84df..09d6cba43 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -28,7 +28,7 @@ jobs: autoreconf -i ./configure make - make install + sudo make install - name: Setup Haskell uses: haskell/actions/setup@v1 From 1749908f6ce6a1e0c7b496972d631c9ffb8440d0 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Fri, 13 Aug 2021 09:58:31 +0200 Subject: [PATCH 3/8] Add --extra-lib-dirs to cabal command --- .github/workflows/build-majestic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index 09d6cba43..f5d70286b 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -39,4 +39,4 @@ jobs: - name: Run testsuite working-directory: ./src/runtime/haskell run: | - cabal test + cabal test --extra-lib-dirs=/usr/local/lib From f35dff7c665eb302c5526dbca9aa3df8602770f6 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Fri, 13 Aug 2021 10:04:21 +0200 Subject: [PATCH 4/8] Add LD_LIBRARY_PATH to cabal test step --- .github/workflows/build-majestic.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-majestic.yml b/.github/workflows/build-majestic.yml index f5d70286b..395053bcb 100644 --- a/.github/workflows/build-majestic.yml +++ b/.github/workflows/build-majestic.yml @@ -38,5 +38,7 @@ jobs: - name: Run testsuite working-directory: ./src/runtime/haskell + env: + LD_LIBRARY_PATH: /usr/local/lib run: | cabal test --extra-lib-dirs=/usr/local/lib From 3e7926f22d13cfa37a49bd2649b3c1b7c477d69d Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Fri, 13 Aug 2021 10:20:49 +0200 Subject: [PATCH 5/8] Update pgf2.cabal, including bumping version to 2.0.0 --- src/runtime/haskell/pgf2.cabal | 77 +++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 30 deletions(-) diff --git a/src/runtime/haskell/pgf2.cabal b/src/runtime/haskell/pgf2.cabal index 2b1eaef4f..9af7b7c9a 100644 --- a/src/runtime/haskell/pgf2.cabal +++ b/src/runtime/haskell/pgf2.cabal @@ -1,34 +1,51 @@ -name: pgf2 -version: 0.1.0.0 --- synopsis: --- description: -homepage: http://www.grammaticalframework.org -license: LGPL-3 ---license-file: LICENSE -author: Krasimir Angelov, Inari -maintainer: --- copyright: -category: Language -build-type: Simple -extra-source-files: README -cabal-version: >=1.10 +name: pgf2 +version: 2.0.0 + +cabal-version: 1.22 +build-type: Simple +license: LGPL-3 +license-file: LICENSE +category: Natural Language Processing +-- synopsis: Bindings to the C version of the PGF runtime +-- description: +-- GF, Grammatical Framework, is a programming language for multilingual grammar applications. +-- GF grammars are compiled into Portable Grammar Format (PGF) which can be used with the PGF runtime, written in C. +-- This package provides Haskell bindings to that runtime. +homepage: https://www.grammaticalframework.org/ +bug-reports: https://github.com/GrammaticalFramework/gf-core/issues +author: Krasimir Angelov +-- tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4 +extra-source-files: + CHANGELOG.md + README.md library - exposed-modules: PGF2, PGF2.Internal, - -- backwards compatibility API: - PGF - other-modules: PGF2.FFI, PGF2.Expr, PGF2.Type - build-depends: base >=4.3, containers, pretty, array, random - -- hs-source-dirs: - default-language: Haskell2010 - build-tools: hsc2hs - - extra-libraries: pgf - cc-options: -std=c99 - c-sources: utils.c + exposed-modules: + PGF2, + PGF2.Internal, + -- backwards compatibility API: + PGF + other-modules: + PGF2.FFI, + PGF2.Expr, + PGF2.Type + build-depends: + base >= 4.3, -- >= 4.9.1 && < 4.15, + containers, -- >= 0.5.7 && < 0.7, + pretty, -- >= 1.1.3 && < 1.2, + array, + random + default-language: Haskell2010 + build-tools: hsc2hs + extra-libraries: pgf + cc-options: -std=c99 + c-sources: utils.c test-suite basic - type: exitcode-stdio-1.0 - main-is: tests/basic.hs - default-language: Haskell2010 - build-depends: base, HUnit, pgf2 + type: exitcode-stdio-1.0 + main-is: tests/basic.hs + default-language: Haskell2010 + build-depends: + base, + HUnit, + pgf2 >= 2.0.0 From 2346abeedbf027e97fe30e941cc360d15b85b6d3 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Fri, 13 Aug 2021 10:25:16 +0200 Subject: [PATCH 6/8] Tweaks to pgf2.cabal --- src/runtime/haskell/pgf2.cabal | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runtime/haskell/pgf2.cabal b/src/runtime/haskell/pgf2.cabal index 9af7b7c9a..f047d6750 100644 --- a/src/runtime/haskell/pgf2.cabal +++ b/src/runtime/haskell/pgf2.cabal @@ -30,9 +30,9 @@ library PGF2.Expr, PGF2.Type build-depends: - base >= 4.3, -- >= 4.9.1 && < 4.15, - containers, -- >= 0.5.7 && < 0.7, - pretty, -- >= 1.1.3 && < 1.2, + base >= 4.3 && < 4.15, + containers, + pretty, array, random default-language: Haskell2010 @@ -48,4 +48,4 @@ test-suite basic build-depends: base, HUnit, - pgf2 >= 2.0.0 + pgf2 From 9e5823c3503fac01fd99fea04784d045406dcc78 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Fri, 13 Aug 2021 10:28:44 +0200 Subject: [PATCH 7/8] Tweak base upper bound in pgf2.cabal --- src/runtime/haskell/pgf2.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/haskell/pgf2.cabal b/src/runtime/haskell/pgf2.cabal index f047d6750..4ac762d06 100644 --- a/src/runtime/haskell/pgf2.cabal +++ b/src/runtime/haskell/pgf2.cabal @@ -30,7 +30,7 @@ library PGF2.Expr, PGF2.Type build-depends: - base >= 4.3 && < 4.15, + base >= 4.3 && < 4.16, containers, pretty, array, From 4fd70bc445146ff10f069281487b3095499bb42e Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Fri, 13 Aug 2021 10:47:06 +0200 Subject: [PATCH 8/8] Add basic installation instructions --- src/runtime/c/README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/runtime/c/README.md diff --git a/src/runtime/c/README.md b/src/runtime/c/README.md new file mode 100644 index 000000000..be9d8d347 --- /dev/null +++ b/src/runtime/c/README.md @@ -0,0 +1,27 @@ +# "Majestic" C Runtime + +## Requirements + +Required system packages (Debian/Ubuntu): +``` +autoconf +automake +libtool +make +g++ +``` + +## Installation + +Installing the runtime (puts libraries in `/usr/local/lib`): +``` +autoreconf -i +./configure +make +make install +``` + +## Using + +- Compiling GF with this runtime will require flag `--extra-lib-dirs=/usr/local/lib`. +- Running GF with this runtime will require environment variable `LD_LIBRARY_PATH=/usr/local/lib`