pacman-game: build for Linux too, not just Darwin

Assisted-by: Claude:opus-4.8
This commit is contained in:
Sam Estep
2026-06-03 18:39:08 -04:00
parent e08e49ba80
commit 94bb01d274
+13 -2
View File
@@ -1,4 +1,5 @@
{
installShellFiles,
lib,
stdenv,
fetchFromGitHub,
@@ -7,6 +8,8 @@
stdenv.mkDerivation (finalAttrs: {
pname = "pacman-game";
version = "0-unstable-2017-01-30";
strictDeps = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "justinjo";
@@ -15,10 +18,18 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-2GwIv8XMbd8WZBaPp4tOblAzku49UilHmv6bG9A1y+4=";
};
# The upstream Makefile hardcodes clang++, which is the default compiler on
# Darwin but not on Linux. Use the stdenv compiler so it builds everywhere.
postPatch = ''
substituteInPlace Makefile --replace-fail "clang++" "c++"
'';
nativeBuildInputs = [ installShellFiles ];
installPhase = ''
runHook preInstall
install -Dm755 pacman $out/bin/pacman
installBin pacman
runHook postInstall
'';
@@ -27,7 +38,7 @@ stdenv.mkDerivation (finalAttrs: {
description = "Command line pacman game";
homepage = "https://github.com/justinjo/Pacman";
license = lib.licenses.unlicense;
platforms = lib.platforms.darwin;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ ethancedwards8 ];
mainProgram = "pacman";
};