8 Commits

Author SHA1 Message Date
Andreas Källberg
dd4c58e902 Merge master into tp_nix_flake 2025-08-08 19:43:23 +02:00
Andreas Källberg
de58b51187 Bump nixpkgs version 2025-08-03 14:40:39 +02:00
Andreas Källberg
fa64b4999c Remove unused devenv stuff from flake
This felt like a bunch of bloat and it makes nix ask about if you
want to trust cachix cache for devenv even when you don't use it
2025-08-02 21:27:24 +02:00
Andreas Källberg
8cb65432c7 Merge remote-tracking branch 'origin/master' into tp_nix_flake 2025-08-02 21:13:11 +02:00
Tim Pierson
9c5d2d3d15 bump base ub 2024-01-24 12:31:12 +00:00
o1lo01ol1o
11c733fce4 clean up 2023-11-16 14:32:22 -06:00
o1lo01ol1o
2e9b983618 mute artifacts 2023-11-16 13:48:05 -06:00
o1lo01ol1o
7c3335b95a scaffold flake 2023-11-16 13:42:28 -06:00
15 changed files with 136 additions and 213 deletions

View File

@@ -66,14 +66,14 @@ jobs:
run: |
mv dist/gf_*.deb dist/gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb
#- uses: actions/upload-release-asset@v1.0.2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: dist/gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb
# asset_name: gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb
# asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb
asset_name: gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb
asset_content_type: application/octet-stream
# ---
@@ -121,14 +121,14 @@ jobs:
run: |
mv dist/gf-*.pkg dist/gf-${{ github.event.release.tag_name }}-macos.pkg
#- uses: actions/upload-release-asset@v1.0.2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: dist/gf-${{ github.event.release.tag_name }}-macos.pkg
# asset_name: gf-${{ github.event.release.tag_name }}-macos.pkg
# asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/gf-${{ github.event.release.tag_name }}-macos.pkg
asset_name: gf-${{ github.event.release.tag_name }}-macos.pkg
asset_content_type: application/octet-stream
# ---
@@ -230,11 +230,11 @@ jobs:
- name: Create archive
run: |
Compress-Archive C:\tmp-dist C:\gf-${{ github.event.release.tag_name }}-windows.zip
#- uses: actions/upload-release-asset@v1.0.2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: C:\gf-${{ github.event.release.tag_name }}-windows.zip
# asset_name: gf-${{ github.event.release.tag_name }}-windows.zip
# asset_content_type: application/zip
- uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: C:\gf-${{ github.event.release.tag_name }}-windows.zip
asset_name: gf-${{ github.event.release.tag_name }}-windows.zip
asset_content_type: application/zip

View File

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

View File

@@ -150,9 +150,11 @@ Open a terminal, go to the top directory (``gf-core``), and type the following c
$ stack install
```
=== Alternative: use Cabal ===
It will install GF and all necessary tools and libraries to do that.
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].
=== 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.
The actual installation process is similar to Stack: open a terminal, go to the top directory (``gf-core``), and type the following command.
@@ -160,13 +162,7 @@ The actual installation process is similar to Stack: open a terminal, go to the
$ cabal install
```
=== 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
```
//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.//
== Compiling GF with C runtime system support ==
@@ -201,7 +197,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]
% **If you just want to use the C runtime from Python or Haskell, you don't need to change your GF installation.**
% **If you just want to use the C runtime from Python, Java, or Haskell, you don't need to change your GF installation.**
- **What —**
This is the most common use case for the C runtime: compile
@@ -234,13 +230,20 @@ modes (use the ``help`` command in the shell for details).
(Re)compiling your GF with these flags will also give you
Haskell bindings to the C runtime, as a library called ``PGF2``,
but if you want Python bindings, you need to do [the previous step #bindings].
but if you want Python or Java 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.
- **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:
@@ -251,32 +254,6 @@ extra-lib-dirs:
```
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``.//
//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.//
@@ -289,8 +266,14 @@ With this feature, ``gf -server`` mode is extended with new requests to call the
system, e.g. ``c-parse``, ``c-linearize`` and ``c-translate``.
- **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:

View File

