From d8fbfa958a28ca8bb5c6f4eabd2459b9eefa9208 Mon Sep 17 00:00:00 2001 From: obsoleszenz Date: Wed, 29 Jan 2025 16:00:27 +0100 Subject: [PATCH] xwax: init at version 1.9 --- pkgs/by-name/xw/xwax/package.nix | 77 ++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 pkgs/by-name/xw/xwax/package.nix diff --git a/pkgs/by-name/xw/xwax/package.nix b/pkgs/by-name/xw/xwax/package.nix new file mode 100644 index 000000000000..ddfdcc9db07f --- /dev/null +++ b/pkgs/by-name/xw/xwax/package.nix @@ -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 = { + homepage = "https://xwax.org"; + description = "Digital vinyl on Linux"; + mainProgram = "xwax"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ obsoleszenz ]; + platforms = lib.platforms.linux; + }; +})