Commit 8f151d79 authored by Mike Gabriel's avatar Mike Gabriel

Work-in patch from Jan Engehardt for working around different improper bash…

Work-in patch from Jan Engehardt for working around different improper bash implementations of string-in-string replacing. (Fixes: #145).
parent 258902be
......@@ -93,23 +93,23 @@ install-full:
cp -aL nx-X11/exports/include/* nx-X11/.build-exports/include
# copy libs (for libnx-x11), we want the targets of the links
find nx-X11/exports/lib/ | grep -F ".so" | while read libpath; do \
. replace.sh; set -x; find nx-X11/exports/lib/ | grep -F ".so" | while read libpath; do \
libfile=$$(basename $$libpath); \
libdir=$$(dirname $$libpath); \
link=$$(readlink $$libpath); \
\
mkdir -p $${libdir//exports/.build-exports}; \
cp -a $${libpath/$$libfile/$$link} $${libdir//exports/.build-exports}; \
mkdir -p "$$(string_rep "$$libdir" exports .build-exports)"; \
cp -a "$$(string_rep "$$libpath" "$$libfile" "$$link")" "$$(string_rep "$$libdir" exports .build-exports)"; \
done;
$(INSTALL_DIR) $(DESTDIR)$(NXLIBDIR)/X11
$(COPY_SYMLINK) nx-X11/.build-exports/lib/*.so* $(DESTDIR)$(NXLIBDIR)/X11/
find nx-X11/.build-exports/include/ -type d | grep -v "include/X11/bitmaps" | \
. replace.sh; set -x; find nx-X11/.build-exports/include/ -type d | grep -v "include/X11/bitmaps" | \
while read dirname; do \
$(INSTALL_DIR) $${dirname//"nx-X11/.build-exports/include"/"$(DESTDIR)$(PREFIX)/include/nx"}; \
$(INSTALL_DIR) "$$(string_rep "$$dirname" nx-X11/.build-exports/include "$(DESTDIR)$(PREFIX)/include/nx")"; \
$(INSTALL_FILE) $${dirname}/*.h \
$${dirname//"nx-X11/.build-exports/include"/"$(DESTDIR)$(PREFIX)/include/nx"}/ || true; \
"$$(string_rep "$$dirname" nx-X11/.build-exports/include "$(DESTDIR)$(PREFIX)/include/nx")"/ || true; \
done; \
$(INSTALL_DIR) $(DESTDIR)$(PREFIX)/include/nx/X11/bitmaps
......
# from http://mywiki.wooledge.org/BashFAQ/021
string_rep()
{
# initialize vars
in=$1
unset out
# SEARCH must not be empty
test -n "$2" || return
while true; do
# break loop if SEARCH is no longer in "$in"
case "$in" in
*"$2"*) : ;;
*) break;;
esac
# append everything in "$in", up to the first instance of SEARCH, and REP, to "$out"
out=$out${in%%"$2"*}$3
# remove everything up to and including the first instance of SEARCH from "$in"
in=${in#*"$2"}
done
# append whatever is left in "$in" after the last instance of SEARCH to out, and print
printf '%s%s\n' "$out" "$in"
}
......@@ -3,6 +3,9 @@ nx-libs (2:3.5.0.18-0) UNRELEASED; urgency=low
[ Mike Gabriel ]
* Remove duplicate install of nxproxy from main Makefile. Spotted by Jan
Engelhard.
* Work-in patch from Jan Engehardt for working around different
improper bash implementations of string-in-string replacing. (Fixes:
#145).
[ Orion Poplawski ]
* Fix wrong symlink direction of libNX_* files. (Fixes: #107).
......
......@@ -120,6 +120,7 @@ mv -v debian/changelog doc/changelog
# copy the top-level makefile if no quilt patch created it before
test -f Makefile || test -f debian/Makefile.nx-libs && cp -v debian/Makefile.nx-libs Makefile
test -f replace.sh || test -f debian/Makefile.replace.sh && cp -v debian/Makefile.replace.sh replace.sh
# remove folders that we do not want to roll into the tarball
rm -Rf ".pc/"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment