diff --git a/pkgs/by-name/ap/applgrid/TFileStringLinkDef.h b/pkgs/by-name/ap/applgrid/TFileStringLinkDef.h new file mode 100644 index 000000000000..ce59a4a65321 --- /dev/null +++ b/pkgs/by-name/ap/applgrid/TFileStringLinkDef.h @@ -0,0 +1,6 @@ +#ifdef __CLING__ +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; +#pragma link C++ class TFileString+; +#endif diff --git a/pkgs/by-name/ap/applgrid/TFileVectorLinkDef.h b/pkgs/by-name/ap/applgrid/TFileVectorLinkDef.h new file mode 100644 index 000000000000..07ba83655d5e --- /dev/null +++ b/pkgs/by-name/ap/applgrid/TFileVectorLinkDef.h @@ -0,0 +1,6 @@ +#ifdef __CLING__ +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; +#pragma link C++ class TFileVector+; +#endif diff --git a/pkgs/by-name/ap/applgrid/no-m64.patch b/pkgs/by-name/ap/applgrid/no-m64.patch new file mode 100644 index 000000000000..5848af7d1e3e --- /dev/null +++ b/pkgs/by-name/ap/applgrid/no-m64.patch @@ -0,0 +1,10 @@ +--- a/configure ++++ b/configure +@@ -16130,7 +16130,6 @@ + $as_echo "$as_me: WARNING: ****************************************************************" >&2;} + fi + +-( echo $CXXFLAGS | grep -q "m64" ) || CXXFLAGS+=" -m64 " + + + diff --git a/pkgs/by-name/ap/applgrid/package.nix b/pkgs/by-name/ap/applgrid/package.nix index c578ade96705..bda97414b7a2 100644 --- a/pkgs/by-name/ap/applgrid/package.nix +++ b/pkgs/by-name/ap/applgrid/package.nix @@ -18,7 +18,26 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-h+ZNGj33FIwg4fOCyfGJrUKM2vDDQl76JcLhtboAOtc="; }; + patches = [ + # Upstream's configure unconditionally injects `-m64` into CXXFLAGS, which is + # invalid on aarch64 (and redundant on x86_64). The line was added in r1946 + # for applgrid 1.6.17 with the commit message "add default m64 compilation". + # There is no public bug tracker upstream, and the line is still present in + # trunk. We patch only the generated `configure` (not `configure.ac`) so + # that make doesn't try to re-run autotools during the build. + ./no-m64.patch + + # ROOT 6.40 made rootcling fail when no selection rules are provided + # (https://root.cern/doc/v640/release-notes.html#core-libraries). The patch + # appends $*LinkDef.h to the dictionary pattern rule so rootcint picks up + # the LinkDef.h files we drop into src/ in postPatch. + ./rootcling-linkdef.patch + ]; + postPatch = '' + cp ${./TFileStringLinkDef.h} src/TFileStringLinkDef.h + cp ${./TFileVectorLinkDef.h} src/TFileVectorLinkDef.h + sed -i appl_grid/serialise_base.h -e '1i#include ' ''; diff --git a/pkgs/by-name/ap/applgrid/rootcling-linkdef.patch b/pkgs/by-name/ap/applgrid/rootcling-linkdef.patch new file mode 100644 index 000000000000..e969dc7f25c7 --- /dev/null +++ b/pkgs/by-name/ap/applgrid/rootcling-linkdef.patch @@ -0,0 +1,11 @@ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -1027,7 +1027,7 @@ + $(CC) $(AM_CFLAGS) -c $< + + @USE_ROOT_TRUE@%Dict.cxx : %.h %.cxx +-@USE_ROOT_TRUE@ $(CINT) -f $@ -c $< -I.. ++@USE_ROOT_TRUE@ $(CINT) -f $@ -c $< -I.. $*LinkDef.h + + #../appl_grid/$*LinkDef.h +