summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2021-05-14 23:08:57 +1000
committerMatthew Waters <matthew@centricular.com>2021-05-14 23:08:57 +1000
commit8445166561d5e9f849314adf80913a058b20abe0 (patch)
tree48f57980cb0959b25e74c092ed42a4592cb2782b
parent5ad371ab5e7c6473b8738c3172b44dca9312c63a (diff)
macos/universal: fix pkg-config packaging
When building for universal, the build-tools pkg-config is not sufficient as it is not built for the universal archs. We need to build our own version to distribute. Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/701>
-rw-r--r--config/darwin.config5
-rw-r--r--packages/gstreamer-1.0-core.package2
-rw-r--r--recipes/gstreamer-1.0-osx-framework.recipe9
-rw-r--r--recipes/pkg-config.recipe22
4 files changed, 29 insertions, 9 deletions
diff --git a/config/darwin.config b/config/darwin.config
index afc91166..6d8a1177 100644
--- a/config/darwin.config
+++ b/config/darwin.config
@@ -133,5 +133,10 @@ if use_ccache:
# Workaround for https://openradar.appspot.com/22671534 on 10.11.
env['gl_cv_func_getcwd_abort_bug'] = 'no'
+# for glib inside pkg-config
+env['glib_cv_stack_grows'] = 'yes'
+env['glib_cv_uscore'] = 'no'
+env['ac_cv_func_posix_getpwuid_r'] = 'yes'
+env['ac_cv_func_posix_getgrgid_r'] = 'yes'
moltenvk_prefix = os.path.join(home_dir, 'moltenvk')
diff --git a/packages/gstreamer-1.0-core.package b/packages/gstreamer-1.0-core.package
index a40dd5cb..90b7a9c6 100644
--- a/packages/gstreamer-1.0-core.package
+++ b/packages/gstreamer-1.0-core.package
@@ -18,7 +18,7 @@ class Package(custom.GStreamer, package.Package):
files_devel = ['gstreamer-1.0', 'gst-plugins-base-1.0:plugins_core_devel',
'gst-plugins-good-1.0:plugins_core_devel', 'gst-plugins-bad-1.0:plugins_core_devel']
platform_files = {
- Platform.DARWIN: ['gstreamer-1.0-osx-framework'],
+ Platform.DARWIN: ['gstreamer-1.0-osx-framework', 'pkg-config'],
Platform.IOS: ['gstreamer-ios-templates'],
Platform.ANDROID: ['gst-android-1.0'],
Platform.LINUX: ['bash-completion'],
diff --git a/recipes/gstreamer-1.0-osx-framework.recipe b/recipes/gstreamer-1.0-osx-framework.recipe
index 251367f8..facb91fc 100644
--- a/recipes/gstreamer-1.0-osx-framework.recipe
+++ b/recipes/gstreamer-1.0-osx-framework.recipe
@@ -9,9 +9,8 @@ class Recipe(recipe.Recipe):
version = '0.1'
stype = SourceType.CUSTOM
btype = BuildType.CUSTOM
- deps = ['gstreamer-1.0', 'gst-plugins-base-1.0', 'gst-plugins-bad-1.0']
+ deps = ['pkg-config', 'gstreamer-1.0', 'gst-plugins-base-1.0', 'gst-plugins-bad-1.0']
- files_bins = ['pkg-config']
files_library = ['lib/GStreamer']
async def _get_installed_gst_libs(self):
@@ -42,9 +41,3 @@ class Recipe(recipe.Recipe):
raise FatalError('No gstreamer libraries were found in the prefix!')
fwlib = DynamicFrameworkLibrary(self.config.min_osx_sdk_version, self.config.target_distro, install_name, install_name, libs, self.config.target_arch, env=self.env)
fwlib.create()
- # Copy pkg-config binary for projects that can't use the framework,
- # f.ex., the gstreamer rust bindings. This binary is standalone, so we
- # do not need to mangle the install_name entries.
- pkgconfig = os.path.join(self.config.build_tools_prefix, 'bin', 'pkg-config')
- bindir = os.path.join(self.config.prefix, 'bin')
- shutil.copy(pkgconfig, bindir)
diff --git a/recipes/pkg-config.recipe b/recipes/pkg-config.recipe
new file mode 100644
index 00000000..5b72d92b
--- /dev/null
+++ b/recipes/pkg-config.recipe
@@ -0,0 +1,22 @@
+# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
+
+
+class Recipe(recipe.Recipe):
+ name = 'pkg-config'
+ version = '0.29.2'
+ licenses = [License.GPLv2Plus]
+ stype = SourceType.TARBALL
+ url = 'https://pkgconfig.freedesktop.org/releases/pkg-config-%(version)s.tar.gz'
+ tarball_checksum = '6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591'
+ configure_options = '--with-internal-glib --disable-host-tool '
+ override_libtool = False
+
+ files_bins = ['pkg-config']
+ files_share = ['share/aclocal/pkg.m4']
+
+ def prepare(self):
+ # --define-prefix is too unreliable on Debian-like distros that have
+ # pkgconfig in /usr/lib/x86_64-linux-gnu etc. instead of in /usr/lib
+ if self.config.platform != Platform.LINUX:
+ self.configure_options += '--enable-define-prefix '
+ self.append_env('CFLAGS', '-Wno-error=format-nonliteral')