1{ stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 name = "alsa-lib-1.1.1";
5
6 src = fetchurl {
7 urls = [
8 "ftp://ftp.alsa-project.org/pub/lib/${name}.tar.bz2"
9 "http://alsa.cybermirror.org/lib/${name}.tar.bz2"
10 ];
11 sha256 = "0sa24fy3qf3jg63xxvfb7j8halj1qmdbcak2lyfx8bpd8hqnriwa";
12 };
13
14 patches = [
15 ./alsa-plugin-conf-multilib.patch
16 ];
17
18 # Fix pcm.h file in order to prevent some compilation bugs
19 # 2: see http://stackoverflow.com/questions/3103400/how-to-overcome-u-int8-t-vs-uint8-t-issue-efficiently
20 postPatch = ''
21 sed -i -e 's|//int snd_pcm_mixer_element(snd_pcm_t \*pcm, snd_mixer_t \*mixer, snd_mixer_elem_t \*\*elem);|/\*int snd_pcm_mixer_element(snd_pcm_t \*pcm, snd_mixer_t \*mixer, snd_mixer_elem_t \*\*elem);\*/|' include/pcm.h
22
23
24 sed -i -e '1i#include <stdint.h>' include/pcm.h
25 sed -i -e 's/u_int\([0-9]*\)_t/uint\1_t/g' include/pcm.h
26 '';
27
28 outputs = [ "out" "dev" ];
29
30 crossAttrs = {
31 patchPhase = ''
32 sed -i s/extern/static/g include/iatomic.h
33 '';
34 };
35
36 meta = with stdenv.lib; {
37 homepage = http://www.alsa-project.org/;
38 description = "ALSA, the Advanced Linux Sound Architecture libraries";
39
40 longDescription = ''
41 The Advanced Linux Sound Architecture (ALSA) provides audio and
42 MIDI functionality to the Linux-based operating system.
43 '';
44
45 license = licenses.gpl3Plus;
46 platforms = platforms.linux;
47 };
48}