Merge pull request #234949 from fgaz/tamatool/init

tamatool: init at 0.1

authored by

Pol Dellaiera and committed by
GitHub
e3884e0c b295f9c7

+80
+78
pkgs/applications/emulators/tamatool/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , zip 5 + , copyDesktopItems 6 + , libpng 7 + , SDL2 8 + , SDL2_image 9 + , darwin 10 + 11 + # Optionally bundle a ROM file 12 + , rom ? null 13 + }: 14 + 15 + stdenv.mkDerivation (finalAttrs: { 16 + pname = "tamatool"; 17 + version = "0.1"; 18 + 19 + src = fetchFromGitHub { 20 + owner = "jcrona"; 21 + repo = "tamatool"; 22 + rev = "v${finalAttrs.version}"; 23 + hash = "sha256-VDmpIBuMWg3TwfCf9J6/bi/DaWip6ESAQWvGh2SH+A8="; 24 + fetchSubmodules = true; 25 + }; 26 + 27 + # * Point to the installed rom and res directory 28 + # * Tell the user to use --rom instead of telling them to place the rom in the 29 + # program directory (it's immutable!) 30 + postPatch = '' 31 + substituteInPlace src/tamatool.c \ 32 + --replace '#define RES_PATH' "#define RES_PATH \"$out/share/tamatool/res\" //" \ 33 + --replace '#define ROM_PATH' "#define ROM_PATH \"$out/share/tamatool/rom.bin\" //" \ 34 + --replace '#define ROM_NOT_FOUND_MSG' '#define ROM_NOT_FOUND_MSG "You need to use the --rom option!" //' 35 + ''; 36 + 37 + nativeBuildInputs = [ 38 + zip 39 + copyDesktopItems 40 + ]; 41 + 42 + buildInputs = [ 43 + libpng 44 + SDL2 45 + SDL2_image 46 + ] ++ lib.optionals stdenv.isDarwin [ 47 + darwin.apple_sdk.frameworks.CoreFoundation 48 + ]; 49 + 50 + makeFlags = [ 51 + "-Clinux" 52 + "VERSION=${finalAttrs.version}" 53 + "CFLAGS+=-I${SDL2.dev}/include/SDL2" 54 + "CFLAGS+=-I${SDL2_image}/include/SDL2" 55 + "DIST_PATH=$(out)" 56 + "CC=${stdenv.cc.targetPrefix}cc" 57 + ]; 58 + 59 + desktopItems = [ "linux/tamatool.desktop" ]; 60 + 61 + installPhase = '' 62 + runHook preInstall 63 + install -Dm755 linux/tamatool $out/bin/tamatool 64 + mkdir -p $out/share/tamatool 65 + cp -r res $out/share/tamatool/res 66 + install -Dm644 linux/tamatool.png $out/share/icons/hicolor/128x126/apps/tamatool.png 67 + ${lib.optionalString (rom != null) "install -Dm677 ${rom} $out/share/tamatool/rom.bin"} 68 + runHook postInstall 69 + ''; 70 + 71 + meta = with lib; { 72 + description = "A cross-platform Tamagotchi P1 explorer"; 73 + homepage = "https://github.com/jcrona/tamatool"; 74 + license = licenses.gpl2Only; 75 + maintainers = with maintainers; [ fgaz ]; 76 + platforms = platforms.all; 77 + }; 78 + })
+2
pkgs/top-level/all-packages.nix
··· 2635 2635 2636 2636 stella = callPackage ../applications/emulators/stella { }; 2637 2637 2638 + tamatool = callPackage ../applications/emulators/tamatool { }; 2639 + 2638 2640 termtekst = callPackage ../applications/emulators/termtekst { }; 2639 2641 2640 2642 tilem = callPackage ../applications/emulators/tilem { };