summaryrefslogtreecommitdiff
path: root/recipes
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2023-05-31 11:13:24 +1000
committerMatthew Waters <matthew@centricular.com>2023-06-04 13:42:51 +1000
commit1cf026d1d7852485442eb76d2402586d753f8417 (patch)
treec703e5740b54f277c44631a5b7c91b61a885e0b7 /recipes
parent976ca291952c026df38a49dcec945ba05b9d04db (diff)
android: remove all traces of gnustl
The relevant c++ standard library is now automaticaly added by the compiler/linker and our gross hack involving gnustl.pc/la is not longer needed. Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1191>
Diffstat (limited to 'recipes')
-rw-r--r--recipes/gnustl.recipe74
-rw-r--r--recipes/openh264.recipe2
-rw-r--r--recipes/openh264/0001-depend-on-gnustl-for-android.patch40
-rw-r--r--recipes/soundtouch.recipe3
-rw-r--r--recipes/soundtouch/0001-Add-minimal-meson-build-system.patch21
-rw-r--r--recipes/soundtouch/0002-add-support-for-linking-with-gnustl-on-android.patch49
-rw-r--r--recipes/srt.recipe2
-rw-r--r--recipes/taglib.recipe3
-rw-r--r--recipes/taglib/0001-Link-with-correct-STL-on-Android.patch82
-rw-r--r--recipes/wavpack.recipe2
-rw-r--r--recipes/webrtc-audio-processing.recipe6
11 files changed, 15 insertions, 269 deletions
diff --git a/recipes/gnustl.recipe b/recipes/gnustl.recipe
deleted file mode 100644
index 32289166..00000000
--- a/recipes/gnustl.recipe
+++ /dev/null
@@ -1,74 +0,0 @@
-# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
-import shutil
-
-from cerbero.tools.libtool import LibtoolLibrary
-from cerbero.tools.pkgconfig import PkgConfigWritter
-
-class Recipe(recipe.Recipe):
- name = 'gnustl'
- version = '0.1'
- licenses = [License.LGPLv2_1Plus]
- stype = SourceType.CUSTOM
- btype = BuildType.CUSTOM
- runtime_dep = True
-
- files_stl = [
- '%(libdir)s/libc++_shared.so']
- files_devel= [
- '%(libdir)s/pkgconfig/gnustl.pc',
- '%(libdir)s/libgnustl.la',
- ]
-
- def prepare(self):
- if self.config.target_platform != Platform.ANDROID:
- raise InvalidRecipeError(self, "Invalid platform")
-
- async def compile(self):
- if not os.path.exists(self.config.libdir):
- os.makedirs(self.config.libdir)
-
- async def install(self):
- stl_prefix = os.path.join(self.config.toolchain_prefix, 'sources',
- 'cxx-stl', 'llvm-libc++')
- if self.config.target_arch == Architecture.X86:
- libarch = 'x86'
- elif self.config.target_arch == Architecture.X86_64:
- libarch = 'x86_64'
- elif self.config.target_arch == Architecture.ARMv7:
- libarch = 'armeabi-v7a'
- elif self.config.target_arch == Architecture.ARM64:
- libarch = 'arm64-v8a'
- elif self.config.target_arch == Architecture.ARM:
- libarch = 'armeabi'
- else:
- raise FatalError("Unsupported Android architecture %s" % self.config.target_arch)
- stl_libdir = os.path.join(stl_prefix, 'libs', libarch)
- libdir = self.config.libdir
- if not os.path.exists(libdir):
- os.makedirs(libdir)
-
- # Copies libraries to the prefix
- shutil.copy(os.path.join(stl_libdir, 'libc++_shared.so'),
- os.path.join(libdir, 'libc++_shared.so'))
-
- # Create a libtool library for gnustl (libgnustl.la)
- lib = LibtoolLibrary('gnustl', None, None, None, libdir,
- self.config.target_platform)
- lib.change_value('dlname', 'libc++_shared.so')
- lib.change_value('library_names', 'libc++_shared.so libc++_shared.so libc++_shared.so')
- lib.change_value('old_library', '')
- lib.change_value('dependency_libs', '-lc++_shared')
- lib.save()
-
- # Create pkg-config file (gnustl.pc)
- pkgdir = os.path.join(self.config.libdir, 'pkgconfig')
- if not os.path.exists(pkgdir):
- os.makedirs(pkgdir)
- stl_pc = PkgConfigWritter('gnustl', 'gnustl', '2.0',
- '', '-L${libdir} ${libdir}/libc++_shared.so',
- # FIXME: slurp these headers into the cerbero directory somehow so that they are usable from c++ applications
- '-I%s/include' % (stl_prefix),
- self.config.prefix,
- self.config.rel_libdir)
- stl_pc.rel_incldir = 'include'
- stl_pc.save('gnustl', pkgdir)
diff --git a/recipes/openh264.recipe b/recipes/openh264.recipe
index cb894bb3..1cb48175 100644
--- a/recipes/openh264.recipe
+++ b/recipes/openh264.recipe
@@ -26,7 +26,7 @@ class Recipe(recipe.Recipe):
elif self.config.target_platform == Platform.DARWIN:
dependency_libs += ['-lc++']
elif self.config.target_platform == Platform.ANDROID:
- dependency_libs += ['gnustl', '-lm']
+ dependency_libs += ['-lm']
elif self.config.target_platform in [Platform.WINDOWS, Platform.LINUX]:
dependency_libs += ['-lstdc++', '-lm']
else:
diff --git a/recipes/openh264/0001-depend-on-gnustl-for-android.patch b/recipes/openh264/0001-depend-on-gnustl-for-android.patch
deleted file mode 100644
index 2b94b644..00000000
--- a/recipes/openh264/0001-depend-on-gnustl-for-android.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From f6bf68f9778294dd6b9a78870a31ab8e578d5862 Mon Sep 17 00:00:00 2001
-From: Matthew Waters <matthew@centricular.com>
-Date: Tue, 10 Mar 2020 14:05:18 +1100
-Subject: [PATCH] depend on gnustl for android
-
-HACK for cerbero environment
----
- meson.build | 8 +++++++-
- 1 file changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/meson.build b/meson.build
-index 1afb712..a649f75 100644
---- a/meson.build
-+++ b/meson.build
-@@ -95,8 +95,10 @@ if ['linux', 'android', 'ios', 'darwin'].contains(system)
- error ('FIXME: unhandled CPU family @0@ for @1@'.format(cpu_family, system))
- endif
-
-- if ['ios', 'darwin', 'android'].contains(system)
-+ if ['ios', 'darwin'].contains(system)
- cpp_lib = '-lc++'
-+ elif system == 'android'
-+ cpp_lib = ''
- endif
- elif system == 'windows'
- if cpu_family == 'x86'
-@@ -123,6 +125,10 @@ if ['x86', 'x86_64'].contains(cpu_family)
- '-o', '@OUTPUT@'] + asm_args)
- endif
-
-+if system == 'android'
-+ deps += dependency('gnustl')
-+endif
-+
- api_headers = []
- api_header_deps = []
-
---
-2.25.1
-
diff --git a/recipes/soundtouch.recipe b/recipes/soundtouch.recipe
index 434ca304..ffe293f0 100644
--- a/recipes/soundtouch.recipe
+++ b/recipes/soundtouch.recipe
@@ -14,7 +14,6 @@ class Recipe(recipe.Recipe):
patches = [
'soundtouch/0008-Fix-compilation-with-clang.patch',
'soundtouch/0001-Add-minimal-meson-build-system.patch',
- 'soundtouch/0002-add-support-for-linking-with-gnustl-on-android.patch',
]
files_libs = ['libSoundTouch']
@@ -30,7 +29,7 @@ class Recipe(recipe.Recipe):
def post_install (self):
dependency_libs = []
if self.config.target_platform == Platform.ANDROID:
- dependency_libs += ['gnustl', '-lm']
+ dependency_libs += ['-lm']
lib = LibtoolLibrary('SoundTouch', None, None, None, self.config.libdir,
self.config.target_platform, deps=dependency_libs)
diff --git a/recipes/soundtouch/0001-Add-minimal-meson-build-system.patch b/recipes/soundtouch/0001-Add-minimal-meson-build-system.patch
index 1802d641..f89ec789 100644
--- a/recipes/soundtouch/0001-Add-minimal-meson-build-system.patch
+++ b/recipes/soundtouch/0001-Add-minimal-meson-build-system.patch
@@ -1,17 +1,17 @@
-From 7c746092ff0d50ec62200374d2b532b697565490 Mon Sep 17 00:00:00 2001
+From b9d5346b04f2b77d59de3690e3f705c5a0d101d3 Mon Sep 17 00:00:00 2001
From: Matthew Waters <matthew@centricular.com>
Date: Mon, 22 Oct 2018 21:05:58 +1100
-Subject: [PATCH 1/2] Add minimal meson build system
+Subject: [PATCH] Add minimal meson build system
No optimisations (mmx or sse)
---
include/meson.build | 17 ++++++++
- meson.build | 42 ++++++++++++++++++++
+ meson.build | 43 ++++++++++++++++++++
meson_options.txt | 9 +++++
source/SoundStretch/meson.build | 11 ++++++
source/SoundTouch/meson.build | 69 +++++++++++++++++++++++++++++++++
source/meson.build | 2 +
- 6 files changed, 150 insertions(+)
+ 6 files changed, 151 insertions(+)
create mode 100644 include/meson.build
create mode 100644 meson.build
create mode 100644 meson_options.txt
@@ -44,10 +44,10 @@ index 0000000..03bee39
+)
diff --git a/meson.build b/meson.build
new file mode 100644
-index 0000000..e2850e0
+index 0000000..4d56edc
--- /dev/null
+++ b/meson.build
-@@ -0,0 +1,42 @@
+@@ -0,0 +1,43 @@
+project('SoundTouch', 'c', 'cpp',
+ version : '2.0.0',
+ meson_version : '>= 0.47',
@@ -76,6 +76,7 @@ index 0000000..e2850e0
+
+libm = cxx.find_library('m', required : false)
+
++platform_deps = [libm]
+soundtouch_inc = include_directories('include')
+
+subdir('include')
@@ -124,7 +125,7 @@ index 0000000..aa57488
+)
diff --git a/source/SoundTouch/meson.build b/source/SoundTouch/meson.build
new file mode 100644
-index 0000000..99bdb09
+index 0000000..9bfcf96
--- /dev/null
+++ b/source/SoundTouch/meson.build
@@ -0,0 +1,69 @@
@@ -189,13 +190,13 @@ index 0000000..99bdb09
+ soversion: soversion,
+ install: true,
+ include_directories: [soundtouch_inc],
-+ dependencies: [libm]
++ dependencies: platform_deps
+)
+
+soundtouch_dep = declare_dependency(
+ link_with: libsoundtouch,
+ include_directories: [soundtouch_inc],
-+ dependencies: [libm]
++ dependencies: platform_deps
+)
diff --git a/source/meson.build b/source/meson.build
new file mode 100644
@@ -206,5 +207,5 @@ index 0000000..19a56de
+subdir('SoundTouch')
+subdir('SoundStretch')
--
-2.19.0
+2.40.1
diff --git a/recipes/soundtouch/0002-add-support-for-linking-with-gnustl-on-android.patch b/recipes/soundtouch/0002-add-support-for-linking-with-gnustl-on-android.patch
deleted file mode 100644
index a594d461..00000000
--- a/recipes/soundtouch/0002-add-support-for-linking-with-gnustl-on-android.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From d1d13721d97da7adb9316aa0cc4492cca2116de7 Mon Sep 17 00:00:00 2001
-From: Matthew Waters <matthew@centricular.com>
-Date: Mon, 22 Oct 2018 21:50:53 +1100
-Subject: [PATCH 2/2] add support for linking with gnustl on android
-
----
- meson.build | 6 ++++++
- source/SoundTouch/meson.build | 4 ++--
- 2 files changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index e2850e0..3e8aeda 100644
---- a/meson.build
-+++ b/meson.build
-@@ -24,7 +24,13 @@ have_mmx = false
- have_sse = false
- # FIXME Check for cpuid.h
-
-+platform_deps = []
- libm = cxx.find_library('m', required : false)
-+platform_deps += libm
-+
-+if host_machine.system() == 'android'
-+ platform_deps += dependency('gnustl')
-+endif
-
- soundtouch_inc = include_directories('include')
-
-diff --git a/source/SoundTouch/meson.build b/source/SoundTouch/meson.build
-index 99bdb09..9bfcf96 100644
---- a/source/SoundTouch/meson.build
-+++ b/source/SoundTouch/meson.build
-@@ -59,11 +59,11 @@ libsoundtouch = library('SoundTouch',
- soversion: soversion,
- install: true,
- include_directories: [soundtouch_inc],
-- dependencies: [libm]
-+ dependencies: platform_deps
- )
-
- soundtouch_dep = declare_dependency(
- link_with: libsoundtouch,
- include_directories: [soundtouch_inc],
-- dependencies: [libm]
-+ dependencies: platform_deps
- )
---
-2.19.0
-
diff --git a/recipes/srt.recipe b/recipes/srt.recipe
index 1c94fe76..94168dd3 100644
--- a/recipes/srt.recipe
+++ b/recipes/srt.recipe
@@ -26,8 +26,6 @@ class Recipe(recipe.Recipe):
self.deps.append('openssl')
if self.config.target_platform == Platform.ANDROID:
self.append_env('CXXFLAGS', '-frtti', '-fexceptions')
- self.configure_options += ' -DUSE_GNUSTL=ON'
- self.deps.append('gnustl')
def post_install(self):
libtool_la = LibtoolLibrary('srt', None, None, None, self.config.libdir,
diff --git a/recipes/taglib.recipe b/recipes/taglib.recipe
index 8f183e1d..d7269d7b 100644
--- a/recipes/taglib.recipe
+++ b/recipes/taglib.recipe
@@ -24,7 +24,6 @@ class Recipe(recipe.Recipe):
cmake_generator = 'ninja'
patches = [
- 'taglib/0001-Link-with-correct-STL-on-Android.patch',
'taglib/0002-Build-a-static-and-non-static-version.patch',
# https://github.com/taglib/taglib/pull/1071
'taglib/0003-cmake-generate-pc-file-with-the-use-of-prefix-in-lib.patch',
@@ -54,8 +53,6 @@ class Recipe(recipe.Recipe):
def post_install(self):
deps = ['z']
- if self.config.target_platform == Platform.ANDROID:
- deps.append('gnustl')
libtool_la = LibtoolLibrary('tag', 1, 7, None, self.config.libdir,
self.config.target_platform, deps)
libtool_la.save()
diff --git a/recipes/taglib/0001-Link-with-correct-STL-on-Android.patch b/recipes/taglib/0001-Link-with-correct-STL-on-Android.patch
deleted file mode 100644
index 30fe1054..00000000
--- a/recipes/taglib/0001-Link-with-correct-STL-on-Android.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 7d759960c628ecaff5f80a8c6c42842ecd96829d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
-Date: Sat, 17 Dec 2016 22:39:47 +0200
-Subject: [PATCH 1/2] Link with correct STL on Android
-
----
- CMakeLists.txt | 15 +++++++++++----
- bindings/c/CMakeLists.txt | 2 +-
- taglib.pc.cmake | 2 +-
- taglib/CMakeLists.txt | 4 ++++
- 4 files changed, 17 insertions(+), 6 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index a59efc9..0dd8e6e 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -53,10 +53,17 @@ if(APPLE)
- set(FRAMEWORK_INSTALL_DIR "/Library/Frameworks" CACHE STRING "Directory to install frameworks to.")
- endif()
-
--if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
-- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
--endif()
-+if (ANDROID_NDK)
-+ include(FindPkgConfig)
-+ pkg_check_modules (GNUSTL gnustl)
-+ set (GNUSTL_PC "gnustl")
-+ include_directories(${GNUSTL_INCLUDE_DIRS} )
-+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall ${GNUTSTL_CFLAGS_OTHER} ")
-+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ${GNUSTL_CFLAGS_OTHER} ")
-+elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
-+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
-+endif (ANDROID_NDK)
-
- if(MSVC AND ENABLE_STATIC_RUNTIME)
- foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
-diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt
-index 387f1bd..c4aafc6 100644
---- a/bindings/c/CMakeLists.txt
-+++ b/bindings/c/CMakeLists.txt
-@@ -20,7 +20,7 @@ set(tag_c_HDRS tag_c.h)
-
- add_library(tag_c tag_c.cpp ${tag_c_HDRS})
-
--target_link_libraries(tag_c tag)
-+target_link_libraries(tag_c tag ${GNUSTL_STATIC_LDFLAGS_OTHER})
- set_target_properties(tag_c PROPERTIES PUBLIC_HEADER "${tag_c_HDRS}")
- if(BUILD_FRAMEWORK)
- set_target_properties(tag_c PROPERTIES FRAMEWORK TRUE)
-diff --git a/taglib.pc.cmake b/taglib.pc.cmake
-index ba9d655..5f42e0b 100644
---- a/taglib.pc.cmake
-+++ b/taglib.pc.cmake
-@@ -5,7 +5,7 @@ includedir=@INCLUDE_INSTALL_DIR@
-
- Name: TagLib
- Description: Audio meta-data library
--Requires:
-+Requires: @GNUSTL_PC@
- Version: @TAGLIB_LIB_VERSION_STRING@
- Libs: -L${libdir} -ltag
- Cflags: -I${includedir}/taglib
-diff --git a/taglib/CMakeLists.txt b/taglib/CMakeLists.txt
-index 000f793..4f8c876 100644
---- a/taglib/CMakeLists.txt
-+++ b/taglib/CMakeLists.txt
-@@ -356,6 +356,10 @@ if(HAVE_BOOST_ZLIB)
- target_link_libraries(tag ${Boost_IOSTREAMS_LIBRARY} ${Boost_ZLIB_LIBRARY})
- endif()
-
-+if(ANDROID_NDK)
-+ target_link_libraries(tag ${GNUSTL_STATIC_LDFLAGS_OTHER})
-+endif(ANDROID_NDK)
-+
- set_target_properties(tag PROPERTIES
- VERSION ${TAGLIB_SOVERSION_MAJOR}.${TAGLIB_SOVERSION_MINOR}.${TAGLIB_SOVERSION_PATCH}
- SOVERSION ${TAGLIB_SOVERSION_MAJOR}
---
-2.11.0
-
diff --git a/recipes/wavpack.recipe b/recipes/wavpack.recipe
index b67f1b6e..5e2d4aa0 100644
--- a/recipes/wavpack.recipe
+++ b/recipes/wavpack.recipe
@@ -68,8 +68,6 @@ class Recipe(recipe.Recipe):
def post_install(self):
deps = ['-lm']
- if self.config.target_platform == Platform.ANDROID:
- deps.append('gnustl')
libtool_la = LibtoolLibrary('wavpack', None, None, None, self.config.libdir,
self.config.target_platform, deps)
libtool_la.save()
diff --git a/recipes/webrtc-audio-processing.recipe b/recipes/webrtc-audio-processing.recipe
index 4927414a..6d5767f0 100644
--- a/recipes/webrtc-audio-processing.recipe
+++ b/recipes/webrtc-audio-processing.recipe
@@ -12,8 +12,6 @@ class Recipe(recipe.Recipe):
url = 'https://freedesktop.org/software/pulseaudio/%(name)s/%(name)s-%(version)s.tar.gz'
tarball_checksum = '59b3d47aedd32dd6fe4836478499ebb7c5bcad815f14dccddbbd70e752a99e5f'
- platform_deps = {Platform.ANDROID: ['gnustl']}
-
# webrtc-audio-processing links to abseil statically
meson_subprojects = ['abseil-cpp']
@@ -35,7 +33,6 @@ class Recipe(recipe.Recipe):
# that defines -mfpu=vfp... plus webrtc-audio-processing build
# system is doing it wrong, as it should add -mfpu=neon only for
# the files that contains neon intrinsic.
- self.meson_options['gnustl'] = 'enabled'
android_api = DistroVersion.get_android_api_version(self.config.target_distro_version)
if android_api < 24:
# -D_FILE_OFFSET_BITS=64 is broken with Android API < 24 for C++
@@ -46,10 +43,11 @@ class Recipe(recipe.Recipe):
# Does not export symbols correctly for DLLs, so just link statically
self.library_type = LibraryType.STATIC
+
def post_install(self):
dependency_libs = []
if self.config.target_platform == Platform.ANDROID:
- dependency_libs += ['gnustl', '-llog']
+ dependency_libs += ['-llog']
libac = LibtoolLibrary('webrtc-audio-coding-1', None, None, None, self.config.libdir,
self.config.target_platform, deps=dependency_libs)