2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-02-20 08:16:24 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2020-07-29 18:00:33 +01:00
|
|
|
, nixosTests
|
2021-06-10 03:57:09 +01:00
|
|
|
, alsa-lib
|
2020-02-20 08:16:24 +00:00
|
|
|
, SDL2
|
|
|
|
}:
|
|
|
|
|
2024-02-19 14:38:20 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-02-20 08:16:24 +00:00
|
|
|
pname = "pt2-clone";
|
2024-08-21 04:39:59 +01:00
|
|
|
version = "1.70";
|
2020-02-20 08:16:24 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "8bitbubsy";
|
|
|
|
repo = "pt2-clone";
|
2024-02-19 14:38:20 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-08-21 04:39:59 +01:00
|
|
|
sha256 = "sha256-oGdgvyVIqM4YVxyr5DFBJ+YLtH95vqbNv0arD9yskdo=";
|
2020-02-20 08:16:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
2021-06-10 03:57:09 +01:00
|
|
|
buildInputs = [ SDL2 ] ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib;
|
2020-02-20 08:16:24 +00:00
|
|
|
|
2023-12-01 21:17:20 +00:00
|
|
|
postInstall = ''
|
|
|
|
install -Dm444 "$src/release/other/Freedesktop.org Resources/ProTracker 2 clone.desktop" \
|
2024-07-11 10:23:57 +01:00
|
|
|
$out/share/applications/pt2-clone.desktop
|
2023-12-01 21:17:20 +00:00
|
|
|
install -Dm444 "$src/release/other/Freedesktop.org Resources/ProTracker 2 clone.png" \
|
2024-07-11 10:23:57 +01:00
|
|
|
$out/share/icons/hicolor/512x512/apps/pt2-clone.png
|
|
|
|
# gtk-update-icon-cache does not like whitespace. Note that removing this
|
|
|
|
# will not make the build fail, but it will make the NixOS test fail.
|
|
|
|
substituteInPlace $out/share/applications/pt2-clone.desktop \
|
|
|
|
--replace-fail "Icon=ProTracker 2 clone" Icon=pt2-clone
|
2023-12-01 21:17:20 +00:00
|
|
|
'';
|
|
|
|
|
2020-07-29 18:00:33 +01:00
|
|
|
passthru.tests = {
|
|
|
|
pt2-clone-opens = nixosTests.pt2-clone;
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-02-20 08:16:24 +00:00
|
|
|
description = "Highly accurate clone of the classic ProTracker 2.3D software for Amiga";
|
|
|
|
homepage = "https://16-bits.org/pt2.php";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
2020-10-02 12:53:35 +01:00
|
|
|
# From HOW-TO-COMPILE.txt:
|
|
|
|
# > This code is NOT big-endian compatible
|
|
|
|
platforms = platforms.littleEndian;
|
2024-02-11 02:19:15 +00:00
|
|
|
mainProgram = "pt2-clone";
|
2020-02-20 08:16:24 +00:00
|
|
|
};
|
2024-02-19 14:38:20 +00:00
|
|
|
})
|