File: setup.py

package info (click to toggle)
mysql-workbench 5.2.40%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 53,880 kB
  • sloc: cpp: 419,850; yacc: 74,784; xml: 54,510; python: 31,455; sh: 9,423; ansic: 4,736; makefile: 2,442; php: 529; java: 237
file content (29 lines) | stat: -rw-r--r-- 838 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

from distutils.core import setup, Extension

import commands
import sys

def pkgconfig(*packages, **kw):
    flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'}
    for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split():
        kw.setdefault(flag_map.get(token[:2]), []).append(token[2:])
    return kw


extra_sources = []

if sys.platform in ["linux2"]:
  options = pkgconfig("sigc++-2.0 gtkmm-2.4")

  options["include_dirs"].append("..")
  options["library_dirs"] = ["../.libs"] + options.get("library_dirs", [])
  options["libraries"].append("mforms")
  extra_sources.append("linux_stubs.cxx")
else:
  print "Platform not supported"
  sys.exit(1)

setup(name = "mforms",
      ext_modules = [Extension("_mforms", ["mforms_wrap.cxx"] + extra_sources, **options)]
     )