aboutsummaryrefslogtreecommitdiff
blob: 36375d387ebf2ba6a0ea4d9629a9c61484a51786 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

inherit versionator

My_PN="gDEBugger"
My_PV=$(delete_all_version_separators)

DESCRIPTION="OpenCL and OpenGL debugger and memory analyzer."
HOMEPAGE="http://developer.amd.com/tools/gDEBugger/Pages/default.aspx"

if [[ "${ARCH}" == "amd64" ]]; then
    _arch="x86_64"
elif [[ "${ARCH}" == "x86" ]]; then
    _arch="x86"
fi

SRC_URI="
    x86?    ( http://developer.amd.com/Downloads/AMD${My_PN}${PV}x86.tar.gz )
    amd64?  ( http://developer.amd.com/Downloads/AMD${My_PN}${PV}x86_64.tar.gz )"

LICENSE="${My_PN}"
SLOT="0"
KEYWORDS="~amd64 ~x86"

RDEPEND="virtual/libstdc++"
DEPEND="${RDEPEND} app-text/html2text"

RESTRICT="mirror strip"

S="${WORKDIR}/${My_PN}${PV}-${_arch}"
_destination=/opt/${My_PN}

src_install() {
    dodir /opt
    dodir /usr/bin
    dodir /usr/portage/licenses/
    dodir /usr/share/applications

    cd ..
    cp -a ${S} ${D}${_destination}

    # The included launcher gets the directory where it is being run; a symbolic
    # link to it in /usr/bin thus cannot work. Instead, copy it to /usr/bin and
    # remove the autodetection of the script's directory and hardcode it to ${_destination}.
    # Then create a lowercase symbolic link to this new launcher.
    cp ${D}${_destination}/${My_PN} ${D}/usr/bin/${My_PN}
    sed "s|gDEBuggerBinariesDir=.*|gDEBuggerBinariesDir=\"${_destination}\"|g" -i ${D}/usr/bin/${My_PN}
    dosym /usr/bin/${My_PN} /usr/bin/${PN}

    html2text ${D}${_destination}/Legal/EndUserLicenseAgreement.htm > ${D}/usr/portage/licenses/${My_PN}.txt || die "Can't copy license"

    echo "[Desktop Entry]
Name=${My_PN}
Exec=${_destination}/${My_PN}
Type=Application
GenericName=OpenCL/OpenGL debugger
Terminal=false
Icon=${My_PN}
Caption=OpenCL/OpenGL debugger
Categories=Application;Development;" > ${D}/usr/share/applications/${PN}.desktop || die "Can't create .desktop file"

    insinto /usr/share/icons/hicolor/64x64/apps/
    newins ${D}${_destination}/tutorial/images/applicationicon_64.png ${My_PN}.png
}