#!/usr/bin/make -f %: dh $@ --buildsystem cargo # regenerating the source code # the xmlstarlet fixes are taken from upstream here: https://github.com/gtk-rs/gir-files/blob/master/fix.sh execute_before_dh_auto_build: rm -f Cargo.lock cp /usr/share/gir-1.0/GLib-2.0.gir $(CURDIR) xmlstarlet ed -L \ -u '//*[@glib:error-domain="g-option-context-error-quark"]/@glib:error-domain' -v g-option-error-quark \ -u '//_:record[@name="KeyFile"]/_:method[@name="set_boolean_list"]//_:parameter[@name="list"]/_:array/@c:type' -v "gboolean*" \ -u '//_:record[@name="KeyFile"]/_:method[@name="set_double_list"]//_:parameter[@name="list"]/_:array/@c:type' -v "gdouble*" \ -u '//_:record[@name="KeyFile"]/_:method[@name="set_integer_list"]//_:parameter[@name="list"]/_:array/@c:type' -v "gint*" \ -u '//_:record[@name="KeyFile"]/_:method[@name="set_locale_string_list"]//_:parameter[@name="list"]/_:array/@c:type' -v "const gchar* const*" \ -u '//_:record[@name="KeyFile"]/_:method[@name="set_string_list"]//_:parameter[@name="list"]/_:array/@c:type' -v "const gchar* const*" \ GLib-2.0.gir sed -i 's/girs_directories\s=\s\[\"\.\.\/gir-files\"\]/girs_directories=\[\".\"\]/' $(CURDIR)/Gir.toml gir -o . # Remove the .gir file before install execute_before_dh_auto_install: rm $(CURDIR)/GLib-2.0.gir