summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 32af8453a87c4960d4803fca037bc4d207649189 (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
# Maintainer: sachin <sachinsenal0x64@gmail.com>
# Github: https://github.com/sachinsenal0x64

pkgname='yaksha'
pkgver='0.0.8'
prev='vP20240414.f76ff03'
pkgrel='0'
pkgdesc='A Programming language with off-side rule syntax,and YakshaLisp sublanguage.'
arch=('x86_64')
url='https://github.com/YakshaLang/Yaksha'
license=('GPL-3.0')
provides=('yaksha')
conflicts=('yaksha')
source=("https://github.com/YakshaLang/Yaksha/releases/download/vP20240414.f76ff03/yaksha_vP20240414.f76ff03_linux-x86_64.tar.gz")
sha256sums=('67b22d12acb3adc6eaf3d3350154c9442032b873ffbd23a0de3154ec16472b78')
depends=('zig')

prepare() {
    tar -xzf "${srcdir}/yaksha_${prev}_linux-x86_64.tar.gz" -C "${srcdir}"
    local inner_folder=$(tar -tzf "${srcdir}/yaksha_${prev}_linux-x86_64.tar.gz" | grep -o '^[^/]*/' | uniq)
    if [ -d "${srcdir}/${inner_folder}" ]; then
        mv "${srcdir}/${inner_folder}"/* "${srcdir}/"  # Move contents to srcdir root
        rmdir "${srcdir}/${inner_folder}"  # Remove the now empty inner folder
    fi
}

build() {
    echo "Building Yaksha..."
    
    cd "${srcdir}"

  }

package() {

      echo "Installing binaries and libraries..."

         
      # Copy binaries and set execute permissions
      install -Dm755 bin/yaksha "${pkgdir}/usr/local/bin/yaksha"
      install -Dm755 bin/hammer "${pkgdir}/usr/local/bin/hammer"
      install -Dm755 bin/carpntr "${pkgdir}/usr/local/bin/carpntr"

      # Remove old directories if they exist and copy new ones
      if [ -d "${pkgdir}/usr/local/runtime" ]; then
          rm -rf "${pkgdir}/usr/local/runtime"
      fi
      cp -r runtime "${pkgdir}/usr/local/runtime"

      if [ -d "${pkgdir}/usr/local/libs" ]; then
          rm -rf "${pkgdir}/usr/local/libs"
      fi
      cp -r libs "${pkgdir}/usr/local/libs"

      if [ -d "${pkgdir}/usr/local/lib" ]; then
          rm -rf "${pkgdir}/usr/local/lib"
      fi
      cp -r bin/lib "${pkgdir}/usr/local/lib"

      if [ -d "${pkgdir}/usr/local/doc" ]; then
          rm -rf "${pkgdir}/usr/local/doc"
      fi
      cp -r bin/doc "${pkgdir}/usr/local/doc"   


      # Clean up: remove the extracted folder
      rm -rf "$srcdir"

      echo "Installation and test build complete. Done!"
    
}