-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfbc8e3
commit 70b9445
Showing
1 changed file
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
fetchurl, | ||
SDL, | ||
SDL_ttf, | ||
jack2, | ||
libmpg123, | ||
ffmpeg, | ||
cdparanoia, | ||
dejavu_fonts, | ||
versionCheckHook, | ||
}: | ||
|
||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "xwax"; | ||
version = "1.9"; | ||
|
||
src = fetchurl { | ||
url = "https://xwax.org/releases/xwax-${finalAttrs.version}.tar.gz"; | ||
hash = "sha256-m+2PoUMYKBhlA2H0kld1W/iR8UMWEGaqp7yoxszp9jI="; | ||
}; | ||
|
||
postPatch = '' | ||
# When cross-compiling sdl-config will not be available in $PATH, | ||
# so we must provide the full path. | ||
substituteInPlace Makefile \ | ||
--replace-fail sdl-config "${lib.getExe' (lib.getDev SDL) "sdl-config"}" | ||
# font loading in xwax is relying on a hardcoded list of paths, | ||
# therefore we patch interface.c to also look up in the dejavu_fonts nix store path | ||
substituteInPlace interface.c \ | ||
--replace-fail "/usr/X11R6/lib/X11/fonts/TTF" "${dejavu_fonts.outPath}/share/fonts/truetype/" | ||
''; | ||
|
||
buildInputs = [ | ||
# sdl | ||
SDL | ||
SDL_ttf | ||
|
||
# audio server | ||
jack2 | ||
|
||
# audio decoder | ||
libmpg123 | ||
ffmpeg | ||
cdparanoia | ||
|
||
# fonts | ||
dejavu_fonts | ||
]; | ||
|
||
configureFlags = [ | ||
"--enable-alsa" | ||
"--enable-jack" | ||
]; | ||
|
||
nativeInstallCheckInputs = [ versionCheckHook ]; | ||
versionCheckProgramArg = "-h"; | ||
doInstallCheck = true; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/bin | ||
cp xwax $out/bin/xwax | ||
runHook postInstall | ||
''; | ||
|
||
meta = with lib; { | ||
homepage = "https://xwax.org"; | ||
description = "Digital vinyl on Linux"; | ||
mainProgram = "xwax"; | ||
license = licenses.gpl3Only; | ||
maintainers = with maintainers; [ obsoleszenz ]; | ||
platforms = platforms.linux; | ||
}; | ||
}) |