pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

llvm/clang: more Darwin installation fixes



Module Name:	pkgsrc-wip
Committed By:	Tobias Nygren <tnn%NetBSD.org@localhost>
Pushed By:	tnn
Date:		Thu Feb 25 19:32:42 2016 +0100
Changeset:	0cf9bb9627e41d6aee98f8336c47ae5b65d03721

Modified Files:
	clang-git/Makefile.common
	clang-git/PLIST
	clang/Makefile.common
	clang/PLIST
	libLLVM/Makefile
	libLLVM/PLIST
	llvm-git/Makefile
	llvm/Makefile

Log Message:
llvm/clang: more Darwin installation fixes

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=0cf9bb9627e41d6aee98f8336c47ae5b65d03721

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 clang-git/Makefile.common |  11 +++-
 clang-git/PLIST           |   4 +-
 clang/Makefile.common     |  16 ++++-
 clang/PLIST               | 154 +++++++++++++++++++++++-----------------------
 libLLVM/Makefile          |  34 +++++++++-
 libLLVM/PLIST             |   5 +-
 llvm-git/Makefile         |  21 +++++--
 llvm/Makefile             |  15 ++++-
 8 files changed, 164 insertions(+), 96 deletions(-)

diffs:
diff --git a/clang-git/Makefile.common b/clang-git/Makefile.common
index a57eb90..447865f 100644
--- a/clang-git/Makefile.common
+++ b/clang-git/Makefile.common
@@ -76,11 +76,18 @@ SUBST_SED.libcxx=		-e 's,(Major >= 7 || Major == 0),(false),'
 CMAKE_ARGS+=			-DCLANG_DEFAULT_CXX_STDLIB:STRING="libstdc++"
 .endif
 
+# 3.8.0 -> 3.8
+LLVM_MAJOR=	${PKGVERSION_NOREV:C/^([0-9]+\.[0-9]+)\..*$/\1/}
+PLIST_SUBST+=	LLVM_MAJOR=${LLVM_MAJOR}
+
+PLIST_VARS+=	notdylib
 .if ${_OPSYS_SHLIB_TYPE} == "dylib"
-PLIST_SUBST+=		SOEXT="dylib"
+SOEXT=		dylib
 .else
-PLIST_SUBST+=		SOEXT="so"
+SOEXT=		so
+PLIST.notdylib=	yes
 .endif
+PLIST_SUBST+=	SOEXT=${SOEXT}
 
 PKG_OPTIONS_VAR=	PKG_OPTIONS.clang
 PKG_SUPPORTED_OPTIONS=	tests
diff --git a/clang-git/PLIST b/clang-git/PLIST
index 4ab4b73..a39de31 100644
--- a/clang-git/PLIST
+++ b/clang-git/PLIST
@@ -2,7 +2,7 @@
 bin/c-index-test
 bin/clang
 bin/clang++
-bin/clang-3.9
+bin/clang-${LLVM_MAJOR}
 bin/clang-cl
 bin/clang-format
 include/clang-c/BuildSystem.h
@@ -536,7 +536,7 @@ lib/cmake/clang/ClangConfig.cmake
 lib/cmake/clang/ClangTargets-release.cmake
 lib/cmake/clang/ClangTargets.cmake
 lib/libclang.${SOEXT}
-lib/libclang.${SOEXT}.3.9
+${PLIST.notdylib}lib/libclang.${SOEXT}.${LLVM_MAJOR}
 lib/libclangAST.a
 lib/libclangASTMatchers.a
 lib/libclangAnalysis.a
diff --git a/clang/Makefile.common b/clang/Makefile.common
index f02bff9..643005e 100644
--- a/clang/Makefile.common
+++ b/clang/Makefile.common
@@ -76,11 +76,23 @@ SUBST_SED.libcxx=		-e 's,(Major >= 7 || (Major == 6 && Minor == 99 && Micro >= 4
 CMAKE_ARGS+=			-DCLANG_DEFAULT_CXX_STDLIB:STRING="libstdc++"
 .endif
 