@@ -1,16 +1,16 @@
---
title: Grammatical Framework Download and Installation
date: 8 August 2025
date: 3 August 2025
---
**GF 3.12** was released on 8 August 2025.
**GF 3.12** was released on 3 August 2025.
What's new? See the [release notes](release-3.12.html).
#### Note: GF core and the RGL
The following instructions explain how to install **GF core**, i.e. the compiler, shell and run-time systems.
Obtaining the **Resource Grammar Library (RGL)** is done separately; see the section [at the bottom of this page](#installing-the-rgl-from-a-binary-release).
Obtaining the **Resource Grammar Library (RGL)** is done separately; see the section at the bottom of this page.
---
@@ -21,36 +21,35 @@ Binary packages are available for Debian/Ubuntu, macOS, and Windows and include:
- GF shell and grammar compiler
- `gf -server` mode
- C run-time system
- Python bindings to the C run-time system
- Java & Python bindings to the C run-time system
[Binary packages on GitHub](https://github.com/GrammaticalFramework/gf-core/releases/tag/release-3.12)
Unlike in previous versions, the binaries **do not** include the RGL.
[Binary packages on GitHub](https://github.com/GrammaticalFramework/gf-core/releases/tag/3.12)
#### Debian/Ubuntu
The package targets Ubuntu 24.04 (Noble).
To install it, use:
There are two versions: `gf-3.12-ubuntu-18.04.deb` for Ubuntu 18.04 (Cosmic), and `gf-3.12-ubuntu-20.04.deb` for Ubuntu 20.04 (Focal).
To install the package use:
```
sudo apt install ./gf-3.12-ubuntu-24.04.deb
sudo apt-get install ./gf-3.12-ubuntu-*.deb
```
<!-- The Ubuntu `.deb` packages should work on Ubuntu 16.04, 18.04 and similar Linux distributions. -->
#### macOS
If you are on an Intel Mac (2019 or older), use `gf-3.12-macos-intel.pkg`.<br>
For newer ARM-based Macs (Apple Silicon M1, M2, M3), use `gf-3.12-macos-arm.pkg`.
To install the package, just double-click it and follow the installer instructions.
After downloading, right click on the file and click on Open.[^1]
You will see a dialog saying that "macOS cannot verify the developer of "gf-3.12-macos-intel.pkg". Are you sure you want to open it?".
Press Open.
[^1]: If you just double click on the file, you will get an error message "gf-3.12-macos-intel.pkg" cannot be opened because it is from an unidentified developer.
The packages should work on at least Catalina and Big Sur.
#### Windows
To install the package:
To install the package, unpack it anywhere.
1. unpack it anywhere and take note of the full path to the folder containing the `.exe` file.
2. add it to the `PATH` environment variable
You will probably need to update the `PATH` environment variable to include your chosen install location.
For more information, see [Using GF on Windows](https://www.grammaticalframework.org/~inari/gf-windows.html) (latest updated for Windows 10).
@@ -68,22 +67,23 @@ cabal install gf-3.12
### Notes
#### GHC version
**GHC version**
The GF source code is known to be compilable with GHC versions 7.10 through to 9.6.7.
The GF source code is known to be compilable with GHC versions 7.10 through to 8.10.
#### Obtaining Haskell
**Obtaining Haskell**
There are various ways of obtaining Haskell, including:
- ghcup
1. Install from https://www.haskell.org/ghcup/
2. `ghcup install ghc 9.6.7`
3. `ghcup set ghc 9.6.7`
- Stack: https://haskellstack.org/
1. Install from https://www.haskell.org/ghcup/
2. `ghcup install ghc 8.10.4`
3. `ghcup set ghc 8.10.4`
- Haskell Platform https://www.haskell.org/platform/
- Stack https://haskellstack.org/
#### Installation location
**Installation location**
The above steps install GF for a single user.
The executables are put in `$HOME/.cabal/bin` (or on macOS in `$HOME/Library/Haskell/bin`),
@@ -93,7 +93,7 @@ so you might want to add this directory to your path (in `.bash_profile` or simi
PATH=$HOME/.cabal/bin:$PATH
```
#### Haskeline
**Haskeline**
GF uses [`haskeline`](http://hackage.haskell.org/package/haskeline), which
on Linux depends on some non-Haskell libraries that won't be installed
@@ -105,7 +105,7 @@ Here is one way to do this:
## Installing from source code
### Obtaining
**Obtaining**
To obtain the source code for the **release**,
download it from [GitHub](https://github.com/GrammaticalFramework/gf-core/releases).
@@ -121,7 +121,8 @@ git clone https://github.com/GrammaticalFramework/gf-core.git
git pull
```
### Installing
**Installing**
You can then install with:
```
@@ -138,6 +139,8 @@ stack install
For more info on working with the GF source code, see the
[GF Developers Guide](../doc/gf-developers.html).
For macOS Sequoia, you need to downgrade the LLVM package, see instructions [here](https://github.com/GrammaticalFramework/gf-core/issues/172#issuecomment-2599365457).
## Installing the Python bindings from PyPI
The Python library is available on PyPI as `pgf`, so it can be installed using:
@@ -146,7 +149,10 @@ The Python library is available on PyPI as `pgf`, so it can be installed using:
pip install pgf
```
If this doesn't work, you will need to install the C runtime manually; see the instructions [here](https://www.grammaticalframework.org/doc/gf-developers.html#toc12).
We provide binary wheels for Linux and macOS, which include the C runtime and are ready-to-go.
If there is no binary distribution for your platform, this will install the source tarball,
which will attempt to build the binding during installation,
and requires the GF C runtime to be installed on your system.
---
@@ -158,8 +164,6 @@ In general the steps to follow are:
1. Download a binary release and extract it somewhere on your system.
2. Set the environment variable `GF_LIB_PATH` to point to wherever you extracted the RGL.
For more information, see [Using GF on Windows](https://www.grammaticalframework.org/~inari/gf-windows.html) (latest updated for Windows 10).
## Installing the RGL from source
To compile the RGL, you will need to have GF already installed and in your path.

View File

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

View File

@@ -1,6 +1,6 @@
---
title: GF 3.12 Release Notes
date: 08 August 2025
date: 03 August 2025
---
## Installation

View File

@@ -11,7 +11,7 @@ description: GF, Grammatical Framework, is a programming language for multilingu
maintainer: John J. Camilleri <john@digitalgrammars.com>
homepage: https://www.grammaticalframework.org/
bug-reports: https://github.com/GrammaticalFramework/gf-core/issues
tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4, GHC==9.0.2, GHC==9.2.4, GHC==9.6.7
tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4, GHC==9.0.2, GHC==9.2.4
data-dir: src
extra-source-files:
@@ -159,7 +159,7 @@ library
parallel >= 3.2.1.1 && < 3.3,
process >= 1.4.3 && < 1.7,
time >= 1.6.0 && <= 1.12.2,
template-haskell >= 2.13.0.0 && < 2.21
template-haskell >= 2.13.0.0
hs-source-dirs: src/compiler
exposed-modules:
@@ -349,8 +349,8 @@ library
build-depends:
terminfo >=0.4.0 && < 0.5
if impl(ghc >= 9.6)
build-depends: unix >= 2.8 && < 2.9
if impl(ghc >= 9.6.6)
build-depends: unix >= 2.8
else
build-depends: unix >= 2.7.2 && < 2.8
@@ -365,7 +365,7 @@ executable gf
default-language: Haskell2010
build-depends:
gf,
base >= 4.9.1 && < 4.22
base
ghc-options: -threaded
--ghc-options: -fwarn-unused-imports
@@ -399,7 +399,7 @@ test-suite gf-tests
main-is: run.hs
hs-source-dirs: testsuite
build-depends:
base >= 4.9.1 && < 4.22,
base >= 4.9.1,
Cabal >= 1.8,
directory >= 1.3.0 && < 1.4,
filepath >= 1.4.1 && < 1.5,

View File

@@ -62,7 +62,7 @@
<a href="lib/doc/synopsis/index.html" class="btn btn-primary ml-3">
<i class="fab fa-readme mr-1"></i>
RGL API
RGL Synopsis
</a>
</div>
@@ -72,12 +72,8 @@
<li><a href="doc/gf-developers.html">Developers Guide</a></li>
<!-- <li><a href="/~hallgren/gf-experiment/browse/">Browse Source Code</a></li> -->
<li>PGF library API:<br>
<ul>
<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>
<a href="http://hackage.haskell.org/package/gf/docs/PGF.html">Haskell</a> /
<a href="doc/runtime-api.html">C&nbsp;runtime</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>

View File

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

View File

@@ -1,17 +0,0 @@
Metadata-Version: 2.4
Name: pgf
Version: 1.0
Summary: Python bindings to the Grammatical Framework's PGF runtime
Home-page: https://www.grammaticalframework.org/
Author: Krasimir Angelov
Author-email: kr.angelov@gmail.com
License: BSD
Dynamic: author
Dynamic: author-email
Dynamic: description
Dynamic: home-page
Dynamic: license
Dynamic: summary
Grammatical Framework (GF) is a programming language for multilingual grammar applications.
This package provides Python bindings to GF runtime, which allows you to parse and generate text using GF grammars compiled into the PGF format.

View File

@@ -1,12 +0,0 @@
INSTALL
README.org
pypgf.c
setup.py
test.py
examples/README
examples/gf_utils.py
examples/translation_pipeline.py
pgf.egg-info/PKG-INFO
pgf.egg-info/SOURCES.txt
pgf.egg-info/dependency_links.txt
pgf.egg-info/top_level.txt

View File

@@ -1 +0,0 @@
pgf

View File

@@ -1,16 +1,5 @@
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:
- multipart-0.2.1@sha256:559c04eed5218a9673e9fb6a225287fee1aeb38a45a0caf91a2598967bd75659,1150
- cgi-3001.5.1.0@sha256:408e1f96ac6134965484c891b5fae35c7303fa841b09ce5baea52ddb078eef6b,3442

View File

@@ -3,17 +3,6 @@
# See: https://github.com/GrammaticalFramework/gf-core/pull/106
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:
- multipart-0.2.1@sha256:559c04eed5218a9673e9fb6a225287fee1aeb38a45a0caf91a2598967bd75659,1150
- cgi-3001.5.1.0@sha256:408e1f96ac6134965484c891b5fae35c7303fa841b09ce5baea52ddb078eef6b,3442