pkgsrc/math/py-scipy12/Makefile
gdt 2277cc6c78 math/py-scipy12: Work around mac extraction woes
On macOS 10.13 (at least), unpacking the distfile as root results in
files that have strange permissions, including group/world writable
and executable.  The upstream distfile has these, but extracting on
other systems or on mac not as root applies some sort of umask.  On
Darwin only, chmod these spurious bits away.  Tested to work as
non-root and root on macOS 10.13, and by inspection will not affect
!macOS.
2020-03-19 19:28:52 +00:00

75 lines
2.4 KiB
Makefile

# $NetBSD: Makefile,v 1.4 2020/03/19 19:28:52 gdt Exp $
DISTNAME= scipy-1.2.2
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
CATEGORIES= math python
MASTER_SITES= ${MASTER_SITE_PYPI:=s/scipy/}
MAINTAINER= markd@NetBSD.org
HOMEPAGE= https://www.scipy.org/
COMMENT= Scientific Algorithms Library for Python
LICENSE= modified-bsd
USE_LANGUAGES+= c c++ fortran
MAKE_ENV+= ATLAS=None
# XXX Avoid picking up other compilers when installed
.include "../../mk/compiler.mk"
.if defined(PKGSRC_FORTRAN) && ${PKGSRC_FORTRAN} == "g95"
PYSETUPBUILDARGS+= --fcompiler=g95
.elif defined(PKGSRC_FORTRAN) && ${PKGSRC_FORTRAN} == "gfortran"
PYSETUPBUILDARGS+= --fcompiler=gnu95
LDFLAGS.Darwin+= -undefined dynamic_lookup
.else
BROKEN= "Requires fortran 95"
.endif
CPPFLAGS+= -D__STDC_FORMAT_MACROS
FFLAGS+= -fPIC
LDFLAGS.Darwin+= -headerpad_max_install_names
REPLACE_PYTHON+= scipy/sparse/linalg/isolve/tests/test_gcrotmk.py
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "Darwin"
# When unpacked by root, files with excessive permissions (group and
# world writable, gratuitously executable) result, apparently only on
# Darwin. Use a large hammer for now.
# \todo Consider using a working EXTRACT tool.
post-extract:
chmod -R go-w ${WRKDIR}
${FIND} ${WRKDIR} -type f | xargs chmod -x
.PHONY: fix-darwin-install-name
post-install: fix-darwin-install-name
fix-darwin-install-name:
${FIND} ${DESTDIR}${PREFIX} -name "*.so" | \
while read lib; do \
libname=`basename $${lib}`; \
libdir=`dirname $${lib} | sed -e 's,${DESTDIR},,'`; \
install_name_tool -id $${libdir}/$${libname} $${lib}; \
done
.endif
TEST_DEPENDS+= ${PYPKGPREFIX}-nose-[0-9]*:../../devel/py-nose
TEST_DEPENDS+= ${PYPKGPREFIX}-test-[0-9]*:../../devel/py-test
# self test failures for 1.1.0 reported at
# https://github.com/scipy/scipy/issues/9196
# needs 'make install' first!
do-test:
cd ${WRKDIR} && \
${PYTHONBIN} -c "import scipy; scipy.test('full')"
.include "../../lang/python/application.mk"
.include "../../lang/python/distutils.mk"
.include "../../devel/py-cython/buildlink3.mk"
.include "../../math/blas/buildlink3.mk"
.include "../../math/fftw/buildlink3.mk"
.include "../../math/lapack/buildlink3.mk"
BUILDLINK_API_DEPENDS.py-numpy+= ${PYPKGPREFIX}-numpy>=1.8.2
.include "../../math/py-numpy/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"