mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 01:20:40 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
46 lines
1.6 KiB
Nix
46 lines
1.6 KiB
Nix
{ stdenv, lib, fetchurl, alsaLib, libpulseaudio, undmg }:
|
|
|
|
let
|
|
bits = stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") "64";
|
|
libPath = lib.makeLibraryPath [ stdenv.cc.cc alsaLib libpulseaudio ];
|
|
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
pname = "fmod";
|
|
version = "4.44.64";
|
|
shortVersion = builtins.replaceStrings [ "." ] [ "" ] version;
|
|
|
|
src = fetchurl (if stdenv.isLinux then {
|
|
url = "https://zdoom.org/files/fmod/fmodapi${shortVersion}linux.tar.gz";
|
|
sha256 = "047hk92xapwwqj281f4zwl0ih821rrliya70gfj82sdfjh9lz8i1";
|
|
} else {
|
|
url = "https://zdoom.org/files/fmod/fmodapi${shortVersion}mac-installer.dmg";
|
|
sha256 = "1m1y4cpcwpkl8x31d3s68xzp107f343ma09w2437i2adn5y7m8ii";
|
|
});
|
|
|
|
nativeBuildInputs = [ undmg ];
|
|
|
|
dontStrip = true;
|
|
dontPatchELF = true;
|
|
dontBuild = true;
|
|
|
|
installPhase = lib.optionalString stdenv.isLinux ''
|
|
install -Dm755 api/lib/libfmodex${bits}-${version}.so $out/lib/libfmodex-${version}.so
|
|
ln -s libfmodex-${version}.so $out/lib/libfmodex.so
|
|
patchelf --set-rpath ${libPath} $out/lib/libfmodex.so
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
install -D api/lib/libfmodex.dylib $out/lib/libfmodex.dylib
|
|
install -D api/lib/libfmodexL.dylib $out/lib/libfmodexL.dylib
|
|
'' + ''
|
|
cp -r api/inc $out/include
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Programming library and toolkit for the creation and playback of interactive audio";
|
|
homepage = "http://www.fmod.org/";
|
|
license = licenses.unfreeRedistributable;
|
|
platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
|
|
maintainers = [ maintainers.lassulus ];
|
|
};
|
|
}
|