File: multiarch.patch

package info (click to toggle)
harp 1.26-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 57,780 kB
  • sloc: xml: 476,214; ansic: 170,387; sh: 4,898; yacc: 2,186; javascript: 1,510; python: 1,145; makefile: 653; lex: 591
file content (28 lines) | stat: -rw-r--r-- 881 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
--- a/python/_harppy.py
+++ b/python/_harppy.py
@@ -34,8 +34,10 @@
 import glob
 import numpy
 import os
+import subprocess
 from functools import reduce
 
+
 try:
     from cStringIO import StringIO
 except ImportError:
@@ -367,6 +369,14 @@
     if os.path.exists(library_path):
         return library_path
 
+    # Debian/Ubuntu
+    st,reply = subprocess.getstatusoutput('dpkg-architecture --query DEB_HOST_MULTIARCH')
+    if st != 0:
+        raise Exception("Multiarch check failed for libharp: %s" % reply)
+    library_path = os.path.join(os.path.normpath("/usr/lib"), reply, "libharp.so.10")
+    if os.path.exists(library_path):
+        return library_path
+
     # assume the library to be in the parent library directory
     library_path = os.path.normpath(os.path.join(os.path.dirname(__file__), "../../..", library_name))
     if not os.path.exists(library_path):