The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

This commit adds a new library for parsing XML files

These changes was commited to the Birdfont repository Thu, 25 Sep 2014 10:54:02 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 25 Sep 2014 10:54:02 +0000 (12:54 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 25 Sep 2014 11:14:16 +0000 (13:14 +0200)
commit 0de0a5759db39440d51b90cc08f82da88abb03c6
tree c6be28404a55b9c6b1a043c9437002162c189fce
parent b18792908bd658c228fb2b08fab3297e07eed896
This commit adds a new library for parsing XML files
The library is much smaller in size than libxml2 and it is easy to
use in vala. It parses tags and attributes but does not attempt to
validate namespaces.

12 files changed:
dodo.py
install.py
libbirdfont/OpenFontFormat/Os2Table.vala
libbirdxml/Attributes.vala [new ]
libbirdxml/Tag.vala [new ]
libbirdxml/Xml.vala [new ]
scripts/build.py
scripts/linux_build.py
scripts/mac_build.py
scripts/version.py
scripts/windows_build.py
diff --git a/dodo.py b/dodo.py
--- a/dodo.py +++ b/dodo.py @@ -30,6 +30,7 @@ DOIT_CONFIG = { 'default_tasks': [ 'build', + 'libbirdxml', 'libbirdfont', 'birdfont', 'birdfont_autotrace', @@ -51,6 +52,10 @@ config.GEE, 'libnotify', 'libgit2' + ] + + LIBBIRD_XML_LIBS = [ + 'glib-2.0' ] def task_build (): @@ -83,7 +88,16 @@ '--target-glib=2.34', # see bug 0000004 '--define=LINUX' ] - libbird = Vala(src='libbirdfont', build='build', library='birdfont', so_version=version.SO_VERSION, pkg_libs=LIBS) + + libbirdxml = Vala(src='libbirdxml', build='build', library='birdxml', so_version=version.LIBBIRDXML_SO_VERSION, pkg_libs=LIBBIRD_XML_LIBS) + def task_libbirdxml(): + yield libbirdxml.gen_c(valac_options) + yield libbirdxml.gen_o(['-fPIC']) + yield libbirdxml.gen_so() + yield libbirdxml.gen_ln() + + + libbird = Vala(src='libbirdfont', build='build', library='birdfont', so_version=version.SO_VERSION, pkg_libs=LIBS, vala_deps=[libbirdxml]) def task_libbirdfont(): yield libbird.gen_c(valac_options) yield libbird.gen_o(['-fPIC', """-D 'GETTEXT_PACKAGE="birdfont"'"""]) @@ -92,25 +106,25 @@ def task_birdfont(): - bird = Vala(src='birdfont', build='build', pkg_libs=LIBS, vala_deps=[libbird]) + bird = Vala(src='birdfont', build='build', pkg_libs=LIBS, vala_deps=[libbird, libbirdxml]) yield bird.gen_c(valac_options) yield bird.gen_bin(["""-D 'GETTEXT_PACKAGE="birdfont"' """]) def task_birdfont_autotrace(): - exp = Vala(src='birdfont-autotrace', build='build', pkg_libs=LIBS, vala_deps=[libbird]) + exp = Vala(src='birdfont-autotrace', build='build', pkg_libs=LIBS, vala_deps=[libbird, libbirdxml]) yield exp.gen_c(valac_options) yield exp.gen_bin(["""-D 'GETTEXT_PACKAGE="birdfont"' """]) def task_birdfont_export(): - exp = Vala(src='birdfont-export', build='build', pkg_libs=LIBS, vala_deps=[libbird]) + exp = Vala(src='birdfont-export', build='build', pkg_libs=LIBS, vala_deps=[libbird, libbirdxml]) yield exp.gen_c(valac_options) yield exp.gen_bin(["""-D 'GETTEXT_PACKAGE="birdfont"' """]) def task_birdfont_import(): - exp = Vala(src='birdfont-import', build='build', pkg_libs=LIBS, vala_deps=[libbird]) + exp = Vala(src='birdfont-import', build='build', pkg_libs=LIBS, vala_deps=[libbird, libbirdxml]) yield exp.gen_c(valac_options) yield exp.gen_bin(["""-D 'GETTEXT_PACKAGE="birdfont"' """])
--- a/install.py +++ b/install.py @@ -2,5 +2,5 @@ """ - Copyright (C) 2013 Johan Mattsson + Copyright (C) 2013 2014 Johan Mattsson This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -125,8 +125,25 @@ link (libdir, 'libbirdfont.' + version.SO_VERSION + '.dylib', ' libbirdfont.dylib.' + version.SO_VERSION_MAJOR) link (libdir, 'libbirdfont.' + version.SO_VERSION + '.dylib', ' libbirdfont.dylib') else: - print ("Can not find libbirdfont.") + print ("Can't find libbirdfont.") exit (1) + + + if os.path.isfile ('build/bin/libbirdxml.so.' + version.LIBBIRDXML_SO_VERSION): + install ('build/bin/libbirdxml.so.' + version.LIBBIRDXML_SO_VERSION, libdir, 644) + link (libdir, 'libbirdxml.so.' + version.LIBBIRDXML_SO_VERSION, ' libbirdxml.so.' + version.LIBBIRDXML_SO_VERSION_MAJOR) + link (libdir, 'libbirdxml.so.' + version.LIBBIRDXML_SO_VERSION, ' libbirdxml.so') + elif os.path.isfile ('build/libbirdxml.so.' + version.LIBBIRDXML_SO_VERSION): + install ('build/libbirdxml.so.' + version.LIBBIRDXML_SO_VERSION, libdir, 644) + link (libdir, 'libbirdxml.so.' + version.LIBBIRDXML_SO_VERSION, ' libbirdxml.so.' + version.LIBBIRDXML_SO_VERSION_MAJOR) + link (libdir, 'libbirdxml.so.' + version.LIBBIRDXML_SO_VERSION, ' libbirdxml.so') + elif os.path.isfile ('build/bin/libbirdxml.' + version.LIBBIRDXML_SO_VERSION + '.dylib'): + install ('build/bin/libbirdxml.' + version.LIBBIRDXML_SO_VERSION + '.dylib', libdir, 644) + link (libdir, 'libbirdxml.' + version.LIBBIRDXML_SO_VERSION + '.dylib', ' libbirdxml.dylib.' + version.LIBBIRDXML_SO_VERSION_MAJOR) + link (libdir, 'libbirdxml.' + version.LIBBIRDXML_SO_VERSION + '.dylib', ' libbirdxml.dylib') + else: + print ("Can't find libbirdxml.") + #manpages if not nogzip:
--- a/libbirdfont/OpenFontFormat/Os2Table.vala +++ b/libbirdfont/OpenFontFormat/Os2Table.vala @@ -11,6 +11,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ + + using Math; namespace BirdFont {
diff --git libbirdxml/Attributes.vala(new)
--- /dev/null +++ b/libbirdxml/Attributes.vala @@ -1,1 +1,48 @@ + /* + Copyright (C) 2014 Johan Mattsson + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 3 of the + License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + */ + namespace Bird { + + public class Attribute : GLib.Object { + + public string ns; + public string name; + public string content; + + internal Attribute (string ns, string name, string content) { + this.ns = ns; + this.name = name; + this.content = content; + } + + internal Attribute.empty () { + this.ns = ""; + this.name = ""; + this.content = ""; + } + + public string get_namespace () { + return ns; + } + + public string get_name () { + return name; + } + + public string get_content () { + return content; + } + } + + }
diff --git libbirdxml/Tag.vala(new)
--- /dev/null +++ b/libbirdxml/Tag.vala @@ -1,1 +1,327 @@ + /* + Copyright (C) 2014 Johan Mattsson + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 3 of the + License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + */ + + namespace Bird { + + public class Tag : GLib.Object { + + int tag_index; + int attribute_index; + + bool has_tags; + bool has_attributes; + + string name; + string data; + string attributes; + + Tag? next_tag = null; + Attribute? next_attribute = null; + + internal Tag (string name, string attributes, string content) { + this.name = name; + this.data = content; + this.attributes = attributes; + tag_index = 0; + attribute_index = 0; + next_tag = obtain_next_tag (); + next_attribute = obtain_next_attribute (); + } + + internal Tag.empty () { + data = ""; + attributes = ""; + name = ""; + } + + /** Reset the parser and start from the beginning XML tag. */ + public void reparse () { + tag_index = 0; + attribute_index = 0; + next_tag = obtain_next_tag (); + next_attribute = obtain_next_attribute (); + } + + /** @return the name of this tag. */ + public string get_name () { + return name; + } + + /** @return true if there is one more tags left */ + public bool has_more_tags () { + return has_tags; + } + + /** @return the next tag. **/ + public Tag get_next_tag () { + Tag r = (!) next_tag; + next_tag = obtain_next_tag (); + return r; + } + + public bool has_more_attributes () { + return has_attributes; + } + + public Attribute get_next_attribute () { + Attribute r = (!) next_attribute; + next_attribute = obtain_next_attribute (); + return r; + } + + Tag obtain_next_tag () { + int end_tag_index; + Tag tag; + + tag = find_next_tag (tag_index, out end_tag_index); + + if (end_tag_index != -1) { + tag_index = end_tag_index; + has_tags = true; + } else { + has_tags = false; + } + + return tag; + } + + Tag find_next_tag (int start, out int end_tag_index) { + int index; + unichar c; + int separator; + int end; + int closing_tag; + + string name; + string attributes; + string content; + + index = start; + end_tag_index = -1; + while (data.get_next_char (ref index, out c)) { + if (c == '<') { + separator = find_next_separator (index); + + if (separator < 0) { + warning ("Expecting a separator after index %d.", index); + return new Tag.empty (); + } + + name = data.substring (index, separator - index); + + end = data.index_of (">", start); + attributes = data.substring (separator, end - separator); + + if (attributes.has_suffix ("/")) { + content = ""; + end_tag_index = data.index_of (">", index); + data.get_next_char (ref end_tag_index, out c); + } else { + data.get_next_char (ref end, out c); // skip > + closing_tag = find_closing_tag (name, end); + content = data.substring (end, closing_tag - end); + end_tag_index = data.index_of (">", closing_tag); + data.get_next_char (ref end_tag_index, out c); + } + + print (@"$(this.name) New tag end_tag_index $end_tag_index, $name, $attributes, $content\n"); + return new Tag (name, attributes, content); + } + } + + return new Tag.empty (); + } + + int find_next_separator (int start) { + int index = start; + int previous_index = start; + unichar c; + + while (true) { + + previous_index = index; + if (!data.get_next_char (ref index, out c)) { + break; + } + + if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '>' || c == '/') { + return previous_index; + } + } + + return -1; + } + + int find_closing_tag (string name, int start) { + int index = start; + int slash_index = start; + int previous_index; + unichar c; + int start_count = 0; + + while (true) { + previous_index = index; + if (!data.get_next_char (ref index, out c)) { + break; + } + + if (c == '<') { + slash_index = index; + data.get_next_char (ref slash_index, out c); + if (c == '/' && is_tag (name, slash_index)) { + if (start_count == 0) { + return previous_index; + } else { + start_count--; + if (start_count == 0) { + return previous_index; + } + } + } else if (is_tag (name, index)) { + start_count++; + } + } + } + + warning (@"No closing tag for $(name)."); + return -1; + } + + bool is_tag (string name, int start) { + int index = 0; + int data_index = start; + unichar c; + unichar c_data; + + while (name.get_next_char (ref index, out c)) { + if (data.get_next_char (ref data_index, out c_data)) { + if (c_data != c) { + return false; + } + } + } + + + if (data.get_next_char (ref data_index, out c_data)) { + return c_data == '>' || c_data == ' ' || c_data == '\t' + || c_data == '\n' || c_data == '\r' || c_data == '/'; + } + + return false; + } + + Attribute obtain_next_attribute () { + int previous_index; + int index = attribute_index; + int name_start; + string attribute_name; + string ns; + string content; + int ns_separator; + int content_start; + int content_stop; + unichar quote; + unichar c; + + // skip space and other separators + while (true) { + previous_index = index; + + if (!attributes.get_next_char (ref index, out c)) { + has_attributes = false; + return new Attribute.empty (); + } + + if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '/')) { + break; + } + } + + name_start = previous_index; + + // read attribute name + while (true) { + previous_index = index; + if (!attributes.get_next_char (ref index, out c)) { + warning (@"Unexpected end of attributes in tag $(this.name)"); + has_attributes = false; + return new Attribute.empty (); + } + + if (c == ' ' || c == '\t' || c == '=' || c == '\n' || c == '\r') { + break; + } + } + + attribute_name = attributes.substring (name_start, previous_index - name_start); + index = name_start + attribute_name.length; + ns = ""; + ns_separator = attribute_name.index_of (":"); + if (ns_separator != -1) { + ns = attribute_name.substring (0, ns_separator); + attribute_name = attribute_name.substring (ns_separator + 1); + } + + // equal sign and space around it + while (attributes.get_next_char (ref index, out c)) { + if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r')) { + if (c == '=') { + break; + } else { + has_attributes = false; + warning (@"Expecting equal sign for attribute $(attribute_name)."); + return new Attribute.empty (); + } + } + } + + while (attributes.get_next_char (ref index, out c)) { + if (!(c == ' ' || c == '\t' || c == '\n' || c == '\r')) { + if (c == '"' || c == '\'') { + break; + } else { + has_attributes = false; + warning (@"Expecting quote for attribute $(attribute_name)."); + return new Attribute.empty (); + } + } + } + + quote = c; + content_start = index; + + while (true) { + if (!attributes.get_next_char (ref index, out c)) { + has_attributes = false; + warning (@"Expecting end quote for attribute $(attribute_name)."); + return new Attribute.empty (); + } + + if (c == quote) { + break; + } + } + + content_stop = index - 1; + content = attributes.substring (content_start, content_stop - content_start); + + has_attributes = true; + + attribute_index = content_stop + 1; + return new Attribute (ns, attribute_name, content); + } + } + + }
diff --git libbirdxml/Xml.vala(new)
--- /dev/null +++ b/libbirdxml/Xml.vala @@ -1,1 +1,75 @@ + /* + Copyright (C) 2014 Johan Mattsson + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 3 of the + License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + */ + namespace Bird { + + /** A small xml parser originally written for the BirdFont project. */ + public class Xml : GLib.Object { + + Tag root; + string data; + + public Xml (string data) { + this.data = data; + reparse (); + } + + /** Reset the parser and start from the beginning of the XML document. */ + public void reparse () { + int root_index; + + root_index = find_root_tag (); + if (root_index == -1) { + warning ("No root tag found."); + } + + root = new Tag ("", "", data.substring (root_index)); + } + + /** @return the next tag. **/ + public Tag get_next_tag () { + return root.get_next_tag (); + } + + /** @return true if there is one more tags left */ + public bool has_more_tags () { + return root.has_more_tags (); + } + + int find_root_tag () { + int index = 0; + int prev_index = 0; + int modifier = 0; + unichar c; + + while (true) { + prev_index = index; + if (!data.get_next_char (ref index, out c)) { + break; + } + + if (c == '<') { + modifier = index; + data.get_next_char (ref modifier, out c); + if (c != '?' && c != '[') { + return prev_index; + } + } + } + + return -1; + } + } + + }
--- a/scripts/build.py +++ b/scripts/build.py @@ -109,8 +109,63 @@ run("cp resources/linux/birdfont-import.1 build/") run("gzip build/birdfont-import.1") + + def libbirdxml(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull = True): + #libbirdfont + run("mkdir -p build/libbirdxml") + run("mkdir -p build/bin") + + experimentalNonNull = "" + if nonNull: + experimentalNonNull = "--enable-experimental-non-null" + + run(valac + """\ + -C \ + """ + valaflags + """ \ + --vapidir=./ \ + --basedir build/libbirdxml/ \ + """ + experimentalNonNull + """ \ + --enable-experimental \ + --library libbirdxml \ + -H build/libbirdxml/birdxml.h \ + libbirdxml/*.vala \ + """) + + if cc == "": + print ("Skipping compilation"); + else: + run(cc + " " + cflags + """ \ + -c build/libbirdxml/*.c \ + -fPIC \ + $(pkg-config --cflags glib-2.0) \ + """) + + run("mv ./*.o build/libbirdxml/ ") + + if library.endswith (".dylib"): + sonameparam = "" # gcc on mac os does not have the soname parameter + else: + sonameparam = "-Wl,-soname," + library + + run(cc + " " + ldflags + """ \ + -shared \ + """ + sonameparam + """ \ + build/libbirdfont/*.o \ + $(pkg-config --libs glib-2.0) \ + -o """ + library) + run("mv " + library + " build/bin/") + + if os.path.exists("build/bin/libbirdxml.so"): + run ("cd build/bin && unlink libbirdxml.so") + + # create link to the versioned library + if library.find ('.so') > -1: + run ("""cd build/bin && ln -sf """ + library + " libbirdxml.so") + elif library.find ('.dylib') > -1: + run ("""cd build/bin && ln -sf """ + library + " libbirdxml.dylib") + - def birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull = True): + def birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, nonNull = True): # birdfont-export run("mkdir -p build/birdfont-export") @@ -172,7 +227,7 @@ run("touch build/installed") run("touch build/configured") - def birdfont_import(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull = True): + def birdfont_import(prefix, cc, cflags, ldflags, valac, valaflags, nonNull = True): # birdfont-import run("mkdir -p build/birdfont-import") @@ -219,7 +274,7 @@ $(pkg-config --libs gdk-pixbuf-2.0) \ -o ./build/bin/birdfont-import""") - def birdfont_autotrace(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull = True): + def birdfont_autotrace(prefix, cc, cflags, ldflags, valac, valaflags, nonNull = True): # birdfont-autotrace run("mkdir -p build/birdfont-autotrace") @@ -267,7 +322,7 @@ -o ./build/bin/birdfont-autotrace""") - def birdfont_gtk(prefix, cc, cflags, ldflags, valac, valaflags, library, nonNull = True): + def birdfont_gtk(prefix, cc, cflags, ldflags, valac, valaflags, nonNull = True): # birdfont run("mkdir -p build/birdfont")
--- a/scripts/linux_build.py +++ b/scripts/linux_build.py @@ -48,16 +48,19 @@ cflags = options.cflags ldflags = options.ldflags library_cflags = options.cflags - library_ldflags= options.ldflags + " -Wl,-soname," + "libbirdfont.so." + version.SO_VERSION - library = "libbirdfont.so." + version.SO_VERSION + library_ldflags= options.ldflags + " -Wl,-soname," + "libbirdfont.so." + version.LIBBIRDXML_SO_VERSION + + xmllibrary_cflags = options.cflags + xmllibrary_ldflags= options.ldflags + " -Wl,-soname," + "libbirdxml.so." + version.SO_VERSION configfile.write_config (prefix) compile_translations() - build.libbirdfont(prefix, cc, cflags, library_ldflags, valac, valaflags, library, False) - build.birdfont_autotrace(prefix, cc, cflags, ldflags, valac, valaflags, library, False) - build.birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, library, False) - build.birdfont_import(prefix, cc, cflags, ldflags, valac, valaflags, library, False) - build.birdfont_gtk(prefix, cc, cflags, ldflags, valac, valaflags, library, False) + build.libbirdxml(prefix, cc, xmllibrary_cflags, xmllibrary_ldflags, valac, valaflags, "libbirdxml.so." + version.LIBBIRDXML_SO_VERSION, False) + build.libbirdfont(prefix, cc, library_cflags, library_ldflags, valac, valaflags, "libbirdfont.so." + version.SO_VERSION, False) + build.birdfont_autotrace(prefix, cc, cflags, ldflags, valac, valaflags, False) + build.birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, False) + build.birdfont_import(prefix, cc, cflags, ldflags, valac, valaflags, False) + build.birdfont_gtk(prefix, cc, cflags, ldflags, valac, valaflags, False) print ("Done")
--- a/scripts/mac_build.py +++ b/scripts/mac_build.py @@ -2,5 +2,5 @@ """ - Copyright (C) 2013 Johan Mattsson + Copyright (C) 2013 2014 Johan Mattsson This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -48,14 +48,17 @@ cc = options.cc cflags = options.cflags ldflags = options.ldflags - library_cflags = options.cflags - library_ldflags = options.ldflags + " " + """-dynamiclib -Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-compatibility_version,1.0,-current_version,1.0,-install_name,""" + prefix + """/lib/libbirdfont.dylib""" - library = "libbirdfont." + version.SO_VERSION + ".dylib" + library_cflags = "-fno-common -fPIC " + cflags + library_ldflags = options.ldflags + " " + """-dynamiclib -Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-compatibility_version,1.0,-current_version,1.0,-install_name,""" + prefix + """/lib/libbirdfont.dylib""" + + xml_library_cflags = "-fno-common -fPIC " + cflags + xml_library_ldflags = options.ldflags + " " + """-dynamiclib -Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-compatibility_version,1.0,-current_version,1.0,-install_name,""" + prefix + """/lib/libbirdxml.dylib""" configfile.write_config (prefix) compile_translations() - build.libbirdfont(prefix, cc, library_cflags, library_ldflags, valac, valaflags, library, False) + build.libbirdxml(prefix, cc, xml_library_cflags, xml_library_ldflags, valac, valaflags, "libbirdfont." + version.SO_VERSION + ".dylib", False) + build.libbirdfont(prefix, cc, library_cflags, library_ldflags, valac, valaflags, "libbirdxml." + version.LIBBIRDXML_SO_VERSION + ".dylib", False) build.birdfont_autotrace(prefix, cc, cflags, ldflags, valac, valaflags, library, False) build.birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, library, False) build.birdfont_import(prefix, cc, cflags, ldflags, valac, valaflags, library, False)
--- a/scripts/version.py +++ b/scripts/version.py @@ -2,22 +2,23 @@ """ Copyright (C) 2013, 2014 Johan Mattsson - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 3 of the + License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. """ VERSION = '1.4' SO_VERSION_MAJOR = '26' SO_VERSION_MINOR = '0' SO_VERSION = SO_VERSION_MAJOR + '.' + SO_VERSION_MINOR + + LIBBIRDXML_SO_VERSION_MAJOR = '0' + LIBBIRDXML_SO_VERSION_MINOR = '0' + LIBBIRDXML_SO_VERSION = LIBBIRDXML_SO_VERSION_MAJOR + '.' + LIBBIRDXML_SO_VERSION_MINOR;
--- a/scripts/windows_build.py +++ b/scripts/windows_build.py @@ -20,7 +20,6 @@ ldflags = "" library_cflags = "-Wl,-subsystem,windows " library_ldflags= ""; - library = "libbirdfont.dll" import configfile configfile.write_config (prefix) @@ -33,8 +32,9 @@ compile_translations() run("windres ./resources/win32/icon.rc -O coff -o ./build/icon.res") - build.libbirdfont(prefix, cc, cflags, library_ldflags, valac, valaflags, library) + build.libbirdxml(prefix, cc, cflags, library_ldflags, valac, valaflags, "libbirdxml.dll") + build.libbirdfont(prefix, cc, cflags, library_ldflags, valac, valaflags, "libbirdfont.dll") build.birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, library) print ("Done")