# Description: Small utilities that use the /proc filesystem
# URL: http://psmisc.sourceforge.net/
# Maintainer: CRUX System Team, core-ports at crux dot nu
# Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
# Depends on: ncurses

name=psmisc
version=23.1
release=1
source=(http://downloads.sourceforge.net/project/$name/$name/$name-$version.tar.xz
        fuseropts.patch)

build() {
  cd $name-$version

  cat > config.cache << EOF
ac_cv_func_malloc_0_nonnull=yes
ac_cv_func_realloc_0_nonnull=yes
EOF

  # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=740275
#  patch -p1 -i $SRC/fuseropts.patch

  ./configure --build=$CHOST \
              --host=$CTARGET \
              --prefix=/usr \
              --disable-nls \
              --cache-file=config.cache
  
  make
  make DESTDIR=$PKG install
  rm -f $PKG/usr/bin/pstree.x11
}