forked from GitHub/gf-core
Merge pull request #88 from GrammaticalFramework/build-binary-packages
Build binary packages
This commit is contained in:
6
.github/workflows/build-all-versions.yml
vendored
6
.github/workflows/build-all-versions.yml
vendored
@@ -13,16 +13,16 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
cabal: ["3.2"]
|
cabal: ["3.2"]
|
||||||
ghc:
|
ghc:
|
||||||
- "8.6.5"
|
- "8.6.5"
|
||||||
- "8.8.3"
|
- "8.8.3"
|
||||||
- "8.10.1"
|
- "8.10.1"
|
||||||
exclude:
|
exclude:
|
||||||
- os: macOS-latest
|
- os: macos-latest
|
||||||
ghc: 8.8.3
|
ghc: 8.8.3
|
||||||
- os: macOS-latest
|
- os: macos-latest
|
||||||
ghc: 8.6.5
|
ghc: 8.6.5
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
ghc: 8.8.3
|
ghc: 8.8.3
|
||||||
|
|||||||
173
.github/workflows/build-binary-packages.yml
vendored
Normal file
173
.github/workflows/build-binary-packages.yml
vendored
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
name: Build Binary Packages
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
release:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
# ---
|
||||||
|
|
||||||
|
ubuntu:
|
||||||
|
name: Build Ubuntu package
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
# env:
|
||||||
|
# LC_ALL: C.UTF-8
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Install build tools
|
||||||
|
run: |
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y \
|
||||||
|
make \
|
||||||
|
dpkg-dev \
|
||||||
|
debhelper \
|
||||||
|
haskell-platform \
|
||||||
|
libghc-json-dev \
|
||||||
|
python-dev \
|
||||||
|
default-jdk \
|
||||||
|
libtool-bin
|
||||||
|
|
||||||
|
- name: Build Debian package
|
||||||
|
run: |
|
||||||
|
make deb
|
||||||
|
|
||||||
|
- name: Copy package
|
||||||
|
run: |
|
||||||
|
cp ../gf_*.deb dist/
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: gf-${{ github.sha }}-ubuntu
|
||||||
|
path: dist/gf_*.deb
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
# ---
|
||||||
|
|
||||||
|
macos:
|
||||||
|
name: Build macOS package
|
||||||
|
runs-on: macos-10.15
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
ghc: ["8.6.5"]
|
||||||
|
cabal: ["2.4"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup Haskell
|
||||||
|
uses: actions/setup-haskell@v1
|
||||||
|
id: setup-haskell-cabal
|
||||||
|
with:
|
||||||
|
ghc-version: ${{ matrix.ghc }}
|
||||||
|
cabal-version: ${{ matrix.cabal }}
|
||||||
|
|
||||||
|
- name: Install build tools
|
||||||
|
run: |
|
||||||
|
brew install \
|
||||||
|
automake
|
||||||
|
cabal v1-install alex happy
|
||||||
|
|
||||||
|
- name: Build macOS package
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p /Library/Java/Home
|
||||||
|
sudo ln -s /usr/local/opt/openjdk/include /Library/Java/Home/include
|
||||||
|
make pkg
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: gf-${{ github.sha }}-macos
|
||||||
|
path: dist/gf-*.pkg
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
# ---
|
||||||
|
|
||||||
|
windows:
|
||||||
|
name: Build Windows package
|
||||||
|
runs-on: windows-2019
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
ghc: ["8.6.5"]
|
||||||
|
cabal: ["2.4"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup MSYS2
|
||||||
|
uses: msys2/setup-msys2@v2
|
||||||
|
with:
|
||||||
|
install: >-
|
||||||
|
base-devel
|
||||||
|
gcc
|
||||||
|
python-devel
|
||||||
|
|
||||||
|
- name: Prepare dist folder
|
||||||
|
shell: msys2 {0}
|
||||||
|
run: |
|
||||||
|
mkdir /c/tmp-dist
|
||||||
|
mkdir /c/tmp-dist/c
|
||||||
|
mkdir /c/tmp-dist/java
|
||||||
|
mkdir /c/tmp-dist/python
|
||||||
|
|
||||||
|
- name: Build C runtime
|
||||||
|
shell: msys2 {0}
|
||||||
|
run: |
|
||||||
|
cd src/runtime/c
|
||||||
|
autoreconf -i
|
||||||
|
./configure
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
cp /mingw64/bin/libpgf-0.dll /c/tmp-dist/c
|
||||||
|
cp /mingw64/bin/libgu-0.dll /c/tmp-dist/c
|
||||||
|
|
||||||
|
- name: Build Java bindings
|
||||||
|
shell: msys2 {0}
|
||||||
|
run: |
|
||||||
|
export PATH="${PATH}:/c/Program Files/Java/jdk8u275-b01/bin"
|
||||||
|
cd src/runtime/java
|
||||||
|
make \
|
||||||
|
JNI_INCLUDES="-I \"/c/Program Files/Java/jdk8u275-b01/include\" -I \"/c/Program Files/Java/jdk8u275-b01/include/win32\" -I \"/mingw64/include\" -D__int64=int64_t" \
|
||||||
|
WINDOWS_LDFLAGS="-L\"/mingw64/lib\" -no-undefined"
|
||||||
|
make install
|
||||||
|
cp .libs//msys-jpgf-0.dll /c/tmp-dist/java/jpgf.dll
|
||||||
|
cp jpgf.jar /c/tmp-dist/java
|
||||||
|
|
||||||
|
- name: Build Python bindings
|
||||||
|
shell: msys2 {0}
|
||||||
|
env:
|
||||||
|
EXTRA_INCLUDE_DIRS: /mingw64/include
|
||||||
|
EXTRA_LIB_DIRS: /mingw64/lib
|
||||||
|
run: |
|
||||||
|
cd src/runtime/python
|
||||||
|
python setup.py build
|
||||||
|
python setup.py install
|
||||||
|
cp /usr/lib/python3.8/site-packages/pgf* /c/tmp-dist/python
|
||||||
|
|
||||||
|
- name: Setup Haskell
|
||||||
|
uses: actions/setup-haskell@v1
|
||||||
|
id: setup-haskell-cabal
|
||||||
|
with:
|
||||||
|
ghc-version: ${{ matrix.ghc }}
|
||||||
|
cabal-version: ${{ matrix.cabal }}
|
||||||
|
|
||||||
|
- name: Install Haskell build tools
|
||||||
|
run: |
|
||||||
|
cabal install alex happy
|
||||||
|
|
||||||
|
- name: Build GF
|
||||||
|
run: |
|
||||||
|
cabal install --only-dependencies -fserver
|
||||||
|
cabal configure -fserver
|
||||||
|
cabal build
|
||||||
|
copy dist\build\gf\gf.exe C:\tmp-dist
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: gf-${{ github.sha }}-windows
|
||||||
|
path: C:\tmp-dist\*
|
||||||
|
if-no-files-found: error
|
||||||
49
.github/workflows/build-debian-package.yml
vendored
49
.github/workflows/build-debian-package.yml
vendored
@@ -1,49 +0,0 @@
|
|||||||
name: Build Debian Package
|
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build on ${{ matrix.os }}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: true
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-18.04]
|
|
||||||
env:
|
|
||||||
LC_ALL: C.UTF-8
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v1
|
|
||||||
|
|
||||||
- name: Install build tools
|
|
||||||
run: |
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y \
|
|
||||||
make \
|
|
||||||
dpkg-dev \
|
|
||||||
debhelper \
|
|
||||||
haskell-platform \
|
|
||||||
libghc-json-dev \
|
|
||||||
python-dev \
|
|
||||||
default-jdk \
|
|
||||||
libtool-bin \
|
|
||||||
txt2tags \
|
|
||||||
pandoc
|
|
||||||
|
|
||||||
- name: Checkout RGL
|
|
||||||
run: |
|
|
||||||
git clone --depth 1 https://github.com/GrammaticalFramework/gf-rgl.git ../gf-rgl
|
|
||||||
|
|
||||||
- name: Build Debian package
|
|
||||||
run: |
|
|
||||||
make deb
|
|
||||||
|
|
||||||
- name: Copy packages
|
|
||||||
run: |
|
|
||||||
mkdir debian/dist
|
|
||||||
cp ../gf_*.deb debian/dist/
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
|
||||||
with:
|
|
||||||
path: debian/dist
|
|
||||||
8
.github/workflows/build-python-package.yml
vendored
8
.github/workflows/build-python-package.yml
vendored
@@ -1,6 +1,10 @@
|
|||||||
name: Build & Publish Python Package
|
name: Build & Publish Python Package
|
||||||
|
|
||||||
on: [push, pull_request]
|
# Trigger the workflow on push or pull request, but only for the master branch
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches: [master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_wheels:
|
build_wheels:
|
||||||
@@ -9,7 +13,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04, macos-latest]
|
os: [ubuntu-18.04, macos-10.15]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|||||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -5,6 +5,12 @@
|
|||||||
*.jar
|
*.jar
|
||||||
*.gfo
|
*.gfo
|
||||||
*.pgf
|
*.pgf
|
||||||
|
debian/.debhelper
|
||||||
|
debian/debhelper-build-stamp
|
||||||
|
debian/gf
|
||||||
|
debian/gf.debhelper.log
|
||||||
|
debian/gf.substvars
|
||||||
|
debian/files
|
||||||
dist/
|
dist/
|
||||||
dist-newstyle/
|
dist-newstyle/
|
||||||
src/runtime/c/.libs/
|
src/runtime/c/.libs/
|
||||||
|
|||||||
55
RELEASE.md
55
RELEASE.md
@@ -1,6 +1,8 @@
|
|||||||
# GF Core releases
|
# GF Core releases
|
||||||
|
|
||||||
🚨 WARNING! The information here is preliminary!
|
**Note:**
|
||||||
|
The RGL is now released completely separately from GF Core.
|
||||||
|
See the [RGL's RELEASE.md](https://github.com/GrammaticalFramework/gf-rgl/blob/master/RELEASE.md).
|
||||||
|
|
||||||
## Creating a new release
|
## Creating a new release
|
||||||
|
|
||||||
@@ -9,39 +11,54 @@
|
|||||||
**Web pages**
|
**Web pages**
|
||||||
|
|
||||||
1. Create `download/index-X.Y.md` with installation instructions.
|
1. Create `download/index-X.Y.md` with installation instructions.
|
||||||
1. Create `download/release-X.Y.md` with changelog information.
|
2. Create `download/release-X.Y.md` with changelog information.
|
||||||
1. Update `download/index.html` to redirect to the new version.
|
3. Update `download/index.html` to redirect to the new version.
|
||||||
1. Add announcement in news section in `index.html`
|
4. Add announcement in news section in `index.html`.
|
||||||
|
|
||||||
**Version numbers**
|
**Version numbers**
|
||||||
|
|
||||||
1. Update version number in `gf.cabal` (ommitting `-git` suffix)
|
1. Update version number in `gf.cabal` (ommitting `-git` suffix).
|
||||||
1. Add a new line in `debian/changelog`
|
2. Add a new line in `debian/changelog`.
|
||||||
|
|
||||||
### 2. Create GitHub release
|
### 2. Create GitHub release
|
||||||
|
|
||||||
1. When the above changes are committed to the `master` branch in the repository,
|
1. When the above changes are committed to the `master` branch in the repository
|
||||||
check that all builds are successful:
|
and pushed, check that all CI workflows are successful (fixing as necessary):
|
||||||
- https://github.com/GrammaticalFramework/gf-core/actions
|
- <https://github.com/GrammaticalFramework/gf-core/actions>
|
||||||
- https://travis-ci.org/github/GrammaticalFramework/gf-core
|
- <https://travis-ci.org/github/GrammaticalFramework/gf-core>
|
||||||
1. Create a GitHub release here: https://github.com/GrammaticalFramework/gf-core/releases/new
|
2. Create a GitHub release [here](https://github.com/GrammaticalFramework/gf-core/releases/new):
|
||||||
with a tag format `RELEASE-X.Y`
|
- Tag version format `RELEASE-X.Y`
|
||||||
|
- Title: "GF X.Y"
|
||||||
|
- Description: mention major changes since last release
|
||||||
|
3. Publish the release to trigger the building of the binary packages (below).
|
||||||
|
|
||||||
### 3. Binary packages
|
### 3. Binary packages
|
||||||
|
|
||||||
Build and attach binaries to the release by running the relevant GitHub Actions workflows (TODO):
|
The binaries will be built automatically by GitHub Actions when the release is created,
|
||||||
|
but the generated _artifacts_ must be manually attached to the release as _assets_.
|
||||||
|
|
||||||
1. Go to https://github.com/GrammaticalFramework/gf-rgl/actions
|
1. Go to the [actions page](https://github.com/GrammaticalFramework/gf-core/actions) and click "Build Binary Packages" under _Workflows_.
|
||||||
1. Click "Build [platform] package" under _Workflows_
|
2. Choose the workflow run corresponding to the newly created release.
|
||||||
1. Click "Run workflow" and specify the tag `RELEASE-X.Y`
|
3. Download the artifacts locally. Extract the Ubuntu and macOS ones to get the `.deb` and `.pkg` files.
|
||||||
|
4. Go back to the [releases page](https://github.com/GrammaticalFramework/gf-core/releases) and click to edit the release information.
|
||||||
|
5. Add the downloaded artifacts as release assets, giving them names with format `gf-X.Y-PLATFORM.EXT` (e.g. `gf-3.11-macos.pkg`).
|
||||||
|
|
||||||
### 4. Upload to Hackage
|
### 4. Upload to Hackage
|
||||||
|
|
||||||
1. Run `make sdist`
|
1. Run `make sdist`
|
||||||
1. Visit `https://hackage.haskell.org/upload` and upload the file `dist/gf-X.Y.tar.gz`,
|
2. Upload the package, either:
|
||||||
OR upload directly with Cabal (≥2.4): `cabal upload dist/gf-X.Y.tar.gz`
|
1. **Manually**: visit <https://hackage.haskell.org/upload> and upload the file `dist/gf-X.Y.tar.gz`
|
||||||
1. If the documentation-building fails on the Hackage server, do:
|
2. **via Cabal (≥2.4)**: `cabal upload dist/gf-X.Y.tar.gz`
|
||||||
|
3. If the documentation-building fails on the Hackage server, do:
|
||||||
```
|
```
|
||||||
cabal v2-haddock --builddir=dist/docs --haddock-for-hackage --enable-doc
|
cabal v2-haddock --builddir=dist/docs --haddock-for-hackage --enable-doc
|
||||||
cabal upload --documentation dist/docs/*-docs.tar.gz
|
cabal upload --documentation dist/docs/*-docs.tar.gz
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Miscellaneous
|
||||||
|
|
||||||
|
### What is the tag `GF-3.10`?
|
||||||
|
|
||||||
|
For GF 3.10, the Core and RGL repositories had already been separated, however
|
||||||
|
the binary packages still included the RGL. `GF-3.10` is a tag that was created
|
||||||
|
in both repositories ([gf-core](https://github.com/GrammaticalFramework/gf-core/releases/tag/GF-3.10) and [gf-rgl](https://github.com/GrammaticalFramework/gf-rgl/releases/tag/GF-3.10)) to indicate which versions of each went into the binaries.
|
||||||
|
|||||||
@@ -1,15 +1,18 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
### This script builds a binary distribution of GF from the source
|
### This script builds a binary distribution of GF from source.
|
||||||
### package that this script is a part of. It assumes that you have installed
|
### It assumes that you have Haskell and Cabal installed.
|
||||||
### a recent version of the Haskell Platform.
|
### Two binary package formats are supported (specified with the FMT env var):
|
||||||
### Two binary package formats are supported: plain tar files (.tar.gz) and
|
### - plain tar files (.tar.gz)
|
||||||
### OS X Installer packages (.pkg).
|
### - macOS installer packages (.pkg)
|
||||||
|
|
||||||
os=$(uname) # Operating system name (e.g. Darwin or Linux)
|
os=$(uname) # Operating system name (e.g. Darwin or Linux)
|
||||||
hw=$(uname -m) # Hardware name (e.g. i686 or x86_64)
|
hw=$(uname -m) # Hardware name (e.g. i686 or x86_64)
|
||||||
|
|
||||||
# GF version number:
|
cabal="cabal v1-" # Cabal >= 2.4
|
||||||
|
# cabal="cabal " # Cabal <= 2.2
|
||||||
|
|
||||||
|
## Get GF version number from Cabal file
|
||||||
ver=$(grep -i ^version: gf.cabal | sed -e 's/version://' -e 's/ //g')
|
ver=$(grep -i ^version: gf.cabal | sed -e 's/version://' -e 's/ //g')
|
||||||
|
|
||||||
name="gf-$ver"
|
name="gf-$ver"
|
||||||
@@ -29,6 +32,7 @@ set -x # print commands before executing them
|
|||||||
pushd src/runtime/c
|
pushd src/runtime/c
|
||||||
bash setup.sh configure --prefix="$prefix"
|
bash setup.sh configure --prefix="$prefix"
|
||||||
bash setup.sh build
|
bash setup.sh build
|
||||||
|
bash setup.sh install prefix="$prefix" # hack required for GF build on macOS
|
||||||
bash setup.sh install prefix="$destdir$prefix"
|
bash setup.sh install prefix="$destdir$prefix"
|
||||||
popd
|
popd
|
||||||
|
|
||||||
@@ -38,11 +42,11 @@ if which >/dev/null python; then
|
|||||||
EXTRA_INCLUDE_DIRS="$extrainclude" EXTRA_LIB_DIRS="$extralib" python setup.py build
|
EXTRA_INCLUDE_DIRS="$extrainclude" EXTRA_LIB_DIRS="$extralib" python setup.py build
|
||||||
python setup.py install --prefix="$destdir$prefix"
|
python setup.py install --prefix="$destdir$prefix"
|
||||||
if [ "$fmt" == pkg ] ; then
|
if [ "$fmt" == pkg ] ; then
|
||||||
# A hack for Python on OS X to find the PGF modules
|
# A hack for Python on macOS to find the PGF modules
|
||||||
pyver=$(ls "$destdir$prefix/lib" | sed -n 's/^python//p')
|
pyver=$(ls "$destdir$prefix/lib" | sed -n 's/^python//p')
|
||||||
pydest="$destdir/Library/Python/$pyver/site-packages"
|
pydest="$destdir/Library/Python/$pyver/site-packages"
|
||||||
mkdir -p "$pydest"
|
mkdir -p "$pydest"
|
||||||
ln "$destdir$prefix/lib/python$pyver/site-packages"/pgf* "$pydest"
|
ln "$destdir$prefix/lib/python$pyver/site-packages"/pgf* "$pydest"
|
||||||
fi
|
fi
|
||||||
popd
|
popd
|
||||||
else
|
else
|
||||||
@@ -55,54 +59,40 @@ if which >/dev/null javac && which >/dev/null jar ; then
|
|||||||
rm -f libjpgf.la # In case it contains the wrong INSTALL_PATH
|
rm -f libjpgf.la # In case it contains the wrong INSTALL_PATH
|
||||||
if make CFLAGS="-I$extrainclude -L$extralib" INSTALL_PATH="$prefix"
|
if make CFLAGS="-I$extrainclude -L$extralib" INSTALL_PATH="$prefix"
|
||||||
then
|
then
|
||||||
make INSTALL_PATH="$destdir$prefix" install
|
make INSTALL_PATH="$destdir$prefix" install
|
||||||
else
|
else
|
||||||
echo "*** Skipping the Java binding because of errors"
|
echo "Skipping the Java binding because of errors"
|
||||||
fi
|
fi
|
||||||
popd
|
popd
|
||||||
else
|
else
|
||||||
echo "Java SDK is not installed, so the Java binding will not be included"
|
echo "Java SDK is not installed, so the Java binding will not be included"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## To find dynamic C run-time libraries when running GF below
|
## To find dynamic C run-time libraries when building GF below
|
||||||
export DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib"
|
export DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib"
|
||||||
|
|
||||||
|
|
||||||
## Build GF, with C run-time support enabled
|
## Build GF, with C run-time support enabled
|
||||||
cabal install -w "$ghc" --only-dependencies -fserver -fc-runtime $extra
|
${cabal}install -w "$ghc" --only-dependencies -fserver -fc-runtime $extra
|
||||||
cabal configure -w "$ghc" --prefix="$prefix" -fserver -fc-runtime $extra
|
${cabal}configure -w "$ghc" --prefix="$prefix" -fserver -fc-runtime $extra
|
||||||
cabal build
|
${cabal}build
|
||||||
# Building the example grammars will fail, because the RGL is missing
|
|
||||||
cabal copy --destdir="$destdir" # create www directory
|
|
||||||
|
|
||||||
## Build the RGL and copy it to $destdir
|
|
||||||
PATH=$PWD/dist/build/gf:$PATH
|
|
||||||
export GF_LIB_PATH="$(dirname $(find "$destdir" -name www))/lib" # hmm
|
|
||||||
mkdir -p "$GF_LIB_PATH"
|
|
||||||
pushd ../gf-rgl
|
|
||||||
make build
|
|
||||||
make copy
|
|
||||||
popd
|
|
||||||
|
|
||||||
# Build GF again, including example grammars that need the RGL
|
|
||||||
cabal build
|
|
||||||
|
|
||||||
## Copy GF to $destdir
|
## Copy GF to $destdir
|
||||||
cabal copy --destdir="$destdir"
|
${cabal}copy --destdir="$destdir"
|
||||||
libdir=$(dirname $(find "$destdir" -name PGF.hi))
|
libdir=$(dirname $(find "$destdir" -name PGF.hi))
|
||||||
cabal register --gen-pkg-config=$libdir/gf-$ver.conf
|
${cabal}register --gen-pkg-config="$libdir/gf-$ver.conf"
|
||||||
|
|
||||||
## Create the binary distribution package
|
## Create the binary distribution package
|
||||||
case $fmt in
|
case $fmt in
|
||||||
tar.gz)
|
tar.gz)
|
||||||
targz="$name-bin-$hw-$os.tar.gz" # the final tar file
|
targz="$name-bin-$hw-$os.tar.gz" # the final tar file
|
||||||
tar -C "$destdir/$prefix" -zcf "dist/$targz" .
|
tar --directory "$destdir/$prefix" --gzip --create --file "dist/$targz" .
|
||||||
echo "Created $targz, consider renaming it to something more user friendly"
|
echo "Created $targz"
|
||||||
;;
|
;;
|
||||||
pkg)
|
pkg)
|
||||||
pkg=$name.pkg
|
pkg=$name.pkg
|
||||||
pkgbuild --identifier org.grammaticalframework.gf.pkg --version "$ver" --root "$destdir" --install-location / dist/$pkg
|
pkgbuild --identifier org.grammaticalframework.gf.pkg --version "$ver" --root "$destdir" --install-location / dist/$pkg
|
||||||
echo "Created $pkg"
|
echo "Created $pkg"
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
## Cleanup
|
||||||
rm -r "$destdir"
|
rm -r "$destdir"
|
||||||
|
|||||||
2
debian/control
vendored
2
debian/control
vendored
@@ -3,7 +3,7 @@ Section: devel
|
|||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Thomas Hallgren <hallgren@chalmers.se>
|
Maintainer: Thomas Hallgren <hallgren@chalmers.se>
|
||||||
Standards-Version: 3.9.2
|
Standards-Version: 3.9.2
|
||||||
Build-Depends: debhelper (>= 5), haskell-platform (>= 2011.2.0.1), libghc-haskeline-dev, libghc-mtl-dev, libghc-json-dev, autoconf, automake, libtool-bin, python-dev, java-sdk, txt2tags, pandoc
|
Build-Depends: debhelper (>= 5), haskell-platform (>= 2011.2.0.1), libghc-haskeline-dev, libghc-mtl-dev, libghc-json-dev, autoconf, automake, libtool-bin, python-dev, java-sdk
|
||||||
Homepage: http://www.grammaticalframework.org/
|
Homepage: http://www.grammaticalframework.org/
|
||||||
|
|
||||||
Package: gf
|
Package: gf
|
||||||
|
|||||||
8
debian/rules
vendored
8
debian/rules
vendored
@@ -26,14 +26,10 @@ override_dh_auto_build:
|
|||||||
cd src/runtime/python && EXTRA_INCLUDE_DIRS=$(CURDIR)/src/runtime/c EXTRA_LIB_DIRS=$(CURDIR)/src/runtime/c/.libs python setup.py build
|
cd src/runtime/python && EXTRA_INCLUDE_DIRS=$(CURDIR)/src/runtime/c EXTRA_LIB_DIRS=$(CURDIR)/src/runtime/c/.libs python setup.py build
|
||||||
cd src/runtime/java && make CFLAGS="-I$(CURDIR)/src/runtime/c -L$(CURDIR)/src/runtime/c/.libs" INSTALL_PATH=/usr
|
cd src/runtime/java && make CFLAGS="-I$(CURDIR)/src/runtime/c -L$(CURDIR)/src/runtime/c/.libs" INSTALL_PATH=/usr
|
||||||
echo $(SET_LDL)
|
echo $(SET_LDL)
|
||||||
-$(SET_LDL) cabal build # builds gf, fails to build example grammars
|
-$(SET_LDL) cabal build
|
||||||
export $(SET_LDL); PATH=$(CURDIR)/dist/build/gf:$$PATH && make -C ../gf-rgl build
|
|
||||||
GF_LIB_PATH=$(CURDIR)/../gf-rgl/dist $(SET_LDL) cabal build # have RGL now, ok to build example grammars
|
|
||||||
make html
|
|
||||||
|
|
||||||
override_dh_auto_install:
|
override_dh_auto_install:
|
||||||
$(SET_LDL) cabal copy --destdir=$(CURDIR)/debian/gf # creates www directory
|
$(SET_LDL) cabal copy --destdir=$(CURDIR)/debian/gf
|
||||||
export GF_LIB_PATH="$$(dirname $$(find "$(CURDIR)/debian/gf" -name www))/lib" && echo "GF_LIB_PATH=$$GF_LIB_PATH" && mkdir -p "$$GF_LIB_PATH" && make -C ../gf-rgl copy
|
|
||||||
cd src/runtime/c && bash setup.sh copy prefix=$(CURDIR)/debian/gf/usr
|
cd src/runtime/c && bash setup.sh copy prefix=$(CURDIR)/debian/gf/usr
|
||||||
cd src/runtime/python && python setup.py install --prefix=$(CURDIR)/debian/gf/usr
|
cd src/runtime/python && python setup.py install --prefix=$(CURDIR)/debian/gf/usr
|
||||||
cd src/runtime/java && make INSTALL_PATH=$(CURDIR)/debian/gf/usr install
|
cd src/runtime/java && make INSTALL_PATH=$(CURDIR)/debian/gf/usr install
|
||||||
|
|||||||
@@ -2,56 +2,60 @@
|
|||||||
title: Grammatical Framework Download and Installation
|
title: Grammatical Framework Download and Installation
|
||||||
...
|
...
|
||||||
|
|
||||||
**GF 3.11** was released on ? December 2020.
|
**GF 3.11** was released on ... December 2020.
|
||||||
|
|
||||||
What's new? See the [release notes](release-3.11.html).
|
What's new? See the [release notes](release-3.11.html).
|
||||||
|
|
||||||
## Binary packages
|
#### Note: GF core and RGL
|
||||||
|
|
||||||
Unlike previous versions, these binary packages include only the GF core (compiler and runtime).
|
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.
|
||||||
|
|
||||||
| Platform | Download | Features | How to install |
|
## Installing from a binary package
|
||||||
|:----------------|:---------------------------------------------------|:---------------|:---------------------------------|
|
|
||||||
| macOS | [gf-3.11.pkg](gf-3.11.pkg) | GF, S, C, J, P | Double-click on the package icon |
|
|
||||||
| Ubuntu (32-bit) | [gf\_3.11\_i386.deb](gf_3.11_i386.deb) | GF, S, C, J, P | `sudo dpkg -i gf_3.11_i386.deb` |
|
|
||||||
| Ubuntu (64-bit) | [gf\_3.11\_amd64.deb](gf_3.11_amd64.deb) | GF, S, C, J, P | `sudo dpkg -i gf_3.11_amd64.deb` |
|
|
||||||
| Windows | [gf-3.11-bin-windows.zip](gf-3.11-bin-windows.zip) | GF, S | `unzip gf-3.11-bin-windows.zip` |
|
|
||||||
|
|
||||||
**Features**
|
Binary packages are available for Debian/Ubuntu, macOS, and Windows and include:
|
||||||
|
|
||||||
- GF = GF shell and grammar compiler
|
- GF shell and grammar compiler
|
||||||
- S = `gf -server` mode
|
- `gf -server` mode
|
||||||
- C = C run-time system
|
- C run-time system
|
||||||
- J/P = Java/Python binding to the C run-time system
|
- Java & Python bindings to the C run-time system
|
||||||
|
|
||||||
### Notes
|
Unlike in previous versions, the binaries **do not** include the RGL.
|
||||||
|
|
||||||
The Windows package is installed by just unpacking it anywhere. You will
|
[Binary packages on GitHub](https://github.com/GrammaticalFramework/gf-core/releases/tag/RELEASE-3.11)
|
||||||
probably need to set the `PATH` and `GF_LIB_PATH` environment variables,
|
|
||||||
see Inari's notes on [Installing GF on Windows](http://www.grammaticalframework.org/~inari/gf-windows.html#toc3).
|
|
||||||
|
|
||||||
The Ubuntu `.deb` packages should work on Ubuntu 16.04 and 18.04 and
|
### Debian/Ubuntu
|
||||||
similar Linux distributions. The `.deb` packages were updated
|
|
||||||
to version 3.10-2 after the release of GF 3.10.
|
|
||||||
(Because of a packaging bug the Resource Grammar Library was missing
|
|
||||||
in the 3.10-1 packages.)
|
|
||||||
|
|
||||||
The packages for macOS (Mac OS X) should work on at least 10.13 and
|
To install the package use:
|
||||||
10.14 (High Sierra and Mojave)
|
```
|
||||||
|
sudo dpkg -i gf_3.11.deb
|
||||||
|
```
|
||||||
|
|
||||||
|
The Ubuntu `.deb` packages should work on Ubuntu 16.04, 18.04 and similar Linux distributions.
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
To install the package, just double-click it and follow the installer instructions.
|
||||||
|
|
||||||
|
The packages should work on at least 10.13 (High Sierra) and 10.14 (Mojave).
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
To install the package, unpack it anywhere.
|
||||||
|
|
||||||
|
You will probably need to update the `PATH` environment variable to include your chosen install location.
|
||||||
|
<!-- see Inari's notes on [Installing GF on Windows](http://www.grammaticalframework.org/~inari/gf-windows.html#toc3). -->
|
||||||
|
|
||||||
## Installing the latest release from source
|
## Installing the latest release from source
|
||||||
|
|
||||||
[GF is on Hackage](http://hackage.haskell.org/package/gf), so under
|
[GF is on Hackage](http://hackage.haskell.org/package/gf), so under
|
||||||
normal circumstances the procedure is fairly simple:
|
normal circumstances the procedure is fairly simple:
|
||||||
|
|
||||||
1. Install a recent version of the [Haskell
|
1. Install a recent version of the [Haskell Platform](http://hackage.haskell.org/platform) (see note below)
|
||||||
Platform](http://hackage.haskell.org/platform) (see note below)
|
|
||||||
2. `cabal update`
|
2. `cabal update`
|
||||||
3. On Linux: install some C libraries from your Linux distribution (see note below)
|
3. On Linux: install some C libraries from your Linux distribution (see note below)
|
||||||
4. `cabal install gf`
|
4. `cabal install gf`
|
||||||
|
|
||||||
This installs the GF executable and Haskell libraries, but **does not include the RGL**.
|
|
||||||
|
|
||||||
You can also download the source code release from [GitHub](https://github.com/GrammaticalFramework/gf-core/releases),
|
You can also download the source code release from [GitHub](https://github.com/GrammaticalFramework/gf-core/releases),
|
||||||
and follow the instructions below under **Installing from the latest developer source code**.
|
and follow the instructions below under **Installing from the latest developer source code**.
|
||||||
|
|
||||||
@@ -59,22 +63,14 @@ and follow the instructions below under **Installing from the latest developer s
|
|||||||
|
|
||||||
**Installation location**
|
**Installation location**
|
||||||
|
|
||||||
The above steps installs GF for a single user. The executables are put
|
The above steps installs GF for a single user.
|
||||||
in `$HOME/.cabal/bin` (or, with recent versions of the Haskell platform
|
The executables are put in `$HOME/.cabal/bin` (or on macOS in `$HOME/Library/Haskell/bin`),
|
||||||
on Mac OS X, in `$HOME/Library/Haskell/bin`), so it is a good idea to
|
so you might want to add this directory to your path (in `.bash_profile` or similar):
|
||||||
put a line in your `.bash_profile` or `.profile` to add that directory
|
|
||||||
to you path:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
PATH=$HOME/.cabal/bin:$PATH
|
PATH=$HOME/.cabal/bin:$PATH
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```
|
|
||||||
PATH=$HOME/Library/Haskell/bin:$PATH
|
|
||||||
```
|
|
||||||
|
|
||||||
**Build tools**
|
**Build tools**
|
||||||
|
|
||||||
In order to compile GF you need the build tools **Alex** and **Happy**.
|
In order to compile GF you need the build tools **Alex** and **Happy**.
|
||||||
@@ -98,8 +94,7 @@ Here is one way to do this:
|
|||||||
|
|
||||||
**GHC version**
|
**GHC version**
|
||||||
|
|
||||||
The GF source code has been updated to compile with GHC 8.4.
|
The GF source code has been updated to compile with GHC versions 7.10 through to 8.8.
|
||||||
Using older versions of GHC (e.g. 8.2, 8.0 and 7.10) should still work too.
|
|
||||||
|
|
||||||
## Installing from the latest developer source code
|
## Installing from the latest developer source code
|
||||||
|
|
||||||
@@ -131,26 +126,6 @@ The above notes for installing from source apply also in these cases.
|
|||||||
For more info on working with the GF source code, see the
|
For more info on working with the GF source code, see the
|
||||||
[GF Developers Guide](../doc/gf-developers.html).
|
[GF Developers Guide](../doc/gf-developers.html).
|
||||||
|
|
||||||
## Installing the RGL from source
|
|
||||||
|
|
||||||
To install the RGL from source,
|
|
||||||
you can download a release from [GitHub](https://github.com/GrammaticalFramework/gf-rgl/releases)
|
|
||||||
or get the latest version by cloning the repository:
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://github.com/GrammaticalFramework/gf-rgl.git
|
|
||||||
```
|
|
||||||
|
|
||||||
In both cases, once you have the RGL sources you can install them by running:
|
|
||||||
|
|
||||||
```
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
in the RGL folder.
|
|
||||||
This assumes that you already have GF installed.
|
|
||||||
For more details about building the RGL, see the [RGL README](https://github.com/GrammaticalFramework/gf-rgl/blob/master/README.md).
|
|
||||||
|
|
||||||
## Installing the Python bindings from PyPI
|
## Installing the Python bindings from PyPI
|
||||||
|
|
||||||
The Python library is available on PyPI as `pgf`, so it can be installed using:
|
The Python library is available on PyPI as `pgf`, so it can be installed using:
|
||||||
@@ -159,11 +134,33 @@ The Python library is available on PyPI as `pgf`, so it can be installed using:
|
|||||||
pip install pgf
|
pip install pgf
|
||||||
```
|
```
|
||||||
|
|
||||||
We provide binary wheels for Linux and OSX (with Windows missing so far), which
|
We provide binary wheels for Linux and macOS, which include the C runtime and are ready-to-go.
|
||||||
include the C runtime and a ready-to-go. If there is no binary distribution for
|
If there is no binary distribution for your platform, this will install the source tarball,
|
||||||
your platform, this will install the source tarball, which will attempt to build
|
which will attempt to build the binding during installation,
|
||||||
the binding during installation, and requires the GF C runtime to be installed on
|
and requires the GF C runtime to be installed on your system.
|
||||||
your system.
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Installing the RGL from a binary release
|
||||||
|
|
||||||
|
Binary releases of the RGL are made available on [GitHub](https://github.com/GrammaticalFramework/gf-rgl/releases).
|
||||||
|
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.
|
||||||
|
|
||||||
|
## Installing the RGL from source
|
||||||
|
|
||||||
|
To compile the RGL, you will need to have GF already installed and in your path.
|
||||||
|
|
||||||
|
1. Obtain the RGL source code, either by:
|
||||||
|
- cloning with `git clone https://github.com/GrammaticalFramework/gf-rgl.git`
|
||||||
|
- downloading a source archive [here](https://github.com/GrammaticalFramework/gf-rgl/archive/master.zip)
|
||||||
|
2. Run `make` in the source code folder.
|
||||||
|
|
||||||
|
For more options, see the [RGL README](https://github.com/GrammaticalFramework/gf-rgl/blob/master/README.md).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Older releases
|
## Older releases
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user