[cluttermm] Add codegen scripts, based on the ones in gtkmm.



commit d852ce0aab8c5fb472715d57d8d218df96ef821a
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Mar 26 21:44:40 2014 +0100

    Add codegen scripts, based on the ones in gtkmm.
    
    This makes it easier to generate the defs and docs.xml files.

 codegen/gen_scripts/clutter_generate_docs.sh       |   21 +++++++++++
 codegen/gen_scripts/clutter_generate_enums.sh      |   17 +++++++++
 codegen/gen_scripts/clutter_generate_extra_defs.sh |   38 ++++++++++++++++++++
 codegen/gen_scripts/clutter_generate_methods.sh    |   17 +++++++++
 4 files changed, 93 insertions(+), 0 deletions(-)
---
diff --git a/codegen/gen_scripts/clutter_generate_docs.sh b/codegen/gen_scripts/clutter_generate_docs.sh
new file mode 100755
index 0000000..cc0ad18
--- /dev/null
+++ b/codegen/gen_scripts/clutter_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 clutter/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/clutter/src"
+
+for dir in "$PREFIX"/clutter/clutter; 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/clutter_docs.xml"
diff --git a/codegen/gen_scripts/clutter_generate_enums.sh b/codegen/gen_scripts/clutter_generate_enums.sh
new file mode 100755
index 0000000..e92fea0
--- /dev/null
+++ b/codegen/gen_scripts/clutter_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 gtk/src.
+
+if [ -z "$JHBUILD_SOURCES" ]; then
+  echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources."
+  exit 1;
+fi
+
+PREFIX="$JHBUILD_SOURCES/clutter"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/clutter/src"
+
+ENUM_PL="$JHBUILD_SOURCES/glibmm/tools/enum.pl"
+$ENUM_PL "$PREFIX"/clutter/*.h "$PREFIX"/clutter/deprecated/*.h > "$OUT_DIR"/clutter_enums.defs
diff --git a/codegen/gen_scripts/clutter_generate_extra_defs.sh 
b/codegen/gen_scripts/clutter_generate_extra_defs.sh
new file mode 100755
index 0000000..0068698
--- /dev/null
+++ b/codegen/gen_scripts/clutter_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 clutter/src.
+# It shall be executed from the tools/gen_scripts directory.
+
+# To update the clutter_signals.defs file:
+# 1. ./clutter_generate_extra_defs.sh
+#    Generates clutter/src/clutter_signals.defs.orig and clutter/src/clutter_signals.defs.
+#    If any hunks from the patch file fail to apply, apply them manually to the
+#    clutter_signals.defs file, if required.
+# 2. Optional: Remove clutter/src/clutter_signals.defs.orig.
+
+# To update the clutter_signals.defs file and the patch file:
+# 1. Like step 1 when updating only the clutter_signals.defs file.
+# 2. Apply new patches manually to the clutter_signals.defs file.
+# 3. ./clutter_generate_extra_defs.sh --make-patch
+# 4. Like step 2 when updating only the clutter_signals.defs file.
+
+ROOT_DIR="$(dirname "$0")/../.."
+GEN_DIR="$ROOT_DIR/codegen/extradefs"
+OUT_DIR="$ROOT_DIR/clutter/src"
+OUT_DEFS_FILE="$OUT_DIR"/clutter_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/codegen/gen_scripts/clutter_generate_methods.sh b/codegen/gen_scripts/clutter_generate_methods.sh
new file mode 100755
index 0000000..93e5929
--- /dev/null
+++ b/codegen/gen_scripts/clutter_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 gtk/src.
+
+if [ -z "$JHBUILD_SOURCES" ]; then
+  echo -e "JHBUILD_SOURCES must contain the path to the jhbuild sources."
+  exit 1;
+fi
+
+PREFIX="$JHBUILD_SOURCES/clutter"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/clutter/src"
+
+H2DEF_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/h2def.py"
+$H2DEF_PY "$PREFIX"/clutter/*.h "$PREFIX"/clutter/deprecated/*.h > "$OUT_DIR"/clutter_methods.defs


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