+# 3.8.0 -> 3.8
+LLVM_MAJOR=	${PKGVERSION_NOREV:C/^([0-9]+\.[0-9]+)\..*$/\1/}
+PLIST_SUBST+=	LLVM_MAJOR=${LLVM_MAJOR}
+
+# 3.8.0rc2 -> 3.8.0
+# This is not required in pkgsrc proper, use PKGVERSION_NOREV
+PKGVERSION_NORC=${PKGVERSION_NOREV:C/rc[0-9]+//}
+PLIST_SUBST+=	PKGVERSION_NORC=${PKGVERSION_NORC}
+
+PLIST_VARS+=	notdylib
 .if ${_OPSYS_SHLIB_TYPE} == "dylib"
-PLIST_SUBST+=		SOEXT="dylib"
+SOEXT=		dylib
 .else
-PLIST_SUBST+=		SOEXT="so"
+SOEXT=		so
+PLIST.notdylib=	yes
 .endif
+PLIST_SUBST+=	SOEXT=${SOEXT}
 
 PKG_OPTIONS_VAR=	PKG_OPTIONS.clang
 PKG_SUPPORTED_OPTIONS=	tests
diff --git a/clang/PLIST b/clang/PLIST
index bd255ca..b25ee37 100644
--- a/clang/PLIST
+++ b/clang/PLIST
@@ -2,7 +2,7 @@
 bin/c-index-test
 bin/clang
 bin/clang++
-bin/clang-3.8
+bin/clang-${LLVM_MAJOR}
 bin/clang-cl
 bin/clang-format
 include/clang-c/BuildSystem.h
@@ -443,83 +443,83 @@ include/clang/Tooling/Refactoring.h
 include/clang/Tooling/RefactoringCallbacks.h
 include/clang/Tooling/ReplacementsYaml.h
 include/clang/Tooling/Tooling.h
-lib/clang/3.8.0/include/Intrin.h
-lib/clang/3.8.0/include/__clang_cuda_runtime_wrapper.h
-lib/clang/3.8.0/include/__stddef_max_align_t.h
-lib/clang/3.8.0/include/__wmmintrin_aes.h
-lib/clang/3.8.0/include/__wmmintrin_pclmul.h
-lib/clang/3.8.0/include/adxintrin.h
-lib/clang/3.8.0/include/altivec.h
-lib/clang/3.8.0/include/ammintrin.h
-lib/clang/3.8.0/include/arm_acle.h
-lib/clang/3.8.0/include/arm_neon.h
-lib/clang/3.8.0/include/avx2intrin.h
-lib/clang/3.8.0/include/avx512bwintrin.h
-lib/clang/3.8.0/include/avx512cdintrin.h
-lib/clang/3.8.0/include/avx512dqintrin.h
-lib/clang/3.8.0/include/avx512erintrin.h
-lib/clang/3.8.0/include/avx512fintrin.h
-lib/clang/3.8.0/include/avx512vlbwintrin.h
-lib/clang/3.8.0/include/avx512vldqintrin.h
-lib/clang/3.8.0/include/avx512vlintrin.h
-lib/clang/3.8.0/include/avxintrin.h
-lib/clang/3.8.0/include/bmi2intrin.h
-lib/clang/3.8.0/include/bmiintrin.h
-lib/clang/3.8.0/include/cpuid.h
-lib/clang/3.8.0/include/cuda_builtin_vars.h
-lib/clang/3.8.0/include/emmintrin.h
-lib/clang/3.8.0/include/f16cintrin.h
-lib/clang/3.8.0/include/float.h
-lib/clang/3.8.0/include/fma4intrin.h
-lib/clang/3.8.0/include/fmaintrin.h
-lib/clang/3.8.0/include/fxsrintrin.h
-lib/clang/3.8.0/include/htmintrin.h
-lib/clang/3.8.0/include/htmxlintrin.h
-lib/clang/3.8.0/include/ia32intrin.h
-lib/clang/3.8.0/include/immintrin.h
-lib/clang/3.8.0/include/inttypes.h
-lib/clang/3.8.0/include/iso646.h
-lib/clang/3.8.0/include/limits.h
-lib/clang/3.8.0/include/lzcntintrin.h
-lib/clang/3.8.0/include/mm3dnow.h
-lib/clang/3.8.0/include/mm_malloc.h
-lib/clang/3.8.0/include/mmintrin.h
-lib/clang/3.8.0/include/module.modulemap
-lib/clang/3.8.0/include/nmmintrin.h
-lib/clang/3.8.0/include/pkuintrin.h
-lib/clang/3.8.0/include/pmmintrin.h
-lib/clang/3.8.0/include/popcntintrin.h
-lib/clang/3.8.0/include/prfchwintrin.h
-lib/clang/3.8.0/include/rdseedintrin.h
-lib/clang/3.8.0/include/rtmintrin.h
-lib/clang/3.8.0/include/s390intrin.h
-lib/clang/3.8.0/include/shaintrin.h
-lib/clang/3.8.0/include/smmintrin.h
-lib/clang/3.8.0/include/stdalign.h
-lib/clang/3.8.0/include/stdarg.h
-lib/clang/3.8.0/include/stdatomic.h
-lib/clang/3.8.0/include/stdbool.h
-lib/clang/3.8.0/include/stddef.h
-lib/clang/3.8.0/include/stdint.h
-lib/clang/3.8.0/include/stdnoreturn.h
-lib/clang/3.8.0/include/tbmintrin.h
-lib/clang/3.8.0/include/tgmath.h
-lib/clang/3.8.0/include/tmmintrin.h
-lib/clang/3.8.0/include/unwind.h
-lib/clang/3.8.0/include/vadefs.h
-lib/clang/3.8.0/include/varargs.h
-lib/clang/3.8.0/include/vecintrin.h
-lib/clang/3.8.0/include/wmmintrin.h
-lib/clang/3.8.0/include/x86intrin.h
-lib/clang/3.8.0/include/xmmintrin.h
-lib/clang/3.8.0/include/xopintrin.h
-lib/clang/3.8.0/include/xsavecintrin.h
-lib/clang/3.8.0/include/xsaveintrin.h
-lib/clang/3.8.0/include/xsaveoptintrin.h
-lib/clang/3.8.0/include/xsavesintrin.h
-lib/clang/3.8.0/include/xtestintrin.h
+lib/clang/${PKGVERSION_NORC}/include/Intrin.h
+lib/clang/${PKGVERSION_NORC}/include/__clang_cuda_runtime_wrapper.h
+lib/clang/${PKGVERSION_NORC}/include/__stddef_max_align_t.h
+lib/clang/${PKGVERSION_NORC}/include/__wmmintrin_aes.h
+lib/clang/${PKGVERSION_NORC}/include/__wmmintrin_pclmul.h
+lib/clang/${PKGVERSION_NORC}/include/adxintrin.h
+lib/clang/${PKGVERSION_NORC}/include/altivec.h
+lib/clang/${PKGVERSION_NORC}/include/ammintrin.h
+lib/clang/${PKGVERSION_NORC}/include/arm_acle.h
+lib/clang/${PKGVERSION_NORC}/include/arm_neon.h
+lib/clang/${PKGVERSION_NORC}/include/avx2intrin.h
+lib/clang/${PKGVERSION_NORC}/include/avx512bwintrin.h
+lib/clang/${PKGVERSION_NORC}/include/avx512cdintrin.h
+lib/clang/${PKGVERSION_NORC}/include/avx512dqintrin.h
+lib/clang/${PKGVERSION_NORC}/include/avx512erintrin.h
+lib/clang/${PKGVERSION_NORC}/include/avx512fintrin.h
+lib/clang/${PKGVERSION_NORC}/include/avx512vlbwintrin.h
+lib/clang/${PKGVERSION_NORC}/include/avx512vldqintrin.h
+lib/clang/${PKGVERSION_NORC}/include/avx512vlintrin.h
+lib/clang/${PKGVERSION_NORC}/include/avxintrin.h
+lib/clang/${PKGVERSION_NORC}/include/bmi2intrin.h
+lib/clang/${PKGVERSION_NORC}/include/bmiintrin.h
+lib/clang/${PKGVERSION_NORC}/include/cpuid.h
+lib/clang/${PKGVERSION_NORC}/include/cuda_builtin_vars.h
+lib/clang/${PKGVERSION_NORC}/include/emmintrin.h
+lib/clang/${PKGVERSION_NORC}/include/f16cintrin.h
+lib/clang/${PKGVERSION_NORC}/include/float.h
+lib/clang/${PKGVERSION_NORC}/include/fma4intrin.h
+lib/clang/${PKGVERSION_NORC}/include/fmaintrin.h
+lib/clang/${PKGVERSION_NORC}/include/fxsrintrin.h
+lib/clang/${PKGVERSION_NORC}/include/htmintrin.h
+lib/clang/${PKGVERSION_NORC}/include/htmxlintrin.h
+lib/clang/${PKGVERSION_NORC}/include/ia32intrin.h
+lib/clang/${PKGVERSION_NORC}/include/immintrin.h
+lib/clang/${PKGVERSION_NORC}/include/inttypes.h
+lib/clang/${PKGVERSION_NORC}/include/iso646.h
+lib/clang/${PKGVERSION_NORC}/include/limits.h
+lib/clang/${PKGVERSION_NORC}/include/lzcntintrin.h
+lib/clang/${PKGVERSION_NORC}/include/mm3dnow.h
+lib/clang/${PKGVERSION_NORC}/include/mm_malloc.h
+lib/clang/${PKGVERSION_NORC}/include/mmintrin.h
+lib/clang/${PKGVERSION_NORC}/include/module.modulemap
+lib/clang/${PKGVERSION_NORC}/include/nmmintrin.h
+lib/clang/${PKGVERSION_NORC}/include/pkuintrin.h
+lib/clang/${PKGVERSION_NORC}/include/pmmintrin.h
+lib/clang/${PKGVERSION_NORC}/include/popcntintrin.h
+lib/clang/${PKGVERSION_NORC}/include/prfchwintrin.h
+lib/clang/${PKGVERSION_NORC}/include/rdseedintrin.h
+lib/clang/${PKGVERSION_NORC}/include/rtmintrin.h
+lib/clang/${PKGVERSION_NORC}/include/s390intrin.h
+lib/clang/${PKGVERSION_NORC}/include/shaintrin.h
+lib/clang/${PKGVERSION_NORC}/include/smmintrin.h
+lib/clang/${PKGVERSION_NORC}/include/stdalign.h
+lib/clang/${PKGVERSION_NORC}/include/stdarg.h
+lib/clang/${PKGVERSION_NORC}/include/stdatomic.h
+lib/clang/${PKGVERSION_NORC}/include/stdbool.h
+lib/clang/${PKGVERSION_NORC}/include/stddef.h
+lib/clang/${PKGVERSION_NORC}/include/stdint.h
+lib/clang/${PKGVERSION_NORC}/include/stdnoreturn.h
+lib/clang/${PKGVERSION_NORC}/include/tbmintrin.h
+lib/clang/${PKGVERSION_NORC}/include/tgmath.h
+lib/clang/${PKGVERSION_NORC}/include/tmmintrin.h
+lib/clang/${PKGVERSION_NORC}/include/unwind.h
+lib/clang/${PKGVERSION_NORC}/include/vadefs.h
+lib/clang/${PKGVERSION_NORC}/include/varargs.h
+lib/clang/${PKGVERSION_NORC}/include/vecintrin.h
+lib/clang/${PKGVERSION_NORC}/include/wmmintrin.h
+lib/clang/${PKGVERSION_NORC}/include/x86intrin.h
+lib/clang/${PKGVERSION_NORC}/include/xmmintrin.h
+lib/clang/${PKGVERSION_NORC}/include/xopintrin.h
+lib/clang/${PKGVERSION_NORC}/include/xsavecintrin.h
+lib/clang/${PKGVERSION_NORC}/include/xsaveintrin.h
+lib/clang/${PKGVERSION_NORC}/include/xsaveoptintrin.h
+lib/clang/${PKGVERSION_NORC}/include/xsavesintrin.h
+lib/clang/${PKGVERSION_NORC}/include/xtestintrin.h
 lib/libclang.${SOEXT}
-lib/libclang.${SOEXT}.3.8
+${PLIST.notdylib}lib/libclang.${SOEXT}.${LLVM_MAJOR}
 lib/libclangAST.a
 lib/libclangASTMatchers.a
 lib/libclangAnalysis.a
diff --git a/libLLVM/Makefile b/libLLVM/Makefile
index f3ac546..c77988c 100644
--- a/libLLVM/Makefile
+++ b/libLLVM/Makefile
@@ -89,6 +89,27 @@ TEST_TARGET=		check
 TEST_ENV+=		LD_LIBRARY_PATH=${WRKDIR}/build/lib
 
 .include "../../mk/bsd.prefs.mk"
+
+# 3.8.0 -> 3.8
+LLVM_MAJOR=	${PKGVERSION_NOREV:C/^([0-9]+\.[0-9]+)\..*$/\1/}
+PLIST_SUBST+=	LLVM_MAJOR=${LLVM_MAJOR}
+
+# This is not required in pkgsrc proper, use PKGVERSION_NOREV
+PKGVERSION_NORC=${PKGVERSION_NOREV:C/rc[0-9]+//}
+PLIST_SUBST+=	PKGVERSION_NORC=${PKGVERSION_NORC}
+
+PLIST_VARS+=	notdylib
+.if ${_OPSYS_SHLIB_TYPE} == "dylib"
+SOEXT=		dylib
+LLVM_LIBNAME=	libLLVM.${SOEXT}
+.else
+SOEXT=		so
+LLVM_LIBNAME=	libLLVM-${LLVM_MAJOR}.${SOEXT}
+PLIST.notdylib=	yes
+.endif
+PLIST_SUBST+=	SOEXT=${SOEXT}
+PLIST_SUBST+=	LLVM_LIBNAME=${LLVM_LIBNAME}
+
 .include "options.mk"
 
 # replacing config.guess is required even for cmake.
@@ -101,9 +122,16 @@ post-extract:
 
 post-install:
 	${INSTALL_LIB_DIR} ${DESTDIR}${PREFIX}/lib/libLLVM
-	${INSTALL_LIB} ${WRKDIR}/build/lib/libLLVM-3.8.so ${DESTDIR}${PREFIX}/lib/libLLVM/libLLVM-3.8.so
-	${LN} -s libLLVM-3.8.so ${DESTDIR}${PREFIX}/lib/libLLVM/libLLVM.so
-	${LN} -s libLLVM-3.8.so ${DESTDIR}${PREFIX}/lib/libLLVM/libLLVM-3.8.0.so
+	${INSTALL_LIB} ${WRKDIR}/build/lib/${LLVM_LIBNAME}	\
+		${DESTDIR}${PREFIX}/lib/libLLVM/${LLVM_LIBNAME}
+.if ${OPSYS} == "Darwin"
+	install_name_tool -id	\
+		${PREFIX}/lib/libLLVM/${LLVM_LIBNAME}	\
+		${DESTDIR}${PREFIX}/lib/libLLVM/${LLVM_LIBNAME}
+.else
+	${LN} -s ${LLVM_LIBNAME}	\
+		${DESTDIR}${PREFIX}/lib/libLLVM/libLLVM.${SOEXT}
+.endif
 
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../lang/python/tool.mk"
diff --git a/libLLVM/PLIST b/libLLVM/PLIST
index 97b7249..d08032d 100644
--- a/libLLVM/PLIST
+++ b/libLLVM/PLIST
@@ -802,9 +802,8 @@ include/libLLVM/llvm/Transforms/Utils/UnifyFunctionExitNodes.h
 include/libLLVM/llvm/Transforms/Utils/UnrollLoop.h
 include/libLLVM/llvm/Transforms/Utils/ValueMapper.h
 include/libLLVM/llvm/Transforms/Vectorize.h
-lib/libLLVM/libLLVM-3.8.so
-lib/libLLVM/libLLVM-3.8.0.so
-lib/libLLVM/libLLVM.so
+${PLIST.notdylib}lib/libLLVM/libLLVM-${LLVM_MAJOR}.${SOEXT}
+lib/libLLVM/libLLVM.${SOEXT}
 libexec/libLLVM/llvm-config
 share/libLLVM/cmake/AddLLVM.cmake
 share/libLLVM/cmake/AddLLVMDefinitions.cmake
diff --git a/llvm-git/Makefile b/llvm-git/Makefile
index 99700dc..4dec6c9 100644
--- a/llvm-git/Makefile
+++ b/llvm-git/Makefile
@@ -72,9 +72,20 @@ TEST_ENV+=		LD_LIBRARY_PATH=${WRKDIR}/build/lib
 .include "../../mk/bsd.prefs.mk"
 
 .if ${_OPSYS_SHLIB_TYPE} == "dylib"
-PLIST_SUBST+=		SOEXT="dylib"
+SOEXT=		dylib
 .else
-PLIST_SUBST+=		SOEXT="so"
+SOEXT=		so
+.endif
+PLIST_SUBST+=	SOEXT=${SOEXT}
+
+.if ${OPSYS} == "Darwin"
+.PHONY: fix-darwin-install-name
+post-install: fix-darwin-install-name
+fix-darwin-install-name:
+.  for lib in BugpointPasses LLVMHello libLTO
+	install_name_tool -id ${PREFIX}/lib/${lib}.${SOEXT}	\
+		${DESTDIR}${PREFIX}/lib/${lib}.${SOEXT}
+.  endfor
 .endif
 
 .include "options.mk"
@@ -83,9 +94,9 @@ PLIST_SUBST+=		SOEXT="so"
 # It is used to detect correct LLVM_HOST_TRIPLE, e.g. for NetBSD/evbarm.
 post-extract:
 	${RUN} mkdir -p ${WRKDIR}/build
-#.for f in config.guess config.sub
-#	cp ../../mk/gnu-config/${f} ${WRKSRC}/autoconf/${f}
-#.endfor
+.for f in config.guess config.sub
+	cp ../../mk/gnu-config/${f} ${WRKSRC}/cmake/${f}
+.endfor
 
 .include "../../wip/mk/git-package.mk"
 .include "../../devel/zlib/buildlink3.mk"
diff --git a/llvm/Makefile b/llvm/Makefile
index e71ff5b..53dfc38 100644
--- a/llvm/Makefile
+++ b/llvm/Makefile
@@ -72,9 +72,20 @@ TEST_ENV+=		LD_LIBRARY_PATH=${WRKDIR}/build/lib
 .include "../../mk/bsd.prefs.mk"
 
 .if ${_OPSYS_SHLIB_TYPE} == "dylib"
-PLIST_SUBST+=		SOEXT="dylib"
+SOEXT=		dylib
 .else
-PLIST_SUBST+=		SOEXT="so"
+SOEXT=		so
+.endif
+PLIST_SUBST+=	SOEXT=${SOEXT}
+
+.if ${OPSYS} == "Darwin"
+.PHONY: fix-darwin-install-name
+post-install: fix-darwin-install-name
+fix-darwin-install-name:
+.  for lib in BugpointPasses LLVMHello libLTO
+	install_name_tool -id ${PREFIX}/lib/${lib}.${SOEXT}	\
+		${DESTDIR}${PREFIX}/lib/${lib}.${SOEXT}
+.  endfor
 .endif
 
 .include "options.mk"


Home | Main Index | Thread Index | Old Index