Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghdl: add split package #6688

Merged
merged 4 commits into from
Nov 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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