[BACK]Return to Makefile CVS log [TXT][DIR] Up to [local] / ports / devel / xsd

File: [local] / ports / devel / xsd / Makefile (download)

Revision 1.5, Sat Feb 10 08:51:54 2024 UTC (3 months, 3 weeks ago) by kn
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, HEAD
Changes since 1.4: +11 -0 lines

neuter prehistoric libexpat bundle in libcutl;  pointed out by tb

xsd uses xerces not expat as XML parser, but build requires <expat.h>
which got picked from bundle where more unused libexpat was built.

Use the base header and completely remove the bundle.
Only consumers security/{libdigidocpp,qdigidoc4} are fine.

COMMENT =		W3C XML Schema to C++ data binding compiler

V =			4.1.0.a11
DISTNAME =		xsd-${V}+dep
PKGNAME =		xsd-${V}
CATEGORIES =		devel textproc
REVISION =		0

HOMEPAGE = 		https://www.codesynthesis.com/products/xsd

MAINTAINER =		Klemens Nanni <kn@openbsd.org>

# GPLv2 with FOSSE exception
PERMIT_PACKAGE =	Yes

WANTLIB +=		${COMPILER_LIBCXX} c m xerces-c

SITES =			https://codesynthesis.com/~boris/tmp/xsd/${V}/
EXTRACT_SUFX =		.tar.bz2

# C++11
COMPILER =		base-clang ports-gcc

CXXFLAGS_base-clang =	-std=c++11

BUILD_DEPENDS =		misc/findutils \
			print/ghostscript/gnu \
			shells/bash

LIB_DEPENDS =		textproc/xerces-c>=3

# xsd uses a bundled version of build:
# "massively-parallel build system implemented on top of GNU make"
USE_GMAKE =		Yes
MAKE_FILE =		makefile
ALL_TARGET =		# empty

# all variables listed in ${WRKSRC}/README
MAKE_FLAGS =		AS=${AS:Q} \
			CC=${CC:Q} \
			CFLAGS=${CFLAGS:Q} \
			CXX=${CXX:Q} \
			CXXFLAGS=${CXXFLAGS:Q} \
			LDFLAGS=${LDFLAGS:Q} \
			LIBS=${LIBS:Q} \
			RANLIB=${RANLIB:Q}

# show compiler lines
MAKE_FLAGS +=		verbose=1

XERCES_CFLAGS =		`pkg-config --cflags xerces-c`
CXXFLAGS +=		${XERCES_CFLAGS}

XERCES_LIBS =		`pkg-config --libs xerces-c`
LDFLAGS +=		${XERCES_LIBS}

# using PREFIX in FAKE_FLAGS is not enough
MAKE_FLAGS +=		install_prefix=${DESTDIR}${PREFIX} \
			install_man_dir=${DESTDIR}${PREFIX}/man

# overwrite libcutl/cutl/{config.hxx,makefile}
CXXFLAGS +=		-DLIBCUTL_EXTERNAL_EXPAT
MAKE_FLAGS +=		expat_sources='' \
			expat_headers='' \
			expat_dist=''

post-extract:
	# avoid conflict with C++20 <version> by adding suffix
	mv ${WRKSRC}/libxsd-frontend/version{,.txt}
	mv ${WRKSRC}/libcutl/version{,.txt}

pre-build:
	# neuter prehistoric libexpat bundle
	rm -rf ${WRKSRC}/libcutl/cutl/details/expat/

# provide `find ... -printf'
pre-test:
	ln -sf /usr/local/bin/gfind ${WRKDIR}/bin/find
pre-install:
	ln -sf /usr/local/bin/gfind ${WRKDIR}/bin/find

post-install:
	# avoid conflicts with lang/mono's xsd(1)
	cd ${PREFIX} && \
		mv bin/xsd{,cxx} && \
		mv man/man1/xsd{,cxx}.1

.include <bsd.port.mk>