File: packaging.diff

package info (click to toggle)
olm 3.2.16%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,208 kB
  • sloc: cpp: 15,245; ansic: 10,894; java: 3,244; objc: 2,291; javascript: 1,882; python: 1,839; makefile: 439; sh: 245; asm: 7; xml: 1
file content (56 lines) | stat: -rw-r--r-- 1,730 bytes parent folder | download | duplicates (2)
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
53
54
55
56
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,3 +1,8 @@
 include include/olm/*.h
-include Makefile
 include olm_build.py
+include libolm/*
+include libolm/cmake/*
+include libolm/include/olm/*
+recursive-include libolm/lib *
+include libolm/src/*
+recursive-include libolm/tests *
--- a/olm_build.py
+++ b/olm_build.py
@@ -25,12 +25,29 @@
 
 DEVELOP = os.environ.get("DEVELOP")
 
-compile_args = ["-I../include"]
+compile_args = ["-Ilibolm/include"]
 
 if DEVELOP and DEVELOP.lower() in ["yes", "true", "1"]:
     link_args.append('-Wl,-rpath=../build')
 
-headers_build = subprocess.Popen("make headers", shell=True)
-headers_build.wait()
+# Try to build with cmake first, fall back to GNU make
+try:
+    subprocess.run(
+        ["cmake", ".", "-Bbuild", "-DBUILD_SHARED_LIBS=NO"],
+        cwd="libolm", check=True,
+    )
+    subprocess.run(
+        ["cmake", "--build", "build"],
+        cwd="libolm", check=True,
+    )
+except FileNotFoundError:
+    try:
+        # try "gmake" first because some systems have a non-GNU make
+        # installed as "make"
+        subprocess.run(["gmake", "static"], cwd="libolm", check=True)
+    except FileNotFoundError:
+        # some systems have GNU make installed without the leading "g"
+        # so give that a try (though this may fail if it isn't GNU make)
+        subprocess.run(["make", "static"], cwd="libolm", check=True)
 
 ffibuilder.set_source(
@@ -43,7 +60,7 @@
         #include <olm/sas.h>
     """,
     libraries=["olm"],
-    library_dirs=[os.path.join("..", "build")],
+    library_dirs=[os.path.join("libolm", "build")],
     extra_compile_args=compile_args,
     source_extension=".cpp", # we need to link the C++ standard library, so use a C++ extension
 )