pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/rust rust: Make building the internal LLVM option...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f7f15e24b533
branches:  trunk
changeset: 398123:f7f15e24b533
user:      nia <nia%pkgsrc.org@localhost>
date:      Thu Jul 11 10:24:14 2019 +0000

description:
rust: Make building the internal LLVM optional for everyone

(not just Darwin and SunOS).

This was posted to tech-pkg@ a while ago with no objections,
I've been using it for a while too.

diffstat:

 lang/rust/Makefile   |  17 +++--------------
 lang/rust/options.mk |  28 ++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 14 deletions(-)

diffs (86 lines):

diff -r 67c3086a2918 -r f7f15e24b533 lang/rust/Makefile
--- a/lang/rust/Makefile        Thu Jul 11 10:11:26 2019 +0000
+++ b/lang/rust/Makefile        Thu Jul 11 10:24:14 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.107 2019/07/08 15:16:40 he Exp $
+# $NetBSD: Makefile,v 1.108 2019/07/11 10:24:14 nia Exp $
 
 DISTNAME=      rustc-1.36.0-src
 PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
@@ -14,8 +14,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.
@@ -124,18 +122,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
 #
@@ -457,6 +445,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.
 #
@@ -465,7 +455,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"
diff -r 67c3086a2918 -r f7f15e24b533 lang/rust/options.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/rust/options.mk      Thu Jul 11 10:24:14 2019 +0000
@@ -0,0 +1,28 @@
+# $NetBSD: options.mk,v 1.1 2019/07/11 10:24:14 nia Exp $
+
+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