summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7d714ee796595d131038828ddf84258bf55febde (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
# Maintainer: MeaTLoTioN <ml@erb.pw>
pkgname=syncterm-src
pkgver=latest
pkgrel=1
pkgdesc="SyncTERM - A terminal for connecting to BBSes (built from source)"
arch=('x86_64')
url="https://syncterm.bbsdev.net/"
license=('GPL')
depends=('ncurses' 'glibc' 'sdl12-compat' 'sdl2')  # Runtime dependencies
makedepends=('wget' 'unzip' 'gcc' 'make' 'base-devel')  # Build dependencies
source=()  # Sources are fetched dynamically in build()
sha256sums=()  # No checksum validation for dynamic sources

build() {
    cd "$srcdir"

    # Download the source zip files
    echo "About to download the syncterm application source..."
    wget https://gitlab.synchro.net/main/sbbs/-/archive/master/sbbs-master.zip?path=3rdp -O 3rdp.zip
    wget https://gitlab.synchro.net/main/sbbs/-/archive/master/sbbs-master.zip?path=src -O src.zip

    # Extract the zip files
    echo "Extracting the source now..."
    for F in *.zip; do unzip -a "$F"; done

    # Organize the directory structure
    echo "Sorting directory structure..."
    for D in sbbs-master-*; do cp -r "$D"/* .; done
    rm -rf sbbs-master-*

    # Change directory to the source folder
    echo "Change into the 'make' folder"
    cd src/syncterm

    # To get full path src
    echo "Set st_path variable for the SRC_ROOT path..."
    st_path=${PWD%/*}
    
    # Time to compile!
    echo "Make SRC_ROOT with path: $st_path"
    make SRC_ROOT=$st_path
}

package() {
    cd "$srcdir/src/syncterm"

    # Find the newly built binary
    binary_file="$(find $srcdir -name syncterm|tail -1)"
    binary_file="$(echo "$binary_file"|sed 's|^\./||')"

    # Install the newly built binary
    install -Dm755 "${binary_file}" "$pkgdir/usr/bin/syncterm"    # Install the compiled binary
}