[pangomm] tools/: Add gen_scripts/, as in glibmm and gtkmm.



commit 4d65d48153d25447ff9be7e8d53678009e216aad
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Feb 4 08:40:49 2015 +0100

    tools/: Add gen_scripts/, as in glibmm and gtkmm.
    
    This makes it easier to regenerate the .defs and _docs.xml files.

 tools/gen_scripts/pango_generate_docs.sh       |   21 +++++++++++++
 tools/gen_scripts/pango_generate_enums.sh      |   17 ++++++++++
 tools/gen_scripts/pango_generate_extra_defs.sh |   38 ++++++++++++++++++++++++
 tools/gen_scripts/pango_generate_methods.sh    |   17 ++++++++++
 4 files changed, 93 insertions(+), 0 deletions(-)
---
diff --git a/tools/gen_scripts/pango_generate_docs.sh b/tools/gen_scripts/pango_generate_docs.sh
new file mode 100755
index 0000000..a606cef
--- /dev/null
+++ b/tools/gen_scripts/pango_generate_docs.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# Note that JHBUILD_SOURCES should be defined to contain the path to the root
+# of the jhbuild sources. The script assumes that it resides in the
+# tools/gen_scripts/ directory and the XML file will be placed in pango/src.
+
+if [ -z "$JHBUILD_SOURCES" ]; then
+  echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources."
+  exit 1;
+fi
+
+PREFIX="$JHBUILD_SOURCES"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/pango/src"
+
+for dir in "$PREFIX"/pango/pango; do
+  PARAMS="$PARAMS -s $dir"
+done
+
+DOCEXTRACT_TO_XML_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/docextract_to_xml.py"
+$DOCEXTRACT_TO_XML_PY $PARAMS > "$OUT_DIR/pango_docs.xml"
diff --git a/tools/gen_scripts/pango_generate_enums.sh b/tools/gen_scripts/pango_generate_enums.sh
new file mode 100755
index 0000000..b3e7d2e
--- /dev/null
+++ b/tools/gen_scripts/pango_generate_enums.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Note that JHBUILD_SOURCES should be defined to contain the path to the root
+# of the jhbuild sources. The script assumes that it resides in the
+# tools/gen_scripts/ directory and the defs file will be placed in pango/src.
+
+if [ -z "$JHBUILD_SOURCES" ]; then
+  echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources."
+  exit 1;
+fi
+
+PREFIX="$JHBUILD_SOURCES/pango"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/pango/src"
+
+ENUM_PL="$JHBUILD_SOURCES/glibmm/tools/enum.pl"
+$ENUM_PL "$PREFIX"/pango/*.h > "$OUT_DIR"/pango_enums.defs
diff --git a/tools/gen_scripts/pango_generate_extra_defs.sh b/tools/gen_scripts/pango_generate_extra_defs.sh
new file mode 100755
index 0000000..8e2dee1
--- /dev/null
+++ b/tools/gen_scripts/pango_generate_extra_defs.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# The script assumes that it resides in the tools/gen_scripts directory
+# and the defs files will be placed in pango/src.
+# It shall be executed from the tools/gen_scripts directory.
+
+# To update the gtk_signals.defs file:
+# 1. ./pango_generate_extra_defs.sh
+#    Generates pango/src/pango_signals.defs.orig and pango/src/pango_signals.defs.
+#    If any hunks from the patch file fail to apply, apply them manually to the
+#    pango_signals.defs file, if required.
+# 2. Optional: Remove pango/src/pango_signals.defs.orig.
+
+# To update the pango_signals.defs file and the patch file:
+# 1. Like step 1 when updating only the pango_signals.defs file.
+# 2. Apply new patches manually to the pango_signals.defs file.
+# 3. ./pango_generate_extra_defs.sh --make-patch
+# 4. Like step 2 when updating only the pango_signals.defs file.
+
+ROOT_DIR="$(dirname "$0")/../.."
+GEN_DIR="$ROOT_DIR/tools/extra_defs_gen"
+OUT_DIR="$ROOT_DIR/pango/src"
+OUT_DEFS_FILE="$OUT_DIR"/pango_signals.defs
+
+if [ $# -eq 0 ]
+then
+  # Without LC_ALL=C documentation (docs "xxx") may be translated in the .defs file.
+  LC_ALL=C "$GEN_DIR"/generate_extra_defs > "$OUT_DEFS_FILE"
+  # PATCH_OPTIONS="--backup --version-control=simple --suffix=.orig"
+  # patch $PATCH_OPTIONS "$OUT_DEFS_FILE" "$OUT_DEFS_FILE".patch
+elif [ "$1" = "--make-patch" ]
+then
+  diff --unified=10 "$OUT_DEFS_FILE".orig "$OUT_DEFS_FILE" > "$OUT_DEFS_FILE".patch
+else
+  echo "Usage: $0 [--make-patch]"
+  exit 1
+fi
+
diff --git a/tools/gen_scripts/pango_generate_methods.sh b/tools/gen_scripts/pango_generate_methods.sh
new file mode 100755
index 0000000..3e9e517
--- /dev/null
+++ b/tools/gen_scripts/pango_generate_methods.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Note that JHBUILD_SOURCES should be defined to contain the path to the root
+# of the jhbuild sources. The script assumes that it resides in the
+# tools/gen_scripts/ directory and the defs file will be placed in pango/src.
+
+if [ -z "$JHBUILD_SOURCES" ]; then
+  echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources."
+  exit 1;
+fi
+
+PREFIX="$JHBUILD_SOURCES/pango"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/pango/src"
+
+H2DEF_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/h2def.py"
+$H2DEF_PY "$PREFIX"/pango/*.h > "$OUT_DIR"/pango_methods.defs


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]