Package: xfree86
Version: 4.2.1-1
Severity: normal

I am attaching four patches to this bug; all four must be present in the
debian/patches/ directory to successfully build on a NetBSD platform. I
would like to request an assigned number-range (as with the other ports)
for these patches; for the moment, they're named under the 999 convention.

Note that the netbsd_no_SharedOldX patch must be applied *after* the C++
support patch for bsdLib.rules (bug #163892), as they both touch the same
file.

Note that patches for the required debian/* support files (such as
MANIFEST.netbsd-i386) will be submitted in a separate bug.
-- 
***************************************************************************
Joel Baker                           System Administrator - lightbearer.com
[EMAIL PROTECTED]              http://users.lightbearer.com/lucifer/
Patch to imake.c for Debian/NetBSD support by Joel Baker
<[EMAIL PROTECTED]>.

--- xc-dist/config/imake/imake.c        Sun Jan 27 23:07:23 2002
+++ xc/config/imake/imake.c     Sun Jan 27 23:20:05 2002
@@ -950,6 +950,10 @@
   fprintf (inFile, "%s\n", "#define LinuxWare       11");
   fprintf (inFile, "%s\n", "#define LinuxYggdrasil  12");
 
+  fprintf (inFile, "%s\n", "#define NetBSDUnknown   0");
+  fprintf (inFile, "%s\n", "#define NetBSDNative    1");
+  fprintf (inFile, "%s\n", "#define NetBSDDebian    2");
+
   if (lstat (yast, &sb) == 0) {
     fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxSuSE");
     fprintf (inFile, "%s\n", "#define DefaultLinuxDistName SuSE");
@@ -963,6 +967,8 @@
   if (lstat (debian, &sb) == 0) {
     fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxDebian");
     fprintf (inFile, "%s\n", "#define DefaultLinuxDistName Debian");
+    fprintf (inFile, "%s\n", "#define DefaultNetBSDDistribution NetBSDDebian");
+    fprintf (inFile, "%s\n", "#define DefaultNetBSDDistName Debian");
     /* You could also try to get the version of the Debian distrib by looking
      * at the content of /etc/debian_version */
     return;
@@ -971,6 +977,8 @@
 
   fprintf (inFile, "%s\n", "#define DefaultLinuxDistribution LinuxUnknown");
   fprintf (inFile, "%s\n", "#define DefaultLinuxDistName Unknown");
+  fprintf (inFile, "%s\n", "#define DefaultNetBSDDistribution NetBSDUnknown");
+  fprintf (inFile, "%s\n", "#define DefaultNetBSDDistName Unknown");
   /* would like to know what version of the distribution it is */
 }

This is an omnibus patch to add support for Debian-specific values in the
NetBSD.cf file. It requires that imake be patched to generate the proper
values for NetBSDDistribution, before these will be used (provided as a
separate patch).

Origionally written by Joel Baker <[EMAIL PROTECTED]>.

diff -ur xc-dist/config/cf/NetBSD.cf xc/config/cf/NetBSD.cf
--- xc-dist/config/cf/NetBSD.cf 2002-10-09 03:55:29.000000000 +0000
+++ xc/config/cf/NetBSD.cf      2002-10-09 03:58:09.000000000 +0000
@@ -18,12 +18,109 @@
 #define OSTeenyVersion         DefaultOSTeenyVersion
 #endif
 
+#ifndef NetBSDDistribution
+#define NetBSDDistribution     DefaultNetBSDDistribution
+/*
+  Add "#define NetBSDDistribution NetBSD<mumble>" to your site.def or host.def.
+  Currently only NetBSDDebian will be autodetected.
+  Valid values are:
+    NetBSDUnknown    (0)
+    NetBSDNative     (1)
+    NetBSDDebian     (2)
+*/
+#endif
+
+#ifndef NetBSDDistName
+# define NetBSDDistName         DefaultNetBSDDistName
+#endif
 
 #ifndef OSVendor
 #define        OSVendor                The NetBSD Foundation, Inc.
 #endif
