summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2023-02-23 12:46:22 (EST)
committer P. J. McDermott <pj@pehjota.net>2023-02-23 13:31:41 (EST)
commitcb0dd73c639fcef0a1d2d73226bbec713afdd42f (patch)
tree26ea7bce1fa08e3e5c6b06fd3a41741665d52258
parent367f73e6f93396e878781ffe7933e5107417a2a1 (diff)
downloadoverworld-rpg-cb0dd73c639fcef0a1d2d73226bbec713afdd42f.zip
overworld-rpg-cb0dd73c639fcef0a1d2d73226bbec713afdd42f.tar.gz
overworld-rpg-cb0dd73c639fcef0a1d2d73226bbec713afdd42f.tar.bz2
build: Distribute embedded xcf2png, use by default
-rw-r--r--3rdparty/local.mk126
-rw-r--r--Makefile.am1
-rw-r--r--README7
-rw-r--r--configure.ac42
-rw-r--r--data/tilesets/local.mk2
5 files changed, 170 insertions, 8 deletions
diff --git a/3rdparty/local.mk b/3rdparty/local.mk
new file mode 100644
index 0000000..ea01355
--- /dev/null
+++ b/3rdparty/local.mk
@@ -0,0 +1,126 @@
+if EMBEDDED_XCF2PNG
+$(XCF2PNG):
+ (cd %reldir%/xcftools/ && $(MAKE))
+clean-local:
+ -(cd %reldir%/xcftools/ && $(MAKE) clean)
+endif
+
+EXTRA_DIST += \
+ %reldir%/xcftools/.gitignore \
+ %reldir%/xcftools/ChangeLog \
+ %reldir%/xcftools/Makefile.in \
+ %reldir%/xcftools/README \
+ %reldir%/xcftools/TRANSLATION \
+ %reldir%/xcftools/config.guess \
+ %reldir%/xcftools/config.hin \
+ %reldir%/xcftools/config.rpath \
+ %reldir%/xcftools/config.sub \
+ %reldir%/xcftools/configure \
+ %reldir%/xcftools/configure.ac \
+ %reldir%/xcftools/dist-generated \
+ %reldir%/xcftools/exit.1i \
+ %reldir%/xcftools/flatspec.c \
+ %reldir%/xcftools/flatten.c \
+ %reldir%/xcftools/flatten.h \
+ %reldir%/xcftools/gimp/base-enums.h \
+ %reldir%/xcftools/gimp/gimpbaseenums.h \
+ %reldir%/xcftools/gimp/xcf-private.h \
+ %reldir%/xcftools/install-sh \
+ %reldir%/xcftools/io-unix.c \
+ %reldir%/xcftools/mancombine.pl \
+ %reldir%/xcftools/manpo/.cvsignore \
+ %reldir%/xcftools/manpo/da.po \
+ %reldir%/xcftools/manpo/manpages.pot \
+ %reldir%/xcftools/manpo/mantranslate.pl \
+ %reldir%/xcftools/manpo/optipot.pl \
+ %reldir%/xcftools/mkenumsc.pl \
+ %reldir%/xcftools/mkenumsh.pl \
+ %reldir%/xcftools/mkopti.pl \
+ %reldir%/xcftools/mktablec.pl \
+ %reldir%/xcftools/options.i \
+ %reldir%/xcftools/palette.c \
+ %reldir%/xcftools/palette.h \
+ %reldir%/xcftools/pixels.c \
+ %reldir%/xcftools/pixels.h \
+ %reldir%/xcftools/po/.cvsignore \
+ %reldir%/xcftools/po/da.po \
+ %reldir%/xcftools/po/xcftools.pot \
+ %reldir%/xcftools/scaletab.c \
+ %reldir%/xcftools/test/Makefile \
+ %reldir%/xcftools/test/README \
+ %reldir%/xcftools/test/answer/Addition.png \
+ %reldir%/xcftools/test/answer/Burn.png \
+ %reldir%/xcftools/test/answer/Color.png \
+ %reldir%/xcftools/test/answer/DarkenOnly.png \
+ %reldir%/xcftools/test/answer/Difference.png \
+ %reldir%/xcftools/test/answer/Divide.png \
+ %reldir%/xcftools/test/answer/Dodge.png \
+ %reldir%/xcftools/test/answer/GrainExtract.png \
+ %reldir%/xcftools/test/answer/GrainMerge.png \
+ %reldir%/xcftools/test/answer/Hardlight.png \
+ %reldir%/xcftools/test/answer/Hue.png \
+ %reldir%/xcftools/test/answer/LightenOnly.png \
+ %reldir%/xcftools/test/answer/Multiply.png \
+ %reldir%/xcftools/test/answer/Overlay.png \
+ %reldir%/xcftools/test/answer/Saturation.png \
+ %reldir%/xcftools/test/answer/Screen.png \
+ %reldir%/xcftools/test/answer/Subtract.png \
+ %reldir%/xcftools/test/answer/Value.png \
+ %reldir%/xcftools/test/answer/burmid.png \
+ %reldir%/xcftools/test/answer/comptest.png \
+ %reldir%/xcftools/test/answer/comptestB.png \
+ %reldir%/xcftools/test/answer/crisp1.png \
+ %reldir%/xcftools/test/answer/crisp2.png \
+ %reldir%/xcftools/test/answer/doodle.png \
+ %reldir%/xcftools/test/answer/gray.png \
+ %reldir%/xcftools/test/answer/huetest.png \
+ %reldir%/xcftools/test/answer/i255t.png \
+ %reldir%/xcftools/test/answer/i255tt.png \
+ %reldir%/xcftools/test/answer/index255.png \
+ %reldir%/xcftools/test/answer/index256.png \
+ %reldir%/xcftools/test/answer/index4.png \
+ %reldir%/xcftools/test/answer/indextest.png \
+ %reldir%/xcftools/test/answer/masknoalpha-b.png \
+ %reldir%/xcftools/test/answer/masknoalpha-g.png \
+ %reldir%/xcftools/test/answer/masknoalpha-r.png \
+ %reldir%/xcftools/test/answer/masknoalpha-w.png \
+ %reldir%/xcftools/test/answer/mid.png \
+ %reldir%/xcftools/test/answer/misc1.png \
+ %reldir%/xcftools/test/answer/modeA.png \
+ %reldir%/xcftools/test/answer/modeB.png \
+ %reldir%/xcftools/test/answer/mono.png \
+ %reldir%/xcftools/test/answer/mono1.png \
+ %reldir%/xcftools/test/answer/odoodle.png \
+ %reldir%/xcftools/test/answer/tiletest.png \
+ %reldir%/xcftools/test/dotest \
+ %reldir%/xcftools/test/pngtype.pl \
+ %reldir%/xcftools/test/source/badindexed0.xcf.gz \
+ %reldir%/xcftools/test/source/comptest.xcf.gz \
+ %reldir%/xcftools/test/source/huetest.xcf.gz \
+ %reldir%/xcftools/test/source/i255.xcf.gz \
+ %reldir%/xcftools/test/source/i256.xcf.gz \
+ %reldir%/xcftools/test/source/indextest.xcf.gz \
+ %reldir%/xcftools/test/source/masknoalpha.xcf.gz \
+ %reldir%/xcftools/test/source/mkbase.i \
+ %reldir%/xcftools/test/source/mkgradient256.pl \
+ %reldir%/xcftools/test/source/mkmodebase.c \
+ %reldir%/xcftools/test/source/mktile0.pl \
+ %reldir%/xcftools/test/source/mktile1.c \
+ %reldir%/xcftools/test/source/modetest.xcf.gz \
+ %reldir%/xcftools/test/source/tiletest-128.xcf.gz \
+ %reldir%/xcftools/test/source/tiletest-61.xcf.gz \
+ %reldir%/xcftools/test/source/tiletest.xcf.gz \
+ %reldir%/xcftools/test/source/truncated.xcf \
+ %reldir%/xcftools/utils.c \
+ %reldir%/xcftools/xcf-general.c \
+ %reldir%/xcftools/xcf2png.10 \
+ %reldir%/xcftools/xcf2png.c \
+ %reldir%/xcftools/xcf2pnm.10 \
+ %reldir%/xcftools/xcf2pnm.c \
+ %reldir%/xcftools/xcfinfo.10 \
+ %reldir%/xcftools/xcfinfo.c \
+ %reldir%/xcftools/xcfspec.txt \
+ %reldir%/xcftools/xcftools.h \
+ %reldir%/xcftools/xcftools.spec \
+ %reldir%/xcftools/xcfview.10 \
+ %reldir%/xcftools/xcfview.in
diff --git a/Makefile.am b/Makefile.am
index e7bfcdc..c10b5e4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -77,3 +77,4 @@ dist-hook:
include $(top_srcdir)/src/local.mk
include $(top_srcdir)/data/local.mk
+include $(top_srcdir)/3rdparty/local.mk
diff --git a/README b/README
index 41cb2d0..9d069d7 100644
--- a/README
+++ b/README
@@ -18,4 +18,9 @@ Boukengine requires the following library packages to build and run:
* `zlib`
* `Lua` 5.1 or later
-Boukengine additionally requires `xcftools` at build time.
+At build time, Boukengine can optionally use a copy of `xcftools`
+installed on the system. However, a copy included with Boukengine is
+used by default and is strongly recommended, as `xcftools` has been
+removed from many modern system distributions and any remaining
+distributions of it may be vulnerable to arbitrary code execution
+vulnerabilities on at least some architectures.
diff --git a/configure.ac b/configure.ac
index b429be5..eb00278 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,13 +49,43 @@ PKG_CHECK_MODULES([LUA], [lua >= 5.1], [],
[PKG_CHECK_MODULES([LUA], [lua-5.1 >= 5.1])])
])
-AC_ARG_VAR([XCF2PNG], [path to xcf2png utility])
-AC_CHECK_PROGS([XCF2PNG], [xcf2png], [no])
-if test "x$XCF2PNG" = "xno"; then
- AC_MSG_ERROR(
-[cannot find xcf2png
-xcftools may need to be installed.])
+dnl AC_ARG_VAR([XCF2PNG], [path to xcf2png utility])
+AC_ARG_WITH(
+ [system-xcf2png],
+ [AS_HELP_STRING([--with-system-xcf2png[=PATH]], [use system xcf2png])],
+ [
+ case "${withval}" in
+ 'yes'|'')
+ AC_PATH_PROG([XCF2PNG], [xcf2png])
+ if test -z "${XCF2PNG}"; then
+ AC_MSG_ERROR([xcf2png not found])
+ fi
+ embedded_xcf2png=false
+ ;;
+ 'no')
+ embedded_xcf2png=true
+ ;;
+ *)
+ XCF2PNG="${withval}"
+ AC_SUBST([XCF2PNG])
+ embedded_xcf2png=false
+ ;;
+ esac
+ ],
+ [
+ embedded_xcf2png=true
+ ]
+)
+if ${embedded_xcf2png}; then
+ AS_MKDIR_P([3rdparty/xcftools])
+ XCF2PNG='3rdparty/xcftools/xcf2png$(EXEEXT)'
+ abs_srcdir="$(cd "${srcdir}" && pwd)"
+ (
+ cd 3rdparty/xcftools
+ "${SHELL}" "${abs_srcdir}/3rdparty/xcftools/configure"
+ )
fi
+AM_CONDITIONAL([EMBEDDED_XCF2PNG], [${embedded_xcf2png}])
if test "x$GCC" = "xyes"; then
GCC_CFLAGS="-pedantic -Wall -Wextra -Werror"
diff --git a/data/tilesets/local.mk b/data/tilesets/local.mk
index 8718868..9a7ec8f 100644
--- a/data/tilesets/local.mk
+++ b/data/tilesets/local.mk
@@ -15,7 +15,7 @@ EXTRA_DIST += \
$(dist_tilesets_sources) \
data/tilesets/collision.tsx
-$(nodist_tilesets_DATA): data/tilesets/$(am__dirstamp)
+$(nodist_tilesets_DATA): data/tilesets/$(am__dirstamp) $(XCF2PNG)
data/tilesets/$(am__dirstamp):
@$(MKDIR_P) data/tilesets