From e83227128be6923eb9503785ef13f78fe165315b Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Thu, 31 Oct 2024 21:24:11 +0700 Subject: [PATCH 1/3] littlegptracker: update to maintained fork (1.4.2) --- .../audio/littlegptracker/default.nix | 82 ++++++++----------- 1 file changed, 32 insertions(+), 50 deletions(-) diff --git a/pkgs/applications/audio/littlegptracker/default.nix b/pkgs/applications/audio/littlegptracker/default.nix index 754bf7865f77b..157ed159a849e 100644 --- a/pkgs/applications/audio/littlegptracker/default.nix +++ b/pkgs/applications/audio/littlegptracker/default.nix @@ -1,75 +1,57 @@ { lib, stdenv , fetchFromGitHub -, unstableGitUpdater -, SDL +, SDL2 +, python3 , jack2 , Foundation +, alsa-lib +, pkg-config }: - -stdenv.mkDerivation { +let + python = python3.withPackages (ps: with ps; [ pillow ]); +in stdenv.mkDerivation rec { pname = "littlegptracker"; - version = "0-unstable-2020-11-26"; + version = "1.4.2"; src = fetchFromGitHub { - owner = "Mdashdotdashn"; + owner = "djdiskmachine"; repo = "littlegptracker"; - rev = "4aca8cd765e1ad586da62decd019e66cb64b45b8"; - sha256 = "0f2ip8z5wxk8fvlw47mczsbcrzh4nh1hgw1fwf5gjrqnzm8v111x"; + rev = "refs/tags/${version}"; + hash = "sha256-1uXC5nJ63YguQuNIkuK0yx9lmrMBqw0WdlmCV8o11cE="; }; buildInputs = [ - SDL + pkg-config + SDL2 + python + alsa-lib ] - ++ lib.optional stdenv.hostPlatform.isDarwin Foundation - ++ lib.optional stdenv.hostPlatform.isLinux jack2; - - patches = [ - # Remove outdated (pre-64bit) checks that would fail on modern platforms - # (see description in patch file) - ./0001-Remove-coherency-checks.patch - ]; + ++ lib.optional stdenv.isDarwin Foundation + ++ lib.optional stdenv.isLinux jack2; preBuild = "cd projects"; - makeFlags = [ "CXX=${stdenv.cc.targetPrefix}c++" ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ "PLATFORM=DEB" ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ "PLATFORM=OSX" ]; + makeFlags = lib.optionals stdenv.isLinux [ "PLATFORM=X64" ] + ++ lib.optionals stdenv.isDarwin [ "PLATFORM=OSX" ]; - env.NIX_CFLAGS_COMPILE = toString ([ "-fpermissive" ] ++ - lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing"); + NIX_LDFLAGS = lib.optional stdenv.isDarwin "-framework Foundation"; - NIX_LDFLAGS = lib.optional stdenv.hostPlatform.isDarwin "-framework Foundation"; - - installPhase = let extension = if stdenv.hostPlatform.isDarwin then "app" else "deb-exe"; + installPhase = let extension = if stdenv.isDarwin then "app" else "x64"; in "install -Dm555 lgpt.${extension} $out/bin/lgpt"; - passthru.updateScript = unstableGitUpdater { - url = "https://github.com/Mdashdotdashn/littlegptracker.git"; - }; - - meta = with lib; { - description = "Music tracker similar to lsdj optimised to run on portable game consoles"; + meta = { + description = "Little Piggy Tracker, LittleGPTracker feature improved"; longDescription = '' - LittleGPTracker (a.k.a 'The piggy', 'lgpt') is a music tracker optimised - to run on portable game consoles. It is currently running on Game Park's - GP2x & Caanoo, PSP, Dingoo, Windows, Mac OSX (intel/ppc) & Linux (Debian). - - It implements the user interface of littlesounddj, a very famous tracker - for the Gameboy platform that has been tried and tested by many users over - the years, leading to a little complex but yet extremely efficent way of - working. - - Piggy currently supports 8 monophonic 16Bit/44.1Khz stereo sample playback - channels. Additionally, the program can drive MIDI instruments (with the - gp32 and gp2x a custom MIDI interface is required). + 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://www.littlegptracker.com/"; - downloadPage = "https://www.littlegptracker.com/download.php"; - license = licenses.bsd3; - maintainers = with maintainers; [ fgaz ]; - platforms = platforms.all; + homepage = "https://github.com/djdiskmachine/LittleGPTracker"; + downloadPage = "https://github.com/djdiskmachine/LittleGPTracker/releases"; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ fgaz ]; + platforms = lib.platforms.all; # https://github.com/NixOS/nixpkgs/pull/91766#issuecomment-688751821 - broken = stdenv.hostPlatform.isDarwin; - mainProgram = "lgpt"; + broken = stdenv.isDarwin; }; } From c7043d55822a520c2d109c372fc4e95aa7262e24 Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Fri, 1 Nov 2024 07:07:08 +0700 Subject: [PATCH 2/3] Delete unused patch, try to build on darwin --- .../0001-Remove-coherency-checks.patch | 52 ------------------- .../audio/littlegptracker/default.nix | 2 - 2 files changed, 54 deletions(-) delete mode 100644 pkgs/applications/audio/littlegptracker/0001-Remove-coherency-checks.patch diff --git a/pkgs/applications/audio/littlegptracker/0001-Remove-coherency-checks.patch b/pkgs/applications/audio/littlegptracker/0001-Remove-coherency-checks.patch deleted file mode 100644 index 3cabd2a2c56c1..0000000000000 --- a/pkgs/applications/audio/littlegptracker/0001-Remove-coherency-checks.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 2e1e9b3ffce9d1069fca0b27b8011f85c7547c3b Mon Sep 17 00:00:00 2001 -From: Francesco Gazzetta -Date: Wed, 19 Aug 2020 15:06:19 +0200 -Subject: [PATCH 1/2] Remove coherency checks >:) - -As far as I can see, they are just to make sure that the types can fit -in the word length, but this check was written when 64 bits weren't a -possibility and didn't take that into account, -so although the types do fit, the checks fail. -Indeed, the program seems to work well on 64 bits. -More info here: -https://github.com/Mdashdotdashn/LittleGPTracker/issues/4 ---- - sources/Externals/Soundfont/DATATYPE.H | 22 ---------------------- - 1 file changed, 22 deletions(-) - -diff --git a/sources/Externals/Soundfont/DATATYPE.H b/sources/Externals/Soundfont/DATATYPE.H -index 762a724..f6b031f 100644 ---- a/sources/Externals/Soundfont/DATATYPE.H -+++ b/sources/Externals/Soundfont/DATATYPE.H -@@ -123,28 +123,6 @@ typedef short SHORT; /* 16 bit signed value was: INT */ - ********************************************************************/ - typedef unsigned short EMUSTAT; - --/******************************************************************** --* Compare values with SoundFont Enabler limits. Fail compile --* if discrepency. If compile fails due to one of these errors, then --* the SoundFont enabler will not work with your system or the state of your --* development environment. --********************************************************************/ --#if (SCHAR_MAX != CHAR_MAXVAL) || (UCHAR_MAX != BYTE_MAXVAL) -- #error : char is out of range! --#endif -- --#if (SHRT_MAX != SHRT_MAXVAL) -- #error : short is out of range! --#endif -- --#if (LONG_MAX != LONG_MAXVAL) -- #error : long is out of range! --#endif -- --#if (ULONG_MAX != DWORD_MAXVAL) -- #error : unsigned long is out of range! --#endif -- - #ifdef __BYTE_COHERENT - - /******************************************************************** --- -2.25.4 - diff --git a/pkgs/applications/audio/littlegptracker/default.nix b/pkgs/applications/audio/littlegptracker/default.nix index 157ed159a849e..14c4f1cca7e1e 100644 --- a/pkgs/applications/audio/littlegptracker/default.nix +++ b/pkgs/applications/audio/littlegptracker/default.nix @@ -51,7 +51,5 @@ in stdenv.mkDerivation rec { license = lib.licenses.gpl3; maintainers = with lib.maintainers; [ fgaz ]; platforms = lib.platforms.all; - # https://github.com/NixOS/nixpkgs/pull/91766#issuecomment-688751821 - broken = stdenv.isDarwin; }; } From 8eb60962903346fa9949e11dc1b35697e4ac475b Mon Sep 17 00:00:00 2001 From: mrtnvgr Date: Fri, 1 Nov 2024 07:38:28 +0700 Subject: [PATCH 3/3] Bundle config and mapping xml files --- .../applications/audio/littlegptracker/default.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/audio/littlegptracker/default.nix b/pkgs/applications/audio/littlegptracker/default.nix index 14c4f1cca7e1e..773724a9b0a62 100644 --- a/pkgs/applications/audio/littlegptracker/default.nix +++ b/pkgs/applications/audio/littlegptracker/default.nix @@ -9,6 +9,7 @@ }: let python = python3.withPackages (ps: with ps; [ pillow ]); + platform = if stdenv.isLinux then "X64" else "OSX"; in stdenv.mkDerivation rec { pname = "littlegptracker"; version = "1.4.2"; @@ -31,13 +32,19 @@ in stdenv.mkDerivation rec { preBuild = "cd projects"; - makeFlags = lib.optionals stdenv.isLinux [ "PLATFORM=X64" ] - ++ lib.optionals stdenv.isDarwin [ "PLATFORM=OSX" ]; + makeFlags = [ "PLATFORM=${platform}" ]; NIX_LDFLAGS = lib.optional stdenv.isDarwin "-framework Foundation"; installPhase = let extension = if stdenv.isDarwin then "app" else "x64"; - in "install -Dm555 lgpt.${extension} $out/bin/lgpt"; + in '' + runHook preInstall + install -Dsm555 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 = "Little Piggy Tracker, LittleGPTracker feature improved"; @@ -48,6 +55,7 @@ in stdenv.mkDerivation rec { ''; 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;