summaryrefslogblamecommitdiff
path: root/experimental/libffcall/APKBUILD
blob: f3bc87e30714598860317c7e8b969be6523c5fa4 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                                     
                                               
                 
          
        
                                                                                    

                                            
                  
          
              
                                       


                                                                  
 




























                                                                                                           





















                                                                    

                                                                                                                                                                  
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Contributor: Will Sinatra <wpsinatra@gmail.com>
# Maintainer: Lee Starnes <lee@canned-death.us>
pkgname=libffcall
pkgver=2.4
pkgrel=0
pkgdesc="C library for implementing foreign function calls in embedded interpreters"
url="https://www.gnu.org/software/libffcall"
arch="all"
license="GPL-2.0+"
depends=""
makedepends=""
subpackages="$pkgname-dev $pkgname-doc"
source="https://ftp.gnu.org/gnu/libffcall/libffcall-$pkgver.tar.gz
	ppc64.patch
	"

prepare() {
	default_prepare
	case "${CARCH}" in
		ppc64)
			# C sources are patched, bundled .S need to be regenerated;
			# recipes for *-powerpc64-elfv2-linux.S from Makefile.devel
			temp=$(mktemp)
			comm="-D__powerpc64__ -D__powerpc64_elfv2__ -O2 -fno-omit-frame-pointer -o ${temp}"
			nxst="../common/noexecstack.h"

			flag="${comm} -I.. -I../dummy"
			for k in avcall vacall; do
				cd ${k}
				gcc ${flag} -S ${k}-powerpc64.c
				cat ${temp} ${nxst} > ${k}-powerpc64-elfv2-linux.S
				cd -
			done

			flag="${comm} -I. -I../.. -I../../dummy -fPIC -DREENTRANT"
			cd callback/vacall_r
			gcc ${flag} -S ../../vacall/vacall-powerpc64.c
			cat ${temp} ../${nxst} > vacall-powerpc64-elfv2-linux.S
			cd -

			rm ${temp}
			;;
	esac
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	# Fails to build if building in parallel
	make -j1
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" htmldir=/usr/share/doc/ffcall install

}

sha512sums="c9451662764a888e3be21499c29673bfb0e1df4915814da3506db5d395a2b00ea2f0c08d1c9dffebf030179f9347794876ec6ec9e6710b4fc70fd760960335e6  libffcall-2.4.tar.gz
7360a5bdea23dec4a84f9653e96540dcccfcce1214899c421ad66760aeffa6223eb1a2d9011a1e0cddb1027b90242518e37c45b12625f8ff9a276e181db278d3  ppc64.patch"