summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Shpuntov <roman.x149x@gmail.com>2019-11-22 09:46:14 +0000
committerNirbheek Chauhan <nirbheek@centricular.com>2019-11-27 13:00:54 +0530
commit8e5a4355021df06ee863dc6751256867e166d118 (patch)
tree4c90286f573cd9f81e1735c45ad1f170090c3d63
parent8ccfcadc559c72e7a222a5d479b4014b1d19c007 (diff)
macos package: add min version option for build macos framework
https://gitlab.freedesktop.org/gstreamer/cerbero/issues/144 For upload to the AppStore is required LC_VERSION_MIN_MACOSX option for all app bin files inside the package, this is achieved using the option -mmacosx-version-min
-rw-r--r--cerbero/ide/xcode/fwlib.py18
-rw-r--r--cerbero/packages/osx/packager.py4
-rw-r--r--recipes/gstreamer-1.0-osx-framework.recipe2
3 files changed, 16 insertions, 8 deletions
diff --git a/cerbero/ide/xcode/fwlib.py b/cerbero/ide/xcode/fwlib.py
index 5ea8ffd2..151aa150 100644
--- a/cerbero/ide/xcode/fwlib.py
+++ b/cerbero/ide/xcode/fwlib.py
@@ -23,7 +23,7 @@ import shutil
import subprocess
from collections import defaultdict
-from cerbero.config import Architecture
+from cerbero.config import Distro, Architecture
from cerbero.ide.pkgconfig import PkgConfig
from cerbero.utils import shell
from cerbero.utils import messages as m
@@ -37,8 +37,10 @@ class FrameworkLibrary(object):
but full paths can be used too with use_pkgconfig=False
'''
- def __init__(self, libname, install_name, libraries, arch):
+ def __init__(self, min_version, target, libname, install_name, libraries, arch):
self.libname = libname
+ self.min_version = min_version
+ self.target = target
self.install_name = install_name
self.libraries = libraries
self.arch = arch
@@ -78,9 +80,15 @@ class FrameworkLibrary(object):
class DynamicFrameworkLibrary(FrameworkLibrary):
def _create_framework_library(self, libraries):
- libraries = ' '.join(['-Wl,-reexport_library %s' % x for x in libraries])
- shell.call('clang -dynamiclib -o %s -arch %s -install_name %s %s' %
- (self.libname, self.arch, self.install_name, libraries))
+ cmdline = ['clang', '-dynamiclib', '-o', self.libname, '-arch', self.arch]
+ if self.target == Distro.OS_X:
+ cmdline += ['-mmacosx-version-min=%s' % self.min_version]
+
+ cmdline += ['-install_name', self.install_name]
+ for lib in libraries:
+ cmdline += ['-Wl,-reexport_library', lib]
+
+ shell.new_call(cmdline)
def _get_lib_file_name(self, lib):
return 'lib%s.dylib' % lib
diff --git a/cerbero/packages/osx/packager.py b/cerbero/packages/osx/packager.py
index 1771adde..436f21ca 100644
--- a/cerbero/packages/osx/packager.py
+++ b/cerbero/packages/osx/packager.py
@@ -571,8 +571,8 @@ class IOSPackage(ProductPackage, FrameworkHeadersMixin):
# Get the list of static libraries
static_files = [x for x in files if x.endswith('.a')]
- fwlib = StaticFrameworkLibrary(libname, libname, static_files,
- self.config.target_arch)
+ fwlib = StaticFrameworkLibrary(self.config.ios_min_version, self.config.target_distro,
+ libname, libname, static_files, self.config.target_arch)
fwlib.use_pkgconfig = False
if self.config.target_arch == Architecture.UNIVERSAL:
fwlib.universal_archs = self.config.universal_archs
diff --git a/recipes/gstreamer-1.0-osx-framework.recipe b/recipes/gstreamer-1.0-osx-framework.recipe
index 4d8fb6b4..49ea2e39 100644
--- a/recipes/gstreamer-1.0-osx-framework.recipe
+++ b/recipes/gstreamer-1.0-osx-framework.recipe
@@ -30,5 +30,5 @@ class Recipe(recipe.Recipe):
'gstreamer-insertbin-1.0', 'gstreamer-mpegts-1.0',
'gstreamer-player-1.0'
]
- fwlib = DynamicFrameworkLibrary(install_name, install_name, libs, self.config.target_arch)
+ fwlib = DynamicFrameworkLibrary(self.config.min_osx_sdk_version, self.config.target_distro, install_name, install_name, libs, self.config.target_arch)
fwlib.create()