summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5966598c90379703ab4add986c87720bf71f6ff3 (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
# Maintainer: RedCubeDev <someredcubedev@gmail.com>
pkgname='rctc'
pkgver=2.3.1.2100
pkgrel=7
pkgdesc="Commandline Compiler for the ReCT Programming language"
arch=('x86_64')
url="http://rect.ml/"
license=('GPL3')
depends=('dotnet-runtime-3.1')
makedepends=('git' 'dotnet-sdk-3.1')
source=("rctc::git://github.com/RedCubeDev-ByteSpace/ReCT.git")
md5sums=('SKIP')

pkgver() {
   cd "$pkgname"
   thever=$(git describe --tags)
   cutver=${thever%%-*}
   echo "$cutver"
}

package() {
	# getting the source of the lastest release
   cd "$pkgname"
   git checkout ${pkgver}
   
   # building the lastest release of rctc
   cd "rctc"
   export DOTNET_CLI_HOME="/tmp"
   dotnet build -c Release

   # install compiled binary
   cd "bin/Release/netcoreapp3.1/"
   mkdir -p "$pkgdir/usr/bin/rect"
   mkdir -p "$pkgdir/usr/bin/rect/Packages"
   mkdir -p "$pkgdir/usr/bin/rect/System Dotnet Assemblies"
   install -Dm755 ./rctc ./rctc.dll ./rctc.runtimeconfig.json ./ReCT.dll "$pkgdir/usr/bin/rect"
   install -Dm755 ./Json.Net.dll ./Mono.Cecil.dll ./Mono.Options.dll ./Mono.Cecil.Rocks.dll "$pkgdir/usr/bin/rect"

   # building all system packages
   cd ../../../..
   cd "System Libs"
   syspacks=( "sys" "math" "io" "net" "web" "audio" )

   for i in "${syspacks[@]}"
   do
      cd "${i}lib"
      printf "\033[0;32m======> BUILDING '$i'\033[0m\n"
      dotnet build -c Release
      cd "./bin/Release/netcoreapp3.1/"
      mv "./${i}lib.dll" "./ReCT.${i}.pack"
      install -Dm755 "./ReCT.${i}.pack" "$pkgdir/usr/bin/rect/Packages"
      cd ../../../..
   done

   cd ..
   cd "./System Dotnet Assemblies"
   install -Dm755 ./System.Console.dll ./System.IO.FileSystem.dll ./System.Net.Sockets.dll ./System.Runtime.Extensions.dll ./System.Runtime.dll ./System.Threading.Thread.dll ./System.Threading.dll "$pkgdir/usr/bin/rect/System Dotnet Assemblies"

   ln -sf "/usr/bin/rect/rctc" "$pkgdir/usr/bin/rctc"
}