From 54357fcd1fbdd380b2e89b891ecd27c8cebff194 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Mon, 25 Mar 2013 18:15:45 +0100
Subject: [PATCH] libtorrent: cross build, static and dbg support.

---
 srcpkgs/libtorrent/libtorrent-devel.template |  7 ++-----
 srcpkgs/libtorrent/template                  | 15 ++++++++++++---
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/srcpkgs/libtorrent/libtorrent-devel.template b/srcpkgs/libtorrent/libtorrent-devel.template
index 57548c549b..d4948ef6d3 100644
--- a/srcpkgs/libtorrent/libtorrent-devel.template
+++ b/srcpkgs/libtorrent/libtorrent-devel.template
@@ -1,13 +1,10 @@
 # Template file for 'librtorrent-devel'.
 #
-noarch=yes
 depends="libtorrent>=$version"
-short_desc="${sourcepkg} - development files"
-long_desc="${long_desc}
-
- This package contains files for development: headers, static libs, etc."
+short_desc="${short_desc} - development files"
 
 do_install() {
 	vmove usr/include usr
 	vmove usr/lib/pkgconfig usr/lib
+	vmove "usr/lib/*.a" usr/lib
 }
diff --git a/srcpkgs/libtorrent/template b/srcpkgs/libtorrent/template
index 2601a93f1a..e3efa7969e 100644
--- a/srcpkgs/libtorrent/template
+++ b/srcpkgs/libtorrent/template
@@ -1,10 +1,19 @@
 # Template build file for 'libtorrent'
 pkgname=libtorrent
 version=0.13.2
-revision=1
+revision=2
 build_style=gnu-configure
-configure_args="--disable-debug"
-makedepends="pkg-config openssl-devel libsigc++-devel"
+
+# Check endiannes
+case "$XBPS_TARGET_MACHINE" in
+	# XXX Only supported targets are matched.
+	i686|x86_64|armv6l|mipsel) _endiannes="ac_cv_c_bigendian=no";;
+	*) _endiannes="ac_cv_c_bigendian=yes";;
+esac
+
+configure_args="--enable-static --disable-debug --without-kqueue --enable-aligned ${_endiannes}"
+hostmakedepends="pkg-config"
+makedepends="openssl-devel libsigc++-devel"
 subpackages="$pkgname-devel"
 short_desc="BitTorrent library written in C++"
 maintainer="Juan RP <xtraeme@gmail.com>"