The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Install libsvgbird

These changes was commited to the Birdfont repository Thu, 30 Jun 2016 21:39:23 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Thu, 30 Jun 2016 21:39:23 +0000]

Updated Files

dodo.py
install.py
libbirdfont/BirdFont.vala
libbirdfont/Font.vala
scripts/version.py
svgbird.deps
diff --git a/dodo.py b/dodo.py
--- a/dodo.py +++ b/dodo.py @@ -369,6 +369,8 @@ yield make_libbirdfont('libbirdfont.so.' + SO_VERSION, ['libbirdgems.so', 'libsvgbird.so']) def make_libsvgbird(target_binary, deps): + global version + valac_command = config.VALAC + """\ -C \ --vapidir=./ \ @@ -384,6 +386,7 @@ --pkg gio-2.0 \ --pkg cairo \ --pkg xmlbird \ + --vapi=./build/svgbird.vapi \ """ cc_command = config.CC + " " + config.CFLAGS.get("libsvgbird", "") + """ \ @@ -419,8 +422,23 @@ target_binary, link_name, deps) - + + f = open('./build/svgbird.pc', 'w+') + f.write("""prefix=""" + config.PREFIX + """ + exec_prefix=${prefix} + includedir=${prefix}/include + libdir=${exec_prefix}/lib + + Name: svgbird + Description: SVG library + Version: """ + version.LIBSVGBIRD_VERSION + """ + Cflags: -I${includedir} + Libs: -L${libdir} -lsvgbird + Requires: cairo, gobject-2.0, glib-2.0 + """) + yield libsvgbird.build() + def task_libsvgbird(): yield make_libsvgbird('libsvgbird.so.' + LIBSVGBIRD_SO_VERSION, [])
--- a/install.py +++ b/install.py @@ -49,7 +49,6 @@ print ("install: " + f) run ('install -d ' + dest + prefix + dir) run ('install -m ' + str(mode) + ' ' + file + ' ' + dest + prefix + dir + '/') - installed.write (f + "\n") def install_root (file, dir, mode): f = getDestRoot (file, dir) @@ -61,7 +60,6 @@ f = getDest (linkname, dir) print ("install link: " + f) run ('cd ' + dest + prefix + dir + ' && ln -sf ' + file + ' ' + linkname) - installed.write (f + "\n") if not os.path.exists ("build/configured"): print ("Project is not configured") @@ -74,6 +72,7 @@ parser.add_option ("-l", "--libdir", dest="libdir", help="path to directory for shared libraries (lib or lib64).") parser.add_option ("-c", "--skip-command-line-tools", dest="nocli", help="don't install command line tools") parser.add_option ("-a", "--apport", dest="apport", help="install apport scripts", default=True) + parser.add_option ('-v', '--development', dest='development', action="store_true", help='install development files', metavar='DEVELOPMENT') (options, args) = parser.parse_args() @@ -92,10 +91,6 @@ prefix = config.PREFIX dest = options.dest - - # create uninstall file - installed = open ('build/installed', 'w') - installed.write ('build/installed\n') # install it: install ('resources/icons.bf', '/share/birdfont', 644) @@ -144,7 +139,7 @@ libdir = options.libdir if "openbsd" in sys.platform: - install ('build/bin/libbirdfont.so.' + '${LIBbirdfont_VERSION}', '/lib', 644) + install ('build/bin/libbirdfont.so.' + '${LIBbirdfont_VERSION}', '/lib', 644) elif os.path.isfile ('build/bin/libbirdfont.so.' + version.SO_VERSION): install ('build/bin/libbirdfont.so.' + version.SO_VERSION, libdir, 644) link (libdir, 'libbirdfont.so.' + version.SO_VERSION, ' libbirdfont.so.' + version.SO_VERSION_MAJOR) @@ -179,9 +174,25 @@ print ("Can't find libbirdgems, version: " + version.LIBBIRDGEMS_SO_VERSION) exit (1) - - #manpages + if "openbsd" in sys.platform: + install ('build/bin/libsvgbird.so.' + '${LIBsvgbird_VERSION}', '/lib', 644) + elif os.path.isfile ('build/bin/libsvgbird.so.' + version.LIBSVGBIRD_SO_VERSION): + install ('build/bin/libsvgbird.so.' + version.LIBSVGBIRD_SO_VERSION, libdir, 644) + link (libdir, 'libsvgbird.so.' + version.LIBSVGBIRD_SO_VERSION, ' libsvgbird.so.' + version.LIBSVGBIRD_SO_VERSION_MAJOR) + link (libdir, 'libsvgbird.so.' + version.LIBSVGBIRD_SO_VERSION, ' libsvgbird.so') + elif os.path.isfile ('build/libsvgbird.so.' + version.LIBSVGBIRD_SO_VERSION): + install ('build/libsvgbird.so.' + version.LIBSVGBIRD_SO_VERSION, libdir, 644) + link (libdir, 'libsvgbird.so.' + version.LIBSVGBIRD_SO_VERSION, ' libsvgbird.so.' + version.LIBSVGBIRD_SO_VERSION_MAJOR) + link (libdir, 'libsvgbird.so.' + version.LIBSVGBIRD_SO_VERSION, ' libsvgbird.so') + elif os.path.isfile ('build/bin/libsvgbird.' + version.LIBSVGBIRD_SO_VERSION + '.dylib'): + install ('build/bin/libsvgbird.' + version.LIBSVGBIRD_SO_VERSION + '.dylib', libdir, 644) + link (libdir, 'libsvgbird.' + version.LIBSVGBIRD_SO_VERSION + '.dylib', ' libsvgbird.dylib.' + version.LIBSVGBIRD_SO_VERSION_MAJOR) + link (libdir, 'libsvgbird.' + version.LIBSVGBIRD_SO_VERSION + '.dylib', ' libsvgbird.dylib') + else: + print ("Can't find libsvgbird, version: " + version.LIBSVGBIRD_SO_VERSION) + exit (1) + #manpages if not nogzip: install ('build/birdfont.1.gz', mandir, 644) @@ -211,5 +222,10 @@ install ('resources/source_birdfont.py', '/share/apport/package-hooks', 644) install_root ('resources/birdfont-crashdb.conf', '/etc/apport/crashdb.conf.d', 644) - installed.close () + #install development files + if options.development: + install ('build/libsvgbird/svgbird.h', '/include', 644) + install ('build/svgbird.vapi', '/share/vala/vapi', 644) + install ('svgbird.deps', '/share/vala/vapi', 644) + install ('build/svgbird.pc', libdir + '/pkgconfig', 644)
--- a/libbirdfont/BirdFont.vala +++ b/libbirdfont/BirdFont.vala @@ -518,33 +518,33 @@ /** Obtain a handle to a file in a folder. */ public static File get_child (File folder, string file_name) { - string f; - string s; - string n; + string folder_path; + string separator; + string name; // avoid drive letter problems on windows - f = (!) folder.get_path (); + folder_path = (!) folder.get_path (); #if LINUX - s = "/"; + separator = "/"; #else - s = (BirdFont.win32) ? "\\" : "/"; + separator = (BirdFont.win32) ? "\\" : "/"; #endif - n = file_name; + name = file_name; if (unlikely (BirdFont.win32 && file_name.index_of ("\\") != -1)) { warning (@"File name contains path separator: $file_name, Directory: $f"); - n = n.substring (n.last_index_of ("\\")).replace ("\\", ""); + name = name.substring (name.last_index_of ("\\")).replace ("\\", ""); } - if (!f.has_suffix (s)) { - f += s; + if (!folder_path.has_suffix (separator)) { + folder_path += separator; } printd (@"File in Directory: $f Name: $n\n"); - return File.new_for_path (f + n); + return File.new_for_path (folder_path + name); } public static void set_drawing_callbacks (Drawing callbacks) {
--- a/libbirdfont/Font.vala +++ b/libbirdfont/Font.vala @@ -188,17 +188,15 @@ } public void add_default_characters () { - GlyphCollection notdef, space; + GlyphCollection notdef = get_notdef_character (); - notdef = get_notdef_character (); - - if (!has_glyph (notdef.get_name ()) { + if (!has_glyph (notdef.get_name ())) { add_glyph_collection (notdef); } - space = get_space (); + GlyphCollection space = get_space (); - if (!has_glyph (space.get_name ()) { + if (!has_glyph (space.get_name ())) { add_glyph_collection (space); } }
--- a/scripts/version.py +++ b/scripts/version.py @@ -22,7 +22,8 @@ LIBBIRDGEMS_SO_VERSION_MINOR = '0' LIBBIRDGEMS_SO_VERSION = LIBBIRDGEMS_SO_VERSION_MAJOR + '.' + LIBBIRDGEMS_SO_VERSION_MINOR + LIBSVGBIRD_VERSION = '0.0.0' LIBSVGBIRD_SO_VERSION_MAJOR = '0' LIBSVGBIRD_SO_VERSION_MINOR = '0' LIBSVGBIRD_SO_VERSION = LIBBIRDGEMS_SO_VERSION_MAJOR + '.' + LIBBIRDGEMS_SO_VERSION_MINOR
diff --git svgbird.deps(new)
--- /dev/null +++ b/svgbird.deps @@ -1,1 +1,3 @@ + gio-2.0 + cairo