Subject: Re: [X2Go-Dev] Bug#238: Bundled libraries

From: Orion Poplawski <[email-masked]>
Date: Wed, 10 Jul 2013 14:12:20 -0600

On 06/14/2013 04:13 AM, Mike Gabriel wrote:
> Hi Orion,
>
> On Fr 14 Jun 2013 04:44:16 CEST Orion Poplawski wrote:
>
>> Package: nx-libs
>>
>> nx-libs has copies of a number of libraries in nx-X11/extras/ (and some glue
>> in nx-X11/libs).  We should get rid of these and use system provided versions.
>>
>> As a first stab, I'm able to remove the following without any harm:
>>
>> rm -r nx-X11/extras/{drm,fonts,ogl-sample,regex,ttf2pt1,x86emu,zlib}
>> rm -r nx-X11/lib/{regex,zlib}
>>
>> expat appears to be essentially the 1.95.6 version.  And can be disabled by
>> setting HasExpat YES in nx-X11/config/cf/host.def.
>>
>> fontconfig is an unmodified fontconfig 2.3.2 and can be disabled with
>> HasFontconfig YES.
>>
>> rman is not needed and can be disabled with BuildRman NO.
>>
>> That's a far as I've gotten today.
>
> Thanks for having started working on this. You earlier reported this request
> via BTS (#116) and getting a fix for this issue rolling is pretty valuable, I
> guess.
>
> We won't be able to remove the source folders you referred to from our
> nx-libs.git repos as the git repos also documents how NoMachine releases get
> merged into NX (redistributed). However, we should get rid of those folders at
> build-time (.deb packages) and get rid of those folders from the tarballs
> (.rpm et al. packages).
>
> So, if you work on this (I know that you work on .rpm based systems), please
> edit nx-libs.git/debian/roll-tarball.sh for us whenever you want to remove
> files from the tarball. If you need some other build options, provide that
> change as a patch for our patch system. Just send the patch, I will transform
> that into an appropriate quilt patch.
>
> For the .deb build process, we have to move folders out of the way during
> build-time via /debian/rules. I can see to that, once you have a diff for the
> roll-tarball.sh script.
>
> Greets+Thanks!
> Mike

Okay, here goes my initial changes.

I'd still like to unbundle Xpm if possible, but it does get linked to 
libXcomp.  And Mesa may be just too integrated.

-- 
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       [email-masked]
Boulder, CO 80301                   http://www.nwra.com
>From 35695e919e17699d2accd5ba79808d9577bcd6a3 Mon Sep 17 00:00:00 2001
From: Orion Poplawski <[email-masked]>
Date: Wed, 10 Jul 2013 14:08:17 -0600
Subject: [PATCH 1/2] Remove bundled libraries we do not need in
 roll-tarballs.sh

---
 debian/roll-tarballs.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/debian/roll-tarballs.sh b/debian/roll-tarballs.sh
index fd36b28..7c1fc67 100755
--- a/debian/roll-tarballs.sh
+++ b/debian/roll-tarballs.sh
@@ -133,6 +133,10 @@ test -f replace.sh || test -f debian/Makefile.replace.sh && cp -v debian/Makefil
 # remove folders that we do not want to roll into the tarball
 rm -Rf ".pc/"
 rm -Rf "debian/"
+# bundled libraries we do not need
+rm -Rf nx-X11/extras/{drm,expat,fontconfig,freetype2,fonts,ogl-sample,regex,rman,ttf2pt1,x86emu,zlib}
+rm -Rf nx-X11/lib/{expat,fontconfig,fontenc,font/FreeType,font/include/fontenc.h,freetype2,regex,zlib}
+
 
 # remove files, that we do not want in the tarballs (build cruft)
 rm -Rf nx*/configure nx*/autom4te.cache*
-- 
1.8.3.1

>From e3569945417272ea2556d4b77b6bc041fdea885f Mon Sep 17 00:00:00 2001
From: Orion Poplawski <[email-masked]>
Date: Wed, 10 Jul 2013 14:09:45 -0600
Subject: [PATCH 2/2] Build option changes to not use bundled libraries

---
 nx-X11/config/cf/host.def         | 10 +++++++---
 nx-X11/lib/font/include/Imakefile |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/nx-X11/config/cf/host.def b/nx-X11/config/cf/host.def
index e9f53c2..3902822 100644
--- a/nx-X11/config/cf/host.def
+++ b/nx-X11/config/cf/host.def
@@ -311,6 +311,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
  *
 #define BuildFreeType		NO
  */
+#define BuildFreeType		NO
 
 /*
  * To set non-default build options for the underlying FreeType libraries,
@@ -891,7 +892,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
  *
 #define HasFreetype2 NO
  */
-#define HasFreetype2 NO
+#define HasFreetype2 YES
 
 /* 
  * To use a FreeType library already installed outside the default search
@@ -908,7 +909,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
  *
 #define HasFontconfig NO
  */
-#define HasFontconfig NO
+#define HasFontconfig YES
 
 /* 
  * To use a Fontconfig library already installed outside the default search
@@ -924,7 +925,7 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
  *
 #define HasExpat NO
  */
-#define HasExpat NO
+#define HasExpat YES
 
 /* 
  * To use a Expat library already installed outside the default search
@@ -1018,3 +1019,6 @@ XCOMM $XFree86: xc/config/cf/xf86site.def,v 3.186 2003/06/25 18:06:22 eich Exp $
 #endif
 
 #endif /* #if !defined(NXZaurusXServer) && !defined(NXiPAQXServer) && !defined(DarwinArchitecture) */
+
+#define BuildRman NO
+#define BuildFontEncLib NO
diff --git a/nx-X11/lib/font/include/Imakefile b/nx-X11/lib/font/include/Imakefile
index 91c84e6..73e65a4 100644
--- a/nx-X11/lib/font/include/Imakefile
+++ b/nx-X11/lib/font/include/Imakefile
@@ -1,5 +1,5 @@
 XCOMM $Xorg$
-    HEADERS = bitmap.h bufio.h fntfil.h fntfilio.h fntfilst.h fontenc.h \
+    HEADERS = bitmap.h bufio.h fntfil.h fntfilio.h fntfilst.h \
 	      fontencc.h fontmisc.h fontmod.h fontshow.h fontutil.h \
 	      fontxlfd.h
 all::
-- 
1.8.3.1