summaryrefslogtreecommitdiff
path: root/x11/gtk/Makefile
blob: ffe0689325bf2b1c0cdb98c1fc6334f75d158d1f (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
# $NetBSD: Makefile,v 1.85 2003/06/25 13:35:06 wiz Exp $

DISTNAME=		gtk+-1.2.10
PKGREVISION=		4
CATEGORIES=		x11
MASTER_SITES=		ftp://ftp.gtk.org/pub/gtk/v1.2/ \
			ftp://ftp.cs.umn.edu/pub/gimp/gtk/v1.2/ \
			${MASTER_SITE_GNOME:=sources/gtk+/1.2/}

MAINTAINER=		tech-pkg@netbsd.org
HOMEPAGE=		http://www.gtk.org/
COMMENT=		Gimp toolkit. Libraries for building X11 user interfaces

BUILD_USES_MSGFMT=	yes

USE_BUILDLINK2=		yes
USE_PERL5=		build
USE_X11BASE=		yes
USE_GMAKE=		yes
USE_NEW_TEXINFO=	yes
USE_PKGLOCALEDIR=	yes
USE_LIBTOOL=		yes
LIBTOOL_OVERRIDE=	${WRKSRC}/ltconfig
PKGCONFIG_OVERRIDE=	${WRKSRC}/gdk.pc.in
PKGCONFIG_OVERRIDE+=	${WRKSRC}/gtk+.pc.in

GNU_CONFIGURE=		yes
CONFIGURE_ARGS+=	--with-xinput=xfree \
			--with-native-locale=yes \
			--sysconfdir=${X11PREFIX}/share
CONFIGURE_ENV+=		X_LDFLAGS="${X_LDFLAGS}"

INFO_FILES=		gdk.info gtk.info

MAKE_ENV+=		PKGLOCALEDIR="${PKGLOCALEDIR}"
PLIST_SUBST+=		LOCALBASE=${LOCALBASE}

# The following ensures that `gtk-config --libs' includes the correct linker
# flags for linking the X11 libs.
#
X_LDFLAGS=		${X11_LDFLAGS}

GTK_VERSION=		${DISTNAME:S/gtk+-//}
GTK_MAJOR_VERSION=	${GTK_VERSION:C/\..*//}
GTK_MINOR_VERSION=	${GTK_VERSION:C/[^.]*\.//:C/\..*//}
GTK_MICRO_VERSION=	${GTK_VERSION:C/.*\.//}

# We patch the version info in the configure scripts for reasons related to
# shared library numbering, but we don't want it to leak into the various
# installed files.  Explicitly replace the version number with the correct
# one derived from the package name.
#
pre-configure:
	@cd ${WRKSRC};							\
	files="gtk-config.in docs/gtk-config.1.in gdk.pc.in gtk+.pc.in gtk/gtkfeatures.h.in"; \
	for file in $${files}; do					\
		${MV} -f $${file} $${file}.fixme;			\
		${SED}	-e "s|@GTK_MAJOR_VERSION@|${GTK_MAJOR_VERSION}|g" \
			-e "s|@GTK_MINOR_VERSION@|${GTK_MINOR_VERSION}|g" \
			-e "s|@GTK_MICRO_VERSION@|${GTK_MICRO_VERSION}|g" \
			-e "s|@VERSION@|${GTK_VERSION}|g"		\
			$${file}.fixme > $${file};			\
		${RM} $${file}.fixme;					\
	done

post-install:
	${TEST} ${PREFIX} = ${LOCALBASE} || \
	${LN} -fs ${PREFIX}/share/aclocal/gtk.m4 \
	  ${LOCALBASE}/share/aclocal/gtk.m4

.include "../../devel/gettext-lib/buildlink2.mk"
.include "../../devel/glib/buildlink2.mk"
.include "../../mk/bsd.pkg.mk"