15 Commits

Author SHA1 Message Date
Herbert Lange
ec4625bc88 temporarily disabling building the c runtime 2025-08-25 15:59:26 +02:00
Herbert Lange
1166a49c26 disable pypi publication for now 2025-08-25 15:56:42 +02:00
Herbert Lange
64803cdd57 rename windows workflow 2025-08-25 15:55:36 +02:00
Herbert Lange
de1575cd31 disable linux build on windows 2025-08-25 15:54:50 +02:00
Herbert Lange
32d73278af enable workflow for test branch 2025-08-25 15:51:29 +02:00
Herbert Lange
837e691643 copy mac build instructions to see if they also work for windows 2025-08-25 15:48:11 +02:00
Inari Listenmaa
0f4d13dd20 add direct link to Python API 2025-08-22 10:37:54 +02:00
Inari Listenmaa
278397db20 rename RGL Synopsis to RGL API 2025-08-22 09:19:09 +02:00
Andreas Källberg
f31a3496f5 Lower ghc bounds for higher unix dep version
This fixes nix builds of gf-lsp
2025-08-19 03:39:44 +02:00
Inari Listenmaa
b753912689 fix redirect? 2025-08-18 13:51:49 +02:00
Inari Listenmaa
000fab7b52 fix github link to release 3.12 2025-08-18 13:48:05 +02:00
Inari Listenmaa
fa2826d29a Merge pull request #196 from GrammaticalFramework/fix-code-generation
`import Control.Monad` when generating .hs with GADTs
2025-08-13 14:02:53 +02:00
Inari Listenmaa
9325c8f9fb add import Control.Monad when generating .hs with GADTs 2025-08-13 13:38:23 +02:00
Inari Listenmaa
57dc5e9098 update developers' guide 2025-08-11 09:36:34 +02:00
Inari Listenmaa
b42b0caa34 add command to install GF with -cshell (commented out) 2025-08-11 09:36:34 +02:00
9 changed files with 121 additions and 71 deletions

View File

