aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c28436a6c4936b6d0814f90da4f9aa50e92fe7fb (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
# Maintainer: shizhiex <shizhiex@gmail.com>

pkgname="orca-slicer"
pkgver=2.2.0
_tag='2.2.0'
pkgrel=1
pkgdesc="Orca Slicer is a fork of Bambu Studio. It was previously known as BambuStudio-SoftFever"
arch=('x86_64')
url="https://github.com/SoftFever/OrcaSlicer"
license=('AGPL3')
depends=('mesa' 'glu' 'cairo' 'gtk3' 'libsoup' 'webkit2gtk' 'gstreamer' 'openvdb' 'wayland' 'wayland-protocols' 'libxkbcommon' 'ttf-harmonyos-sans' 'gst-plugins-base')
makedepends=('cmake' 'extra-cmake-modules' 'git' 'm4' 'pkgconf')
provides=("orca-slicer")
conflicts=("orca-slicer")
source=(
  "https://github.com/SoftFever/OrcaSlicer/archive/refs/tags/v${_tag}.tar.gz"
  "https://raw.githubusercontent.com/SoftFever/OrcaSlicer/v${_tag}/deps/Boost/0001-Boost-fix.patch"
  'CMakeLists.txt.patch'
  'orca-slicer.sh'
  '0002-clipper.patch'
  )
sha256sums=('90d78d8bd60fb98a4e63708b70e53c3095fb61c16381d36d0063a6d7943a4ec7'
            'bb2662d0a4c58c43726ec98ef4acf201fcf98719c9bbfd207e2d6cdf695a2093'
            '01171a77d533584026f113092a6586e28c9d87e10117c0f81cb4357d11a29fb1'
            '8c958ecc5522fd00b9e4161e20de438265fd7f31abdbcc63d7e5d90596ff7a19'
            '2bc8019afc15a48759f239cbcea57112299c4253470bbdbbba424a7099b257bc')

prepare() {
  # link up directory
  ln -sf OrcaSlicer-${_tag} OrcaSlicer
  # add missing 0001-Boost-fix.patch
  cp 0001-Boost-fix.patch OrcaSlicer/deps/Boost
  patch -p0 < "$srcdir/CMakeLists.txt.patch"
  patch -p0 < "$srcdir/0002-clipper.patch"
}

build() {
  # deps
  cd "$srcdir/OrcaSlicer/deps"
  for dir in build deps; do
    test -d $dir || mkdir $dir
  done
  cd build
  if [ ! -f $srcdir/.deps_done ]; then
    cmake ../ -DDESTDIR="$srcdir/dep_linux" -DCMAKE_BUILD_TYPE=Release -DDEP_WX_GTK3=1 -DJPEG_VERSION=8
    # do not override -j from makepkg.conf
    make
  fi
  touch $srcdir/.deps_done

  # bins
  cd "$srcdir/OrcaSlicer"
  for dir in build install_dir; do
    test -d $dir || mkdir $dir
  done
  cd build
  cmake .. -DSLIC3R_FHS=1 -DSLIC3R_STATIC=ON -DSLIC3R_GTK=3 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="$srcdir/dep_linux/usr/local" -DCMAKE_INSTALL_PREFIX="$srcdir/install_dir"
  # do not override -j from makepkg.conf
  cmake --build . --target install --config Release
}

package() {
  echo "Entering directory $srcdir/install_dir/bin."
  install -d "$pkgdir/usr/bin"
  cd "$srcdir/install_dir/bin"
  install "orca-slicer" "$pkgdir/usr/bin/orca-slicer-bin"
  install "$srcdir/orca-slicer.sh" "$pkgdir/usr/bin/orca-slicer"

  echo "Entering directory $srcdir/OrcaSlicer/install_dir."
  cd "$srcdir/install_dir"
  find share -type f -exec install -D {} "$pkgdir/usr/{}" \;

  echo "Entering directory $srcdir/OrcaSlicer/doc."
  cd "$srcdir/OrcaSlicer/doc"
  install -D -t "$pkgdir/usr/share/doc/$pkgname" *.md
}