Add PKGBUILD

This commit is contained in:
Maddie Busig 2025-05-11 13:01:42 -07:00
commit 52d41ecd2c
2 changed files with 78 additions and 0 deletions

56
PKGBUILD Normal file
View File

@ -0,0 +1,56 @@
# Maintainer: Madeline Busig <madeline.busig@outlook.com>
# Contributor: mickele
pkgname=tclreadline
pkgver=2.3.8
pkgrel=3
pkgdesc="GNU readline for interactive tcl shells"
url="https://github.com/flightaware/tclreadline"
arch=('x86_64' 'i686')
license=('BSD')
depends=('tcl' 'readline')
optdepends=()
makedepends=('git')
conflicts=()
replaces=()
backup=()
#install=''
source=(
"https://github.com/flightaware/${pkgname}/archive/v${pkgver}.tar.gz"
'tclreadline.c.diff'
)
noextract=('tclreadline.c.diff')
sha256sums=(
'a64e0faed5957b8e1ac16f179948e21cdd6d3b8313590b7ab049a3192ab864fb'
'SKIP'
)
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
autoreconf -ivf
patch 'tclreadline.c' "${srcdir}/tclreadline.c.diff"
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
# tk-existence seems to have no impact on build, but breaks configure otherwise
TKOPT=""
pkgconf tk || TKOPT="--without-tk"
./configure --prefix=/usr \
--with-tcl=/usr/lib \
--with-tcl-includes=/usr/include/tcl \
${TKOPT}
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
install -m644 -D -t "${pkgdir}/usr/share/doc/${pkgname}" "${srcdir}/${pkgname}-${pkgver}/"{COPYING,sample.tclshrc,SCENARIO}
}

22
tclreadline.c.diff Normal file
View File

@ -0,0 +1,22 @@
--- tclreadline.c.orig 2019-11-21 14:54:07.000000000 -0800
+++ tclreadline.c 2025-05-11 12:52:58.741636853 -0700
@@ -354,16 +354,16 @@
Tcl_WrongNumArgs(interp, 2, objv, "?boolean?");
return TCL_ERROR;
} else if (3 == objc) {
- int bool = tclrl_use_builtin_completer;
+ int boolval = tclrl_use_builtin_completer;
if (TCL_OK != Tcl_GetBoolean(interp,
Tcl_GetStringFromObj(objv[2], 0),
- &bool)) {
+ &boolval)) {
Tcl_AppendResult(interp,
"wrong # args: should be a boolean value.",
(char*) NULL);
return TCL_ERROR;
} else {
- tclrl_use_builtin_completer = bool;
+ tclrl_use_builtin_completer = boolval;
}
}
Tcl_AppendResult(interp, tclrl_use_builtin_completer ? "1" : "0",