commit:     f7b3da5b1de23c8774708b9c88bbafcab19032da
Author:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 27 01:45:39 2022 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Sun Mar 27 01:46:25 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7b3da5b

dev-scheme/bigloo: fix exe install and Emacs sitefile

Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 ...loo-4.4c_p4.ebuild => bigloo-4.4c_p4-r1.ebuild} | 25 +++++++++++++++++++---
 dev-scheme/bigloo/files/50bigloo-gentoo.el         |  1 +
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/dev-scheme/bigloo/bigloo-4.4c_p4.ebuild 
b/dev-scheme/bigloo/bigloo-4.4c_p4-r1.ebuild
similarity index 81%
rename from dev-scheme/bigloo/bigloo-4.4c_p4.ebuild
rename to dev-scheme/bigloo/bigloo-4.4c_p4-r1.ebuild
index 967319442401..e0bff03017b4 100644
--- a/dev-scheme/bigloo/bigloo-4.4c_p4.ebuild
+++ b/dev-scheme/bigloo/bigloo-4.4c_p4-r1.ebuild
@@ -67,7 +67,7 @@ src_configure() {
                --ldflags="${LDFLAGS}"
                # Installation directories
                --prefix=/usr
-               --bindir=/usr/bin
+               --bindir=/usr/share/${PN}/bin
                --docdir=/usr/share/doc/${PF}
                --infodir=/usr/share/info
                --libdir=/usr/"$(get_libdir)"
@@ -142,6 +142,27 @@ src_install() {
        emake DESTDIR="${D}" -C bdb install
        emake DESTDIR="${D}" -C cigloo install
 
+       # The ".sh" scripts set proper environment and library order for Bigloo,
+       # but programs (and the Bigloo Emacs library, "bee-mode") want "bigloo",
+       # not "bigloo.sh". To make programs work we install all executable files
+       # into "/usr/share/bigloo/bin", and then pick one by one for 
non-scripts:
+       # if a script with ".sh" extensions exists, then we link the script,
+       # not the picked executable to a binary name, otherwise link the binary.
+       mkdir -p "${D}"/usr/bin || die
+       pushd "${D}" >/dev/null || die
+       local bin bin_link
+       for bin in usr/share/${PN}/bin/* ; do
+               if [[ ${bin} != *.sh ]] ; then
+                       bin_link=usr/bin/$(basename ${bin})
+                       if [[ -f ${bin}.sh ]] ; then
+                               ln -s ../../${bin}.sh ${bin_link} || die
+                       else
+                               ln -s ../../${bin} ${bin_link} || die
+                       fi
+               fi
+       done
+       popd >/dev/null || die
+
        if use emacs ; then
                emake DESTDIR="${D}" install-bee
                elisp-site-file-install "${FILESDIR}/${SITEFILE}"
@@ -151,8 +172,6 @@ src_install() {
 }
 
 pkg_postinst() {
-       einfo "Heads up: Bigloo is launched via \"bigloo.sh\" script, not 
\"bigloo\" executable!"
-
        use emacs && elisp-site-regen
 }
 

diff --git a/dev-scheme/bigloo/files/50bigloo-gentoo.el 
b/dev-scheme/bigloo/files/50bigloo-gentoo.el
index 431f7e90ae73..9cac9f0f7d0f 100644
--- a/dev-scheme/bigloo/files/50bigloo-gentoo.el
+++ b/dev-scheme/bigloo/files/50bigloo-gentoo.el
@@ -1 +1,2 @@
 (add-to-list 'load-path "@SITELISP@")
+(autoload 'bee-mode "bee-mode" "Major mode for editing Bigloo code." t)

Reply via email to