nixpkgs/pkgs/applications/audio/schismtracker/default.nix
Ihar Hrachyshka dd0f03a56c treewide: remove usage of deprecated apple_sdk framework stubs
They are not doing anything right now. This is in preparation for their
complete removal from the tree.

Note: several changes that affect the derivation inputs (e.g. removal of
references to stub paths in build instructions) were left out. They will
be cleaned up the next iteration and will require special care.

Note: this PR is a result of a mix of ugly regex (not AST) based
automation and some manual labor. For reference, the regex automation
part was hacked in: https://github.com/booxter/nix-clean-apple_sdk

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
2025-04-19 20:28:20 -04:00

86 lines
2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
alsa-lib,
perl,
pkg-config,
SDL2,
libX11,
libXext,
utf8proc,
nix-update-script,
}:
stdenv.mkDerivation rec {
pname = "schismtracker";
version = "20250313";
src = fetchFromGitHub {
owner = "schismtracker";
repo = "schismtracker";
tag = version;
hash = "sha256-AiQ5+HTosVOR+Z5+uT6COMLvkGS3zvXtkCkg16MhVf4=";
};
# If we let it try to get the version from git, it will fail and fall back
# on running `date`, which will output the epoch, which is considered invalid
# in this assert: https://github.com/schismtracker/schismtracker/blob/a106b57e0f809b95d9e8bcf5a3975d27e0681b5a/schism/version.c#L112
postPatch = ''
substituteInPlace configure.ac \
--replace-fail 'git log' 'echo ${version} #'
'';
configureFlags =
[
(lib.enableFeature true "dependency-tracking")
(lib.withFeature true "sdl2")
(lib.enableFeature true "sdl2-linking")
]
++ lib.optionals stdenv.hostPlatform.isLinux [
(lib.enableFeature true "alsa")
(lib.enableFeature true "alsa-linking")
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
(lib.enableFeature false "sdltest")
];
strictDeps = true;
nativeBuildInputs = [
autoreconfHook
perl
pkg-config
];
buildInputs =
[
SDL2
libX11
utf8proc
]
++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
libXext
];
enableParallelBuilding = true;
# Our Darwin SDL2 doesn't have a SDL2main to link against
preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace configure.ac \
--replace '-lSDL2main' '-lSDL2'
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Music tracker application, free reimplementation of Impulse Tracker";
homepage = "https://schismtracker.org/";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ ftrvxmtrx ];
mainProgram = "schismtracker";
};
}