From 399974ebfb606d0ff7db03c248b605b8a94fb9f4 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Mon, 9 Nov 2020 13:55:53 +0100 Subject: Fix whitespace in binary build script --- bin/build-binary-dist.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'bin') diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh index 7f6ca5d72..8714c8dda 100755 --- a/bin/build-binary-dist.sh +++ b/bin/build-binary-dist.sh @@ -38,11 +38,11 @@ if which >/dev/null python; then EXTRA_INCLUDE_DIRS="$extrainclude" EXTRA_LIB_DIRS="$extralib" python setup.py build python setup.py install --prefix="$destdir$prefix" if [ "$fmt" == pkg ] ; then - # A hack for Python on OS X to find the PGF modules - pyver=$(ls "$destdir$prefix/lib" | sed -n 's/^python//p') - pydest="$destdir/Library/Python/$pyver/site-packages" - mkdir -p "$pydest" - ln "$destdir$prefix/lib/python$pyver/site-packages"/pgf* "$pydest" + # A hack for Python on OS X to find the PGF modules + pyver=$(ls "$destdir$prefix/lib" | sed -n 's/^python//p') + pydest="$destdir/Library/Python/$pyver/site-packages" + mkdir -p "$pydest" + ln "$destdir$prefix/lib/python$pyver/site-packages"/pgf* "$pydest" fi popd else @@ -55,9 +55,9 @@ if which >/dev/null javac && which >/dev/null jar ; then rm -f libjpgf.la # In case it contains the wrong INSTALL_PATH if make CFLAGS="-I$extrainclude -L$extralib" INSTALL_PATH="$prefix" then - make INSTALL_PATH="$destdir$prefix" install + make INSTALL_PATH="$destdir$prefix" install else - echo "*** Skipping the Java binding because of errors" + echo "*** Skipping the Java binding because of errors" fi popd else @@ -95,14 +95,14 @@ cabal register --gen-pkg-config=$libdir/gf-$ver.conf ## Create the binary distribution package case $fmt in tar.gz) - targz="$name-bin-$hw-$os.tar.gz" # the final tar file - tar -C "$destdir/$prefix" -zcf "dist/$targz" . - echo "Created $targz, consider renaming it to something more user friendly" - ;; + targz="$name-bin-$hw-$os.tar.gz" # the final tar file + tar -C "$destdir/$prefix" -zcf "dist/$targz" . + echo "Created $targz, consider renaming it to something more user friendly" + ;; pkg) - pkg=$name.pkg - pkgbuild --identifier org.grammaticalframework.gf.pkg --version "$ver" --root "$destdir" --install-location / dist/$pkg - echo "Created $pkg" + pkg=$name.pkg + pkgbuild --identifier org.grammaticalframework.gf.pkg --version "$ver" --root "$destdir" --install-location / dist/$pkg + echo "Created $pkg" esac rm -r "$destdir" -- cgit v1.2.3 From f6eb94c33b8ad2f1b9a7d8cc43147cec222d54a5 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Mon, 9 Nov 2020 21:12:23 +0100 Subject: Try removing something that looks like a typo --- .github/workflows/build-macos-package.yml | 2 -- bin/build-binary-dist.sh | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/.github/workflows/build-macos-package.yml b/.github/workflows/build-macos-package.yml index 0031c8a6c..6d11b8a1c 100644 --- a/.github/workflows/build-macos-package.yml +++ b/.github/workflows/build-macos-package.yml @@ -34,8 +34,6 @@ jobs: - name: Build macOS package run: | make pkg - env: - PREFIX: /Users/runner/work/gf-core/gf-core/dist/gf-3.10.4-git/ - name: Copy packages run: | diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh index 8714c8dda..80b4f0d17 100755 --- a/bin/build-binary-dist.sh +++ b/bin/build-binary-dist.sh @@ -29,7 +29,7 @@ set -x # print commands before executing them pushd src/runtime/c bash setup.sh configure --prefix="$prefix" bash setup.sh build -bash setup.sh install prefix="$destdir$prefix" +bash setup.sh install prefix="$prefix" popd ## Build the python binding to the C run-time system @@ -72,7 +72,7 @@ export DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal install -w "$ghc" --only-dependencies -fserver -fc-runtime $extra cabal configure -w "$ghc" --prefix="$prefix" -fserver -fc-runtime $extra cabal build - # Building the example grammars will fail, because the RGL is missing +# 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 -- cgit v1.2.3 From ed97a42fde223a7613bf6f9fc6ad56c70180c353 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Mon, 9 Nov 2020 21:23:52 +0100 Subject: Try it another way round --- bin/build-binary-dist.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh index 80b4f0d17..2c71cb2ea 100755 --- a/bin/build-binary-dist.sh +++ b/bin/build-binary-dist.sh @@ -29,7 +29,7 @@ set -x # print commands before executing them pushd src/runtime/c bash setup.sh configure --prefix="$prefix" bash setup.sh build -bash setup.sh install prefix="$prefix" +bash setup.sh install prefix="$destdir$prefix" popd ## Build the python binding to the C run-time system @@ -70,7 +70,7 @@ export DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" ## Build GF, with C run-time support enabled 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="$destdir$prefix" -fserver -fc-runtime $extra cabal build # Building the example grammars will fail, because the RGL is missing cabal copy --destdir="$destdir" # create www directory -- cgit v1.2.3 From 9018eabb10233f44b9c3381772cb1f940eaee1c0 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Mon, 9 Nov 2020 21:35:17 +0100 Subject: Add libtool finish command from warning --- bin/build-binary-dist.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'bin') diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh index 2c71cb2ea..f96831910 100755 --- a/bin/build-binary-dist.sh +++ b/bin/build-binary-dist.sh @@ -30,6 +30,7 @@ pushd src/runtime/c bash setup.sh configure --prefix="$prefix" bash setup.sh build bash setup.sh install prefix="$destdir$prefix" +libtool --finish "$prefix/lib" popd ## Build the python binding to the C run-time system -- cgit v1.2.3 From b1b3bc3360c9b10ad6767ba13063f86757ab3162 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Mon, 9 Nov 2020 21:40:55 +0100 Subject: Install C runtime in two places. Use cabal v1-copy. --- bin/build-binary-dist.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh index f96831910..02751f40b 100755 --- a/bin/build-binary-dist.sh +++ b/bin/build-binary-dist.sh @@ -29,8 +29,8 @@ set -x # print commands before executing them pushd src/runtime/c bash setup.sh configure --prefix="$prefix" bash setup.sh build +bash setup.sh install prefix="$prefix" bash setup.sh install prefix="$destdir$prefix" -libtool --finish "$prefix/lib" popd ## Build the python binding to the C run-time system @@ -71,10 +71,10 @@ export DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" ## Build GF, with C run-time support enabled cabal install -w "$ghc" --only-dependencies -fserver -fc-runtime $extra -cabal configure -w "$ghc" --prefix="$destdir$prefix" -fserver -fc-runtime $extra +cabal configure -w "$ghc" --prefix="$prefix" -fserver -fc-runtime $extra cabal build # Building the example grammars will fail, because the RGL is missing -cabal copy --destdir="$destdir" # create www directory +cabal v1-copy --destdir="$destdir" # create www directory ## Build the RGL and copy it to $destdir PATH=$PWD/dist/build/gf:$PATH @@ -89,7 +89,7 @@ popd cabal build ## Copy GF to $destdir -cabal copy --destdir="$destdir" +cabal v1-copy --destdir="$destdir" libdir=$(dirname $(find "$destdir" -name PGF.hi)) cabal register --gen-pkg-config=$libdir/gf-$ver.conf -- cgit v1.2.3 From 359f1509fa70fc572351f425451360b2ec5336bb Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Mon, 9 Nov 2020 21:59:05 +0100 Subject: Blurt out cabal version in both action and build script --- .github/workflows/build-macos-package.yml | 6 +++++- bin/build-binary-dist.sh | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/.github/workflows/build-macos-package.yml b/.github/workflows/build-macos-package.yml index 6d11b8a1c..f4f0e4edb 100644 --- a/.github/workflows/build-macos-package.yml +++ b/.github/workflows/build-macos-package.yml @@ -9,8 +9,8 @@ jobs: strategy: matrix: os: [macOS-latest] - cabal: ["2.4"] ghc: ["8.6.5"] + cabal: ["2.4"] steps: - uses: actions/checkout@v2 @@ -22,6 +22,10 @@ jobs: ghc-version: ${{ matrix.ghc }} cabal-version: ${{ matrix.cabal }} + - name: Check cabal version + run: | + cabal --version + - name: Install build tools run: | brew install \ diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh index 02751f40b..2c03a81a1 100755 --- a/bin/build-binary-dist.sh +++ b/bin/build-binary-dist.sh @@ -25,6 +25,8 @@ extra="--extra-lib-dirs=$extralib --extra-include-dirs=$extrainclude" set -e # Stop if an error occurs set -x # print commands before executing them +cabal --version + ## First configure & build the C run-time system pushd src/runtime/c bash setup.sh configure --prefix="$prefix" @@ -74,7 +76,7 @@ cabal install -w "$ghc" --only-dependencies -fserver -fc-runtime $extra cabal configure -w "$ghc" --prefix="$prefix" -fserver -fc-runtime $extra cabal build # Building the example grammars will fail, because the RGL is missing -cabal v1-copy --destdir="$destdir" # create www directory +cabal copy --destdir="$destdir" # create www directory ## Build the RGL and copy it to $destdir PATH=$PWD/dist/build/gf:$PATH @@ -89,7 +91,7 @@ popd cabal build ## Copy GF to $destdir -cabal v1-copy --destdir="$destdir" +cabal copy --destdir="$destdir" libdir=$(dirname $(find "$destdir" -name PGF.hi)) cabal register --gen-pkg-config=$libdir/gf-$ver.conf -- cgit v1.2.3 From 2dc11524fc9d027307982ae4821c0625074c3c4e Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Mon, 16 Nov 2020 22:42:13 +0100 Subject: Remove RGL from build, use 'cabal v1-' commands --- .github/workflows/build-macos-package.yml | 2 +- bin/build-binary-dist.sh | 56 ++++++++++++------------------- 2 files changed, 23 insertions(+), 35 deletions(-) (limited to 'bin') diff --git a/.github/workflows/build-macos-package.yml b/.github/workflows/build-macos-package.yml index 4331d111a..7ea62f5f2 100644 --- a/.github/workflows/build-macos-package.yml +++ b/.github/workflows/build-macos-package.yml @@ -1,6 +1,6 @@ name: Build macOS Package -on: [push, pull_request] +on: workflow_dispatch jobs: build: diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh index 2c03a81a1..8c08c122b 100755 --- a/bin/build-binary-dist.sh +++ b/bin/build-binary-dist.sh @@ -1,15 +1,18 @@ #! /bin/bash -### This script builds a binary distribution of GF from the source -### package that this script is a part of. It assumes that you have installed -### a recent version of the Haskell Platform. -### Two binary package formats are supported: plain tar files (.tar.gz) and -### OS X Installer packages (.pkg). +### This script builds a binary distribution of GF from source. +### It assumes that you have Haskell and Cabal installed. +### Two binary package formats are supported (specified with the FMT env var): +### - plain tar files (.tar.gz) +### - OS X installer packages (.pkg) os=$(uname) # Operating system name (e.g. Darwin or Linux) 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') name="gf-$ver" @@ -25,14 +28,13 @@ extra="--extra-lib-dirs=$extralib --extra-include-dirs=$extrainclude" set -e # Stop if an error occurs set -x # print commands before executing them -cabal --version - ## First configure & build the C run-time system pushd src/runtime/c bash setup.sh configure --prefix="$prefix" bash setup.sh build -bash setup.sh install prefix="$prefix" -bash setup.sh install prefix="$destdir$prefix" +## Install in two places: +# bash setup.sh install prefix="$prefix" # for GF build to find +bash setup.sh install prefix="$destdir$prefix" # for inclusion in distribution popd ## Build the python binding to the C run-time system @@ -60,47 +62,32 @@ if which >/dev/null javac && which >/dev/null jar ; then then make INSTALL_PATH="$destdir$prefix" install else - echo "*** Skipping the Java binding because of errors" + echo "Skipping the Java binding because of errors" fi popd else echo "Java SDK is not installed, so the Java binding will not be included" 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" - ## Build GF, with C run-time support enabled -cabal install -w "$ghc" --only-dependencies -fserver -fc-runtime $extra -cabal configure -w "$ghc" --prefix="$prefix" -fserver -fc-runtime $extra -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 +${cabal}install -w "$ghc" --only-dependencies -fserver -fc-runtime $extra +${cabal}configure -w "$ghc" --prefix="$prefix" -fserver -fc-runtime $extra +${cabal}build ## Copy GF to $destdir -cabal copy --destdir="$destdir" +${cabal}copy --destdir="$destdir" 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 case $fmt in tar.gz) targz="$name-bin-$hw-$os.tar.gz" # the final tar file - tar -C "$destdir/$prefix" -zcf "dist/$targz" . - echo "Created $targz, consider renaming it to something more user friendly" + tar --directory "$destdir/$prefix" --gzip --create --file "dist/$targz" . + echo "Created $targz" ;; pkg) pkg=$name.pkg @@ -108,4 +95,5 @@ case $fmt in echo "Created $pkg" esac +## Cleanup rm -r "$destdir" -- cgit v1.2.3 From 30bcafb76f693fb9208312c62c557ff88e1a27db Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Mon, 16 Nov 2020 23:18:40 +0100 Subject: Re-enable hack for finding C runtime on macOS --- bin/build-binary-dist.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh index 8c08c122b..5258ec702 100755 --- a/bin/build-binary-dist.sh +++ b/bin/build-binary-dist.sh @@ -32,9 +32,8 @@ set -x # print commands before executing them pushd src/runtime/c bash setup.sh configure --prefix="$prefix" bash setup.sh build -## Install in two places: -# bash setup.sh install prefix="$prefix" # for GF build to find -bash setup.sh install prefix="$destdir$prefix" # for inclusion in distribution +bash setup.sh install prefix="$prefix" # hack required for GF build on macOS +bash setup.sh install prefix="$destdir$prefix" popd ## Build the python binding to the C run-time system -- cgit v1.2.3 From dbb0bcc5dd7e85d5f790fa4d84a017d79e35b2ec Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Tue, 17 Nov 2020 00:44:05 +0100 Subject: Minors in comments --- bin/build-binary-dist.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/build-binary-dist.sh b/bin/build-binary-dist.sh index 5258ec702..4ea1c31a3 100755 --- a/bin/build-binary-dist.sh +++ b/bin/build-binary-dist.sh @@ -4,7 +4,7 @@ ### It assumes that you have Haskell and Cabal installed. ### Two binary package formats are supported (specified with the FMT env var): ### - plain tar files (.tar.gz) -### - OS X installer packages (.pkg) +### - macOS installer packages (.pkg) os=$(uname) # Operating system name (e.g. Darwin or Linux) hw=$(uname -m) # Hardware name (e.g. i686 or x86_64) @@ -42,7 +42,7 @@ if which >/dev/null python; then EXTRA_INCLUDE_DIRS="$extrainclude" EXTRA_LIB_DIRS="$extralib" python setup.py build python setup.py install --prefix="$destdir$prefix" 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') pydest="$destdir/Library/Python/$pyver/site-packages" mkdir -p "$pydest" -- cgit v1.2.3 From 6862098d8bd6f47513d52e132aba419997979f90 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Tue, 17 Nov 2020 01:07:05 +0100 Subject: Add preliminary RELEASE.md --- RELEASE.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ bin/update_html | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 RELEASE.md (limited to 'bin') diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 000000000..131a37b5d --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,47 @@ +# GF Core releases + +🚨 WARNING! The information here is preliminary! + +## Creating a new release + +### 1. Prepare the repository + +**Web pages** + +1. Create `download/index-X.Y.md` with installation instructions. +1. Create `download/release-X.Y.md` with changelog information. +1. Update `download/index.html` to redirect to the new version. +1. Add announcement in news section in `index.html` + +**Version numbers** + +1. Update version number in `gf.cabal` (ommitting `-git` suffix) +1. Add a new line in `debian/changelog` + +### 2. Create GitHub release + +1. When the above changes are committed to the `master` branch in the repository, + check that all builds are successful: + - https://github.com/GrammaticalFramework/gf-core/actions + - https://travis-ci.org/github/GrammaticalFramework/gf-core +1. Create a GitHub release here: https://github.com/GrammaticalFramework/gf-core/releases/new + with a tag format `RELEASE-X.Y` + +### 3. Binary packages + +Build and attach binaries to the release by running the relevant GitHub Actions workflows (TODO): + +1. Go to https://github.com/GrammaticalFramework/gf-rgl/actions +1. Click "Build [platform] package" under _Workflows_ +1. Click "Run workflow" and specify the tag `RELEASE-X.Y` + +### 4. Upload to Hackage + +1. Run `make sdist` +1. Visit `https://hackage.haskell.org/upload` and upload the file `dist/gf-X.Y.tar.gz`, + OR upload directly with Cabal (≥2.4): `cabal upload dist/gf-X.Y.tar.gz` +1. If the documentation-building fails on the Hackage server, do: +``` +cabal v2-haddock --builddir=dist/docs --haddock-for-hackage --enable-doc +cabal upload --documentation dist/docs/*-docs.tar.gz +``` diff --git a/bin/update_html b/bin/update_html index 912ff1fa0..717670085 100755 --- a/bin/update_html +++ b/bin/update_html @@ -147,7 +147,7 @@ else fi done find . -name '*.md' | while read file ; do - if [[ "$file" == *"README.md" ]] ; then continue ; fi + if [[ "$file" == *"README.md" ]] || [[ "$file" == *"RELEASE.md" ]] ; then continue ; fi html="${file%.md}.html" if [ "$file" -nt "$html" ] || [ "$template" -nt "$html" ] ; then render_md_html "$file" "$html" -- cgit v1.2.3