Changeset View
Standalone View
net/libproxy/Makefile
# Created by: Joe Marcus Clarke <marcus@FreeBSD.org> | # Created by: Joe Marcus Clarke <marcus@FreeBSD.org> | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
# $MCom: ports/net/libproxy/Makefile,v 1.1 2011/01/12 13:10:52 kwm Exp $ | |||||
PORTNAME= libproxy | PORTNAME= libproxy | ||||
PORTVERSION= 0.4.12 | PORTVERSION= 0.4.15 | ||||
PORTREVISION?= 0 | PORTREVISION?= 0 | ||||
CATEGORIES?= net devel | CATEGORIES?= net devel | ||||
MAINTAINER= gnome@FreeBSD.org | MAINTAINER= gnome@FreeBSD.org | ||||
COMMENT?= Library that provides automatic proxy configuration management | COMMENT?= Library that provides automatic proxy configuration management | ||||
LICENSE= LGPL21+ | LICENSE= LGPL21+ | ||||
LICENSE_FILE= ${WRKSRC}/COPYING | LICENSE_FILE= ${WRKSRC}/COPYING | ||||
USES+= cmake:outsource cpe pathfix pkgconfig | |||||
CPE_VENDOR= libproxy_project | CPE_VENDOR= libproxy_project | ||||
PATHFIX_CMAKELISTSTXT= devfiles.cmk | PATHFIX_CMAKELISTSTXT= devfiles.cmk | ||||
USE_GITHUB= yes | USE_GITHUB= yes | ||||
USES+= cmake:outsource cpe pathfix | |||||
PLIST_SUB+= VERSION=${PORTVERSION} | CMAKE_ON+= WITH_VALA | ||||
CMAKE_OFF+= BIPR WITH_DOTNET WITH_NATUS WITH_NM WITH_NMold | |||||
CMAKE_ARGS= -DBIPR:BOOL=OFF -DWITH_DOTNET:BOOL=OFF \ | # Slave ports. | ||||
-DWITH_NATUS:BOOL=OFF -DWITH_NM:BOOL=OFF \ | LIBPROXY_SLAVES= LIBRARY PYTHON PERL GNOME2 GNOME3 KDE WEBKIT WEBKIT3 MOZJS PYTHON | ||||
-DWITH_VALA:BOOL=ON | |||||
.if !defined(LIBPROXY_SLAVE) | # If nothing is set, we're building the library, i.e. this port. | ||||
USE_LDCONFIG= yes | LIBPROXY_SLAVE?= LIBRARY | ||||
CMAKE_ARGS+= -DWITH_PYTHON:BOOL=OFF -DWITH_PERL:BOOL=OFF \ | |||||
-DWITH_GNOME2:BOOL=OFF -DWITH_GNOME3:BOOL=OFF \ | |||||
-DWITH_KDE:BOOL=OFF -DWITH_MOZJS:BOOL=OFF \ | |||||
-DWITH_WEBKIT:BOOL=OFF -DWITH_WEBKIT3:BOOL=OFF | |||||
.else | |||||
PORTSCOUT= ignore:1 | |||||
mat: This is a bit wrong, you define options, and then you say all options are excluded. The… | |||||
# Libproxy is build for the slave ports, since I haven't been able to find | PLIST_SUB+= VERSION=${PORTVERSION} | ||||
# out how to only build optional code with cmake. | |||||
# Patches for this problem are welcome. | |||||
. if ${LIBPROXY_SLAVE}=="python" | # Activate the wanted module, and deactivate the others | ||||
CMAKE_ARGS+= -DWITH_PYTHON:BOOL=ON | CMAKE_ON+= WITH_${LIBPROXY_SLAVE} | ||||
. else | CMAKE_OFF+= ${LIBPROXY_SLAVES:N${LIBPROXY_SLAVE}:S/^/WITH_/} | ||||
CMAKE_ARGS+= -DWITH_PYTHON:BOOL=OFF | |||||
. endif | |||||
. if ${LIBPROXY_SLAVE}=="perl" | # Setup slave ports. | ||||
CMAKE_ARGS+= -DWITH_PERL:BOOL=ON | .if ${LIBPROXY_SLAVE:NLIBRARY} | ||||
. else | USES+= localbase | ||||
CMAKE_ARGS+= -DWITH_PERL:BOOL=OFF | LIB_DEPENDS+= libproxy.so:net/libproxy | ||||
DESCR= ${.CURDIR}/../${PORTNAME}-${LIBPROXY_SLAVE:tl}/pkg-descr | |||||
Not Done Inline ActionsBoth these should be WITH_${OPTIONS_SLAVE}. mat: Both these should be `WITH_${OPTIONS_SLAVE}`. | |||||
Not Done Inline ActionsMmmm, no, only the first, but the way this is done is so convoluted that it should probably not be done this way. mat: Mmmm, no, only the first, but the way this is done is so convoluted that it should probably not… | |||||
Not Done Inline ActionsI see, your not a fan of my cleverness ... I'll revert it to the old way :) tcberner: I see, your not a fan of my cleverness ... I'll revert it to the old way
{meme… | |||||
Not Done Inline ActionsOh, no, I love clever people, but you have to remember that you are not the only one who will work on any given port. If it takes more a minute or two to understand what is happening, it could probably be done in an easier way. In this case, now that I have thought more about these 2 lines (so more like 30 minutes of thinking) looking at it, I think using options, only the _BOOL was needed, because when the options was excluded, it would be "off" and the WITH_FOO=OFF would be added. (I may be wrong, though.) So being clever is nice, but the more clever you think you are, the more you can create bugs that will take longer to figure out, and the more you, yourself will wonder wtf you wanted to do when you did this change 18 months ago. mat: Oh, no, I love clever people, but you have to remember that you are not the only one who will… | |||||
PLIST= ${.CURDIR}/../${PORTNAME}-${LIBPROXY_SLAVE:tl}/pkg-plist | |||||
. endif | .endif | ||||
. if ${LIBPROXY_SLAVE}=="gnome" | .if ${LIBPROXY_SLAVE:MWEBKIT3} | ||||
CMAKE_ARGS+= -DWITH_GNOME2:BOOL=ON | # Additionally to WITH_WEBKIT3 also WITH_WEBKIT is required. | ||||
. else | CMAKE_ON+= WITH_WEBKIT | ||||
CMAKE_ARGS+= -DWITH_GNOME2:BOOL=OFF | CMAKE_OFF:= ${CMAKE_OFF:C/WITH_WEBKIT//} | ||||
. endif | .endif | ||||
. if ${LIBPROXY_SLAVE}=="gnome3" | .include <bsd.port.pre.mk> | ||||
CMAKE_ARGS+= -DWITH_GNOME3:BOOL=ON | |||||
. else | |||||
CMAKE_ARGS+= -DWITH_GNOME3:BOOL=OFF | |||||
. endif | |||||
. if ${LIBPROXY_SLAVE}=="kde" | # Hackery for the to python backends. | ||||
CMAKE_ARGS+= -DWITH_KDE:BOOL=ON | .if ${LIBPROXY_SLAVE:MPYTHON} | ||||
. if ${PYTHON_MAJOR_VER} == 2 | |||||
CMAKE_ON+= WITH_PYTHON2 | |||||
CMAKE_OFF+= WITH_PYTHON3 | |||||
CMAKE_ARGS+= -DPYTHON2_EXECUTABLE:FILEPATH=${PYTHON_CMD} | |||||
. else | . else | ||||
CMAKE_ARGS+= -DWITH_KDE:BOOL=OFF | CMAKE_ON+= WITH_PYTHON3 | ||||
CMAKE_OFF+= WITH_PYTHON2 | |||||
. endif | . endif | ||||
. if ${LIBPROXY_SLAVE}=="webkit" | |||||
CMAKE_ARGS+= -DWITH_WEBKIT3:BOOL=ON | |||||
. else | .else | ||||
CMAKE_ARGS+= -DWITH_WEBKIT3:BOOL=OFF -DWITH_WEBKIT:BOOL=OFF | CMAKE_OFF+= WITH_PYTHON2 WITH_PYTHON3 | ||||
. endif | .endif | ||||
. if ${LIBPROXY_SLAVE}=="mozjs" | .include <bsd.port.post.mk> | ||||
Not Done Inline Actions@mat line 75--90 tcberner: @mat line 75--90 | |||||
Not Done Inline ActionsThis should probably go in the Python slave port. mat: This should probably go in the Python slave port. | |||||
Not Done Inline ActionsHaving two plists is probably not required, USE_PYTHON=py3kplist should handle it. mat: Having two plists is probably not required, `USE_PYTHON=py3kplist` should handle it. | |||||
CMAKE_ARGS+= -DWITH_MOZJS:BOOL=ON | |||||
. else | |||||
CMAKE_ARGS+= -DWITH_MOZJS:BOOL=OFF | |||||
. endif | |||||
.endif | |||||
.include <bsd.port.mk> |
This is a bit wrong, you define options, and then you say all options are excluded. The current implementation handles this by enforcing the _SLAVE before enforcing the _EXCLUDE but this could change. This should probably not exclude the current set option.