summaryrefslogtreecommitdiff
blob: 77be8a1f274abad4c465e710964729d7160311da (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
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit flag-o-matic toolchain-funcs

DESCRIPTION="Simple interactive calendar program with a notebook capability"
HOMEPAGE="https://www.freebsd.org/"
SRC_URI="ftp://daemon.jp.FreeBSD.org/pub/FreeBSD-jp/ports-jp/LOCAL_PORTS/${P}+i18n.tar.gz"
S="${WORKDIR}/${PN}"

LICENSE="HPND"
SLOT="0"
KEYWORDS="~alpha amd64 ppc ppc64 x86"
IUSE="motif"

RDEPEND="
	x11-libs/libX11
	x11-libs/libXt
	motif? (
		x11-libs/libXmu
		x11-libs/motif
	)
	!motif? ( x11-libs/libXaw )"
DEPEND="
	${RDEPEND}
	x11-base/xorg-proto"
BDEPEND="virtual/pkgconfig"

PATCHES=(
	"${FILESDIR}"/${P}-clang16.patch
)

src_prepare() {
	default

	sed -e "s|%%XCALENDAR_LIBDIR%%|${EPREFIX}/usr/$(get_libdir)/xcalendar|" \
		-e "s|/usr/local/X11R5/lib/X11/|${EPREFIX}/usr/$(get_libdir)/|" \
		< XCalendar.sed > XCalendar || die
}

src_compile() {
	tc-export CC
	append-cflags -std=gnu89 # old codebase, incompatible with c2x

	if use motif; then
		append-cppflags $($(tc-getPKG_CONFIG) --cflags x11 xmu xt || die)
		append-libs -lXm $($(tc-getPKG_CONFIG) --libs x11 xmu xt || die)
	else
		append-cppflags -DATHENA $($(tc-getPKG_CONFIG) --cflags x11 xaw7 xt || die)
		append-libs $($(tc-getPKG_CONFIG) --libs x11 xaw7 xt || die)
	fi

	emake LDLIBS="${LIBS}" -f /dev/null -E "xcalendar: dayeditor.o lists.o"
}

src_install() {
	dobin xcalendar
	newman xcalendar.man xcalendar.1

	insinto /usr/share/X11/app-defaults
	doins XCalendar

	insinto /usr/$(get_libdir)/xcalendar
	doins *.xbm *.hlp

	einstalldocs
}