Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xwax: init at version 1.9 #377421

Merged
merged 2 commits into from
Feb 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16991,6 +16991,12 @@
github = "obsidian-systems-maintenance";
githubId = 80847921;
};
obsoleszenz = {
name = "obsoleszenz";
email = "[email protected]";
github = "obsoleszenz";
githubId = 94946669;
};
ocfox = {
email = "[email protected]";
github = "ocfox";
Expand Down
77 changes: 77 additions & 0 deletions pkgs/by-name/xw/xwax/package.nix
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=";
};

obsoleszenz marked this conversation as resolved.
Show resolved Hide resolved
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
'';

obsoleszenz marked this conversation as resolved.
Show resolved Hide resolved
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;
};
})