mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
Merge pull request #116 from anka-213/fix-binary-package-build
Update scripts to use `cabal v1-...` so they work on newer cabal
This commit is contained in:
9
.github/workflows/build-all-versions.yml
vendored
9
.github/workflows/build-all-versions.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
|
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
|
id: setup-haskell-cabal
|
||||||
name: Setup Haskell
|
name: Setup Haskell
|
||||||
with:
|
with:
|
||||||
@@ -73,11 +73,12 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
|
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
|
name: Setup Haskell Stack
|
||||||
with:
|
with:
|
||||||
# ghc-version: ${{ matrix.ghc }}
|
ghc-version: ${{ matrix.ghc }}
|
||||||
stack-version: ${{ matrix.stack }}
|
stack-version: 'latest'
|
||||||
|
enable-stack: true
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1
|
||||||
name: Cache ~/.stack
|
name: Cache ~/.stack
|
||||||
|
|||||||
17
.github/workflows/build-binary-packages.yml
vendored
17
.github/workflows/build-binary-packages.yml
vendored
@@ -2,7 +2,8 @@ name: Build Binary Packages
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
release:
|
release:
|
||||||
|
types: ["created"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
@@ -10,11 +11,13 @@ jobs:
|
|||||||
|
|
||||||
ubuntu:
|
ubuntu:
|
||||||
name: Build Ubuntu package
|
name: Build Ubuntu package
|
||||||
runs-on: ubuntu-18.04
|
strategy:
|
||||||
# strategy:
|
matrix:
|
||||||
# matrix:
|
os:
|
||||||
# ghc: ["8.6.5"]
|
- ubuntu-18.04
|
||||||
# cabal: ["2.4"]
|
- ubuntu-20.04
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -53,7 +56,7 @@ jobs:
|
|||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: gf-${{ github.sha }}-ubuntu
|
name: gf-${{ github.sha }}-${{ matrix.os }}
|
||||||
path: dist/gf_*.deb
|
path: dist/gf_*.deb
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
|||||||
41
Makefile
41
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
|
# This gets the numeric part of the version from the cabal file
|
||||||
VERSION=$(shell sed -ne "s/^version: *\([0-9.]*\).*/\1/p" gf.cabal)
|
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
|
all: build
|
||||||
|
|
||||||
dist/setup-config: gf.cabal Setup.hs WebSetup.hs
|
dist/setup-config: gf.cabal Setup.hs WebSetup.hs
|
||||||
cabal configure
|
ifneq ($(STACK),1)
|
||||||
|
cabal ${CMD_PFX}configure
|
||||||
|
endif
|
||||||
|
|
||||||
build: dist/setup-config
|
build: dist/setup-config
|
||||||
cabal build
|
${CMD} ${CMD_PFX}build
|
||||||
|
|
||||||
install:
|
install:
|
||||||
cabal copy
|
ifeq ($(STACK),1)
|
||||||
cabal register
|
stack install
|
||||||
|
else
|
||||||
|
cabal ${CMD_PFX}copy
|
||||||
|
cabal ${CMD_PFX}register
|
||||||
|
endif
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
cabal haddock
|
${CMD} ${CMD_PFX}haddock
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
cabal clean
|
${CMD} ${CMD_PFX}clean
|
||||||
bash bin/clean_html
|
bash bin/clean_html
|
||||||
|
|
||||||
gf:
|
|
||||||
cabal build rgl-none
|
|
||||||
strip dist/build/gf/gf
|
|
||||||
|
|
||||||
html::
|
html::
|
||||||
bash bin/update_html
|
bash bin/update_html
|
||||||
|
|
||||||
@@ -35,7 +52,7 @@ html::
|
|||||||
deb:
|
deb:
|
||||||
dpkg-buildpackage -b -uc
|
dpkg-buildpackage -b -uc
|
||||||
|
|
||||||
# Make an OS X Installer package
|
# Make a macOS installer package
|
||||||
pkg:
|
pkg:
|
||||||
FMT=pkg bash bin/build-binary-dist.sh
|
FMT=pkg bash bin/build-binary-dist.sh
|
||||||
|
|
||||||
|
|||||||
10
debian/rules
vendored
10
debian/rules
vendored
@@ -16,9 +16,9 @@ override_dh_shlibdeps:
|
|||||||
override_dh_auto_configure:
|
override_dh_auto_configure:
|
||||||
cd src/runtime/c && bash setup.sh configure --prefix=/usr
|
cd src/runtime/c && bash setup.sh configure --prefix=/usr
|
||||||
cd src/runtime/c && bash setup.sh build
|
cd src/runtime/c && bash setup.sh build
|
||||||
cabal update
|
cabal v1-update
|
||||||
cabal install --only-dependencies
|
cabal v1-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-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
|
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/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
|
-$(SET_LDL) cabal v1-build
|
||||||
|
|
||||||
override_dh_auto_install:
|
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/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
|
||||||
|
|||||||
Reference in New Issue
Block a user