summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2162ca66812658349291ca45bf7fa9e4be06d7c7 (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
# Maintainer: Fabio 'Lolix' Loli <fabio.loli@disroot.org> -> https://github.com/FabioLolix
# Contributor: Gonçalo Pereira
# Contributor: Jason Kercher <jkercher43 a gmail>
# Contributor: Peter Ivanov <ivanovp@gmail.com>
# Contributor: Alec Ari <neotheuser@ymail.com>

pkgname=linuxcnc
pkgver=2.9.3
pkgrel=3
pkgdesc="Controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more (formerly EMC2)"
arch=(x86_64)
license=(GPL2 'custom: unredestributable')
url="https://linuxcnc.org/"
depends=(glibc python gtk3 libusb libxss python-cairo gobject-introspection-runtime dbus-python python-pillow libxmu
         python-gobject tk python-matplotlib boost-libs python-numpy gstreamer at-spi2-core libepoxy libtirpc libxft
         harfbuzz gcc-libs fontconfig gdk-pixbuf2 libxext librsvg glib2 zlib cairo readline systemd-libs freetype2
         libx11 libxinerama python-configobj libgpiod python-yapps2 tcl pango bwidget)
makedepends=(intltool boost asciidoc glu procps-ng psmisc tclx)
options=(!emptydirs !strip)
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/LinuxCNC/linuxcnc/archive/refs/tags/v${pkgver}.tar.gz"
        'unredestributable.txt'
        'libtirpc.patch')
sha256sums=('061d78ad404492fe80fbc013dfd3138c9a31d0c8e38e0a4e4eaa36d40efce816'
            '228a035c143ccbdd6056e1189267b034f046742cae034bff821eccc8dbc68ee3'
            'bc95bafd67fad1c1d3722261bc586cdc612ec9e1597fadb95fa825c10550ac2c')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}/src"
  echo "[[ ":\$TCLLIBPATH:" != *":/usr/lib/tcltk/linuxcnc:"* ]] && export TCLLIBPATH="/usr/lib/tcltk/linuxcnc:\$TCLLIBPATH"" > ${pkgname}.sh
  find . -iname fixpaths.py -o -iname checkglade -o \
   -iname update_ini | xargs perl -p -i -e "s/python/python2/"
  patch -Np2 -i $srcdir/libtirpc.patch

  ./autogen.sh

  ./configure \
    --prefix=/usr \
    --enable-non-distributable=yes \
    --with-realtime=uspace \
    --without-libmodbus \
    --disable-gtk2

  # Linking time errors fix
  #sed -i "163s|FileName|FileNameArr|" hal/classicladder/files_project.c
  #sed -i "174s|FileName|FileNameArr|g" hal/classicladder/files_project.c
  #sed -i "175s|FileName|FileNameArr|" hal/classicladder/files_project.c
}

build () {
  cd "${srcdir}/${pkgname}-${pkgver}/src"
  make
}

package() {
  install -Dm644 unredestributable.txt   -t "${pkgdir}"/usr/share/licenses/${pkgname}/
  install -Dm644 "${pkgname}-${pkgver}/src/linuxcnc.sh" -t "${pkgdir}"/etc/profile.d/

  cd "${pkgname}-${pkgver}/src"
  install -Dm644 ../share/menus/CNC.menu -t "${pkgdir}"/etc/xdg/menus/

  DESTDIR="${pkgdir}" make install

  #sed -i "s|${srcdir}||" "${pkgdir}/usr/include/linuxcnc/config.h"
  #sed -i "s|${srcdir}||" "${pkgdir}/usr/share/linuxcnc/Makefile.modinc"


  #cd "${srcdir}/${pkgname}-${pkgver}/src"
  #DESTDIR=${pkgdir} make install
  #cp -PR "${srcdir}/${pkgname}-${pkgver}/share/applications" $pkgdir/usr/share
  #mkdir -p "${pkgdir}/etc/xdg"
  #cp -PR "${srcdir}/${pkgname}-${pkgver}/share/menus" "${pkgdir}/etc/xdg/"
  #install -Dm755 "${srcdir}/${pkgname}-${pkgver}/src/${pkgname}.sh" "${pkgdir}/etc/profile.d/${pkgname}.sh"
  #sed -i "s|${srcdir}||" "${pkgdir}/usr/include/linuxcnc/config.h"
  #sed -i "s|${srcdir}||" "${pkgdir}/usr/share/linuxcnc/Makefile.modinc"
  #install -Dm644 "${srcdir}/${pkgname}-${pkgver}/src/linuxcnc.sh" -t "${pkgdir}/etc/profile.d/"
  #install -D -t "${pkgdir}/usr/share/licenses/${pkgname}" "${srcdir}/unredestributable.txt"
}