textproc/xmlada: modernize by using gprbuild
This commit is contained in:
parent
31b10db372
commit
d33b365f0c
4 changed files with 2044 additions and 1285 deletions
|
@ -1,6 +1,7 @@
|
|||
PORTNAME= xmlada
|
||||
DISTVERSIONPREFIX=v
|
||||
DISTVERSION= 23.0.0
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= textproc
|
||||
|
||||
MAINTAINER= ports@FreeBSD.org
|
||||
|
@ -9,157 +10,36 @@ WWW= https://github.com/AdaCore/xmlada
|
|||
|
||||
LICENSE= GPLv3RLE
|
||||
|
||||
USES= ada:run
|
||||
BUILD_DEPENDS= gprbuild>=23:devel/gprbuild
|
||||
|
||||
USES= ada:12,run gmake
|
||||
USE_BINUTILS= yes
|
||||
GNU_CONFIGURE= yes
|
||||
|
||||
USE_GITHUB= yes
|
||||
GH_ACCOUNT= AdaCore
|
||||
GH_PROJECT= xmlada
|
||||
|
||||
MAKE_ARGS+= PROCESSORS=${MAKE_JOBS_NUMBER} \
|
||||
LIBVER=${PORTVERSION}
|
||||
ALL_TARGET= schema/lib/static/libxmlada_schema.a \
|
||||
schema/lib/relocatable/libxmlada_schema.so
|
||||
PLIST_SUB+= LIBVER=${PORTVERSION}
|
||||
MAKEFILE= Makefile.bsd
|
||||
PORTDOCS= *
|
||||
DUNICODE= ${WRKSRC}/unicode/dummy_unicode.adb
|
||||
DINPSRC= ${WRKSRC}/input_sources/dummy_input_sources.adb
|
||||
DSAX= ${WRKSRC}/sax/dummy_sax.adb
|
||||
DDOM= ${WRKSRC}/dom/dummy_dom.adb
|
||||
DSCHEMA= ${WRKSRC}/schema/dummy_schema.adb
|
||||
TEST_TARGET= test
|
||||
TEST_ENV+= GPR_PROJECT_PATH=${PREFIX}/share/gpr \
|
||||
PATH=${LOCALBASE}/gnat12/bin:${PATH}
|
||||
|
||||
OPTIONS_DEFINE= DOCS
|
||||
OPTIONS_DEFINE= DOCS EXAMPLES
|
||||
PORTDOCS= *
|
||||
PORTEXAMPLES= *
|
||||
|
||||
DOCS_BUILD_DEPENDS= sphinx-build:textproc/py-sphinx
|
||||
DOCS_ALL_TARGET= gen-docs
|
||||
|
||||
FIND1= cd ${WRKSRC}/unicode && ${FIND} -s * \( -name "unicode*.ad[bs]" \
|
||||
-a ! -name "unicode.ads" \) -exec ${PRINTF} ', "%s"' {} \;
|
||||
FIND2= cd ${WRKSRC}/input_sources && ${FIND} -s * \( -name "input*.ad[bs]" \
|
||||
-a ! -name "input_sources.ads" \) -exec ${PRINTF} ', "%s"' {} \;
|
||||
FIND3= cd ${WRKSRC}/sax && \
|
||||
${FIND} -s * -name "sax-*.ad[bs]" -exec ${PRINTF} ', "%s"' {} \;
|
||||
FIND4= cd ${WRKSRC}/dom && \
|
||||
${FIND} -s * -name "dom-*.ad[bs]" -exec ${PRINTF} ', "%s"' {} \;
|
||||
FIND5= cd ${WRKSRC}/schema && ${FIND} -s * \( -name "schema*.ad[bs]" \
|
||||
-a ! -name "schema.ads" \) -depth 0 -maxdepth 0 \
|
||||
-exec ${PRINTF} ', "%s"' {} \;
|
||||
do-build-DOCS-on:
|
||||
(cd ${WRKSRC}/docs && ${DO_MAKE_BUILD} html )
|
||||
|
||||
post-patch: dummy-unicode dummy-input_sources dummy-sax dummy-dom dummy-schema
|
||||
@${CP} ${FILESDIR}/Makefile.bsd ${WRKSRC}
|
||||
@${MKDIR} ${WRKSRC}/sax/obj/relocatable
|
||||
@${MKDIR} ${WRKSRC}/sax/obj/static
|
||||
@${MKDIR} ${WRKSRC}/sax/lib/relocatable
|
||||
@${MKDIR} ${WRKSRC}/sax/lib/static
|
||||
@${MKDIR} ${WRKSRC}/schema/obj/relocatable
|
||||
@${MKDIR} ${WRKSRC}/schema/obj/static
|
||||
@${SED} -e '/^with/d' -e 's|@ZONE@|unicode|' \
|
||||
-e "s|@FILES@|`${FIND1}`|" \
|
||||
-e 's|@VERSION@|${PORTVERSION}|' ${FILESDIR}/generic_gpr.in \
|
||||
> ${WRKSRC}/distrib/xmlada_unicode.gpr
|
||||
@${SED} -e 's|@DEPENDS@|unicode|' -e 's|@ZONE@|input_sources|' \
|
||||
-e "s|@FILES@|`${FIND2}`|" \
|
||||
-e 's|@VERSION@|${PORTVERSION}|' ${FILESDIR}/generic_gpr.in \
|
||||
> ${WRKSRC}/distrib/xmlada_input_sources.gpr
|
||||
@${SED} -e 's|@DEPENDS@|input_sources|' -e 's|@ZONE@|sax|' \
|
||||
-e "s|@FILES@|`${FIND3}`|" \
|
||||
-e 's|@VERSION@|${PORTVERSION}|' ${FILESDIR}/generic_gpr.in \
|
||||
> ${WRKSRC}/distrib/xmlada_sax.gpr
|
||||
@${SED} -e 's|@DEPENDS@|sax|' -e 's|@ZONE@|dom|' \
|
||||
-e "s|@FILES@|`${FIND4}`|" \
|
||||
-e 's|@VERSION@|${PORTVERSION}|' ${FILESDIR}/generic_gpr.in \
|
||||
> ${WRKSRC}/distrib/xmlada_dom.gpr
|
||||
@${SED} -e 's|@DEPENDS@|dom|' -e 's|@ZONE@|schema|' \
|
||||
-e "s|@FILES@|`${FIND5}`|" \
|
||||
-e 's|@VERSION@|${PORTVERSION}|' ${FILESDIR}/generic_gpr.in \
|
||||
> ${WRKSRC}/distrib/xmlada_schema.gpr
|
||||
# Since we want to pull in all 5 libs, we only need to specify schema
|
||||
${REINPLACE_CMD} -e '/unicode/d' ${WRKSRC}/distrib/xmlada.gpr
|
||||
|
||||
do-install:
|
||||
${MKDIR} ${STAGEDIR}${PREFIX}/include/xmlada \
|
||||
${STAGEDIR}${PREFIX}/lib/gnat \
|
||||
${STAGEDIR}${PREFIX}/lib/xmlada/relocatable \
|
||||
${STAGEDIR}${PREFIX}/lib/xmlada/static \
|
||||
${STAGEDIR}${DOCSDIR}
|
||||
${INSTALL_DATA} ${WRKSRC}/dom/*.ad[bs] \
|
||||
${WRKSRC}/input_sources/*.ad[bs] \
|
||||
${WRKSRC}/sax/*.ad[bs] \
|
||||
${WRKSRC}/schema/*.ad[bs] \
|
||||
${WRKSRC}/unicode/*.ad[bs] \
|
||||
${STAGEDIR}${PREFIX}/include/xmlada
|
||||
${RM} ${STAGEDIR}${PREFIX}/include/xmlada/dummy_*.adb
|
||||
${INSTALL_DATA} ${WRKSRC}/dom/obj/relocatable/*.ali \
|
||||
${WRKSRC}/input_sources/obj/relocatable/*.ali \
|
||||
${WRKSRC}/sax/obj/relocatable/*.ali \
|
||||
${WRKSRC}/schema/obj/relocatable/*.ali \
|
||||
${WRKSRC}/unicode/obj/relocatable/*.ali \
|
||||
${WRKSRC}/dom/lib/relocatable/* \
|
||||
${WRKSRC}/input_sources/lib/relocatable/* \
|
||||
${WRKSRC}/sax/lib/relocatable/* \
|
||||
${WRKSRC}/schema/lib/relocatable/* \
|
||||
${WRKSRC}/unicode/lib/relocatable/* \
|
||||
${STAGEDIR}${PREFIX}/lib/xmlada/relocatable
|
||||
${INSTALL_DATA} ${WRKSRC}/dom/obj/static/*.ali \
|
||||
${WRKSRC}/input_sources/obj/static/*.ali \
|
||||
${WRKSRC}/sax/obj/static/*.ali \
|
||||
${WRKSRC}/schema/obj/static/*.ali \
|
||||
${WRKSRC}/unicode/obj/static/*.ali \
|
||||
${WRKSRC}/dom/lib/static/* \
|
||||
${WRKSRC}/input_sources/lib/static/* \
|
||||
${WRKSRC}/sax/lib/static/* \
|
||||
${WRKSRC}/schema/lib/static/* \
|
||||
${WRKSRC}/unicode/lib/static/* \
|
||||
${STAGEDIR}${PREFIX}/lib/xmlada/static
|
||||
${INSTALL_DATA} ${WRKSRC}/distrib/xml*.gpr \
|
||||
${STAGEDIR}${PREFIX}/lib/gnat
|
||||
|
||||
do-install-DOCS-on:
|
||||
(cd ${WRKSRC}/docs/_build/html && \
|
||||
${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR})
|
||||
${RM} -r ${STAGEDIR}${DOCSDIR}/_sources \
|
||||
${STAGEDIR}${DOCSDIR}/.buildinfo
|
||||
post-install:
|
||||
(cd ${STAGEDIR}${PREFIX}/lib/xmlada/relocatable && \
|
||||
(cd ${STAGEDIR}${PREFIX}/lib/ && \
|
||||
${STRIP_CMD} libxmlada* )
|
||||
|
||||
dummy-unicode:
|
||||
@${GREP} ^package ${WRKSRC}/unicode/unicode-*.ads | \
|
||||
${AWK} '{print "with " $$2 ";"}' | ${SORT} > ${DUNICODE}
|
||||
@${ECHO} 'procedure dummy_unicode is' >> ${DUNICODE}
|
||||
@${ECHO} 'begin' >> ${DUNICODE}
|
||||
@${ECHO} ' null;' >> ${DUNICODE}
|
||||
@${ECHO} 'end dummy_unicode;' >> ${DUNICODE}
|
||||
|
||||
dummy-input_sources:
|
||||
@${GREP} ^package ${WRKSRC}/input_sources/input_sources-*.ads | \
|
||||
${AWK} '{print "with " $$2 ";"}' | ${SORT} > ${DINPSRC}
|
||||
@${ECHO} 'procedure dummy_input_sources is' >> ${DINPSRC}
|
||||
@${ECHO} 'begin' >> ${DINPSRC}
|
||||
@${ECHO} ' null;' >> ${DINPSRC}
|
||||
@${ECHO} 'end dummy_input_sources;' >> ${DINPSRC}
|
||||
|
||||
dummy-sax:
|
||||
@${GREP} ^package ${WRKSRC}/sax/sax-*.ads | \
|
||||
${AWK} '{print "with " $$2 ";"}' | ${SORT} > ${DSAX}
|
||||
@${ECHO} 'procedure dummy_sax is' >> ${DSAX}
|
||||
@${ECHO} 'begin' >> ${DSAX}
|
||||
@${ECHO} ' null;' >> ${DSAX}
|
||||
@${ECHO} 'end dummy_sax;' >> ${DSAX}
|
||||
|
||||
dummy-dom:
|
||||
@${GREP} ^package ${WRKSRC}/dom/dom-*.ads | \
|
||||
${AWK} '{print "with " $$2 ";"}' | ${SORT} > ${DDOM}
|
||||
@${ECHO} 'procedure dummy_dom is' >> ${DDOM}
|
||||
@${ECHO} 'begin' >> ${DDOM}
|
||||
@${ECHO} ' null;' >> ${DDOM}
|
||||
@${ECHO} 'end dummy_dom;' >> ${DDOM}
|
||||
|
||||
dummy-schema:
|
||||
@${GREP} ^package ${WRKSRC}/schema/schema-*.ads | \
|
||||
${AWK} '{print "with " $$2 ";"}' | ${SORT} > ${DSCHEMA}
|
||||
@${ECHO} 'procedure dummy_schema is' >> ${DSCHEMA}
|
||||
@${ECHO} 'begin' >> ${DSCHEMA}
|
||||
@${ECHO} ' null;' >> ${DSCHEMA}
|
||||
@${ECHO} 'end dummy_schema;' >> ${DSCHEMA}
|
||||
post-install-DOCS-on:
|
||||
${RM} ${STAGEDIR}${DOCSDIR}/.buildinfo
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -1,137 +0,0 @@
|
|||
ADALIB!= gnatls -v | grep adalib | awk '{print $$1}'
|
||||
|
||||
STATIC_FLAGS= -gnatQ -O2 -gnatn -gnatp -gnatA -j${PROCESSORS}
|
||||
DYNAMIC_FLAGS= -fPIC ${STATIC_FLAGS}
|
||||
|
||||
|
||||
#
|
||||
# unicode depends on nothing
|
||||
#
|
||||
|
||||
unicode/lib/static/libxmlada_unicode.a: unicode/dummy_unicode.adb
|
||||
@echo building static ${.TARGET:R} library
|
||||
@rm -f ${.TARGET}
|
||||
gnatmake -c ${.ALLSRC} -D unicode/obj/static ${STATIC_FLAGS}
|
||||
rm unicode/obj/static/dummy*
|
||||
ar cq ${.TARGET} unicode/obj/static/*.o
|
||||
ranlib ${.TARGET}
|
||||
|
||||
unicode/lib/relocatable/libxmlada_unicode.so: unicode/dummy_unicode.adb
|
||||
@${ECHO} building shared library ${.TARGET:R}
|
||||
@rm -f ${.TARGET} ${.TARGET}.${LIBVER}
|
||||
gnatmake -c ${.ALLSRC} -D unicode/obj/relocatable ${DYNAMIC_FLAGS}
|
||||
rm unicode/obj/relocatable/dummy*
|
||||
ada -shared -Wl,-rpath,${PREFIX}/lib/xmlada/relocatable \
|
||||
-L${ADALIB} -lgnat -Wl,-rpath,${ADALIB} \
|
||||
-o ${.TARGET}.${LIBVER} -Wl,-soname,${.TARGET:T}.${LIBVER} \
|
||||
unicode/obj/relocatable/*.o
|
||||
ln -s ${.TARGET:T}.${LIBVER} ${.TARGET}
|
||||
|
||||
#
|
||||
# input sources depends on unicode
|
||||
#
|
||||
|
||||
input_sources/lib/static/libxmlada_input_sources.a: input_sources/dummy_input_sources.adb unicode/lib/static/libxmlada_unicode.a
|
||||
@echo building static ${.TARGET:R} library
|
||||
@rm -f ${.TARGET}
|
||||
gnatmake -c ${.ALLSRC:M*.adb} -D input_sources/obj/static -aOunicode/obj/static -aIunicode ${STATIC_FLAGS}
|
||||
rm input_sources/obj/static/dummy*
|
||||
ar cq ${.TARGET} input_sources/obj/static/*.o
|
||||
ranlib ${.TARGET}
|
||||
|
||||
input_sources/lib/relocatable/libxmlada_input_sources.so: input_sources/dummy_input_sources.adb unicode/lib/relocatable/libxmlada_unicode.so
|
||||
@${ECHO} building shared library ${.TARGET:R}
|
||||
@rm -f ${.TARGET} ${.TARGET}.${LIBVER}
|
||||
gnatmake -c ${.ALLSRC:M*.adb} -D input_sources/obj/relocatable -aOunicode/obj/relocatable -aIunicode ${DYNAMIC_FLAGS}
|
||||
rm input_sources/obj/relocatable/dummy*
|
||||
ada -shared -Wl,-rpath,${PREFIX}/lib/xmlada/relocatable \
|
||||
-L${ADALIB} -lgnat -Wl,-rpath,${ADALIB} \
|
||||
-Lunicode/lib/relocatable -lxmlada_unicode \
|
||||
-o ${.TARGET}.${LIBVER} -Wl,-soname,${.TARGET:T}.${LIBVER} \
|
||||
input_sources/obj/relocatable/*.o
|
||||
ln -s ${.TARGET:T}.${LIBVER} ${.TARGET}
|
||||
|
||||
#
|
||||
# sax depends on input sources and unicode (sufficent to limit to I.S)
|
||||
#
|
||||
|
||||
sax/lib/static/libxmlada_sax.a: sax/dummy_sax.adb input_sources/lib/static/libxmlada_input_sources.a
|
||||
@echo building static ${.TARGET:R} library
|
||||
@rm -f ${.TARGET}
|
||||
gnatmake -c ${.ALLSRC:M*.adb} -D sax/obj/static -aOunicode/obj/static -aOinput_sources/obj/static -aIunicode -aIinput_sources ${STATIC_FLAGS}
|
||||
rm sax/obj/static/dummy*
|
||||
ar cq ${.TARGET} sax/obj/static/*.o
|
||||
ranlib ${.TARGET}
|
||||
|
||||
sax/lib/relocatable/libxmlada_sax.so: sax/dummy_sax.adb input_sources/lib/relocatable/libxmlada_input_sources.so
|
||||
@${ECHO} building shared library ${.TARGET:R}
|
||||
@rm -f ${.TARGET} ${.TARGET}.${LIBVER}
|
||||
gnatmake -c ${.ALLSRC:M*.adb} -D sax/obj/relocatable -aOunicode/obj/relocatable -aOinput_sources/obj/relocatable -aIunicode -aIinput_sources ${DYNAMIC_FLAGS}
|
||||
rm sax/obj/relocatable/dummy*
|
||||
ada -shared -Wl,-rpath,${PREFIX}/lib/xmlada/relocatable \
|
||||
-L${ADALIB} -lgnat -Wl,-rpath,${ADALIB} \
|
||||
-Lunicode/lib/relocatable -lxmlada_unicode \
|
||||
-Linput_sources/lib/relocatable -lxmlada_input_sources \
|
||||
-o ${.TARGET}.${LIBVER} -Wl,-soname,${.TARGET:T}.${LIBVER} \
|
||||
sax/obj/relocatable/*.o
|
||||
ln -s ${.TARGET:T}.${LIBVER} ${.TARGET}
|
||||
|
||||
#
|
||||
# dom depends on three other libraries (sufficent to limit to sax)
|
||||
#
|
||||
|
||||
dom/lib/static/libxmlada_dom.a: dom/dummy_dom.adb sax/lib/static/libxmlada_sax.a
|
||||
@echo building static ${.TARGET:R} library
|
||||
@rm -f ${.TARGET}
|
||||
gnatmake -c ${.ALLSRC:M*.adb} -D dom/obj/static -aOunicode/obj/static -aOinput_sources/obj/static -aOsax/obj/static -aIunicode -aIinput_sources -aIsax ${STATIC_FLAGS}
|
||||
rm dom/obj/static/dummy*
|
||||
ar cq ${.TARGET} dom/obj/static/*.o
|
||||
ranlib ${.TARGET}
|
||||
|
||||
dom/lib/relocatable/libxmlada_dom.so: dom/dummy_dom.adb sax/lib/relocatable/libxmlada_sax.so
|
||||
@${ECHO} building shared library ${.TARGET:R}
|
||||
@rm -f ${.TARGET} ${.TARGET}.${LIBVER}
|
||||
gnatmake -c ${.ALLSRC:M*.adb} -D dom/obj/relocatable -aOunicode/obj/relocatable -aOinput_sources/obj/relocatable -aOsax/obj/relocatable -aIunicode -aIinput_sources -aIsax ${DYNAMIC_FLAGS}
|
||||
rm dom/obj/relocatable/dummy*
|
||||
ada -shared -Wl,-rpath,${PREFIX}/lib/xmlada/relocatable \
|
||||
-L${ADALIB} -lgnat -Wl,-rpath,${ADALIB} \
|
||||
-Lunicode/lib/relocatable -lxmlada_unicode \
|
||||
-Linput_sources/lib/relocatable -lxmlada_input_sources \
|
||||
-Lsax/lib/relocatable -lxmlada_sax \
|
||||
-o ${.TARGET}.${LIBVER} -Wl,-soname,${.TARGET:T}.${LIBVER} \
|
||||
dom/obj/relocatable/*.o
|
||||
ln -s ${.TARGET:T}.${LIBVER} ${.TARGET}
|
||||
|
||||
#
|
||||
# schema depends on four other libraries (sufficent to limit to dom)
|
||||
#
|
||||
|
||||
schema/lib/static/libxmlada_schema.a: schema/dummy_schema.adb dom/lib/static/libxmlada_dom.a
|
||||
@echo building static ${.TARGET:R} library
|
||||
@rm -f ${.TARGET}
|
||||
gnatmake -c ${.ALLSRC:M*.adb} -D schema/obj/static -aOunicode/obj/static -aOinput_sources/obj/static -aOsax/obj/static -aOdom/obj/static -aIunicode -aIinput_sources -aIsax -aIdom ${STATIC_FLAGS}
|
||||
rm schema/obj/static/dummy*
|
||||
ar cq ${.TARGET} schema/obj/static/*.o
|
||||
ranlib ${.TARGET}
|
||||
|
||||
schema/lib/relocatable/libxmlada_schema.so: schema/dummy_schema.adb dom/lib/relocatable/libxmlada_dom.so
|
||||
@${ECHO} building shared library ${.TARGET:R}
|
||||
@rm -f ${.TARGET} ${.TARGET}.${LIBVER}
|
||||
gnatmake -c ${.ALLSRC:M*.adb} -D schema/obj/relocatable -aOunicode/obj/relocatable -aOinput_sources/obj/relocatable -aOsax/obj/relocatable -aOdom/obj/relocatable -aIunicode -aIinput_sources -aIsax -aIdom ${DYNAMIC_FLAGS}
|
||||
rm schema/obj/relocatable/dummy*
|
||||
ada -shared -Wl,-rpath,${PREFIX}/lib/xmlada/relocatable \
|
||||
-L${ADALIB} -lgnat -Wl,-rpath,${ADALIB} \
|
||||
-Lunicode/lib/relocatable -lxmlada_unicode \
|
||||
-Linput_sources/lib/relocatable -lxmlada_input_sources \
|
||||
-Lsax/lib/relocatable -lxmlada_sax \
|
||||
-Ldom/lib/relocatable -lxmlada_dom \
|
||||
-o ${.TARGET}.${LIBVER} -Wl,-soname,${.TARGET:T}.${LIBVER} \
|
||||
schema/obj/relocatable/*.o
|
||||
ln -s ${.TARGET:T}.${LIBVER} ${.TARGET}
|
||||
|
||||
#
|
||||
# Sphinx documentation
|
||||
#
|
||||
|
||||
gen-docs:
|
||||
${MAKE} -e -C docs html
|
|
@ -1,19 +0,0 @@
|
|||
with "xmlada_@DEPENDS@";
|
||||
project XmlAda_@ZONE@ is
|
||||
for Library_Name use "xmlada_@ZONE@";
|
||||
Version := "@VERSION@";
|
||||
So_Ext := ".so";
|
||||
|
||||
type Xmlada_Kind_Type is ("static", "relocatable");
|
||||
Xmlada_Kind : Xmlada_Kind_Type := external ("LIBRARY_TYPE", "static");
|
||||
Libdir := "../../lib/xmlada/" & Xmlada_Kind;
|
||||
|
||||
for Library_Kind use Xmlada_Kind;
|
||||
for Library_Dir use Libdir;
|
||||
for Library_Version use
|
||||
"lib" & Project'Library_Name & So_Ext & "." & Version;
|
||||
for Source_Dirs use ("../../include/xmlada");
|
||||
for Source_Files use ("@ZONE@.ads"@FILES@);
|
||||
for Externally_Built use "true";
|
||||
|
||||
end XmlAda_@ZONE@;
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue