[gtksourceviewmm] Added gen_scripts, based on the libgda ones.



commit 3cab8bc18583e9fc615db8ee00d186ae2b0b7854
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Aug 3 11:12:37 2016 +0200

    Added gen_scripts, based on the libgda ones.
    
    These make it easier to regenerated the .defs and docs.xml files.

 codegen/gen_scripts/gtksourceview_generate_docs.sh |   21 +++++++++++
 .../gen_scripts/gtksourceview_generate_enums.sh    |   17 +++++++++
 .../gtksourceview_generate_extra_defs.sh           |   38 ++++++++++++++++++++
 .../gen_scripts/gtksourceview_generate_methods.sh  |   17 +++++++++
 4 files changed, 93 insertions(+), 0 deletions(-)
---
diff --git a/codegen/gen_scripts/gtksourceview_generate_docs.sh 
b/codegen/gen_scripts/gtksourceview_generate_docs.sh
new file mode 100755
index 0000000..b284360
--- /dev/null
+++ b/codegen/gen_scripts/gtksourceview_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/gtksourceview/src"
+
+for dir in "$PREFIX"/gtksourceview/gtksourceview; 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/gtksourceview_docs.xml"
diff --git a/codegen/gen_scripts/gtksourceview_generate_enums.sh 
b/codegen/gen_scripts/gtksourceview_generate_enums.sh
new file mode 100755
index 0000000..ac1a5c0
--- /dev/null
+++ b/codegen/gen_scripts/gtksourceview_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/gtksourceview"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/gtksourceview/src"
+
+ENUM_PL="$JHBUILD_SOURCES/glibmm/tools/enum.pl"
+$ENUM_PL "$PREFIX"/gtksourceview/*.h "$PREFIX"/gtksourceview/completion-providers/words/*.h > 
"$OUT_DIR"/gtksourceview_enums.defs
diff --git a/codegen/gen_scripts/gtksourceview_generate_extra_defs.sh 
b/codegen/gen_scripts/gtksourceview_generate_extra_defs.sh
new file mode 100755
index 0000000..9fc0643
--- /dev/null
+++ b/codegen/gen_scripts/gtksourceview_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 gtksourceview/src.
+# It shall be executed from the tools/gen_scripts directory.
+
+# To update the gtksourceview_signals.defs file:
+# 1. ./gtksourceview_generate_extra_defs.sh
+#    Generates gtksourceview/src/gtksourceview_signals.defs.orig and 
gtksourceview/src/gtksourceview_signals.defs.
+#    If any hunks from the patch file fail to apply, apply them manually to the
+#    gtksourceview_signals.defs file, if required.
+# 2. Optional: Remove gtksourceview/src/gtksourceview_signals.defs.orig.
+
+# To update the gtksourceview_signals.defs file and the patch file:
+# 1. Like step 1 when updating only the gtksourceview_signals.defs file.
+# 2. Apply new patches manually to the gtksourceview_signals.defs file.
+# 3. ./gtksourceview_generate_extra_defs.sh --make-patch
+# 4. Like step 2 when updating only the gtksourceview_signals.defs file.
+
+ROOT_DIR="$(dirname "$0")/../.."
+GEN_DIR="$ROOT_DIR/codegen/extradefs"
+OUT_DIR="$ROOT_DIR/gtksourceview/src"
+OUT_DEFS_FILE="$OUT_DIR"/gtksourceview_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/gtksourceview_generate_methods.sh 
b/codegen/gen_scripts/gtksourceview_generate_methods.sh
new file mode 100755
index 0000000..659c375
--- /dev/null
+++ b/codegen/gen_scripts/gtksourceview_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/gtksourceview"
+ROOT_DIR="$(dirname "$0")/../.."
+OUT_DIR="$ROOT_DIR/gtksourceview/src"
+
+H2DEF_PY="$JHBUILD_SOURCES/glibmm/tools/defs_gen/h2def.py"
+$H2DEF_PY "$PREFIX"/gtksourceview/*.h "$PREFIX"/gtksourceview/completion-providers/words/*.h  > 
"$OUT_DIR"/gtksourceview_methods.defs


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