name: clang version: 8.0.1 release: 1 sources: - https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/cfe-%{version}.src.tar.xz - labs.h - clang dirname: build @configure #sed -i '/^ return ToolChain::CST_Libstdcxx/s@stdcxx@cxx@' cfe-%{version}.src/tools/lib/Driver/ToolChain.cpp mkdir %{dirname} cd %{dirname} cmake ../cfe-%{version}.src \ -DCMAKE_PREFIX_PATH=%{prefix} \ -DCMAKE_INSTALL_PREFIX=%{prefix} \ -DCLANG_CONFIG_FILE_SYSTEM_DIR=%{prefix}/etc/clang \ -DCLANG_DEFAULT_CXX_STDLIB=libc++ \ -DCMAKE_CXX_COMPILER="clang++" \ -DCMAKE_CXX_FLAGS="$CXXFLAGS -stdlib=libc++ -include /usr/weirdos/include/c++/v1/math.h -include $(pwd)/../labs.h -D__DEFINED_max_align_t" \ -DCMAKE_C_COMPILER="clang" \ -DCMAKE_C_FLAGS="$CFLAGS" \ -DCMAKE_EXE_LINKER_FLAGS="$LDFLAGS -lc++" \ -DCMAKE_SHARED_LINKER_FLAGS="$LDFLAGS -lc++" \ -DCMAKE_BUILD_TYPE=Release @install cd %{dirname} make DESTDIR=%{pkg} install mkdir -p %{pkg}/prefix/bin rm %{pkg}%{prefix}/bin/clang cp ../clang %{pkg}%{prefix}/bin/ rm %{pkg}%{prefix}/bin/clang++ ln -s %{prefix}/bin/clang %{pkg}%{prefix}/bin/clang++