summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1f6df12dddee030574de01633a3ac97080797e0f (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: dakataca <馃惉danieldakataca@gmail.com>
# Contributor: Cristophero <cristophero.alvarado@gmail.com>

pkgname=pseint-bin
_pkgname=${pkgname%-*}
pkgver=20230517
pkgrel=1
pkgdesc='A tool for learning programming basis with a simple spanish pseudocode'
arch=('x86_64')
url='http://pseint.sourceforge.net'
license=('GPL2')
conflicts=("$_pkgname")
makedepends=('gendesk')
depends=('wxwidgets-gtk3' 'rsync')
noextract=(creator.psz)
source=("$_pkgname-$pkgver.tgz::https://cfhcable.dl.sourceforge.net/project/$_pkgname/$pkgver/$_pkgname-l64-$pkgver.tgz")
sha256sums=('1208bbf2247f0b5f89c0b6f85ee0ab9816a89c102a6d4ab7a041109b1425cb4d')  # 'makepkg -g' to generate it.


# Funci贸n 'prepare': Prepara el entorno antes de compilar el paquete.
prepare(){
    cd $_pkgname

    # Utilidad 'gendesk' para generar el archivo .desktop.
    gendesk -f -n \
        --pkgname="$_pkgname" \
        --pkgdesc="$pkgdesc" \
        --name="$_pkgname" \
        --genericname="$_pkgname" \
        --comment="$pkgdesc" \
        --exec="$_pkgname" \
        --path="/opt/$_pkgname" \
        --icon="$_pkgname" \
        --categories='Development,Education'
}


# Funci贸n 'pkgver': Devuelve la versi贸n del paquete.
pkgver(){
    cd $_pkgname
    cat version
}


# Funci贸n 'package': Empaqueta los archivos compilados en el paquete final.
package(){
    cd $_pkgname

    # Crear el directorio de destino y copiar en 茅l, el contenido de pseint-bin.
    rsync -a . --mkpath "$pkgdir/opt/$_pkgname/"

    # Instala el archivo .desktop en la ubicaci贸n (-t) adecuada.
    install -Dvm644 "$_pkgname.desktop" -t "$pkgdir/usr/share/applications"

    # Instalar icono de pseint-bin.
    install -Dvm644 "imgs/icon.icns" "$pkgdir/usr/share/pixmaps/$_pkgname.icns"

    # Crea un archivo ejecutable en la ubicaci贸n /usr/bin/$_pkgname que ejecuta el programa wxPSeInt(pseint).
    install -Dvm755 <(echo -e '#!/usr/bin/env bash\n/opt/pseint/wxPSeInt') $pkgdir/usr/bin/$_pkgname
}


## Test:
# rm -rf pseint-* src/ pkg/
# makepkg --printsrcinfo > .SRCINFO

## References
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=densify
# https://wiki.archlinux.org/title/Desktop_entries#How_to_use
# https://sourceforge.net/projects/pseint/files/
# https://sourceforge.net/projects/pseint/files/20210609/pseint-l64-20210609.tgz/download
# https://www.gnu.org/software/bash/manual/html_node/Process-Substitution.html