aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Rui <vowstar@gmail.com>2021-01-06 05:52:57 +0800
committerHuang Rui <vowstar@gmail.com>2021-01-06 05:52:57 +0800
commit4e3c7e96cb7b2e93c1a2c2fc1a62b82036879603 (patch)
treecc1231ec19ccbd4c7c7a92ee46723cd25ddd4f12 /sci-electronics
parentsci-electronics/bsc: add DOC, and patch (diff)
downloadguru-4e3c7e96cb7b2e93c1a2c2fc1a62b82036879603.tar.gz
guru-4e3c7e96cb7b2e93c1a2c2fc1a62b82036879603.tar.bz2
guru-4e3c7e96cb7b2e93c1a2c2fc1a62b82036879603.zip
sci-electronics/bsc: add special wrapper patch for gentoo
Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Huang Rui <vowstar@gmail.com>
Diffstat (limited to 'sci-electronics')
-rw-r--r--sci-electronics/bsc/bsc-9999.ebuild1
-rw-r--r--sci-electronics/bsc/files/bsc-9999-fix-libdir.patch17
-rw-r--r--sci-electronics/bsc/files/bsc-9999-fix-wrapper.patch13
3 files changed, 24 insertions, 7 deletions
diff --git a/sci-electronics/bsc/bsc-9999.ebuild b/sci-electronics/bsc/bsc-9999.ebuild
index 6feedbbed..163f49ecf 100644
--- a/sci-electronics/bsc/bsc-9999.ebuild
+++ b/sci-electronics/bsc/bsc-9999.ebuild
@@ -42,6 +42,7 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-9999-fix-libdir.patch
+ "${FILESDIR}"/${PN}-9999-fix-wrapper.patch
)
DOCS=( "README.md" "COPYING" )
diff --git a/sci-electronics/bsc/files/bsc-9999-fix-libdir.patch b/sci-electronics/bsc/files/bsc-9999-fix-libdir.patch
index 4bf421845..e0afdb4c5 100644
--- a/sci-electronics/bsc/files/bsc-9999-fix-libdir.patch
+++ b/sci-electronics/bsc/files/bsc-9999-fix-libdir.patch
@@ -130,7 +130,7 @@ index 4ee8e86..e243531 100644
if { [catch Bluetcl::initBluespec err] } {
puts "Error in initialization file bluespec.tcl: $err"
diff --git a/src/comp/Makefile b/src/comp/Makefile
-index 58b81d7..dda30ac 100644
+index 58b81d7..6f113a2 100644
--- a/src/comp/Makefile
+++ b/src/comp/Makefile
@@ -14,6 +14,7 @@ RM = rm -f
@@ -149,26 +149,29 @@ index 58b81d7..dda30ac 100644
BINDIR=$(PREFIX)/bin
# Top-level of where intermediate GHC files are stored
-@@ -390,6 +392,7 @@ $(BINDIR)/core/%: %
+@@ -389,7 +391,8 @@ $(BINDIR)/core/%: %
+
$(BINDIR)/%: wrapper.sh $(BINDIR)/core/%
mkdir -p -m 755 $(BINDIR)
- $(INSTALL) -m 755 wrapper.sh $(BINDIR)/$(@F)
-+ cat $(BINDIR)/$(@F) | $(SED) -e "s:^LIBDIR=.*$$:LIBDIR=\"$(abspath $(LIBDIR))\":g" > $(BINDIR)/$(@F)
+- $(INSTALL) -m 755 wrapper.sh $(BINDIR)/$(@F)
++ $(SED) "s:^LIBDIR=.*$$:LIBDIR=\"$(abspath $(LIBDIR))\":g" wrapper.sh > $(BUILDDIR)/$(@F)
++ $(INSTALL) -m 755 $(BUILDDIR)/$(@F) $(BINDIR)/$(@F)
.PHONY: install-bsc
install-bsc: $(addprefix $(BINDIR)/,$(BSCEXES))
diff --git a/src/comp/wrapper.sh b/src/comp/wrapper.sh
-index 656e9a0..fa1a052 100755
+index 656e9a0..1d5cf47 100755
--- a/src/comp/wrapper.sh
+++ b/src/comp/wrapper.sh
-@@ -5,9 +5,22 @@
+@@ -5,9 +5,23 @@
ABSNAME="$(cd "${0%/*}"; echo $PWD)/${0##*/}"
SCRIPTNAME="${ABSNAME##*/}"
BINDIR="${ABSNAME%/*}"
+# LIBDIR will be replaced to user defined path after build
+LIBDIR="${BINDIR}/../lib"
+
-+# If missing LIBDIR, search one
++# If missing LIBDIR, search one.
++# This is unlikely to happen unless the user moves the file after installation.
+if [ ! -d ${LIBDIR} ]; then
+ LIBDIR="$(find ${BINDIR}/.. -maxdepth 10 -type d -name 'SAT' -print -quit)"
+ if [ ! "x${LIBDIR}" = "x" ]; then
diff --git a/sci-electronics/bsc/files/bsc-9999-fix-wrapper.patch b/sci-electronics/bsc/files/bsc-9999-fix-wrapper.patch
new file mode 100644
index 000000000..974e42894
--- /dev/null
+++ b/sci-electronics/bsc/files/bsc-9999-fix-wrapper.patch
@@ -0,0 +1,13 @@
+diff --git a/src/comp/Makefile b/src/comp/Makefile
+index 6f113a2..5220c30 100644
+--- a/src/comp/Makefile
++++ b/src/comp/Makefile
+@@ -391,7 +391,7 @@ $(BINDIR)/core/%: %
+
+ $(BINDIR)/%: wrapper.sh $(BINDIR)/core/%
+ mkdir -p -m 755 $(BINDIR)
+- $(SED) "s:^LIBDIR=.*$$:LIBDIR=\"$(abspath $(LIBDIR))\":g" wrapper.sh > $(BUILDDIR)/$(@F)
++ $(SED) "s:^LIBDIR=.*$$:LIBDIR=\"$$\{BINDIR\}/$(shell realpath --relative-to $(BINDIR) $(LIBDIR))\":g" wrapper.sh > $(BUILDDIR)/$(@F)
+ $(INSTALL) -m 755 $(BUILDDIR)/$(@F) $(BINDIR)/$(@F)
+
+ .PHONY: install-bsc