Use the latest Gtk-Doc helper from DeforaOS configure
This commit is contained in:
parent
a4f08c77e0
commit
28c4309c31
102
doc/gtkdoc.sh
102
doc/gtkdoc.sh
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#$Id$
|
#$Id$
|
||||||
#Copyright (c) 2012-2017 Pierre Pronchery <khorben@defora.org>
|
#Copyright (c) 2012-2020 Pierre Pronchery <khorben@defora.org>
|
||||||
#
|
#
|
||||||
#Redistribution and use in source and binary forms, with or without
|
#Redistribution and use in source and binary forms, with or without
|
||||||
#modification, are permitted provided that the following conditions are met:
|
#modification, are permitted provided that the following conditions are met:
|
||||||
|
@ -38,6 +38,7 @@ GTKDOC_SCAN="gtkdoc-scan"
|
||||||
INSTALL="install -m 0644"
|
INSTALL="install -m 0644"
|
||||||
MKDIR="mkdir -m 0755 -p"
|
MKDIR="mkdir -m 0755 -p"
|
||||||
RM="rm -f"
|
RM="rm -f"
|
||||||
|
RMDIR="rmdir"
|
||||||
TOUCH="touch"
|
TOUCH="touch"
|
||||||
|
|
||||||
[ -f "../config.sh" ] && . "../config.sh"
|
[ -f "../config.sh" ] && . "../config.sh"
|
||||||
|
@ -60,6 +61,48 @@ _error()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#gtkdoc_mkdb
|
||||||
|
_gtkdoc_mkdb()
|
||||||
|
{
|
||||||
|
module="$1"
|
||||||
|
sourcedir="$2"
|
||||||
|
outputdir="$3"
|
||||||
|
|
||||||
|
(cd "$sourcedir" &&
|
||||||
|
$DEBUG $GTKDOC_MKDB --module="$module" \
|
||||||
|
--output-dir="$outputdir" \
|
||||||
|
--output-format="xml" --tmpl-dir="tmpl")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#gtkdoc_mktmpl
|
||||||
|
_gtkdoc_mktmpl()
|
||||||
|
{
|
||||||
|
module="$1"
|
||||||
|
sourcedir="$2"
|
||||||
|
outputdir="$3"
|
||||||
|
|
||||||
|
(cd "$sourcedir" &&
|
||||||
|
$DEBUG $GTKDOC_MKTMPL --module="$module" \
|
||||||
|
--output-dir="$outputdir")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#gtkdoc_scan
|
||||||
|
_gtkdoc_scan()
|
||||||
|
{
|
||||||
|
module="$1"
|
||||||
|
sourcedir="$2"
|
||||||
|
outputdir="$3"
|
||||||
|
|
||||||
|
(cd ".." &&
|
||||||
|
$DEBUG $GTKDOC_SCAN --module="$module" \
|
||||||
|
--source-dir="$sourcedir" \
|
||||||
|
--output-dir="$outputdir")
|
||||||
|
# --rebuild-types
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#usage
|
#usage
|
||||||
_usage()
|
_usage()
|
||||||
{
|
{
|
||||||
|
@ -129,23 +172,25 @@ while [ $# -gt 0 ]; do
|
||||||
file="${i##*/}"
|
file="${i##*/}"
|
||||||
$DEBUG $RM -- "$instdir/$MODULE/$file" || exit 2
|
$DEBUG $RM -- "$instdir/$MODULE/$file" || exit 2
|
||||||
done
|
done
|
||||||
|
if [ -d "$instdir/$MODULE" ]; then
|
||||||
|
$DEBUG $RMDIR -- "$instdir/$MODULE" || exit 2
|
||||||
|
fi
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#create
|
#create
|
||||||
case "$target" in
|
case "$target" in
|
||||||
gtkdoc/html.stamp)
|
gtkdoc/html.stamp)
|
||||||
driver="../$MODULE-docs.xml"
|
|
||||||
if [ -n "$OBJDIR" ]; then
|
|
||||||
driver="gtkdoc/$MODULE-docs.xml"
|
|
||||||
$DEBUG $CP -- "$driver" "${OBJDIR}gtkdoc" \
|
|
||||||
|| exit 2
|
|
||||||
fi
|
|
||||||
output="${OBJDIR}gtkdoc/html"
|
output="${OBJDIR}gtkdoc/html"
|
||||||
$DEBUG $MKDIR -- "$output" || exit 2
|
$DEBUG $MKDIR -- "$output" || exit 2
|
||||||
|
driver="$MODULE-docs.xml"
|
||||||
|
if [ -n "$OBJDIR" ]; then
|
||||||
|
$DEBUG $CP -- "gtkdoc/$driver" "${OBJDIR}gtkdoc" \
|
||||||
|
|| exit 2
|
||||||
|
fi
|
||||||
(cd "$output" &&
|
(cd "$output" &&
|
||||||
$DEBUG $GTKDOC_MKHTML "$MODULE" \
|
$DEBUG $GTKDOC_MKHTML "$MODULE" \
|
||||||
"${OBJDIR}$driver")
|
"../$driver")
|
||||||
#detect when gtk-doc is not available
|
#detect when gtk-doc is not available
|
||||||
res=$?
|
res=$?
|
||||||
if [ $res -eq 127 ]; then
|
if [ $res -eq 127 ]; then
|
||||||
|
@ -162,41 +207,34 @@ while [ $# -gt 0 ]; do
|
||||||
--module-dir="html" \
|
--module-dir="html" \
|
||||||
--html-dir="$instdir") || exit 2
|
--html-dir="$instdir") || exit 2
|
||||||
;;
|
;;
|
||||||
gtkdoc/sgml.stamp)
|
|
||||||
output="xml"
|
|
||||||
if [ -n "$OBJDIR" ]; then
|
|
||||||
output="${OBJDIR}gtkdoc/xml"
|
|
||||||
$DEBUG $MKDIR -- "$output" || exit 2
|
|
||||||
fi
|
|
||||||
(cd "${OBJDIR}gtkdoc" &&
|
|
||||||
$DEBUG $GTKDOC_MKDB \
|
|
||||||
--module="$MODULE" \
|
|
||||||
--output-dir="$output" \
|
|
||||||
--output-format="xml" \
|
|
||||||
--tmpl-dir="tmpl")
|
|
||||||
;;
|
|
||||||
gtkdoc/tmpl.stamp)
|
gtkdoc/tmpl.stamp)
|
||||||
output="tmpl"
|
output="tmpl"
|
||||||
if [ -n "$OBJDIR" ]; then
|
if [ -n "$OBJDIR" ]; then
|
||||||
output="${OBJDIR}gtkdoc/tmpl"
|
output="${OBJDIR}gtkdoc/tmpl"
|
||||||
$DEBUG $MKDIR -- "$output" || exit 2
|
$DEBUG $MKDIR -- "$output" || exit 2
|
||||||
fi
|
fi
|
||||||
(cd "${OBJDIR}gtkdoc" &&
|
_gtkdoc_mktmpl "$MODULE" "${OBJDIR}gtkdoc" "$output"
|
||||||
$DEBUG $GTKDOC_MKTMPL \
|
;;
|
||||||
--module="$MODULE" \
|
gtkdoc/xml.stamp)
|
||||||
--output-dir="$output")
|
output="xml"
|
||||||
|
if [ -n "$OBJDIR" ]; then
|
||||||
|
output="${OBJDIR}gtkdoc"
|
||||||
|
sections="gtkdoc/$MODULE-sections.txt"
|
||||||
|
$DEBUG $MKDIR -- "$output/xml" || exit 2
|
||||||
|
$DEBUG $CP -- "$sections" "$output" \
|
||||||
|
|| exit 2
|
||||||
|
_gtkdoc_scan "$MODULE" "include" "$output"
|
||||||
|
output="${OBJDIR}gtkdoc/xml"
|
||||||
|
fi
|
||||||
|
_gtkdoc_mkdb "$MODULE" "${OBJDIR}gtkdoc" "$output"
|
||||||
;;
|
;;
|
||||||
gtkdoc/*.types)
|
gtkdoc/*.types)
|
||||||
output="doc/gtkdoc" || exit 2
|
output="$PWD/gtkdoc" || exit 2
|
||||||
if [ -n "$OBJDIR" ]; then
|
if [ -n "$OBJDIR" ]; then
|
||||||
output="${OBJDIR}gtkdoc"
|
output="${OBJDIR}gtkdoc"
|
||||||
$DEBUG $MKDIR -- "$output" || exit 2
|
$DEBUG $MKDIR -- "$output" || exit 2
|
||||||
fi
|
fi
|
||||||
(cd ".." &&
|
_gtkdoc_scan "$MODULE" "include" "$output"
|
||||||
$DEBUG $GTKDOC_SCAN \
|
|
||||||
--module="$MODULE" \
|
|
||||||
--source-dir="include" \
|
|
||||||
--output-dir="$output")
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
_error "$target: Unknown type"
|
_error "$target: Unknown type"
|
||||||
|
@ -208,7 +246,7 @@ while [ $# -gt 0 ]; do
|
||||||
_error "$target: Could not create documentation"
|
_error "$target: Could not create documentation"
|
||||||
install=0
|
install=0
|
||||||
fi
|
fi
|
||||||
$TOUCH "$target"
|
$TOUCH "${OBJDIR}$target"
|
||||||
|
|
||||||
#install
|
#install
|
||||||
if [ "$install" -eq 1 ]; then
|
if [ "$install" -eq 1 ]; then
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
subdirs=gtkdoc
|
subdirs=gtkdoc
|
||||||
targets=gtkdoc/libDesktop.types,gtkdoc/tmpl.stamp,gtkdoc/sgml.stamp,gtkdoc/html.stamp,widget.1,widget.html,widget.xml
|
targets=gtkdoc/libDesktop.types,gtkdoc/html.stamp,gtkdoc/tmpl.stamp,gtkdoc/xml.stamp,widget.1,widget.html,widget.xml
|
||||||
dist=Makefile,docbook.sh,gtkdoc.sh,manual.css.xml,widget.css.xml,widget.xml.in
|
dist=Makefile,docbook.sh,gtkdoc.sh,manual.css.xml,widget.css.xml,widget.xml.in
|
||||||
|
|
||||||
#targets
|
#targets
|
||||||
|
@ -8,22 +8,22 @@ type=script
|
||||||
script=./gtkdoc.sh
|
script=./gtkdoc.sh
|
||||||
depends=../config.sh
|
depends=../config.sh
|
||||||
|
|
||||||
|
[gtkdoc/html.stamp]
|
||||||
|
type=script
|
||||||
|
script=./gtkdoc.sh
|
||||||
|
depends=gtkdoc/libDesktop-docs.xml,gtkdoc/xml.stamp
|
||||||
|
install=
|
||||||
|
|
||||||
[gtkdoc/tmpl.stamp]
|
[gtkdoc/tmpl.stamp]
|
||||||
type=script
|
type=script
|
||||||
script=./gtkdoc.sh
|
script=./gtkdoc.sh
|
||||||
depends=gtkdoc/libDesktop.types
|
depends=gtkdoc/libDesktop.types
|
||||||
|
|
||||||
[gtkdoc/sgml.stamp]
|
[gtkdoc/xml.stamp]
|
||||||
type=script
|
type=script
|
||||||
script=./gtkdoc.sh
|
script=./gtkdoc.sh
|
||||||
depends=gtkdoc/tmpl.stamp
|
depends=gtkdoc/tmpl.stamp
|
||||||
|
|
||||||
[gtkdoc/html.stamp]
|
|
||||||
type=script
|
|
||||||
script=./gtkdoc.sh
|
|
||||||
depends=gtkdoc/libDesktop-docs.xml,gtkdoc/sgml.stamp
|
|
||||||
install=
|
|
||||||
|
|
||||||
[widget.1]
|
[widget.1]
|
||||||
type=script
|
type=script
|
||||||
script=./docbook.sh
|
script=./docbook.sh
|
||||||
|
|
Loading…
Reference in New Issue
Block a user