Skip to content

Commit

Permalink
Merge pull request #958 from alerque/make-bsd
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque authored Jul 18, 2020
2 parents 120bddc + 8bac1a2 commit f89c240
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 36 deletions.
10 changes: 6 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions Makefile-luarocks
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 $<
5 changes: 2 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,7 +27,6 @@ SHELL = bash
.SECONDARY:
.SECONDEXPANSION:
.DELETE_ON_ERROR:
am__remove_distdir =

BUILT_SOURCES = .version

Expand All @@ -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
Expand Down
31 changes: 28 additions & 3 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
37 changes: 22 additions & 15 deletions build-aux/list-dist-files.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
4 changes: 2 additions & 2 deletions sile-dev-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f89c240

Please sign in to comment.