1 |
|
# Copyright 1999-2024 Gentoo Authors
|
|
1 |
# Copyright 1999-2025 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
|
EAPI=7
|
|
4 |
EAPI=8
|
5 |
5 |
|
6 |
|
inherit autotools
|
|
6 |
LLVM_COMPAT=( {18..19} )
|
7 |
7 |
|
8 |
|
DESCRIPTION="User-mode filesystem implementation"
|
9 |
|
HOMEPAGE="https://sourceforge.net/projects/lufs/"
|
10 |
|
SRC_URI="https://downloads.sourceforge.net/lufs/${P}.tar.gz"
|
|
8 |
inherit autotools bash-completion-r1 llvm-r1
|
11 |
9 |
|
12 |
|
LICENSE="GPL-2"
|
|
10 |
DESCRIPTION="NVC is a VHDL compiler and simulator"
|
|
11 |
HOMEPAGE="https://www.nickg.me.uk/nvc/
|
|
12 |
https://github.com/nickg/nvc/"
|
|
13 |
|
|
14 |
if [[ "${PV}" == *9999* ]] ; then
|
|
15 |
inherit git-r3
|
|
16 |
|
|
17 |
EGIT_REPO_URI="https://github.com/nickg/nvc.git"
|
|
18 |
|
|
19 |
NVC_SOURCEDIR="${WORKDIR}/${PN}-${PV}"
|
|
20 |
else
|
|
21 |
SRC_URI="https://github.com/nickg/nvc/archive/r${PV}.tar.gz
|
|
22 |
-> ${P}.tar.gz"
|
|
23 |
KEYWORDS="~amd64 ~x86"
|
|
24 |
|
|
25 |
NVC_SOURCEDIR="${WORKDIR}/${PN}-r${PV}"
|
|
26 |
fi
|
|
27 |
|
|
28 |
NVC_BUILDDIR="${NVC_SOURCEDIR}_BuildDir"
|
|
29 |
S="${NVC_BUILDDIR}"
|
|
30 |
|
|
31 |
LICENSE="GPL-3+"
|
13 |
32 |
SLOT="0"
|
14 |
|
KEYWORDS="~amd64 ppc x86"
|
15 |
|
IUSE="debug"
|
|
33 |
IUSE="debug llvm"
|
|
34 |
RESTRICT="test" # Some tests fail.
|
|
35 |
|
|
36 |
RDEPEND="
|
|
37 |
app-arch/bzip2:=
|
|
38 |
app-arch/zstd:=
|
|
39 |
dev-libs/capstone:=
|
|
40 |
dev-libs/elfutils
|
|
41 |
dev-libs/icu:=
|
|
42 |
dev-libs/libffi:=
|
|
43 |
dev-libs/libxml2:=
|
|
44 |
sys-libs/ncurses:=
|
|
45 |
sys-libs/zlib:=
|
|
46 |
llvm? (
|
|
47 |
$(llvm_gen_dep '
|
|
48 |
llvm-core/llvm:${LLVM_SLOT}=
|
|
49 |
')
|
|
50 |
)
|
|
51 |
"
|
|
52 |
DEPEND="
|
|
53 |
${RDEPEND}
|
|
54 |
"
|
|
55 |
BDEPEND="
|
|
56 |
dev-libs/check
|
|
57 |
sys-apps/which
|
|
58 |
sys-devel/bison
|
|
59 |
sys-devel/flex
|
|
60 |
"
|
16 |
61 |
|
17 |
|
RDEPEND="sys-fs/lufis"
|
18 |
|
DEPEND="${RDEPEND}"
|
|
62 |
PATCHES=( "${FILESDIR}/nvc-1.9.2-jit-code-capstone.patch" )
|
19 |
63 |
|
20 |
|
PATCHES=(
|
21 |
|
"${FILESDIR}"/${P}-fPIC.patch
|
22 |
|
"${FILESDIR}"/${PN}-automount-port.diff
|
23 |
|
"${FILESDIR}"/${P}-enable-gnome-2.patch
|
24 |
|
"${FILESDIR}"/${PN}-no-kernel.patch
|
25 |
|
"${FILESDIR}"/${P}-gcc43.patch
|
26 |
|
)
|
|
64 |
# Special libraries for NVC.
|
|
65 |
QA_FLAGS_IGNORED="usr/lib[0-9]*/nvc/preload[0-9]*.so"
|
27 |
66 |
|
28 |
67 |
pkg_setup() {
|
29 |
|
filesystems="ftpfs localfs"
|
30 |
|
use amd64 || filesystems+=" sshfs"
|
|
68 |
use llvm && llvm-r1_pkg_setup
|
|
69 |
}
|
|
70 |
|
|
71 |
src_unpack() {
|
|
72 |
default
|
|
73 |
|
|
74 |
mkdir -p "${S}" || die
|
31 |
75 |
}
|
32 |
76 |
|
33 |
77 |
src_prepare() {
|
|
78 |
pushd "${NVC_SOURCEDIR}" >/dev/null || die
|
|
79 |
|
34 |
80 |
default
|
35 |
81 |
eautoreconf
|
|
82 |
|
|
83 |
popd >/dev/null || die
|
36 |
84 |
}
|
37 |
85 |
|
38 |
86 |
src_configure() {
|
39 |
|
unset ARCH
|
40 |
|
econf $(use_enable debug)
|
|
87 |
# Needs "bison" and "flex" exactly.
|
|
88 |
unset LEX
|
|
89 |
unset YACC
|
|
90 |
|
|
91 |
local ECONF_SOURCE="${NVC_SOURCEDIR}"
|
|
92 |
local -a myconf=(
|
|
93 |
--enable-vital
|
|
94 |
--with-bash-completion="$(get_bashcompdir)"
|
|
95 |
$(use_enable debug)
|
|
96 |
$(use_enable llvm)
|
|
97 |
)
|
|
98 |
econf "${myconf[@]}"
|
|
99 |
|
|
100 |
export V=1 # Verbose compilation and install.
|
41 |
101 |
}
|
42 |
102 |
|
43 |
103 |
src_compile() {
|
44 |
|
einfo "Compiling for ${filesystems}"
|
|
104 |
emake -j1
|
|
105 |
}
|
45 |
106 |
|
46 |
|
cd filesystems || die
|
47 |
|
local i
|
48 |
|
for i in ${filesystems} ; do
|
49 |
|
pushd ${i} &>/dev/null || die
|
50 |
|
emake
|
51 |
|
popd &>/dev/null || die
|
52 |
|
done
|
|
107 |
src_test() {
|
|
108 |
PATH="${S}/bin:${PATH}" emake check-TESTS
|
53 |
109 |
}
|
54 |
110 |
|
55 |
111 |
src_install() {
|
56 |
|
cd filesystems || die
|
57 |
|
local i
|
58 |
|
for i in ${filesystems} ; do
|
59 |
|
pushd ${i} &>/dev/null || die
|
60 |
|
emake DESTDIR="${D}" install
|
61 |
|
popd &>/dev/null || die
|
62 |
|
done
|
63 |
|
}
|
64 |
|
|
65 |
|
pkg_postinst() {
|
66 |
|
ewarn "Lufs Kernel support and lufsd,lufsmnt have been disabled in favour"
|
67 |
|
ewarn "of lufis, please use lufis to mount lufs-filesystems, eg:"
|
68 |
|
if use amd64; then
|
69 |
|
elog "# lufis fs=ftpfs,host=ftp.kernel.org /mnt/lufis/ -s"
|
70 |
|
else
|
71 |
|
elog "# lufis fs=sshfs,host=dev.gentoo.org,username=genstef /mnt/lufis/ -s"
|
72 |
|
fi
|
73 |
|
ewarn "If something does not work for you with this setup please"
|
74 |
|
ewarn "complain to bugs.gentoo.org"
|
75 |
|
einfo "Note: There is also the native sshfs implementation now"
|
76 |
|
use amd64 && ewarn "lufs-sshfs does not work on amd64 and is disabled there."
|
|
112 |
default
|
|
113 |
|
|
114 |
mv "${D}/$(get_bashcompdir)"/nvc{.bash,} || die
|
|
115 |
dostrip -x "/usr/$(get_libdir)/nvc"
|
77 |
116 |
}
|