2023-04-26 00:47:37 +02:00
|
|
|
--- 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
|
2023-04-28 00:52:39 +02:00
|
|
|
@@ -25,12 +25,29 @@
|
2023-04-26 00:47:37 +02:00
|
|
|
|
|
|
|
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()
|
2023-04-27 23:19:53 +02:00
|
|
|
+# Try to build with cmake first, fall back to GNU make
|
2023-04-26 00:47:37 +02:00
|
|
|
+try:
|
|
|
|
+ subprocess.run(
|
|
|
|
+ ["cmake", ".", "-Bbuild", "-DBUILD_SHARED_LIBS=NO"],
|
|
|
|
+ cwd="libolm", check=True,
|
|
|
|
+ )
|
|
|
|
+ subprocess.run(
|
|
|
|
+ ["cmake", "--build", "build"],
|
|
|
|
+ cwd="libolm", check=True,
|
|
|
|
+ )
|
|
|
|
+except FileNotFoundError:
|
2023-04-27 23:19:53 +02:00
|
|
|
+ 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)
|
2023-04-26 00:47:37 +02:00
|
|
|
|
|
|
|
ffibuilder.set_source(
|
2023-04-28 00:52:39 +02:00
|
|
|
@@ -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
|
|
|
|
)
|