pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/rust



Module Name:    pkgsrc
Committed By:   nia
Date:           Thu Jul 11 10:24:14 UTC 2019

Modified Files:
        pkgsrc/lang/rust: Makefile
Added Files:
        pkgsrc/lang/rust: options.mk

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 pkgsrc/lang/rust/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/rust/options.mk

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

Modified files:

Index: pkgsrc/lang/rust/Makefile
diff -u pkgsrc/lang/rust/Makefile:1.107 pkgsrc/lang/rust/Makefile:1.108
--- pkgsrc/lang/rust/Makefile:1.107     Mon Jul  8 15:16:40 2019
+++ pkgsrc/lang/rust/Makefile   Thu Jul 11 10:24:14 2019
@@ -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_GCC_RUNTIME=      yes
 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_SSP_SUPPORTED=       no
 
 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 @@ stage0-bootstrap: install
         ${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 @@ stage0-bootstrap: install
 #.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"

Added files:

Index: pkgsrc/lang/rust/options.mk
diff -u /dev/null pkgsrc/lang/rust/options.mk:1.1
--- /dev/null   Thu Jul 11 10:24:14 2019
+++ pkgsrc/lang/rust/options.mk Thu Jul 11 10:24:14 2019
@@ -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