aboutsummaryrefslogtreecommitdiffstats
path: root/www/surf/Makefile
blob: 827fff3b119c518f69804884a0e267899864c059 (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
# Created by: Christopher Knaust <jigboe@gmx.de>
# $FreeBSD$

PORTNAME=   surf
PORTVERSION=    0.7
CATEGORIES= www
MASTER_SITES=   http://dl.suckless.org/${PORTNAME}/
PKGNAMESUFFIX=  -browser

MAINTAINER= ports@FreeBSD.org
COMMENT=    Simple Web browser based on WebKit/Gtk+

LICENSE=    MIT
LICENSE_FILE=   ${WRKSRC}/LICENSE

LIB_DEPENDS=    libwebkitgtk-1.0.so:www/webkit-gtk2
RUN_DEPENDS=    dmenu:x11/dmenu

USE_GNOME=  gtk20
USE_XORG=   x11
USES=       pkgconfig

PORTDOCS=   FAQ.md README TODO.md
PORTEXAMPLES=   surf-open.sh
PLIST_FILES=    bin/surf man/man1/surf.1.gz share/pixmaps/surf.png

DESKTOP_ENTRIES="Surf" "" "${PREFIX}/share/pixmaps/surf.png" "surf" "" true

CONFLICTS=  surf-1* # math/surf

OPTIONS_DEFINE= BUILTIN_DOWNLOAD DOCS EXAMPLES
OPTIONS_SINGLE= TOOLKIT
OPTIONS_SINGLE_TOOLKIT= GTK2 GTK3
OPTIONS_DEFAULT=    GTK2

# http://surf.suckless.org/patches/download
# http://surf.suckless.org/patches/smoothscrolling-via-GTK3
BUILTIN_DOWNLOAD_DESC=  Built-in download support
BUILTIN_DOWNLOAD_CFLAGS=    -DBUILTIN_DOWNLOAD
GTK2_LIB_DEPENDS=   libwebkitgtk-1.0.so:www/webkit-gtk2
GTK2_USE=       gnome=gtk20
GTK2_MAKE_ENV=      GTKINC="$$(pkg-config --cflags webkit-1.0)" \
            GTKLIB="$$(pkg-config --libs webkit-1.0)"
GTK3_LIB_DEPENDS=   libwebkitgtk-3.0.so:www/webkit-gtk3
GTK3_USE=       gnome=gtk30
GTK3_MAKE_ENV=      GTKINC="$$(pkg-config --cflags webkitgtk-3.0)" \
            GTKLIB="$$(pkg-config --libs webkitgtk-3.0)"
TOOLKIT_DESC=       Gtk+ toolkit

.include <bsd.port.options.mk>

pre-everything::
    @${ECHO_MSG} "You can build surf with your own config.h using the SURF_CONF knob:"
    @${ECHO_MSG} "make SURF_CONF=/path/to/surf/config.h install clean"

post-extract:
.if defined(SURF_CONF)
    @${ECHO_MSG} "creating config.h from ${SURF_CONF}"
    @${CP} ${SURF_CONF} ${WRKSRC}/config.h
.endif

post-patch:
    ${REINPLACE_CMD} -e \
        '/^PREFIX/s| =| ?=| ; \
        /^MANPREFIX/s|/share/man|/man| ; \
        /^X11/s|/usr/X11R6/|$${LOCALBASE}/| ; \
        /^GTKINC/s| =| ?=| ; \
        /^GTKLIB/s| =| ?=| ; \
        /^INCS/s|-I/usr/include || ; \
        /^LIBS/s|-L/usr/lib -lc || ; \
        /^CPPFLAGS/s| =| +=| ; \
        /^CFLAGS/s| =| +=| ; \
        /^CFLAGS/s|-Os || ; \
        /^LDFLAGS/s| =| +=| ; \
        /^LDFLAGS/s|-g || ; \
        /^CC/s| =| ?=|' ${WRKSRC}/config.mk

post-install:
    ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/surf
    (cd ${WRKSRC} && ${INSTALL_DATA} surf.png \
        ${STAGEDIR}${PREFIX}/share/pixmaps)

post-install-DOCS-on:
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
    (cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR})

post-install-EXAMPLES-on:
    ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
    (cd ${WRKSRC} && ${INSTALL_DATA} ${PORTEXAMPLES} \
        ${STAGEDIR}${EXAMPLESDIR})

.include <bsd.port.mk>