aboutsummaryrefslogtreecommitdiffstats
path: root/databases/gtksql/Makefile
blob: cb1049e1aada5983916c8778cbbafc3b297f04f2 (plain) (blame)
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
# Created by: Andrey Zakhvatov
# $FreeBSD$

PORTNAME=   gtksql
PORTVERSION=    0.4.5
PORTREVISION=   2
CATEGORIES= databases
MASTER_SITES=   SF/${PORTNAME}/${PORTNAME}-testing/${PORTNAME}-${PORTVERSION}

MAINTAINER= ports@FreeBSD.org
COMMENT=    Graphical query tool for PostgreSQL/MySQL/SQLite

LICENSE=    GPLv2 # (or later)

BROKEN=     Fails to configure

LIB_DEPENDS=    libscintilla.so:${PORTSDIR}/x11-toolkits/scintilla
RUN_DEPENDS=    xdg-open:${PORTSDIR}/devel/xdg-utils

OPTIONS_DEFINE= AVAHI DOCS
OPTIONS_MULTI=  DB
OPTIONS_MULTI_DB=   MYSQL PGSQL SQLITE
OPTIONS_DEFAULT=    SQLITE

USES=       gettext gmake pkgconfig
USE_GNOME=  gtk20
GNU_CONFIGURE=  yes
MAKE_ARGS=  ACLOCAL="${TRUE}" AUTOCONF="${TRUE}" AUTOMAKE="${TRUE}" \
        AUTOHEADER="${TRUE}"

CPPFLAGS+=  -I${LOCALBASE}/include/scintilla -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib -lscintilla -lscintilla_lexers

PGSQL_USES= pgsql
PGSQL_CONFIGURE_WITH=   postgresql

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MAVAHI}
LIB_DEPENDS+=   libavahi-common.so:${PORTSDIR}/net/avahi-app
.else
CONFIGURE_ARGS+=    --without-avahi
.endif

.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL=  yes
CPPFLAGS+=  -I${LOCALBASE}/include/mysql
LDFLAGS+=   -L${LOCALBASE}/lib/mysql
.else
CONFIGURE_ARGS+=    --without-mysql
.endif

.if ${PORT_OPTIONS:MSQLITE}
USE_SQLITE= yes
.else
CONFIGURE_ARGS+=    --without-sqlite
.endif

post-patch:
    @${REINPLACE_CMD} -e \
        '/-lstdc++/s|^|#| ; \
         /scintilla.a/s|^|#| ; \
         /\/scintilla\/include/s|^|#| ; \
         /ac_header/s|postgres.h|libpq-fe.h| ; \
         /^packagedatadir/s|=.*|=share/gtksql|' \
        ${WRKSRC}/configure
    @${REINPLACE_CMD} -e \
        's|-O1|| ; \
         s|-g$$|-DGTK|' \
        ${WRKSRC}/src/Makefile.in
    @${REINPLACE_CMD} -e \
        's|<postgres\.h>|<postgresql/internal/c.h>|' \
        ${WRKSRC}/src/d_postgres_f.c
    @${REINPLACE_CMD} -e \
        's|mozilla|xdg-open|' \
        ${WRKSRC}/src/gtkui-object.c
    @${REINPLACE_CMD} -e \
        's|/usr/local/gtksql|${PREFIX}/lib/gtksql|' \
        ${WRKSRC}/src/plugins.c

.include <bsd.port.mk>