summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index 96cc070..931ba3f 100644
--- a/setup.py
+++ b/setup.py
@@ -11,10 +11,20 @@
#
# Written by René 'Necoro' Neumann <necoro@necoro.net>
-import os, os.path
+import sys, os, os.path
from distutils.core import setup, Extension
from portato.constants import FRONTENDS, VERSION, DATA_DIR, ICON_DIR, PLUGIN_DIR, TEMPLATE_DIR
+### copied from shm's setup.py ###
+MacrosAndDefines = [ ]
+
+# HAVE_UNION_SEMUN needs to be #defined on FreeBSD and OS X and must *not* be #defined
+# on Linux. On other systems, I'm not sure. Please let me know if you find that you
+# need to make changes for your platform.
+if ("bsd" in sys.platform) or ("darwin" in sys.platform):
+ MacrosAndDefines.append( ('HAVE_UNION_SEMUN', None) )
+### end copy ###
+
def plugin_list (*args):
"""Creates a list of correct plugin pathes out of the arguments."""
return [("plugins/%s.xml" % x) for x in args]
@@ -24,10 +34,11 @@ def ui_file_list ():
uis = [x for x in os.listdir("portato/gui/templates/ui/") if x.endswith(".ui")]
return [os.path.join("portato/gui/templates/ui",x) for x in uis]
-packages = ["portato", "portato.gui", "portato.plugins", "portato.backend", "portato.backend.portage", "portato.backend.catapult"]
-ext_modules = []
+packages = ["portato", "portato.gui", "portato.plugins", "portato.backend", "portato.backend.portage", "portato.backend.catapult", "portato.shm"]
+ext_modules = [Extension("portato.shm.shm", ["shm/shmmodule.c"], define_macros = MacrosAndDefines, extra_compile_args=["-fPIC"])]
data_files = [(ICON_DIR, ["icons/portato-icon.png"]), (PLUGIN_DIR, plugin_list("shutdown", "resume_loop")), (DATA_DIR, ["plugin.xsd", "ebuild.lang"])]
cmdclass = {}
+package_dir = {"portato.shm" : "shm"}
if "gtk" in FRONTENDS:
packages.append("portato.gui.gtk")
@@ -48,5 +59,6 @@ setup(name="Portato",
packages = packages,
data_files = data_files,
ext_modules = ext_modules,
- cmdclass = cmdclass
+ cmdclass = cmdclass,
+ package_dir = package_dir
)