[BACK]Return to options.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / lang / python27

File: [cvs.NetBSD.org] / pkgsrc / lang / python27 / options.mk (download)

Revision 1.1, Tue Jul 26 16:44:28 2016 UTC (2 years, 7 months ago) by kamil
Branch: MAIN
CVS Tags: pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-

Add an option for Python: x11

Fix build on systems with disabled X11

Reported by <schmonz>, Andreas Kusalananda Kahari
Tested by Andreas Kusalananda Kahari

Possible direction is to make this switch by default disabled on Darwin.

# $NetBSD: options.mk,v 1.1 2016/07/26 16:44:28 kamil Exp $

PKG_OPTIONS_VAR=	PKG_OPTIONS.python27
PKG_SUPPORTED_OPTIONS+=	x11
PKG_SUGGESTED_OPTIONS=	x11

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

.if !empty(PKG_OPTIONS:Mx11)
# Support for native X11 paths as an option
# This code is no-op for modular X11, however for simplicity don't make it conditional.
SUBST_CLASSES+=			x11findlib
SUBST_MESSAGE.x11findlib=	Fixing find_library() for native X11.
SUBST_STAGE.x11findlib=		pre-configure
SUBST_FILES.x11findlib=		Lib/ctypes/util.py
SUBST_SED.x11findlib=		-e 's!\(-Wl,-t -o\)!${COMPILER_RPATH_FLAG}${X11BASE}/lib -L${X11BASE}/lib \1!'

# Required to get definition of X11BASE and retain X11 rpath paths for linker
# We need to pass rpath to _ctypes.so to get functional dlopen(3) for X11 libs
USE_X11=		yes

SUBST_CLASSES+=		cdlopen
SUBST_MESSAGE.cdlopen=	Handle X11BASE paths in dlopen(3) calls of _ctypes.so
SUBST_STAGE.cdlopen=	pre-configure
SUBST_FILES.cdlopen=	setup.py
SUBST_SED.cdlopen=	-e "s!\(libraries=\[\],\)!\1 runtime_library_dirs=\['${X11BASE}/lib'\],!"
.endif