Skip to content

Commit

Permalink
webhelper: Avoid build-relative paths in checked in generated files
Browse files Browse the repository at this point in the history
gwh-enum-types.[ch] are automatically generated, but are also checked
into version control, so we need to avoid any unwanted changes.
To achieve this, use basenames instead of full names in the generated
files.  This requires glib-mkenums >= 2.22, but it should be old enough
not to cause dependencies concerns.  If this dependency appear to be a
problem, another solution could be to simply remove reference to the
source files in the generated output.

These files need to stay checked in even if they are auto-generated
because they contain translatable strings that the translation system
has to be able to extract, whether the plugin is built or not.

Close geany#163.
  • Loading branch information
b4n authored and Marcelo Galvao Povoa committed Sep 17, 2015
1 parent ac2ca91 commit 2d238cc
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion build/webhelper.m4
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ AC_DEFUN([GP_CHECK_WEBHELPER],
GP_ARG_DISABLE([WebHelper], [auto])
GTK_VERSION=2.16
GLIB_VERSION=2.16
dnl 2.22 for glib-mkenums' @basename@ template
GLIB_VERSION=2.22
GIO_VERSION=2.18
GDK_PIXBUF_VERSION=2.0
WEBKIT_VERSION=1.1.18
Expand Down
6 changes: 3 additions & 3 deletions webhelper/src/gwh-enum-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <glib/gi18n.h>

/* enumerations from "./gwh-browser.h" */
/* enumerations from "gwh-browser.h" */
GType
gwh_browser_position_get_type (void)
{
Expand All @@ -22,7 +22,7 @@ gwh_browser_position_get_type (void)
return etype;
}

/* enumerations from "./gwh-settings.h" */
/* enumerations from "gwh-settings.h" */
GType
gwh_settings_notify_flags_get_type (void)
{
Expand All @@ -38,7 +38,7 @@ gwh_settings_notify_flags_get_type (void)
return etype;
}

/* enumerations from "./gwh-utils.h" */
/* enumerations from "gwh-utils.h" */
GType
gwh_window_type_get_type (void)
{
Expand Down
2 changes: 1 addition & 1 deletion webhelper/src/gwh-enum-types.c.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/*** END file-header ***/

/*** BEGIN file-production ***/
/* enumerations from "@filename@" */
/* enumerations from "@basename@" */
/*** END file-production ***/

/*** BEGIN value-header ***/
Expand Down
6 changes: 3 additions & 3 deletions webhelper/src/gwh-enum-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@

G_BEGIN_DECLS

/* enumerations from "./gwh-browser.h" */
/* enumerations from "gwh-browser.h" */
G_GNUC_INTERNAL
GType gwh_browser_position_get_type (void) G_GNUC_CONST;
#define GWH_TYPE_BROWSER_POSITION (gwh_browser_position_get_type ())

/* enumerations from "./gwh-settings.h" */
/* enumerations from "gwh-settings.h" */
G_GNUC_INTERNAL
GType gwh_settings_notify_flags_get_type (void) G_GNUC_CONST;
#define GWH_TYPE_SETTINGS_NOTIFY_FLAGS (gwh_settings_notify_flags_get_type ())

/* enumerations from "./gwh-utils.h" */
/* enumerations from "gwh-utils.h" */
G_GNUC_INTERNAL
GType gwh_window_type_get_type (void) G_GNUC_CONST;
#define GWH_TYPE_WINDOW_TYPE (gwh_window_type_get_type ())
Expand Down
2 changes: 1 addition & 1 deletion webhelper/src/gwh-enum-types.h.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ G_BEGIN_DECLS

/*** BEGIN file-production ***/

/* enumerations from "@filename@" */
/* enumerations from "@basename@" */
/*** END file-production ***/

/*** BEGIN value-header ***/
Expand Down
2 changes: 1 addition & 1 deletion webhelper/wscript_configure
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ conf.load ('glib2')

packages = [
('gtk+-2.0', '2.16', 'GTK'),
('glib-2.0', '2.16', 'GLIB'),
('glib-2.0', '2.22', 'GLIB'),
('gio-2.0', '2.18', 'GIO'),
('gdk-pixbuf-2.0', '2.0', 'GDK_PIXBUF'),
('webkit-1.0', '1.1.18', 'WEBKIT'),
Expand Down

0 comments on commit 2d238cc

Please sign in to comment.