freebsd-ports/math/cadabra2/Makefile
Mathieu Arnold 551be3c723 Convert Python ports to FLAVORS.
Ports using USE_PYTHON=distutils are now flavored.  They will
  automatically get flavors (py27, py34, py35, py36) depending on what
  versions they support.

  There is also a USE_PYTHON=flavors for ports that do not use distutils
  but need FLAVORS to be set.  A USE_PYTHON=noflavors can be set if
  using distutils but flavors are not wanted.

  A new USE_PYTHON=optsuffix that will add PYTHON_PKGNAMESUFFIX has been
  added to cope with Python ports that did not have the Python
  PKGNAMEPREFIX but are flavored.

  USES=python now also exports a PY_FLAVOR variable that contains the
  current python flavor.  It can be used in dependency lines when the
  port itself is not python flavored.  For example, deskutils/calibre.

  By default, all the flavors are generated.  To only generate flavors
  for the versions in PYTHON2_DEFAULT and PYTHON3_DEFAULT, define
  BUILD_DEFAULT_PYTHON_FLAVORS in your make.conf.

  In all the ports with Python dependencies, the *_DEPENDS entries MUST
  end with the flavor so that the framework knows which to build/use.
  This is done by appending '@${PY_FLAVOR}' after the origin (or
  @${FLAVOR} if in a Python module with Python flavors, as the content
  will be the same).  For example:

    RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR}

PR:		223071
Reviewed by:	portmgr, python
Sponsored by:	Absolight
Differential Revision:	https://reviews.freebsd.org/D12464
2017-11-30 15:50:30 +00:00

86 lines
3.6 KiB
Makefile

# $FreeBSD$
PORTNAME= cadabra2
DISTVERSION= 2.1.6
CATEGORIES= math
MAINTAINER= yuri@FreeBSD.org
COMMENT= Computer algebra system for solving field theory problems
LICENSE= LGPL3
LICENSE_FILE= ${WRKSRC}/doc/license.txt
PATCH_DEPENDS= ${NONEXISTENT}:devel/boost-libs:extract \
${NONEXISTENT}:devel/websocketpp:extract
BUILD_DEPENDS= ${LOCALBASE}/include/websocketpp/client.hpp:devel/websocketpp
LIB_DEPENDS= libboost_python.so:devel/boost-python-libs \
libboost_system.so:devel/boost-libs \
libpcrecpp.so:devel/pcre \
libjsoncpp.so:devel/jsoncpp \
libgmp.so:math/gmp \
libuuid.so:misc/e2fsprogs-libuuid
RUN_DEPENDS= ${PYTHON_SITELIBDIR}/sympy/__init__.py:math/py-sympy@${PY_FLAVOR} \
${PYTHON_SITELIBDIR}/matplotlib/__init__.py:math/py-matplotlib@${PY_FLAVOR}
OPTIONS_DEFINE= GUI
OPTIONS_DEFAULT=GUI
USES= compiler:c++14-lang cmake gettext-runtime pkgconfig python:2 sqlite
USE_GITHUB= yes
GH_ACCOUNT= kpeeters
GUI_USE= GNOME=gtkmm30,gdkpixbuf2
USE_TEX= base texmf texhash
USE_LDCONFIG= yes
OPTIONS_SUB= yes
GUI_INSTALLS_ICONS= yes
GUI_USES= desktop-file-utils
CMAKE_ARGS+= -DBOOST_ROOT=${LOCALBASE}
CMAKE_ARGS+= -DUSE_PYTHON_3:BOOL=OFF
GUI_CMAKE_BOOL= FRONTEND
CXXFLAGS+= -I${LOCALBASE}/include
CXXFLAGS+= -I${LOCALBASE}/include/jsoncpp
LDFLAGS+= -L${LOCALBASE}/lib -ljsoncpp
CMAKE_CXX_FLAGS=${CXXFLAGS}
CMAKE_INSTALL_PREFIX=${PREFIX}
post-extract:
@${RM} -r ${WRKSRC}/client_server/jsoncpp ${WRKSRC}/client_server/websocketpp
pre-patch:
# workaround for https://github.com/zaphoyd/websocketpp/issues/563, so that the local patch can be applied
@${MKDIR} ${WRKSRC}/override/include/boost/asio/detail/impl
@${CP} `${MAKE} -C ${PORTSDIR}/devel/boost-libs -V WRKSRC`/boost/asio/detail/impl/socket_ops.ipp \
${WRKSRC}/override/include/boost/asio/detail/impl/
# workaround for https://github.com/zaphoyd/websocketpp/issues/587, so that the local patch can be applied
@${MKDIR} ${WRKSRC}/override/include/websocketpp/transport/asio
@${CP} `${MAKE} -C ${PORTSDIR}/devel/websocketpp -V WRKSRC`/websocketpp/transport/asio/endpoint.hpp \
${WRKSRC}/override/include/websocketpp/transport/asio/
post-patch:
@${REINPLACE_CMD} -e 's|execute|#execute|' \
-e 's|"$${GIT_COMMIT_SERIAL}.$${GIT_SHORT_SHA}"|"FreeBSD port version=${PORTVERSION} tag=${GH_TAGNAME}"|' \
-e 's|set(CADABRA_VERSION_DATE "$${THE_DATE}"|set(CADABRA_VERSION_DATE "'`date "+%Y-%m-%d"`'"|' \
-e 's|include_directories(|include_directories($${PROJECT_SOURCE_DIR}/override/include |' \
${WRKSRC}/CMakeLists.txt
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/cadabra2html
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/cadabra-server
${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/cadabra2.so
post-install-GUI-on:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/cadabra2-gtk
@${GZIP_CMD} < ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps/cadabra2-gtk.svg \
> ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps/cadabra2-gtk.svgz
@${RM} ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps/cadabra2-gtk.svg
@${LN} ${STAGEDIR}${PREFIX}/share/icons/hicolor/256x256/apps/cadabra2-gtk.png \
${STAGEDIR}${PREFIX}/share/icons/hicolor/256x256/apps/cadabra-gtk.png
@${LN} ${STAGEDIR}${PREFIX}/share/icons/hicolor/128x128/apps/cadabra2-gtk.png \
${STAGEDIR}${PREFIX}/share/icons/hicolor/128x128/apps/cadabra-gtk.png
@${LN} ${STAGEDIR}${PREFIX}/share/icons/hicolor/64x64/apps/cadabra2-gtk.png \
${STAGEDIR}${PREFIX}/share/icons/hicolor/64x64/apps/cadabra-gtk.png
@${LN} ${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps/cadabra2-gtk.svgz \
${STAGEDIR}${PREFIX}/share/icons/hicolor/scalable/apps/cadabra-gtk.svgz
.include <bsd.port.mk>