summaryrefslogtreecommitdiff
path: root/libsavitar/PKGBUILD
blob: 62c6098e61bc8b0382dc143079f5d9c260c19a70 (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
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Jelle van der Waa <jelle@archlinux.org>
# Contributor: neodarz <neodarz@neodarz.net>

pkgname=libsavitar
pkgver=4.13.0
pkgrel=4
pkgdesc="C++ implementation of 3mf loading with SIP python bindings"
arch=('x86_64')
url="https://github.com/Ultimaker/libsavitar"
license=('AGPL')
_pinned_dependencies=(
  'gcc-libs=12.2.1'
  'glibc>=2.36'
  'pugixml=1.13'
)
depends=("${_pinned_dependencies[@]}")
makedepends=('cmake' 'python-sip4' 'sip4')
source=($pkgname-$pkgver.tar.gz::https://github.com/Ultimaker/libSavitar//archive/${pkgver}.tar.gz use_system_pugixml.patch)
sha512sums=('a446131c0bbcc34e55c093032af823b9750797f06297bea9fd4d64838e793811e71679a1f6ae99be9fc9382a23e8763140147c7a6eea0a310f6f2d40b53be3bf'
            'b312dcf43bf334001da98da93388da99731eacf417fe3a9dff51831bdd1f0ab5487377925bebce05e227533be2680b1a45f3203b0a7b9de9a77280a206ec7b26')

prepare() {
  cd "libSavitar-${pkgver}"
  sed -i 's,DESTINATION lib/python${PYTHON_VERSION_MAJOR}/dist-packages,DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages,g' CMakeLists.txt
  sed -i 's,DESTINATION lib/python${PYTHON_VERSION_MAJOR}/dist-packages/cura),DESTINATION lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/cura),g' CMakeLists.txt

  # don't install a second system pugixml; WONTFIX upstream due to:
  # "It's been decided that an external dependency makes setting up your
  # development environment for Cura needlessly difficult."
  patch -Np1 -i "$srcdir"/use_system_pugixml.patch
}

build() {
  cd "libSavitar-${pkgver}"
  mkdir  build && cd build
  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DCMAKE_BUILD_TYPE=Release
  make
}

package() {
  cd "libSavitar-${pkgver}/build"
  make DESTDIR="${pkgdir}" install
}