summaryrefslogtreecommitdiff
blob: fe13cf72bfc6821bf329be77dc032052bcb97bf8 (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
69
70
71
72
73
74
75
76
77
EAPI="5"

inherit eutils

DESCRIPTION="A HDL"
HOMEPAGE="http://github.com/ucb-bar/${PN}/"
SRC_URI="https://github.com/ucb-bar/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0/$PV"
KEYWORDS="amd64 amd64-linux"
IUSE=""

RDEPEND="dev-java/sbt-bin
         dev-lang/scala"

DEPEND="${RDEPEND}"

src_prepare() {
        epatch "${FILESDIR}/${P}-Wall.patch"
}

src_configure() {
        cat >Configfile <<EOF
PREFIX = ${EPREFIX}/usr

LANGUAGES += scala
LANGUAGES += pkgconfig
LANGUAGES += h
LANGUAGES += bash

LIBRARIES += libchisel.jar
SOURCES += main/scala/Driver.scala

LIBRARIES += pkgconfig/chisel.pc
SOURCES += chisel.pc

HEADERS += chisel/emulator.h
SOURCES += main/resources/emulator.h

HEADERS += chisel/emulator_mod.h
SOURCES += main/resources/emulator_mod.h

HEADERS += chisel/emulator_api.h
SOURCES += main/resources/emulator_api.h

BINARIES += chisel-hdrtar
SOURCES  += chisel-hdrtar.bash

BINARIES += chisel-jargen
SOURCES  += chisel-jargen.bash
EOF

        cat > src/chisel.pc <<EOF
prefix=@@pconfigure_prefix@@
exec_prefix=@@pconfigure_prefix@@
libdir=\${prefix}/@@pconfigure_libdir@@
includedir=\${prefix}/@@pconfigure_hdrdir@@

Name: chisel
Description: A HDL
Version: $PV
Libs: -lchisel
Cflags: -I\${includedir}/chisel
URL: http://github.com/ucb-bar/chisel
EOF

        cat >src/chisel-jargen.bash <<EOF
cat ${EPREFIX}/usr/lib/libchisel.jar
EOF

        cat >src/chisel-hdrtar.bash <<EOF
tar -C ${EPREFIX}/usr/include/chisel -c .
EOF

	pconfigure
}