APP=kernel-source
VERSION=5.4.41
BUILD=1sml
REQUIRES="musl"
HOMEPAGE='https://www.kernel.org'
DESC="source code for the Linux kernel"
AARCHVERSION=5.4.51

build() {
  mkandenterbuilddir
  rm -rf linux-$VERSION

  tar xf $SRCDIR/linux-$VERSION.tar.?z*
  fixbuilddirpermissions

  if [ "$HOSTTYPE" = "x86_64" ] ; then
    zcat $SRCDIR/kernelconfig-huge-$VERSION.gz > linux-$VERSION/.config
    install -Dm 644 $SRCDIR/README $PKG/doc/$APP-$VERSION/README
  elif [ "$HOSTTYPE" = "aarch64" ] ; then
    zcat $SRCDIR/kernelconfig-$AARCHVERSION.gz > linux-$VERSION/.config
  fi

  mkdir -p $PKG/share
  cp -a linux-$VERSION $PKG/share/

  mkfinalpkg
}

SHA512SUMS="
711db80661f2e94fd4819991bd69ff7c3124832ffd6c17025bb82daf2177b82d6700454f7cc58f76c9f839fddf1316f49406af3c2572723b3455b2aac689f7a4  linux-5.4.41.tar.xz
"
