freebsd-ports/lang/python39/Makefile
Tobias C. Berner f98ae56653 lang: remove 'Created by' lines
A big Thank You to the original contributors of these ports:

  *  Aaron Dalton <aaron@FreeBSD.org>
  *  Adam Weinberger <adamw@FreeBSD.org>
  *  Akinori MUSHA aka knu <knu@idaemons.org>
  *  Alex Dupre <ale@FreeBSD.org>
  *  Alexey Dokuchaev <danfe@FreeBSD.org>
  *  Alonso Cardenas Marquez <acm@FreeBSD.org>
  *  Andreas Klemm <andreas@klemm.gtn.com>
  *  Andrew Pantyukhin <infofarmer@FreeBSD.org>
  *  Andrey Zakhvatov
  *  Anton Berezin <tobez@FreeBSD.org>
  *  Anton Berezin <tobez@tobez.org>
  *  Anton Shterenlikht
  *  Ashish SHUKLA <ashish@FreeBSD.org>
  *  Bob Eager <bob@eager.cx>
  *  Bruce M Simpson
  *  Bruce M. Simpson
  *  Christoph Mallon <christoph.mallon@gmx.de>
  *  Christopher Elkins <chrise@scardini.com>
  *  Christopher Key <cjk32@cam.ac.uk>
  *  Chuck Robey <chuckr@FreeBSD.org>
  *  Cyrille Lefevre <clefevre@citeweb.net>
  *  Dan Rench <citric@cubicone.tmetic.com>
  *  Danilo Egea Gondolfo <danilogondolfo@gmail.com>
  *  Dario Freni <saturnero@gufi.org>
  *  David Kalliecharan <dave@dal.ca>
  *  David Naylor <dbn@FreeBSD.org>
  *  David Naylor <dbn@dragon.local>
  *  David O'Brien (obrien@NUXI.com)
  *  David O'Brien (obrien@NUXI.org)
  *  David O'Brien <obrien@NUXI.org>
  *  David O'Brien <obrien@cs.ucdavis.edu>
  *  Dereckson <dereckson@gmail.com>
  *  Devon H. O'Dell <devon.odell@gmail.com>
  *  Dmitry Sivachenko <demon@FreeBSD.org>
  *  Don Croyle <croyle@gelemna.org>
  *  Douglas Anestad <yotta@dougdidit.com>
  *  Edwin Groothuis (edwin@mavetju.org)
  *  Edwin Groothuis <edwin@mavetju.org>
  *  Eugene Ossintsev
  *  Frank Fischer
  *  Frank Gruender <elwood@mc5sys.in-berlin.de>
  *  Frederic Cambus
  *  Gea-Suan Lin <gslin@gslin.org>
  *  Gerald Pfeifer <gerald@FreeBSD.org>
  *  Giuseppe Pilichi aka Jacula Modyun <jacula@gmail.com>
  *  GreenDog <fiziologus@gmail.com>
  *  Gustau Perez i Querol <gustau.perez@gmail.com>
  *  Guy Antony Halse <guy@rucus.ru.za.za>
  *  Herve Quiroz <hq@FreeBSD.org>
  *  Hye-Shik Chang
  *  Hye-Shik Chang <perky@fallin.lv>
  *  Hye-Shik Chang <perky@python.or.kr>
  *  Iblis Lin <iblis@hs.ntnu.edu.tw>
  *  James Bailie <jimmy@mammothcheese.ca>
  *  James FitzGibbon <jfitz@FreeBSD.org>
  *  Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
  *  Jean-Yves Lefort <jylefort@FreeBSD.org>
  *  Jeff Brown <jabrown@caida.org>
  *  Jeremy Norris <ishmael27@home.com>
  *  Jing-Tang Keith Jang <keith@FreeBSD.org>
  *  John Hein <jhein@symmetricom.com>
  *  John Marino <marino@FreeBSD.org>
  *  John Merryweather Cooper
  *  John Merryweather Cooper <coop9211@uidaho.edu>
  *  John Merryweather Cooper et al
  *  Joseph Koshy <jkoshy@FreeBSD.org>
  *  Josh Elsasser <jre@vineyard.net>
  *  Josh Gilliam <josh@quick.net>
  *  Julian H. Stacey <jhs@FreeBSD.org>
  *  Julian Stecklina
  *  Jyun-Yan You <jyyou@cs.nctu.edu.tw>
  *  Katsuji ISHIKAWA <katsuji.ishikawa@gmail.com>
  *  Kimura Fuyuki <fuyuki@hadaly.org>
  *  Kimura Fuyuki <fuyuki@mj.0038.net>
  *  Kimura Fuyuki <fuyuki@nigredo.org>
  *  Kiriyama Kazuhiko <kiri@kiri.toba-cmt.ac.jp>
  *  Kubilay Kocak <koobs@FreeBSD.org>
  *  Lars Thegler <lth@FreeBSD.org>
  *  Lev Walkin <vlm@lionet.info>
  *  Li-Wen Hsu <lwhsu@FreeBSD.org>
  *  Mahdi Mokhtari <mokhi64@gmail.com>
  *  Marcin Cieslak <saper@SYSTEM.PL>
  *  Martin Matuska <mm@FreeBSD.org>
  *  Matthew Hunt <mph@FreeBSD.org>
  *  Michael Butschky <butsch@computi.erols.com>
  *  Michael Johnson <ahze@FreeBSD.org>
  *  Mitsuru YOSHIDA <mitsuru@riken.jp>
  *  Muhammad Moinur Rahman <5u623l20@gmail.com>
  *  Neal Nelson <ports@nicandneal.net>
  *  Nicola Vitale <nivit@FreeBSD.org>
  *  Nils M Holm <nmh@t3x.org>
  *  Oliver Braun <obraun@informatik.unibw-muenchen.de>
  *  Oliver Breuninger <ob@seicom.NET>
  *  Patrick Li <pat@databits.net>
  *  Pawel Worach <pawel.worach@gmail.com>
  *  Pedro F. Giffuni <giffunip@asme.org>
  *  Pedro Giffuni
  *  Pedro Giffuni <giffunip@asme.org>
  *  Pete French <pete@twisted.org.uk>
  *  Peter Schuller <peter.schuller@infidyne.com>
  *  Peter van Heusden <pvh@egenetics.com>
  *  Phillip Neumann <pneumann@gmail.com>
  *  Piotr Kubaj <pkubaj@anongoth.pl>
  *  Po-Chuan Hsieh <sunpoet@FreeBSD.org>
  *  Pontus Stenetorp <ninjin@kth.se>
  *  Ralf S. Engelschall <rse@engelschall.com>
  *  Rick van der Zwet <rick@wzoeterwoude.net>
  *  Rob Zinkov
  *  Roland Jesse <roland.jesse@gmx.net>
  *  Romain Tartiere <romain@blogreen.org>
  *  Ryan Steinmetz <zi@FreeBSD.org>
  *  Sahil Tandon <sahil@tandon.net>
  *  Sergei Kolobov <sergei@kolobov.com>
  *  Sergey A. Osokin <osa@FreeBSD.org>
  *  Sergey Skvortsov <skv@protey.ru>
  *  Simon Marlow <simonmar@microsoft.com>
  *  Simun Mikecin <numisemis@yahoo.com>
  *  Stanislav Sedov <ssedov@mbsd.msk.ru>
  *  Stephen Weeks <sweeks@sweeks.com>
  *  Steven G. Kargl
  *  Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
  *  Sylvio Cesar <sylvio@FreeBSD.org>
  *  Thomas Gellekum <tg@FreeBSD.org>
  *  Timothy Beyer <beyert@cs.ucr.edu>
  *  Timothy Bourke <timbob@bigpond.com>
  *  Tom Judge <tj@FreeBSD.org>
  *  Veniamin Gvozdikov <vg@FreeBSD.org>
  *  Vitaly Magerya <vmagerya@gmail.com>
  *  Wen Heping <wenheping@gmail.com>
  *  Wen Heping <wenhping@gmail.com>
  *  Wes Peters <wes@softweyr.com>
  *  Ying-Chieh Liao <ijliao@FreeBSD.org>
  *  Yukihiro Nakai <Nakai@technologist.com>
  *  Yukihiro Nakai <nakai@FreeBSD.org>
  *  Zach Garner <zach@neurosoft.org>
  *  aaron@FreeBSD.org
  *  andrewb@cs.cmu.edu
  *  arved
  *  chinsan
  *  chuckr
  *  dd
  *  erik@smluc.org
  *  gahr
  *  gahr@FreeBSD.org
  *  gpalmer
  *  hsu
  *  ijliao
  *  jasone
  *  jkh
  *  jkoshy
  *  jmacd
  *  jmacd@FreeBSD.org
  *  jmz
  *  js@jeannot.org
  *  jseger@FreeBSD.org
  *  kappa@FreeBSD.org.ua
  *  kbyanc
  *  msmith@gsoft.com.au
  *  mutoh@openedu.org
  *  netchild@FreeBSD.org
  *  patrick
  *  pst
  *  rene@FreeBSD.org
  *  ruslan@shevchenko.kiev.ua
  *  stas
  *  tobez

