aboutsummaryrefslogtreecommitdiffstats
path: root/databases/libgda5/Makefile
blob: 7680045a394f704f52349693a676654c0677c04f (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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# Created by: Joe Marcus Clarke <marcus@FreeBSD.org>
# $FreeBSD$

PORTNAME=   libgda
PORTVERSION?=   5.2.5
PORTREVISION?=  1
CATEGORIES= databases gnome
MASTER_SITES=   GNOME
PKGNAMESUFFIX?= 5
DIST_SUBDIR=    gnome3

MAINTAINER?=    gnome@FreeBSD.org
COMMENT?=   Provides uniform access to different kinds of data sources

LICENSE=    GPLv2+ LGPL20+
LICENSE_COMB=   multi
LICENSE_FILE_GPLv20+ =  ${WRKSRC}/COPYING
LICENSE_FILE_LGPL2+ =   ${WRKSRC}/COPYING.LIB

USES=       python readline shebangfix tar:xz
LIBGDA5_SLAVE?= no
SHEBANG_FILES=  libgda-report/RML/*/*.py

.if !defined(REFERENCE_PORT)

BUILD_DEPENDS=  itstool:textproc/itstool
LIB_DEPENDS=    libsecret-1.so:security/libsecret \
        libsoup-2.4.so:devel/libsoup \

USES+=      gettext gmake gnome libtool localbase pathfix pkgconfig
USE_GNOME=  glib20 libxslt intlhack introspection:build referencehack
USE_LDCONFIG=   yes
GNU_CONFIGURE=  yes
INSTALL_TARGET= install-strip
#MAKE_JOBS_UNSAFE=yes
CONFIGURE_ARGS= --without-oracle \
        --disable-crypto \
        --disable-default-binary \
        --enable-introspection

.include <bsd.port.options.mk>

VERSION=    5.0
PLIST_SUB+= VERSION=${VERSION}

.if ${LIBGDA5_SLAVE}!="no"
USE_GNOME+= libgda5
.endif

.if ${LIBGDA5_SLAVE}==ui
LIB_DEPENDS=    libgcrypt.so:security/libgcrypt \
        libgpg-error.so:security/libgpg-error
CONFIGURE_ARGS+=--with-ui
USE_GNOME+= cairo gtk30
INSTALLS_ICONS= yes
.else
CONFIGURE_ARGS+=--without-ui
.endif

.if ${LIBGDA5_SLAVE}==bdb
USES+=          bdb:5
CONFIGURE_ARGS+=    --with-bdb=${LOCALBASE}
.else
CONFIGURE_ARGS+=    --without-bdb
.endif

.if ${LIBGDA5_SLAVE}==ldap
USE_OPENLDAP=   yes
CONFIGURE_ARGS+=    --with-ldap=${LOCALBASE}
.else
CONFIGURE_ARGS+=    --without-ldap
.endif

.if ${LIBGDA5_SLAVE}==mysql
USES+=          mysql
CONFIGURE_ARGS+=    --with-mysql=${LOCALBASE}
.else
CONFIGURE_ARGS+=    --without-mysql
.endif

.if ${LIBGDA5_SLAVE}==postgresql
USES+=          pgsql
CONFIGURE_ARGS+=    --with-postgres=${LOCALBASE}
.else
CONFIGURE_ARGS+=    --without-postgres
.endif

# MDB (MS Access)
.if ${LIBGDA5_SLAVE}==mdb
LIB_DEPENDS+=       libmdbsql.so:databases/mdbtools
CONFIGURE_ARGS+=    --with-mdb=${LOCALBASE}
.else
CONFIGURE_ARGS+=    --without-mdb
.endif

.if ${LIBGDA5_SLAVE}==jdbc
USE_JAVA=       yes
JAVA_VERSION=       1.6+
JAVA_VENDOR=        bsdjava openjdk
CFLAGS+=        -I${JAVA_HOME}/include -I${JAVA_HOME}/include/freebsd
.else
CONFIGURE_ARGS+=    --without-java
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|-ldl||g' \
        ${WRKSRC}/configure
    @${REINPLACE_CMD} -e 's|"db.h|"db${BDB_VER}/db.h|g' \
        -e 's|ldb47|l${BDB_LIB_NAME}|g' \
        -e 's|ldb|l${BDB_LIB_NAME}|g' \
        -e 's|libdb|lib${BDB_LIB_NAME}|g' \
        ${WRKSRC}/configure
    @${REINPLACE_CMD} -e 's|<db\.h>|<db${BDB_VER}/db.h>|' \
        ${WRKSRC}/providers/bdb/gda-bdb-provider.c \
        ${WRKSRC}/providers/bdb/gda-bdb-test.c
.if ${LIBGDA5_SLAVE} == jdbc
    @${REINPLACE_CMD} -e 's|lib/amd64|lib/${ARCH}|g' \
        ${WRKSRC}/getsp.java
.endif
.if ${LIBGDA5_SLAVE}!="no"
    @${FIND} ${WRKSRC} -name Makefile.in -exec ${REINPLACE_CMD} \
        -e 's|$$(top_builddir)/libgda/libgda-5.0.la|-lgda-5.0|g' \
        -e 's|../libgda/libgda-5.0.la|-lgda-5.0|g' \
        {} \;
.endif

.if ${LIBGDA5_SLAVE} == jdbc
pre-configure:
    @cd ${WRKSRC} && ${LOCALBASE}/bin/javac getsp.java
.endif

pre-build:
.if ${LIBGDA5_SLAVE}==postgresql
    cd ${WRKSRC}/providers/reuseable/postgres && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} libgda-postgres.la
.endif

.if ${LIBGDA5_SLAVE}==mysql
    cd ${WRKSRC}/providers/reuseable/mysql && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} libgda-mysql.la
.endif

.if ${LIBGDA5_SLAVE}==ui
    cd ${WRKSRC}/libgda && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} gda-enum-types.h
.endif

.if ${LIBGDA5_SLAVE}==no
post-install:
    ${MV} ${STAGEDIR}${PREFIX}/etc/libgda-${VERSION}/config \
        ${STAGEDIR}${PREFIX}/etc/libgda-${VERSION}/config.sample
.endif
.if ${LIBGDA5_SLAVE}==ui
post-install:
    ${INSTALL_DATA} ${WRKSRC}/libgda-ui-5.0.pc \
        ${STAGEDIR}${PREFIX}/libdata/pkgconfig/
.endif

.include <bsd.port.mk>
.endif