The Birdfont Source Code


All Repositories / birdfont.git / blob – RSS feed

linux_build.py in scripts

This file is a part of the Birdfont project.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git

Revisions

View the latest version of scripts/linux_build.py.
Create new paths in pen tool
1 #!/usr/bin/python 2 """ 3 Copyright (C) 2013 2014 Johan Mattsson 4 5 This library is free software; you can redistribute it and/or modify 6 it under the terms of the GNU Lesser General Public License as 7 published by the Free Software Foundation; either version 3 of the 8 License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, but 11 WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 """ 15 16 import build 17 from translations import compile_translations 18 import configfile 19 from run import run 20 import version 21 from optparse import OptionParser 22 23 parser = OptionParser() 24 parser.add_option("-p", "--prefix", dest="prefix", help="install prefix", metavar="PREFIX") 25 parser.add_option("-d", "--dest", dest="dest", help="install to this directory", metavar="DEST") 26 parser.add_option("-c", "--cc", dest="cc", help="select the C compiler", metavar="CC") 27 parser.add_option("-f", "--cflags", dest="cflags", help="set compiler flags", metavar="CFLAGS") 28 parser.add_option("-l", "--ldflags", dest="ldflags", help="set linker flags", metavar="LDFLAGS") 29 parser.add_option("-v", "--valac", dest="valac", help="select vala compiler", metavar="VALAC") 30 parser.add_option("-w", "--valac-flags", dest="valaflags", help="vala flags", metavar="VALAFLAGS") 31 32 (options, args) = parser.parse_args() 33 34 if not options.prefix: 35 options.prefix = "/usr/local" 36 if not options.cc: 37 options.cc = "gcc" 38 if not options.cflags: 39 options.cflags = "" 40 if not options.ldflags: 41 options.ldflags = "" 42 if not options.valac: 43 options.valac = "valac" 44 if not options.valaflags: 45 options.valaflags = "" 46 47 prefix = options.prefix 48 valac = options.valac 49 valaflags = options.valaflags + " --pkg gdk-pixbuf-2.0 --pkg gtk+-3.0" 50 cc = options.cc 51 cflags = options.cflags + " " + "$(pkg-config --cflags gdk-pixbuf-2.0)" 52 ldflags = options.ldflags + " " + "$(pkg-config --libs gdk-pixbuf-2.0)" 53 library_cflags = options.cflags 54 library_ldflags= options.ldflags + " -Wl,-soname," + "libbirdfont.so." + version.LIBBIRDXML_SO_VERSION 55 56 xmllibrary_cflags = options.cflags 57 xmllibrary_ldflags= options.ldflags + " -Wl,-soname," + "libbirdxml.so." + version.SO_VERSION 58 59 configfile.write_config (prefix) 60 compile_translations() 61 build.libbirdxml(prefix, cc, xmllibrary_cflags, xmllibrary_ldflags, valac, valaflags, "libbirdxml.so." + version.LIBBIRDXML_SO_VERSION, False) 62 build.libbirdfont(prefix, cc, library_cflags, library_ldflags, valac, valaflags, "libbirdfont.so." + version.SO_VERSION, False) 63 build.birdfont_autotrace(prefix, cc, cflags, ldflags, valac, valaflags, False) 64 build.birdfont_export(prefix, cc, cflags, ldflags, valac, valaflags, False) 65 build.birdfont_import(prefix, cc, cflags, ldflags, valac, valaflags, False) 66 build.birdfont_gtk(prefix, cc, cflags, ldflags, valac, valaflags, False) 67 68 print ("Done") 69