aboutsummaryrefslogtreecommitdiffstats
path: root/cad/freecad/Makefile
blob: 5474b9d063eb85e6760f710a4cd0ddb80fa3ec34 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# $FreeBSD$

PORTNAME=   FreeCAD
DISTVERSION=    0.17-13541 # git rev-list --count
DISTVERSIONSUFFIX=  -g9948ee4f1
PORTREVISION=   6
CATEGORIES= cad

MAINTAINER= cmt@FreeBSD.org
COMMENT=    General purpose 3D CAD modeller

LICENSE=    LGPL20+
LICENSE_FILE=   ${WRKSRC}/COPYING

BUILD_DEPENDS=  pyside2-rcc:devel/pyside2-tools \
        swig3.0:devel/swig30
LIB_DEPENDS=    libexpat.so:textproc/expat2 \
        libfreetype.so:print/freetype2 \
        ${PY_BOOST} \
        libpyside2-${PYTHON_VERSION}.so:devel/pyside2@${PY_FLAVOR} \
        libCoin.so:graphics/Coin \
        libpng.so:graphics/png \
        libtiff.so:graphics/tiff \
        libvtkFiltersTexture-6.2.so:math/vtk6 \
        libTKernel.so:cad/opencascade \
        libxerces-c.so:textproc/xerces-c3 \
        libboost_thread.so:devel/boost-libs \
        libarea.so:devel/libarea \
        libmed.so:french/med \
        libshiboken2-${PYTHON_VERSION}.so:devel/shiboken2@${PY_FLAVOR} \
        libhdf5.so:science/hdf5
RUN_DEPENDS=    pivy-devel>0:graphics/py-pivy-devel@${PY_FLAVOR}

USES=       dos2unix compiler:c++11-lib cmake gl eigen:3 fortran jpeg \
        python:2.7 localbase qt:5
USE_GITHUB= yes
USE_XORG=   ice sm x11 xext xt
USE_GL=     gl glu
USE_QT=     buildtools qmake_build core gui network opengl svg xml webkit widgets printsupport concurrent
USE_LDCONFIG=   yes

DOS2UNIX_GLOB=  *.txt *.h *.cpp *.py *.qss *.csv *.pov *.stp *.ui *.wrl *.WRL

# To be removed when french/med will be built against science/hdf5
LIB_DEPENDS+=   libhdf5-18.so:science/hdf5-18
CMAKE_ARGS+=    -DOCC_INCLUDE_DIR="${LOCALBASE}/include/OpenCASCADE" \
        -DHDF5_FOUND="TRUE" -DHDF5_VERSION="1.8.17"     \
        -DHDF5_INCLUDE_DIRS="${LOCALBASE}/include/hdf5-18"  \
        -DCMAKE_CXX_FLAGS="-I${LOCALBASE}/include/hdf5-18"  \
        -DCMAKE_C_FLAGS="-I${LOCALBASE}/include/hdf5-18"    \
        -DHDF5_LIBRARIES="-lhdf5-18" -DBUILD_QT5="ON"
CFLAGS+=    -I${LOCALBASE}/include/hdf5-18

CMAKE_INSTALL_PREFIX=   ${PREFIX}/${PORTNAME}

OPTIONS_DEFINE= COLLADA

COLLADA_DESC=       Install pycollada for Collada files import
COLLADA_RUN_DEPENDS=    ${PYTHON_PKGNAMEPREFIX}pycollada>0:graphics/py-pycollada@${PY_FLAVOR}

DESKTOP_ENTRIES=${PORTNAME} "" "${PREFIX}/FreeCAD/data/freecad.svg" \
        ${PORTNAME} "Graphics;Engineering;" false

post-patch:
    @${REINPLACE_CMD} -e '/sed/s,-i,& \\"\\",' \
        ${WRKSRC}/cMake/FindPySide*Tools.cmake
    @${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},' \
        ${WRKSRC}/src/Gui/CMakeLists.txt
    @${REINPLACE_CMD} -e '/self\.rev/s/Unknown/${DISTVERSION:C/.*-//}/' \
        ${WRKSRC}/src/Tools/SubWCRev.py

pre-configure:
    # To be removed when french/med will be built against science/hdf5
    @${REINPLACE_CMD} -e 's|find_package(HDF5 REQUIRED)|#find_package(HDF5 REQUIRED)|' \
        ${WRKSRC}/CMakeLists.txt
    @${REINPLACE_CMD} -e 's|<hdf5.h>|<hdf5-18/hdf5.h>|' \
        ${WRKSRC}/src/3rdParty/salomesmesh/inc/MED_Common.hxx

post-install:
    ${LN} -s ../${PORTNAME}/bin/FreeCAD ${STAGEDIR}${LOCALBASE}/bin/FreeCAD
    ${LN} -s ../${PORTNAME}/bin/FreeCADCmd ${STAGEDIR}${LOCALBASE}/bin/FreeCADCmd

.include <bsd.port.mk>