#!/bin/sh

#shellcheck disable=SC2034
#shellcheck disable=SC2154
#shellcheck disable=SC2086

#ebs.formulae
ebsver=1

pkgname=binutils
pkgver=2.47
pkgsrc=https://ftp.gnu.org/gnu/binutils/binutils-$pkgver.tar.xz
pkgchecksum=sha256:154ab23b60070e8f27013c22977f1129425d67d1e8acd6e13010e617811e4cff
pkgdesc="GNU collection of binary tools"
pkgmaintainer="juanvel400 <me@juanvel400.com>"
pkglicense="GPL-3.0-or-later"
pkghomepage="https://www.gnu.org/software/binutils"
pkgcheck=true
pkgdeps="musl,zlib"

build() {
    mkdir build
    cd build || return 1

    ../configure ${CONFIGUREFLAGS:-} --prefix=/usr --disable-rpath --enable-year2038 --with-system-zlib
    make
}

check() {
    make check
}

package() {
    "${1:-fakeroot}" make install DESTDIR="$pkgdir"
}
