# Maintainer: PktSurf <smlinux@pktsurf.in>
app=ccache
version=3.7.9
build=2sml
homepage="https://ccache.dev/"
download="https://github.com/ccache/ccache/releases/download/v$version/ccache-$version.tar.xz"
desc="Compiler cache to speed up re-compilation of C/C++ code by caching previous compiles"
requires="musl"

prepbuilddir() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions
}

build() {
  LDFLAGS="-static" \
  ./configure \
    --prefix=

  make
  make install DESTDIR=$pkg

  cp GPL* $pkgdocs/

  # Make some necessary symlinks
  mkdir -p $pkg/lib/ccache
  (
    cd $pkg/lib/ccache
    ln -sf ../../bin/ccache gcc
    ln -sf ../../bin/ccache g++
    ln -sf ../../bin/ccache cc
    ln -sf ../../bin/ccache c++
  )

  mkfinalpkg
}

sha512sums="
0944846a6543947251e500576dd69f0b88d69c9a7535de5be8d6a17505489d8ec658bac8a71b8a8c70f341e3e174968e99ebfaadfd1e64b2e791f4d567b1a0c9  ccache-3.7.9.tar.lz
"
