aboutsummaryrefslogtreecommitdiffstats
path: root/www/w3m/Makefile
blob: 82d350ea48f9dd36cc6777c6a53a44b11ab67e31 (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
# Created by: MANTANI Nobutaka <nobutaka@nobutaka.com>
# $FreeBSD$

PORTNAME=   w3m
PORTVERSION=    0.5.3.20170102
CATEGORIES+=    www ipv6

MAINTAINER?=    nobutaka@FreeBSD.org
COMMENT?=   Pager/text-based WWW browser

LICENSE=    w3m
LICENSE_NAME=   w3m
LICENSE_FILE=   ${WRKSRC}/doc/README
LICENSE_PERMS=  dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

LIB_DEPENDS=    libgc.so:devel/boehm-gc

USES=       iconv pkgconfig perl5 ssl
USE_GITHUB= yes

GH_ACCOUNT= tats
GH_PROJECT= w3m
GH_TAGNAME= 1ac245b

MAKE_JOBS_UNSAFE=   yes

CONFLICTS?= ja-w3m-0.5.* ja-w3m-img-0.5.* w3m-img-0.5.*
GNU_CONFIGURE=  yes
CONFIGURE_ARGS= --with-gc=${LOCALBASE} \
        ac_cv_path_PERL=${PERL}
CONFIGURE_ENV=  DEFS="-I${LOCALBASE}/include"

DOCS_COMMON=    FAQ.html HISTORY MANUAL.html README README.cookie \
        README.cygwin README.dict README.func README.img \
        README.m17n README.mouse README.passwd README.pre_form \
        README.siteconf README.tab STORY.html \
        keymap.default keymap.lynx menu.default menu.submenu
DOCS_DE=    FAQ.html MANUAL.html README.func
DOCS_EN=    README.sixel
DOCS_JP=    ${DOCS_COMMON} README.SSL README.keymap \
        README.mailcap README.menu README.migemo

OPTIONS_DEFINE= INLINE_IMAGE JAPANESE KEY_LYNX DOCS NLS
INLINE_IMAGE_DESC=  Inline image support
JAPANESE_DESC=      Japanese messages and migemo support
KEY_LYNX_DESC=      Keymap like lynx browser
OPTIONS_SUB=    yes

INLINE_IMAGE_USE=   xorg=x11 gnome=gtk20,gdkpixbuf2
INLINE_IMAGE_CONFIGURE_ON=  --with-imagelib=gtk2 --enable-image=fb,x11
INLINE_IMAGE_CONFIGURE_OFF= --enable-image=no

JAPANESE_CONFIGURE_ON=  --enable-japanese=U --with-migemo=yes

KEY_LYNX_CONFIGURE_ON=  --with-keymap=lynx

NLS_USES=   gettext
NLS_CONFIGURE_ON=   --enable-nls
NLS_CONFIGURE_OFF=  --disable-nls

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MINLINE_IMAGE}
PKGMESSAGE= ${MASTERDIR}/pkg-message
CONFIGURE_ENV += LDFLAGS="-L${LOCALBASE}/lib" LIBS="-lX11"
.else
# Don't use pkg-message
PKGMESSAGE= ${NONEXISTENT}
.endif

post-patch:
    @${REINPLACE_CMD} -e \
        's|\`\(expr\) \(.*\) : \(.*\)`|`\1 \\( \2 : \3 \\)`|' \
        -e 's|/usr/local|${LOCALBASE}|g' \
        ${WRKSRC}/configure
    @${FIND} ${WRKSRC}/doc* -type f \! -name HISTORY \
        -exec ${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|g' {} +
    @${CP} ${WRKSRC}/doc-jp/README.func ${WRKSRC}/README.func.bak
    @${ICONV_CMD} -f EUC-JP -t UTF-8 ${WRKSRC}/README.func.bak \
        > ${WRKSRC}/doc-jp/README.func
    @${CP} ${WRKSRC}/scripts/w3mhelp-funcdesc.ja.pl.in \
        ${WRKSRC}/scripts/w3mhelp-funcdesc.ja.pl.in.bak
    @${ICONV_CMD} -f EUC-JP -t UTF-8 \
        ${WRKSRC}/scripts/w3mhelp-funcdesc.ja.pl.in.bak \
        > ${WRKSRC}/scripts/w3mhelp-funcdesc.ja.pl.in
    @${REINPLACE_CMD} -e 's|EUC-JP|UTF-8|g' \
        ${WRKSRC}/scripts/w3mhelp-funcdesc.ja.pl.in

post-install:
    @${MKDIR} ${STAGEDIR}${PREFIX}/share/doc/ja/w3m
    @cd ${WRKSRC}/doc-jp; \
    for i in ${DOCS_JP} ; do \
        ${INSTALL_DATA} $$i ${STAGEDIR}${PREFIX}/share/doc/ja/w3m/ ; \
    done
    @${MKDIR} ${STAGEDIR}${PREFIX}/share/doc/de/w3m
    @cd ${WRKSRC}/doc-de; \
    for i in ${DOCS_DE} ; do \
        ${INSTALL_DATA} $$i ${STAGEDIR}${PREFIX}/share/doc/de/w3m/ ; \
    done
    @cd ${WRKSRC}/doc; \
    ${MKDIR} ${STAGEDIR}${PREFIX}/share/doc/w3m/; \
    for i in ${DOCS_COMMON} ${DOCS_EN} ; do \
        ${INSTALL_DATA} $$i ${STAGEDIR}${PREFIX}/share/doc/w3m/ ; \
    done
    ${INSTALL_MAN} ${WRKSRC}/scripts/w3mman/w3mman.1 ${STAGEDIR}${PREFIX}/man/ja/man1

.include <bsd.port.mk>