diff --git a/.cirrus.yml b/.cirrus.yml index 1979033c2..9885e91a4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -5,18 +5,20 @@ task: name: Cirrus CI (FreeBSD) install_script: - pkg install -y git autoconf automake libtool pkgconf harfbuzz lua52 lua52-luarocks lua52-luafilesystem lua52-lpeg lua52-lzlib fontconfig png gmake bash lua52-luasec lua52-luasocket lua52-luaexpat - - luarocks52 install luaepnf - - luarocks52 install linenoise - luarocks52 install cassowary - luarocks52 install compat53 + - luarocks52 install cosmo + - luarocks52 install linenoise - luarocks52 install lua-zlib - luarocks52 install lua_cliargs + - luarocks52 install luaepnf - luarocks52 install luarepl - luarocks52 install penlight - luarocks52 install stdlib - luarocks52 install vstruct - - luarocks52 install cosmo - - sh bootstrap.sh + - git fetch --prune --tags ||: + - ./bootstrap.sh - ./configure --with-system-luarocks CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" + - gmake all - gmake install test_script: gmake test diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fa42c5e69..9d9538c3c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -37,7 +37,7 @@ jobs: echo "::set-env name=MAKEFLAGS::-j$(nproc) -Otarget" - name: Make package run: | - make dist + make am__remove_distdir= dist - name: Upload Artifacts if: ${{ !contains(github.ref, 'refs/tags/v') }} uses: actions/upload-artifact@v2 diff --git a/Makefile-luarocks b/Makefile-luarocks index 9af2eaa1d..616bda396 100644 --- a/Makefile-luarocks +++ b/Makefile-luarocks @@ -20,8 +20,9 @@ lua_modules: $(LUAMODSPEC) $(shell $(rocksmatch) || echo force) else rm -rf lua_modules cp -a lua_modules_dist lua_modules - $(foreach LUA,$(filter-out $(LUA_VERSION),$(SUPPORTED_LUAS)), - find lua_modules -maxdepth 3 -type d -name "*$(LUA)" -execdir rm -rf {} \;) + for luaver in $(filter-out $(LUA_VERSION),$(SUPPORTED_LUAS)); do + find lua_modules -maxdepth 3 -type d -name "*$$luaver" -execdir rm -rf {} \; + done fi $(LUAMODLOCK): lua_modules $(LUAMODSPEC) @@ -37,8 +38,9 @@ disallow-dist-with-system-luarocks: endif .PHONY: lua_modules_dist -lua_modules_dist: LUAROCKS = luarocks --tree lua_modules_dist -lua_modules_dist: $(LUAMODSPEC) force disallow-dist-with-system-luarocks - $(foreach LUA,$(SUPPORTED_LUAS), - $(LUAROCKS) $(LUAROCKSARGS) --lua-version $(LUA) install --only-deps $<) +lua_modules_dist: $(foreach LUA,$(SUPPORTED_LUAS),lua_modules_dist_$(LUA)) +.PHONY: lua_modules_dist_% +lua_modules_dist_%: LUAROCKS = luarocks --tree lua_modules_dist --lua-version $* +lua_modules_dist_%: $(LUAMODSPEC) disallow-dist-with-system-luarocks + $(LUAROCKS) $(LUAROCKSARGS) install --only-deps $< diff --git a/Makefile.am b/Makefile.am index 93b78f4f9..8701eb7c5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,7 +9,7 @@ endif MANUAL = documentation/sile.pdf -Makefile-distfiles: build-aux/list-dist-files.sh .version sile-dev-1.rockslock +Makefile-distfiles: build-aux/list-dist-files.sh $(wildcard .version sile-dev-1.rockslock) $< 2>/dev/null > $@ include Makefile-distfiles @@ -27,7 +27,6 @@ SHELL = bash .SECONDARY: .SECONDEXPANSION: .DELETE_ON_ERROR: -am__remove_distdir = BUILT_SOURCES = .version @@ -40,7 +39,7 @@ BUILT_SOURCES = .version dist-hook: lua_modules_dist | $(MANUAL) $(EXAMPLES) echo $(VERSION) > $(distdir)/.tarball-version cp -fa $< $(distdir)/ - sed -i -e '/rm -f/s/ core / /' configure aclocal.m4 ||: + sed -i -e '/rm -f/s/ core / /' $(distdir)/configure $(distdir)/aclocal.m4 ||: _DATA_HOOK_DEPS = if MANUAL diff --git a/bootstrap.sh b/bootstrap.sh index f760294cc..d9d514831 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,16 +1,41 @@ #!/usr/bin/env sh set -e +incomplete_source () { + echo -e "$1. Please either:\n" \ + "* $2,\n" \ + "* or use the source packages instead of a repo archive\n" \ + "* or use a full Git clone.\n" >&2 + exit 1 +} + # We neet a local copy of the libtexpdf library to compile. If this was # downloaded as a src distibution package this will exist already, but if not # and we are part of a git repository that the user has not fully initialized, # go ahead and do the step of fetching the the submodule so the compile process # can run. -if [ ! -f "libtexpdf/configure.ac" ] && [ -e ".git" ]; then - git submodule update --init --recursive --remote +if [ ! -f "libtexpdf/configure.ac" ]; then + if [ -e ".git" ]; then + git submodule update --init --recursive --remote + else + incomplete_source "No libtexpdf sources found" \ + "download and extract a copy yourself" + fi +fi + +# Make +# directory. This enables easy building from Github's snapshot archives +if [ ! -e ".git" ]; then + if [ ! -f ".tarball-version" ]; then + incomplete_source "No version information found" \ + "identify the correct version with \`echo \$version > .tarball-version\`" + fi +else + # Just a head start to save a ./configure cycle + ./build-aux/git-version-gen .tarball-version > .version fi -touch -d @0 Makefile-distfiles +touch -t 197001010200 Makefile-distfiles autoreconf --install -W none diff --git a/build-aux/list-dist-files.sh b/build-aux/list-dist-files.sh index d878e1877..86bfbdb42 100755 --- a/build-aux/list-dist-files.sh +++ b/build-aux/list-dist-files.sh @@ -1,24 +1,31 @@ #!/usr/bin/env bash set -e +set -o pipefail -echo -n "nobase_dist_pkgdata_DATA =" -find core classes languages packages lua-libraries -type f -name '*.lua' -printf ' %p' -find classes -type f -name '*.sil' -printf ' %p' +echo -n "nobase_dist_pkgdata_DATA = " +{ +find core classes languages packages lua-libraries -type f -name '*.lua' +find classes -type f -name '*.sil' +} | xargs -echo -ne "\nLUAMODULES =" -find lua_modules -type f -not -name '*~' -printf ' %p' ||: +echo -ne "\nLUAMODULES = " +find lua_modules -type f ! -name '*~' | xargs ||: -echo -ne "\nLUAMODULESDIST =" -find lua_modules_dist -type f -not -name '*~' -printf ' %p' ||: +echo -ne "\nLUAMODULESDIST = " +find lua_modules_dist -type f ! -name '*~' | xargs ||: -echo -ne "\nTESTSRCS ?=" -find tests -maxdepth 1 -type f -name '*.sil' -printf ' %p' -find tests -maxdepth 1 -type f -name '*.xml' -printf ' %p' +echo -ne "\nTESTSRCS ?= " +{ +find tests -maxdepth 1 -type f -name '*.sil' +find tests -maxdepth 1 -type f -name '*.xml' +} | xargs -echo -ne "\nTESTEXPECTS ?=" -find tests -maxdepth 1 -type f -name '*.expected' -printf ' %p' +echo -ne "\nTESTEXPECTS ?= " +find tests -maxdepth 1 -type f -name '*.expected' | xargs -echo -ne "\nEXAMPLESSRCS =" -find examples -maxdepth 1 -type f -name '*.sil' -printf ' %p' -find examples/docbook -maxdepth 1 -type f -name '*.xml' -printf ' %p' +echo -ne "\nEXAMPLESSRCS = " +{ +find examples -maxdepth 1 -type f -name '*.sil' +find examples/docbook -maxdepth 1 -type f -name '*.xml' +} | xargs diff --git a/configure.ac b/configure.ac index 31a11f149..6f26ee46c 100644 --- a/configure.ac +++ b/configure.ac @@ -113,13 +113,13 @@ AS_IF([test "x$with_system_luarocks" = "xyes"], [ AS_IF([test "$LUA_SHORT_VERSION" -lt 52], AX_LUA_MODULE([bit32], [bit32]) ) - AX_LUA_MODULE([lpeg], [lpeg]) AX_LUA_MODULE([cassowary], [cassowary]) AS_IF([test "$LUA_SHORT_VERSION" -lt 53], AX_LUA_MODULE([compat53], [compat53]) ) AX_LUA_MODULE([cosmo], [cosmo]) AX_LUA_MODULE([linenoise], [linenoise]) + AX_LUA_MODULE([lpeg], [lpeg]) AX_LUA_MODULE([zlib], [lua-zlib]) AX_LUA_MODULE([cliargs], [lua_cliargs]) AX_LUA_MODULE([epnf], [luaepnf]) diff --git a/sile-dev-1.rockspec b/sile-dev-1.rockspec index 799988ab2..ff5bc4f72 100644 --- a/sile-dev-1.rockspec +++ b/sile-dev-1.rockspec @@ -10,11 +10,11 @@ source = { dependencies = { "lua >= 5.1", "bit32", - "lpeg == 1.0.2-1", "cassowary == 2.2-1", - "cosmo == 16.06.04-1", "compat53 == 0.8-1", + "cosmo == 16.06.04-1", "linenoise == 0.9-1", + "lpeg == 1.0.2-1", "lua-zlib == 1.2-0", "lua_cliargs == 2.3-3", "luaepnf == 0.3-2",