@@ -4,7 +4,7 @@ name: Build & Publish Python Package
on: on:
pull_request: pull_request:
push: push:
branches: [master] branches: [master,try-to-build-python-module-for-win]
jobs: jobs:
build_wheels: build_wheels:
@@ -13,7 +13,7 @@ jobs:
strategy: strategy:
fail-fast: true fail-fast: true
matrix: matrix:
os: [ubuntu-latest, macos-latest, macos-13] os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -34,7 +34,7 @@ jobs:
brew install libtool brew install libtool
- name: Build wheels on Linux - name: Build wheels on Linux
if: startsWith(matrix.os, 'macos') != true if: startsWith(matrix.os, 'ubuntu')
env: env:
CIBW_BEFORE_BUILD: cd src/runtime/c && autoreconf -i && ./configure && make && make install CIBW_BEFORE_BUILD: cd src/runtime/c && autoreconf -i && ./configure && make && make install
run: | run: |
@@ -47,56 +47,63 @@ jobs:
run: | run: |
python -m cibuildwheel src/runtime/python --output-dir wheelhouse python -m cibuildwheel src/runtime/python --output-dir wheelhouse
- name: Build wheels on Windows
if: startsWith(matrix.os, 'windows')
# env:
# CIBW_BEFORE_BUILD: cd src/runtime/c && glibtoolize && autoreconf -i && ./configure && make && sudo make install
run: |
python -m cibuildwheel src/runtime/python --output-dir wheelhouse
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:
name: wheel-${{ matrix.os }} name: wheel-${{ matrix.os }}
path: ./wheelhouse path: ./wheelhouse
build_sdist: # build_sdist:
name: Build source distribution # name: Build source distribution
runs-on: ubuntu-latest # runs-on: ubuntu-latest
steps: # steps:
- uses: actions/checkout@v4 # - uses: actions/checkout@v4
- uses: actions/setup-python@v5 # - uses: actions/setup-python@v5
name: Install Python # name: Install Python
with: # with:
python-version: '3.10' # python-version: '3.10'
- name: Build sdist # - name: Build sdist
run: cd src/runtime/python && python setup.py sdist # run: cd src/runtime/python && python setup.py sdist
- uses: actions/upload-artifact@v4 # - uses: actions/upload-artifact@v4
with: # with:
name: wheel-source # name: wheel-source
path: ./src/runtime/python/dist/*.tar.gz # path: ./src/runtime/python/dist/*.tar.gz
upload_pypi: # upload_pypi:
name: Upload to PyPI # name: Upload to PyPI
needs: [build_wheels, build_sdist] # needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest # runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push' # if: github.ref == 'refs/heads/master' && github.event_name == 'push'
steps: # steps:
- uses: actions/checkout@v4 # - uses: actions/checkout@v4
- name: Set up Python # - name: Set up Python
uses: actions/setup-python@v5 # uses: actions/setup-python@v5
with: # with:
python-version: '3.x' # python-version: '3.x'
- name: Install twine # - name: Install twine
run: pip install twine # run: pip install twine
- uses: actions/download-artifact@v4.1.7 # - uses: actions/download-artifact@v4.1.7
with: # with:
pattern: wheel-* # pattern: wheel-*
merge-multiple: true # merge-multiple: true
path: ./dist # path: ./dist
- name: Publish # - name: Publish
env: # env:
TWINE_USERNAME: __token__ # TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} # TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: | # run: |
twine upload --verbose --non-interactive --skip-existing dist/* # twine upload --verbose --non-interactive --skip-existing dist/*

View File

@@ -150,11 +150,9 @@ Open a terminal, go to the top directory (``gf-core``), and type the following c
$ stack install $ stack install
``` ```
It will install GF and all necessary tools and libraries to do that.
=== Alternative: use Cabal === === Alternative: use Cabal ===
You can also install GF using Cabal, if you prefer Cabal to Stack. In that case, you may need to install some prerequisites yourself.
If you prefer Cabal, then you just need to manually choose a suitable GHC to build GF. We recommend GHC 9.6.7, see other supported options in [gf.cabal https://github.com/GrammaticalFramework/gf-core/blob/master/gf.cabal#L14].
The actual installation process is similar to Stack: open a terminal, go to the top directory (``gf-core``), and type the following command. The actual installation process is similar to Stack: open a terminal, go to the top directory (``gf-core``), and type the following command.
@@ -162,7 +160,13 @@ The actual installation process is similar to Stack: open a terminal, go to the
$ cabal install $ cabal install
``` ```
//The old (potentially outdated) instructions for Cabal are moved to a [separate page ../doc/gf-developers-old-cabal.html]. If you run into trouble with ``cabal install``, you may want to take a look.// === Nix ===
As of 3.12, GF can also be installed via Nix. You can install GF from github with the following command:
```
nix profile install github:GrammaticalFramework/gf-core#gf
```
== Compiling GF with C runtime system support == == Compiling GF with C runtime system support ==
@@ -197,7 +201,7 @@ Depending on what you want to do with the C runtime, you can follow one or more
=== Use the C runtime from another programming language ===[bindings] === Use the C runtime from another programming language ===[bindings]
% **If you just want to use the C runtime from Python, Java, or Haskell, you don't need to change your GF installation.** % **If you just want to use the C runtime from Python or Haskell, you don't need to change your GF installation.**
- **What —** - **What —**
This is the most common use case for the C runtime: compile This is the most common use case for the C runtime: compile
@@ -230,20 +234,13 @@ modes (use the ``help`` command in the shell for details).
(Re)compiling your GF with these flags will also give you (Re)compiling your GF with these flags will also give you
Haskell bindings to the C runtime, as a library called ``PGF2``, Haskell bindings to the C runtime, as a library called ``PGF2``,
but if you want Python or Java bindings, you need to do [the previous step #bindings]. but if you want Python bindings, you need to do [the previous step #bindings].
% ``PGF2``: a module to import in Haskell programs, providing a binding to the C run-time system. % ``PGF2``: a module to import in Haskell programs, providing a binding to the C run-time system.
- **How —** - **How —**
If you use cabal, run the following command:
``` Add (or uncomment) the following lines in the ``stack.yaml`` file:
cabal install -fc-runtime
```
from the top directory (``gf-core``).
If you use stack, uncomment the following lines in the ``stack.yaml`` file:
``` ```
flags: flags:
@@ -254,6 +251,32 @@ extra-lib-dirs:
``` ```
and then run ``stack install`` from the top directory (``gf-core``). and then run ``stack install`` from the top directory (``gf-core``).
Run the newly built executable with the flag ``-cshell``, and you should see the following welcome message:
```
$ gf -cshell
* * *
* *
* *
*
*
* * * * * * *
* * *
* * * * * *
* * *
* * *
This is GF version 3.12.0.
Built on ...
Git info: ...
Flags: interrupt server c-runtime
License: see help -license.
This shell uses the C run-time system. See help for available commands.
>
```
//If you get an "``error while loading shared libraries``" when trying to run GF with C runtime, remember to declare your ``LD_LIBRARY_PATH``.// //If you get an "``error while loading shared libraries``" when trying to run GF with C runtime, remember to declare your ``LD_LIBRARY_PATH``.//
//Add ``export LD_LIBRARY_PATH="/usr/local/lib"`` to either your ``.bashrc`` or ``.profile``. You should now be able to start GF with C runtime.// //Add ``export LD_LIBRARY_PATH="/usr/local/lib"`` to either your ``.bashrc`` or ``.profile``. You should now be able to start GF with C runtime.//
@@ -266,14 +289,8 @@ With this feature, ``gf -server`` mode is extended with new requests to call the
system, e.g. ``c-parse``, ``c-linearize`` and ``c-translate``. system, e.g. ``c-parse``, ``c-linearize`` and ``c-translate``.
- **How —** - **How —**
If you use cabal, run the following command:
``` Add the following lines in the ``stack.yaml`` file:
cabal install -fc-runtime -fserver
```
from the top directory.
If you use stack, add the following lines in the ``stack.yaml`` file:
``` ```
flags: flags:

View File

@@ -23,7 +23,7 @@ Binary packages are available for Debian/Ubuntu, macOS, and Windows and include:
- C run-time system - C run-time system
- Python bindings to the C run-time system - Python bindings to the C run-time system
[Binary packages on GitHub](https://github.com/GrammaticalFramework/gf-core/releases/tag/3.12) [Binary packages on GitHub](https://github.com/GrammaticalFramework/gf-core/releases/tag/release-3.12)
#### Debian/Ubuntu #### Debian/Ubuntu

View File

@@ -1,6 +1,6 @@
<html> <html>
<head> <head>
<meta http-equiv="refresh" content="0; URL=/download/index-3.11.html" /> <meta http-equiv="refresh" content="0; URL=/download/index-3.12.html" />
</head> </head>
<body> <body>
You are being redirected to <a href="index-3.12.html">the current version</a> of this page. You are being redirected to <a href="index-3.12.html">the current version</a> of this page.

View File

@@ -349,7 +349,7 @@ library
build-depends: build-depends:
terminfo >=0.4.0 && < 0.5 terminfo >=0.4.0 && < 0.5
if impl(ghc >= 9.6.6) if impl(ghc >= 9.6)
build-depends: unix >= 2.8 && < 2.9 build-depends: unix >= 2.8 && < 2.9
else else

View File

@@ -62,7 +62,7 @@
<a href="lib/doc/synopsis/index.html" class="btn btn-primary ml-3"> <a href="lib/doc/synopsis/index.html" class="btn btn-primary ml-3">
<i class="fab fa-readme mr-1"></i> <i class="fab fa-readme mr-1"></i>
RGL Synopsis RGL API
</a> </a>
</div> </div>
@@ -72,8 +72,12 @@
<li><a href="doc/gf-developers.html">Developers Guide</a></li> <li><a href="doc/gf-developers.html">Developers Guide</a></li>
<!-- <li><a href="/~hallgren/gf-experiment/browse/">Browse Source Code</a></li> --> <!-- <li><a href="/~hallgren/gf-experiment/browse/">Browse Source Code</a></li> -->
<li>PGF library API:<br> <li>PGF library API:<br>
<a href="http://hackage.haskell.org/package/gf/docs/PGF.html">Haskell</a> / <ul>
<a href="doc/runtime-api.html">C&nbsp;runtime</a> <li><a href="http://hackage.haskell.org/package/gf/docs/PGF.html">Haskell</a>
</li><li><a href="doc/runtime-api.html#python">Python</a>
</li><li><a href="doc/runtime-api.html">C&nbsp;runtime</a>
</li>
</ul>
</li> </li>
<li><a href="http://hackage.haskell.org/package/gf/docs/GF.html">GF compiler API</a></li> <li><a href="http://hackage.haskell.org/package/gf/docs/GF.html">GF compiler API</a></li>
<!-- <li><a href="src/ui/android/README">GF on Android (new)</a></li> <!-- <li><a href="src/ui/android/README">GF on Android (new)</a></li>

View File

@@ -51,7 +51,7 @@ grammar2haskell opts name gr = foldr (++++) [] $
derivingClause derivingClause
| dataExt = "deriving (Show,Data)" | dataExt = "deriving (Show,Data)"
| otherwise = "deriving Show" | otherwise = "deriving Show"
extraImports | gadt = ["import Control.Monad.Identity", "import Data.Monoid"] extraImports | gadt = ["import Control.Monad.Identity", "import Control.Monad", "import Data.Monoid"]
| dataExt = ["import Data.Data"] | dataExt = ["import Data.Data"]
| otherwise = [] | otherwise = []
pgfImports | pgf2 = ["import PGF2 hiding (Tree)", "", "showCId :: CId -> String", "showCId = id"] pgfImports | pgf2 = ["import PGF2 hiding (Tree)", "", "showCId :: CId -> String", "showCId = id"]

View File

@@ -1,5 +1,16 @@
resolver: ghc-9.6.7 resolver: ghc-9.6.7
## To install GF with C-runtime support, comment out the following lines:
# flags:
# gf:
# c-runtime: true
# extra-lib-dirs:
# - /usr/local/lib
## Need exact versions of libraries, to ensure predictable build
extra-deps: extra-deps:
- multipart-0.2.1@sha256:559c04eed5218a9673e9fb6a225287fee1aeb38a45a0caf91a2598967bd75659,1150 - multipart-0.2.1@sha256:559c04eed5218a9673e9fb6a225287fee1aeb38a45a0caf91a2598967bd75659,1150
- cgi-3001.5.1.0@sha256:408e1f96ac6134965484c891b5fae35c7303fa841b09ce5baea52ddb078eef6b,3442 - cgi-3001.5.1.0@sha256:408e1f96ac6134965484c891b5fae35c7303fa841b09ce5baea52ddb078eef6b,3442

View File

@@ -3,6 +3,17 @@
# See: https://github.com/GrammaticalFramework/gf-core/pull/106 # See: https://github.com/GrammaticalFramework/gf-core/pull/106
resolver: ghc-9.6.7 resolver: ghc-9.6.7
## To install GF with C-runtime support, comment out the following lines:
# flags:
# gf:
# c-runtime: true
# extra-lib-dirs:
# - /usr/local/lib
## Need exact versions of libraries, to ensure predictable build
extra-deps: extra-deps:
- multipart-0.2.1@sha256:559c04eed5218a9673e9fb6a225287fee1aeb38a45a0caf91a2598967bd75659,1150 - multipart-0.2.1@sha256:559c04eed5218a9673e9fb6a225287fee1aeb38a45a0caf91a2598967bd75659,1150
- cgi-3001.5.1.0@sha256:408e1f96ac6134965484c891b5fae35c7303fa841b09ce5baea52ddb078eef6b,3442 - cgi-3001.5.1.0@sha256:408e1f96ac6134965484c891b5fae35c7303fa841b09ce5baea52ddb078eef6b,3442