Skip to content

Commit

Permalink
Merge pull request #6688 from eine/ghdl
Browse files Browse the repository at this point in the history
ghdl: add split package
  • Loading branch information
lazka authored Nov 20, 2020
2 parents ec29712 + 097dc1c commit b4b8903
Showing 1 changed file with 89 additions and 0 deletions.
89 changes: 89 additions & 0 deletions mingw-w64-ghdl/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
_realname=ghdl
pkgbase="mingw-w64-${_realname}"
pkgname='__placeholder__'
pkgver=0.37.0.r1063.gc5b094bb
pkgrel=1
pkgdesc='GHDL: the open-source analyzer, compiler, simulator and (experimental) synthesizer for VHDL (mingw-w64)'
arch=('any')
license=('GPL2+')
url='https://github.com/ghdl'
checkdepends=("${MINGW_PACKAGE_PREFIX}-python")
provides=("${MINGW_PACKAGE_PREFIX}-${_realname}")
makedepends=("${MINGW_PACKAGE_PREFIX}-clang" "${MINGW_PACKAGE_PREFIX}-gcc-ada")
_commit='c5b094bb'
source=("ghdl::git://github.com/ghdl/ghdl.git#commit=${_commit}")
sha512sums=('SKIP')

pkgver() {
cd "ghdl"
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g'
}

build() {
[[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH}
mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}

if [ "$CARCH" = "i686" ]; then
echo 'Configuring ghdl-mcode...'
../${_realname}/configure \
--prefix=${MINGW_PREFIX} \
--enable-checks \
--enable-libghdl \
--enable-synth \
LDFLAGS="-static"
fi

if [ "$CARCH" = "x86_64" ]; then
echo 'Configuring ghdl-llvm...'
../${_realname}/configure \
--prefix=${MINGW_PREFIX} \
--enable-checks \
--enable-libghdl \
--enable-synth \
--with-llvm-config="llvm-config --link-static" \
LDFLAGS="-static"
fi

make GNATMAKE="gnatmake -j$(nproc)"
}

check() {
cd "${srcdir}/build-${CARCH}"
make install.vpi.local
make test
}

_package() {
cd "${srcdir}"/build-${CARCH}
mkdir -p "${pkgdir}${MINGW_PREFIX}/lib"
make DESTDIR="${pkgdir}" install

# License
install -Dm644 ${srcdir}/${_realname}/doc/licenses.rst ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/licenses.rst
}

if [ "${CARCH}" = "x86_64" ]; then
pkgname=("${pkgbase}-llvm")

package() {
pkgdesc="$pkgdesc (LLVM backend) (mingw-w64)"
depends=(
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-clang"
"${MINGW_PACKAGE_PREFIX}-llvm"
)
options=(!emptydirs)

_package
}
fi
if [ "${CARCH}" = "i686" ]; then
pkgname=("${pkgbase}-mcode")

package() {
pkgdesc="$pkgdesc (mcode backend) (mingw-w64)"
depends=("${MINGW_PACKAGE_PREFIX}-zlib")

_package
}
fi

0 comments on commit b4b8903

Please sign in to comment.