Merge media-sound/spotify: Fix homepage URL
[gentoo.git] / dev-libs / distorm64 / distorm64-1.7.30-r1.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="2"
6 SUPPORT_PYTHON_ABIS="1"
7
8 inherit eutils flag-o-matic python toolchain-funcs
9
10 DESCRIPTION="The ultimate disassembler library (X86-32, X86-64)"
11 HOMEPAGE="http://www.ragestorm.net/distorm/"
12 SRC_URI="http://ragestorm.net/distorm/${PN}-pkg${PV}.tar.bz2"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="+python"
18
19 DEPEND="python? ( >=dev-lang/python-2.4 )"
20 RDEPEND="${DEPEND}"
21 RESTRICT_PYTHON_ABIS="3.*"
22
23 S="${WORKDIR}/${PN}"
24
25 src_prepare() {
26         epatch "${FILESDIR}/${P}-python.patch"
27         epatch "${FILESDIR}/${P}-respect_flags.patch"
28 }
29
30 src_compile() {
31         cd "${WORKDIR}/${PN}/build/linux"
32         emake CC="$(tc-getCC)" clib || die "emake clib failed"
33
34         if use python; then
35                 building() {
36                         # Build ../../src/pydistorm.o separately with each enabled version of Python.
37                         rm -f ../../src/pydistorm.o
38
39                         # Additional CFLAGS retrieved from build/linux/Makefile.
40                         emake CC="$(tc-getCC)" CFLAGS="${CFLAGS} -I$(python_get_includedir) -Wall -fPIC -DSUPPORT_64BIT_OFFSET -D_DLL" TARGET="distorm.so-${PYTHON_ABI}" py
41                 }
42                 python_execute_function building
43         fi
44
45         cd "${WORKDIR}/${PN}/linuxproj"
46         emake CC="$(tc-getCC)" disasm || die "emake disasm failed"
47
48 }
49
50 src_install() {
51         cd "${WORKDIR}/${PN}/build/linux"
52
53         dolib.so libdistorm64.so
54
55         if use python; then
56                 installation() {
57                         dodir "$(python_get_sitedir)"
58                         install distorm.so-${PYTHON_ABI} "${D}$(python_get_sitedir)/distorm.so"
59                 }
60                 python_execute_function -q installation
61         fi
62
63         cd "${WORKDIR}/${PN}"
64         newlib.a distorm64.a libdistorm64.a
65
66         dobin linuxproj/disasm
67
68         dodir "/usr/include"
69         install distorm.h "${D}usr/include/" || die "Unable to install distorm.h"
70 }