+
+#ifndef NetBSDBinUtilsMajorVersion
+# define NetBSDBinUtilsMajorVersion     DefaultNetBSDBinUtilsMajorVersion
+#endif
+
 XCOMM operating system:  OSName (OSMajorVersion./**/OSMinorVersion./**/OSTeenyVersion)
 
+/* Defines for Debian GNU/NetBSD */
+
+#if NetBSDDistribution == NetBSDDebian
+# ifndef DefaultGcc2OptimizeOpt
+#  define DefaultGcc2OptimizeOpt       -O2
+# endif
+# define DefaultGcc2AxpOpt     DefaultGcc2OptimizeOpt
+# define DefaultGcc2i386Opt    DefaultGcc2OptimizeOpt
+# define DefaultGcc2PpcOpt     DefaultGcc2OptimizeOpt
+# define SystemManDirectory    /usr/share/man
+# define HasPam                        YES
+# define HasTk                 YES
+# define TkLibDir              /usr/lib
+# define TkIncDir              /usr/include
+# define TkLibName             tk8.3
+# define XF86SetupUsesStaticTk NO
+# define HasTcl                        YES
+# define TclLibDir             /usr/lib
+# define TclIncDir             /usr/include
+# define TclLibName            tcl8.3
+# define XF86SetupUsesStaticTcl        NO
+# define XAppLoadDir           EtcX11Directory/app-defaults
+# define XFileSearchPathDefault        
+Concat4(EtcX11Directory/%L/%T/%N%C,%S:EtcX11Directory/%l/%T/%N%C,%S:EtcX11Directory/%T/%N%C,%S:EtcX11Directory/%L/%T/%N%S:EtcX11Directory/%l/%T/%N%S:EtcX11Directory/%T/%N%S):Concat4($(LIBDIR)/%L/%T/%N%C,%S:$(LIBDIR)/%l/%T/%N%C,%S:$(LIBDIR)/%T/%N%C,%S:$(LIBDIR)/%L/%T/%N%S:$(LIBDIR)/%l/%T/%N%S:$(LIBDIR)/%T/%N%S)
+/* the relative symlink created by this rule causes problems for us */
+# if InstallAppDefFiles
+#  define InstallAppDefaultsLong(file,class)                           @@\
+InstallNamedTarget(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
+# else
+#  define InstallAppDefaultsLong(file,class)                           @@\
+InstallNamedTargetNoClobber(install,file.ad,$(INSTAPPFLAGS),$(XAPPLOADDIR),class)
+# endif /* InstallAppDefFiles */
+
+# define SharedLibXdmGreet     NO
+# define LinkGLToUsrInclude    NO
+# define LinkGLToUsrLib                NO
+# define SharedLibFont         NO
+# define HasZlib               YES
+# define SharedLibGlu          YES
+# define NormalLibGlu          YES
+# define FSUseSyslog           YES
+
+/*
+ *
+ */
+# define DebianMaintainer      "[EMAIL PROTECTED]"
+/*
+ *
+ */
+
+# ifdef DebianMaintainer
+#  ifndef XFree86CustomVersion
+#    define XFree86CustomVersion       "Debian"
+#  endif
+#  ifndef BuilderEMailAddr
+#    define BuilderEMailAddr   "[EMAIL PROTECTED]"
+#  endif
+#  define XFree86Devel         YES
+#  define BuildAllSpecsDocs    YES
+#  define InstallXinitConfig   YES
+#  define InstallXdmConfig     YES
+#  define InstallFSConfig      YES
+#  define DebuggableLibraries  YES
+#  define ForceNormalLib       YES
+#  define BuildSpecsDocs       YES
+#  define SpecsDocDirs         CTEXT GL ICCCM X11 Xext Xv i18n xterm
+#  define BuildRman            NO
+#  define BuildHtmlManPages    NO
+#  define ProjectManSuffix     x
+
+/* we build-depend on libfreetype6-dev (FreeType 2.x) */
+#  define BuildFreetype2Library        NO
+#  define HasFreetype2         YES
+#  define HasXdmAuth           YES
+#  define HasLatex             YES
+# endif /* DebianMaintainer */
+#endif /* NetBSDDebian */
+
 /*
  * C library features
  */
@@ -83,8 +180,13 @@
 
 #define HasUsableFileMmap      YES
 
+#if NetBSDDistribution == NetBSDDebian
+#define HasVarRun              YES
+#define VarDbDirectory         $(VARDIR)/lib
+#else /* Debian */
 #define HasVarRun              YES
 #define HasVarDb               YES
+#endif /* Debian */
 
 #define InstallXloadSetGID     NO
 
@@ -100,6 +202,11 @@
 #define SharedX11Reqs          ThreadsLibraries
 #endif
 
+#if UseElfFormat
+# define HasPlugin                      YES
+# define VendorHasX11R6_3libXext        YES     /* XC or XFree86 >= 3.3.1 */
+#endif
+
 /*
  * Compiler Features
  */
@@ -286,6 +393,10 @@
 /* NetBSD doesn't have gperf in the base install */
 #define DontRebuildGperfOutput YES
 
+#if NetBSDDistribution == NetBSDDebian
+#define HasPerl                 YES
+#endif
+
 /* 
  * NetBSD doesn't have perl in default system
  * you may override this in host.def if you installed perl from the packages
@@ -305,7 +416,13 @@
 /*
  * Make & install Features
  */
+
+#if NetBSDDistribution == NetBSDDebian
+#define HasBsdMake             NO
+#else
 #define HasBsdMake             YES
+#endif
+
 #define CompressAllFonts       YES
 #define GzipFontCompression    YES
 #define DefaultUserPath                
/bin:/usr/bin:/usr/pkg/bin:/usr/local/bin:$(BINDIR)
@@ -396,6 +513,8 @@
                                                                        @@\
 .EXEC:
 
+#if NetBSDDistribution != NetBSDDebian /* Debian uses ProjectManSuffix */
+
 /*
  * Man pages need to be formatted when installed, so override the default
  * imake rules.
@@ -487,6 +606,8 @@
                                                                        @@\
 InstallManPageAliasesBase(file,destdir,aliases)
 
+#endif /* Debian */
+
 /*
  * Shared libraries supported starting in 1.0 on a.out platforms,
  * and on all ELF platforms.
This patch disables the building of a shared liboldX library (static building
is still done). This brings the NetBSD architectures in line with the other
Debian builds (which only have the static version of the librar).

This patch must be applied *after* the bsdLib.rules patch.

Patch by Joel Baker <[EMAIL PROTECTED]>

diff -ur xc-dist/config/cf/bsdLib.rules xc/config/cf/bsdLib.rules
--- xc-dist/config/cf/bsdLib.rules      2002-10-09 03:32:44.000000000 +0000
+++ xc/config/cf/bsdLib.rules   2002-10-09 03:41:11.000000000 +0000
@@ -13,6 +13,12 @@
 #define UseElfFormat NO
 #endif
 
+#if NetBSDDistribution == NetBSDDebian
+# ifndef SharedOldX
+#  define SharedOldX NO
+# endif
+#endif /* Debian */
+
 #if !UseElfFormat
 /* a.out shared libs */
 #ifndef HasSharedLibraries
This patch disables building the (obsolete) kbd_mode program on Debian
systems.

Patch by Joel Baker <[EMAIL PROTECTED]>

diff -ur xc-dist/programs/Xserver/hw/xfree86/etc/Imakefile 
xc/programs/Xserver/hw/xfree86/etc/Imakefile
--- xc-dist/programs/Xserver/hw/xfree86/etc/Imakefile   2001-06-24 20:19:11.000000000 
+0000
+++ xc/programs/Xserver/hw/xfree86/etc/Imakefile        2002-10-09 03:27:33.000000000 
++0000
@@ -65,7 +65,7 @@
 
 all:: $(FILES)
 
-#if defined(FreeBSDArchitecture) || defined(NetBSDArchitecture) || 
defined(OpenBSDArchitecture)
+#if defined(FreeBSDArchitecture) || (defined(NetBSDArchitecture) && 
+(NetBSDDistribution != NetBSDDebian)) || defined(OpenBSDArchitecture)
        SRCS1 = kbd_mode.c
      DEFINES = XFree86ConsoleDefines
 

Reply via email to