Last active
March 6, 2016 21:21
-
-
Save b4n/75806eaaa87f3b0990a7 to your computer and use it in GitHub Desktop.
Generate Geany-1.0.gir from geany-gtkdoc.h with sciwrappers methods on the ScintillaObject itself
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
trap 'rm -f /tmp/get-type.txt geany-gtkdoc-tmp.h' EXIT INT QUIT TERM | |
# prepare the get-type list | |
cat > /tmp/get-type.txt <<EOF | |
get-type:stash_group_get_type | |
get-type:tm_source_file_get_type | |
get-type:scintilla_object_get_type | |
EOF | |
# move Sci wrappers to ScintillaObject namespace | |
# we introduce a marker so we can rename the symbols back in the GIR | |
sed 's/\(^\|\W\)sci_/\1scintilla_object_gengirmarker_/' \ | |
<../doc/geany-gtkdoc.h \ | |
>geany-gtkdoc-tmp.h | |
CPPFLAGS="" \ | |
CFLAGS="-g -O2" \ | |
LDFLAGS="" \ | |
CC="gcc" \ | |
g-ir-scanner \ | |
--namespace=Geany \ | |
--nsversion=1.0 \ | |
--libtool="/bin/bash ../libtool" \ | |
--include=Gtk-3.0 \ | |
--include=GLib-2.0 \ | |
--include=GObject-2.0 \ | |
--library=../src/libgeany.la \ | |
--accept-unprefixed \ | |
--c-include=geanyplugin.h \ | |
--program-arg=--introspection-dump=/tmp/get-type.txt,/tmp/get-type.out \ | |
--cflags-begin \ | |
$(pkg-config --cflags gtk+-3.0) \ | |
-DG_IR_SCANNING \ | |
--cflags-end \ | |
geany-gtkdoc-tmp.h \ | |
--output Geany-1.0.gir | |
# and fix back the wrappers' actual C identifiers | |
sed -e 's/scintilla_object_gengirmarker_/sci_/' \ | |
-e 's/gengirmarker_//' \ | |
-i Geany-1.0.gir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment