Name duktape
Description Embeddable Javascript engine
Version 2.7.0-7
Package Base duktape
Homepage https://duktape.org/
Maintainers ['Alexander F. Rødseth <xyproto@archlinux.org>', 'T.J. Townsend <blakkheim@archlinux.org>']
Contributors ['Jan Alexander Steffens (heftig) <heftig@archlinux.org>']
Distro-repo https://gitlab.archlinux.org/archlinux/packaging/packages/duktape
Sources ['https://duktape.org/duktape-2.7.0.tar.xz']
Dependencies ['glibc']
Optional-Dependencies []
Build-Dependencies []
Provides ['libduktape.so', 'libduktaped.so']
Builddate 12-07-2024 06:47:47
Architecture x86_64
Distro-Version
Licenses ['MIT']
Hash 92452979e8cc6f34558ee4d9c3f34f8b7e0d7a8ebff94296b68c7926f00895cd
# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=duktape
pkgver=2.7.0
pkgrel=7
pkgdesc='Embeddable Javascript engine'
url='https://duktape.org/'
arch=(x86_64)
license=(MIT)
depends=(
  glibc
)
provides=(libduktape{,d}.so)
source=("https://duktape.org/duktape-$pkgver.tar.xz")
b2sums=('da5eea88758201177f32c5611a3757433ef1b0173d6430eff1f067abd7535f3e4b9c3717290fbd8475827a53f7a2a74818287a65e563f14e91761f5cd0fe30d5')

# https://duktape.org/download.html
md5sums=('b3200b02ab80125b694bae887d7c1ca6')

prepare() {
  cd duktape-$pkgver

  # tools/configure.py needs Python 2
  sed -i 's/^#undef DUK_USE_FASTINT$/#define DUK_USE_FASTINT/' src/duk_config.h

  # Add missing NEEDED on libm.so
  sed -i 's/duktape\.c/& -lm/' Makefile.sharedlibrary
}

_make() (
  local make_options=(
    -f Makefile.sharedlibrary
    INSTALL_PREFIX=/usr
  )

  make "${make_options[@]}" "$@"
)

build() {
  cd duktape-$pkgver
  _make
}

package() {
  cd duktape-$pkgver
  _make DESTDIR="$pkgdir" install
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 LICENSE.txt
}

# getver: github.com/svaarala/duktape