Commit 26755a9
OpenSuSE build fixes
Changed files (12)
modifiedbirdfont/Main.valamodifiedconfiguremodifieddodo.pymodifiedinstall.pymodifiedlibbirdfont/CharDatabaseParser.valamodifiedlibbirdfont/Tool.valamodifiedresources/linux/birdfont.desktopmodifiedscripts/__init__.pymodifiedscripts/build.pymodifiedscripts/configfile.pymodifiedscripts/linux_build.pymodifiedscripts/version.py
Diff
@@ -28,7 +28,7 @@ public static int main (string[] arg) { string file; BirdFont.BirdFont birdfont; CharDatabaseParser db;- unowned Thread<int> db_thread;+ unowned Thread<CharDatabaseParser> db_thread; Mutex database_mutex = new Mutex (); Cond main_loop_idle = new Cond (); bool in_idle = false;@@ -56,7 +56,7 @@ public static int main (string[] arg) { } try {- db_thread = Thread.create<int> (db.load, false);+ db_thread = Thread.create<CharDatabaseParser> (db.load, false); // wait until main loop is done db.sync.connect (() => {@@ -18,6 +18,8 @@ WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' +gee = "";+ def test_program_version (program, a, b, c): print ("Checking for %s version >= %s.%s.%s" % (program, a, b, c)) process = subprocess.Popen (program + ' --version', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)@@ -42,19 +44,18 @@ def test_library_version (lib): print ("Looking for library: " + lib + "\t\t") process = subprocess.Popen ('pkg-config --modversion ' + lib, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) process.communicate()[0]- if not process.returncode == 0:- print (FAIL + "Can't find " + lib + ENDC)- exit (1) + return process.returncode == 0 def configure ():- if not test_program_version ("valac", 0, 17, 3):+ global gee+ + if not test_program_version ("valac", 0, 16, 0): print (FAIL + "valac is too old." + ENDC) exit (1) libs = [ 'cairo', - 'gdk-pixbuf-2.0', - 'gee-0.8',+ 'gdk-pixbuf-2.0', 'gio-2.0', 'glib-2.0', 'gtk+-2.0',@@ -64,7 +65,17 @@ def configure (): ] for lib in libs:- test_library_version (lib)+ if not test_library_version (lib):+ print (FAIL + "Can not find " + lib + ENDC)+ exit (1)++ if test_library_version ('gee-0.8'):+ gee = "gee-0.8"+ elif test_library_version ('gee-1.0'):+ gee = "gee-1.0"+ else:+ print (FAIL + "Can not find libgee (version 0.8 or version 1.0)." + ENDC)+ exit (1) run ('mkdir -p build') run ('touch build/configured')@@ -89,4 +100,4 @@ if not options.cc: configure () configfile.write_config (options.prefix)-configfile.write_compile_parameters (options.prefix, options.dest, options.cc)+configfile.write_compile_parameters (options.prefix, options.dest, options.cc, gee)@@ -18,13 +18,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. import os import glob import subprocess-import scripts.version+ from optparse import OptionParser from doit.tools import run_once from doit.action import CmdAction from scripts.bavala import Vala from scripts import version from scripts.translations import compile_translations+from scripts import config DOIT_CONFIG = { 'default_tasks': [@@ -45,7 +46,7 @@ LIBS = [ 'cairo', 'gdk-pixbuf-2.0', 'webkit-1.0',- 'gee-0.8'+ config.GEE ] def task_build ():@@ -8,18 +8,28 @@ from scripts import config from scripts import version from scripts.run import run -def install (file, dir, mode):+def getDest (file, dir): f = dest + prefix + dir + '/' s = file.rfind ('/') if s > -1: f += file[s + 1:] else: f += file+ return f+ +def install (file, dir, mode):+ f = getDest (file, dir) print ("install: " + f) run ('install -d ' + dest + prefix + dir) run ('install -m ' + `mode` + ' ' + file + ' ' + dest + prefix + dir + '/') installed.write (f + "\n") +def link (dir, file, linkname):+ 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") exit (1)@@ -30,18 +40,16 @@ if not os.path.exists ("build/installed"): parser = OptionParser() parser.add_option ("-d", "--dest", dest="dest", help="install to this directory", metavar="DEST")-parser.add_option ("-m", "--unzip-manpages", dest="nogzip", help="don't gzip manpages", action="store_false")+parser.add_option ("-m", "--nogzip", dest="nogzip", help="don't gzip manpages", default=False) parser.add_option ("-n", "--manpages-directory", dest="mandir", help="put man pages in this directory under prefix")+parser.add_option ("-l", "--libdir", dest="libdir", help="path to directory for shared libraries (lib or lib64).") (options, args) = parser.parse_args() if not options.dest: options.dest = "" -if not options.nogzip:- zip_manpages = False-else:- zip_manpages = true+nogzip = options.nogzip if not options.mandir: mandir = "/man/man1"@@ -63,35 +71,39 @@ for file in os.listdir('./icons'): install ('icons/' + file, '/share/birdfont/icons', 644) install ('resources/linux/birdfont.desktop', '/share/applications', 644)-install ('resources/linux/birdfont.png', '/share/icons/hicolor/48x48/apps', 644)+install ('resources/linux/birdfont.png', '/share/icons/hicolor/128x128/apps', 644) if os.path.isfile ('build/bin/birdfont'): install ('build/bin/birdfont', '/bin', 755) install ('build/bin/birdfont-export', '/bin', 755) -libdir = '/lib' #library-if platform.machine() == 'i386' or platform.machine() == 's390' or platform.machine() == 'ppc' or platform.machine() == 'armv7hl':- libdir = '/lib'-if platform.machine() == 'x86_64' or platform.machine() == 's390x' or platform.machine() == 'ppc64':- libdir = '/lib64'+if not options.libdir:+ if platform.machine() == 'i386' or platform.machine() == 's390' or platform.machine() == 'ppc' or platform.machine() == 'armv7hl':+ libdir = '/lib'+ elif platform.machine() == 'x86_64' or platform.machine() == 's390x' or platform.machine() == 'ppc64':+ libdir = '/lib64'+ else:+ libdir = '/lib'+else:+ libdir = options.libdir if os.path.isfile ('build/bin/libbirdfont.so.' + version.SO_VERSION): install ('build/bin/libbirdfont.so.' + version.SO_VERSION, libdir, 644)- install ('build/bin/libbirdfont.so', libdir, 644)+ link (libdir, 'libbirdfont.so.' + version.SO_VERSION, ' libbirdfont.so.' + version.SO_VERSION_MAJOR) elif os.path.isfile ('build/libbirdfont.so.' + version.SO_VERSION): install ('build/libbirdfont.so.' + version.SO_VERSION, libdir, 644)- install ('build/libbirdfont.so', libdir, 644)+ link (libdir, 'libbirdfont.so.' + version.SO_VERSION, ' libbirdfont.so.' + version.SO_VERSION_MAJOR) elif os.path.isfile ('build/bin/libbirdfont.' + version.SO_VERSION + '.dylib'): install ('build/bin/libbirdfont.' + version.SO_VERSION + '.dylib', libdir, 644)- install ('build/bin/libbirdfont.dylib', libdir, 644)+ link (libdir, 'libbirdfont.' + version.SO_VERSION + '.dylib', ' libbirdfont.dylib.' + version.SO_VERSION_MAJOR) else: print ("Can not find libbirdfont.") exit (1) #manpages-if zip_manpages:+if not nogzip: install ('build/birdfont.1.gz', mandir, 644) install ('build/birdfont-export.1.gz', mandir, 644) else:@@ -132,7 +132,7 @@ public class CharDatabaseParser : GLib.Object { } } - public int load () {+ public CharDatabaseParser load () { parse_all_entries (); IdleSource idle = new IdleSource ();@@ -145,7 +145,7 @@ public class CharDatabaseParser : GLib.Object { }); idle.attach (null); - return 0;+ return this; } static File get_unicode_database () {@@ -271,12 +271,14 @@ public class Tool : GLib.Object { cr.restore (); // FIXME: DELETE+ /* cr.save (); cr.set_line_width (2); cr.set_source_rgba (0/255.0, 100/255.0, 0/255.0, 1); cr.rectangle (x, y, w, h); cr.stroke (); cr.restore ();+ */ } /** Run pending events in main loop before continuing. */@@ -8,5 +8,6 @@ Icon=birdfont StartupWMClass=birdfont Terminal=false Type=Application-Categories=Graphics;+GenericName=Font Editor+Categories=Graphics;VectorGraphics; @@ -0,0 +1 @@+@@ -17,10 +17,11 @@ import os import shutil import subprocess import sys+import version from optparse import OptionParser from run import run -import configfile+import config def libbirdfont(prefix, cc, cflags, ldflags, valac, valaflags, library): #libbirdfont@@ -37,7 +38,7 @@ def libbirdfont(prefix, cc, cflags, ldflags, valac, valaflags, library): -H build/libbirdfont/birdfont.h \ libbirdfont/*.vala \ libbirdfont/OpenFontFormat/*.vala \- --pkg gee-0.8 \+ --pkg """ + config.GEE + """ \ --pkg libxml-2.0 \ --pkg gio-2.0 \ --pkg cairo \@@ -53,7 +54,7 @@ def libbirdfont(prefix, cc, cflags, ldflags, valac, valaflags, library): -c build/libbirdfont/*.c \ -fPIC \ -D 'GETTEXT_PACKAGE="birdfont"' \- $(pkg-config --cflags gee-0.8) \+ $(pkg-config --cflags """ + config.GEE + """) \ $(pkg-config --cflags libxml-2.0) \ $(pkg-config --cflags gio-2.0) \ $(pkg-config --cflags cairo) \@@ -66,7 +67,7 @@ def libbirdfont(prefix, cc, cflags, ldflags, valac, valaflags, library): -shared \ build/libbirdfont/*.o \ $(freetype-config --libs) \- $(pkg-config --libs gee-0.8) \+ $(pkg-config --libs """ + config.GEE + """) \ $(pkg-config --libs libxml-2.0) \ $(pkg-config --libs gio-2.0) \ $(pkg-config --libs cairo) \@@ -80,10 +81,18 @@ def libbirdfont(prefix, cc, cflags, ldflags, valac, valaflags, library): # create link to the versioned library if library.find ('.so') > -1:- run ("""cd build/bin && ln -s """ + library + " libbirdfont.so")+ run ("""cd build/bin && ln -sf """ + library + " libbirdfont.so") elif library.find ('.dylib') > -1:- run ("""cd build/bin && ln -s """ + library + " libbirdfont.dylib")- + run ("""cd build/bin && ln -sf """ + library + " libbirdfont.dylib")++ run("rm -f build/birdfont.1.gz")+ run("cp resources/linux/birdfont.1 build/")+ run("gzip build/birdfont.1") ++ run("rm -f build/birdfont-export.1.gz") + run("cp resources/linux/birdfont-export.1 build/")+ run("gzip build/birdfont-export.1")+ def birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, library): # birdfont-export@@ -95,7 +104,7 @@ def birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, library): --enable-experimental \ --define=MAC birdfont-export/* \ --vapidir=./ \- --pkg gee-0.8 \+ --pkg """ + config.GEE + """ \ --pkg libxml-2.0 \ --pkg gio-2.0 \ --pkg cairo \@@ -107,7 +116,7 @@ def birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, library): run(cc + " " + cflags + """ \ -c ./build/libbirdfont/birdfont.h build/birdfont-export/*.c \ -D 'GETTEXT_PACKAGE="birdfont"' \- $(pkg-config --cflags gee-0.8) \+ $(pkg-config --cflags """ + config.GEE + """) \ $(pkg-config --cflags libxml-2.0) \ $(pkg-config --cflags gio-2.0) \ $(pkg-config --cflags cairo) \@@ -119,7 +128,7 @@ def birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, library): run(cc + " " + ldflags + " \ build/birdfont-export/*.o \ -Lbuild/bin/ -lbirdfont \- $(pkg-config --libs gee-0.8) \+ $(pkg-config --libs """ + config.GEE + """) \ $(pkg-config --libs libxml-2.0) \ $(pkg-config --libs gio-2.0) \ $(pkg-config --libs cairo) \@@ -127,6 +136,14 @@ def birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, library): $(pkg-config --libs gdk-pixbuf-2.0) \ -o ./build/bin/birdfont-export""") + run("rm -f build/birdfont.1.gz")+ run("cp resources/linux/birdfont.1 build/")+ run("gzip -9 build/birdfont.1")++ run("rm -f build/birdfont-export.1.gz") + run("cp resources/linux/birdfont-export.1 build/")+ run("gzip -9 build/birdfont-export.1")+ run("touch build/installed") run("touch build/configured") @@ -140,7 +157,7 @@ def birdfont_gtk(prefix, cc, cflags, ldflags, valac, valaflags, library): --enable-experimental-non-null \ --enable-experimental \ --vapidir=./ \- --pkg gee-0.8 \+ --pkg """ + config.GEE + """ \ --pkg libxml-2.0 \ --pkg gio-2.0 \ --pkg cairo \@@ -154,7 +171,7 @@ def birdfont_gtk(prefix, cc, cflags, ldflags, valac, valaflags, library): run(cc + " " + cflags + """\ -c ./build/libbirdfont/birdfont.h build/birdfont/*.c \ -D 'GETTEXT_PACKAGE="birdfont"' \- $(pkg-config --cflags gee-0.8) \+ $(pkg-config --cflags """ + config.GEE + """) \ $(pkg-config --cflags libxml-2.0) \ $(pkg-config --cflags gio-2.0) \ $(pkg-config --cflags cairo) \@@ -167,7 +184,7 @@ def birdfont_gtk(prefix, cc, cflags, ldflags, valac, valaflags, library): run(cc + " " + ldflags + """ \ build/birdfont/*.o \ -Lbuild/bin/ -lbirdfont \- $(pkg-config --libs gee-0.8) \+ $(pkg-config --libs """ + config.GEE + """) \ $(pkg-config --libs libxml-2.0) \ $(pkg-config --libs gio-2.0) \ $(pkg-config --libs cairo) \@@ -15,6 +15,7 @@ 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/>. """+ import version import time; @@ -38,9 +39,10 @@ def write_config (prefix): f.write("}") -def write_compile_parameters (prefix, dest, cc):+def write_compile_parameters (prefix, dest, cc, gee): f = open('./scripts/config.py', 'w+') f.write("#!/usr/bin/python\n") f.write("PREFIX = \"" + prefix + "\"\n") f.write("DEST = \"" + dest + "\"\n") f.write("CC = \"" + cc + "\"\n")+ f.write("GEE = \"" + gee + "\"\n")@@ -48,7 +48,7 @@ cc = options.cc cflags = options.cflags ldflags = options.ldflags library_cflags = options.cflags-library_ldflags= options.ldflags+library_ldflags= options.ldflags + " -Wl,-soname," + "libbirdfont.so." + version.SO_VERSION library = "libbirdfont.so." + version.SO_VERSION configfile.write_config (prefix)@@ -17,4 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. """ VERSION = '0.31'-SO_VERSION = '7'+SO_VERSION_MAJOR = '7'+SO_VERSION_MINOR = '0'+SO_VERSION = SO_VERSION_MAJOR + '.' + SO_VERSION_MINOR