With hat:	portmgr
2022-07-20 16:22:15 +02:00

157 lines
5.8 KiB
Makefile

PORTNAME= python
DISTVERSION= ${PYTHON_DISTVERSION}
CATEGORIES= lang python
MASTER_SITES= PYTHON/ftp/python/${DISTVERSION}
PKGNAMESUFFIX= ${PYTHON_SUFFIX}
DISTNAME= Python-${DISTVERSION}
DIST_SUBDIR= python
MAINTAINER= python@FreeBSD.org
COMMENT= Interpreted object-oriented programming language
LICENSE= PSFL
LIB_DEPENDS= libffi.so:devel/libffi
USES= compiler:c11 cpe ncurses pathfix pkgconfig readline \
shebangfix ssl tar:xz
PATHFIX_MAKEFILEIN= Makefile.pre.in
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
python_CMD= ${PREFIX}/bin/python${PYTHON_DISTVERSION:R}
SHEBANG_FILES= Lib/*.py Lib/*/*.py Lib/*/*/*.py Lib/*/*/*/*.py
SHEBANG_FILES+= Lib/test/ziptestdata/exe_with_z64 \
Lib/test/ziptestdata/exe_with_zip \
Lib/test/ziptestdata/header.sh
# Duplicate python.mk variables. TODO: Let lang/python?? ports use python.mk bits.
PYTHON_VER= ${PYTHON_DISTVERSION:R}
PYTHON_VERSION= python${PYTHON_VER}
PYTHON_SUFFIX= ${PYTHON_VER:S/.//g}
DISABLED_EXTENSIONS= _sqlite3 _tkinter _gdbm
CONFIGURE_ARGS+= --enable-shared --without-ensurepip \
--with-system-ffi
CONFIGURE_ENV+= OPT="" # Null out OPT to respect user CFLAGS and remove optimizations
INSTALL_TARGET= altinstall # Don't want cloberring of unprefixed files
TEST_TARGET= buildbottest
TEST_ARGS= TESTOPTS=-j${MAKE_JOBS_NUMBER}
MAKE_ARGS+= INSTALL_SHARED="${INSTALL_LIB}" # Strip shared library
SUB_FILES= pkg-message
SUB_LIST= PYTHON_SUFFIX=${PYTHON_SUFFIX}
PLIST_SUB= ABI=${ABIFLAGS} \
XY=${PYTHON_SUFFIX} \
XYDOT=${PYTHON_VER} \
XYZDOT=${DISTVERSION} \
OSMAJOR=${OSVERSION:C/([0-9]*)[0-9]{5}/\1/} # For plat-freebsd* in pkg-plist. https://bugs.python.org/issue19554
OPTIONS_DEFINE= DEBUG IPV6 LIBMPDEC LTO NLS PYMALLOC
OPTIONS_DEFAULT= LIBMPDEC PYMALLOC
OPTIONS_EXCLUDE_powerpc64= LTO
OPTIONS_EXCLUDE_riscv64= LTO
OPTIONS_RADIO= HASH
OPTIONS_RADIO_HASH= FNV SIPHASH
OPTIONS_SUB= yes
LIBMPDEC_DESC= Use libmpdec from ports instead of bundled version
NLS_DESC= Enable gettext support for the locale module
PYMALLOC_DESC= Enable specialized mallocs
HASH_DESC= Hash Algorithm (PEP-456)
FNV_DESC= Modified Fowler-Noll-Vo Algorithm
SIPHASH_DESC= SipHash24 Algorithm
FNV_CONFIGURE_ON= --with-hash-algorithm=fnv
SIPHASH_CONFIGURE_ON= --with-hash-algorithm=siphash24
DEBUG_CONFIGURE_WITH= pydebug
IPV6_CONFIGURE_ENABLE= ipv6
LIBMPDEC_CONFIGURE_ON= --with-system-libmpdec
LIBMPDEC_LIB_DEPENDS= libmpdec.so:math/mpdecimal
LTO_CONFIGURE_ON= --with-lto
# Use CPPFLAGS over CFLAGS due to -I ordering, causing elementtree and pyexpat
# to break in Python 2.7, or preprocessor complaints in Python >= 3.3
# Upstream Issue: https://bugs.python.org/issue6299
NLS_USES= gettext
NLS_CPPFLAGS= -I${LOCALBASE}/include
NLS_LIBS= -L${LOCALBASE}/lib -lintl
NLS_CONFIGURE_ENV_OFF= ac_cv_lib_intl_textdomain=no ac_cv_header_libintl_h=no
PYMALLOC_CONFIGURE_WITH= pymalloc
.include "${.CURDIR}/Makefile.version"
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MDEBUG}
ABIFLAGS:= d${ABIFLAGS}
.endif
.if !empty(ABIFLAGS)
PLIST_FILES+= bin/python${PYTHON_VER}${ABIFLAGS} \
bin/python${PYTHON_VER}${ABIFLAGS}-config \
libdata/pkgconfig/python-${PYTHON_VER}${ABIFLAGS}.pc \
libdata/pkgconfig/python-${PYTHON_VER}${ABIFLAGS}-embed.pc
.endif
.if ${ARCH} == sparc64
CFLAGS+= -DPYTHON_DEFAULT_RECURSION_LIMIT=900
.endif
# See https://bugs.freebsd.org/115940 and https://bugs.freebsd.org/193650
.if !exists(/usr/bin/ypcat) || defined(WITHOUT_NIS)
PLIST_SUB+= NO_NIS="@comment "
DISABLED_EXTENSIONS+= nis
.else
PLIST_SUB+= NO_NIS=""
.endif
post-patch:
# disable the detection of includes and library from e2fsprogs-libuuid,
# which introduces hidden dependency and breaks build
@${REINPLACE_CMD} -e 's|uuid/uuid.h|ignore_&|' ${WRKSRC}/configure
@${REINPLACE_CMD} -e '/find_library_file/ s|uuid|ignore_&|' ${WRKSRC}/setup.py
# disable detection of multiarch as it breaks with clang >= 13, which adds a
# major.minor version number in -print-multiarch output, confusing Python
@${REINPLACE_CMD} -e 's|^\( *MULTIARCH=\).*--print-multiarch.*|\1|' ${WRKSRC}/configure
# Apply DISABLED_EXTENSIONS
@${ECHO_CMD} '*disabled*' > ${WRKSRC}/Modules/Setup.local
. for _module in ${DISABLED_EXTENSIONS}
@${ECHO_CMD} ${_module} >> ${WRKSRC}/Modules/Setup.local
. endfor
post-install:
.if ! ${PORT_OPTIONS:MDEBUG}
${RM} ${STAGEDIR}${PREFIX}/lib/libpython3.so # Upstream Issue: https://bugs.python.org/issue17975
.endif
${LN} -sf libpython${PYTHON_VER}${ABIFLAGS}.so.1.0 ${STAGEDIR}${PREFIX}/lib/libpython${PYTHON_VER}${ABIFLAGS}.so.1
# This code block exists for the qemu-user enabled cross build environment.
# When using this environment in poudriere, CC is not set to the default
# of /usr/bin/cc and a cross-compile toolchain is used. We need to hand
# edit this so that the run time configuration for python matches what the
# FreeBSD base system provides. sbruno 02Aug2017
.if ${CC} == /nxb-bin/usr/bin/cc
@${REINPLACE_CMD} -e 's=/nxb-bin==' \
${STAGEDIR}${PREFIX}/lib/python${PYTHON_VER}/_sysconfigdata_${ABIFLAGS}_freebsd${OSREL:R}_.py
@cd ${WRKSRC} && ${SETENV} LD_LIBRARY_PATH=${WRKSRC} \
./python -E -m compileall -d ${PREFIX}/lib/python${PYTHON_VER} \
${STAGEDIR}${PREFIX}/lib/python${PYTHON_VER}/_sysconfigdata_${ABIFLAGS}_freebsd${OSREL:R}_.py
@cd ${WRKSRC} && ${SETENV} LD_LIBRARY_PATH=${WRKSRC} \
./python -E -O -m compileall -d ${PREFIX}/lib/python${PYTHON_VER} \
${STAGEDIR}${PREFIX}/lib/python${PYTHON_VER}/_sysconfigdata_${ABIFLAGS}_freebsd${OSREL:R}_.py
@${REINPLACE_CMD} -e 's=/nxb-bin==' \
${STAGEDIR}${PREFIX}/lib/python${PYTHON_VER}/config-${PYTHON_VER}${ABIFLAGS}/Makefile
.endif
for i in ${STAGEDIR}${PREFIX}/lib/python${PYTHON_VER}/lib-dynload/*.so; do \
${STRIP_CMD} $$i; done # Strip shared extensions
${INSTALL_DATA} ${WRKSRC}/Tools/gdb/libpython.py \
${STAGEDIR}${PREFIX}/lib/libpython${PYTHON_VER}${ABIFLAGS}.so.1.0-gdb.py
.include <bsd.port.mk>