From f45177459c64777ad22b5aebd2f4b2e0672b3da6 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 13 May 2025 21:57:29 +0200 Subject: [PATCH] pong3d: fix build --- pkgs/by-name/po/pong3d/package.nix | 32 ++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/po/pong3d/package.nix b/pkgs/by-name/po/pong3d/package.nix index 32614d8db292..d94b42d23303 100644 --- a/pkgs/by-name/po/pong3d/package.nix +++ b/pkgs/by-name/po/pong3d/package.nix @@ -2,23 +2,39 @@ lib, stdenv, fetchurl, + libX11, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "3dpong"; version = "0.5"; + src = fetchurl { - url = "ftp://ftp.tuxpaint.org/unix/x/3dpong/src/3dpong-${version}.tar.gz"; - sha256 = "1ibb79sbzlbn4ra3n0qk22gqr6fg7q0jy6cm0wg2qj4z64c7hmdi"; + url = "https://tuxpaint.org/ftp/unix/x/3dpong/src/3dpong-${finalAttrs.version}.tar.gz"; + hash = "sha256-sVV4GDGfSCweB5UZLwE+z5mMnxATAztUJnbRv3Q6a8U="; }; + postPatch = '' + substituteInPlace src/3dpong.c --replace-fail \ + "#include " \ + "#include + #include " + + substituteInPlace src/randnum.c --replace-fail \ + "#include " \ + "#include + #include " + + substituteInPlace src/text.c --replace-fail \ + "#include " \ + "#include + #include " + ''; + buildInputs = [ libX11 ]; - preConfigure = '' - sed -i s,/usr/local,$out, Makefile - mkdir -p $out/bin - ''; + makeFlags = [ "PREFIX=$(out)" ]; meta = { homepage = "http://www.newbreedsoftware.com/3dpong/"; @@ -26,4 +42,4 @@ stdenv.mkDerivation rec { license = lib.licenses.gpl2Plus; platforms = lib.platforms.linux; }; -} +})