Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
56 lines
1.5 KiB
Nix
56 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
pkgs,
|
|
alsa-lib,
|
|
plugins ? [ pkgs.alsa-plugins ],
|
|
lndir,
|
|
symlinkJoin,
|
|
runCommand,
|
|
}:
|
|
let
|
|
merged = symlinkJoin {
|
|
name = "alsa-plugins-merged";
|
|
paths = plugins;
|
|
};
|
|
in
|
|
runCommand "${alsa-lib.pname}-${alsa-lib.version}"
|
|
{
|
|
meta = with lib; {
|
|
description = "Wrapper to ease access to ALSA plugins";
|
|
mainProgram = "aserver";
|
|
platforms = platforms.linux;
|
|
};
|
|
outputs = alsa-lib.outputs;
|
|
}
|
|
(
|
|
(lib.concatMapStringsSep "\n" (output: ''
|
|
mkdir ${placeholder output}
|
|
${lndir}/bin/lndir ${lib.attrByPath [ output ] null alsa-lib} \
|
|
${placeholder output}
|
|
'') alsa-lib.outputs)
|
|
+ ''
|
|
cp -r ${merged}/lib/alsa-lib $out/lib
|
|
(
|
|
echo $out | wc -c
|
|
echo ${alsa-lib} | wc -c
|
|
) | xargs echo | grep -q "^\(.*\) \1$" || (
|
|
echo cannot binary patch
|
|
exit 1
|
|
)
|
|
rm $out/lib/libasound.la
|
|
rm $out/lib/libasound.so.?.?.?
|
|
rm $dev/lib/pkgconfig/alsa.pc
|
|
rm $dev/nix-support/propagated-build-inputs
|
|
cp ${alsa-lib}/lib/libasound.la $out/lib
|
|
cp ${alsa-lib}/lib/libasound.so.?.?.? $out/lib
|
|
cp ${alsa-lib.dev}/lib/pkgconfig/alsa.pc $dev/lib/pkgconfig
|
|
cp ${alsa-lib.dev}/nix-support/propagated-build-inputs $dev/nix-support
|
|
sed -i \
|
|
$out/lib/libasound.la \
|
|
$out/lib/libasound.so.?.?.? \
|
|
$dev/lib/pkgconfig/alsa.pc \
|
|
$dev/nix-support/propagated-build-inputs \
|
|
-e "s@${alsa-lib}@$out@g"
|
|
''
|
|
)
|