2024-01-13 08:15:51 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, fetchpatch
|
|
|
|
, autoreconfHook, pkg-config, libpulseaudio, alsa-lib, libcap
|
2020-04-24 23:36:52 +00:00
|
|
|
, CoreAudio, CoreServices, AudioUnit
|
|
|
|
, usePulseAudio }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "1.2.2";
|
|
|
|
pname = "libao";
|
|
|
|
|
|
|
|
# the github mirror is more up to date than downloads.xiph.org
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xiph";
|
|
|
|
repo = "libao";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0svgk4sc9kdhcsfyvbvgm5vpbg3sfr6z5rliflrw49v3x2i4vxq5";
|
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
patches = [
|
|
|
|
# add header time.h for nanosecond
|
|
|
|
(fetchpatch {
|
|
|
|
name = "nanosecond-header.patch";
|
|
|
|
url = "https://github.com/xiph/libao/commit/1f998f5d6d77674dad01b181811638578ad68242.patch";
|
|
|
|
hash = "sha256-cvlyhQq1YS4pVya44LfsKD1R6iSOONsHJGRbP5LlanQ=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-broken-oss"
|
|
|
|
"--enable-alsa-mmap"
|
|
|
|
];
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" "man" "doc" ];
|
|
|
|
|
|
|
|
buildInputs = [ ] ++
|
|
|
|
lib.optional usePulseAudio libpulseaudio ++
|
2024-09-26 11:04:55 +00:00
|
|
|
lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib libcap ] ++
|
|
|
|
lib.optionals stdenv.hostPlatform.isDarwin [ CoreAudio CoreServices AudioUnit ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
Libao is Xiph.org's cross-platform audio library that allows
|
|
|
|
programs to output audio using a simple API on a wide variety of
|
|
|
|
platforms.
|
|
|
|
'';
|
|
|
|
homepage = "https://xiph.org/ao/";
|
|
|
|
license = licenses.gpl2;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = with platforms; unix;
|
|
|
|
};
|
|
|
|
}
|