[Pkg-electronics-devel] Bug#930890: ghdl: Debian ghdl.wrapper prevents build when GHDL is not already installed.

Pavel Pisa pisa at cmp.felk.cvut.cz
Fri Jun 21 23:26:36 BST 2019


Source: ghdl
Version: 0.36+20190617
Severity: serious
Tags: ftbfs
Justification: fails to build from source (but built successfully in the past)

When Debianized GHDL package is build it fails with message

  Error: No installed ghdl backend found. Terminating!

in context

  install -m 755 -p libghdl-0_37_dev.so ../../debian/tmp/usr/lib/ghdl/mcode/
../../debian/tmp/usr/bin/ghdl --disp-standard --std=87 >
../../debian/tmp/usr/lib/ghdl/mcode/vhdl/src/std/standard.v87
  Error: No installed ghdl backend found. Terminating!
  make[2]: *** [Makefile:131: install] Error 2
  make[2]: Leaving directory '/home/user/repo/ghdl/ghdl-git/builddir/mcode'
  make[1]: *** [debian/rules:140: override_dh_auto_install] Error 2
  make[1]: Leaving directory '/home/user/repo/ghdl/ghdl-git'
  make: *** [debian/rules:54: binary] Error 2
  dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned
exit status 2

The reason for the problem is the file /debian/ghdl.wrapper which prevents
install when there is not already installed some "ghdl" package because
it ignores "ghdl-mcode" already redy to be run in "debian/tmp/usr/bin"
directory.

Extending of file to find executables in the wrapper directory
solves the problem

------------------------------------------------------------
#!/bin/sh
set -e

backend="$GHDL_BACKEND"

ghdl_bin_dir="$(cd "$(dirname "$0")" ; pwd)"

if [ ! -x "/usr/bin/ghdl-$backend" -a ! -x "$ghdl_bin_dir/ghdl-$backend" ];
then
        if [ -x "$ghdl_bin_dir/ghdl-mcode" ]; then
                backend=mcode
        elif [ -x "$ghdl_bin_dir/ghdl-gcc" ]; then
                backend=gcc
        elif [ -x "$ghdl_bin_dir/ghdl-llvm" ]; then
                backend=llvm
        elif [ -x /usr/bin/ghdl-mcode ]; then
                backend=mcode
        elif [ -x /usr/bin/ghdl-gcc ]; then
                backend=gcc
        elif [ -x /usr/bin/ghdl-llvm ]; then
                backend=llvm
        else
                echo >&2 "Error: No installed ghdl backend found. Terminating!"
                exit 2
        fi
fi

if [ -x "$ghdl_bin_dir/ghdl-$backend" ]; then
        exec "$ghdl_bin_dir/ghdl-$backend" "$@"
else
        exec "/usr/bin/ghdl-$backend" "$@"
fi
------------------------------------------------------------



-- System Information:
Debian Release: 10.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled



More information about the Pkg-electronics-devel mailing list