Subject: Re: [X2Go-Dev] nx-libs makefile install messed up

From: Orion Poplawski <[email-masked]>
Date: Fri, 18 Jan 2013 14:14:00 -0700

Package: nx-libs
Version: 3.5.0.17
Tags: patch

On 01/16/2013 05:13 PM, Orion Poplawski wrote:
> On 01/15/2013 05:03 PM, Orion Poplawski wrote:
>> With current git head, the main nx-libs Makefile install gets it backwards
>> installing the libraries:
>>
>>          $(INSTALL_FILE) nx-X11/.build-exports/lib/*.so
>> $(DESTDIR)$(NXLIBDIR)/X11/
>>          $(COPY_SYMLINK) nx-X11/.build-exports/lib/*.so.*
>> $(DESTDIR)$(NXLIBDIR)/X11/
>>
>> The *.so and *.so.# are symlinks to *.so.#.#.  Though some libs only have a
>> single version (*.so -> *.so.#).
>>
>
> Hmm, gets messed up earlier:
>
> -rwxr-xr-x. 1 orion nwra 10421469 Jan 16 17:07
> nx-libs-HEAD/nx-X11/.build-exports/lib/libNX_X11.so
> lrwxrwxrwx. 1 orion nwra       12 Jan 16 17:07
> nx-libs-HEAD/nx-X11/.build-exports/lib/libNX_X11.so.6 -> libNX_X11.so
> lrwxrwxrwx. 1 orion nwra       12 Jan 16 17:07
> nx-libs-HEAD/nx-X11/.build-exports/lib/libNX_X11.so.6.2 -> libNX_X11.so
> lrwxrwxrwx. 1 orion nwra       26 Jan 16 17:06
> nx-libs-HEAD/nx-X11/exports/lib/libNX_X11.so -> ../../lib/X11/libNX_X11.so
> lrwxrwxrwx. 1 orion nwra       28 Jan 16 17:06
> nx-libs-HEAD/nx-X11/exports/lib/libNX_X11.so.6 -> ../../lib/X11/libNX_X11.so.6
> lrwxrwxrwx. 1 orion nwra       30 Jan 16 17:06
> nx-libs-HEAD/nx-X11/exports/lib/libNX_X11.so.6.2 ->
> ../../lib/X11/libNX_X11.so.6.2
> lrwxrwxrwx. 1 orion nwra       16 Jan 16 17:06
> nx-libs-HEAD/nx-X11/lib/X11/libNX_X11.so -> libNX_X11.so.6.2
> lrwxrwxrwx. 1 orion nwra       16 Jan 16 17:06
> nx-libs-HEAD/nx-X11/lib/X11/libNX_X11.so.6 -> libNX_X11.so.6.2
> -rwxr-xr-x. 1 orion nwra 10421469 Jan 16 17:06
> nx-libs-HEAD/nx-X11/lib/X11/libNX_X11.so.6.2
>
> Don't have time to see how .build-exports gets populated yet.
>

Okay, here is the fix.

-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder Office                  FAX: 303-415-9702
3380 Mitchell Lane                       [email-masked]
Boulder, CO 80301                   http://www.nwra.com

--- nx-libs-HEAD/Makefile.install	2013-01-15 14:35:47.000000000 -0700
+++ nx-libs-HEAD/Makefile	2013-01-18 12:22:20.039607600 -0700
@@ -92,22 +92,18 @@
 	# copy headers (for libnx-x11-dev)
 	cp -aL nx-X11/exports/include/* nx-X11/.build-exports/include
 
-	# copy libs (for libnx-x11)
-	find nx-X11/exports/lib/ | egrep "^.*\.so$$" | while read libpath; do \
+	# copy libs (for libnx-x11), we want the targets of the links
+	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 -L $$libpath $${libdir//exports/.build-exports}; \
-	\
-	    find $$libdir/$$libfile.* | while read symlink; do \
-	        ln -s $$libfile $${libdir//exports/.build-exports}/$$(basename $$symlink); \
-	    done; \
+	    cp -a $${libpath/$$libfile/$$link} $${libdir//exports/.build-exports}; \
 	done;
 
 	$(INSTALL_DIR) $(DESTDIR)$(NXLIBDIR)/X11
-	$(INSTALL_FILE) nx-X11/.build-exports/lib/*.so $(DESTDIR)$(NXLIBDIR)/X11/
-	$(COPY_SYMLINK) nx-X11/.build-exports/lib/*.so.* $(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" | \
 	    while read dirname; do \

---

From: Mike Gabriel <[email-masked]>
Date: Tue, 12 Feb 2013 08:14:41 +0100

tag #107 pending
thanks

Hi Orion,

>> Don't have time to see how .build-exports gets populated yet.

Applied to nx-libs.git:
http://code.x2go.org/gitweb?p=nx-libs.git;a=commitdiff;h=d439556ff1b83aecb10991cf0f031fd4da23494e

THANKS!
Mike

-- 

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: [email-masked], http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb