git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #91766 from fgaz/littlegptracker/init

littlegptracker: init at unstable-2019-04-14

commitec3714b42b1a929f4d2c7ea7aa1e5bd3c7bcac4c authorTimo Kaufmann <timokau@zoho.com> dateWed 23 Sep 2020, 20:32 (6 years ago) parent7955668e20e2d4
4 files changed+155
pkgs/applications/audio/littlegptracker/0001-Remove-coherency-checks.patch+52 pkgs/applications/audio/littlegptracker/0002-Set-the-initial-directory-to-the-current-directory.patch+27 pkgs/applications/audio/littlegptracker/default.nix+72 pkgs/top-level/all-packages.nix+4
pkgs/applications/audio/littlegptracker/0001-Remove-coherency-checks.patchnew file+52
@@ -0,0 +1,52 @@
1+From 2e1e9b3ffce9d1069fca0b27b8011f85c7547c3b Mon Sep 17 00:00:00 2001
2+From: Francesco Gazzetta <fgaz@fgaz.me>
3+Date: Wed, 19 Aug 2020 15:06:19 +0200
4+Subject: [PATCH 1/2] Remove coherency checks >:)
5+
6+As far as I can see, they are just to make sure that the types can fit
7+in the word length, but this check was written when 64 bits weren't a
8+possibility and didn't take that into account,
9+so although the types do fit, the checks fail.
10+Indeed, the program seems to work well on 64 bits.
11+More info here:
12+https://github.com/Mdashdotdashn/LittleGPTracker/issues/4
13+---
14+ sources/Externals/Soundfont/DATATYPE.H | 22 ----------------------
15+ 1 file changed, 22 deletions(-)
16+
17+diff --git a/sources/Externals/Soundfont/DATATYPE.H b/sources/Externals/Soundfont/DATATYPE.H
18+index 762a724..f6b031f 100644
19+--- a/sources/Externals/Soundfont/DATATYPE.H
20++++ b/sources/Externals/Soundfont/DATATYPE.H
21+@@ -123,28 +123,6 @@ typedef short SHORT; /* 16 bit signed value was: INT */
22+ ********************************************************************/
23+ typedef unsigned short EMUSTAT;
24+
25+-/********************************************************************
26+-* Compare <limits.h> values with SoundFont Enabler limits. Fail compile
27+-* if discrepency. If compile fails due to one of these errors, then
28+-* the SoundFont enabler will not work with your system or the state of your
29+-* development environment.
30+-********************************************************************/
31+-#if (SCHAR_MAX != CHAR_MAXVAL) || (UCHAR_MAX != BYTE_MAXVAL)
32+- #error <datatype.h>: char is out of range!
33+-#endif
34+-
35+-#if (SHRT_MAX != SHRT_MAXVAL)
36+- #error <datatype.h>: short is out of range!
37+-#endif
38+-
39+-#if (LONG_MAX != LONG_MAXVAL)
40+- #error <datatype.h>: long is out of range!
41+-#endif
42+-
43+-#if (ULONG_MAX != DWORD_MAXVAL)
44+- #error <datatype.h>: unsigned long is out of range!
45+-#endif
46+-
47+ #ifdef __BYTE_COHERENT
48+
49+ /********************************************************************
50+--
51+2.25.4
52+
pkgs/applications/audio/littlegptracker/0002-Set-the-initial-directory-to-the-current-directory.patchnew file+27
@@ -0,0 +1,27 @@
1+From c3865405ca707e3284a81709577d85ce2b3db72c Mon Sep 17 00:00:00 2001
2+From: Francesco Gazzetta <fgaz@fgaz.me>
3+Date: Wed, 19 Aug 2020 15:06:58 +0200
4+Subject: [PATCH 2/2] Set the initial directory to the current directory
5+
6+otherwise the user has to navigate from the nix store, which makes the program
7+crash due to its size
8+---
9+ sources/Adapters/DEB/System/DEBSystem.cpp | 2 +-
10+ 1 file changed, 1 insertion(+), 1 deletion(-)
11+
12+diff --git a/sources/Adapters/DEB/System/DEBSystem.cpp b/sources/Adapters/DEB/System/DEBSystem.cpp
13+index 6e86693..65d2cdd 100644
14+--- a/sources/Adapters/DEB/System/DEBSystem.cpp
15++++ b/sources/Adapters/DEB/System/DEBSystem.cpp
16+@@ -54,7 +54,7 @@ void DEBSystem::Boot(int argc,char **argv) {
17+ }
18+ Path::SetAlias("bin",dirname(buff)) ;
19+
20+- Path::SetAlias("root","bin:..") ;
21++ Path::SetAlias("root",".") ;
22+
23+ #ifdef _DEBUG
24+ Trace::GetInstance()->SetLogger(*(new StdOutLogger()));
25+--
26+2.25.4
27+
pkgs/applications/audio/littlegptracker/default.nixnew file+72
@@ -0,0 +1,72 @@
1+{ stdenv
2+, fetchFromGitHub
3+, SDL
4+, jack2
5+, Foundation
6+}:
7+
8+stdenv.mkDerivation rec {
9+ pname = "littlegptracker";
10+ version = "unstable-2019-04-14";
11+
12+ src = fetchFromGitHub {
13+ owner = "Mdashdotdashn";
14+ repo = "littlegptracker";
15+ rev = "0ed729b46739e3df5e111c6fa4d548fde2d3b891";
16+ sha256 = "1pc6lg2qp6xh7ahs5d5pb63ms4h2dz7ryp3c7mci4g37gbwbsj5b";
17+ };
18+
19+ buildInputs = [
20+ SDL
21+ ]
22+ ++ stdenv.lib.optional stdenv.isDarwin Foundation
23+ ++ stdenv.lib.optional stdenv.isLinux jack2;
24+
25+ patches = [
26+ # Remove outdated (pre-64bit) checks that would fail on modern platforms
27+ # (see description in patch file)
28+ ./0001-Remove-coherency-checks.patch
29+ # Set starting directory to cwd, default is in /nix/store and causes a crash
30+ # (see description in patch file)
31+ ./0002-Set-the-initial-directory-to-the-current-directory.patch
32+ ];
33+
34+ preBuild = "cd projects";
35+
36+ makeFlags = [ "CXX=${stdenv.cc.targetPrefix}c++" ]
37+ ++ stdenv.lib.optionals stdenv.isLinux [ "PLATFORM=DEB" ]
38+ ++ stdenv.lib.optionals stdenv.isDarwin [ "PLATFORM=OSX" ];
39+
40+ NIX_CFLAGS_COMPILE = [ "-fpermissive" ] ++
41+ stdenv.lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing";
42+
43+ NIX_LDFLAGS = stdenv.lib.optional stdenv.isDarwin "-framework Foundation";
44+
45+ installPhase = let extension = if stdenv.isDarwin then "app" else "deb-exe";
46+ in "install -Dm555 lgpt.${extension} $out/bin/lgpt";
47+
48+ meta = with stdenv.lib; {
49+ description = "A music tracker similar to lsdj optimised to run on portable game consoles";
50+ longDescription = ''
51+ LittleGPTracker (a.k.a 'The piggy', 'lgpt') is a music tracker optimised
52+ to run on portable game consoles. It is currently running on Game Park's
53+ GP2x & Caanoo, PSP, Dingoo, Windows, Mac OSX (intel/ppc) & Linux (Debian).
54+
55+ It implements the user interface of littlesounddj, a very famous tracker
56+ for the Gameboy platform that has been tried and tested by many users over
57+ the years, leading to a little complex but yet extremely efficent way of
58+ working.
59+
60+ Piggy currently supports 8 monophonic 16Bit/44.1Khz stereo sample playback
61+ channels. Additionally, the program can drive MIDI instruments (with the
62+ gp32 and gp2x a custom MIDI interface is required).
63+ '';
64+ homepage = "http://www.littlegptracker.com/";
65+ downloadPage = "http://www.littlegptracker.com/download.php";
66+ license = licenses.bsd3;
67+ maintainers = with maintainers; [ fgaz ];
68+ platforms = platforms.all;
69+ # https://github.com/NixOS/nixpkgs/pull/91766#issuecomment-688751821
70+ broken = stdenv.isDarwin;
71+ };
72+}
pkgs/top-level/all-packages.nix+4
@@ -21767,6 +21767,10 @@ in
2176721767
2176821768 linuxband = callPackage ../applications/audio/linuxband { };
2176921769
21770+ littlegptracker = callPackage ../applications/audio/littlegptracker {
21771+ inherit (darwin.apple_sdk.frameworks) Foundation;
21772+ };
21773+
2177021774 ledger = callPackage ../applications/office/ledger { };
2177121775
2177221776 ledger-autosync = callPackage ../applications/office/ledger-autosync { };