From 8445166561d5e9f849314adf80913a058b20abe0 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 14 May 2021 23:08:57 +1000 Subject: 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: --- config/darwin.config | 5 +++++ packages/gstreamer-1.0-core.package | 2 +- recipes/gstreamer-1.0-osx-framework.recipe | 9 +-------- recipes/pkg-config.recipe | 22 ++++++++++++++++++++++ 4 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 recipes/pkg-config.recipe 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') -- cgit v1.2.3