mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-08 02:38:11 +09:00
miniaudio: export miniaudio header
This commit is contained in:
parent
adaa24fbf4
commit
640036c10e
1 changed files with 27 additions and 7 deletions
|
@ -2,32 +2,52 @@
|
|||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
testers,
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "miniaudio";
|
||||
version = "0.11.22";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mackron";
|
||||
repo = "miniaudio";
|
||||
rev = version;
|
||||
rev = finalAttrs.version;
|
||||
hash = "sha256-o/7sfBcrhyXEakccOAogQqm8dO4Szj1QSpaIHg6OSt4=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp -r $src/* $out/
|
||||
postInstall = ''
|
||||
mkdir -p $out/include
|
||||
mkdir -p $out/lib/pkgconfig
|
||||
|
||||
cp $src/miniaudio.h $out/include
|
||||
ln -s $out/include/miniaudio.h $out
|
||||
|
||||
cp -r $src/extras $out/
|
||||
|
||||
cat <<EOF >$out/lib/pkgconfig/miniaudio.pc
|
||||
prefix=$out
|
||||
includedir=$out/include
|
||||
|
||||
Name: miniaudio
|
||||
Description: An audio playback and capture library in a single source file.
|
||||
Version: $version
|
||||
Cflags: -I$out/include
|
||||
Libs: -lm -lpthread -latomic
|
||||
EOF
|
||||
'';
|
||||
|
||||
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Single header audio playback and capture library written in C";
|
||||
homepage = "https://github.com/mackron/miniaudio";
|
||||
changelog = "https://github.com/mackron/miniaudio/blob/${src.rev}/CHANGES.md";
|
||||
changelog = "https://github.com/mackron/miniaudio/blob/${finalAttrs.version}/CHANGES.md";
|
||||
license = with licenses; [
|
||||
unlicense # or
|
||||
mit0
|
||||
];
|
||||
maintainers = [ maintainers.jansol ];
|
||||
pkgConfigModules = [ "miniaudio" ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue