[gxml] Fixed make distcheck. Partial fixes for Bug #769353
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gxml] Fixed make distcheck. Partial fixes for Bug #769353
- Date: Mon, 1 Aug 2016 18:48:27 +0000 (UTC)
commit 936565d0e32a16a5b03f5dac0835574f2c33a5f8
Author: Daniel Espinosa <esodan gmail com>
Date: Mon Aug 1 13:34:38 2016 -0500
Fixed make distcheck. Partial fixes for Bug #769353
Revert changes to Makefile.am, GXml will use its workaround
for build using C files, while Automake Bug #13002 is fixed
for proper Vala support; without it make distcheck will fail
due to trying to write down stamps in a read only directory.
Reverted to changes to install VAPI in Vala versioned directory
thanks a suggestion of Yannick Inizan on Bug #769353. This will
require further tests due to gxml compilation inside flatpak
packages and sanboxed environments.
gxml/DomCharacter.vala | 8 ++++++
gxml/Makefile.am | 65 ++++++++++++++++++++++++++++++++++--------------
2 files changed, 54 insertions(+), 19 deletions(-)
---
diff --git a/gxml/DomCharacter.vala b/gxml/DomCharacter.vala
index f617da7..724187d 100644
--- a/gxml/DomCharacter.vala
+++ b/gxml/DomCharacter.vala
@@ -32,11 +32,13 @@ public interface GXml.DomCharacterData : GLib.Object,
public virtual ulong length {
get {
+ Init.init ();
if (this.data == null) return 0;
return this.data.length;
}
}
public virtual string substring_data (ulong offset, ulong count) throws GLib.Error {
+ Init.init ();
if (((int)offset) > this.data.length)
throw new DomError.INDEX_SIZE_ERROR (_("Invalid offset for substring"));
int end = (int) (offset + count);
@@ -44,15 +46,19 @@ public interface GXml.DomCharacterData : GLib.Object,
return data.slice ((int) offset, end);
}
public virtual void append_data (string data) {
+ Init.init ();
this.data += data;
}
public virtual void insert_data (ulong offset, string data) throws GLib.Error {
+ Init.init ();
replace_data (offset, 0, data);
}
public virtual void delete_data (ulong offset, ulong count) throws GLib.Error {
+ Init.init ();
replace_data (offset, count, "");
}
public new virtual void replace_data (ulong offset, ulong count, string data) throws GLib.Error {
+ Init.init ();
if (((int)offset) > this.data.length)
throw new DomError.INDEX_SIZE_ERROR (_("Invalid offset for replace data"));
int end = (int) (offset + count);
@@ -63,6 +69,7 @@ public interface GXml.DomCharacterData : GLib.Object,
public interface GXml.DomText : GXml.DomCharacterData {
public virtual GXml.DomText split_text (ulong offset) throws GLib.Error {
+ Init.init ();
if (offset >= data.length)
throw new DomError.INDEX_SIZE_ERROR (_("Invalid offset to split text"));
var nt = this.owner_document.create_text_node (this.data.slice ((int)offset, this.data.length));
@@ -75,6 +82,7 @@ public interface GXml.DomText : GXml.DomCharacterData {
}
public virtual string whole_text {
owned get {
+ Init.init ();
string s = "";
if (this.previous_sibling is DomText)
s += (this.previous_sibling as DomText).whole_text;
diff --git a/gxml/Makefile.am b/gxml/Makefile.am
index f85f07e..e4e0fae 100644
--- a/gxml/Makefile.am
+++ b/gxml/Makefile.am
@@ -112,10 +112,10 @@ sources = \
$(NULL)
-VALAFLAGS= \
+AM_VALAFLAGS= \
--vapidir=$(VAPIDIR) \
- $(ERROR_VALAFLAGS) \
- --library=gxml-0.10 \
+ $(ERROR_AM_VALAFLAGS) \
+ --library=gxml-0.12 \
$(top_srcdir)/vapi/config.vapi \
$(top_srcdir)/vapi/xlibxml-1.0.vapi \
--vapidir=. \
@@ -125,17 +125,17 @@ VALAFLAGS= \
--pkg gobject-2.0 \
--pkg gio-2.0 \
--includedir gxml \
- --vapi gxml-0.12.vapi \
- -H gxml.h
+ -H gxml.h -C \
+ $(NULL)
# library flags
-#libgxml_0_12_la_VALAFLAGS=
+#libgxml_0_12_la_AM_VALAFLAGS=
### General Compilation flags
-libgxml_0_12_la_CPPFLAGS = \
+AM_CPPFLAGS = \
-include $(CONFIG_HEADER) \
-DPACKAGE_DATA_DIR=\""$(pkgdatadir)"\" \
-DPACKAGE_LOCALE_DIR=\""$(localedir)"\" \
@@ -144,7 +144,7 @@ libgxml_0_12_la_CPPFLAGS = \
-I$(top_srcdir) \
$(NULL)
-libgxml_0_12_la_CFLAGS = \
+AM_CFLAGS = \
-g \
$(GLIB_CFLAGS) \
$(LIBXML_CFLAGS) \
@@ -157,7 +157,7 @@ libgxml_0_12_la_CFLAGS = \
if ENABLE_DEVHELP_DOCS
-VALAFLAGS += \
+AM_VALAFLAGS += \
--vapi-comments
endif
@@ -165,7 +165,7 @@ endif
# -Wall # TODO: add this back when we can properly handle more libxml2/vala warnings
if DEBUG
-VALAFLAGS += \
+AM_VALAFLAGS += \
-D DEBUG \
--enable-mem-profiler \
-g
@@ -182,9 +182,34 @@ libgxml_0_12_la_LIBADD = \
libgxml_0_12_la_LDFLAGS = \
-version-info "$(LT_CURRENT)":"$(LT_REVISION)":"$(LT_AGE)"
+vala-stamp: $(sources)
+ @rm -f vala-temp
+ @touch vala-temp
+ $(VALAC) $(AM_VALAFLAGS) $^
+ @mv -f vala-temp $@
+
+$(sources:.vala=.c): vala-stamp
+## Recover from the removal of $@
+ @if test -f $@; then :; else \
+ trap ’rm -rf vala-lock vala-stamp’ 1 2 13 15; \
+ if mkdir vala-lock 2>/dev/null; then \
+## This code is being executed by the first process.
+ rm -f vala-stamp; \
+ $(MAKE) $(AM_MAKEFLAGS) vala-stamp; \
+ rmdir vala-lock; \
+ else \
+## This code is being executed by the follower processes.
+## Wait until the first process is done.
+ while test -d vala-lock; do sleep 1; done; \
+## Succeed if and only if the first process succeeded.
+ test -f vala-stamp; exit $$?; \
+ fi; \
+ fi
+
libgxml_0_12_la_SOURCES= \
- $(sources) \
- xlibxml.c
+ $(sources:.vala=.c) \
+ xlibxml.c \
+ $(NULL)
# .h header file
gxml.h: libgxml-0.12.la
@@ -193,7 +218,7 @@ gxml_HEADERS = gxml.h xlibxml.h
# .vapi Vala API file
gxml-0.12.vapi: libgxml-0.12.la
-vapidir = $(VAPIDIR)
+vapidir = $(datadir)/vala/vapi
dist_vapi_DATA = \
gxml-0.12.vapi \
gxml-0.12.deps \
@@ -209,9 +234,9 @@ EXTRA_DIST = \
$(pkgconfig_in) \
$(NULL)
-GITIGNOREFILES = \
- $(sources:.vala=.c) \
- $(NULL)
+#GITIGNOREFILES = \
+# $(sources:.vala=.c) \
+# $(NULL)
# This makes GObject Introspection optional and requires to use --enable-instrospection switch on configure
if HAVE_INTROSPECTION
@@ -225,7 +250,7 @@ libgxml_dlname=\
#libgxml_dlname=\
# `$(GREP) -e dlname libgxml-0.12.la | $(SED) s/dlname=\'// | $(SED) s/\'//`
-VALAFLAGS += \
+AM_VALAFLAGS += \
--gir=GXml-$(API_VERSION).gir
INTROSPECTION_GIRS = GXml-$(API_VERSION).gir
@@ -245,7 +270,7 @@ CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif
if PLATFORM_WIN32
-VALAFLAGS += \
+AM_VALAFLAGS += \
--symbols=gxml.symbols
libgxml_0_12_la_LDFLAGS += -shared -o libgxml-0.12.dll -no-undefined \
@@ -272,10 +297,12 @@ BUILT_SOURCES += \
endif
CLEANFILES += \
+ $(sources:.vala=.c) \
+ vala-stamp \
$(pkgconfig_DATA) \
namespace-info.vala \
gxml-0.12.vapi \
gxml.h
-
-include $(top_srcdir)/git.mk
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]