community/psmisc: fix build for ppc64le

9f4395581c
This commit is contained in:
Leonardo Arena 2017-04-07 15:02:16 +00:00
parent 865fdb4dd3
commit 3c80ffcde3
3 changed files with 96 additions and 8 deletions

View File

@ -1,17 +1,25 @@
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=psmisc
pkgver=22.21
pkgrel=1
pkgrel=2
pkgdesc="A set of some small useful utilities that use the proc filesystem"
url="http://psmisc.sourceforge.net/"
arch="all !ppc64le" #does not build yet for ppc64le
arch="all"
license="BSD GPL"
depends=""
makedepends="ncurses-dev"
subpackages="$pkgname-doc"
source="http://downloads.sourceforge.net/psmisc/$pkgname-$pkgver.tar.gz"
makedepends="gettext-dev libintl ncurses-dev"
subpackages="$pkgname-doc $pkgname-lang"
source="http://downloads.sourceforge.net/psmisc/$pkgname-$pkgver.tar.gz
include_limits.patch
peekfd_lintl.patch
"
builddir="$srcdir/$pkgname-$pkgver"
prepare() {
cd "$builddir"
default_prepare
}
build() {
cd "$builddir"
./configure --prefix=/usr \
@ -27,6 +35,11 @@ package() {
make DESTDIR="$pkgdir" install || return 1
}
md5sums="935c0fd6eb208288262b385fa656f1bf psmisc-22.21.tar.gz"
sha256sums="97323cad619210845b696d7d722c383852b2acb5c49b5b0852c4f29c77a8145a psmisc-22.21.tar.gz"
sha512sums="766aeb45687090b88b17176c5117a603e83fe92a13c013aea72c8ee80048adf02e18c7daa52ddfb8b2135f7c9a1bcae38896cdfb8d0158728d85a446c5e0d5ae psmisc-22.21.tar.gz"
check() {
cd "$builddir"
make check
}
sha512sums="766aeb45687090b88b17176c5117a603e83fe92a13c013aea72c8ee80048adf02e18c7daa52ddfb8b2135f7c9a1bcae38896cdfb8d0158728d85a446c5e0d5ae psmisc-22.21.tar.gz
63dea6a65c4cabcfa06d225950bc78fd6ac42f7445b8d10bde5e86dd8d96eb89823e486d7635b78562da058642f87289356c416225563a8e1ccfc2e32d81e884 include_limits.patch
ec84b84a02e48aed9f47a9efdd7ee4a4d409373751e9872e32c06912b506d9102a0526f244dcaff172598cd77e61344d38449a60181c2bbb010a674662e8f439 peekfd_lintl.patch"

View File

@ -0,0 +1,45 @@
Author: Breno Leitao <brenohl@br.ibm.com>
Date: Thu Apr 6 13:59:57 2017 -0300
peekfd: Include headers for ppc64
Currently peekfd fails to build on ppc64le architecture with musl
because it does not find reference for __WORDSIZE.
This patch just includes reference for this macro if it was not
previously defined.
Index: psmisc-22.21/src/peekfd.c
===================================================================
--- psmisc-22.21.orig/src/peekfd.c
+++ psmisc-22.21/src/peekfd.c
@@ -37,6 +37,14 @@
#include "i18n.h"
+#if !defined(PATH_MAX)
+#include <limits.h>
+#endif
+
+#if !defined(__WORDSIZE)
+#include <bits/reg.h>
+#endif
+
#ifdef I386
#define REG_ORIG_ACCUM orig_eax
#define REG_ACCUM eax
Index: psmisc-22.21/src/pstree.c
===================================================================
--- psmisc-22.21.orig/src/pstree.c
+++ psmisc-22.21/src/pstree.c
@@ -45,6 +45,10 @@
#include "i18n.h"
#include "comm.h"
+#if !defined(PATH_MAX)
+#include <limits.h>
+#endif
+
#ifdef WITH_SELINUX
#include <selinux/selinux.h>
#else

View File

@ -0,0 +1,30 @@
Author: Breno Leitao <brenohl@br.ibm.com>
Date: Thu Apr 6 14:03:00 2017 -0300
pstree: Linking with libintl.
Curently pstree does built, at least on ppc64le, because it does
not have a explicit link against gettext, causing the following error:
peekfd.o: In function `print_version':
peekfd.c:(.text+0x160): undefined reference to `libintl_gettext'
peekfd.c:(.text+0x18c): undefined reference to `libintl_gettext'
peekfd.c:(.text+0x1ac): undefined reference to `libintl_gettext'
peekfd depends on libint because of the following macro:
#define _(String) gettext (String)
Index: psmisc-22.21/src/Makefile.in
===================================================================
--- psmisc-22.21.orig/src/Makefile.in
+++ psmisc-22.21/src/Makefile.in
@@ -131,7 +131,7 @@ killall_OBJECTS = $(am_killall_OBJECTS)
killall_DEPENDENCIES =
am_peekfd_OBJECTS = peekfd.$(OBJEXT)
peekfd_OBJECTS = $(am_peekfd_OBJECTS)
-peekfd_LDADD = $(LDADD)
+peekfd_LDADD = $(LDADD) -lintl
am_prtstat_OBJECTS = prtstat.$(OBJEXT)
prtstat_OBJECTS = $(am_prtstat_OBJECTS)
prtstat_DEPENDENCIES =