2014-07-18 17:50:02 +02:00
|
|
|
# Template file for 'ksh'
|
|
|
|
pkgname=ksh
|
|
|
|
version=2012.08.01
|
2015-05-23 21:42:48 +02:00
|
|
|
revision=4
|
2015-08-31 13:45:53 +02:00
|
|
|
_debpkgver=93u+20120801
|
2014-07-18 17:50:02 +02:00
|
|
|
wrksrc=${pkgname}-${_debpkgver}
|
|
|
|
register_shell="/bin/ksh"
|
|
|
|
short_desc="AT&T's Korn shell (ksh93)"
|
|
|
|
maintainer="Christian Neukirchen <chneukirchen@gmail.com>"
|
|
|
|
license="custom"
|
|
|
|
homepage="http://www.kornshell.com/"
|
|
|
|
distfiles="${DEBIAN_SITE}/main/k/ksh/ksh_${_debpkgver}.orig.tar.gz"
|
|
|
|
checksum=052d598df7ed3cbd0fdf458b796262b0b59f4cd3305d970be1cc2287408dbfc9
|
2015-05-23 21:33:14 +02:00
|
|
|
nocross=yes
|
2014-07-18 17:50:02 +02:00
|
|
|
|
|
|
|
build_options="static"
|
|
|
|
|
2015-05-23 21:33:14 +02:00
|
|
|
case "$XBPS_TARGET_MACHINE" in
|
|
|
|
*-musl)
|
2015-05-23 21:42:48 +02:00
|
|
|
CFLAGS='-D_GNU_SOURCE'
|
2015-05-23 21:33:14 +02:00
|
|
|
post_extract() {
|
|
|
|
# Don't rewrite xxx64 to xxx.
|
|
|
|
sed -i '/define.*off_t/d' src/lib/libast/include/ast_std.h
|
|
|
|
sed -i '/off_t/d' src/lib/libast/features/fs
|
|
|
|
sed -i '/define statvfs/d' src/lib/libast/features/fs
|
|
|
|
sed -i '/define.*64/d' src/cmd/ksh93/include/shell.h
|
|
|
|
|
|
|
|
# Don't let <stdio.h> define FILE.
|
|
|
|
sed -i '/include.*_nxt_wchar/i#define __DEFINED_FILE' \
|
|
|
|
src/lib/libast/features/wchar
|
|
|
|
sed -i '/define FILE/a#define __DEFINED_FILE' src/lib/libast/include/ast.h
|
|
|
|
|
|
|
|
# Redefine iswalpha.
|
|
|
|
sed -i 's/#define iswalpha(w)\(.*\)/static __inline__ int isalphaw(wint_t w) { return \1; }/' src/lib/libast/features/wctype
|
|
|
|
}
|
|
|
|
esac
|
|
|
|
|
2014-07-18 17:50:02 +02:00
|
|
|
do_build() {
|
|
|
|
if [ "$build_option_static" ]; then
|
|
|
|
LDFLAGS+=" -static"
|
2014-11-23 15:04:50 +01:00
|
|
|
fi
|
2015-05-23 21:33:14 +02:00
|
|
|
export SHELL=/bin/sh # bin/package breaks on bash
|
|
|
|
$SHELL bin/package make \
|
|
|
|
CC="${CC}" LDFLAGS="${LDFLAGS}" \
|
2015-05-23 21:42:48 +02:00
|
|
|
CFLAGS="${CFLAGS}" CCFLAGS="${CFLAGS}" \
|
2015-05-23 21:33:14 +02:00
|
|
|
HOSTTYPE="$($SHELL bin/package host canon $XBPS_CROSS_TRIPLET)"
|
2014-07-18 17:50:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
2014-08-21 18:07:02 +02:00
|
|
|
cd arch/*/
|
2014-07-18 17:50:02 +02:00
|
|
|
vbin bin/ksh
|
|
|
|
ln -s ksh ${DESTDIR}/usr/bin/ksh93
|
|
|
|
vbin bin/shcomp
|
|
|
|
vmkdir usr/share/ksh
|
|
|
|
vcopy fun usr/share/ksh/functions
|
|
|
|
vman man/man1/sh.1 ksh.1
|
|
|
|
vlicense ${FILESDIR}/LICENSE
|
|
|
|
}
|