lol
1{ lib, stdenv
2, fetchFromGitHub
3, unstableGitUpdater
4, SDL
5, jack2
6, Foundation
7}:
8
9stdenv.mkDerivation rec {
10 pname = "littlegptracker";
11 version = "unstable-2020-11-26";
12
13 src = fetchFromGitHub {
14 owner = "Mdashdotdashn";
15 repo = "littlegptracker";
16 rev = "4aca8cd765e1ad586da62decd019e66cb64b45b8";
17 sha256 = "0f2ip8z5wxk8fvlw47mczsbcrzh4nh1hgw1fwf5gjrqnzm8v111x";
18 };
19
20 buildInputs = [
21 SDL
22 ]
23 ++ lib.optional stdenv.isDarwin Foundation
24 ++ lib.optional stdenv.isLinux jack2;
25
26 patches = [
27 # Remove outdated (pre-64bit) checks that would fail on modern platforms
28 # (see description in patch file)
29 ./0001-Remove-coherency-checks.patch
30 ];
31
32 preBuild = "cd projects";
33
34 makeFlags = [ "CXX=${stdenv.cc.targetPrefix}c++" ]
35 ++ lib.optionals stdenv.isLinux [ "PLATFORM=DEB" ]
36 ++ lib.optionals stdenv.isDarwin [ "PLATFORM=OSX" ];
37
38 NIX_CFLAGS_COMPILE = [ "-fpermissive" ] ++
39 lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing";
40
41 NIX_LDFLAGS = lib.optional stdenv.isDarwin "-framework Foundation";
42
43 installPhase = let extension = if stdenv.isDarwin then "app" else "deb-exe";
44 in "install -Dm555 lgpt.${extension} $out/bin/lgpt";
45
46 passthru.updateScript = unstableGitUpdater {
47 url = "https://github.com/Mdashdotdashn/littlegptracker.git";
48 };
49
50 meta = with lib; {
51 description = "A music tracker similar to lsdj optimised to run on portable game consoles";
52 longDescription = ''
53 LittleGPTracker (a.k.a 'The piggy', 'lgpt') is a music tracker optimised
54 to run on portable game consoles. It is currently running on Game Park's
55 GP2x & Caanoo, PSP, Dingoo, Windows, Mac OSX (intel/ppc) & Linux (Debian).
56
57 It implements the user interface of littlesounddj, a very famous tracker
58 for the Gameboy platform that has been tried and tested by many users over
59 the years, leading to a little complex but yet extremely efficent way of
60 working.
61
62 Piggy currently supports 8 monophonic 16Bit/44.1Khz stereo sample playback
63 channels. Additionally, the program can drive MIDI instruments (with the
64 gp32 and gp2x a custom MIDI interface is required).
65 '';
66 homepage = "http://www.littlegptracker.com/";
67 downloadPage = "http://www.littlegptracker.com/download.php";
68 license = licenses.bsd3;
69 maintainers = with maintainers; [ fgaz ];
70 platforms = platforms.all;
71 # https://github.com/NixOS/nixpkgs/pull/91766#issuecomment-688751821
72 broken = stdenv.isDarwin;
73 };
74}