summaryrefslogtreecommitdiff
path: root/inputmethod/mozc-server/Makefile.common
blob: e804bebb894a001886f44842f3cc8f5c9ef551a4 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# $NetBSD: Makefile.common,v 1.36 2022/04/24 22:19:15 tnn Exp $

# used by inputmethod/ibus-mozc/Makefile
# used by inputmethod/mozc-elisp/Makefile
# used by inputmethod/mozc-server/Makefile
# used by inputmethod/mozc-tool/Makefile
# used by inputmethod/mozc-renderer/Makefile
# used by inputmethod/uim-mozc/Makefile

DISTNAME=	mozc-2.26.4282.100
CATEGORIES=	inputmethod
MASTER_SITES=	${MASTER_SITE_LOCAL}
EXTRACT_SUFX=	.tar.xz

MAINTAINER=	ryoon@NetBSD.org
HOMEPAGE=	https://github.com/google/mozc/
COMMENT=	Japanese inputmethod Mozc engine
LICENSE=	modified-bsd

UIM_MOZC=	uim-mozc-321.3ea28b1
DISTFILES+=	${DISTNAME}${EXTRACT_SUFX} \
		${UIM_MOZC}.tar.xz
SITES.${UIM_MOZC}.tar.xz=	${MASTER_SITE_SOURCEFORGE:=pnsft-aur/}

EXTRACT_USING=	bsdtar
WRKSRC=		${WRKDIR}/${DISTNAME}/src

DISTINFO_FILE=	${.CURDIR}/../../inputmethod/mozc-server/distinfo
PATCHDIR=	${.CURDIR}/../../inputmethod/mozc-server/patches

PYTHON_VERSIONS_INCOMPATIBLE+=	27

BUILD_DEPENDS+=	${PYPKGPREFIX}-gyp>=0.1pre20200512.caa60026e223fc501e8b337fd5086ece4028b1c6:../../devel/gyp
BUILD_DEPENDS+=	${PYPKGPREFIX}-six-[0-9]*:../../lang/py-six
BUILD_DEPENDS+=	ninja-build-[0-9]*:../../devel/ninja-build

USE_LANGUAGES=	c c++
USE_TOOLS+=	gmake pkg-config
GCC_REQD+=	4.7	# for c++11

CHECK_PORTABILITY_SKIP+=	third_party/protobuf/src/google/protobuf/compiler/zip_output_unittest.sh

OPENSSL_CFLAGS=		-I${BUILDLINK_PREFIX.openssl}/include
OPENSSL_INC=		-I${BUILDLINK_PREFIX.openssl}/include
OPENSSL_LDFLAGS=	-L${BUILDLINK_PREFIX.openssl}/lib -lssl -lcrypto
OPENSSL_LIBS=		-lssl -lcrypto

SUBST_CLASSES+=		gyp
SUBST_STAGE.gyp=	pre-configure
SUBST_MESSAGE.gyp=	Fix gyp defaults
SUBST_FILES.gyp+=	config.bzl
SUBST_FILES.gyp+=	base/process.cc
SUBST_FILES.gyp+=	gyp/directories.gypi
SUBST_FILES.gyp+=	unix/ibus/ibus.gyp
SUBST_FILES.gyp+=	unix/ibus/path_util.cc
SUBST_VARS.gyp+=	OPENSSL_CFLAGS OPENSSL_INC OPENSSL_LDFLAGS OPENSSL_LIBS
SUBST_VARS.gyp+=	PREFIX

# To disable flock(1) in link stage.
ALL_ENV+=	LINK=${CXX}

.include "../../mk/bsd.prefs.mk"

OPSYSVARS+=	OSDEST
OSDEST.Linux=	linux
OSDEST.NetBSD=	bsd

MOZC_BUILD_MODE=	Release # or Debug

# In file included from src/dictionary/system/system_dictionary.h:43:0,
#                  from ../../dictionary/system/system_dictionary.cc:47:
# src/dictionary/system/key_expansion_table.h: In member function 'const mozc::dictionary::ExpandedKey mozc::dictionary::KeyExpansionTable::ExpandKey(char) const':
# src/dictionary/system/key_expansion_table.h:83:34: error: array subscript has type 'char' [-Werror=char-subscripts]
#      return ExpandedKey(table_[key]);
# Maybe fix this later.
BUILDLINK_TRANSFORM+=	rm:-Werror=char-subscripts

do-configure:
	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
		GYP_DEFINES="use_libprotobuf=1" \
		${PYTHONBIN} build_mozc.py \
		gyp \
		--gypdir=${LOCALBASE}/bin

.include "../../devel/glib2/buildlink3.mk"
.include "../../devel/protobuf/buildlink3.mk"
# gmock is not used yet...
#.include "../../devel/gmock/buildlink3.mk"
.include "../../inputmethod/zinnia/buildlink3.mk"
.include "../../www/curl/buildlink3.mk"
.include "../../x11/gtk2/buildlink3.mk"
.include "../../x11/qt5-qtbase/buildlink3.mk"

.include "../../lang/python/tool.mk"
.include "../../mk/atomic64.mk"