forked from void-linux/void-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate
More file actions
109 lines (99 loc) · 2.73 KB
/
template
File metadata and controls
109 lines (99 loc) · 2.73 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# Template file for 'ghdl'
#
# We could also package the gcc backend, but that requires an entire gcc
# source tree being available and looks rather complicated, so for now
# only mcode (on x86) and llvm (everywhere) is done
#
pkgname=ghdl
reverts="20181129_1"
version=6.0.0
revision=1
build_style=configure
configure_args="--prefix=/usr --srcdir=.. --disable-werror"
makedepends="zlib-devel"
short_desc="VHDL 2008/93/87 simulator"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://github.com/ghdl/ghdl"
changelog="https://raw.githubusercontent.com/ghdl/ghdl/refs/heads/master/NEWS.md"
distfiles="https://github.com/ghdl/ghdl/archive/refs/tags/v${version}.tar.gz"
checksum=2d84fbd0b238a26928e89a0256274072c6b40af1969a4f4c7be57ec3515bc622
nocross=yes
# testsuite is big and long
make_check=extended
build_options="llvm mcode"
desc_option_llvm="Build the portable LLVM backend"
desc_option_mcode="Build the x86-only mcode backend"
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*)
build_options_default="mcode"
;;
*)
build_options_default="llvm"
if [ "$build_option_mcode" ]; then
broken="mcode backend only available on x86"
fi
esac
if [ "$build_option_llvm" ]; then
makedepends+=" llvm18-devel"
fi
do_configure() {
if [ "$build_option_mcode" ]; then
mkdir -p build_mcode
cd build_mcode
../configure ${configure_args}
cd ..
fi
if [ "$build_option_llvm" ]; then
mkdir -p build_llvm
cd build_llvm
../configure --with-llvm-config \
${configure_args}
cd ..
fi
}
do_build() {
if [ "$build_option_mcode" ]; then
make -C build_mcode ${makejobs}
fi
if [ "$build_option_llvm" ]; then
make -C build_llvm ${makejobs}
fi
}
do_install() {
# must be first; make install uses it
vbin ${FILESDIR}/ghdl
# install whatever backends we have
if [ "$build_option_mcode" ]; then
make -C build_mcode DESTDIR=${DESTDIR} install
fi
if [ "$build_option_llvm" ]; then
make -C build_llvm DESTDIR=${DESTDIR} install
fi
# manpage is not installed by default
vman doc/ghdl.1
}
do_check() {
# need a temporary installation for testsuite run so that ghdl is found
for variant in ${build_options_default}; do
cd ${wrksrc}/build_${variant}
mkdir -p tmp_inst/usr/bin
ln -sf ghdl-${variant} tmp_inst/usr/bin/ghdl
make DESTDIR=${wrksrc}/build_${variant}/tmp_inst install
cd ../testsuite
# run all tests but pyunit
GHDL="${wrksrc}/build_${variant}/tmp_inst/usr/bin/ghdl" \
./testsuite.sh sanity gna synth vpi vhpi
cd ${wrksrc}
done
}
ghdl-mcode_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - transitional dummy package"
metapackage=yes
}
ghdl-llvm_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - transitional dummy package"
metapackage=yes
}