nixpkgs/pkgs/applications/audio/littlegptracker/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

76 lines
2.2 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
SDL2,
python3,
jack2,
alsa-lib,
pkg-config,
}:
let
python = python3.withPackages (ps: with ps; [ pillow ]);
platform = if stdenv.hostPlatform.isDarwin then "OSX" else "X64";
in
stdenv.mkDerivation (finalAttrs: {
pname = "littlegptracker";
version = "1.4.2";
src = fetchFromGitHub {
owner = "djdiskmachine";
repo = "littlegptracker";
tag = finalAttrs.version;
hash = "sha256-1uXC5nJ63YguQuNIkuK0yx9lmrMBqw0WdlmCV8o11cE=";
};
nativeBuildInputs = [
pkg-config
python
];
buildInputs =
[ SDL2 ]
++ lib.optional (lib.meta.availableOn stdenv.hostPlatform alsa-lib) alsa-lib
++ lib.optional stdenv.hostPlatform.isLinux jack2;
preBuild = ''
cd projects
'';
makeFlags = [
"CXX=${stdenv.cc.targetPrefix}c++"
"PLATFORM=${platform}"
];
env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-framework Foundation";
installPhase =
let
extension = if stdenv.hostPlatform.isDarwin then "app" else "x64";
in
''
runHook preInstall
install -Dm555 lgpt.${extension} $out/lib/lgpt/lgpt
install -Dm444 resources/${platform}/{config,mapping}.xml $out/lib/lgpt/
mkdir -p $out/bin
ln -s $out/lib/lgpt/lgpt $out/bin/
runHook postInstall
'';
meta = {
description = "Music tracker optimised to run on portable game consoles";
longDescription = ''
Little Piggy Tracker (f.k.a 'LittleGPTracker') is a music tracker optimised to run on portable game consoles.
It is currently running on Windows, MacOS (intel/arm) & Linux, PSP, Miyoo Mini, and a collection of other retro gaming handhelds.
It implements the user interface of littlesounddj and precedes M8 tracker, two popular trackers greatly loved in the tracker community.
'';
homepage = "https://github.com/djdiskmachine/LittleGPTracker";
downloadPage = "https://github.com/djdiskmachine/LittleGPTracker/releases";
mainProgram = "lgpt";
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ fgaz ];
platforms = lib.platforms.all;
# https://github.com/NixOS/nixpkgs/pull/352617#issuecomment-2495663097
broken = stdenv.hostPlatform.isDarwin;
};
})