File ghdl.spec of Package ghdl

#global commit0 8185ed878df5054a9624af97ae4c73bbd3e906ef
%global shortcommit0 %(c=%{commit0}; echo ${c:0:7})
#global date0 20220228
%global sover 4_1_0

Name:           ghdl
Version:        4.1.0
Release:        0
Summary:        VHDL 2008/93/87 simulator
License:        GPL-2.0-or-later
URL:            https://github.com/ghdl/ghdl
Source0: https://github.com/ghdl/ghdl/archive/refs/tags/v4.1.0.tar.gz#/ghdl-4.1.0.tar.gz

BuildRequires:  gcc-ada
BuildRequires:  zlib-devel

%description
GHDL is an open-source analyzer, compiler, simulator and (experimental)
synthesizer for VHDL, a Hardware Description Language (HDL).
GHDL is not an interpreter: it allows you to analyse and elaborate sources to 
generate machine code from your design. Native program execution is the only
way for high speed simulation.

%package -n libghdl-%{sover}
Summary: GHDL runtime library

%description -n libghdl-%{sover}
This package contains the libraries required by GHDL programs.

%package -n libghdlvpi
Summary: GHDL VPI/VHPI implementation

%description -n libghdlvpi
This package contains the PLI/VPI and VHPI implementations.

%package ghwdump
Summary: GHDL waveform dumper/manipulation tool

%description ghwdump
This package contains the ghwdump tool for dumping waveforms and
corresponding library.

%package devel
Summary: GHDL development files
Requires: libghdl-%{sover}

%description devel
This package contains the development files for GHDL programs.

%prep
%autosetup -p1

%build
# Fixes for when %%_libdir is not "lib"
sed -e "s/^libdirsuffix=lib\/ghdl/libdirsuffix=%{_lib}\/ghdl/" -i configure
sed -e "s/\"lib\"/\"%{_lib}\"/" -i src/ghdldrv/ghdlsynth.adb
mkdir lib
# Using gnatbind -shared so that we always link with shared libgnat.so and avoid PIC/PIE problems
./configure --prefix=%{_prefix} --default-pic --disable-werror --enable-libghdl --enable-synth
%make_build GNAT_BARGS="-bargs -E -shared" libdir=%{_libdir}

%install
%make_install GNAT_BARGS="-bargs -E -shared" libdir=%{_libdir}
mkdir -p %buildroot%{_libexecdir}
mv %buildroot/usr/lib/ghdl %buildroot%{_libexecdir}/ghdl || :

%files
%license COPYING.md
%doc README.md
%{_bindir}/ghdl
%{_libexecdir}/ghdl

%files -n libghdl-%{sover}
%{_libdir}/libghdl-4*.so

%files -n libghdlvpi
%{_libdir}/libghdlvpi.so

%files ghwdump
%{_bindir}/ghwdump
%{_libdir}/libghw.so

%files devel
%{_includedir}/ghdl
%{_libdir}/libghdl.a
%{_libdir}/libghdl.link

%changelog

openSUSE Build Service is sponsored by