tech-pkg archive

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

[PATCH] rust: Make internal llvm optional on all platforms



we're already special-casing this for SunOS and Darwin, this makes it
available to everyone.

thoughts?

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/lang/rust/Makefile,v
retrieving revision 1.104
diff -u -r1.104 Makefile
--- Makefile	13 Jun 2019 19:06:30 -0000	1.104
+++ Makefile	5 Jul 2019 20:43:14 -0000
@@ -15,8 +15,6 @@
 USE_LANGUAGES=		c c++11
 USE_LIBTOOL=		yes
 USE_TOOLS+=		bash ggrep gmake perl:build pkg-config
-# For internal llvm
-BUILD_DEPENDS+=		cmake-[0-9]*:../../devel/cmake
 
 # The NetBSD bootstraps are built for NetBSD 8 (because rust doesn't
 # build on 7).  Mark earlier versions as broken.
@@ -125,18 +123,8 @@
 
 CHECK_PORTABILITY_SKIP+=	src/vendor/openssl-src/openssl/.travis-create-release.sh
 
-# Required for LLVM (-std=c++11)
-GCC_REQD+=	4.8
-
 .include "../../mk/bsd.prefs.mk"
 
-# The bundled LLVM current has issues building on SunOS.
-.if ${OPSYS} == "Darwin" || ${OPSYS} == "SunOS"
-.include "../../lang/llvm/buildlink3.mk"
-CONFIGURE_ARGS+=	--enable-llvm-link-shared
-CONFIGURE_ARGS+=	--llvm-root=${BUILDLINK_PREFIX.llvm}
-.endif
-
 #
 # Under NetBSD, do not use DT_RUNPATH
 #
@@ -458,6 +446,8 @@
 	 ${GTAR} -zcf ${PKGNAME_NOREV}-${RUST_ARCH}.tar.gz ${PKGNAME_NOREV}-${RUST_ARCH})
 .endif
 
+.include "options.mk"
+
 # These dependencies currently use the bundled sources as they require
 # development features not yet available in released versions.
 #
@@ -466,7 +456,6 @@
 #.include "../../www/curl/buildlink3.mk"
 #.include "../../www/http-parser/buildlink3.mk"
 
-.include "../../devel/cmake/buildlink3.mk"
 #.include "../../devel/jemalloc/buildlink3.mk"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../lang/python/tool.mk"
Index: options.mk
===================================================================
RCS file: options.mk
diff -N options.mk
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ options.mk	5 Jul 2019 20:43:14 -0000
@@ -0,0 +1,28 @@
+# $NetBSD$
+
+PKG_OPTIONS_VAR=		PKG_OPTIONS.rust
+PKG_SUPPORTED_OPTIONS+=		rust-llvm
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+# The bundled LLVM current has issues building on SunOS.
+.if ${OPSYS} != "SunOS" && ${OPSYS} != "Darwin"
+PKG_SUGGESTED_OPTIONS+=		rust-llvm
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+#
+# Use the internal copy of LLVM.
+# This contains some extra optimizations.
+#
+.if !empty(PKG_OPTIONS:Mrust-llvm)
+# LLVM uses -std=c++11
+GCC_REQD+=	4.8
+BUILD_DEPENDS+=	cmake-[0-9]*:../../devel/cmake
+.include "../../devel/cmake/buildlink3.mk"
+.else
+.include "../../lang/llvm/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-llvm-link-shared
+CONFIGURE_ARGS+=	--llvm-root=${BUILDLINK_PREFIX.llvm}
+.endif


Home | Main Index | Thread Index | Old Index