From a80aad7a10c352d77f571bbcc557d50f92fa33fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Ker=C3=A4nen?= Date: Mon, 13 Feb 2023 08:39:57 +0200 Subject: [PATCH] c64-debugger: init at 0.64.58.6 --- .../emulators/c64-debugger/default.nix | 101 ++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 103 insertions(+) create mode 100644 pkgs/applications/emulators/c64-debugger/default.nix diff --git a/pkgs/applications/emulators/c64-debugger/default.nix b/pkgs/applications/emulators/c64-debugger/default.nix new file mode 100644 index 000000000000..b7c357ca2709 --- /dev/null +++ b/pkgs/applications/emulators/c64-debugger/default.nix @@ -0,0 +1,101 @@ +{ lib +, stdenv +, fetchgit +, alsa-lib +, gtk3 +, libGL +, libGLU +, libX11 +, pkg-config +, upx +, xcbutil +}: + +stdenv.mkDerivation { + name = "c64-debugger"; + version = "0.64.58.6"; + + src = fetchgit { + url = "https://git.code.sf.net/p/c64-debugger/code"; + rev = "f97772e3f5c8b4fa99e8ed212ed1c4cb1e2389f1"; + sha256 = "sha256-3SR73AHQlYSEYpJLtQ/aJ1UITZGq7aA9tQKxBsn/yuc="; + }; + + buildInputs = [ + alsa-lib + gtk3 + libGL + libGLU + pkg-config + libX11 + xcbutil + ]; + + nativeBuildInputs = [ + upx + ]; + + postPatch = '' + # Disable default definition of RUN_COMMODORE64 + sed -i 's|^#define RUN_COMMODORE64|//#define RUN_COMMODORE64|' MTEngine/Games/c64/C64D_Version.h + ''; + + buildPhase = '' + runHook preBuild + + # Build C64 debugger + make -C MTEngine \ + CFLAGS="-w -O2 -fcommon" \ + CXXFLAGS="-w -O2 --std=c++11" \ + DEFINES="-DRUN_COMMODORE64" \ + -j$NIX_BUILD_CORES + mv MTEngine/c64debugger c64debugger + make -C MTEngine clean + + # Build 65XE debugger + make -C MTEngine \ + CFLAGS="-w -O2 -fcommon" \ + CXXFLAGS="-w -O2 --std=c++11" \ + DEFINES="-DRUN_ATARI" \ + -j$NIX_BUILD_CORES + mv MTEngine/c64debugger 65xedebugger + make -C MTEngine clean + + # Build NES debugger + make -C MTEngine \ + CFLAGS="-w -O2 -fcommon" \ + CXXFLAGS="-w -O2 --std=c++11" \ + DEFINES="-DRUN_NES" \ + -j$NIX_BUILD_CORES + mv MTEngine/c64debugger nesdebugger + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + install -d "$out/bin" + install -d "$out/share/doc" + install -m 755 c64debugger 65xedebugger nesdebugger "$out/bin" + install -m 644 MTEngine/Assets/*.txt "$out/share/doc" + install -m 644 MTEngine/Assets/*.pdf "$out/share/doc" + + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://sourceforge.net/projects/c64-debugger"; + description = "Commodore 64, Atari XL/XE and NES code and memory debugger that works in real time"; + license = with licenses; [ + gpl3Only # c64-debugger + mit # MTEngine + # emulators included in c64-debugger + gpl2Plus # VICE, atari800 + gpl2 # nestopiaue + ]; + mainProgram = "c64debugger"; + maintainers = [ maintainers.detegr ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 91450b149754..6985ff4ef24d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -368,6 +368,8 @@ with pkgs; buildMaven = callPackage ../build-support/build-maven.nix {}; + c64-debugger = callPackage ../applications/emulators/c64-debugger { }; + caroline = callPackage ../development/libraries/caroline { }; castget = callPackage ../applications/networking/feedreaders/castget { };