From 244450ba2d63fa2efdf3495daec3a1df6eb2e7ee Mon Sep 17 00:00:00 2001
From: Andrea Brancaleoni <miwaxe@gmail.com>
Date: Wed, 5 Aug 2015 10:41:11 +0200
Subject: [PATCH] New package: lld

---
 srcpkgs/lld           |  1 +
 srcpkgs/llvm/template | 17 +++++++++++++++++
 2 files changed, 18 insertions(+)
 create mode 120000 srcpkgs/lld

diff --git a/srcpkgs/lld b/srcpkgs/lld
new file mode 120000
index 00000000000..0d68131b9b3
--- /dev/null
+++ b/srcpkgs/lld
@@ -0,0 +1 @@
+llvm
\ No newline at end of file
diff --git a/srcpkgs/llvm/template b/srcpkgs/llvm/template
index 30efc6d1d8d..ffacc7e6b45 100644
--- a/srcpkgs/llvm/template
+++ b/srcpkgs/llvm/template
@@ -14,11 +14,13 @@ homepage="http://www.llvm.org"
 license="BSD"
 distfiles="
  http://www.llvm.org/releases/${version}/llvm-${version}.src.tar.xz
+ http://www.llvm.org/releases/${version}/lld-${version}.src.tar.xz
  http://www.llvm.org/releases/${version}/lldb-${version}.src.tar.xz
  http://www.llvm.org/releases/${version}/cfe-${version}.src.tar.xz
  http://www.llvm.org/releases/${version}/compiler-rt-${version}.src.tar.xz"
 checksum="
  f60dc158bfda6822de167e87275848969f0558b3134892ff54fced87e4667b94
+ 43f553c115563600577764262f1f2fac3740f0c639750f81e125963c90030b33
  940dc96b64919b7dbf32c37e0e1d1fc88cc18e1d4b3acf1e7dfe5a46eb6523a9
  ae9180466a23acb426d12444d866b266ff2289b266064d362462e44f8d4699f3
  0f2ff37d80a64575fecd8cf0d5c50f7ac1f837ddf700d1855412bb7547431d87"
@@ -32,6 +34,7 @@ if [ -z "$CROSS_BUILD" ]; then
 	# XXX fails to cross compile due to python
 	subpackages+=" lldb lldb-devel"
 fi
+subpackages+=" lld"
 
 post_extract() {
 	# patches
@@ -62,6 +65,10 @@ post_extract() {
 	if [ -d ${XBPS_BUILDDIR}/cfe-${version}.src ]; then
 		mv ${XBPS_BUILDDIR}/cfe-${version}.src ${wrksrc}/tools/clang
 	fi
+	# Move lld files into the llvm source
+	if [ -d ${XBPS_BUILDDIR}/lld-${version}.src ]; then
+		mv ${XBPS_BUILDDIR}/lld-${version}.src ${wrksrc}/tools/lld
+	fi
 	# Move lldb files into the llvm source.
 	if [ -z "$CROSS_BUILD" -a -d ${XBPS_BUILDDIR}/lldb-${version}.src ]; then
 		mv ${XBPS_BUILDDIR}/lldb-${version}.src ${wrksrc}/tools/lldb
@@ -170,6 +177,16 @@ lldb-devel_package() {
 		vmove "usr/lib/liblldb*.a"
 	}
 }
+lld_package() {
+	lib32disabled=yes
+	short_desc+=" - Linker"
+	homepage="http://lld.llvm.org"
+	pkg_install() {
+		vmove usr/include/lld
+		vmove usr/bin/lld
+		vmove "usr/lib/liblld*"
+	}
+}
 llvm-docs_package() {
 	noarch=yes
 	short_desc+=" - documentation files"