summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--extras/CustomTarget_glade.mk26
-rw-r--r--extras/Module_extras.mk1
-rw-r--r--extras/Package_glade.mk2
-rw-r--r--extras/source/glade/libreoffice-catalog.xml.in (renamed from extras/source/glade/libreoffice-catalog.xml)0
-rw-r--r--extras/source/glade/makewidgetgroup.xslt50
5 files changed, 78 insertions, 1 deletions
diff --git a/extras/CustomTarget_glade.mk b/extras/CustomTarget_glade.mk
new file mode 100644
index 000000000000..89d452ebe040
--- /dev/null
+++ b/extras/CustomTarget_glade.mk
@@ -0,0 +1,26 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CustomTarget_CustomTarget,extras/glade))
+
+#
+# Rules
+#
+
+$(call gb_CustomTarget_get_workdir,extras/source/glade)/libreoffice-catalog.xml : \
+ $(SRCDIR)/extras/source/glade/libreoffice-catalog.xml.in \
+ $(SRCDIR)/extras/source/glade/makewidgetgroup.xslt \
+ | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
+ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XSLT,4)
+ $(call gb_Helper_abbreviate_dirs, \
+ $(call gb_ExternalExecutable_get_command,xsltproc) --nonet \
+ -o $@ $(SRCDIR)/extras/source/glade/makewidgetgroup.xslt $< \
+ )
+
+# vim: set noet sw=4 ts=4:
diff --git a/extras/Module_extras.mk b/extras/Module_extras.mk
index 7144265d613a..c3cb14b75b7c 100644
--- a/extras/Module_extras.mk
+++ b/extras/Module_extras.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_Module_Module,extras))
$(eval $(call gb_Module_add_targets,extras,\
AllLangZip_autotextshare \
CustomTarget_autocorr \
+ CustomTarget_glade \
Package_fonts \
Package_glade \
Package_labels \
diff --git a/extras/Package_glade.mk b/extras/Package_glade.mk
index 9621aa9ba8f1..1ac1f690786a 100644
--- a/extras/Package_glade.mk
+++ b/extras/Package_glade.mk
@@ -7,7 +7,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
-$(eval $(call gb_Package_Package,extras_glade,$(SRCDIR)/extras/source/glade))
+$(eval $(call gb_Package_Package,extras_glade,$(call gb_CustomTarget_get_workdir,extras/source/glade)))
$(eval $(call gb_Package_add_file,extras_glade,pck/libreoffice-catalog.xml,libreoffice-catalog.xml))
diff --git a/extras/source/glade/libreoffice-catalog.xml b/extras/source/glade/libreoffice-catalog.xml.in
index 435449cd34f4..435449cd34f4 100644
--- a/extras/source/glade/libreoffice-catalog.xml
+++ b/extras/source/glade/libreoffice-catalog.xml.in
diff --git a/extras/source/glade/makewidgetgroup.xslt b/extras/source/glade/makewidgetgroup.xslt
new file mode 100644
index 000000000000..c7d97d70822e
--- /dev/null
+++ b/extras/source/glade/makewidgetgroup.xslt
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="xml" version="1.0" encoding="UTF-8"/>
+
+ <!-- work arround apparently broken output indenting in libxslt -->
+ <xsl:param name="indent" select="' '"/>
+
+ <xsl:template match="/glade-catalog">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+
+ <xsl:text>&#10;</xsl:text>
+ <xsl:value-of select="$indent"/>
+ <glade-widget-group name="libreoffice" title="LibreOffice">
+ <xsl:text>&#10;</xsl:text>
+
+ <xsl:for-each select="//glade-widget-class">
+ <xsl:value-of select="concat($indent,$indent)"/>
+ <glade-widget-class-ref name="{@name}"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:for-each>
+
+ <xsl:value-of select="$indent"/>
+ </glade-widget-group>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="@*|node()">
+ <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>