2021-01-15 13:21:58 +00:00
|
|
|
{ lib, stdenv
|
2020-02-25 14:06:24 +00:00
|
|
|
, fetchurl
|
|
|
|
, unzip
|
2020-11-27 12:41:44 +00:00
|
|
|
, copyDesktopItems
|
2020-02-25 14:06:24 +00:00
|
|
|
, makeDesktopItem
|
|
|
|
, imagemagick
|
|
|
|
, SDL
|
|
|
|
, isStereo ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-01-21 22:06:40 +00:00
|
|
|
pname = "goattracker" + lib.optionalString isStereo "-stereo";
|
2020-02-25 14:06:24 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = pname;
|
2023-01-21 22:06:40 +00:00
|
|
|
desktopName = "GoatTracker 2" + lib.optionalString isStereo " Stereo";
|
2020-02-25 14:06:24 +00:00
|
|
|
genericName = "Music Tracker";
|
|
|
|
exec = if isStereo
|
|
|
|
then "gt2stereo"
|
|
|
|
else "goattrk2";
|
|
|
|
icon = "goattracker";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "AudioVideo" "AudioVideoEditing" ];
|
|
|
|
keywords = [ "tracker" "music" ];
|
2020-02-25 14:06:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
inherit pname;
|
|
|
|
version = if isStereo
|
2021-05-27 07:13:25 +00:00
|
|
|
then "2.77" # stereo
|
|
|
|
else "2.76"; # normal
|
2020-02-25 14:06:24 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-01-21 22:06:40 +00:00
|
|
|
url = "mirror://sourceforge/goattracker2/GoatTracker_${version}${lib.optionalString isStereo "_Stereo"}.zip";
|
2020-02-25 14:06:24 +00:00
|
|
|
sha256 = if isStereo
|
2021-05-27 07:13:25 +00:00
|
|
|
then "1hiig2d152sv9kazwz33i56x1c54h5sh21ipkqnp6qlnwj8x1ksy" # stereo
|
|
|
|
else "0d7a3han4jw4bwiba3j87racswaajgl3pj4sb5lawdqdxicv3dn1"; # normal
|
2020-02-25 14:06:24 +00:00
|
|
|
};
|
2021-05-27 07:13:25 +00:00
|
|
|
sourceRoot = "src";
|
2020-02-25 14:06:24 +00:00
|
|
|
|
2020-11-27 12:41:44 +00:00
|
|
|
nativeBuildInputs = [ copyDesktopItems unzip imagemagick ];
|
2020-02-25 14:06:24 +00:00
|
|
|
buildInputs = [ SDL ];
|
|
|
|
|
|
|
|
# PREFIX gets treated as BINDIR.
|
|
|
|
makeFlags = [ "PREFIX=$(out)/bin/" ];
|
|
|
|
|
|
|
|
# The zip contains some build artifacts.
|
|
|
|
prePatch = "make clean";
|
|
|
|
|
|
|
|
# The destination does not get created automatically.
|
|
|
|
preBuild = "mkdir -p $out/bin";
|
|
|
|
|
|
|
|
# Other files get installed during the build phase.
|
|
|
|
installPhase = ''
|
2020-11-27 12:41:44 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-02-25 14:06:24 +00:00
|
|
|
convert goattrk2.bmp goattracker.png
|
|
|
|
install -Dm644 goattracker.png $out/share/icons/hicolor/32x32/apps/goattracker.png
|
2020-11-27 12:41:44 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-02-25 14:06:24 +00:00
|
|
|
'';
|
|
|
|
|
2020-11-27 12:41:44 +00:00
|
|
|
desktopItems = [ desktopItem ];
|
|
|
|
|
2020-02-25 14:06:24 +00:00
|
|
|
meta = {
|
|
|
|
description = "A crossplatform music editor for creating Commodore 64 music. Uses reSID library by Dag Lem and supports alternatively HardSID & CatWeasel devices"
|
2023-01-21 22:06:40 +00:00
|
|
|
+ lib.optionalString isStereo " - Stereo version";
|
2020-02-25 14:06:24 +00:00
|
|
|
homepage = "https://cadaver.github.io/tools.html";
|
|
|
|
downloadPage = "https://sourceforge.net/projects/goattracker2/";
|
2023-01-21 22:06:40 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [ fgaz ];
|
|
|
|
platforms = lib.platforms.all;
|
2020-02-25 14:06:24 +00:00
|
|
|
};
|
|
|
|
}
|