summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eda43ffa70e8d1c2027edca8957636cd9be268b7 (plain)
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
# Maintainer: Salamandar <felix@piedallu.me>

pkgname=freecad-linkstage3-git
pkgver=asm3.0.11.r4461.ge6c5ae83e2
pkgrel=1
pkgdesc='A general purpose 3D CAD modeler - LinkStage3 dev branch, git checkout'
arch=('x86_64')
url='http://www.freecadweb.org/'
license=('LGPL')
conflicts=('freecad')
depends=(
    # Copied from Freecad package
    'boost-libs' 'curl' 'opencascade>=7.2' 'xerces-c' 'libspnav' 'glew' 'netcdf'
    'shared-mime-info' 'hicolor-icon-theme' 'jsoncpp' 'qt5-base' 'qt5-declarative'
    'qt5-svg' 'qt5-tools' 'qt5-x11extras' 'qt5-xmlpatterns' 'qt5-webkit' 'med' 'python-pivy'
    'python-pyside2' 'python-matplotlib' 'pyside2-tools' 'shiboken2'     
    # 'netgen-git'
    # 'pybind11'
    # 'calculix'
    # 'coin'
    # 'gmsh'
    # 'vtk'
    # 'python-shiboken2'

)
makedepends=(
    'cmake' 'ninja'
    'boost'
    'desktop-file-utils'
    'eigen'
    'gcc-fortran'
    'swig'
    'xerces-c'
    'coin'
)
optdepends=(
    'python-matplotlib' 'graphviz' 'openscad'
)
_gitname='FreeCAD'
source=(
    "git+https://github.com/realthunder/FreeCAD.git#branch=LinkStage3"
    'patch_std_gnupp14.patch'
)
sha256sums=(
    'SKIP'
    'd2a3a4c157741089c5ffbdd7c502be04414b8256081cd01208c94f2b0ed06ce3'
)


pkgver() {
    cd "${srcdir}/${_gitname}"
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/_//'
}

prepare() {
    cd "${srcdir}/${_gitname}"
    git apply < "$srcdir/patch_std_gnupp14.patch"
}

build() {
    cd "${srcdir}/${_gitname}"

    rm build -rf
    mkdir build -p
    pushd build >/dev/null

    # Those deprecation warnings make debugging a nightmare
    export CFLAGS="$CFLAGS -Wno-deprecated-declarations"
    export CXXFLAGS="$CXXFLAGS -Wno-deprecated-declarations"

    cmake -GNinja -Wno-dev .. \
        -DBUILD_QT5=ON \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_DATADIR='/usr/share/freecad' \
        -DCMAKE_INSTALL_DOCDIR='/usr/share/freecad/doc' \
        -DCMAKE_INSTALL_PREFIX='/usr/lib/freecad' \
        -DFREECAD_USE_OCC_VARIANT="Official Version" \
        -DFREECAD_USE_EXTERNAL_PIVY=ON \
        -DFREECAD_USE_QT_FILEDIALOG=ON \
        -DPYTHON_EXECUTABLE=/usr/bin/python

    ninja -j$(($(nproc)-1))
}

package() {
    pushd "${srcdir}/${_gitname}/build"
        DESTDIR="${pkgdir}" ninja install
    popd

    pushd "${pkgdir}"
        # Symlink to /usr/bin
        install -dm755 "usr/bin"
        ln -sf "/usr/lib/freecad/bin/FreeCAD"       "usr/bin/freecad"
        ln -sf "/usr/lib/freecad/bin/FreeCAD"       "usr/bin/FreeCAD"
        ln -sf "/usr/lib/freecad/bin/FreeCADCmd"    "usr/bin/freecadcmd"
        ln -sf "/usr/lib/freecad/bin/FreeCADCmd"    "usr/bin/FreeCADCmd"

        # Move data from /usr/lib/freecad/share to /usr/share
        mv "usr/lib/freecad/share/"{icons,pixmaps,mime,metainfo,applications,thumbnailers} \
            "usr/share"

        rmdir "usr/lib/freecad/share"
    popd
}