From ed24081baa569f319e2055c1eba9fd093b109493 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Fri, 3 Nov 2023 12:32:07 -0400 Subject: smpeg: fix build with clang 16 Apply upstream patches to remove usage of the `register` storage class specifier, which was removed from C++17 (the default with clang 16). --- pkgs/development/libraries/smpeg/default.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'pkgs/development/libraries/smpeg/default.nix') diff --git a/pkgs/development/libraries/smpeg/default.nix b/pkgs/development/libraries/smpeg/default.nix index f25ac14df86..099a3d838bb 100644 --- a/pkgs/development/libraries/smpeg/default.nix +++ b/pkgs/development/libraries/smpeg/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, SDL, autoconf, automake, libtool, gtk2, m4, pkg-config, libGLU, libGL, makeWrapper }: +{ lib, stdenv, fetchFromGitHub, fetchpatch, SDL, autoconf, automake, libtool, gtk2, m4, pkg-config, libGLU, libGL, makeWrapper }: stdenv.mkDerivation rec { pname = "smpeg"; @@ -16,8 +16,24 @@ stdenv.mkDerivation rec { ./gcc6.patch ./libx11.patch ./gtk.patch + # These patches remove use of the `register` storage class specifier, + # allowing smpeg to build with clang 16, which defaults to C++17. + (fetchpatch { + url = "https://github.com/icculus/smpeg/commit/cc114ba0dd8644c0d6205bbce2384781daeff44b.patch"; + hash = "sha256-GxSD82j05pw0r2SxmPYAe/BXX4iUc+iHWhB9Ap4GzfA="; + }) + (fetchpatch { + url = "https://github.com/icculus/smpeg/commit/b369feca5bf99d6cff50d8eb316395ef48acf24f.patch"; + hash = "sha256-U+a6dbc5cm249KlUcf4vi79yUiT4hgEvMv522K4PqUc="; + }) ]; + postPatch = '' + substituteInPlace video/gdith.cpp \ + --replace 'register int' 'int' \ + --replace 'register Uint16' 'Uint16' + ''; + enableParallelBuilding = true; nativeBuildInputs = [ autoconf automake libtool m4 pkg-config makeWrapper ]; -- cgit 1.4.1