summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorL. E. Segovia <amy@centricular.com>2024-03-08 20:10:36 -0300
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2024-04-02 16:46:44 +0000
commit41067f35328f7f160f9cf285abe88168db4c63b9 (patch)
treefc4c12525848bf4e54a4aff7baba42e6dd5080a1
parent1998c5cbf12fc8aabaeec197945fe4f9ba2750c2 (diff)
tinyalsa: Update to 2.0.0 and switch to Meson
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1403>
-rw-r--r--recipes/tinyalsa.recipe57
-rw-r--r--recipes/tinyalsa/0001-meson-add-attributes-h-and-plugin-h.patch25
2 files changed, 55 insertions, 27 deletions
diff --git a/recipes/tinyalsa.recipe b/recipes/tinyalsa.recipe
index a385c52e..279456e6 100644
--- a/recipes/tinyalsa.recipe
+++ b/recipes/tinyalsa.recipe
@@ -1,36 +1,39 @@
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python
+from cerbero.tools.libtool import LibtoolLibrary
-import os
-import shutil
class Recipe(recipe.Recipe):
- """
- Sets up build based on the tinyalsa library.
- """
- name = 'tinyalsa'
- version = '0.1'
- licenses = [License.Apachev2]
- btype = BuildType.MAKEFILE
- remotes = {'origin': 'https://github.com/tinyalsa/tinyalsa'}
- commit = '1.1.1'
- files_devel = [ 'include/tinyalsa/asoundlib.h' ]
+ name = 'tinyalsa'
+ version = '2.0.0'
+ licenses = [{License.BSD_like: ['NOTICE']}]
+ stype = SourceType.TARBALL
+ btype = BuildType.MESON
+ url = f'https://github.com/tinyalsa/tinyalsa/archive/refs/tags/v{version}.tar.gz'
+ tarball_checksum = '573ae0b2d3480851c1d2a12503ead2beea27f92d44ed47b74b553ba947994ef1'
+
+ patches = [
+ # https://github.com/tinyalsa/tinyalsa/pull/216
+ f'{name}/0001-meson-add-attributes-h-and-plugin-h.patch',
+ ]
+
+ meson_options = {
+ 'docs': 'disabled',
+ 'examples': 'disabled',
+ 'utils': 'disabled',
+ }
files_libs = [ 'libtinyalsa' ]
- def prepare(self):
- if self.config.target_platform != Platform.LINUX and self.config.target_platform != Platform.ANDROID:
- raise InvalidRecipeError(self, "Invalid platform")
-
- async def install(self):
- include_path = os.path.join(self.config.prefix, 'include', 'tinyalsa')
- library_path = self.config.libdir
+ files_devel = [ 'include/tinyalsa', '%(libdir)s/pkgconfig/tinyalsa.pc' ]
- tinyalsa_header = os.path.join(self.build_dir, 'include', 'tinyalsa', 'asoundlib.h')
- tinyalsa_lib = os.path.join(self.build_dir, 'src', 'libtinyalsa.a')
-
- if not os.path.exists(include_path):
- os.makedirs(include_path)
-
- shutil.copy(tinyalsa_header, include_path)
- shutil.copy(tinyalsa_lib, library_path)
+ def prepare(self):
+ if self.config.target_platform not in (Platform.LINUX, Platform.ANDROID):
+ raise InvalidRecipeError(self, "Invalid platform")
+ # ALSA
+ self.use_system_libs = not self.config.cross_compiling()
+
+ def post_install(self):
+ LibtoolLibrary('tinyalsa', 2, 0, 0, self.config.libdir,
+ self.config.target_platform).save()
+ super().post_install()
diff --git a/recipes/tinyalsa/0001-meson-add-attributes-h-and-plugin-h.patch b/recipes/tinyalsa/0001-meson-add-attributes-h-and-plugin-h.patch
new file mode 100644
index 00000000..884f650e
--- /dev/null
+++ b/recipes/tinyalsa/0001-meson-add-attributes-h-and-plugin-h.patch
@@ -0,0 +1,25 @@
+From 4a2f0334e4790f6ba7eb6cfdd8179e7307f4119d Mon Sep 17 00:00:00 2001
+From: tinywrkb <tinywrkb@gmail.com>
+Date: Mon, 26 Jul 2021 19:09:26 +0300
+Subject: [PATCH] meson: add attributes.h and plugin.h public headers
+
+---
+ include/tinyalsa/meson.build | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/tinyalsa/meson.build b/include/tinyalsa/meson.build
+index d14b35be..95077be8 100644
+--- a/include/tinyalsa/meson.build
++++ b/include/tinyalsa/meson.build
+@@ -1,9 +1,11 @@
+ tinyalsa_headers = [
+ 'asoundlib.h',
++ 'attributes.h',
+ 'interval.h',
+ 'limits.h',
+ 'mixer.h',
+ 'pcm.h',
++ 'plugin.h',
+ 'version.h'
+ ]
+