Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opensp: fix build with clang 16 #240645

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pkgs/tools/text/sgml/opensp/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib, stdenv, fetchurl, fetchpatch, xmlto, docbook_xml_dtd_412
, libxslt, docbook_xsl, autoconf, automake, gettext, libiconv, libtool
, autoreconfHook
}:

stdenv.mkDerivation rec {
Expand All @@ -21,6 +22,8 @@ stdenv.mkDerivation rec {
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-text/opensp/files/opensp-1.5.2-c11-using.patch?id=688d9675782dfc162d4e6cff04c668f7516118d0";
sha256 = "04q14s8qsad0bkjmj067dn831i0r6v7742rafdlnbfm5y249m2q6";
})
# Clang 16 defaults to C++17, which does not allow `register` as a storage class specifier.
./fix-register-storage-class.patch
];

setupHook = ./setup-hook.sh;
Expand All @@ -41,7 +44,11 @@ stdenv.mkDerivation rec {
xmlto
docbook_xml_dtd_412
docbook_xsl
] ++ lib.optionals stdenv.isCygwin [ autoconf automake libtool ];
]
# Clang 16 fails to build due to inappropriate definitions in the `config.h` generated by the
# existing configure scripts. Regenerate them to make sure they detect its features correctly.
++ lib.optional stdenv.cc.isClang autoreconfHook
++ lib.optionals stdenv.isCygwin [ autoconf automake libtool ];

doCheck = false; # fails

Expand Down
11 changes: 11 additions & 0 deletions pkgs/tools/text/sgml/opensp/fix-register-storage-class.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/lib/Recognizer.cxx 2005-11-05 04:05:20.000000000 -0500
+++ b/lib/Recognizer.cxx 2023-06-03 11:45:04.497116217 -0400
@@ -39,7 +39,7 @@
}
else
in->startTokenNoMulticode();
- register const Trie *pos = trie_.pointer();
+ const Trie *pos = trie_.pointer();
do {
pos = pos->next(map_[in->tokenChar(mgr)]);
} while (pos->hasNext());