View | Details | Raw Unified | Return to bug 270625 | Differences between
and this patch

Collapse All | Expand All

(-)b/devel/root/Makefile (-1 / +12 lines)
Lines 82-85 PLIST_SUB+= ONLY_INSTALLED_WITH_LLVM_CLANG_13="" Link Here
82
PLIST_SUB+=	ONLY_INSTALLED_WITH_LLVM_CLANG_13="@comment "
82
PLIST_SUB+=	ONLY_INSTALLED_WITH_LLVM_CLANG_13="@comment "
83
.endif
83
.endif
84
84
85
.include <bsd.port.mk>
85
.include <bsd.port.pre.mk>
86
87
# In LLVM/Clang 10.0.1 (used on FreeBSD 12.3), the cstdalign header is missing from the std modulemap, but it is declared included in ROOT's std modulemap - this has to be removed.
88
# See https://github.com/llvm/llvm-project/blob/main/libcxx/include/module.modulemap.in#L181
89
# The same seems to be the case for the other headers defined in the variable "modules" below.
90
.if ${OSVERSION} < 1204000
91
modules=	cstdalign cuchar experimental/string_view ext/functional ext/numeric ext/type_traits.h bits_alloc_traits_h bits/allocator.h bits/basic_ios.h bits/cpp_type_traits.h bits/exception_defines.h bits/ios_base.h bits/locale_facets.h bits_stl_algobase_h bits_stl_iterator_h bits/stl_iterator_base_types.h bits/stl_map.h bits/stl_pair.h bits_stl_tree_h bits/uniform_int_dist.h
92
post-patch:
93
	SCRIPTDIR=${SCRIPTDIR} MODULEMAP=${WRKSRC}/interpreter/cling/include/cling/std.modulemap ${SH} ${SCRIPTDIR}/remove-modules-from-modulemap.sh "${modules}"
94
.endif
95
96
.include <bsd.port.post.mk>
(-)b/devel/root/scripts/remove-modules-from-modulemap.awk (+9 lines)
Added Link Here
1
BEGIN {
2
  exclude = exclude; #trim left and right
3
  gsub(/[[:blank:]]/, "|", exclude);
4
  gsub(/\//, "\\/", exclude);
5
  ex_regx = "module[[:blank:]]+\"(" exclude ")\".*{[[:blank:]]*$";
6
}
7
8
$0 ~ ex_regx, $0 ~ /^[[:blank:]]*}[[:blank:]]*$/  { next ; }
9
{print}
(-)b/devel/root/scripts/remove-modules-from-modulemap.sh (-23 / +3 lines)
Lines 1-27 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
2
3
# Script removes module definition blocks in LLVM/Clang .modulemap
3
# Script removes module definition blocks in LLVM/Clang .modulemap
4
# files in-place in the file path stored in the variable MODULEMAP
4
# files "in-place" in the file path stored in the variable MODULEMAP
5
5
6
sp='[[:space:]]'
6
modules=$1
7
7
tmp=${MODULEMAP}.tmp && awk -f ${SCRIPTDIR}/remove-modules-from-modulemap.awk -v exclude="${modules}" ${MODULEMAP} > ${tmp} && mv ${tmp} ${MODULEMAP} || rm ${tmp}
8
mdls="" ; i=0
9
for m in "$@" ; do
10
  i=$((i+1))
11
  mdls="$mdls($m)"
12
  [ $i -ne $# ] && mdls="$mdls|"
13
done
14
15
script="\
16
/^$sp*(explicit)?$sp*module$sp*\"$mdls\"$sp*\{$sp*\$/ {
17
  :l
18
    N
19
    s/}/}/
20
    tx
21
    bl
22
  :x
23
    d
24
}\
25
"
26
27
sed -i '' -E "$script" "$MODULEMAP"

Return to bug 270625