# Maintainer: Nicola Squartini <tensor5@gmail.com>

pkgname=solidity
pkgver=0.8.7
_commit=e28d00a76daa0747f00ffe47cea17862bca55771
pkgrel=1
pkgdesc='Contract-Oriented Programming Language'
arch=('x86_64')
url='https://github.com/ethereum/solidity'
license=('GPL3')
depends=('cvc4' 'z3')
makedepends=('boost' 'cmake' 'git')
source=("git+https://github.com/ethereum/solidity.git#commit=${_commit}")
sha512sums=('SKIP')

prepare() {
    cd ${pkgname}

    commithash=$(git rev-parse --short=8 HEAD)
    echo -n ${commithash} > commit_hash.txt
    echo -n > prerelease.txt
}

build() {
    cd ${pkgname}

    mkdir build
    cd build
    cmake \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DTESTS=OFF \
        ..
    make
}

package() {
    cd ${pkgname}/build

    make DESTDIR="${pkgdir}" install
}
