summaryrefslogtreecommitdiff
path: root/x11/py-sip/patches/patch-aa
blob: 3e5a7d27ce69e7404fa056483d9a30b5d3ed34fe (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$NetBSD: patch-aa,v 1.7 2013/08/23 11:25:38 drochner Exp $

--- configure.py.orig	2013-08-21 05:25:44.000000000 +0000
+++ configure.py
@@ -19,6 +19,7 @@ import sys
 import os
 import glob
 import optparse
+import imp
 from distutils import sysconfig
 
 try:
@@ -218,7 +219,7 @@ def set_platform_directories():
 
         plat_py_lib_dir = lib_dir + "/config"
         plat_bin_dir = sys.exec_prefix + "/bin"
-        plat_sip_dir = sys.prefix + "/share/sip"
+        plat_sip_dir = sys.prefix + "/share/sip%s" % sys.version[0:3]
 
 
 def patch_files():
@@ -271,7 +272,7 @@ def create_config(module, template, macr
         "sip_version":      sip_version,
         "sip_version_str":  sip_version_str,
         "platform":         opts.platform,
-        "sip_bin":          os.path.join(opts.sipbindir, "sip"),
+        "sip_bin":          os.path.join(opts.sipbindir, "sip%s" % sys.version[0:3]),
         "sip_inc_dir":      opts.sipincdir,
         "sip_mod_dir":      opts.sipmoddir,
         "default_bin_dir":  plat_bin_dir,
@@ -305,11 +306,19 @@ def create_makefiles(macros):
 
     sipconfig.inform("Creating top level Makefile...")
 
+    pyc_file = "sipconfig.pyc"
+    pyc_dir = cfg.sip_mod_dir
+    try:
+        pyc_file = imp.cache_from_source("sipconfig.py")
+        pyc_dir = os.path.join(cfg.sip_mod_dir, "__pycache__")
+    except AttributeError:
+        pass
+
     sipconfig.ParentMakefile(
         configuration=cfg,
         subdirs=["sipgen", "siplib"],
-        installs=(["sipconfig.py", os.path.join(src_dir, "sipdistutils.py")],
-                cfg.sip_mod_dir)
+        installs=[(["sipconfig.py", os.path.join(src_dir, "sipdistutils.py")],
+                cfg.sip_mod_dir), ([pyc_file], pyc_dir)]
     ).generate()
 
     sipconfig.inform("Creating sip code generator Makefile...")