/
Portfile
139 lines (111 loc) · 5.53 KB
/
Portfile
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup cmake 1.1
PortGroup compilers 1.0
PortGroup github 1.0
PortGroup qt4 1.0
github.setup FreeCAD FreeCAD 0.18.4
revision 0
name freecad
categories cad
platforms darwin
maintainers {gmail.com:mark.brethen @mbrethen} {mps @Schamschula} openmaintainer
license LGPL-2+
description \
FreeCAD is a general purpose feature-based, parametric 3D modeler.
long_description \
FreeCAD is a general purpose feature-based, parametric 3D modeler for \
CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering \
and product design but also fits a wider range of uses in engineering, \
such as architecture or other engineering specialties. It is 100% Open \
Source (LGPL2+ license) and extremely modular, allowing for very \
advanced extension and customization.
homepage https://www.freecadweb.org
checksums rmd160 2fdb6bb247571e2ffaffaca1defb02ca0b2e1cc5 \
sha256 d2f10f861cbcc9d19b34f79cd1c96baca2f23174f232e834f64a7c4a74f5f1e7 \
size 219760632
depends_build-append port:doxygen
depends_lib-append port:boost \
port:Coin-framework \
port:eigen3 \
port:freetype \
port:opencascade \
port:py27-backports-functools_lru_cache \
port:py27-matplotlib \
port:py27-pivy \
port:py27-pyside \
port:py27-pyside-tools \
port:py27-shiboken \
port:SoQt \
port:swig \
port:swig-python \
port:xercesc3 \
port:zlib
depends_run port:qt4-mac-sqlite3-plugin
patchfiles cMake-FindCoin3D.cmake.diff \
patch-src-Main-MainPy.cpp.diff
# disable FreeCAD FEM module, as it requires hdf5 1.8.x
patchfiles-append patch-CMakeLists.txt.diff
post-patch {
reinplace "s|QLibraryInfo::location.*|QLatin1String\(\"${applications_dir}/Qt4/\"\);|" \
${worksrcpath}/src/Gui/Assistant.cpp
reinplace "s|/Applications|${applications_dir}|" \
${worksrcpath}/src/Mod/OpenSCAD/OpenSCADUtils.py
}
compilers.choose fc
compilers.setup require_fortran -g95
cmake.install_prefix ${prefix}/libexec/${name}
cmake.install_rpath ${cmake.install_prefix}/lib
configure.pre_args-replace \
-DCMAKE_INSTALL_NAME_DIR=${prefix}/lib \
-DCMAKE_INSTALL_NAME_DIR=${cmake.install_prefix}/lib
configure.args-append -DCMAKE_INSTALL_DATADIR=${prefix}/share/${name} \
-DCMAKE_INSTALL_DOCDIR=${prefix}/share/doc/${name} \
-DCMAKE_FRAMEWORK_PATH=${frameworks_dir} \
-DMACPORTS_PREFIX=${prefix} \
-DPYSIDEUIC4BINARY=${prefix}/bin/pyside-uic-2.7 \
-DPYSIDERCC4BINARY=${prefix}/bin/pyside-rcc-2.7
pre-configure {
# The c++ compiler is used for linking instead of fc.
# -L needs a path to a directory.
set libgfortran [exec ${configure.fc} --print-file-name libgfortran.a]
configure.ldflags-append "-L[file dirname ${libgfortran}]"
set python_prefix [exec ${prefix}/bin/python2.7-config --prefix]
configure.args-append -DBUILD_ROBOT=NO \
-DPYTHON_LIBRARY=${python_prefix}/Python \
-DPYTHON_INCLUDE_DIR=${python_prefix}/Headers \
-DPYTHON_EXECUTABLE=${python_prefix}/bin/python2.7 \
-DShiboken_DIR=${python_prefix}/lib/cmake/Shiboken-1.2.4 \
-DPySide_DIR=${python_prefix}/lib/cmake/PySide-1.2.4 \
-DOCE_DIR=${frameworks_dir}/OCE.framework/Versions/0.17/Resources
}
post-configure {
reinplace "s|sed -i|sed -i .orig|" \
${workpath}/build/src/Mod/Arch/CMakeFiles/Arch.dir/build.make \
${workpath}/build/src/Mod/Draft/CMakeFiles/Draft.dir/build.make \
${workpath}/build/src/Mod/Material/CMakeFiles/Material.dir/build.make \
${workpath}/build/src/Mod/OpenSCAD/CMakeFiles/OpenSCAD.dir/build.make \
${workpath}/build/src/Mod/Plot/CMakeFiles/Plot.dir/build.make \
${workpath}/build/src/Mod/Ship/CMakeFiles/Ship.dir/build.make \
${workpath}/build/src/Mod/Tux/CMakeFiles/Tux.dir/build.make
}
post-destroot {
# link the executables back
ln -s ${prefix}/libexec/${name}/MacOS/FreeCAD \
${destroot}${prefix}/bin
ln -s ${prefix}/libexec/${name}/MacOS/FreeCADCmd \
${destroot}${prefix}/bin
# create stub App
set appdir ${destroot}${applications_dir}/FreeCAD.app
xinstall -d ${appdir}/Contents/MacOS
xinstall -d ${appdir}/Contents/Resources
xinstall -m 644 ${filespath}/Info.plist ${appdir}/Contents/
xinstall -m 644 ${filespath}/FreeCAD.icns ${appdir}/Contents/Resources/
xinstall -m 755 ${filespath}/FreeCAD ${appdir}/Contents/MacOS
reinplace -W ${appdir}/Contents "s,@@VERSION@@,${version},g" Info.plist
reinplace -W ${appdir}/Contents/MacOS "s,@@PREFIX@@,${prefix},g" FreeCAD
}
variant oce description {use Community Edition version of Open CASCADE} {
depends_lib-replace port:opencascade port:oce
}
github.livecheck.regex {(\d\.\d+(\.\d+)?(?!_pre))}