> remember that devel/llvm is not set in stone.
> 
> here are two patches, for wine, and for devel/llvm, that make this
> significantly less annoying to deal with. my build is still running but
> I think it should work.
> 
> another way to do it: rather than completely removing the stripped-out
> headers, devel/llvm could install them under a different dir and
> include in packages.

... changes to llvm aren't _required_ in order to do this, but unxz of
the llvm tarball and extracting <250 files is *loads* quicker than
doing the whole lot.

> --- Makefile.orig     Mon Oct 19 14:18:12 2026
> +++ Makefile  Mon Oct 19 14:43:16 2026
> @@ -27,19 +27,14 @@ WANTLIB += lib/inotify/inotify lib/libpcap/pcap
>  # loaded with dlopen()
>  WANTLIB += SDL2 cups dbus-1 gnutls netapi vulkan xkbregistry
>  
> -# keep this in sync with MODCLANG_VERSION
> -# source for updates/new releases: 
> https://thfr.gothub.org/wine-clang-pe-headers
> -CLANG_PE_HEADERS =           22.1.8
> -DISTFILES.clang-pe-headers = wine-clang-pe-headers-${CLANG_PE_HEADERS}.tar.gz
> -SITES.clang-pe-headers =     https://thfr.info/distfiles/
> -
>  SITES =                      https://dl.winehq.org/wine/source/11.x/
>  EXTRACT_SUFX =               .tar.xz
>  
>  MODULES =            lang/clang
>  
>  BUILD_DEPENDS =              devel/bison \
> -                     devel/nasm
> +                     devel/nasm \
> +                     ${_MODCLANG_BUILD_DEPENDS},headerextract:patch

...so for now, this could use ${_MODCLANG_BUILD_DEPENDS}:patch without
the special flavour, and then it's ok sthen to import

>  RUN_DEPENDS =                multimedia/gstreamer1/libav \
>                       multimedia/gstreamer1/plugins-bad \
>                       multimedia/gstreamer1/plugins-good \
> @@ -156,9 +151,9 @@ SUBST_VARS+=              CLANG_PE_RESOURCE 
> MODCLANG_VERSION
>  
>  pre-configure:
>       ${INSTALL_DATA_DIR} ${CLANG_PE_RESOURCE}/include
> -     cp -R ${CLANG_RESOURCE}/include/. ${CLANG_PE_RESOURCE}/include/
> -     cp ${WRKDIR}/wine-clang-pe-headers-${CLANG_PE_HEADERS}/*.h \
> +     cp ${WRKDIR}/devel/llvm/*/*/clang/lib/Headers/*.h \
>               ${CLANG_PE_RESOURCE}/include/
> +     cp -R ${CLANG_RESOURCE}/include/. ${CLANG_PE_RESOURCE}/include/
>       ln -sfh ${CLANG_RESOURCE}/lib ${CLANG_PE_RESOURCE}/lib
>       ${SUBST_PROGRAM} ${FILESDIR}/clang-pe ${WRKDIR}/bin/clang-pe
>  
> 
> 
> Index: Makefile.inc
> ===================================================================
> RCS file: /cvs/ports/devel/llvm/Makefile.inc,v
> diff -u -p -r1.35 Makefile.inc
> --- Makefile.inc      20 Sep 2026 14:25:09 -0000      1.35
> +++ Makefile.inc      19 Oct 2026 13:35:06 -0000
> @@ -97,9 +97,19 @@ COMPILER = base-clang ports-gcc
>  
>  MODULES +=   devel/cmake
>  
> +# internal use for emulators/wine; reduce extraction size
> +FLAVORS=     headerextract
> +FLAVOR?=
> +
> +.if ${FLAVOR} == headerextract
> +PATCH_LIST=
> +EXTRACT_CASES += llvm*.tar.xz) \
> +    xz -T${MAKE_JOBS} -d <${FULLDISTDIR}/$$archive | ${TAR} -xf - -- 
> */clang/lib/Headers;;
> +.else
>  BUILD_DEPENDS +=     devel/swig \
>                       textproc/py-sphinx \
>                       textproc/py-recommonmark
> +.endif
>  
>  CONFIGURE_STYLE +=   cmake
>  CONFIGURE_ARGS +=    \
> @@ -151,7 +161,8 @@ CXXFLAGS-powerpc =        -fno-ret-protector
>  CXXFLAGS-mips64 +=   -mxgot
>  CXXFLAGS-mips64el += -mxgot
>  
> -CXXFLAGS +=          ${CXXFLAGS-${MACHINE_ARCH}}
> +CXXFLAGS +=          ${CXXFLAGS-${MACHINE_ARCH}} \
> +                     -D_LIBCPP_USE_LOWER_DEQUE_BLOCK_SIZE
>  
>  ALL_TARGET =         all docs-llvm-man docs-clang-man
>  
> 

Reply via email to