diff options
author | Marc Weber <marco-oweber@gmx.de> | 2010-01-18 19:15:36 +0000 |
---|---|---|
committer | Marc Weber <marco-oweber@gmx.de> | 2010-01-18 19:15:36 +0000 |
commit | 3b37933dd49e94646ae1a6b4118bbf5148ade61c (patch) | |
tree | ee3e82e23696a532882ff6a85a83756bf5e5da87 /pkgs/os-specific/linux/alsa-lib | |
parent | 907be69b26c5c33c4cbb7acc7537ad0ddb773199 (diff) | |
download | nixpkgs-3b37933dd49e94646ae1a6b4118bbf5148ade61c.tar nixpkgs-3b37933dd49e94646ae1a6b4118bbf5148ade61c.tar.gz nixpkgs-3b37933dd49e94646ae1a6b4118bbf5148ade61c.tar.bz2 nixpkgs-3b37933dd49e94646ae1a6b4118bbf5148ade61c.tar.lz nixpkgs-3b37933dd49e94646ae1a6b4118bbf5148ade61c.tar.xz nixpkgs-3b37933dd49e94646ae1a6b4118bbf5148ade61c.tar.zst nixpkgs-3b37933dd49e94646ae1a6b4118bbf5148ade61c.zip |
second part of alsaLib patch + comment
svn path=/nixpkgs/branches/stdenv-updates/; revision=19529
Diffstat (limited to 'pkgs/os-specific/linux/alsa-lib')
-rw-r--r-- | pkgs/os-specific/linux/alsa-lib/alsa-plugin-dirs.patch | 46 | ||||
-rw-r--r-- | pkgs/os-specific/linux/alsa-lib/default.nix | 5 |
2 files changed, 50 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/alsa-lib/alsa-plugin-dirs.patch b/pkgs/os-specific/linux/alsa-lib/alsa-plugin-dirs.patch index 2b6d6276c22..3cee02aa0cd 100644 --- a/pkgs/os-specific/linux/alsa-lib/alsa-plugin-dirs.patch +++ b/pkgs/os-specific/linux/alsa-lib/alsa-plugin-dirs.patch @@ -62,3 +62,49 @@ index 74d1d1a..17ffb12 100644 } } #ifndef PIC + + +diff --git a/src/control/control.c b/src/control/control.c +index c090797..137fe57 100644 +--- a/src/control/control.c ++++ b/src/control/control.c +@@ -854,8 +854,38 @@ static int snd_ctl_open_conf(snd_ctl_t **ctlp, const char *name, + err = -ENOMEM; + goto _err; + } ++ sprintf(buf1, "%s/libasound_module_pcm_%s.so", ALSA_PLUGIN_DIR, str); ++ if (!file_exists(buf1)){ ++ // try to locate plugin in one of ALSA_PLUGIN_DIRS which is colon separated list of paths ++ char * pdirs = getenv("ALSA_PLUGIN_DIRS"); ++ ++ if (pdirs){ // env var set? ++ char * saveptr; ++ while (1) { ++ char * dir_tok = strtok_r(pdirs, "::::", &saveptr); // "::::" to work around bug in glibc and -O2 ? ":" seems to cause a segfault ++ if (dir_tok == NULL) ++ break; ++ char * so_file = malloc(strlen(str) + strlen(dir_tok) + 32); ++ if (so_file == NULL) { ++ err = -ENOMEM; ++ goto _err; ++ } ++ ++ sprintf(so_file, "%s/libasound_module_ctl_%s.so", dir_tok, str); ++ ++ if (file_exists(so_file)){ ++ ++ free(buf1); ++ buf1 = so_file; ++ break; ++ } else { ++ free (so_file); ++ } ++ pdirs = NULL; ++ } ++ } ++ } + lib = buf1; +- sprintf(buf1, "%s/libasound_module_ctl_%s.so", ALSA_PLUGIN_DIR, str); + } + } + #ifndef PIC diff --git a/pkgs/os-specific/linux/alsa-lib/default.nix b/pkgs/os-specific/linux/alsa-lib/default.nix index daabf99d543..36e99482f5d 100644 --- a/pkgs/os-specific/linux/alsa-lib/default.nix +++ b/pkgs/os-specific/linux/alsa-lib/default.nix @@ -28,7 +28,10 @@ stdenv.mkDerivation rec { patches = [ /* allow specifying alternatives alsa plugin locations using - export ALSA_PLUGIN_DIRS=$(nix-build -A alsaPlugins)/lib/alsa-lib */ + export ALSA_PLUGIN_DIRS=$(nix-build -A alsaPlugins)/lib/alsa-lib + This patch should be improved: + See http://thread.gmane.org/gmane.linux.distributions.nixos/3435 + */ ./alsa-plugin-dirs.patch ]; } |