diff --git a/.github/workflows/build-all-versions.yml b/.github/workflows/build-all-versions.yml index f4ba6a2f1f..9ab8a06226 100644 --- a/.github/workflows/build-all-versions.yml +++ b/.github/workflows/build-all-versions.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: actions/setup-haskell@v1.1.4 + - uses: haskell/actions/setup@v1 id: setup-haskell-cabal name: Setup Haskell with: @@ -73,11 +73,12 @@ jobs: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: actions/setup-haskell@v1.1.4 + - uses: haskell/actions/setup@v1 name: Setup Haskell Stack with: - # ghc-version: ${{ matrix.ghc }} - stack-version: ${{ matrix.stack }} + ghc-version: ${{ matrix.ghc }} + stack-version: 'latest' + enable-stack: true - uses: actions/cache@v1 name: Cache ~/.stack diff --git a/.github/workflows/build-binary-packages.yml b/.github/workflows/build-binary-packages.yml index 53f0397144..ccc7dd7d77 100644 --- a/.github/workflows/build-binary-packages.yml +++ b/.github/workflows/build-binary-packages.yml @@ -2,7 +2,8 @@ name: Build Binary Packages on: workflow_dispatch: - release: + release: + types: ["created"] jobs: @@ -10,11 +11,13 @@ jobs: ubuntu: name: Build Ubuntu package - runs-on: ubuntu-18.04 - # strategy: - # matrix: - # ghc: ["8.6.5"] - # cabal: ["2.4"] + strategy: + matrix: + os: + - ubuntu-18.04 + - ubuntu-20.04 + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -53,7 +56,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: gf-${{ github.sha }}-ubuntu + name: gf-${{ github.sha }}-${{ matrix.os }} path: dist/gf_*.deb if-no-files-found: error diff --git a/Makefile b/Makefile index 93a8dc20b5..cdb35e49a8 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,48 @@ -.PHONY: all build install doc clean gf html deb pkg bintar sdist +.PHONY: all build install doc clean html deb pkg bintar sdist # This gets the numeric part of the version from the cabal file VERSION=$(shell sed -ne "s/^version: *\([0-9.]*\).*/\1/p" gf.cabal) +# Check if stack is installed +STACK=$(shell if hash stack 2>/dev/null; then echo "1"; else echo "0"; fi) + +# Check if cabal >= 2.4 is installed (with v1- and v2- commands) +CABAL_NEW=$(shell if cabal v1-repl --help >/dev/null 2>&1 ; then echo "1"; else echo "0"; fi) + +ifeq ($(STACK),1) + CMD=stack +else + CMD=cabal + ifeq ($(CABAL_NEW),1) + CMD_PFX=v1- + endif +endif + all: build dist/setup-config: gf.cabal Setup.hs WebSetup.hs - cabal configure +ifneq ($(STACK),1) + cabal ${CMD_PFX}configure +endif build: dist/setup-config - cabal build + ${CMD} ${CMD_PFX}build install: - cabal copy - cabal register +ifeq ($(STACK),1) + stack install +else + cabal ${CMD_PFX}copy + cabal ${CMD_PFX}register +endif doc: - cabal haddock + ${CMD} ${CMD_PFX}haddock clean: - cabal clean + ${CMD} ${CMD_PFX}clean bash bin/clean_html -gf: - cabal build rgl-none - strip dist/build/gf/gf - html:: bash bin/update_html @@ -35,7 +52,7 @@ html:: deb: dpkg-buildpackage -b -uc -# Make an OS X Installer package +# Make a macOS installer package pkg: FMT=pkg bash bin/build-binary-dist.sh diff --git a/debian/rules b/debian/rules index 8bd3c1f85a..7ec04b4e22 100755 --- a/debian/rules +++ b/debian/rules @@ -16,9 +16,9 @@ override_dh_shlibdeps: override_dh_auto_configure: cd src/runtime/c && bash setup.sh configure --prefix=/usr cd src/runtime/c && bash setup.sh build - cabal update - cabal install --only-dependencies - cabal configure --prefix=/usr -fserver -fc-runtime --extra-lib-dirs=$(CURDIR)/src/runtime/c/.libs --extra-include-dirs=$(CURDIR)/src/runtime/c + cabal v1-update + cabal v1-install --only-dependencies + cabal v1-configure --prefix=/usr -fserver -fc-runtime --extra-lib-dirs=$(CURDIR)/src/runtime/c/.libs --extra-include-dirs=$(CURDIR)/src/runtime/c SET_LDL=LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/src/runtime/c/.libs @@ -26,10 +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/java && make CFLAGS="-I$(CURDIR)/src/runtime/c -L$(CURDIR)/src/runtime/c/.libs" INSTALL_PATH=/usr echo $(SET_LDL) - -$(SET_LDL) cabal build + -$(SET_LDL) cabal v1-build override_dh_auto_install: - $(SET_LDL) cabal copy --destdir=$(CURDIR)/debian/gf + $(SET_LDL) cabal v1-copy --destdir=$(CURDIR)/debian/gf 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/java && make INSTALL_PATH=$(CURDIR)/debian/gf/usr install