### this file is sourced not run
PKGVER=0.188
PKGBUILD=1
PKGARCH=i686

# source: BLFS updated to LFS 11.3
TARBALL=elfutils-$PKGVER.tar.bz2
MD5SUM=efb25a91873b2eec4df9f31e6a4f4e5c
BUNDLE=fatdog-base-11.3.tar
SRC_URL=http://distro.ibiblio.org/fatdog/source/900/$BUNDLE
#SRC_URL=https://sourceware.org/ftp/elfutils/$PKGVER/$TARBALL

SLACKREQ=
SLACKDESC="libelf: libelf $PKGVER (extracted libraries from elfutils)  
libelf:  
libelf32: This package contains the libraries from elfutils. In particular, it 
libelf32: contains libelf.so, which is required by Radeon drivers for mesa.
libelf32: 
libelf32: This package contains 32-bit version of the library.
libelf32: 
libelf32: 
libelf32: 
libelf32: 
libelf32: 
"

### override download for LFS sources bundle
# $1-src-dir $2-tarball 
pkg_download() {
	echo downloading $BUNDLE for $TARBALL
	wget -P $1 $SRC_URL
	tar -xf $1/$BUNDLE --strip-components=1 -C $1 
	rm $1/$BUNDLE
}

### default pkg_prepare
### package - only collect the libraries
pkg_package() {
	rm -rf bin sbin usr/bin usr/sbin usr/include usr/share
}

### build
pkg_build() {
	CONFFLAGS="$CONFFLAGS            \
		--disable-debuginfod         \
		--enable-libdebuginfod=dummy \
		--program-prefix=eu-         \
	"

	# have to use this CFLAGS on gcc 12.2.0 to avoid build failure
	CFLAGS="$CFLAGS -Wno-error=use-after-free"

	pkg_build_autoconf && pkg_build_slackdesc
}


