diff options
author | Randy Eckenrode <randy@largeandhighquality.com> | 2023-09-07 23:16:49 -0400 |
---|---|---|
committer | Randy Eckenrode <randy@largeandhighquality.com> | 2023-09-07 23:22:11 -0400 |
commit | 92d99c521b2c02fa645b3b993ac4bbaf49e43ddd (patch) | |
tree | 784d12b55e7fb24a7155ea86aeb6d2ba7acb6f24 /pkgs/tools | |
parent | dba6d77ad232e3a5ffc5e281ebbada4fe0e23981 (diff) | |
download | nixpkgs-92d99c521b2c02fa645b3b993ac4bbaf49e43ddd.tar nixpkgs-92d99c521b2c02fa645b3b993ac4bbaf49e43ddd.tar.gz nixpkgs-92d99c521b2c02fa645b3b993ac4bbaf49e43ddd.tar.bz2 nixpkgs-92d99c521b2c02fa645b3b993ac4bbaf49e43ddd.tar.lz nixpkgs-92d99c521b2c02fa645b3b993ac4bbaf49e43ddd.tar.xz nixpkgs-92d99c521b2c02fa645b3b993ac4bbaf49e43ddd.tar.zst nixpkgs-92d99c521b2c02fa645b3b993ac4bbaf49e43ddd.zip |
plotutils: fix build with clang 16
Clang defaults to C++, which disallows the register storage class specifier. This causes the build to fail. Remove the specifier to allow clang 16 to build plotutils.
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/graphics/plotutils/c++17-register-usage-fix.patch | 44 | ||||
-rw-r--r-- | pkgs/tools/graphics/plotutils/default.nix | 5 |
2 files changed, 48 insertions, 1 deletions
diff --git a/pkgs/tools/graphics/plotutils/c++17-register-usage-fix.patch b/pkgs/tools/graphics/plotutils/c++17-register-usage-fix.patch new file mode 100644 index 00000000000..c83409221ac --- /dev/null +++ b/pkgs/tools/graphics/plotutils/c++17-register-usage-fix.patch @@ -0,0 +1,44 @@ +diff -ur a/pic2plot/gram.cc b/pic2plot/gram.cc +--- a/pic2plot/gram.cc 2000-06-28 00:23:21.000000000 -0400 ++++ b/pic2plot/gram.cc 2023-09-07 22:59:47.004460065 -0400 +@@ -1229,9 +1229,9 @@ + char *from; + unsigned int count; + { +- register char *f = from; +- register char *t = to; +- register int i = count; ++ char *f = from; ++ char *t = to; ++ int i = count; + + while (i-- > 0) + *t++ = *f++; +@@ -1244,9 +1244,9 @@ + static void + __yy_memcpy (char *to, char *from, unsigned int count) + { +- register char *t = to; +- register char *f = from; +- register int i = count; ++ char *t = to; ++ char *f = from; ++ int i = count; + + while (i-- > 0) + *t++ = *f++; +@@ -1289,10 +1289,10 @@ + yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL + { +- register int yystate; +- register int yyn; +- register short *yyssp; +- register YYSTYPE *yyvsp; ++ int yystate; ++ int yyn; ++ short *yyssp; ++ YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + diff --git a/pkgs/tools/graphics/plotutils/default.nix b/pkgs/tools/graphics/plotutils/default.nix index 57cfe988b0b..29b4c4b35fe 100644 --- a/pkgs/tools/graphics/plotutils/default.nix +++ b/pkgs/tools/graphics/plotutils/default.nix @@ -16,7 +16,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; buildInputs = [ libpng ]; - patches = map fetchurl (import ./debian-patches.nix); + patches = map fetchurl (import ./debian-patches.nix) + # `pic2plot/gram.cc` uses the register storage class specifier, which is not supported in C++17. + # This prevents clang 16 from building plotutils because it defaults to C++17. + ++ [ ./c++17-register-usage-fix.patch ]; preBuild = '' # Fix parallel building. |