summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py29
1 files changed, 27 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index f5f77fb..700ab4b 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,12 @@
# Written by René 'Necoro' Neumann <necoro@necoro.net>
import os
+import sys
+
from distutils.core import setup
+from distutils.extension import Extension
+from Cython.Distutils import build_ext
+
from portato.constants import VERSION, ICON_DIR, PLUGIN_DIR, TEMPLATE_DIR, APP
from build_manpage import build_manpage
@@ -21,12 +26,31 @@ def plugin_list (*args):
"""Creates a list of correct plugin pathes out of the arguments."""
return [("plugins/%s.py" % x) for x in args]
-packages = ["portato", "portato.db", "portato.gui", "portato.gui.windows", "portato.plugins", "portato.backend", "portato.backend.portage"]
+packages = [
+ "portato",
+ "portato.db",
+ "portato.gui", "portato.gui.windows",
+ "portato.plugins",
+ "portato.backend", "portato.backend.portage"
+ ]
+
data_files = [
(TEMPLATE_DIR, [os.path.join("portato/gui/templates",x) for x in os.listdir("portato/gui/templates") if x.endswith(".ui")]),
(ICON_DIR, ["icons/portato-icon.png"]),
(PLUGIN_DIR, plugin_list("gpytage", "notify", "etc_proposals", "reload_portage", "package_details"))]
+# extension stuff
+ext_modules = [Extension("portato.ipc", ["portato/ipc.pyx"])]
+
+if "--disable-eix" in sys.argv:
+ sys.argv.remove("--disable-eix")
+else:
+ ext_modules.append(Extension("portato.eix.parser", ["portato/eix/parser.pyx"]))
+ packages.append("portato.eix")
+
+ if "--enable-eix" in sys.argv:
+ sys.argv.remove("--enable-eix")
+
# do the distutils setup
setup(name=APP,
version = VERSION,
@@ -39,5 +63,6 @@ setup(name=APP,
author_email = "necoro@necoro.net",
packages = packages,
data_files = data_files,
- cmdclass={'build_manpage': build_manpage}
+ ext_modules = ext_modules,
+ cmdclass={'build_manpage': build_manpage, 'build_ext' : build_ext}
)