From: Florian Fainelli Date: Mon, 9 Oct 2006 14:48:41 +0000 (+0000) Subject: Add alsa-lib, with wordexp fixes, closes #486 X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;hb=f58b7e149f0e383cf9c9056ba5565d0eb20fb312 Add alsa-lib, with wordexp fixes, closes #486 SVN-Revision: 4988 --- diff --git a/libs/alsa-lib/Makefile b/libs/alsa-lib/Makefile new file mode 100644 index 0000000000..c858373abb --- /dev/null +++ b/libs/alsa-lib/Makefile @@ -0,0 +1,71 @@ +# +# Copyright (C) 2006 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=alsa-lib +PKG_VERSION:=1.0.10 +PKG_RELEASE:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/lib/ +PKG_MD5SUM:=b1a4e15c9ff81798507de470a92fcc43 +PKG_CAT:=bzcat + +PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install + +include $(INCLUDE_DIR)/package.mk + +define Package/alsa-lib + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+alsa + TITLE:=Advanced Linux Sound Architecture Library + DESCRIPTION:=This is the library package for alsa, needed by some userspace programs. You must\\\ + have enabled the ALSA support in the kernel. + URL:=http://www.alsa-project.org/ +endef + +define Build/Configure +$(call Build/Configure/Default,\ + --enable-shared=yes \ + --enable-static=yes \ + --with-gnu-ld \ + --disable-debugging \ + --disable-profiling \ + --with-softfloat \ + --with-versioned=no \ +) +endef + +define Build/Compile +$(call Build/Compile/Default,\ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install) +endef + +define Package/alsa-lib/install + install -d -m0755 $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasound.so.* $(1)/usr/lib/ +endef + +define Build/InstallDev + mkdir -p $(STAGING_DIR)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/alsa $(STAGING_DIR)/usr/include/ + mkdir -p $(STAGING_DIR)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libasound.{a,so}* $(STAGING_DIR)/usr/lib/ +endef + +define Build/UninstallDev + rm -rf \ + $(STAGING_DIR)/usr/include/alsa \ + $(STAGING_DIR)/usr/lib/libasound.{a,so}* +endef + +$(eval $(call BuildPackage,alsa-lib)) diff --git a/libs/alsa-lib/patches/01-no_wordexp.patch b/libs/alsa-lib/patches/01-no_wordexp.patch new file mode 100644 index 0000000000..7fe330215a --- /dev/null +++ b/libs/alsa-lib/patches/01-no_wordexp.patch @@ -0,0 +1,211 @@ +diff -urN alsa-lib-1.0.10/src/alisp/alisp.c alsa-lib-1.0.10.new/src/alisp/alisp.c +--- alsa-lib-1.0.10/src/alisp/alisp.c 2005-01-19 14:56:31.000000000 +0100 ++++ alsa-lib-1.0.10.new/src/alisp/alisp.c 2006-10-09 16:20:51.000000000 +0200 +@@ -30,7 +30,6 @@ + #include + #include + #include +-#include + + #define alisp_seq_iterator alisp_object + +diff -urN alsa-lib-1.0.10/src/conf.c alsa-lib-1.0.10.new/src/conf.c +--- alsa-lib-1.0.10/src/conf.c 2005-10-12 18:08:53.000000000 +0200 ++++ alsa-lib-1.0.10.new/src/conf.c 2006-10-09 16:21:06.000000000 +0200 +@@ -415,7 +415,6 @@ + + + #include +-#include + #include + #include + #include +diff -urN alsa-lib-1.0.10/src/names.c alsa-lib-1.0.10.new/src/names.c +--- alsa-lib-1.0.10/src/names.c 2005-06-06 16:01:13.000000000 +0200 ++++ alsa-lib-1.0.10.new/src/names.c 2006-10-09 16:21:16.000000000 +0200 +@@ -31,7 +31,6 @@ + */ + + #include +-#include + #include + #include + #include +diff -urN alsa-lib-1.0.10/src/pcm/Makefile.am alsa-lib-1.0.10.new/src/pcm/Makefile.am +--- alsa-lib-1.0.10/src/pcm/Makefile.am 2005-02-24 11:16:52.000000000 +0100 ++++ alsa-lib-1.0.10.new/src/pcm/Makefile.am 2006-10-09 16:22:44.000000000 +0200 +@@ -9,7 +9,7 @@ + pcm_route.c pcm_mulaw.c pcm_alaw.c pcm_adpcm.c \ + pcm_rate.c pcm_plug.c pcm_misc.c pcm_mmap.c pcm_multi.c \ + pcm_shm.c pcm_file.c pcm_null.c pcm_share.c \ +- pcm_meter.c pcm_hooks.c pcm_lfloat.c pcm_ladspa.c \ ++ pcm_meter.c pcm_hooks.c pcm_lfloat.c \ + pcm_direct.c pcm_dmix.c pcm_dsnoop.c pcm_dshare.c \ + pcm_asym.c pcm_iec958.c pcm_softvol.c pcm_symbols.c \ + pcm_ioplug.c pcm_extplug.c +@@ -17,7 +17,7 @@ + EXTRA_DIST = pcm_dmix_i386.c pcm_dmix_x86_64.c pcm_dmix_generic.c + + noinst_HEADERS = pcm_local.h pcm_plugin.h mask.h mask_inline.h \ +- interval.h interval_inline.h plugin_ops.h ladspa.h \ ++ interval.h interval_inline.h plugin_ops.h \ + pcm_direct.h pcm_dmix_i386.h pcm_dmix_x86_64.h \ + pcm_generic.h pcm_ext_parm.h + +diff -urN alsa-lib-1.0.10/src/pcm/Makefile.in alsa-lib-1.0.10.new/src/pcm/Makefile.in +--- alsa-lib-1.0.10/src/pcm/Makefile.in 2005-11-16 15:44:41.000000000 +0100 ++++ alsa-lib-1.0.10.new/src/pcm/Makefile.in 2006-10-09 16:19:45.000000000 +0200 +@@ -158,7 +158,7 @@ + pcm_route.c pcm_mulaw.c pcm_alaw.c pcm_adpcm.c \ + pcm_rate.c pcm_plug.c pcm_misc.c pcm_mmap.c pcm_multi.c \ + pcm_shm.c pcm_file.c pcm_null.c pcm_share.c \ +- pcm_meter.c pcm_hooks.c pcm_lfloat.c pcm_ladspa.c \ ++ pcm_meter.c pcm_hooks.c pcm_lfloat.c \ + pcm_direct.c pcm_dmix.c pcm_dsnoop.c pcm_dshare.c \ + pcm_asym.c pcm_iec958.c pcm_softvol.c pcm_symbols.c \ + pcm_ioplug.c pcm_extplug.c +@@ -167,7 +167,7 @@ + EXTRA_DIST = pcm_dmix_i386.c pcm_dmix_x86_64.c pcm_dmix_generic.c + + noinst_HEADERS = pcm_local.h pcm_plugin.h mask.h mask_inline.h \ +- interval.h interval_inline.h plugin_ops.h ladspa.h \ ++ interval.h interval_inline.h plugin_ops.h \ + pcm_direct.h pcm_dmix_i386.h pcm_dmix_x86_64.h \ + pcm_generic.h pcm_ext_parm.h + +@@ -188,7 +188,7 @@ + pcm_mulaw.lo pcm_alaw.lo pcm_adpcm.lo pcm_rate.lo pcm_plug.lo \ + pcm_misc.lo pcm_mmap.lo pcm_multi.lo pcm_shm.lo pcm_file.lo \ + pcm_null.lo pcm_share.lo pcm_meter.lo pcm_hooks.lo \ +- pcm_lfloat.lo pcm_ladspa.lo pcm_direct.lo pcm_dmix.lo \ ++ pcm_lfloat.lo pcm_direct.lo pcm_dmix.lo \ + pcm_dsnoop.lo pcm_dshare.lo pcm_asym.lo pcm_iec958.lo \ + pcm_softvol.lo pcm_symbols.lo pcm_ioplug.lo pcm_extplug.lo + libpcm_la_OBJECTS = $(am_libpcm_la_OBJECTS) +@@ -209,7 +209,6 @@ + @AMDEP_TRUE@ ./$(DEPDIR)/pcm_hooks.Plo ./$(DEPDIR)/pcm_hw.Plo \ + @AMDEP_TRUE@ ./$(DEPDIR)/pcm_iec958.Plo \ + @AMDEP_TRUE@ ./$(DEPDIR)/pcm_ioplug.Plo \ +-@AMDEP_TRUE@ ./$(DEPDIR)/pcm_ladspa.Plo \ + @AMDEP_TRUE@ ./$(DEPDIR)/pcm_lfloat.Plo \ + @AMDEP_TRUE@ ./$(DEPDIR)/pcm_linear.Plo \ + @AMDEP_TRUE@ ./$(DEPDIR)/pcm_meter.Plo ./$(DEPDIR)/pcm_misc.Plo \ +@@ -277,7 +276,6 @@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_hw.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_iec958.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_ioplug.Plo@am__quote@ +-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_ladspa.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_lfloat.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_linear.Plo@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_meter.Plo@am__quote@ +diff -urN alsa-lib-1.0.10/src/pcm/pcm.c alsa-lib-1.0.10.new/src/pcm/pcm.c +--- alsa-lib-1.0.10/src/pcm/pcm.c 2005-09-29 21:11:50.000000000 +0200 ++++ alsa-lib-1.0.10.new/src/pcm/pcm.c 2006-10-09 16:20:34.000000000 +0200 +@@ -1937,7 +1937,7 @@ + } + + static char *build_in_pcms[] = { +- "adpcm", "alaw", "copy", "dmix", "file", "hooks", "hw", "ladspa", "lfloat", ++ "adpcm", "alaw", "copy", "dmix", "file", "hooks", "hw", "lfloat", + "linear", "meter", "mulaw", "multi", "null", "plug", "rate", "route", "share", + "shm", "dsnoop", "dshare", "asym", "iec958", "softvol", NULL + }; +diff -urN alsa-lib-1.0.10/src/pcm/pcm_symbols.c alsa-lib-1.0.10.new/src/pcm/pcm_symbols.c +--- alsa-lib-1.0.10/src/pcm/pcm_symbols.c 2005-01-03 19:19:23.000000000 +0100 ++++ alsa-lib-1.0.10.new/src/pcm/pcm_symbols.c 2006-10-09 16:20:15.000000000 +0200 +@@ -39,7 +39,6 @@ + extern const char *_snd_module_pcm_share; + extern const char *_snd_module_pcm_shm; + extern const char *_snd_module_pcm_lfloat; +-extern const char *_snd_module_pcm_ladspa; + extern const char *_snd_module_pcm_dmix; + extern const char *_snd_module_pcm_dsnoop; + extern const char *_snd_module_pcm_dshare; +@@ -65,7 +64,6 @@ + &_snd_module_pcm_share, + &_snd_module_pcm_shm, + &_snd_module_pcm_lfloat, +- &_snd_module_pcm_ladspa, + &_snd_module_pcm_dmix, + &_snd_module_pcm_dsnoop, + &_snd_module_pcm_dshare, +diff -urN alsa-lib-1.0.10/src/userfile.c alsa-lib-1.0.10.new/src/userfile.c +--- alsa-lib-1.0.10/src/userfile.c 2005-05-24 16:14:29.000000000 +0200 ++++ alsa-lib-1.0.10.new/src/userfile.c 2006-10-09 16:21:42.000000000 +0200 +@@ -1,58 +1,31 @@ +-/* +- * Get full filename +- * Copyright (c) 2003 by Jaroslav Kysela +- * +- * This library is free software; you can redistribute it and/or modify +- * it under the terms of the GNU Lesser General Public License as +- * published by the Free Software Foundation; either version 2.1 of +- * the License, or (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General Public +- * License along with this library; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++/* This is a mockup of alsalib's userfile.c without its functionality but ++ * the same interface. + * ++ * Maybe someone, someday wants to FIXME. + */ + + #include ++#include ++#include + #include +-#include +-#include + +-/** +- * \brief Get the full file name +- * \param file The file name string to parse +- * \param result The pointer to store the resultant file name +- * \return 0 if successful, or a negative error code +- * +- * Parses the given file name with POSIX-Shell-like expansion and +- * stores the first matchine one. The returned string is strdup'ed. +- */ + int snd_user_file(const char *file, char **result) + { +- wordexp_t we; +- int err; +- +- assert(file && result); +- err = wordexp(file, &we, WRDE_NOCMD); +- switch (err) { +- case WRDE_NOSPACE: +- return -ENOMEM; +- case 0: +- if (we.we_wordc == 1) +- break; +- /* fall thru */ +- default: +- wordfree(&we); +- return -EINVAL; ++ static int warned; ++ if(getenv("BROKEN_USERFILE_SILENT") == NULL) { ++ if(getenv("BROKEN_USERFILE_DEBUG") == NULL) { ++ if(warned == 0) ++ fprintf(stderr, "WARNING: this snd_user_file implementation won't behave as expected.\n" ++ " set BROKEN_USERFILE_DEBUG to see all problems, or\n" ++ " set BROKEN_USERFILE_SILENT to disable all warnings.\n"); ++ warned = 1; ++ } else { ++ fprintf(stderr, "WARNING(snd_user_file): '%s' has not been expanded\n", file); ++ } + } +- *result = strdup(we.we_wordv[0]); ++ ++ *result = strdup(file); + if (*result == NULL) + return -ENOMEM; +- wordfree(&we); + return 0; + } diff --git a/libs/alsa-lib/patches/02-alsa_symbols.patch b/libs/alsa-lib/patches/02-alsa_symbols.patch new file mode 100644 index 0000000000..70570e7fc8 --- /dev/null +++ b/libs/alsa-lib/patches/02-alsa_symbols.patch @@ -0,0 +1,11 @@ +--- alsa-lib-1.0.10/include/alsa-symbols.h.orig 2006-03-01 21:59:33.500097817 +0100 ++++ alsa-lib-1.0.10/include/alsa-symbols.h 2006-03-01 22:00:22.323650362 +0100 +@@ -57,7 +57,7 @@ + __asm__ (".set " #name "," #real); \ + __asm__ (".set ." #name ",." #real) + #else +-#ifdef __alpha__ ++#if defined(__alpha__) || defined(__mips__) || defined(__arm__) + #define use_default_symbol_version(real, name, version) \ + __asm__ (".weak " #name); \ + __asm__ (#name " = " #real)