-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6688 from eine/ghdl
ghdl: add split package
- Loading branch information
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |