From 5711bfdefb6daa5185d690d9cf7133a3fae61c95 Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Sun, 22 Oct 2017 21:09:19 +0100 Subject: [PATCH 1/3] torcs: fix build with gcc6 --- pkgs/games/torcs/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/games/torcs/default.nix b/pkgs/games/torcs/default.nix index 1ea94a5d2ced813..e7c1c38fd15a7d2 100644 --- a/pkgs/games/torcs/default.nix +++ b/pkgs/games/torcs/default.nix @@ -1,4 +1,4 @@ -{ fetchurl, stdenv, mesa, freeglut, libX11, plib, openal, freealut, libXrandr, xproto, +{ fetchpatch, fetchurl, stdenv, mesa, freeglut, libX11, plib, openal, freealut, libXrandr, xproto, libXext, libSM, libICE, libXi, libXt, libXrender, libXxf86vm, libvorbis, libpng, zlib, bash, makeWrapper }: @@ -10,7 +10,14 @@ stdenv.mkDerivation rec { sha256 = "0kdq0sc7dsfzlr0ggbxggcbkivc6yp30nqwjwcaxg9295s3b06wa"; }; - patchPhase = '' + patches = [ + (fetchpatch { + url = "https://anonscm.debian.org/git/pkg-games/torcs.git/plain/debian/patches/gcc6-isnan.patch"; + sha256 = "16scmq30vwb8429ah9d4ws0v1w6ai59lvn7hcgnvfzyap42ry876"; + }) + ]; + + postPatch = '' sed -i -e s,/bin/bash,`type -P bash`, src/linux/torcs.in ''; From ce0684a81a2596a9a2b4a3072f7cb5ca01961bb7 Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Sun, 22 Oct 2017 21:09:46 +0100 Subject: [PATCH 2/3] torcs: re-enable -Wformat hardening --- pkgs/games/torcs/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/games/torcs/default.nix b/pkgs/games/torcs/default.nix index e7c1c38fd15a7d2..3a4b8bdb0213e0d 100644 --- a/pkgs/games/torcs/default.nix +++ b/pkgs/games/torcs/default.nix @@ -15,6 +15,10 @@ stdenv.mkDerivation rec { url = "https://anonscm.debian.org/git/pkg-games/torcs.git/plain/debian/patches/gcc6-isnan.patch"; sha256 = "16scmq30vwb8429ah9d4ws0v1w6ai59lvn7hcgnvfzyap42ry876"; }) + (fetchpatch { + url = "https://anonscm.debian.org/git/pkg-games/torcs.git/plain/debian/patches/format-argument.patch"; + sha256 = "04advcx88yh23ww767iysydzhp370x7cqp2wf9hk2y1qvw7mxsja"; + }) ]; postPatch = '' @@ -28,8 +32,6 @@ stdenv.mkDerivation rec { installTargets = "install datainstall"; - hardeningDisable = [ "format" ]; - postInstall = '' wrapProgram $out/bin/torcs \ --prefix LD_LIBRARY_PATH : ${mesa}/lib From a94d014149173c1a2b1c005ed3e22bd86413d643 Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Sun, 22 Oct 2017 21:10:49 +0100 Subject: [PATCH 3/3] torcs: clean up compiler warnings --- pkgs/games/torcs/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/games/torcs/default.nix b/pkgs/games/torcs/default.nix index 3a4b8bdb0213e0d..1b6ad5b34c329a5 100644 --- a/pkgs/games/torcs/default.nix +++ b/pkgs/games/torcs/default.nix @@ -19,6 +19,10 @@ stdenv.mkDerivation rec { url = "https://anonscm.debian.org/git/pkg-games/torcs.git/plain/debian/patches/format-argument.patch"; sha256 = "04advcx88yh23ww767iysydzhp370x7cqp2wf9hk2y1qvw7mxsja"; }) + (fetchpatch { + url = "https://anonscm.debian.org/git/pkg-games/torcs.git/plain/debian/patches/glibc-default-source.patch"; + sha256 = "0k4hgpddnhv68mdc9ics7ah8q54j60g394d7zmcmzg6l3bjd9pyp"; + }) ]; postPatch = ''