forked from GitHub/gf-core
Compare commits
18 Commits
release3.1
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f4d13dd20 | ||
|
|
278397db20 | ||
|
|
f31a3496f5 | ||
|
|
b753912689 | ||
|
|
000fab7b52 | ||
|
|
fa2826d29a | ||
|
|
9325c8f9fb | ||
|
|
57dc5e9098 | ||
|
|
b42b0caa34 | ||
|
|
3ecb75d7d8 | ||
|
|
2b876b1aac | ||
|
|
5935119050 | ||
|
|
489424a1c6 | ||
|
|
9c72994c2b | ||
|
|
17ebcac84f | ||
|
|
7d018dde62 | ||
|
|
4dba12c0ce | ||
|
|
5ca230dd2a |
48
.github/workflows/build-binary-packages.yml
vendored
48
.github/workflows/build-binary-packages.yml
vendored
@@ -66,14 +66,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mv dist/gf_*.deb dist/gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb
|
mv dist/gf_*.deb dist/gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb
|
||||||
|
|
||||||
- uses: actions/upload-release-asset@v1.0.2
|
#- uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
# env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
# with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
# upload_url: ${{ github.event.release.upload_url }}
|
||||||
asset_path: dist/gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb
|
# asset_path: dist/gf-${{ github.event.release.tag_name }}-${{ matrix.os }}.deb
|
||||||
asset_name: 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
|
# asset_content_type: application/octet-stream
|
||||||
|
|
||||||
# ---
|
# ---
|
||||||
|
|
||||||
@@ -121,14 +121,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mv dist/gf-*.pkg dist/gf-${{ github.event.release.tag_name }}-macos.pkg
|
mv dist/gf-*.pkg dist/gf-${{ github.event.release.tag_name }}-macos.pkg
|
||||||
|
|
||||||
- uses: actions/upload-release-asset@v1.0.2
|
#- uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
# env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
# with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
# upload_url: ${{ github.event.release.upload_url }}
|
||||||
asset_path: dist/gf-${{ github.event.release.tag_name }}-macos.pkg
|
# asset_path: dist/gf-${{ github.event.release.tag_name }}-macos.pkg
|
||||||
asset_name: gf-${{ github.event.release.tag_name }}-macos.pkg
|
# asset_name: gf-${{ github.event.release.tag_name }}-macos.pkg
|
||||||
asset_content_type: application/octet-stream
|
# asset_content_type: application/octet-stream
|
||||||
|
|
||||||
# ---
|
# ---
|
||||||
|
|
||||||
@@ -230,11 +230,11 @@ jobs:
|
|||||||
- name: Create archive
|
- name: Create archive
|
||||||
run: |
|
run: |
|
||||||
Compress-Archive C:\tmp-dist C:\gf-${{ github.event.release.tag_name }}-windows.zip
|
Compress-Archive C:\tmp-dist C:\gf-${{ github.event.release.tag_name }}-windows.zip
|
||||||
- uses: actions/upload-release-asset@v1.0.2
|
#- uses: actions/upload-release-asset@v1.0.2
|
||||||
env:
|
# env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
# with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
# upload_url: ${{ github.event.release.upload_url }}
|
||||||
asset_path: C:\gf-${{ github.event.release.tag_name }}-windows.zip
|
# asset_path: C:\gf-${{ github.event.release.tag_name }}-windows.zip
|
||||||
asset_name: gf-${{ github.event.release.tag_name }}-windows.zip
|
# asset_name: gf-${{ github.event.release.tag_name }}-windows.zip
|
||||||
asset_content_type: application/zip
|
# asset_content_type: application/zip
|
||||||
|
|||||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -73,3 +73,9 @@ doc/icfp-2012.html
|
|||||||
download/*.html
|
download/*.html
|
||||||
gf-book/index.html
|
gf-book/index.html
|
||||||
src/www/gf-web-api.html
|
src/www/gf-web-api.html
|
||||||
|
.devenv
|
||||||
|
.direnv
|
||||||
|
result
|
||||||
|
.vscode
|
||||||
|
.envrc
|
||||||
|
.pre-commit-config.yaml
|
||||||
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
@@ -36,9 +36,14 @@ sudo apt install ./gf-3.12-ubuntu-24.04.deb
|
|||||||
|
|
||||||
#### macOS
|
#### macOS
|
||||||
|
|
||||||
To install the package, just double-click it and follow the installer instructions.
|
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`.
|
||||||
|
|
||||||
The packages should work on at least Catalina and Big Sur.
|
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.
|
||||||
|
|
||||||
#### Windows
|
#### Windows
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
43
flake.lock
generated
Normal file
43
flake.lock
generated
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1704290814,
|
||||||
|
"narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-23.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs",
|
||||||
|
"systems": "systems"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
50
flake.nix
Normal file
50
flake.nix
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||||
|
systems.url = "github:nix-systems/default";
|
||||||
|
};
|
||||||
|
|
||||||
|
nixConfig = {
|
||||||
|
# extra-trusted-public-keys =
|
||||||
|
# "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
|
||||||
|
# extra-substituters = "https://devenv.cachix.org";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, systems, ... }@inputs:
|
||||||
|
let forEachSystem = nixpkgs.lib.genAttrs (import systems);
|
||||||
|
in {
|
||||||
|
packages = forEachSystem (system:
|
||||||
|
let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
haskellPackages = pkgs.haskell.packages.ghc925.override {
|
||||||
|
overrides = self: _super: {
|
||||||
|
cgi = pkgs.haskell.lib.unmarkBroken (pkgs.haskell.lib.dontCheck
|
||||||
|
(self.callHackage "cgi" "3001.5.0.1" { }));
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
in {
|
||||||
|
gf = pkgs.haskell.lib.overrideCabal
|
||||||
|
(haskellPackages.callCabal2nixWithOptions "gf" self "--flag=-server"
|
||||||
|
{ }) (_old: {
|
||||||
|
# Fix utf8 encoding problems
|
||||||
|
patches = [
|
||||||
|
# Already applied in master
|
||||||
|
# (
|
||||||
|
# pkgs.fetchpatch {
|
||||||
|
# url = "https://github.com/anka-213/gf-core/commit/6f1ca05fddbcbc860898ddf10a557b513dfafc18.patch";
|
||||||
|
# sha256 = "17vn3hncxm1dwbgpfmrl6gk6wljz3r28j191lpv5zx741pmzgbnm";
|
||||||
|
# }
|
||||||
|
# )
|
||||||
|
./nix/expose-all.patch
|
||||||
|
./nix/revert-new-cabal-madness.patch
|
||||||
|
];
|
||||||
|
jailbreak = true;
|
||||||
|
# executableSystemDepends = [
|
||||||
|
# (pkgs.ncurses.override { enableStatic = true; })
|
||||||
|
# ];
|
||||||
|
# executableHaskellDepends = [ ];
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
12
gf.cabal
12
gf.cabal
@@ -11,7 +11,7 @@ description: GF, Grammatical Framework, is a programming language for multilingu
|
|||||||
maintainer: John J. Camilleri <john@digitalgrammars.com>
|
maintainer: John J. Camilleri <john@digitalgrammars.com>
|
||||||
homepage: https://www.grammaticalframework.org/
|
homepage: https://www.grammaticalframework.org/
|
||||||
bug-reports: https://github.com/GrammaticalFramework/gf-core/issues
|
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
|
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
|
||||||
|
|
||||||
data-dir: src
|
data-dir: src
|
||||||
extra-source-files:
|
extra-source-files:
|
||||||
@@ -159,7 +159,7 @@ library
|
|||||||
parallel >= 3.2.1.1 && < 3.3,
|
parallel >= 3.2.1.1 && < 3.3,
|
||||||
process >= 1.4.3 && < 1.7,
|
process >= 1.4.3 && < 1.7,
|
||||||
time >= 1.6.0 && <= 1.12.2,
|
time >= 1.6.0 && <= 1.12.2,
|
||||||
template-haskell >= 2.13.0.0
|
template-haskell >= 2.13.0.0 && < 2.21
|
||||||
|
|
||||||
hs-source-dirs: src/compiler
|
hs-source-dirs: src/compiler
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
@@ -349,8 +349,8 @@ 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
|
build-depends: unix >= 2.8 && < 2.9
|
||||||
|
|
||||||
else
|
else
|
||||||
build-depends: unix >= 2.7.2 && < 2.8
|
build-depends: unix >= 2.7.2 && < 2.8
|
||||||
@@ -365,7 +365,7 @@ executable gf
|
|||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
build-depends:
|
build-depends:
|
||||||
gf,
|
gf,
|
||||||
base
|
base >= 4.9.1 && < 4.22
|
||||||
ghc-options: -threaded
|
ghc-options: -threaded
|
||||||
--ghc-options: -fwarn-unused-imports
|
--ghc-options: -fwarn-unused-imports
|
||||||
|
|
||||||
@@ -399,7 +399,7 @@ test-suite gf-tests
|
|||||||
main-is: run.hs
|
main-is: run.hs
|
||||||
hs-source-dirs: testsuite
|
hs-source-dirs: testsuite
|
||||||
build-depends:
|
build-depends:
|
||||||
base >= 4.9.1,
|
base >= 4.9.1 && < 4.22,
|
||||||
Cabal >= 1.8,
|
Cabal >= 1.8,
|
||||||
directory >= 1.3.0 && < 1.4,
|
directory >= 1.3.0 && < 1.4,
|
||||||
filepath >= 1.4.1 && < 1.5,
|
filepath >= 1.4.1 && < 1.5,
|
||||||
|
|||||||
10
index.html
10
index.html
@@ -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 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 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>
|
||||||
|
|||||||
12
nix/expose-all.patch
Normal file
12
nix/expose-all.patch
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/gf.cabal b/gf.cabal
|
||||||
|
index 0076e7638..8d3fe4b49 100644
|
||||||
|
--- a/gf.cabal
|
||||||
|
+++ b/gf.cabal
|
||||||
|
@@ -168,7 +168,6 @@ Library
|
||||||
|
GF.Text.Lexing
|
||||||
|
GF.Grammar.Canonical
|
||||||
|
|
||||||
|
- other-modules:
|
||||||
|
GF.Main
|
||||||
|
GF.Compiler
|
||||||
|
GF.Interactive
|
||||||
193
nix/revert-new-cabal-madness.patch
Normal file
193
nix/revert-new-cabal-madness.patch
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
commit 45e5473fcd5707af93646d9a116867a4d4e3e9c9
|
||||||
|
Author: Andreas Källberg <anka.213@gmail.com>
|
||||||
|
Date: Mon Oct 10 14:57:12 2022 +0200
|
||||||
|
|
||||||
|
Revert "workaround for the Nix madness"
|
||||||
|
|
||||||
|
This reverts commit 1294269cd60f3db7b056135104615625baeb528c.
|
||||||
|
|
||||||
|
There are easier workarounds, like using
|
||||||
|
|
||||||
|
cabal v1-build
|
||||||
|
|
||||||
|
etc. instead of just `cabal build`
|
||||||
|
|
||||||
|
These changes also broke a whole bunch of other stuff
|
||||||
|
|
||||||
|
diff --git a/README.md b/README.md
|
||||||
|
index ba35795a4..79e6ab68f 100644
|
||||||
|
--- a/README.md
|
||||||
|
+++ b/README.md
|
||||||
|
@@ -38,21 +38,6 @@ or:
|
||||||
|
```
|
||||||
|
stack install
|
||||||
|
```
|
||||||
|
-Note that if you are unlucky to have Cabal 3.0 or later, then it uses
|
||||||
|
-the so-called Nix style commands. Using those for GF development is
|
||||||
|
-a pain. Every time when you change something in the source code, Cabal
|
||||||
|
-will generate a new folder for GF to look for the GF libraries and
|
||||||
|
-the GF cloud. Either reinstall everything with every change in the
|
||||||
|
-compiler, or be sane and stop using cabal-install. Instead you can do:
|
||||||
|
-```
|
||||||
|
-runghc Setup.hs configure
|
||||||
|
-runghc Setup.hs build
|
||||||
|
-sudo runghc Setup.hs install
|
||||||
|
-```
|
||||||
|
-The script will install the GF dependencies globally. The only solution
|
||||||
|
-to the Nix madness that I found is radical:
|
||||||
|
-
|
||||||
|
- "No person, no problem" (Нет человека – нет проблемы).
|
||||||
|
|
||||||
|
For more information, including links to precompiled binaries, see the [download page](https://www.grammaticalframework.org/download/index.html).
|
||||||
|
|
||||||
|
diff --git a/Setup.hs b/Setup.hs
|
||||||
|
index 58dc3e0c6..f8309cc00 100644
|
||||||
|
--- a/Setup.hs
|
||||||
|
+++ b/Setup.hs
|
||||||
|
@@ -4,68 +4,42 @@ import Distribution.Simple.LocalBuildInfo(LocalBuildInfo(..),absoluteInstallDirs
|
||||||
|
import Distribution.Simple.Setup(BuildFlags(..),Flag(..),InstallFlags(..),CopyDest(..),CopyFlags(..),SDistFlags(..))
|
||||||
|
import Distribution.PackageDescription(PackageDescription(..),emptyHookedBuildInfo)
|
||||||
|
import Distribution.Simple.BuildPaths(exeExtension)
|
||||||
|
-import System.Directory
|
||||||
|
import System.FilePath((</>),(<.>))
|
||||||
|
-import System.Process
|
||||||
|
-import Control.Monad(forM_,unless)
|
||||||
|
-import Control.Exception(bracket_)
|
||||||
|
-import Data.Char(isSpace)
|
||||||
|
|
||||||
|
import WebSetup
|
||||||
|
|
||||||
|
+-- | Notice about RGL not built anymore
|
||||||
|
+noRGLmsg :: IO ()
|
||||||
|
+noRGLmsg = putStrLn "Notice: the RGL is not built as part of GF anymore. See https://github.com/GrammaticalFramework/gf-rgl"
|
||||||
|
+
|
||||||
|
main :: IO ()
|
||||||
|
main = defaultMainWithHooks simpleUserHooks
|
||||||
|
- { preConf = gfPreConf
|
||||||
|
- , preBuild = gfPreBuild
|
||||||
|
+ { preBuild = gfPreBuild
|
||||||
|
, postBuild = gfPostBuild
|
||||||
|
, preInst = gfPreInst
|
||||||
|
, postInst = gfPostInst
|
||||||
|
, postCopy = gfPostCopy
|
||||||
|
}
|
||||||
|
where
|
||||||
|
- gfPreConf args flags = do
|
||||||
|
- pkgs <- fmap (map (dropWhile isSpace) . tail . lines)
|
||||||
|
- (readProcess "ghc-pkg" ["list"] "")
|
||||||
|
- forM_ dependencies $ \pkg -> do
|
||||||
|
- let name = takeWhile (/='/') (drop 36 pkg)
|
||||||
|
- unless (name `elem` pkgs) $ do
|
||||||
|
- let fname = name <.> ".tar.gz"
|
||||||
|
- callProcess "wget" [pkg,"-O",fname]
|
||||||
|
- callProcess "tar" ["-xzf",fname]
|
||||||
|
- removeFile fname
|
||||||
|
- bracket_ (setCurrentDirectory name) (setCurrentDirectory ".." >> removeDirectoryRecursive name) $ do
|
||||||
|
- exists <- doesFileExist "Setup.hs"
|
||||||
|
- unless exists $ do
|
||||||
|
- writeFile "Setup.hs" (unlines [
|
||||||
|
- "import Distribution.Simple",
|
||||||
|
- "main = defaultMain"
|
||||||
|
- ])
|
||||||
|
- let to_descr = reverse .
|
||||||
|
- (++) (reverse ".cabal") .
|
||||||
|
- drop 1 .
|
||||||
|
- dropWhile (/='-') .
|
||||||
|
- reverse
|
||||||
|
- callProcess "wget" [to_descr pkg, "-O", to_descr name]
|
||||||
|
- callProcess "runghc" ["Setup.hs","configure"]
|
||||||
|
- callProcess "runghc" ["Setup.hs","build"]
|
||||||
|
- callProcess "sudo" ["runghc","Setup.hs","install"]
|
||||||
|
-
|
||||||
|
- preConf simpleUserHooks args flags
|
||||||
|
-
|
||||||
|
- gfPreBuild args = gfPre args . buildDistPref
|
||||||
|
- gfPreInst args = gfPre args . installDistPref
|
||||||
|
+ gfPreBuild args = gfPre args . buildDistPref
|
||||||
|
+ gfPreInst args = gfPre args . installDistPref
|
||||||
|
|
||||||
|
gfPre args distFlag = do
|
||||||
|
return emptyHookedBuildInfo
|
||||||
|
|
||||||
|
gfPostBuild args flags pkg lbi = do
|
||||||
|
+ -- noRGLmsg
|
||||||
|
let gf = default_gf lbi
|
||||||
|
buildWeb gf flags (pkg,lbi)
|
||||||
|
|
||||||
|
gfPostInst args flags pkg lbi = do
|
||||||
|
+ -- noRGLmsg
|
||||||
|
+ saveInstallPath args flags (pkg,lbi)
|
||||||
|
installWeb (pkg,lbi)
|
||||||
|
|
||||||
|
gfPostCopy args flags pkg lbi = do
|
||||||
|
+ -- noRGLmsg
|
||||||
|
+ saveCopyPath args flags (pkg,lbi)
|
||||||
|
copyWeb flags (pkg,lbi)
|
||||||
|
|
||||||
|
-- `cabal sdist` will not make a proper dist archive, for that see `make sdist`
|
||||||
|
@@ -73,16 +47,27 @@ main = defaultMainWithHooks simpleUserHooks
|
||||||
|
gfSDist pkg lbi hooks flags = do
|
||||||
|
return ()
|
||||||
|
|
||||||
|
-dependencies = [
|
||||||
|
- "https://hackage.haskell.org/package/utf8-string-1.0.2/utf8-string-1.0.2.tar.gz",
|
||||||
|
- "https://hackage.haskell.org/package/json-0.10/json-0.10.tar.gz",
|
||||||
|
- "https://hackage.haskell.org/package/network-bsd-2.8.1.0/network-bsd-2.8.1.0.tar.gz",
|
||||||
|
- "https://hackage.haskell.org/package/httpd-shed-0.4.1.1/httpd-shed-0.4.1.1.tar.gz",
|
||||||
|
- "https://hackage.haskell.org/package/exceptions-0.10.5/exceptions-0.10.5.tar.gz",
|
||||||
|
- "https://hackage.haskell.org/package/stringsearch-0.3.6.6/stringsearch-0.3.6.6.tar.gz",
|
||||||
|
- "https://hackage.haskell.org/package/multipart-0.2.1/multipart-0.2.1.tar.gz",
|
||||||
|
- "https://hackage.haskell.org/package/cgi-3001.5.0.0/cgi-3001.5.0.0.tar.gz"
|
||||||
|
- ]
|
||||||
|
+saveInstallPath :: [String] -> InstallFlags -> (PackageDescription, LocalBuildInfo) -> IO ()
|
||||||
|
+saveInstallPath args flags bi = do
|
||||||
|
+ let
|
||||||
|
+ dest = NoCopyDest
|
||||||
|
+ dir = datadir (uncurry absoluteInstallDirs bi dest)
|
||||||
|
+ writeFile dataDirFile dir
|
||||||
|
+
|
||||||
|
+saveCopyPath :: [String] -> CopyFlags -> (PackageDescription, LocalBuildInfo) -> IO ()
|
||||||
|
+saveCopyPath args flags bi = do
|
||||||
|
+ let
|
||||||
|
+ dest = case copyDest flags of
|
||||||
|
+ NoFlag -> NoCopyDest
|
||||||
|
+ Flag d -> d
|
||||||
|
+ dir = datadir (uncurry absoluteInstallDirs bi dest)
|
||||||
|
+ writeFile dataDirFile dir
|
||||||
|
+
|
||||||
|
+-- | Name of file where installation's data directory is recording
|
||||||
|
+-- This is a last-resort way in which the seprate RGL build script
|
||||||
|
+-- can determine where to put the compiled RGL files
|
||||||
|
+dataDirFile :: String
|
||||||
|
+dataDirFile = "DATA_DIR"
|
||||||
|
|
||||||
|
-- | Get path to locally-built gf
|
||||||
|
default_gf :: LocalBuildInfo -> FilePath
|
||||||
|
diff --git a/gf.cabal b/gf.cabal
|
||||||
|
index a055b86be..d00a5b935 100644
|
||||||
|
--- a/gf.cabal
|
||||||
|
+++ b/gf.cabal
|
||||||
|
@@ -2,7 +2,7 @@ name: gf
|
||||||
|
version: 3.11.0-git
|
||||||
|
|
||||||
|
cabal-version: 1.22
|
||||||
|
-build-type: Simple
|
||||||
|
+build-type: Custom
|
||||||
|
license: OtherLicense
|
||||||
|
license-file: LICENSE
|
||||||
|
category: Natural Language Processing, Compiler
|
||||||
|
@@ -44,6 +44,14 @@ data-files:
|
||||||
|
www/translator/*.css
|
||||||
|
www/translator/*.js
|
||||||
|
|
||||||
|
+custom-setup
|
||||||
|
+ setup-depends:
|
||||||
|
+ base >= 4.9.1 && < 4.16,
|
||||||
|
+ Cabal >= 1.22.0.0,
|
||||||
|
+ directory >= 1.3.0 && < 1.4,
|
||||||
|
+ filepath >= 1.4.1 && < 1.5,
|
||||||
|
+ process >= 1.0.1.1 && < 1.7
|
||||||
|
+
|
||||||
|
source-repository head
|
||||||
|
type: git
|
||||||
|
location: https://github.com/GrammaticalFramework/gf-core.git
|
||||||
@@ -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"]
|
||||||
|
|||||||
17
src/runtime/python/pgf.egg-info/PKG-INFO
Normal file
17
src/runtime/python/pgf.egg-info/PKG-INFO
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
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.
|
||||||
12
src/runtime/python/pgf.egg-info/SOURCES.txt
Normal file
12
src/runtime/python/pgf.egg-info/SOURCES.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
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
|
||||||
1
src/runtime/python/pgf.egg-info/dependency_links.txt
Normal file
1
src/runtime/python/pgf.egg-info/dependency_links.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
1
src/runtime/python/pgf.egg-info/top_level.txt
Normal file
1
src/runtime/python/pgf.egg-info/top_level.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
pgf
|
||||||
@@ -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
|
||||||
|
|||||||
11
stack.yaml
11
stack.yaml
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user