Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: motif-2.3.8
@ 2020-11-04 19:44 abenson
  2020-11-04 20:12 ` [PR REVIEW] " ericonr
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: abenson @ 2020-11-04 19:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

There is a new pull request by abenson against master on the void-packages repository

https://github.com/abenson/void-packages np_motifwqemu
https://github.com/void-linux/void-packages/pull/26134

New package: motif-2.3.8


A patch file from https://github.com/void-linux/void-packages/pull/26134.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-np_motifwqemu-26134.patch --]
[-- Type: text/x-diff, Size: 86493 bytes --]

From cf48fc32d76a4d2402ca0f9b4d1b5cfc03b8bb81 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 21:11:58 -0700
Subject: [PATCH 1/5] New package: motif-2.3.8

---
 common/shlibs                                 |   6 +-
 srcpkgs/motif-demos                           |   1 +
 srcpkgs/motif-devel                           |   1 +
 srcpkgs/motif-mwm                             |   1 +
 srcpkgs/motif-xmbind                          |   1 +
 .../patches/02-fix-format-security.patch      | 607 ++++++++++++++++++
 srcpkgs/motif/patches/03-no-demos.patch       |  53 ++
 .../motif/patches/06-cast-size_t-to-int.patch |  17 +
 ...7-fix_lintian_reported_manpage_typos.patch | 118 ++++
 .../patches/08-fix_hyphen_in_man_pages.patch  | 156 +++++
 .../motif/patches/09-fix_typo_in_libxm.patch  |  25 +
 .../10-fix_manpage-has-bad-whatis-entry.patch |  49 ++
 .../motif/patches/11-fix_underlinking.patch   | 564 ++++++++++++++++
 .../13-fix_hardcoded_x11rgb_path.patch        |  54 ++
 .../patches/15-link_uil_against_libuil.patch  |  29 +
 .../16-fix-undefined-use-of-sprintf.patch     |  17 +
 .../17-switch-to-system-iswspace.patch        | 384 +++++++++++
 srcpkgs/motif/patches/20-cross-compile.patch  |  15 +
 srcpkgs/motif/template                        |  68 ++
 19 files changed, 2163 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/motif-demos
 create mode 120000 srcpkgs/motif-devel
 create mode 120000 srcpkgs/motif-mwm
 create mode 120000 srcpkgs/motif-xmbind
 create mode 100644 srcpkgs/motif/patches/02-fix-format-security.patch
 create mode 100644 srcpkgs/motif/patches/03-no-demos.patch
 create mode 100644 srcpkgs/motif/patches/06-cast-size_t-to-int.patch
 create mode 100644 srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
 create mode 100644 srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
 create mode 100644 srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
 create mode 100644 srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
 create mode 100644 srcpkgs/motif/patches/11-fix_underlinking.patch
 create mode 100644 srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
 create mode 100644 srcpkgs/motif/patches/15-link_uil_against_libuil.patch
 create mode 100644 srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
 create mode 100644 srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
 create mode 100644 srcpkgs/motif/patches/20-cross-compile.patch
 create mode 100644 srcpkgs/motif/template

diff --git a/common/shlibs b/common/shlibs
index 4270867b673..bc07b491b27 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1763,9 +1763,9 @@ libSDL2_net-2.0.so.0 SDL2_net-2.0.0_1
 libnxml.so.0 libnxml-0.18.3_1
 libmrss.so.0 libmrss-0.19.2_1
 libuv.so.1 libuv-1.0.0_1
-libXm.so.2 lesstif-0.95.2_1
-libMrm.so.2 lesstif-0.95.2_1
-libUil.so.2 lesstif-0.95.2_1
+libXm.so.4 motif-2.3.8_1
+libMrm.so.4 motif-2.3.8_1
+libUil.so.4 motif-2.3.8_1
 libgtest.so gtest-1.7.0_1
 libgtest_main.so gtest-1.7.0_1
 libxmlsec1-gcrypt.so.1 xmlsec1-1.2.20_2
diff --git a/srcpkgs/motif-demos b/srcpkgs/motif-demos
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-demos
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-devel b/srcpkgs/motif-devel
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-devel
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-mwm b/srcpkgs/motif-mwm
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-mwm
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-xmbind b/srcpkgs/motif-xmbind
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-xmbind
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif/patches/02-fix-format-security.patch b/srcpkgs/motif/patches/02-fix-format-security.patch
new file mode 100644
index 00000000000..18c4abdc271
--- /dev/null
+++ b/srcpkgs/motif/patches/02-fix-format-security.patch
@@ -0,0 +1,607 @@
+Description: Fix unsafe uses of fprintf and sprintf
+ prevent 'format not a string literal and no format arguments' errors
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1574
+Author: Graham Inggs <graham@nerve.org.za>
+Last-Update: 2012-12-25
+--- a/lib/Mrm/Mrmhier.c
++++ b/lib/Mrm/Mrmhier.c
+@@ -264,10 +264,10 @@
+ 	    case MrmSUCCESS:
+ 	      break;
+ 	    case MrmNOT_VALID:
+-	      sprintf (err_stg, _MrmMMsg_0113);
++	      sprintf (err_stg, "%s", _MrmMMsg_0113);
+ 	      break;
+ 	    default:
+-	      sprintf (err_stg, _MrmMMsg_0114);
++	      sprintf (err_stg, "%s", _MrmMMsg_0114);
+ 	      break;
+ 	    }
+ 	}
+--- a/lib/Mrm/Mrmicon.c
++++ b/lib/Mrm/Mrmicon.c
+@@ -1176,7 +1176,7 @@
+ 		}
+ 		break;
+ 	      default:
+-		sprintf(err_msg, _MrmMMsg_0040);
++		sprintf(err_msg, "%s", _MrmMMsg_0040);
+ 		return Urm__UT_Error ("Urm__RelizeColorTable",
+ 				      err_msg, NULL, NULL, MrmFAILURE) ;
+ 	      }
+@@ -1252,7 +1252,7 @@
+ 	      break;
+ 	    default:
+ 	      result = MrmFAILURE;
+-	      sprintf (err_msg, _MrmMMsg_0040);
++	      sprintf (err_msg, "%s", _MrmMMsg_0040);
+ 	      Urm__UT_Error ("Urm__RelizeColorTable",
+ 			     err_msg, NULL, NULL, MrmFAILURE) ;
+ 	    }
+--- a/lib/Mrm/Mrmlread.c
++++ b/lib/Mrm/Mrmlread.c
+@@ -698,7 +698,7 @@
+ 	 XBlackPixelOfScreen(XDefaultScreenOfDisplay(display)));
+       break;
+     default:
+-      sprintf(err_msg, _MrmMMsg_0040);
++      sprintf(err_msg, "%s", _MrmMMsg_0040);
+       result = Urm__UT_Error ("MrmFetchColorLiteral",
+ 			      err_msg, NULL, NULL, MrmFAILURE) ;
+       _MrmAppUnlock(app);
+--- a/lib/Mrm/Mrmwcrw.c
++++ b/lib/Mrm/Mrmwcrw.c
+@@ -1390,7 +1390,7 @@
+ 			}
+ 		      break;
+ 		    default:
+-		      sprintf (err_msg, _MrmMMsg_0040);
++		      sprintf (err_msg, "%s", _MrmMMsg_0040);
+ 		      result = Urm__UT_Error ("Urm__CW_ConvertValue",
+ 					      err_msg, NULL, NULL, MrmFAILURE) ;
+ 		    };
+@@ -2426,7 +2426,7 @@
+ 	    }
+ 	  break;
+ 	default:
+-	  sprintf(err_msg, _MrmMMsg_0040);
++	  sprintf(err_msg, "%s", _MrmMMsg_0040);
+ 	  return Urm__UT_Error ("Urm__CW_ConvertValue",
+ 				err_msg, NULL, NULL, MrmFAILURE) ;
+ 	};
+--- a/tools/wml/wmlouth.c
++++ b/tools/wml/wmlouth.c
+@@ -225,12 +225,12 @@
+     printf ("\nCouldn't open UilSymGen.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write the sym_k..._object literals
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
+@@ -244,7 +244,7 @@
+ /*
+  * Define the sym_k_..._reason literals
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_reason_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr;
+@@ -258,7 +258,7 @@
+ /*
+  * Define the sym_k_..._arg literals
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -272,7 +272,7 @@
+ /*
+  * Define the sym_k_..._enumset structs and literals
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -286,7 +286,7 @@
+ /*
+  * Define the sym_k_..._enumval literals
+  */
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
+     {
+     enumvalobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
+@@ -301,7 +301,7 @@
+  * Define the sym_k_..._charsize literals
+  * Define the sym_k_..._charset literals
+  */
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     charsetobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -315,7 +315,7 @@
+ /*
+  * Define the sym_k_..._child literals
+  */
+-fprintf (outfil, canned8);
++fprintf (outfil, "%s", canned8);
+ for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
+@@ -379,12 +379,12 @@
+     printf ("\nCouldn't open UilSymChCL.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
+@@ -392,7 +392,7 @@
+     fprintf (outfil, "    sym_k_%s_object,\n",
+ 	     classobj->tkname);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -446,12 +446,12 @@
+     printf ("\nCouldn't open UilSymArTy.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -459,7 +459,7 @@
+     fprintf (outfil, "    sym_k_%s_value,\n",
+ 	     datobj->tkname);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -509,19 +509,19 @@
+     printf ("\nCouldn't open UilSymRArg.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+     fprintf (outfil, "    %d,\n",
+ 	     resobj->related_code);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -621,12 +621,12 @@
+     printf ("\nCouldn't open UilUrmClas.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write entries for widgets
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
+@@ -637,7 +637,7 @@
+     else 
+ 	fprintf (outfil, "  \"%s\",\t\n", synobj->convfunc);
+     }
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ 
+ /*
+  * Write entries for gadget variants of widget classes
+@@ -661,7 +661,7 @@
+ 		     synobj->name);
+ 	}
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * Write entries for non-dialog widgets
+@@ -685,7 +685,7 @@
+ 		     synobj->name);
+ 	}
+     }
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ 
+ /*
+  * Write entries for the resource a widget's controls map to
+@@ -701,7 +701,7 @@
+     else
+ 	fprintf (outfil, "  sym_k_%s_arg,\n", mapresobj->tkname);
+     }
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ 
+ /*
+  * Write entries for arguments
+@@ -714,7 +714,7 @@
+     fprintf (outfil, "  %s,\n",
+ 	     synres->resliteral);
+     }
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ 
+ /*
+  * Write entries for reasons
+@@ -727,7 +727,7 @@
+     fprintf (outfil, "  %s,\n",
+ 	     synres->resliteral);
+     }
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ 
+ /*
+  * close the output file
+@@ -781,13 +781,13 @@
+     printf ("\nCouldn't open UilConst.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Process the arguments in code order. We start with 1, and write out
+  * the mask after processing 8 codes.
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ strcpy (maskbuf, "0");
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+@@ -805,7 +805,7 @@
+     }
+ if ( bitno != 8 )
+     fprintf (outfil, "%s", maskbuf);
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -878,8 +878,8 @@
+     printf ("\nCouldn't open UilSymReas.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the reason code,
+@@ -925,13 +925,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( resndx=0 ; resndx<wml_obj_reason_ptr->cnt ; resndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[resndx].objptr;
+     fprintf (outfil, "  reason_class_vec%d,\n", resobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1004,8 +1004,8 @@
+     printf ("\nCouldn't open UilSymArTa.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the argument code,
+@@ -1051,13 +1051,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( resndx=0 ; resndx<wml_obj_arg_ptr->cnt ; resndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[resndx].objptr;
+     fprintf (outfil, "  arg_class_vec%d,\n", resobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1129,8 +1129,8 @@
+     printf ("\nCouldn't open UilSymChTa.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the child code,
+@@ -1174,13 +1174,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( childndx=0 ; childndx<wml_obj_child_ptr->cnt ; childndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[childndx].objptr;
+     fprintf (outfil, "  child_class_vec%d,\n", childobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1251,8 +1251,8 @@
+     printf ("\nCouldn't open UilSymCtl.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the class code,
+@@ -1296,13 +1296,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( ctlndx=0 ; ctlndx<wml_obj_class_ptr->cnt ; ctlndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ctlndx].objptr;
+     fprintf (outfil, "  object_class_vec%d,\n", clsobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1438,7 +1438,7 @@
+     printf ("\nCouldn't open UilSymNam.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write entries for widgets
+@@ -1517,7 +1517,7 @@
+     fprintf (outfil, "    \"%s\",\n",
+ 	     synch->name);
+     }
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ 
+ /*
+  * close the output file
+@@ -1621,12 +1621,12 @@
+     printf ("\nCouldn't open UilSymEnum.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Generate the enumeration value vectors for each enumeration set.
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -1643,7 +1643,7 @@
+ /*
+  * Generate the enumeration set tables
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -1655,7 +1655,7 @@
+ /*
+  * Create enumset table entries for arguments, similar to writing sym_k...
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -1669,13 +1669,13 @@
+ /*
+  * Create the enumval values table.
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
+     {
+     evobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
+     fprintf (outfil, "  %s,\n", evobj->syndef->enumlit);
+     }
+-fprintf (outfil, canned5a);
++fprintf (outfil, "%s", canned5a);
+ 
+ /*
+  * close the output file
+@@ -1813,12 +1813,12 @@
+     printf ("\nCouldn't open UilSymCSet.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Generate the standards name table
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1836,7 +1836,7 @@
+ /*
+  * Generate the writing direction table
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1858,7 +1858,7 @@
+ /*
+  * Generate the parsing direction table
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1880,7 +1880,7 @@
+ /*
+  * Generate the character size table
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1906,7 +1906,7 @@
+ /*
+  * Generate the $LANG name recognition table
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ lang_max = 0;
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+@@ -1936,7 +1936,7 @@
+ /*
+  * Generate the $LANG code lookup table, in upper case
+  */
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+--- a/tools/wml/wmloutkey.c
++++ b/tools/wml/wmloutkey.c
+@@ -574,16 +574,16 @@
+     printf ("\nCouldn't open UilKeyTab.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Print the case sensitive and insensitive tables
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ wmlOutputUilKeyTabBody (outfil, wml_tok_sens_ptr, &maxlen, &maxkey);
+ fprintf (outfil, canned2, maxlen, maxkey);
+ wmlOutputUilKeyTabBody (outfil, wml_tok_insens_ptr, &maxlen, &maxkey);
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -812,8 +812,8 @@
+     printf ("\nCouldn't open UilTokName.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Print the token name entries
+--- a/tools/wml/wmloutmm.c
++++ b/tools/wml/wmloutmm.c
+@@ -209,9 +209,9 @@
+ /*
+  * Write out header information
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ fprintf (outfil, "%s\n", name);
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ 
+ /*
+  * Alphabetize the controls, reason, and argument lists
+@@ -287,7 +287,7 @@
+     else
+ 	fprintf (outfil, "\n");
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * Write out the argument table
+@@ -323,7 +323,7 @@
+     }    
+     argndx += 1;
+     }
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ 
+ }
+ 
diff --git a/srcpkgs/motif/patches/03-no-demos.patch b/srcpkgs/motif/patches/03-no-demos.patch
new file mode 100644
index 00000000000..03953c4f8f7
--- /dev/null
+++ b/srcpkgs/motif/patches/03-no-demos.patch
@@ -0,0 +1,53 @@
+Description: Add option to disable building of demos
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1575
+Author: Graham Inggs <graham@nerve.org.za>
+Last-Update: 2013-01-09
+--- a/configure.ac
++++ b/configure.ac
+@@ -311,7 +311,20 @@
+ doc/man/man5/Makefile \
+ tools/Makefile \
+ tools/wml/Makefile \
+-demos/Makefile \
++lib/Xm/xmstring.list \
++])
++
++AC_ARG_ENABLE(demos, [  --disable-demos
++                       Disable building demos])
++
++if test x$enable_demos = x
++then
++    enable_demos="yes"
++fi
++
++if test "$enable_demos" = "yes"
++then
++  AC_CONFIG_FILES([demos/Makefile
+ demos/lib/Makefile \
+ demos/lib/Xmd/Makefile \
+ demos/lib/Wsm/Makefile \
+@@ -395,6 +408,11 @@
+ demos/doc/programGuide/ch17/Makefile \
+ demos/doc/programGuide/ch17/simple_drop/Makefile \
+ demos/doc/programGuide/ch17/simple_drag/Makefile \
+-lib/Xm/xmstring.list \
+-])
++  ])
++  MAYBE_DEMOS=demos
++else
++  MAYBE_DEMOS=
++fi
++AC_SUBST(MAYBE_DEMOS)
++
+ AC_OUTPUT
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -29,6 +29,7 @@
+              tools \
+              clients \
+              doc \
+-             demos
++             $(MAYBE_DEMOS)
++
+ AUTOMAKE_OPTIONS = 1.4
+ ACLOCAL_AMFLAGS = -I .
diff --git a/srcpkgs/motif/patches/06-cast-size_t-to-int.patch b/srcpkgs/motif/patches/06-cast-size_t-to-int.patch
new file mode 100644
index 00000000000..b5ce9c643a7
--- /dev/null
+++ b/srcpkgs/motif/patches/06-cast-size_t-to-int.patch
@@ -0,0 +1,17 @@
+Description: To prevent build failure during building with Hardening options
+ enabled due to "format '%d' expects argument of type 'int', but argument 5 has
+ type 'size_t'", the fifth argument is cast to integer on the input.
+Author: Paul Gevers <elbrus@debian.org>
+Updated: 13-01-2013
+
+--- a/tools/wml/wmloutkey.c
++++ b/tools/wml/wmloutkey.c
+@@ -627,7 +627,7 @@
+     fprintf (outfil, "    {%s, %s, %d, %s, \"%s\"},\n",
+ 	     tkclass,
+ 	     tksym,
+-	     strlen(tokstg),
++	     (int)strlen(tokstg),
+ 	     tktoken,
+ 	     tokstg);
+     if ( (int)strlen(tokstg) > *maxlen )
diff --git a/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch b/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
new file mode 100644
index 00000000000..5ddfd760075
--- /dev/null
+++ b/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
@@ -0,0 +1,118 @@
+Description: lintian reports several typos in manpages. This patch fixes those
+ reported
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1587
+Last-reviewed: 14 Jan 2013
+
+--- a/doc/man/man1/mwm.1
++++ b/doc/man/man1/mwm.1
+@@ -359,7 +359,7 @@
+ (and other associated messages) by saving the geometries of its clients to a state file\&. 
+ \fBmwm\fP can then be restarted by the XSMP session manager\&.
+ The default location for the state file is \fB$HOME/\&.mwmclientdb\fP\&.
+-This location can be overriden with the resource \fBsessionClientDB\fP\&.
++This location can be overridden with the resource \fBsessionClientDB\fP\&.
+ .SS "X Resources"
+ .PP
+ The \fBmwm\fP command is configured from its resource
+--- a/doc/man/man3/VendorShell.3
++++ b/doc/man/man3/VendorShell.3
+@@ -76,7 +76,7 @@
+ to the VendorShell resources for controlling toolTips. VendorShell displays
+ the XmNtooTipString in an XmLabel that is a child of a transientShell. The name
+ of the transientShell is TipShell, and the name of the XmLabel is TipLabel.
+-The appearance of the tip can be controlled by specifing resources on these
++The appearance of the tip can be controlled by specifying resources on these
+ widgets.
+ .PP
+ If an application uses the \fBXmNmwmDecorations\fP,
+--- a/doc/man/man3/XmComboBox.3
++++ b/doc/man/man3/XmComboBox.3
+@@ -581,7 +581,7 @@
+ ComboBox \fBXmNcomboBoxType\fP is
+ \fBXmDROP_DOWN_LIST\fP,
+ \fB<osfActivate>\fP, \fB<osfCancel>\fP, and
+-\fBReturn\fP are overriden by ComboBox actions\&.
++\fBReturn\fP are overridden by ComboBox actions\&.
+ .IP "\fB:c\fP <Key>\fB<osfDown>\fP:" 10
+ CBDropDownList()
+ .IP "\fB:c\fP <Key>\fB<osfUp>\fP:" 10
+--- a/doc/man/man3/XmGetPixmap.3
++++ b/doc/man/man3/XmGetPixmap.3
+@@ -109,7 +109,7 @@
+ In addition to X bitmap files (XBM), Motif also supports XPM (X
+ Pixmap) file formats and, from version 2.3, JPEG and PNG image formats\&.
+ (Note that support of JPEG and PNG image format is an optional feature
+-of Motif, in order to check if current version supports PNG ang JPEG
++of Motif, in order to check if current version supports PNG and JPEG
+ image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked
+ correspondingly.)
+ The \fBXBMLANGPATH\fP specifies the path for
+--- a/doc/man/man3/XmGetPixmapByDepth.3
++++ b/doc/man/man3/XmGetPixmapByDepth.3
+@@ -111,7 +111,7 @@
+ In addition to X bitmap files (XBM), Motif also supports XPM (X
+ Pixmap) file formats, and, from version 2.3, JPEG and PNG image formats\&.
+ (Note that support of JPEG and PNG image format is an optional feature
+-of Motif, in order to check if current version supports PNG ang JPEG
++of Motif, in order to check if current version supports PNG and JPEG
+ image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked
+ correspondingly.)
+ The \fBXBMLANGPATH\fP specifies the path for
+--- a/doc/man/man3/XmHierarchyGetChildNodes.3
++++ b/doc/man/man3/XmHierarchyGetChildNodes.3
+@@ -69,8 +69,8 @@
+ \fBXmHierarchy\fP(3)\&.
+ .SH "RETURN"
+ .PP
+-Returns WidgetList with child nodes of the hierachy, or NULL
+-if the hierachy contains no children\&.
++Returns WidgetList with child nodes of the hierarchy, or NULL
++if the hierarchy contains no children\&.
+ .SH "RELATED"
+ .PP
+ \fBXmHierarchy\fP(3)\&.
+--- a/doc/man/man3/XmManager.3
++++ b/doc/man/man3/XmManager.3
+@@ -502,7 +502,7 @@
+ Indicates whether the posting process should continue\&. The
+ application may modify this field\&.
+ .IP "\fItarget\fP" 10
+-Specifies the most specific widget or gadget that the menu sytem found
++Specifies the most specific widget or gadget that the menu system found
+ from the event that matches the event\&.
+ .SS "Translations"
+ .PP
+--- a/doc/man/man3/XmPrimitive.3
++++ b/doc/man/man3/XmPrimitive.3
+@@ -609,7 +609,7 @@
+ Indicates whether the posting process should continue\&. The
+ application may modify this field\&.
+ .IP "\fItarget\fP" 10
+-Specifies the most specific widget or gadget that the menu sytem found
++Specifies the most specific widget or gadget that the menu system found
+ from the event that matches the event\&.
+ .SS "Translations"
+ .PP
+--- a/doc/man/man3/XmRendition.3
++++ b/doc/man/man3/XmRendition.3
+@@ -71,7 +71,7 @@
+ If a resource in a rendition is unspecified, usually by setting it to
+ \fBXmAS_IS\fP or \fBXmUNSPECIFIED_PIXEL\fP,
+ then the value to be used for that resource is the value of the
+-immediately preceeding rendition in \fBXmString\fR\&. If that value
++immediately preceding rendition in \fBXmString\fR\&. If that value
+ is unspecified, then the preceding value is used, and so on\&. If
+ no renditions specify a value for a resource, then a default value
+ will be used\&.
+--- a/doc/man/man3/XmStringGetNextComponent.3
++++ b/doc/man/man3/XmStringGetNextComponent.3
+@@ -111,7 +111,7 @@
+ \fBXmSTRING_COMPONENT_UNKNOWN\fP\&. The data returned by these
+ components is returned in the \fIunknown_tag\fP, \fIunknown_length\fP,
+ and \fIunknown_value\fP fields\&. This apparent inconsistency is
+-designed to accomodate older applications that may not be equipped to
++designed to accommodate older applications that may not be equipped to
+ handle the newer component types of Motif version 2\&.0 and beyond\&.
+ Consequently, the use of this procedure is not recommended\&. Instead,
+ use the \fBXmStringGetNextTriple\fP procedure, which provides all the
diff --git a/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch b/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
new file mode 100644
index 00000000000..bc1beb029cd
--- /dev/null
+++ b/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
@@ -0,0 +1,156 @@
+Description: lintian reports hyphen misuse in manpages. This patch fixes those
+ reported.
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1588
+Last-reviewed: 06 Feb 2013
+
+--- a/doc/man/man1/mwm.1
++++ b/doc/man/man1/mwm.1
+@@ -904,7 +904,7 @@
+ resizeCursors\aResizeCursors\aT/F\aT
+ transientDecoration\aTransientDecoration\astring\amenu title
+ transientFunctions\aTransientFunctions\astring\aT{
+--minimize-maximize
++\-minimize-maximize
+ T}
+ useIconBox\aUseIconBox\aT/F\aF
+ .TE
+@@ -941,7 +941,7 @@
+ screen size of the icon box window depends on the iconImageMaximum (size)
+ and \fIiconDecoration\fP resources\&. The default value for size
+ is (6 * iconWidth + padding) wide by (1 * iconHeight + padding) high\&. The
+-default value of the location is +0 -0\&.
++default value of the location is +0 \-0\&.
+ .IP "\fIiconBoxName\fP\ (class\  \fIIconBoxName\fP)" 10
+ This resource specifies the name that is used to look up icon box resources\&.
+ The default name is iconbox\&.
+@@ -1059,7 +1059,7 @@
+ This resource is used to indicate which window management functions
+ are applicable (or not applicable) to transient windows\&. The function specification
+ is exactly the same as for the \fIclientFunctions\fP (client
+-specific) resource\&. The default value for this resource is -minimize -maximize\&.
++specific) resource\&. The default value for this resource is \-minimize \-maximize\&.
+ .IP "" 10
+ An application can also specify which functions \fBmwm\fP
+ should apply to its windows\&. If it does so, \fBmwm\fP applies
+@@ -1176,7 +1176,7 @@
+ title\aTitle bar (includes border)\&.
+ .TE
+ .PP
+-Examples: \fIMwm*XClock\&.clientDecoration: -resizeh -maximize\fP This removes the resize handles and maximize button from XClock
++Examples: \fIMwm*XClock\&.clientDecoration: \-resizeh \-maximize\fP This removes the resize handles and maximize button from XClock
+ windows\&. \fIMwm*XClock\&.clientDecoration: menu minimize border\fP This does the same thing as above\&. Note that either \fImenu\fP or \fIminimize\fP implies
+ \fItitle\fP\&.
+ .IP "\fIclientFunctions\fP\ (class\  \fIClientFunctions\fP)" 10
+--- a/doc/man/man4/mwmrc.4
++++ b/doc/man/man4/mwmrc.4
+@@ -84,7 +84,7 @@
+ be specified from the command line:
+ .PP
+ .nf
+-\f(CW/usr/X11R6/bin/X11/mwm -xrm "mwm*configFile: mymwmrc"\fR
++\f(CW/usr/X11R6/bin/X11/mwm \-xrm "mwm*configFile: mymwmrc"\fR
+ .fi
+ .PP
+ .SS "Resource Types"
+--- a/doc/man/man3/XmFontList.3
++++ b/doc/man/man3/XmFontList.3
+@@ -119,7 +119,7 @@
+ without a font list entry tag;
+ .PP
+ .nf
+-\f(CW*fontList:  -Adobe-Times-Medium-I-Normal--10*\fR
++\f(CW*fontList:  \-Adobe\-Times\-Medium\-I\-Normal\-\-10*\fR
+ .fi
+ .PP
+ .PP
+@@ -138,9 +138,9 @@
+ and an explicit font list entry tag\&.
+ .PP
+ .nf
+-\f(CW*fontList: -Adobe-Courier-Bold-R-Normal--25-180-100-100-M-150;\
+--JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240;\
+--JIS-Fixed-Medium-R-Normal--26-180-100-100-C-120:MY_TAG\fR
++\f(CW*fontList: \-Adobe\-Courier\-Bold\-R\-Normal\-\-25\-180\-100\-100\-M\-150;\
++\-JIS\-Fixed\-Medium\-R\-Normal\-\-26\-180\-100\-100\-C\-240;\
++\-JIS\-Fixed\-Medium\-R\-Normal\-\-26\-180\-100\-100\-C\-120:MY_TAG\fR
+ .fi
+ .PP
+ .PP
+--- a/doc/man/man3/XmGetPixmapByDepth.3
++++ b/doc/man/man3/XmGetPixmapByDepth.3
+@@ -245,8 +245,8 @@
+ \f(CW/* XBM file */
+ #define plaid_width 22
+ #define plaid_height 22
+-#define plaid_x_hot -1
+-#define plaid_y_hot -1
++#define plaid_x_hot \-1
++#define plaid_y_hot \-1
+ static char plaid_bits[] = {
+    0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
+    0x75, 0xfd, 0x3f, 0xff, 0x57, 0x15, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
+--- a/doc/man/man3/XmList.3
++++ b/doc/man/man3/XmList.3
+@@ -182,7 +182,7 @@
+ A value of 1 transfers the first item in the List; a value of 2
+ transfers the second item; and so on\&.
+ If the entire contents of the List are being transferred, the value is
+--1\&.
++\-1\&.
+ .PP
+ As a source of data, List supports the following targets and associated
+ conversions of data to these targets:
+--- a/doc/man/man3/XmScreen.3
++++ b/doc/man/man3/XmScreen.3
+@@ -300,7 +300,7 @@
+ startup time, either by placing it within a defaults file or by using the
+ \fB-xrm\fP command line argument\&. For example:
+ .IP "" 10
+-\fBmyProg -xrm "*menuCursor: arrow"\fP
++\fBmyProg \-xrm "*menuCursor: arrow"\fP
+ .IP "" 10
+ The menu cursor can also be selected in the program through
+ the function \fBXmSetMenuCursor\fP\&.
+--- a/doc/man/man3/XmTabListCopy.3
++++ b/doc/man/man3/XmTabListCopy.3
+@@ -71,7 +71,7 @@
+ Specifies where to start copying\&. A value of 0 (zero) indicates begin
+ at the beginning, a value of 1 indicates to skip the first tab, and so
+ on\&. A negative indicates to begin counting backwards from the end\&.
+-A value of -1 indicates to start copying from the last tab\&.
++A value of \-1 indicates to start copying from the last tab\&.
+ .IP "\fIcount\fP" 10
+ Specifies the number of tabs to copy\&. A value of 0 (zero) indicates
+ to copy all elements from the starting point to the end (beginning if
+--- a/doc/man/man3/XmTabListInsertTabs.3
++++ b/doc/man/man3/XmTabListInsertTabs.3
+@@ -83,7 +83,7 @@
+ value of 1 makes it the second tab, and so on\&. If \fIposition\fP is
+ greater than the number of tabs in \fIoldlist\fP, then the tabs will
+ be inserted at the end\&. If \fIposition\fP is negative, the count will
+-be backwards from the end\&. A value of -1 makes the first new tab
++be backwards from the end\&. A value of \-1 makes the first new tab
+ the last tab, and so on\&.
+ .SH "RETURN"
+ .PP
+--- a/doc/man/man5/UIL.5
++++ b/doc/man/man5/UIL.5
+@@ -1211,7 +1211,7 @@
+ 3\&.1415E-2 (equals \&.031415)
+ T}\a2\&.87 e6 (embedded blanks)
+ T{
+--6\&.29e7 (equals -62900000)
++\-6\&.29e7 (equals \-62900000)
+ T}\a2\&.0e100 (out of range)
+ .TE
+ .PP
+@@ -1322,7 +1322,7 @@
+ You can use parentheses to override the normal precedence of operators\&.
+ In a sequence of unary operators, the operations are performed in
+ right-to-left
+-order\&. For example, \fB- + -A\fP is equivalent to \fB-(+(-A))\fP\&.
++order\&. For example, \fB- + \-A\fP is equivalent to \fB\-(+(\-A))\fP\&.
+ In a sequence of binary operators of the same precedence, the operations
+ are performed in left-to-right order\&. For example, \fBA*B/C*D\fP is
+ equivalent to \fB((A*B)/C)*D\fP\&.
diff --git a/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch b/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
new file mode 100644
index 00000000000..90d39a3f0c0
--- /dev/null
+++ b/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
@@ -0,0 +1,25 @@
+Description: lintian reports a typo in libXm. This patch fixes it.
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1589
+Last-reviewed: 06 Feb 2013
+
+--- a/lib/Xm/FontS.c
++++ b/lib/Xm/FontS.c
+@@ -1225,7 +1225,7 @@
+ 
+     if ((fontdata = XLoadQueryFont(XtDisplay((Widget) fsw), font)) == NULL)
+     {
+-	sprintf(buf, "Font '%s'\nis not availiable on this machine", font);
++	sprintf(buf, "Font '%s'\nis not available on this machine", font);
+ 	DisplayUserError(fsw, buf);
+ 	err = True;
+     }
+@@ -1275,7 +1275,7 @@
+ 					   fbuf)) == NULL) 
+ 	    {
+ 		sprintf(buf,
+-			    "Font '%s'\nis not availiable on this machine",
++			    "Font '%s'\nis not available on this machine",
+ 			    font);
+ 		DisplayUserError(fsw, buf);
+ 		    err = True;
diff --git a/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch b/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
new file mode 100644
index 00000000000..cf51d1fa3d4
--- /dev/null
+++ b/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
@@ -0,0 +1,49 @@
+Description: lintian reports bad whatis entries in manpages. Fixing here
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1590
+Last-reviewed: 17 Feb 2013
+
+--- a/doc/man/man3/XmColorSelector.3
++++ b/doc/man/man3/XmColorSelector.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmColorSelector 3X ""
+ .SH NAME
+-The Color Selector widget
++XmColorSelector \- The Color Selector widget
+ .SH SYNOPSIS
+ #include <Xm/ColorS.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmExt18List.3
++++ b/doc/man/man3/XmExt18List.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XxExt18LIst 3x ""
+ .SH NAME
+-The Internationalized Extended List widget
++XmExt18List \- The Internationalized Extended List widget
+ .SH SYNOPSIS
+ #include <Xm/Ext18List.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmFontSelector.3
++++ b/doc/man/man3/XmFontSelector.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmFontSelector 3X ""
+ .SH NAME
+-The Font Selector widget
++XmFontSelector \- The Font Selector widget
+ .SH SYNOPSIS
+ #include <Xm/FontS.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmIconButton.3
++++ b/doc/man/man3/XmIconButton.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmIconButton 3X "15 July 1992"
+ .SH NAME
+-The Icon Button widget
++XmIconButton \- The Icon Button widget
+ .SH SYNOPSIS
+ Documents the XmIconButton widget
+ .SH DESCRIPTION
diff --git a/srcpkgs/motif/patches/11-fix_underlinking.patch b/srcpkgs/motif/patches/11-fix_underlinking.patch
new file mode 100644
index 00000000000..601b0918632
--- /dev/null
+++ b/srcpkgs/motif/patches/11-fix_underlinking.patch
@@ -0,0 +1,564 @@
+Description: Fix underlinking of libXt, libXext and libX11
+ Recent changes to default linker behaviour prevent shared libraries from being
+ indirectly linked, resulting in FTBFS in Ubuntu Raring.
+ .
+ This patch fixes this by explicitly linking libXt, libXext and libX11 wherever
+ necessary.  Demos are patched even though they are not built for distribution.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1583
+Last-Update: 2013-02-26
+--- a/clients/mwm/Makefile.am
++++ b/clients/mwm/Makefile.am
+@@ -9,7 +9,7 @@
+ rc_DATA = system.mwmrc
+ 
+ bin_PROGRAMS = mwm
+-mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la 
++mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la -lXt -lXext -lX11
+ 
+ INCLUDES = -DLARGECURSORS -DR2_COMPAT -DUNMAP_ON_RESTART \
+            -DCDE_INSTALLATION_TOP=\"@CDE_INSTALLATION_TOP@\" \
+--- a/clients/uil/Makefile.am
++++ b/clients/uil/Makefile.am
+@@ -11,9 +11,9 @@
+ UilParser.lo: UilParser.c
+ 	$(LTCOMPILE) -DCALLABLE -c UilParser.c
+ 
+-libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la 
++libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+-uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la 
++uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
+--- a/clients/xmbind/Makefile.am
++++ b/clients/xmbind/Makefile.am
+@@ -2,6 +2,6 @@
+ 
+ bin_PROGRAMS = xmbind
+ 
+-LDADD = ../../lib/Xm/libXm.la
++LDADD = ../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS}
+--- a/demos/doc/programGuide/ch05/Scale/Makefile.am
++++ b/demos/doc/programGuide/ch05/Scale/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch06/combo_box/Makefile.am
++++ b/demos/doc/programGuide/ch06/combo_box/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch06/spin_box/Makefile.am
++++ b/demos/doc/programGuide/ch06/spin_box/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch08/Container/Makefile.am
++++ b/demos/doc/programGuide/ch08/Container/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch08/Notebook/Makefile.am
++++ b/demos/doc/programGuide/ch08/Notebook/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch16/Makefile.am
++++ b/demos/doc/programGuide/ch16/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch17/simple_drag/Makefile.am
++++ b/demos/doc/programGuide/ch17/simple_drag/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch17/simple_drop/Makefile.am
++++ b/demos/doc/programGuide/ch17/simple_drop/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/lib/Exm/wml/Makefile.am
++++ b/demos/lib/Exm/wml/Makefile.am
+@@ -18,7 +18,7 @@
+ 	-I$(top_builddir)/clients/uil \
+ 	${X_CFLAGS} 
+ 
+-LDADD = $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Xm/libXm.la -lXt
+ 
+ DISTCLEANFILES = motif.wmd
+ 
+--- a/demos/lib/Xmd/Makefile.am
++++ b/demos/lib/Xmd/Makefile.am
+@@ -12,7 +12,7 @@
+ Print.h PrintP.h \
+ RegEdit.h RegEditI.h
+ 
+-LDADD = libXmd.a ../../../lib/Xm/libXm.la
++LDADD = libXmd.a ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(srcdir)/../../../lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/ButtonBox/Makefile.am
++++ b/demos/programs/ButtonBox/Makefile.am
+@@ -8,6 +8,6 @@
+ bboxdemo_SOURCES = bboxdemo.c
+ data_DATA = $(EXTRA_DIST) $(bboxdemo_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/ColorSel/Makefile.am
++++ b/demos/programs/ColorSel/Makefile.am
+@@ -7,6 +7,6 @@
+ colordemo_SOURCES = util-c.c colordemo.c
+ EXTRA_DIST = Imakefile
+ data_DATA = $(colordemo_SOURCES) $(EXTRA_DIST)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Column/Makefile.am
++++ b/demos/programs/Column/Makefile.am
+@@ -8,5 +8,5 @@
+ EXTRA_DIST = Imakefile Column.ad
+ data_DATA = $(EXTRA_DIST) $(column_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Combo2/Makefile.am
++++ b/demos/programs/Combo2/Makefile.am
+@@ -8,5 +8,5 @@
+ combo_SOURCES = combo.c
+ data_DATA = $(EXTRA_DIST) $(combo_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Exm/app_in_c/Makefile.am
++++ b/demos/programs/Exm/app_in_c/Makefile.am
+@@ -14,4 +14,4 @@
+            -I$(top_builddir)/lib \
+             ${X_CFLAGS} 
+ LDADD = ../../../lib/Exm/libExm.a \
+-	../../../../lib/Xm/libXm.la
++	../../../../lib/Xm/libXm.la -lXt -lXext -lX11
+--- a/demos/programs/Exm/simple_app/Makefile.am
++++ b/demos/programs/Exm/simple_app/Makefile.am
+@@ -14,5 +14,6 @@
+            -I$(srcdir)/../../../lib \
+            -I$(top_builddir)/lib \
+            ${X_CFLAGS} 
+-LDADD = ../../../../lib/Xm/libXm.la \
+-        ../../../lib/Exm/libExm.a
++LDADD = ../../../lib/Exm/libExm.a \
++        ../../../../lib/Xm/libXm.la -lXt -lX11
++
+--- a/demos/programs/Ext18List/Makefile.am
++++ b/demos/programs/Ext18List/Makefile.am
+@@ -10,6 +10,6 @@
+ EXTRA_DIST = Imakefile
+ data_DATA = $(EXTRA_DIST) $(ext18list_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/FontSel/Makefile.am
++++ b/demos/programs/FontSel/Makefile.am
+@@ -7,6 +7,6 @@
+ fontsel_SOURCES = callbacks-c.c creation-c.c fontsel.c fontsel.h
+ EXTRA_DIST = Imakefile
+ data_DATA = $(EXTRA_DIST) $(fontsel_SOURCES)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/IconB/Makefile.am
++++ b/demos/programs/IconB/Makefile.am
+@@ -8,7 +8,7 @@
+ iconbuttondemo_SOURCES = misc.c  iconbuttondemo.c
+ data_DATA = $(iconbuttondemo_SOURCES) $(EXTRA_DIST)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. \
+            -I$(srcdir)/$(TOPDIR)/lib \
+--- a/demos/programs/Outline/Makefile.am
++++ b/demos/programs/Outline/Makefile.am
+@@ -7,6 +7,6 @@
+ bin_PROGRAMS = outline
+ outline_SOURCES = outline.c
+ data_DATA = $(outline_SOURCES) $(EXTRA_DIST)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Paned/Makefile.am
++++ b/demos/programs/Paned/Makefile.am
+@@ -8,6 +8,6 @@
+ paned_SOURCES = creation-c.c paned.c
+ data_DATA = $(EXTRA_DIST) $(paned_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/TabStack/Makefile.am
++++ b/demos/programs/TabStack/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = Imakefile
+ data_DATA = $(tabstack_SOURCES) $(EXTRA_DIST)            
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Tree/Makefile.am
++++ b/demos/programs/Tree/Makefile.am
+@@ -8,6 +8,6 @@
+ tree_SOURCES = bxutil-c.c  tree.c
+ data_DATA = $(EXTRA_DIST) $(tree_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/airport/Makefile.am
++++ b/demos/programs/airport/Makefile.am
+@@ -8,5 +8,5 @@
+                   dragsource.h dropsite.h main.h
+ EXTRA_DIST = Imakefile XmdAirport.ad README
+ data_DATA = $(airport_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/animate/Makefile.am
++++ b/demos/programs/animate/Makefile.am
+@@ -17,7 +17,7 @@
+ 
+ bin_PROGRAMS = xmanimate
+ 
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib \
+            -I$(srcdir)/../../lib \
+--- a/demos/programs/drag_and_drop/Makefile.am
++++ b/demos/programs/drag_and_drop/Makefile.am
+@@ -10,6 +10,6 @@
+ simpledrop_SOURCES = simpledrop.c
+ data_DATA = $(EXTRA_DIST) $(DNDDemo_SOURCES) $(simpledrop_SOURCES)
+ noinst_HEADERS = DNDDemo.h
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/draw/Makefile.am
++++ b/demos/programs/draw/Makefile.am
+@@ -7,5 +7,5 @@
+ draw_SOURCES = draw.c
+ EXTRA_DIST = Imakefile XmdDraw.ad README draw.help draw.man
+ data_DATA = $(EXTRA_DIST) $(draw_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/earth/Makefile.am
++++ b/demos/programs/earth/Makefile.am
+@@ -7,5 +7,5 @@
+ earth_SOURCES = earth.c
+ EXTRA_DIST = terre.xbm earth.man Imakefile README
+ data_DATA = $(EXTRA_DIST) $(earth_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lXext -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/filemanager/Makefile.am
++++ b/demos/programs/filemanager/Makefile.am
+@@ -11,7 +11,7 @@
+            obj.xpm pix.xpm s_dir.xpm s_exec.xpm s_file.xpm \
+            s_none.xpm s_pix.xpm
+ data_DATA = $(EXTRA_DIST) $(filemanager_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+ 
+--- a/demos/programs/fileview/Makefile.am
++++ b/demos/programs/fileview/Makefile.am
+@@ -11,7 +11,7 @@
+ 
+ UILS= French.uil German.uil English.uil
+ 
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/getsubres/Makefile.am
++++ b/demos/programs/getsubres/Makefile.am
+@@ -7,5 +7,5 @@
+ EXTRA_DIST = getsubres.help getsubres.man README Imakefile
+ getsubres_SOURCES = getsubres.c
+ data_DATA = $(EXTRA_DIST) $(getsubres_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/hellomotif/Makefile.am
++++ b/demos/programs/hellomotif/Makefile.am
+@@ -7,7 +7,7 @@
+ EXTRA_DIST = hellomotif.uil Imakefile README
+ hellomotif_SOURCES = hellomotif.c
+ data_DATA = $(EXTRA_DIST) $(hellomotif_SOURCES) hellomotif.uid
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+ all: hellomotif.uid
+--- a/demos/programs/hellomotifi18n/Makefile.am
++++ b/demos/programs/hellomotifi18n/Makefile.am
+@@ -12,7 +12,7 @@
+ helloint_DEPENDENCIES = helloint.uid C/uid/l_strings.uid english/uid/l_strings.uid french/uid/l_strings.uid hebrew/uid/l_strings.uid japan/uid/l_strings.uid japanese/uid/l_strings.uid swedish/uid/l_strings.uid
+ 
+ INCLUDES = -I$(top_srcdir)/lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la -lXt
+ 
+ SUFFIXES = .uil .uid
+ 
+--- a/demos/programs/i18ninput/Makefile.am
++++ b/demos/programs/i18ninput/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = XmdI18nInput.ad README i18ninput.man i18ninput.help \
+              Imakefile
+ data_DATA = $(EXTRA_DIST) $(i18ninput_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/panner/Makefile.am
++++ b/demos/programs/panner/Makefile.am
+@@ -7,5 +7,5 @@
+ panner_SOURCES = panner.c
+ EXTRA_DIST = README panner.man Imakefile
+ data_DATA = $(EXTRA_DIST) $(panner_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/periodic/Makefile.am
++++ b/demos/programs/periodic/Makefile.am
+@@ -7,7 +7,7 @@
+ EXTRA_DIST = periodic.uil periodic_l.uil XmdPeriodic.ad Imakefile README
+ periodic_SOURCES = periodic.c
+ data_DATA = $(EXTRA_DIST) $(periodic_SOURCES) periodic.uid
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/piano/Makefile.am
++++ b/demos/programs/piano/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = piano.images README Inv8_part1.piano Inv8_part2.piano \
+              piano.man Imakefile
+ data_DATA  = $(EXTRA_DIST) $(piano_SOURCES) 
+-LDADD = ../../../lib/Xm/libXm.la -lm
++LDADD = ../../../lib/Xm/libXm.la -lm -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/popups/Makefile.am
++++ b/demos/programs/popups/Makefile.am
+@@ -7,6 +7,6 @@
+ autopopups_SOURCES = autopopups.c
+ EXTRA_DIST = README autopopups.man Imakefile
+ data_DATA = $(EXTRA_DIST) $(autopopups_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/sampler2_0/Makefile.am
++++ b/demos/programs/sampler2_0/Makefile.am
+@@ -10,6 +10,6 @@
+ bin_PROGRAMS = sampler2_0
+ sampler2_0_SOURCES = sampler2_0.c
+ data_DATA = $(sampler2_0_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/setdate/Makefile.am
++++ b/demos/programs/setdate/Makefile.am
+@@ -7,6 +7,6 @@
+ EXTRA_DIST = XmdSetDate.ad README setDate.man Imakefile
+ setDate_SOURCES = setDate.c
+ data_DATA = $(EXTRA_DIST) $(setDate_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/todo/Makefile.am
++++ b/demos/programs/todo/Makefile.am
+@@ -9,4 +9,4 @@
+ data_DATA = $(EXTRA_DIST) $(todo_SOURCES)
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la 
++LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la -lXt -lXext -lX11
+--- a/demos/programs/tooltips/Makefile.am
++++ b/demos/programs/tooltips/Makefile.am
+@@ -7,6 +7,6 @@
+ bin_PROGRAMS = tooltips
+ tooltips_SOURCES = tooltips.c
+ data_DATA = $(tooltips_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/workspace/Makefile.am
++++ b/demos/programs/workspace/Makefile.am
+@@ -11,4 +11,4 @@
+               wsm.h wsmSend.h wsmStruct.h wsm_ui.h xrmLib.h
+ data_DATA = $(wsm_SOURCES) $(EXTRA_DIST)
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm
++LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm -lXt -lX11
+--- a/demos/unsupported/aicon/Makefile.am
++++ b/demos/unsupported/aicon/Makefile.am
+@@ -2,7 +2,7 @@
+ 
+ noinst_PROGRAMS = aicon
+  
+-LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la 
++LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/unsupported/dainput/Makefile.am
++++ b/demos/unsupported/dainput/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ dainput_SOURCES = dainput.c dainput_dlg.c dainput_ui.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/dogs/Makefile.am
++++ b/demos/unsupported/dogs/Makefile.am
+@@ -16,7 +16,7 @@
+ 
+ dogs_DEPENDENCIES = dogs.uid
+ 
+-LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/unsupported/hellomotif/Makefile.am
++++ b/demos/unsupported/hellomotif/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = hellomotif.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/motifshell/Makefile.am
++++ b/demos/unsupported/motifshell/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = motifshell.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmapdef/Makefile.am
++++ b/demos/unsupported/xmapdef/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmapdef.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmfonts/Makefile.am
++++ b/demos/unsupported/xmfonts/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmfonts.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmforc/Makefile.am
++++ b/demos/unsupported/xmforc/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmforc.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmform/Makefile.am
++++ b/demos/unsupported/xmform/Makefile.am
+@@ -6,6 +6,6 @@
+ 
+ EXTRA_DIST = Imakefile
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS}
+--- a/tools/wml/Makefile.am
++++ b/tools/wml/Makefile.am
+@@ -30,7 +30,7 @@
+ wml_LDADD = -L. -lwml
+ wml_DEPENDENCIES = libwml.a
+ 
+-wmldbcreate_LDADD = ../../lib/Xm/libXm.la
++wmldbcreate_LDADD = ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I../../lib -I$(srcdir)/../../lib -I$(srcdir)/../../include ${X_CFLAGS} 
+ 
diff --git a/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch b/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
new file mode 100644
index 00000000000..6d532859d73
--- /dev/null
+++ b/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
@@ -0,0 +1,54 @@
+Description: Fix hardcoded path to /usr/lib/X11/rgb.txt in lib/Xm/ColorS.c
+ LibXm is hardcoded to read rgb.txt from /usr/lib/X11 but this file, provided
+ by x11-common in Debian, is located in /etc/X11 and /usr/share/X11 via symlink.
+ .
+ This patch fixes this by allowing the directory in which rgb.txt resides to be
+ customized by the --with-x11rgbdir=DIR configure option.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1585
+Last-Update: 2013-03-12
+--- a/configure.ac
++++ b/configure.ac
+@@ -189,6 +189,10 @@
+ XMBINDDIR_FALLBACK="$xmbinddir"
+ AC_SUBST(XMBINDDIR_FALLBACK)
+ 
++AC_ARG_WITH(x11rgbdir, [  --with-x11rgbdir=DIR  rgb.txt is located in DIR], x11rgbdir=$withval, x11rgbdir="/usr/lib/X11")
++X11RGBPATH="$x11rgbdir/rgb.txt"
++AC_SUBST(X11RGBPATH)
++
+ RM="rm -f"
+ AC_SUBST(RM)
+ 
+--- a/lib/Xm/ColorS.c
++++ b/lib/Xm/ColorS.c
+@@ -123,6 +123,10 @@
+  *       STATIC DECLARATIONS
+  ************************************************************/
+ 
++#ifndef X11RGBPATH
++#define X11RGBPATH "/usr/lib/X11/rgb.txt"
++#endif
++
+ static XtResource resources[] =
+ {
+   {
+@@ -146,7 +150,7 @@
+   {
+     XmNrgbFile, XmCString, XmRString,
+     sizeof(String), XtOffsetOf(XmColorSelectorRec, cs.rgb_file),
+-    XmRString, (XtPointer) "/usr/lib/X11/rgb.txt"
++    XmRString, (XtPointer) X11RGBPATH
+   },
+ #endif
+   {
+--- a/lib/Xm/Makefile.am
++++ b/lib/Xm/Makefile.am
+@@ -8,6 +8,7 @@
+ INCLUDES = -I.. -I$(srcdir)/.. -DXMBINDDIR_FALLBACK=\"@XMBINDDIR_FALLBACK@\" \
+            -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
++           -DX11RGBPATH=\"@X11RGBPATH@\" \
+            ${X_CFLAGS}
+ xmdir = $(includedir)/Xm
+ 
diff --git a/srcpkgs/motif/patches/15-link_uil_against_libuil.patch b/srcpkgs/motif/patches/15-link_uil_against_libuil.patch
new file mode 100644
index 00000000000..11792a7a4c8
--- /dev/null
+++ b/srcpkgs/motif/patches/15-link_uil_against_libuil.patch
@@ -0,0 +1,29 @@
+Description: Link the uil executable against libUil
+ Linking the uil executable againt libUil instead of compiling with the libUil
+ code results in a reduction in size of the uil executable from about 348KB
+ to about 16KB.
+ .
+ This patch originates from Red Hat.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1586
+Last-Update: 2013-03-12
+--- a/clients/uil/Makefile.am
++++ b/clients/uil/Makefile.am
+@@ -13,7 +13,7 @@
+ 
+ libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+-uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
++uil_LDADD = libUil.la ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
+@@ -42,7 +42,7 @@
+ 		UilLstMac.c	UilSemVal.c	UilSemCSet.c	UilDB.c
+ 
+ SRCS =		$(COMMON_SRC)
+-SRCS2 =		$(COMMON_SRC)	UilMain.c
++SRCS2 =		UilMain.c
+ 
+ HEADERS_1 = 	Uil.h		UilSymGl.h	UilSymDef.h \
+ 		UilDef.h	XmAppl.uil
diff --git a/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch b/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
new file mode 100644
index 00000000000..95a753e083e
--- /dev/null
+++ b/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
@@ -0,0 +1,17 @@
+Description: Fix undefined use of sprintf
+ This patch fixes the undefined use of sprintf when the
+ source and destination buffers overlap.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1628
+Last-Update: 2013-09-24
+--- a/lib/Xm/XmRenderT.c
++++ b/lib/Xm/XmRenderT.c
+@@ -2703,7 +2703,7 @@
+       number = tlist -> count;
+       tab = (_XmTab) tlist -> start;
+       while(number > 0) {
+-	sprintf(temp, "%s %f %d %d %d, ", temp, tab -> value, 
++	sprintf(temp + strlen(temp), " %f %d %d %d, ", tab -> value,
+ 		tab -> units, tab -> alignment, tab -> offsetModel);
+ 	tab = (_XmTab) tab -> next;
+ 	number--;
diff --git a/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch b/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
new file mode 100644
index 00000000000..a77b8793a8e
--- /dev/null
+++ b/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
@@ -0,0 +1,384 @@
+Description: Switch to system iswspace() function
+ This patch replaces calls to _XmDataFieldIsWSpace() in lib/Xm/DataF.c
+ and _XmTextFieldIsWSpace() in lib/Xm/TextF.c with calls to the system
+ iswspace() function.
+ .
+ It fixes an array bounds error in lib/Xm/DataF.c where 
+ _XmDataFieldIsWSpace() is called with num_entries = 3.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1629
+Last-Update: 2013-11-18
+--- a/lib/Xm/DataF.c
++++ b/lib/Xm/DataF.c
+@@ -208,7 +208,6 @@
+ static Boolean df_VerifyLeave() ;
+ static Boolean _XmDataFieldIsWordBoundary() ;
+ static int _XmGetImage(Screen *, char *, XImage **);
+-static Boolean _XmDataFieldIsWSpace() ;
+ static void df_FindWord() ;
+ static void df_FindPrevWord() ;
+ static void df_FindNextWord() ;
+@@ -549,10 +548,6 @@
+                         XmDataFieldWidget tf,
+                         XmTextPosition pos1,
+                         XmTextPosition pos2) ;
+-static Boolean _XmDataFieldIsWSpace( 
+-                        wchar_t wide_char,
+-                        wchar_t *white_space,
+-                        int num_entries) ;
+ static void df_FindWord( 
+                         XmDataFieldWidget tf,
+                         XmTextPosition begin,
+@@ -4549,40 +4544,6 @@
+    return False;
+ }
+ 
+-/* This routine accepts an array of wchar_t's containing wchar encodings
+- * of whitespace characters (and the number of array elements), comparing
+- * the wide character passed to each element of the array.  If a match
+- * is found, we got a white space.  This routine exists only because
+- * iswspace(3c) is not yet standard.  If a system has isw* available,
+- * calls to this routine should be changed to iswspace(3c) (and callers
+- * should delete initialization of the array), and this routine should
+- * be deleted.  Its a stop gap measure to avoid allocating an instance
+- * variable for the white_space array and/or declaring a widget wide
+- * global for the data and using a macro.  Its ugly, but it works and 
+- * in the long run will be replaced by standard functionality. */
+-
+-/* ARGSUSED */
+-static Boolean
+-#ifdef _NO_PROTO
+-_XmDataFieldIsWSpace( wide_char, white_space, num_entries )
+-	wchar_t wide_char ;
+-	wchar_t * white_space ;
+-	int num_entries ;
+-#else
+-_XmDataFieldIsWSpace(
+-	wchar_t wide_char,
+-	wchar_t * white_space ,
+-	int num_entries )
+-#endif /* _NO_PROTO */
+-{
+-   int i;
+-
+-   for (i=num_entries; i > 0; i--){
+-      if (wide_char == white_space[i]) return True;
+-   }
+-   return False;
+-}
+-
+ static void 
+ #ifdef _NO_PROTO
+ df_FindWord( tf, begin, left, right )
+@@ -4599,7 +4560,6 @@
+ #endif /* _NO_PROTO */
+ {
+     XmTextPosition start, end;
+-    wchar_t white_space[3];
+ 
+     if (XmTextF_max_char_size(tf) == 1) {
+        for (start = begin; start > 0; start--) {
+@@ -4617,11 +4577,8 @@
+        }
+        *right = end - 1;
+     } else { /* check for iswspace and iswordboundary in each direction */
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+        for (start = begin; start > 0; start --) {
+-          if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start-1],white_space, 3)
++          if (iswspace(XmTextF_wc_value(tf)[start-1])
+ 	      || _XmDataFieldIsWordBoundary(tf, (XmTextPosition) start - 1, 
+ 					    start)) {
+ 		 break;
+@@ -4630,7 +4587,7 @@
+        *left = start;
+ 
+        for (end = begin; end <= XmTextF_string_length(tf); end++) {
+-	   if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)){
++	   if (iswspace(XmTextF_wc_value(tf)[end])){
+ 	      end++;
+ 	      break;
+ 	   } else if (end < XmTextF_string_length(tf)) {
+@@ -4659,14 +4616,6 @@
+ {
+ 
+     XmTextPosition start = XmTextF_cursor_position(tf);
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+-
+ 
+     if (XmTextF_max_char_size(tf) == 1) {
+        if ((start > 0) && 
+@@ -4680,11 +4629,9 @@
+        }
+        df_FindWord(tf, start, left, right);
+     } else { 
+-       if ((start > 0) && (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start - 1],
+-						white_space, 3))) {
++       if ((start > 0) && (iswspace(XmTextF_wc_value(tf)[start - 1]))) {
+           for (; start > 0; start--) {
+-	     if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start -1], 
+-				       white_space, 3)){
++	     if (!iswspace(XmTextF_wc_value(tf)[start -1])){
+ 		start--;
+ 		break;
+              }
+@@ -4713,14 +4660,6 @@
+ {
+ 
+     XmTextPosition end = XmTextF_cursor_position(tf);
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+-
+ 
+     if(XmTextF_max_char_size(tf) == 1) {
+        if (isspace((int)(unsigned char)XmTextF_value(tf)[end])) {
+@@ -4742,9 +4681,9 @@
+        if (*right < XmTextF_string_length(tf))
+           *right = *right - 1;
+    } else {
+-      if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) {
++      if (iswspace(XmTextF_wc_value(tf)[end])) {
+ 	 for ( ; end < XmTextF_string_length(tf); end ++) {
+-	   if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) {
++	   if (!iswspace(XmTextF_wc_value(tf)[end])) {
+ 	       break;
+            }
+          }
+@@ -4758,10 +4697,9 @@
+        * If word boundary caused by whitespace, set right to the last 
+        * whitespace following the end of the current word.
+        */
+-      if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], white_space, 3))      {
++      if (iswspace(XmTextF_wc_value(tf)[(int)*right]))      {
+          while (*right < XmTextF_string_length(tf) &&
+-               _XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], 
+-				    white_space, 3)) {
++               iswspace(XmTextF_wc_value(tf)[(int)*right])) {
+             *right = *right + 1;
+ 	 }
+ 	 if (*right < XmTextF_string_length(tf))
+@@ -5872,13 +5810,6 @@
+ {
+     XmDataFieldWidget tf = (XmDataFieldWidget) w;
+     XmTextPosition cursorPos, position, dummy;
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+ 
+     cursorPos = XmTextF_cursor_position(tf);
+ 
+@@ -5896,16 +5827,13 @@
+              }
+           }
+        } else {
+-	  if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[cursorPos],
+-				   white_space, 3))
++	  if (iswspace(XmTextF_wc_value(tf)[cursorPos]))
+ 	     df_FindWord(tf, cursorPos, &dummy, &position);
+ 	  else
+ 	     df_FindNextWord(tf, &dummy, &position);
+-          if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position],
+-				   white_space, 3)){
++          if (iswspace(XmTextF_wc_value(tf)[position])){
+ 	     for (; position < XmTextF_string_length(tf); position++) {
+-		if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position], 
+-					  white_space, 3))
++		if (!iswspace(XmTextF_wc_value(tf)[position]))
+ 		   break;
+ 	     }
+ 	  }
+--- a/lib/Xm/TextF.c
++++ b/lib/Xm/TextF.c
+@@ -360,10 +360,6 @@
+ 					  XmTextPosition pos1,
+ 					  XmTextPosition pos2);
+ 
+-static Boolean _XmTextFieldIsWSpace(wchar_t wide_char,
+-				    wchar_t *white_space,
+-				    int num_entries);
+-
+ static void FindWord(XmTextFieldWidget tf,
+ 		     XmTextPosition begin,
+ 		     XmTextPosition *left,
+@@ -3514,32 +3510,6 @@
+   return False;
+ }
+ 
+-/* This routine accepts an array of wchar_t's containing wchar encodings
+- * of whitespace characters (and the number of array elements), comparing
+- * the wide character passed to each element of the array.  If a match
+- * is found, we got a white space.  This routine exists only because
+- * iswspace(3c) is not yet standard.  If a system has isw* available,
+- * calls to this routine should be changed to iswspace(3c) (and callers
+- * should delete initialization of the array), and this routine should
+- * be deleted.  Its a stop gap measure to avoid allocating an instance
+- * variable for the white_space array and/or declaring a widget wide
+- * global for the data and using a macro.  Its ugly, but it works and 
+- * in the long run will be replaced by standard functionality. */
+-
+-/* ARGSUSED */
+-static Boolean
+-_XmTextFieldIsWSpace(wchar_t wide_char,
+-		     wchar_t * white_space ,
+-		     int num_entries)
+-{
+-  int i;
+-  
+-  for (i=0; i < num_entries; i++) {
+-    if (wide_char == white_space[i]) return True;
+-  }
+-  return False;
+-}
+-
+ static void 
+ FindWord(XmTextFieldWidget tf,
+ 	 XmTextPosition begin,
+@@ -3547,7 +3517,6 @@
+ 	 XmTextPosition *right)
+ {
+   XmTextPosition start, end;
+-  wchar_t white_space[3];
+   
+   if (tf->text.max_char_size == 1) {
+     for (start = begin; start > 0; start--) {
+@@ -3565,11 +3534,8 @@
+     }
+     *right = end - 1;
+   } else { /* check for iswspace and iswordboundary in each direction */
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+     for (start = begin; start > 0; start --) {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start-1],white_space, 3)
++      if (iswspace(TextF_WcValue(tf)[start-1])
+ 	  || _XmTextFieldIsWordBoundary(tf, (XmTextPosition) start - 1, 
+ 					start)) {
+ 	break;
+@@ -3578,7 +3544,7 @@
+     *left = start;
+     
+     for (end = begin; end <= tf->text.string_length; end++) {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++      if (iswspace(TextF_WcValue(tf)[end])) {
+ 	end++;
+ 	break;
+       } else if (end < tf->text.string_length) {
+@@ -3599,14 +3565,6 @@
+ {
+   
+   XmTextPosition start = TextF_CursorPosition(tf);
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+-  
+   
+   if (tf->text.max_char_size == 1) {
+     if ((start > 0) && 
+@@ -3620,11 +3578,9 @@
+     }
+     FindWord(tf, start, left, right);
+   } else { 
+-    if ((start > 0) && (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start - 1],
+-					     white_space, 3))) {
++    if ((start > 0) && (iswspace(TextF_WcValue(tf)[start - 1]))) {
+       for (; start > 0; start--) {
+-	if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[start -1], 
+-				  white_space, 3)) {
++	if (!iswspace(TextF_WcValue(tf)[start -1])) {
+ 	  start--;
+ 	  break;
+ 	}
+@@ -3645,14 +3601,6 @@
+ {
+   
+   XmTextPosition end = TextF_CursorPosition(tf);
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+-  
+   
+   if(tf->text.max_char_size == 1) {
+     if (isspace((unsigned char)TextF_Value(tf)[end])) {
+@@ -3674,9 +3622,9 @@
+     if (*right < tf->text.string_length)
+       *right = *right - 1;
+   } else {
+-    if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++    if (iswspace(TextF_WcValue(tf)[end])) {
+       for (; end < tf->text.string_length; end ++) {
+-	if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++	if (!iswspace(TextF_WcValue(tf)[end])) {
+ 	  break;
+ 	}
+       }
+@@ -3690,10 +3638,9 @@
+      * If word boundary caused by whitespace, set right to the last 
+      * whitespace following the end of the current word.
+      */
+-    if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], white_space, 3)) {
++    if (iswspace(TextF_WcValue(tf)[(int)*right])) {
+       while (*right < tf->text.string_length &&
+-	     _XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], 
+-				  white_space, 3)) {
++	     iswspace(TextF_WcValue(tf)[(int)*right])) {
+ 	*right = *right + 1;
+       }
+       if (*right < tf->text.string_length)
+@@ -4546,13 +4493,6 @@
+ {
+   XmTextFieldWidget tf = (XmTextFieldWidget) w;
+   XmTextPosition cursorPos, position, dummy;
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+   
+   cursorPos = TextF_CursorPosition(tf);
+   
+@@ -4570,16 +4510,13 @@
+ 	}
+       }
+     } else {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[cursorPos],
+-			       white_space, 3))
++      if (iswspace(TextF_WcValue(tf)[cursorPos]))
+ 	FindWord(tf, cursorPos, &dummy, &position);
+       else
+ 	FindNextWord(tf, &dummy, &position);
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[position],
+-			       white_space, 3)) {
++      if (iswspace(TextF_WcValue(tf)[position])) {
+ 	for (; position < tf->text.string_length; position++) {
+-	  if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[position], 
+-				    white_space, 3))
++	  if (!iswspace(TextF_WcValue(tf)[position]))
+ 	    break;
+ 	}
+       }
diff --git a/srcpkgs/motif/patches/20-cross-compile.patch b/srcpkgs/motif/patches/20-cross-compile.patch
new file mode 100644
index 00000000000..1994b26cc4a
--- /dev/null
+++ b/srcpkgs/motif/patches/20-cross-compile.patch
@@ -0,0 +1,15 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,10 +3,10 @@
+ AC_CONFIG_SRCDIR([lib/Xm/Form.c])
+ AC_PREREQ(2.52)
+ AC_CONFIG_AUX_DIR(.)
+-AC_CHECK_FILE(/usr/X/include/X11/X.h,
++AS_IF([test -f "/usr/X/include/X11/X.h"],
+   AC_PREFIX_DEFAULT(/usr/X),
+   AC_PREFIX_DEFAULT(/usr))
+-AC_CHECK_FILE(/usr/X11R6/include/X11/X.h,
++AS_IF([test -f "/usr/X11R6/include/X11/X.h"],
+   AC_PREFIX_DEFAULT(/usr/X11R6),
+   AC_PREFIX_DEFAULT(/usr))
+ 
diff --git a/srcpkgs/motif/template b/srcpkgs/motif/template
new file mode 100644
index 00000000000..8842817b4c2
--- /dev/null
+++ b/srcpkgs/motif/template
@@ -0,0 +1,68 @@
+# Template file for 'motif'
+pkgname=motif
+version=2.3.8
+revision=1
+build_style=gnu-configure
+build_helper=qemu
+configure_args="--disable-jpeg --disable-png --enable-xft --disable-demos"
+hostmakedepends="pkg-config automake libtool flex"
+makedepends="libX11-devel libXft-devel libXt-devel libXpm-devel libXext-devel xbitmaps"
+short_desc="User interface component toolkit"
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://sourceforge.net/projects/motif/"
+distfiles="${SOURCEFORGE_SITE}/motif/Motif%20${version}%20Source%20Code/motif-${version}.tar.gz"
+checksum=859b723666eeac7df018209d66045c9853b50b4218cecadb794e2359619ebce7
+replaces="lesstif>=0"
+patch_args="-Np1"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" $makedepends"
+fi
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		vsed -i lib/Xm/Makefile.am -e 's|$(top_builddir)/config/util/makestr|/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e 's|\./wmluiltok|/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e 's|\./wml |/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e '/motif.wmd:/a	\\tsed -i "s|      exec|& /usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static |" wmldbcreate'
+	fi
+	touch NEWS AUTHORS
+	autoreconf -fi
+	vsed -i tools/wml/wmluiltok.l -e '1i %option main'
+}
+
+motif-devel_package() {
+	short_desc+=" - development files"
+	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	replaces="lesstif-devel>=0"
+	pkg_install() {
+		vmove usr/bin/uil
+		vmove usr/share/man/man3
+		vmove usr/share/man/man1/uil.1
+		vmove usr/share/man/man5
+		vmove usr/include
+		vmove "usr/lib/*.so"
+	}
+}
+
+motif-mwm_package() {
+	short_desce="Motif window manager"
+	depends="${sourcepkg}>=${version}_${revision}"
+	replaces="lesstif-mwm>=0"
+	pkg_install() {
+		vmove usr/bin/mwm
+		vmove usr/share/man/man1/mwm.1
+		vmove usr/share/man/man4/mwmrc.4
+		vmove usr/lib/X11/system.mwmrc
+	}
+}
+
+motif-xmbind_package() {
+	short_desc="Configures the virtual key bindings of Motif applications"
+	replaces="lesstif-xmbind>=0"
+	pkg_install() {
+		vmove usr/bin/xmbind
+		vmove usr/share/man/man1/xmbind.1
+	}
+}

From 2d9e6844e1924eb77b53afa88a89be30465dae66 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:21:15 -0700
Subject: [PATCH 2/5] lesstif: remove deprecated package

---
 srcpkgs/lesstif-devel    |  1 -
 srcpkgs/lesstif-mwm      |  1 -
 srcpkgs/lesstif-xmbind   |  1 -
 srcpkgs/lesstif/template | 67 ----------------------------------------
 4 files changed, 70 deletions(-)
 delete mode 120000 srcpkgs/lesstif-devel
 delete mode 120000 srcpkgs/lesstif-mwm
 delete mode 120000 srcpkgs/lesstif-xmbind
 delete mode 100644 srcpkgs/lesstif/template

diff --git a/srcpkgs/lesstif-devel b/srcpkgs/lesstif-devel
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-devel
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif-mwm b/srcpkgs/lesstif-mwm
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-mwm
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif-xmbind b/srcpkgs/lesstif-xmbind
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-xmbind
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif/template b/srcpkgs/lesstif/template
deleted file mode 100644
index 96b858d5a64..00000000000
--- a/srcpkgs/lesstif/template
+++ /dev/null
@@ -1,67 +0,0 @@
-# Template file for 'lesstif'
-pkgname=lesstif
-version=0.95.2
-revision=6
-build_style=gnu-configure
-configure_args="--prefix=/usr --mandir=/usr/share/man --docdir=/usr/share/doc
- --with-xdnd --enable-production --enable-nonstandard-conversions
- --enable-editres --enable-build-21 --disable-static --disable-debug
- --x-includes=/usr/include --x-libraries=/usr/lib"
-hostmakedepends="pkg-config"
-makedepends="libXt-devel libXp-devel libXft-devel"
-short_desc="LGPL'd re-implementation of Motif"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="LGPL-2.1"
-homepage="http://lesstif.sourceforge.net/"
-distfiles="${SOURCEFORGE_SITE}/lesstif/lesstif-${version}.tar.bz2"
-checksum=eb4aa38858c29a4a3bcf605cfe7d91ca41f4522d78d770f69721e6e3a4ecf7e3
-
-pre_build() {
-	if [ -n "$CROSS_BUILD" ]; then
-		cd ${wrksrc}/scripts
-		msg_normal "Building man2html for $XBPS_ARCH\n"
-		cc -o man2html man2html.c
-		# Disable the rule for cross-gcc man2html
-		sed -i Makefile -e "/noinst_PROGRAMS = / s/man2html.*//"
-	fi
-}
-post_install() {
-	rm -rf $DESTDIR/usr/LessTif
-}
-
-lesstif-mwm_package() {
-	short_desc="LessTif clone of the Motif Window Manager"
-	pkg_install() {
-		vmove usr/bin/mwm
-		vmove usr/lib/X11/mwm
-		vmove usr/share/man/man1/mwm.1
-		vmove usr/share/man/man5/mwmrc.5
-		vmove usr/lib/X11/app-defaults/Mwm
-	}
-}
-
-lesstif-xmbind_package() {
-	short_desc="Configures the virtual key bindings of LessTif applications"
-	pkg_install() {
-		vmove usr/bin/xmbind
-		vmove usr/share/man/man1/xmbind.1
-	}
-}
-
-lesstif-devel_package() {
-	depends="${sourcepkg}>=${version}_${revision}"
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove "usr/lib/*.so"
-		vmove usr/share/man/man3
-		vmove usr/share/man/man1/ltversion.1
-		vmove usr/share/man/man1/uil.1
-		vmove usr/share/man/man1/lesstif.1
-		vmove usr/share/man/man5/VirtualBindings.5
-		vmove usr/lib/LessTif
-		vmove usr/bin/uil
-		vmove usr/bin/mxmkmf
-		vmove usr/bin/motif-config
-	}
-}

From 6429678c5ee0438b2f04f7b86d8ea155779a179d Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:15:49 -0700
Subject: [PATCH 3/5] xastir: rebuild with motif

---
 srcpkgs/xastir/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/xastir/template b/srcpkgs/xastir/template
index b6b9de5ee2f..459769cbe1b 100644
--- a/srcpkgs/xastir/template
+++ b/srcpkgs/xastir/template
@@ -1,7 +1,7 @@
 # Template file for 'xastir'
 pkgname=xastir
 version=2.1.4
-revision=1
+revision=2
 archs="i686 x86_64 ppc64le"
 wrksrc="Xastir-Release-${version}"
 build_style=gnu-configure

From 0ac17ba8f0e5220dccea815a2ed5decf62141007 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:16:21 -0700
Subject: [PATCH 4/5] ddd: rebuild with motif

---
 srcpkgs/ddd/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/ddd/template b/srcpkgs/ddd/template
index 02ab5304bc7..249dd115893 100644
--- a/srcpkgs/ddd/template
+++ b/srcpkgs/ddd/template
@@ -1,7 +1,7 @@
 # Template build file for 'ddd'.
 pkgname=ddd
 version=3.3.12
-revision=5
+revision=6
 build_style=gnu-configure
 makedepends="ncurses-devel libXt-devel libXext-devel libXmu-devel lesstif-devel"
 short_desc="Graphical front-end for command-line debuggers"

From a8d6a22e6b051f290fe53cc066cfba2e3cb72a27 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:17:41 -0700
Subject: [PATCH 5/5] yeahwm: rebuild with motif

---
 srcpkgs/yeahwm/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/yeahwm/template b/srcpkgs/yeahwm/template
index ca7af56230a..100e28e784b 100644
--- a/srcpkgs/yeahwm/template
+++ b/srcpkgs/yeahwm/template
@@ -1,10 +1,10 @@
 # Template file for 'yeahwm'
 pkgname=yeahwm
 version=0.3.5
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="XROOT=\${XBPS_CROSS_BASE}/usr"
-makedepends="lesstif-devel libX11-devel libXinerama-devel"
+makedepends="motif-devel libX11-devel libXinerama-devel"
 short_desc="A h* window manager for X based on evilwm and aewm"
 maintainer="Ananteris <ananteris@mailinator.com>"
 license="Public Domain"

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR REVIEW] New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
@ 2020-11-04 20:12 ` ericonr
  2020-11-04 20:18 ` [PR PATCH] [Updated] " abenson
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ericonr @ 2020-11-04 20:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

New review comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/26134#discussion_r517603617

Comment:
This one still has `lesstif-devel`.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
  2020-11-04 20:12 ` [PR REVIEW] " ericonr
@ 2020-11-04 20:18 ` abenson
  2020-11-04 20:19 ` [PR REVIEW] " abenson
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: abenson @ 2020-11-04 20:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

There is an updated pull request by abenson against master on the void-packages repository

https://github.com/abenson/void-packages np_motifwqemu
https://github.com/void-linux/void-packages/pull/26134

New package: motif-2.3.8


A patch file from https://github.com/void-linux/void-packages/pull/26134.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-np_motifwqemu-26134.patch --]
[-- Type: text/x-diff, Size: 87033 bytes --]

From cf48fc32d76a4d2402ca0f9b4d1b5cfc03b8bb81 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 21:11:58 -0700
Subject: [PATCH 1/5] New package: motif-2.3.8

---
 common/shlibs                                 |   6 +-
 srcpkgs/motif-demos                           |   1 +
 srcpkgs/motif-devel                           |   1 +
 srcpkgs/motif-mwm                             |   1 +
 srcpkgs/motif-xmbind                          |   1 +
 .../patches/02-fix-format-security.patch      | 607 ++++++++++++++++++
 srcpkgs/motif/patches/03-no-demos.patch       |  53 ++
 .../motif/patches/06-cast-size_t-to-int.patch |  17 +
 ...7-fix_lintian_reported_manpage_typos.patch | 118 ++++
 .../patches/08-fix_hyphen_in_man_pages.patch  | 156 +++++
 .../motif/patches/09-fix_typo_in_libxm.patch  |  25 +
 .../10-fix_manpage-has-bad-whatis-entry.patch |  49 ++
 .../motif/patches/11-fix_underlinking.patch   | 564 ++++++++++++++++
 .../13-fix_hardcoded_x11rgb_path.patch        |  54 ++
 .../patches/15-link_uil_against_libuil.patch  |  29 +
 .../16-fix-undefined-use-of-sprintf.patch     |  17 +
 .../17-switch-to-system-iswspace.patch        | 384 +++++++++++
 srcpkgs/motif/patches/20-cross-compile.patch  |  15 +
 srcpkgs/motif/template                        |  68 ++
 19 files changed, 2163 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/motif-demos
 create mode 120000 srcpkgs/motif-devel
 create mode 120000 srcpkgs/motif-mwm
 create mode 120000 srcpkgs/motif-xmbind
 create mode 100644 srcpkgs/motif/patches/02-fix-format-security.patch
 create mode 100644 srcpkgs/motif/patches/03-no-demos.patch
 create mode 100644 srcpkgs/motif/patches/06-cast-size_t-to-int.patch
 create mode 100644 srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
 create mode 100644 srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
 create mode 100644 srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
 create mode 100644 srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
 create mode 100644 srcpkgs/motif/patches/11-fix_underlinking.patch
 create mode 100644 srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
 create mode 100644 srcpkgs/motif/patches/15-link_uil_against_libuil.patch
 create mode 100644 srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
 create mode 100644 srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
 create mode 100644 srcpkgs/motif/patches/20-cross-compile.patch
 create mode 100644 srcpkgs/motif/template

diff --git a/common/shlibs b/common/shlibs
index 4270867b673..bc07b491b27 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1763,9 +1763,9 @@ libSDL2_net-2.0.so.0 SDL2_net-2.0.0_1
 libnxml.so.0 libnxml-0.18.3_1
 libmrss.so.0 libmrss-0.19.2_1
 libuv.so.1 libuv-1.0.0_1
-libXm.so.2 lesstif-0.95.2_1
-libMrm.so.2 lesstif-0.95.2_1
-libUil.so.2 lesstif-0.95.2_1
+libXm.so.4 motif-2.3.8_1
+libMrm.so.4 motif-2.3.8_1
+libUil.so.4 motif-2.3.8_1
 libgtest.so gtest-1.7.0_1
 libgtest_main.so gtest-1.7.0_1
 libxmlsec1-gcrypt.so.1 xmlsec1-1.2.20_2
diff --git a/srcpkgs/motif-demos b/srcpkgs/motif-demos
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-demos
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-devel b/srcpkgs/motif-devel
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-devel
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-mwm b/srcpkgs/motif-mwm
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-mwm
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-xmbind b/srcpkgs/motif-xmbind
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-xmbind
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif/patches/02-fix-format-security.patch b/srcpkgs/motif/patches/02-fix-format-security.patch
new file mode 100644
index 00000000000..18c4abdc271
--- /dev/null
+++ b/srcpkgs/motif/patches/02-fix-format-security.patch
@@ -0,0 +1,607 @@
+Description: Fix unsafe uses of fprintf and sprintf
+ prevent 'format not a string literal and no format arguments' errors
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1574
+Author: Graham Inggs <graham@nerve.org.za>
+Last-Update: 2012-12-25
+--- a/lib/Mrm/Mrmhier.c
++++ b/lib/Mrm/Mrmhier.c
+@@ -264,10 +264,10 @@
+ 	    case MrmSUCCESS:
+ 	      break;
+ 	    case MrmNOT_VALID:
+-	      sprintf (err_stg, _MrmMMsg_0113);
++	      sprintf (err_stg, "%s", _MrmMMsg_0113);
+ 	      break;
+ 	    default:
+-	      sprintf (err_stg, _MrmMMsg_0114);
++	      sprintf (err_stg, "%s", _MrmMMsg_0114);
+ 	      break;
+ 	    }
+ 	}
+--- a/lib/Mrm/Mrmicon.c
++++ b/lib/Mrm/Mrmicon.c
+@@ -1176,7 +1176,7 @@
+ 		}
+ 		break;
+ 	      default:
+-		sprintf(err_msg, _MrmMMsg_0040);
++		sprintf(err_msg, "%s", _MrmMMsg_0040);
+ 		return Urm__UT_Error ("Urm__RelizeColorTable",
+ 				      err_msg, NULL, NULL, MrmFAILURE) ;
+ 	      }
+@@ -1252,7 +1252,7 @@
+ 	      break;
+ 	    default:
+ 	      result = MrmFAILURE;
+-	      sprintf (err_msg, _MrmMMsg_0040);
++	      sprintf (err_msg, "%s", _MrmMMsg_0040);
+ 	      Urm__UT_Error ("Urm__RelizeColorTable",
+ 			     err_msg, NULL, NULL, MrmFAILURE) ;
+ 	    }
+--- a/lib/Mrm/Mrmlread.c
++++ b/lib/Mrm/Mrmlread.c
+@@ -698,7 +698,7 @@
+ 	 XBlackPixelOfScreen(XDefaultScreenOfDisplay(display)));
+       break;
+     default:
+-      sprintf(err_msg, _MrmMMsg_0040);
++      sprintf(err_msg, "%s", _MrmMMsg_0040);
+       result = Urm__UT_Error ("MrmFetchColorLiteral",
+ 			      err_msg, NULL, NULL, MrmFAILURE) ;
+       _MrmAppUnlock(app);
+--- a/lib/Mrm/Mrmwcrw.c
++++ b/lib/Mrm/Mrmwcrw.c
+@@ -1390,7 +1390,7 @@
+ 			}
+ 		      break;
+ 		    default:
+-		      sprintf (err_msg, _MrmMMsg_0040);
++		      sprintf (err_msg, "%s", _MrmMMsg_0040);
+ 		      result = Urm__UT_Error ("Urm__CW_ConvertValue",
+ 					      err_msg, NULL, NULL, MrmFAILURE) ;
+ 		    };
+@@ -2426,7 +2426,7 @@
+ 	    }
+ 	  break;
+ 	default:
+-	  sprintf(err_msg, _MrmMMsg_0040);
++	  sprintf(err_msg, "%s", _MrmMMsg_0040);
+ 	  return Urm__UT_Error ("Urm__CW_ConvertValue",
+ 				err_msg, NULL, NULL, MrmFAILURE) ;
+ 	};
+--- a/tools/wml/wmlouth.c
++++ b/tools/wml/wmlouth.c
+@@ -225,12 +225,12 @@
+     printf ("\nCouldn't open UilSymGen.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write the sym_k..._object literals
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
+@@ -244,7 +244,7 @@
+ /*
+  * Define the sym_k_..._reason literals
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_reason_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr;
+@@ -258,7 +258,7 @@
+ /*
+  * Define the sym_k_..._arg literals
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -272,7 +272,7 @@
+ /*
+  * Define the sym_k_..._enumset structs and literals
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -286,7 +286,7 @@
+ /*
+  * Define the sym_k_..._enumval literals
+  */
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
+     {
+     enumvalobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
+@@ -301,7 +301,7 @@
+  * Define the sym_k_..._charsize literals
+  * Define the sym_k_..._charset literals
+  */
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     charsetobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -315,7 +315,7 @@
+ /*
+  * Define the sym_k_..._child literals
+  */
+-fprintf (outfil, canned8);
++fprintf (outfil, "%s", canned8);
+ for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
+@@ -379,12 +379,12 @@
+     printf ("\nCouldn't open UilSymChCL.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
+@@ -392,7 +392,7 @@
+     fprintf (outfil, "    sym_k_%s_object,\n",
+ 	     classobj->tkname);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -446,12 +446,12 @@
+     printf ("\nCouldn't open UilSymArTy.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -459,7 +459,7 @@
+     fprintf (outfil, "    sym_k_%s_value,\n",
+ 	     datobj->tkname);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -509,19 +509,19 @@
+     printf ("\nCouldn't open UilSymRArg.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+     fprintf (outfil, "    %d,\n",
+ 	     resobj->related_code);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -621,12 +621,12 @@
+     printf ("\nCouldn't open UilUrmClas.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write entries for widgets
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
+@@ -637,7 +637,7 @@
+     else 
+ 	fprintf (outfil, "  \"%s\",\t\n", synobj->convfunc);
+     }
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ 
+ /*
+  * Write entries for gadget variants of widget classes
+@@ -661,7 +661,7 @@
+ 		     synobj->name);
+ 	}
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * Write entries for non-dialog widgets
+@@ -685,7 +685,7 @@
+ 		     synobj->name);
+ 	}
+     }
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ 
+ /*
+  * Write entries for the resource a widget's controls map to
+@@ -701,7 +701,7 @@
+     else
+ 	fprintf (outfil, "  sym_k_%s_arg,\n", mapresobj->tkname);
+     }
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ 
+ /*
+  * Write entries for arguments
+@@ -714,7 +714,7 @@
+     fprintf (outfil, "  %s,\n",
+ 	     synres->resliteral);
+     }
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ 
+ /*
+  * Write entries for reasons
+@@ -727,7 +727,7 @@
+     fprintf (outfil, "  %s,\n",
+ 	     synres->resliteral);
+     }
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ 
+ /*
+  * close the output file
+@@ -781,13 +781,13 @@
+     printf ("\nCouldn't open UilConst.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Process the arguments in code order. We start with 1, and write out
+  * the mask after processing 8 codes.
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ strcpy (maskbuf, "0");
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+@@ -805,7 +805,7 @@
+     }
+ if ( bitno != 8 )
+     fprintf (outfil, "%s", maskbuf);
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -878,8 +878,8 @@
+     printf ("\nCouldn't open UilSymReas.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the reason code,
+@@ -925,13 +925,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( resndx=0 ; resndx<wml_obj_reason_ptr->cnt ; resndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[resndx].objptr;
+     fprintf (outfil, "  reason_class_vec%d,\n", resobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1004,8 +1004,8 @@
+     printf ("\nCouldn't open UilSymArTa.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the argument code,
+@@ -1051,13 +1051,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( resndx=0 ; resndx<wml_obj_arg_ptr->cnt ; resndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[resndx].objptr;
+     fprintf (outfil, "  arg_class_vec%d,\n", resobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1129,8 +1129,8 @@
+     printf ("\nCouldn't open UilSymChTa.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the child code,
+@@ -1174,13 +1174,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( childndx=0 ; childndx<wml_obj_child_ptr->cnt ; childndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[childndx].objptr;
+     fprintf (outfil, "  child_class_vec%d,\n", childobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1251,8 +1251,8 @@
+     printf ("\nCouldn't open UilSymCtl.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the class code,
+@@ -1296,13 +1296,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( ctlndx=0 ; ctlndx<wml_obj_class_ptr->cnt ; ctlndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ctlndx].objptr;
+     fprintf (outfil, "  object_class_vec%d,\n", clsobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1438,7 +1438,7 @@
+     printf ("\nCouldn't open UilSymNam.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write entries for widgets
+@@ -1517,7 +1517,7 @@
+     fprintf (outfil, "    \"%s\",\n",
+ 	     synch->name);
+     }
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ 
+ /*
+  * close the output file
+@@ -1621,12 +1621,12 @@
+     printf ("\nCouldn't open UilSymEnum.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Generate the enumeration value vectors for each enumeration set.
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -1643,7 +1643,7 @@
+ /*
+  * Generate the enumeration set tables
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -1655,7 +1655,7 @@
+ /*
+  * Create enumset table entries for arguments, similar to writing sym_k...
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -1669,13 +1669,13 @@
+ /*
+  * Create the enumval values table.
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
+     {
+     evobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
+     fprintf (outfil, "  %s,\n", evobj->syndef->enumlit);
+     }
+-fprintf (outfil, canned5a);
++fprintf (outfil, "%s", canned5a);
+ 
+ /*
+  * close the output file
+@@ -1813,12 +1813,12 @@
+     printf ("\nCouldn't open UilSymCSet.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Generate the standards name table
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1836,7 +1836,7 @@
+ /*
+  * Generate the writing direction table
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1858,7 +1858,7 @@
+ /*
+  * Generate the parsing direction table
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1880,7 +1880,7 @@
+ /*
+  * Generate the character size table
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1906,7 +1906,7 @@
+ /*
+  * Generate the $LANG name recognition table
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ lang_max = 0;
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+@@ -1936,7 +1936,7 @@
+ /*
+  * Generate the $LANG code lookup table, in upper case
+  */
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+--- a/tools/wml/wmloutkey.c
++++ b/tools/wml/wmloutkey.c
+@@ -574,16 +574,16 @@
+     printf ("\nCouldn't open UilKeyTab.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Print the case sensitive and insensitive tables
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ wmlOutputUilKeyTabBody (outfil, wml_tok_sens_ptr, &maxlen, &maxkey);
+ fprintf (outfil, canned2, maxlen, maxkey);
+ wmlOutputUilKeyTabBody (outfil, wml_tok_insens_ptr, &maxlen, &maxkey);
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -812,8 +812,8 @@
+     printf ("\nCouldn't open UilTokName.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Print the token name entries
+--- a/tools/wml/wmloutmm.c
++++ b/tools/wml/wmloutmm.c
+@@ -209,9 +209,9 @@
+ /*
+  * Write out header information
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ fprintf (outfil, "%s\n", name);
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ 
+ /*
+  * Alphabetize the controls, reason, and argument lists
+@@ -287,7 +287,7 @@
+     else
+ 	fprintf (outfil, "\n");
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * Write out the argument table
+@@ -323,7 +323,7 @@
+     }    
+     argndx += 1;
+     }
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ 
+ }
+ 
diff --git a/srcpkgs/motif/patches/03-no-demos.patch b/srcpkgs/motif/patches/03-no-demos.patch
new file mode 100644
index 00000000000..03953c4f8f7
--- /dev/null
+++ b/srcpkgs/motif/patches/03-no-demos.patch
@@ -0,0 +1,53 @@
+Description: Add option to disable building of demos
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1575
+Author: Graham Inggs <graham@nerve.org.za>
+Last-Update: 2013-01-09
+--- a/configure.ac
++++ b/configure.ac
+@@ -311,7 +311,20 @@
+ doc/man/man5/Makefile \
+ tools/Makefile \
+ tools/wml/Makefile \
+-demos/Makefile \
++lib/Xm/xmstring.list \
++])
++
++AC_ARG_ENABLE(demos, [  --disable-demos
++                       Disable building demos])
++
++if test x$enable_demos = x
++then
++    enable_demos="yes"
++fi
++
++if test "$enable_demos" = "yes"
++then
++  AC_CONFIG_FILES([demos/Makefile
+ demos/lib/Makefile \
+ demos/lib/Xmd/Makefile \
+ demos/lib/Wsm/Makefile \
+@@ -395,6 +408,11 @@
+ demos/doc/programGuide/ch17/Makefile \
+ demos/doc/programGuide/ch17/simple_drop/Makefile \
+ demos/doc/programGuide/ch17/simple_drag/Makefile \
+-lib/Xm/xmstring.list \
+-])
++  ])
++  MAYBE_DEMOS=demos
++else
++  MAYBE_DEMOS=
++fi
++AC_SUBST(MAYBE_DEMOS)
++
+ AC_OUTPUT
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -29,6 +29,7 @@
+              tools \
+              clients \
+              doc \
+-             demos
++             $(MAYBE_DEMOS)
++
+ AUTOMAKE_OPTIONS = 1.4
+ ACLOCAL_AMFLAGS = -I .
diff --git a/srcpkgs/motif/patches/06-cast-size_t-to-int.patch b/srcpkgs/motif/patches/06-cast-size_t-to-int.patch
new file mode 100644
index 00000000000..b5ce9c643a7
--- /dev/null
+++ b/srcpkgs/motif/patches/06-cast-size_t-to-int.patch
@@ -0,0 +1,17 @@
+Description: To prevent build failure during building with Hardening options
+ enabled due to "format '%d' expects argument of type 'int', but argument 5 has
+ type 'size_t'", the fifth argument is cast to integer on the input.
+Author: Paul Gevers <elbrus@debian.org>
+Updated: 13-01-2013
+
+--- a/tools/wml/wmloutkey.c
++++ b/tools/wml/wmloutkey.c
+@@ -627,7 +627,7 @@
+     fprintf (outfil, "    {%s, %s, %d, %s, \"%s\"},\n",
+ 	     tkclass,
+ 	     tksym,
+-	     strlen(tokstg),
++	     (int)strlen(tokstg),
+ 	     tktoken,
+ 	     tokstg);
+     if ( (int)strlen(tokstg) > *maxlen )
diff --git a/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch b/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
new file mode 100644
index 00000000000..5ddfd760075
--- /dev/null
+++ b/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
@@ -0,0 +1,118 @@
+Description: lintian reports several typos in manpages. This patch fixes those
+ reported
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1587
+Last-reviewed: 14 Jan 2013
+
+--- a/doc/man/man1/mwm.1
++++ b/doc/man/man1/mwm.1
+@@ -359,7 +359,7 @@
+ (and other associated messages) by saving the geometries of its clients to a state file\&. 
+ \fBmwm\fP can then be restarted by the XSMP session manager\&.
+ The default location for the state file is \fB$HOME/\&.mwmclientdb\fP\&.
+-This location can be overriden with the resource \fBsessionClientDB\fP\&.
++This location can be overridden with the resource \fBsessionClientDB\fP\&.
+ .SS "X Resources"
+ .PP
+ The \fBmwm\fP command is configured from its resource
+--- a/doc/man/man3/VendorShell.3
++++ b/doc/man/man3/VendorShell.3
+@@ -76,7 +76,7 @@
+ to the VendorShell resources for controlling toolTips. VendorShell displays
+ the XmNtooTipString in an XmLabel that is a child of a transientShell. The name
+ of the transientShell is TipShell, and the name of the XmLabel is TipLabel.
+-The appearance of the tip can be controlled by specifing resources on these
++The appearance of the tip can be controlled by specifying resources on these
+ widgets.
+ .PP
+ If an application uses the \fBXmNmwmDecorations\fP,
+--- a/doc/man/man3/XmComboBox.3
++++ b/doc/man/man3/XmComboBox.3
+@@ -581,7 +581,7 @@
+ ComboBox \fBXmNcomboBoxType\fP is
+ \fBXmDROP_DOWN_LIST\fP,
+ \fB<osfActivate>\fP, \fB<osfCancel>\fP, and
+-\fBReturn\fP are overriden by ComboBox actions\&.
++\fBReturn\fP are overridden by ComboBox actions\&.
+ .IP "\fB:c\fP <Key>\fB<osfDown>\fP:" 10
+ CBDropDownList()
+ .IP "\fB:c\fP <Key>\fB<osfUp>\fP:" 10
+--- a/doc/man/man3/XmGetPixmap.3
++++ b/doc/man/man3/XmGetPixmap.3
+@@ -109,7 +109,7 @@
+ In addition to X bitmap files (XBM), Motif also supports XPM (X
+ Pixmap) file formats and, from version 2.3, JPEG and PNG image formats\&.
+ (Note that support of JPEG and PNG image format is an optional feature
+-of Motif, in order to check if current version supports PNG ang JPEG
++of Motif, in order to check if current version supports PNG and JPEG
+ image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked
+ correspondingly.)
+ The \fBXBMLANGPATH\fP specifies the path for
+--- a/doc/man/man3/XmGetPixmapByDepth.3
++++ b/doc/man/man3/XmGetPixmapByDepth.3
+@@ -111,7 +111,7 @@
+ In addition to X bitmap files (XBM), Motif also supports XPM (X
+ Pixmap) file formats, and, from version 2.3, JPEG and PNG image formats\&.
+ (Note that support of JPEG and PNG image format is an optional feature
+-of Motif, in order to check if current version supports PNG ang JPEG
++of Motif, in order to check if current version supports PNG and JPEG
+ image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked
+ correspondingly.)
+ The \fBXBMLANGPATH\fP specifies the path for
+--- a/doc/man/man3/XmHierarchyGetChildNodes.3
++++ b/doc/man/man3/XmHierarchyGetChildNodes.3
+@@ -69,8 +69,8 @@
+ \fBXmHierarchy\fP(3)\&.
+ .SH "RETURN"
+ .PP
+-Returns WidgetList with child nodes of the hierachy, or NULL
+-if the hierachy contains no children\&.
++Returns WidgetList with child nodes of the hierarchy, or NULL
++if the hierarchy contains no children\&.
+ .SH "RELATED"
+ .PP
+ \fBXmHierarchy\fP(3)\&.
+--- a/doc/man/man3/XmManager.3
++++ b/doc/man/man3/XmManager.3
+@@ -502,7 +502,7 @@
+ Indicates whether the posting process should continue\&. The
+ application may modify this field\&.
+ .IP "\fItarget\fP" 10
+-Specifies the most specific widget or gadget that the menu sytem found
++Specifies the most specific widget or gadget that the menu system found
+ from the event that matches the event\&.
+ .SS "Translations"
+ .PP
+--- a/doc/man/man3/XmPrimitive.3
++++ b/doc/man/man3/XmPrimitive.3
+@@ -609,7 +609,7 @@
+ Indicates whether the posting process should continue\&. The
+ application may modify this field\&.
+ .IP "\fItarget\fP" 10
+-Specifies the most specific widget or gadget that the menu sytem found
++Specifies the most specific widget or gadget that the menu system found
+ from the event that matches the event\&.
+ .SS "Translations"
+ .PP
+--- a/doc/man/man3/XmRendition.3
++++ b/doc/man/man3/XmRendition.3
+@@ -71,7 +71,7 @@
+ If a resource in a rendition is unspecified, usually by setting it to
+ \fBXmAS_IS\fP or \fBXmUNSPECIFIED_PIXEL\fP,
+ then the value to be used for that resource is the value of the
+-immediately preceeding rendition in \fBXmString\fR\&. If that value
++immediately preceding rendition in \fBXmString\fR\&. If that value
+ is unspecified, then the preceding value is used, and so on\&. If
+ no renditions specify a value for a resource, then a default value
+ will be used\&.
+--- a/doc/man/man3/XmStringGetNextComponent.3
++++ b/doc/man/man3/XmStringGetNextComponent.3
+@@ -111,7 +111,7 @@
+ \fBXmSTRING_COMPONENT_UNKNOWN\fP\&. The data returned by these
+ components is returned in the \fIunknown_tag\fP, \fIunknown_length\fP,
+ and \fIunknown_value\fP fields\&. This apparent inconsistency is
+-designed to accomodate older applications that may not be equipped to
++designed to accommodate older applications that may not be equipped to
+ handle the newer component types of Motif version 2\&.0 and beyond\&.
+ Consequently, the use of this procedure is not recommended\&. Instead,
+ use the \fBXmStringGetNextTriple\fP procedure, which provides all the
diff --git a/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch b/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
new file mode 100644
index 00000000000..bc1beb029cd
--- /dev/null
+++ b/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
@@ -0,0 +1,156 @@
+Description: lintian reports hyphen misuse in manpages. This patch fixes those
+ reported.
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1588
+Last-reviewed: 06 Feb 2013
+
+--- a/doc/man/man1/mwm.1
++++ b/doc/man/man1/mwm.1
+@@ -904,7 +904,7 @@
+ resizeCursors\aResizeCursors\aT/F\aT
+ transientDecoration\aTransientDecoration\astring\amenu title
+ transientFunctions\aTransientFunctions\astring\aT{
+--minimize-maximize
++\-minimize-maximize
+ T}
+ useIconBox\aUseIconBox\aT/F\aF
+ .TE
+@@ -941,7 +941,7 @@
+ screen size of the icon box window depends on the iconImageMaximum (size)
+ and \fIiconDecoration\fP resources\&. The default value for size
+ is (6 * iconWidth + padding) wide by (1 * iconHeight + padding) high\&. The
+-default value of the location is +0 -0\&.
++default value of the location is +0 \-0\&.
+ .IP "\fIiconBoxName\fP\ (class\  \fIIconBoxName\fP)" 10
+ This resource specifies the name that is used to look up icon box resources\&.
+ The default name is iconbox\&.
+@@ -1059,7 +1059,7 @@
+ This resource is used to indicate which window management functions
+ are applicable (or not applicable) to transient windows\&. The function specification
+ is exactly the same as for the \fIclientFunctions\fP (client
+-specific) resource\&. The default value for this resource is -minimize -maximize\&.
++specific) resource\&. The default value for this resource is \-minimize \-maximize\&.
+ .IP "" 10
+ An application can also specify which functions \fBmwm\fP
+ should apply to its windows\&. If it does so, \fBmwm\fP applies
+@@ -1176,7 +1176,7 @@
+ title\aTitle bar (includes border)\&.
+ .TE
+ .PP
+-Examples: \fIMwm*XClock\&.clientDecoration: -resizeh -maximize\fP This removes the resize handles and maximize button from XClock
++Examples: \fIMwm*XClock\&.clientDecoration: \-resizeh \-maximize\fP This removes the resize handles and maximize button from XClock
+ windows\&. \fIMwm*XClock\&.clientDecoration: menu minimize border\fP This does the same thing as above\&. Note that either \fImenu\fP or \fIminimize\fP implies
+ \fItitle\fP\&.
+ .IP "\fIclientFunctions\fP\ (class\  \fIClientFunctions\fP)" 10
+--- a/doc/man/man4/mwmrc.4
++++ b/doc/man/man4/mwmrc.4
+@@ -84,7 +84,7 @@
+ be specified from the command line:
+ .PP
+ .nf
+-\f(CW/usr/X11R6/bin/X11/mwm -xrm "mwm*configFile: mymwmrc"\fR
++\f(CW/usr/X11R6/bin/X11/mwm \-xrm "mwm*configFile: mymwmrc"\fR
+ .fi
+ .PP
+ .SS "Resource Types"
+--- a/doc/man/man3/XmFontList.3
++++ b/doc/man/man3/XmFontList.3
+@@ -119,7 +119,7 @@
+ without a font list entry tag;
+ .PP
+ .nf
+-\f(CW*fontList:  -Adobe-Times-Medium-I-Normal--10*\fR
++\f(CW*fontList:  \-Adobe\-Times\-Medium\-I\-Normal\-\-10*\fR
+ .fi
+ .PP
+ .PP
+@@ -138,9 +138,9 @@
+ and an explicit font list entry tag\&.
+ .PP
+ .nf
+-\f(CW*fontList: -Adobe-Courier-Bold-R-Normal--25-180-100-100-M-150;\
+--JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240;\
+--JIS-Fixed-Medium-R-Normal--26-180-100-100-C-120:MY_TAG\fR
++\f(CW*fontList: \-Adobe\-Courier\-Bold\-R\-Normal\-\-25\-180\-100\-100\-M\-150;\
++\-JIS\-Fixed\-Medium\-R\-Normal\-\-26\-180\-100\-100\-C\-240;\
++\-JIS\-Fixed\-Medium\-R\-Normal\-\-26\-180\-100\-100\-C\-120:MY_TAG\fR
+ .fi
+ .PP
+ .PP
+--- a/doc/man/man3/XmGetPixmapByDepth.3
++++ b/doc/man/man3/XmGetPixmapByDepth.3
+@@ -245,8 +245,8 @@
+ \f(CW/* XBM file */
+ #define plaid_width 22
+ #define plaid_height 22
+-#define plaid_x_hot -1
+-#define plaid_y_hot -1
++#define plaid_x_hot \-1
++#define plaid_y_hot \-1
+ static char plaid_bits[] = {
+    0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
+    0x75, 0xfd, 0x3f, 0xff, 0x57, 0x15, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
+--- a/doc/man/man3/XmList.3
++++ b/doc/man/man3/XmList.3
+@@ -182,7 +182,7 @@
+ A value of 1 transfers the first item in the List; a value of 2
+ transfers the second item; and so on\&.
+ If the entire contents of the List are being transferred, the value is
+--1\&.
++\-1\&.
+ .PP
+ As a source of data, List supports the following targets and associated
+ conversions of data to these targets:
+--- a/doc/man/man3/XmScreen.3
++++ b/doc/man/man3/XmScreen.3
+@@ -300,7 +300,7 @@
+ startup time, either by placing it within a defaults file or by using the
+ \fB-xrm\fP command line argument\&. For example:
+ .IP "" 10
+-\fBmyProg -xrm "*menuCursor: arrow"\fP
++\fBmyProg \-xrm "*menuCursor: arrow"\fP
+ .IP "" 10
+ The menu cursor can also be selected in the program through
+ the function \fBXmSetMenuCursor\fP\&.
+--- a/doc/man/man3/XmTabListCopy.3
++++ b/doc/man/man3/XmTabListCopy.3
+@@ -71,7 +71,7 @@
+ Specifies where to start copying\&. A value of 0 (zero) indicates begin
+ at the beginning, a value of 1 indicates to skip the first tab, and so
+ on\&. A negative indicates to begin counting backwards from the end\&.
+-A value of -1 indicates to start copying from the last tab\&.
++A value of \-1 indicates to start copying from the last tab\&.
+ .IP "\fIcount\fP" 10
+ Specifies the number of tabs to copy\&. A value of 0 (zero) indicates
+ to copy all elements from the starting point to the end (beginning if
+--- a/doc/man/man3/XmTabListInsertTabs.3
++++ b/doc/man/man3/XmTabListInsertTabs.3
+@@ -83,7 +83,7 @@
+ value of 1 makes it the second tab, and so on\&. If \fIposition\fP is
+ greater than the number of tabs in \fIoldlist\fP, then the tabs will
+ be inserted at the end\&. If \fIposition\fP is negative, the count will
+-be backwards from the end\&. A value of -1 makes the first new tab
++be backwards from the end\&. A value of \-1 makes the first new tab
+ the last tab, and so on\&.
+ .SH "RETURN"
+ .PP
+--- a/doc/man/man5/UIL.5
++++ b/doc/man/man5/UIL.5
+@@ -1211,7 +1211,7 @@
+ 3\&.1415E-2 (equals \&.031415)
+ T}\a2\&.87 e6 (embedded blanks)
+ T{
+--6\&.29e7 (equals -62900000)
++\-6\&.29e7 (equals \-62900000)
+ T}\a2\&.0e100 (out of range)
+ .TE
+ .PP
+@@ -1322,7 +1322,7 @@
+ You can use parentheses to override the normal precedence of operators\&.
+ In a sequence of unary operators, the operations are performed in
+ right-to-left
+-order\&. For example, \fB- + -A\fP is equivalent to \fB-(+(-A))\fP\&.
++order\&. For example, \fB- + \-A\fP is equivalent to \fB\-(+(\-A))\fP\&.
+ In a sequence of binary operators of the same precedence, the operations
+ are performed in left-to-right order\&. For example, \fBA*B/C*D\fP is
+ equivalent to \fB((A*B)/C)*D\fP\&.
diff --git a/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch b/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
new file mode 100644
index 00000000000..90d39a3f0c0
--- /dev/null
+++ b/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
@@ -0,0 +1,25 @@
+Description: lintian reports a typo in libXm. This patch fixes it.
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1589
+Last-reviewed: 06 Feb 2013
+
+--- a/lib/Xm/FontS.c
++++ b/lib/Xm/FontS.c
+@@ -1225,7 +1225,7 @@
+ 
+     if ((fontdata = XLoadQueryFont(XtDisplay((Widget) fsw), font)) == NULL)
+     {
+-	sprintf(buf, "Font '%s'\nis not availiable on this machine", font);
++	sprintf(buf, "Font '%s'\nis not available on this machine", font);
+ 	DisplayUserError(fsw, buf);
+ 	err = True;
+     }
+@@ -1275,7 +1275,7 @@
+ 					   fbuf)) == NULL) 
+ 	    {
+ 		sprintf(buf,
+-			    "Font '%s'\nis not availiable on this machine",
++			    "Font '%s'\nis not available on this machine",
+ 			    font);
+ 		DisplayUserError(fsw, buf);
+ 		    err = True;
diff --git a/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch b/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
new file mode 100644
index 00000000000..cf51d1fa3d4
--- /dev/null
+++ b/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
@@ -0,0 +1,49 @@
+Description: lintian reports bad whatis entries in manpages. Fixing here
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1590
+Last-reviewed: 17 Feb 2013
+
+--- a/doc/man/man3/XmColorSelector.3
++++ b/doc/man/man3/XmColorSelector.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmColorSelector 3X ""
+ .SH NAME
+-The Color Selector widget
++XmColorSelector \- The Color Selector widget
+ .SH SYNOPSIS
+ #include <Xm/ColorS.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmExt18List.3
++++ b/doc/man/man3/XmExt18List.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XxExt18LIst 3x ""
+ .SH NAME
+-The Internationalized Extended List widget
++XmExt18List \- The Internationalized Extended List widget
+ .SH SYNOPSIS
+ #include <Xm/Ext18List.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmFontSelector.3
++++ b/doc/man/man3/XmFontSelector.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmFontSelector 3X ""
+ .SH NAME
+-The Font Selector widget
++XmFontSelector \- The Font Selector widget
+ .SH SYNOPSIS
+ #include <Xm/FontS.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmIconButton.3
++++ b/doc/man/man3/XmIconButton.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmIconButton 3X "15 July 1992"
+ .SH NAME
+-The Icon Button widget
++XmIconButton \- The Icon Button widget
+ .SH SYNOPSIS
+ Documents the XmIconButton widget
+ .SH DESCRIPTION
diff --git a/srcpkgs/motif/patches/11-fix_underlinking.patch b/srcpkgs/motif/patches/11-fix_underlinking.patch
new file mode 100644
index 00000000000..601b0918632
--- /dev/null
+++ b/srcpkgs/motif/patches/11-fix_underlinking.patch
@@ -0,0 +1,564 @@
+Description: Fix underlinking of libXt, libXext and libX11
+ Recent changes to default linker behaviour prevent shared libraries from being
+ indirectly linked, resulting in FTBFS in Ubuntu Raring.
+ .
+ This patch fixes this by explicitly linking libXt, libXext and libX11 wherever
+ necessary.  Demos are patched even though they are not built for distribution.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1583
+Last-Update: 2013-02-26
+--- a/clients/mwm/Makefile.am
++++ b/clients/mwm/Makefile.am
+@@ -9,7 +9,7 @@
+ rc_DATA = system.mwmrc
+ 
+ bin_PROGRAMS = mwm
+-mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la 
++mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la -lXt -lXext -lX11
+ 
+ INCLUDES = -DLARGECURSORS -DR2_COMPAT -DUNMAP_ON_RESTART \
+            -DCDE_INSTALLATION_TOP=\"@CDE_INSTALLATION_TOP@\" \
+--- a/clients/uil/Makefile.am
++++ b/clients/uil/Makefile.am
+@@ -11,9 +11,9 @@
+ UilParser.lo: UilParser.c
+ 	$(LTCOMPILE) -DCALLABLE -c UilParser.c
+ 
+-libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la 
++libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+-uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la 
++uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
+--- a/clients/xmbind/Makefile.am
++++ b/clients/xmbind/Makefile.am
+@@ -2,6 +2,6 @@
+ 
+ bin_PROGRAMS = xmbind
+ 
+-LDADD = ../../lib/Xm/libXm.la
++LDADD = ../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS}
+--- a/demos/doc/programGuide/ch05/Scale/Makefile.am
++++ b/demos/doc/programGuide/ch05/Scale/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch06/combo_box/Makefile.am
++++ b/demos/doc/programGuide/ch06/combo_box/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch06/spin_box/Makefile.am
++++ b/demos/doc/programGuide/ch06/spin_box/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch08/Container/Makefile.am
++++ b/demos/doc/programGuide/ch08/Container/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch08/Notebook/Makefile.am
++++ b/demos/doc/programGuide/ch08/Notebook/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch16/Makefile.am
++++ b/demos/doc/programGuide/ch16/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch17/simple_drag/Makefile.am
++++ b/demos/doc/programGuide/ch17/simple_drag/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch17/simple_drop/Makefile.am
++++ b/demos/doc/programGuide/ch17/simple_drop/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/lib/Exm/wml/Makefile.am
++++ b/demos/lib/Exm/wml/Makefile.am
+@@ -18,7 +18,7 @@
+ 	-I$(top_builddir)/clients/uil \
+ 	${X_CFLAGS} 
+ 
+-LDADD = $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Xm/libXm.la -lXt
+ 
+ DISTCLEANFILES = motif.wmd
+ 
+--- a/demos/lib/Xmd/Makefile.am
++++ b/demos/lib/Xmd/Makefile.am
+@@ -12,7 +12,7 @@
+ Print.h PrintP.h \
+ RegEdit.h RegEditI.h
+ 
+-LDADD = libXmd.a ../../../lib/Xm/libXm.la
++LDADD = libXmd.a ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(srcdir)/../../../lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/ButtonBox/Makefile.am
++++ b/demos/programs/ButtonBox/Makefile.am
+@@ -8,6 +8,6 @@
+ bboxdemo_SOURCES = bboxdemo.c
+ data_DATA = $(EXTRA_DIST) $(bboxdemo_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/ColorSel/Makefile.am
++++ b/demos/programs/ColorSel/Makefile.am
+@@ -7,6 +7,6 @@
+ colordemo_SOURCES = util-c.c colordemo.c
+ EXTRA_DIST = Imakefile
+ data_DATA = $(colordemo_SOURCES) $(EXTRA_DIST)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Column/Makefile.am
++++ b/demos/programs/Column/Makefile.am
+@@ -8,5 +8,5 @@
+ EXTRA_DIST = Imakefile Column.ad
+ data_DATA = $(EXTRA_DIST) $(column_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Combo2/Makefile.am
++++ b/demos/programs/Combo2/Makefile.am
+@@ -8,5 +8,5 @@
+ combo_SOURCES = combo.c
+ data_DATA = $(EXTRA_DIST) $(combo_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Exm/app_in_c/Makefile.am
++++ b/demos/programs/Exm/app_in_c/Makefile.am
+@@ -14,4 +14,4 @@
+            -I$(top_builddir)/lib \
+             ${X_CFLAGS} 
+ LDADD = ../../../lib/Exm/libExm.a \
+-	../../../../lib/Xm/libXm.la
++	../../../../lib/Xm/libXm.la -lXt -lXext -lX11
+--- a/demos/programs/Exm/simple_app/Makefile.am
++++ b/demos/programs/Exm/simple_app/Makefile.am
+@@ -14,5 +14,6 @@
+            -I$(srcdir)/../../../lib \
+            -I$(top_builddir)/lib \
+            ${X_CFLAGS} 
+-LDADD = ../../../../lib/Xm/libXm.la \
+-        ../../../lib/Exm/libExm.a
++LDADD = ../../../lib/Exm/libExm.a \
++        ../../../../lib/Xm/libXm.la -lXt -lX11
++
+--- a/demos/programs/Ext18List/Makefile.am
++++ b/demos/programs/Ext18List/Makefile.am
+@@ -10,6 +10,6 @@
+ EXTRA_DIST = Imakefile
+ data_DATA = $(EXTRA_DIST) $(ext18list_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/FontSel/Makefile.am
++++ b/demos/programs/FontSel/Makefile.am
+@@ -7,6 +7,6 @@
+ fontsel_SOURCES = callbacks-c.c creation-c.c fontsel.c fontsel.h
+ EXTRA_DIST = Imakefile
+ data_DATA = $(EXTRA_DIST) $(fontsel_SOURCES)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/IconB/Makefile.am
++++ b/demos/programs/IconB/Makefile.am
+@@ -8,7 +8,7 @@
+ iconbuttondemo_SOURCES = misc.c  iconbuttondemo.c
+ data_DATA = $(iconbuttondemo_SOURCES) $(EXTRA_DIST)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. \
+            -I$(srcdir)/$(TOPDIR)/lib \
+--- a/demos/programs/Outline/Makefile.am
++++ b/demos/programs/Outline/Makefile.am
+@@ -7,6 +7,6 @@
+ bin_PROGRAMS = outline
+ outline_SOURCES = outline.c
+ data_DATA = $(outline_SOURCES) $(EXTRA_DIST)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Paned/Makefile.am
++++ b/demos/programs/Paned/Makefile.am
+@@ -8,6 +8,6 @@
+ paned_SOURCES = creation-c.c paned.c
+ data_DATA = $(EXTRA_DIST) $(paned_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/TabStack/Makefile.am
++++ b/demos/programs/TabStack/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = Imakefile
+ data_DATA = $(tabstack_SOURCES) $(EXTRA_DIST)            
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Tree/Makefile.am
++++ b/demos/programs/Tree/Makefile.am
+@@ -8,6 +8,6 @@
+ tree_SOURCES = bxutil-c.c  tree.c
+ data_DATA = $(EXTRA_DIST) $(tree_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/airport/Makefile.am
++++ b/demos/programs/airport/Makefile.am
+@@ -8,5 +8,5 @@
+                   dragsource.h dropsite.h main.h
+ EXTRA_DIST = Imakefile XmdAirport.ad README
+ data_DATA = $(airport_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/animate/Makefile.am
++++ b/demos/programs/animate/Makefile.am
+@@ -17,7 +17,7 @@
+ 
+ bin_PROGRAMS = xmanimate
+ 
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib \
+            -I$(srcdir)/../../lib \
+--- a/demos/programs/drag_and_drop/Makefile.am
++++ b/demos/programs/drag_and_drop/Makefile.am
+@@ -10,6 +10,6 @@
+ simpledrop_SOURCES = simpledrop.c
+ data_DATA = $(EXTRA_DIST) $(DNDDemo_SOURCES) $(simpledrop_SOURCES)
+ noinst_HEADERS = DNDDemo.h
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/draw/Makefile.am
++++ b/demos/programs/draw/Makefile.am
+@@ -7,5 +7,5 @@
+ draw_SOURCES = draw.c
+ EXTRA_DIST = Imakefile XmdDraw.ad README draw.help draw.man
+ data_DATA = $(EXTRA_DIST) $(draw_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/earth/Makefile.am
++++ b/demos/programs/earth/Makefile.am
+@@ -7,5 +7,5 @@
+ earth_SOURCES = earth.c
+ EXTRA_DIST = terre.xbm earth.man Imakefile README
+ data_DATA = $(EXTRA_DIST) $(earth_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lXext -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/filemanager/Makefile.am
++++ b/demos/programs/filemanager/Makefile.am
+@@ -11,7 +11,7 @@
+            obj.xpm pix.xpm s_dir.xpm s_exec.xpm s_file.xpm \
+            s_none.xpm s_pix.xpm
+ data_DATA = $(EXTRA_DIST) $(filemanager_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+ 
+--- a/demos/programs/fileview/Makefile.am
++++ b/demos/programs/fileview/Makefile.am
+@@ -11,7 +11,7 @@
+ 
+ UILS= French.uil German.uil English.uil
+ 
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/getsubres/Makefile.am
++++ b/demos/programs/getsubres/Makefile.am
+@@ -7,5 +7,5 @@
+ EXTRA_DIST = getsubres.help getsubres.man README Imakefile
+ getsubres_SOURCES = getsubres.c
+ data_DATA = $(EXTRA_DIST) $(getsubres_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/hellomotif/Makefile.am
++++ b/demos/programs/hellomotif/Makefile.am
+@@ -7,7 +7,7 @@
+ EXTRA_DIST = hellomotif.uil Imakefile README
+ hellomotif_SOURCES = hellomotif.c
+ data_DATA = $(EXTRA_DIST) $(hellomotif_SOURCES) hellomotif.uid
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+ all: hellomotif.uid
+--- a/demos/programs/hellomotifi18n/Makefile.am
++++ b/demos/programs/hellomotifi18n/Makefile.am
+@@ -12,7 +12,7 @@
+ helloint_DEPENDENCIES = helloint.uid C/uid/l_strings.uid english/uid/l_strings.uid french/uid/l_strings.uid hebrew/uid/l_strings.uid japan/uid/l_strings.uid japanese/uid/l_strings.uid swedish/uid/l_strings.uid
+ 
+ INCLUDES = -I$(top_srcdir)/lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la -lXt
+ 
+ SUFFIXES = .uil .uid
+ 
+--- a/demos/programs/i18ninput/Makefile.am
++++ b/demos/programs/i18ninput/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = XmdI18nInput.ad README i18ninput.man i18ninput.help \
+              Imakefile
+ data_DATA = $(EXTRA_DIST) $(i18ninput_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/panner/Makefile.am
++++ b/demos/programs/panner/Makefile.am
+@@ -7,5 +7,5 @@
+ panner_SOURCES = panner.c
+ EXTRA_DIST = README panner.man Imakefile
+ data_DATA = $(EXTRA_DIST) $(panner_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/periodic/Makefile.am
++++ b/demos/programs/periodic/Makefile.am
+@@ -7,7 +7,7 @@
+ EXTRA_DIST = periodic.uil periodic_l.uil XmdPeriodic.ad Imakefile README
+ periodic_SOURCES = periodic.c
+ data_DATA = $(EXTRA_DIST) $(periodic_SOURCES) periodic.uid
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/piano/Makefile.am
++++ b/demos/programs/piano/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = piano.images README Inv8_part1.piano Inv8_part2.piano \
+              piano.man Imakefile
+ data_DATA  = $(EXTRA_DIST) $(piano_SOURCES) 
+-LDADD = ../../../lib/Xm/libXm.la -lm
++LDADD = ../../../lib/Xm/libXm.la -lm -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/popups/Makefile.am
++++ b/demos/programs/popups/Makefile.am
+@@ -7,6 +7,6 @@
+ autopopups_SOURCES = autopopups.c
+ EXTRA_DIST = README autopopups.man Imakefile
+ data_DATA = $(EXTRA_DIST) $(autopopups_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/sampler2_0/Makefile.am
++++ b/demos/programs/sampler2_0/Makefile.am
+@@ -10,6 +10,6 @@
+ bin_PROGRAMS = sampler2_0
+ sampler2_0_SOURCES = sampler2_0.c
+ data_DATA = $(sampler2_0_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/setdate/Makefile.am
++++ b/demos/programs/setdate/Makefile.am
+@@ -7,6 +7,6 @@
+ EXTRA_DIST = XmdSetDate.ad README setDate.man Imakefile
+ setDate_SOURCES = setDate.c
+ data_DATA = $(EXTRA_DIST) $(setDate_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/todo/Makefile.am
++++ b/demos/programs/todo/Makefile.am
+@@ -9,4 +9,4 @@
+ data_DATA = $(EXTRA_DIST) $(todo_SOURCES)
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la 
++LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la -lXt -lXext -lX11
+--- a/demos/programs/tooltips/Makefile.am
++++ b/demos/programs/tooltips/Makefile.am
+@@ -7,6 +7,6 @@
+ bin_PROGRAMS = tooltips
+ tooltips_SOURCES = tooltips.c
+ data_DATA = $(tooltips_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/workspace/Makefile.am
++++ b/demos/programs/workspace/Makefile.am
+@@ -11,4 +11,4 @@
+               wsm.h wsmSend.h wsmStruct.h wsm_ui.h xrmLib.h
+ data_DATA = $(wsm_SOURCES) $(EXTRA_DIST)
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm
++LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm -lXt -lX11
+--- a/demos/unsupported/aicon/Makefile.am
++++ b/demos/unsupported/aicon/Makefile.am
+@@ -2,7 +2,7 @@
+ 
+ noinst_PROGRAMS = aicon
+  
+-LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la 
++LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/unsupported/dainput/Makefile.am
++++ b/demos/unsupported/dainput/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ dainput_SOURCES = dainput.c dainput_dlg.c dainput_ui.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/dogs/Makefile.am
++++ b/demos/unsupported/dogs/Makefile.am
+@@ -16,7 +16,7 @@
+ 
+ dogs_DEPENDENCIES = dogs.uid
+ 
+-LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/unsupported/hellomotif/Makefile.am
++++ b/demos/unsupported/hellomotif/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = hellomotif.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/motifshell/Makefile.am
++++ b/demos/unsupported/motifshell/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = motifshell.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmapdef/Makefile.am
++++ b/demos/unsupported/xmapdef/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmapdef.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmfonts/Makefile.am
++++ b/demos/unsupported/xmfonts/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmfonts.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmforc/Makefile.am
++++ b/demos/unsupported/xmforc/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmforc.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmform/Makefile.am
++++ b/demos/unsupported/xmform/Makefile.am
+@@ -6,6 +6,6 @@
+ 
+ EXTRA_DIST = Imakefile
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS}
+--- a/tools/wml/Makefile.am
++++ b/tools/wml/Makefile.am
+@@ -30,7 +30,7 @@
+ wml_LDADD = -L. -lwml
+ wml_DEPENDENCIES = libwml.a
+ 
+-wmldbcreate_LDADD = ../../lib/Xm/libXm.la
++wmldbcreate_LDADD = ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I../../lib -I$(srcdir)/../../lib -I$(srcdir)/../../include ${X_CFLAGS} 
+ 
diff --git a/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch b/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
new file mode 100644
index 00000000000..6d532859d73
--- /dev/null
+++ b/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
@@ -0,0 +1,54 @@
+Description: Fix hardcoded path to /usr/lib/X11/rgb.txt in lib/Xm/ColorS.c
+ LibXm is hardcoded to read rgb.txt from /usr/lib/X11 but this file, provided
+ by x11-common in Debian, is located in /etc/X11 and /usr/share/X11 via symlink.
+ .
+ This patch fixes this by allowing the directory in which rgb.txt resides to be
+ customized by the --with-x11rgbdir=DIR configure option.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1585
+Last-Update: 2013-03-12
+--- a/configure.ac
++++ b/configure.ac
+@@ -189,6 +189,10 @@
+ XMBINDDIR_FALLBACK="$xmbinddir"
+ AC_SUBST(XMBINDDIR_FALLBACK)
+ 
++AC_ARG_WITH(x11rgbdir, [  --with-x11rgbdir=DIR  rgb.txt is located in DIR], x11rgbdir=$withval, x11rgbdir="/usr/lib/X11")
++X11RGBPATH="$x11rgbdir/rgb.txt"
++AC_SUBST(X11RGBPATH)
++
+ RM="rm -f"
+ AC_SUBST(RM)
+ 
+--- a/lib/Xm/ColorS.c
++++ b/lib/Xm/ColorS.c
+@@ -123,6 +123,10 @@
+  *       STATIC DECLARATIONS
+  ************************************************************/
+ 
++#ifndef X11RGBPATH
++#define X11RGBPATH "/usr/lib/X11/rgb.txt"
++#endif
++
+ static XtResource resources[] =
+ {
+   {
+@@ -146,7 +150,7 @@
+   {
+     XmNrgbFile, XmCString, XmRString,
+     sizeof(String), XtOffsetOf(XmColorSelectorRec, cs.rgb_file),
+-    XmRString, (XtPointer) "/usr/lib/X11/rgb.txt"
++    XmRString, (XtPointer) X11RGBPATH
+   },
+ #endif
+   {
+--- a/lib/Xm/Makefile.am
++++ b/lib/Xm/Makefile.am
+@@ -8,6 +8,7 @@
+ INCLUDES = -I.. -I$(srcdir)/.. -DXMBINDDIR_FALLBACK=\"@XMBINDDIR_FALLBACK@\" \
+            -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
++           -DX11RGBPATH=\"@X11RGBPATH@\" \
+            ${X_CFLAGS}
+ xmdir = $(includedir)/Xm
+ 
diff --git a/srcpkgs/motif/patches/15-link_uil_against_libuil.patch b/srcpkgs/motif/patches/15-link_uil_against_libuil.patch
new file mode 100644
index 00000000000..11792a7a4c8
--- /dev/null
+++ b/srcpkgs/motif/patches/15-link_uil_against_libuil.patch
@@ -0,0 +1,29 @@
+Description: Link the uil executable against libUil
+ Linking the uil executable againt libUil instead of compiling with the libUil
+ code results in a reduction in size of the uil executable from about 348KB
+ to about 16KB.
+ .
+ This patch originates from Red Hat.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1586
+Last-Update: 2013-03-12
+--- a/clients/uil/Makefile.am
++++ b/clients/uil/Makefile.am
+@@ -13,7 +13,7 @@
+ 
+ libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+-uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
++uil_LDADD = libUil.la ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
+@@ -42,7 +42,7 @@
+ 		UilLstMac.c	UilSemVal.c	UilSemCSet.c	UilDB.c
+ 
+ SRCS =		$(COMMON_SRC)
+-SRCS2 =		$(COMMON_SRC)	UilMain.c
++SRCS2 =		UilMain.c
+ 
+ HEADERS_1 = 	Uil.h		UilSymGl.h	UilSymDef.h \
+ 		UilDef.h	XmAppl.uil
diff --git a/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch b/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
new file mode 100644
index 00000000000..95a753e083e
--- /dev/null
+++ b/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
@@ -0,0 +1,17 @@
+Description: Fix undefined use of sprintf
+ This patch fixes the undefined use of sprintf when the
+ source and destination buffers overlap.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1628
+Last-Update: 2013-09-24
+--- a/lib/Xm/XmRenderT.c
++++ b/lib/Xm/XmRenderT.c
+@@ -2703,7 +2703,7 @@
+       number = tlist -> count;
+       tab = (_XmTab) tlist -> start;
+       while(number > 0) {
+-	sprintf(temp, "%s %f %d %d %d, ", temp, tab -> value, 
++	sprintf(temp + strlen(temp), " %f %d %d %d, ", tab -> value,
+ 		tab -> units, tab -> alignment, tab -> offsetModel);
+ 	tab = (_XmTab) tab -> next;
+ 	number--;
diff --git a/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch b/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
new file mode 100644
index 00000000000..a77b8793a8e
--- /dev/null
+++ b/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
@@ -0,0 +1,384 @@
+Description: Switch to system iswspace() function
+ This patch replaces calls to _XmDataFieldIsWSpace() in lib/Xm/DataF.c
+ and _XmTextFieldIsWSpace() in lib/Xm/TextF.c with calls to the system
+ iswspace() function.
+ .
+ It fixes an array bounds error in lib/Xm/DataF.c where 
+ _XmDataFieldIsWSpace() is called with num_entries = 3.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1629
+Last-Update: 2013-11-18
+--- a/lib/Xm/DataF.c
++++ b/lib/Xm/DataF.c
+@@ -208,7 +208,6 @@
+ static Boolean df_VerifyLeave() ;
+ static Boolean _XmDataFieldIsWordBoundary() ;
+ static int _XmGetImage(Screen *, char *, XImage **);
+-static Boolean _XmDataFieldIsWSpace() ;
+ static void df_FindWord() ;
+ static void df_FindPrevWord() ;
+ static void df_FindNextWord() ;
+@@ -549,10 +548,6 @@
+                         XmDataFieldWidget tf,
+                         XmTextPosition pos1,
+                         XmTextPosition pos2) ;
+-static Boolean _XmDataFieldIsWSpace( 
+-                        wchar_t wide_char,
+-                        wchar_t *white_space,
+-                        int num_entries) ;
+ static void df_FindWord( 
+                         XmDataFieldWidget tf,
+                         XmTextPosition begin,
+@@ -4549,40 +4544,6 @@
+    return False;
+ }
+ 
+-/* This routine accepts an array of wchar_t's containing wchar encodings
+- * of whitespace characters (and the number of array elements), comparing
+- * the wide character passed to each element of the array.  If a match
+- * is found, we got a white space.  This routine exists only because
+- * iswspace(3c) is not yet standard.  If a system has isw* available,
+- * calls to this routine should be changed to iswspace(3c) (and callers
+- * should delete initialization of the array), and this routine should
+- * be deleted.  Its a stop gap measure to avoid allocating an instance
+- * variable for the white_space array and/or declaring a widget wide
+- * global for the data and using a macro.  Its ugly, but it works and 
+- * in the long run will be replaced by standard functionality. */
+-
+-/* ARGSUSED */
+-static Boolean
+-#ifdef _NO_PROTO
+-_XmDataFieldIsWSpace( wide_char, white_space, num_entries )
+-	wchar_t wide_char ;
+-	wchar_t * white_space ;
+-	int num_entries ;
+-#else
+-_XmDataFieldIsWSpace(
+-	wchar_t wide_char,
+-	wchar_t * white_space ,
+-	int num_entries )
+-#endif /* _NO_PROTO */
+-{
+-   int i;
+-
+-   for (i=num_entries; i > 0; i--){
+-      if (wide_char == white_space[i]) return True;
+-   }
+-   return False;
+-}
+-
+ static void 
+ #ifdef _NO_PROTO
+ df_FindWord( tf, begin, left, right )
+@@ -4599,7 +4560,6 @@
+ #endif /* _NO_PROTO */
+ {
+     XmTextPosition start, end;
+-    wchar_t white_space[3];
+ 
+     if (XmTextF_max_char_size(tf) == 1) {
+        for (start = begin; start > 0; start--) {
+@@ -4617,11 +4577,8 @@
+        }
+        *right = end - 1;
+     } else { /* check for iswspace and iswordboundary in each direction */
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+        for (start = begin; start > 0; start --) {
+-          if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start-1],white_space, 3)
++          if (iswspace(XmTextF_wc_value(tf)[start-1])
+ 	      || _XmDataFieldIsWordBoundary(tf, (XmTextPosition) start - 1, 
+ 					    start)) {
+ 		 break;
+@@ -4630,7 +4587,7 @@
+        *left = start;
+ 
+        for (end = begin; end <= XmTextF_string_length(tf); end++) {
+-	   if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)){
++	   if (iswspace(XmTextF_wc_value(tf)[end])){
+ 	      end++;
+ 	      break;
+ 	   } else if (end < XmTextF_string_length(tf)) {
+@@ -4659,14 +4616,6 @@
+ {
+ 
+     XmTextPosition start = XmTextF_cursor_position(tf);
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+-
+ 
+     if (XmTextF_max_char_size(tf) == 1) {
+        if ((start > 0) && 
+@@ -4680,11 +4629,9 @@
+        }
+        df_FindWord(tf, start, left, right);
+     } else { 
+-       if ((start > 0) && (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start - 1],
+-						white_space, 3))) {
++       if ((start > 0) && (iswspace(XmTextF_wc_value(tf)[start - 1]))) {
+           for (; start > 0; start--) {
+-	     if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start -1], 
+-				       white_space, 3)){
++	     if (!iswspace(XmTextF_wc_value(tf)[start -1])){
+ 		start--;
+ 		break;
+              }
+@@ -4713,14 +4660,6 @@
+ {
+ 
+     XmTextPosition end = XmTextF_cursor_position(tf);
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+-
+ 
+     if(XmTextF_max_char_size(tf) == 1) {
+        if (isspace((int)(unsigned char)XmTextF_value(tf)[end])) {
+@@ -4742,9 +4681,9 @@
+        if (*right < XmTextF_string_length(tf))
+           *right = *right - 1;
+    } else {
+-      if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) {
++      if (iswspace(XmTextF_wc_value(tf)[end])) {
+ 	 for ( ; end < XmTextF_string_length(tf); end ++) {
+-	   if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) {
++	   if (!iswspace(XmTextF_wc_value(tf)[end])) {
+ 	       break;
+            }
+          }
+@@ -4758,10 +4697,9 @@
+        * If word boundary caused by whitespace, set right to the last 
+        * whitespace following the end of the current word.
+        */
+-      if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], white_space, 3))      {
++      if (iswspace(XmTextF_wc_value(tf)[(int)*right]))      {
+          while (*right < XmTextF_string_length(tf) &&
+-               _XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], 
+-				    white_space, 3)) {
++               iswspace(XmTextF_wc_value(tf)[(int)*right])) {
+             *right = *right + 1;
+ 	 }
+ 	 if (*right < XmTextF_string_length(tf))
+@@ -5872,13 +5810,6 @@
+ {
+     XmDataFieldWidget tf = (XmDataFieldWidget) w;
+     XmTextPosition cursorPos, position, dummy;
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+ 
+     cursorPos = XmTextF_cursor_position(tf);
+ 
+@@ -5896,16 +5827,13 @@
+              }
+           }
+        } else {
+-	  if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[cursorPos],
+-				   white_space, 3))
++	  if (iswspace(XmTextF_wc_value(tf)[cursorPos]))
+ 	     df_FindWord(tf, cursorPos, &dummy, &position);
+ 	  else
+ 	     df_FindNextWord(tf, &dummy, &position);
+-          if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position],
+-				   white_space, 3)){
++          if (iswspace(XmTextF_wc_value(tf)[position])){
+ 	     for (; position < XmTextF_string_length(tf); position++) {
+-		if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position], 
+-					  white_space, 3))
++		if (!iswspace(XmTextF_wc_value(tf)[position]))
+ 		   break;
+ 	     }
+ 	  }
+--- a/lib/Xm/TextF.c
++++ b/lib/Xm/TextF.c
+@@ -360,10 +360,6 @@
+ 					  XmTextPosition pos1,
+ 					  XmTextPosition pos2);
+ 
+-static Boolean _XmTextFieldIsWSpace(wchar_t wide_char,
+-				    wchar_t *white_space,
+-				    int num_entries);
+-
+ static void FindWord(XmTextFieldWidget tf,
+ 		     XmTextPosition begin,
+ 		     XmTextPosition *left,
+@@ -3514,32 +3510,6 @@
+   return False;
+ }
+ 
+-/* This routine accepts an array of wchar_t's containing wchar encodings
+- * of whitespace characters (and the number of array elements), comparing
+- * the wide character passed to each element of the array.  If a match
+- * is found, we got a white space.  This routine exists only because
+- * iswspace(3c) is not yet standard.  If a system has isw* available,
+- * calls to this routine should be changed to iswspace(3c) (and callers
+- * should delete initialization of the array), and this routine should
+- * be deleted.  Its a stop gap measure to avoid allocating an instance
+- * variable for the white_space array and/or declaring a widget wide
+- * global for the data and using a macro.  Its ugly, but it works and 
+- * in the long run will be replaced by standard functionality. */
+-
+-/* ARGSUSED */
+-static Boolean
+-_XmTextFieldIsWSpace(wchar_t wide_char,
+-		     wchar_t * white_space ,
+-		     int num_entries)
+-{
+-  int i;
+-  
+-  for (i=0; i < num_entries; i++) {
+-    if (wide_char == white_space[i]) return True;
+-  }
+-  return False;
+-}
+-
+ static void 
+ FindWord(XmTextFieldWidget tf,
+ 	 XmTextPosition begin,
+@@ -3547,7 +3517,6 @@
+ 	 XmTextPosition *right)
+ {
+   XmTextPosition start, end;
+-  wchar_t white_space[3];
+   
+   if (tf->text.max_char_size == 1) {
+     for (start = begin; start > 0; start--) {
+@@ -3565,11 +3534,8 @@
+     }
+     *right = end - 1;
+   } else { /* check for iswspace and iswordboundary in each direction */
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+     for (start = begin; start > 0; start --) {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start-1],white_space, 3)
++      if (iswspace(TextF_WcValue(tf)[start-1])
+ 	  || _XmTextFieldIsWordBoundary(tf, (XmTextPosition) start - 1, 
+ 					start)) {
+ 	break;
+@@ -3578,7 +3544,7 @@
+     *left = start;
+     
+     for (end = begin; end <= tf->text.string_length; end++) {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++      if (iswspace(TextF_WcValue(tf)[end])) {
+ 	end++;
+ 	break;
+       } else if (end < tf->text.string_length) {
+@@ -3599,14 +3565,6 @@
+ {
+   
+   XmTextPosition start = TextF_CursorPosition(tf);
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+-  
+   
+   if (tf->text.max_char_size == 1) {
+     if ((start > 0) && 
+@@ -3620,11 +3578,9 @@
+     }
+     FindWord(tf, start, left, right);
+   } else { 
+-    if ((start > 0) && (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start - 1],
+-					     white_space, 3))) {
++    if ((start > 0) && (iswspace(TextF_WcValue(tf)[start - 1]))) {
+       for (; start > 0; start--) {
+-	if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[start -1], 
+-				  white_space, 3)) {
++	if (!iswspace(TextF_WcValue(tf)[start -1])) {
+ 	  start--;
+ 	  break;
+ 	}
+@@ -3645,14 +3601,6 @@
+ {
+   
+   XmTextPosition end = TextF_CursorPosition(tf);
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+-  
+   
+   if(tf->text.max_char_size == 1) {
+     if (isspace((unsigned char)TextF_Value(tf)[end])) {
+@@ -3674,9 +3622,9 @@
+     if (*right < tf->text.string_length)
+       *right = *right - 1;
+   } else {
+-    if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++    if (iswspace(TextF_WcValue(tf)[end])) {
+       for (; end < tf->text.string_length; end ++) {
+-	if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++	if (!iswspace(TextF_WcValue(tf)[end])) {
+ 	  break;
+ 	}
+       }
+@@ -3690,10 +3638,9 @@
+      * If word boundary caused by whitespace, set right to the last 
+      * whitespace following the end of the current word.
+      */
+-    if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], white_space, 3)) {
++    if (iswspace(TextF_WcValue(tf)[(int)*right])) {
+       while (*right < tf->text.string_length &&
+-	     _XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], 
+-				  white_space, 3)) {
++	     iswspace(TextF_WcValue(tf)[(int)*right])) {
+ 	*right = *right + 1;
+       }
+       if (*right < tf->text.string_length)
+@@ -4546,13 +4493,6 @@
+ {
+   XmTextFieldWidget tf = (XmTextFieldWidget) w;
+   XmTextPosition cursorPos, position, dummy;
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+   
+   cursorPos = TextF_CursorPosition(tf);
+   
+@@ -4570,16 +4510,13 @@
+ 	}
+       }
+     } else {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[cursorPos],
+-			       white_space, 3))
++      if (iswspace(TextF_WcValue(tf)[cursorPos]))
+ 	FindWord(tf, cursorPos, &dummy, &position);
+       else
+ 	FindNextWord(tf, &dummy, &position);
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[position],
+-			       white_space, 3)) {
++      if (iswspace(TextF_WcValue(tf)[position])) {
+ 	for (; position < tf->text.string_length; position++) {
+-	  if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[position], 
+-				    white_space, 3))
++	  if (!iswspace(TextF_WcValue(tf)[position]))
+ 	    break;
+ 	}
+       }
diff --git a/srcpkgs/motif/patches/20-cross-compile.patch b/srcpkgs/motif/patches/20-cross-compile.patch
new file mode 100644
index 00000000000..1994b26cc4a
--- /dev/null
+++ b/srcpkgs/motif/patches/20-cross-compile.patch
@@ -0,0 +1,15 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,10 +3,10 @@
+ AC_CONFIG_SRCDIR([lib/Xm/Form.c])
+ AC_PREREQ(2.52)
+ AC_CONFIG_AUX_DIR(.)
+-AC_CHECK_FILE(/usr/X/include/X11/X.h,
++AS_IF([test -f "/usr/X/include/X11/X.h"],
+   AC_PREFIX_DEFAULT(/usr/X),
+   AC_PREFIX_DEFAULT(/usr))
+-AC_CHECK_FILE(/usr/X11R6/include/X11/X.h,
++AS_IF([test -f "/usr/X11R6/include/X11/X.h"],
+   AC_PREFIX_DEFAULT(/usr/X11R6),
+   AC_PREFIX_DEFAULT(/usr))
+ 
diff --git a/srcpkgs/motif/template b/srcpkgs/motif/template
new file mode 100644
index 00000000000..8842817b4c2
--- /dev/null
+++ b/srcpkgs/motif/template
@@ -0,0 +1,68 @@
+# Template file for 'motif'
+pkgname=motif
+version=2.3.8
+revision=1
+build_style=gnu-configure
+build_helper=qemu
+configure_args="--disable-jpeg --disable-png --enable-xft --disable-demos"
+hostmakedepends="pkg-config automake libtool flex"
+makedepends="libX11-devel libXft-devel libXt-devel libXpm-devel libXext-devel xbitmaps"
+short_desc="User interface component toolkit"
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://sourceforge.net/projects/motif/"
+distfiles="${SOURCEFORGE_SITE}/motif/Motif%20${version}%20Source%20Code/motif-${version}.tar.gz"
+checksum=859b723666eeac7df018209d66045c9853b50b4218cecadb794e2359619ebce7
+replaces="lesstif>=0"
+patch_args="-Np1"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" $makedepends"
+fi
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		vsed -i lib/Xm/Makefile.am -e 's|$(top_builddir)/config/util/makestr|/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e 's|\./wmluiltok|/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e 's|\./wml |/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e '/motif.wmd:/a	\\tsed -i "s|      exec|& /usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static |" wmldbcreate'
+	fi
+	touch NEWS AUTHORS
+	autoreconf -fi
+	vsed -i tools/wml/wmluiltok.l -e '1i %option main'
+}
+
+motif-devel_package() {
+	short_desc+=" - development files"
+	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	replaces="lesstif-devel>=0"
+	pkg_install() {
+		vmove usr/bin/uil
+		vmove usr/share/man/man3
+		vmove usr/share/man/man1/uil.1
+		vmove usr/share/man/man5
+		vmove usr/include
+		vmove "usr/lib/*.so"
+	}
+}
+
+motif-mwm_package() {
+	short_desce="Motif window manager"
+	depends="${sourcepkg}>=${version}_${revision}"
+	replaces="lesstif-mwm>=0"
+	pkg_install() {
+		vmove usr/bin/mwm
+		vmove usr/share/man/man1/mwm.1
+		vmove usr/share/man/man4/mwmrc.4
+		vmove usr/lib/X11/system.mwmrc
+	}
+}
+
+motif-xmbind_package() {
+	short_desc="Configures the virtual key bindings of Motif applications"
+	replaces="lesstif-xmbind>=0"
+	pkg_install() {
+		vmove usr/bin/xmbind
+		vmove usr/share/man/man1/xmbind.1
+	}
+}

From 2d9e6844e1924eb77b53afa88a89be30465dae66 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:21:15 -0700
Subject: [PATCH 2/5] lesstif: remove deprecated package

---
 srcpkgs/lesstif-devel    |  1 -
 srcpkgs/lesstif-mwm      |  1 -
 srcpkgs/lesstif-xmbind   |  1 -
 srcpkgs/lesstif/template | 67 ----------------------------------------
 4 files changed, 70 deletions(-)
 delete mode 120000 srcpkgs/lesstif-devel
 delete mode 120000 srcpkgs/lesstif-mwm
 delete mode 120000 srcpkgs/lesstif-xmbind
 delete mode 100644 srcpkgs/lesstif/template

diff --git a/srcpkgs/lesstif-devel b/srcpkgs/lesstif-devel
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-devel
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif-mwm b/srcpkgs/lesstif-mwm
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-mwm
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif-xmbind b/srcpkgs/lesstif-xmbind
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-xmbind
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif/template b/srcpkgs/lesstif/template
deleted file mode 100644
index 96b858d5a64..00000000000
--- a/srcpkgs/lesstif/template
+++ /dev/null
@@ -1,67 +0,0 @@
-# Template file for 'lesstif'
-pkgname=lesstif
-version=0.95.2
-revision=6
-build_style=gnu-configure
-configure_args="--prefix=/usr --mandir=/usr/share/man --docdir=/usr/share/doc
- --with-xdnd --enable-production --enable-nonstandard-conversions
- --enable-editres --enable-build-21 --disable-static --disable-debug
- --x-includes=/usr/include --x-libraries=/usr/lib"
-hostmakedepends="pkg-config"
-makedepends="libXt-devel libXp-devel libXft-devel"
-short_desc="LGPL'd re-implementation of Motif"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="LGPL-2.1"
-homepage="http://lesstif.sourceforge.net/"
-distfiles="${SOURCEFORGE_SITE}/lesstif/lesstif-${version}.tar.bz2"
-checksum=eb4aa38858c29a4a3bcf605cfe7d91ca41f4522d78d770f69721e6e3a4ecf7e3
-
-pre_build() {
-	if [ -n "$CROSS_BUILD" ]; then
-		cd ${wrksrc}/scripts
-		msg_normal "Building man2html for $XBPS_ARCH\n"
-		cc -o man2html man2html.c
-		# Disable the rule for cross-gcc man2html
-		sed -i Makefile -e "/noinst_PROGRAMS = / s/man2html.*//"
-	fi
-}
-post_install() {
-	rm -rf $DESTDIR/usr/LessTif
-}
-
-lesstif-mwm_package() {
-	short_desc="LessTif clone of the Motif Window Manager"
-	pkg_install() {
-		vmove usr/bin/mwm
-		vmove usr/lib/X11/mwm
-		vmove usr/share/man/man1/mwm.1
-		vmove usr/share/man/man5/mwmrc.5
-		vmove usr/lib/X11/app-defaults/Mwm
-	}
-}
-
-lesstif-xmbind_package() {
-	short_desc="Configures the virtual key bindings of LessTif applications"
-	pkg_install() {
-		vmove usr/bin/xmbind
-		vmove usr/share/man/man1/xmbind.1
-	}
-}
-
-lesstif-devel_package() {
-	depends="${sourcepkg}>=${version}_${revision}"
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove "usr/lib/*.so"
-		vmove usr/share/man/man3
-		vmove usr/share/man/man1/ltversion.1
-		vmove usr/share/man/man1/uil.1
-		vmove usr/share/man/man1/lesstif.1
-		vmove usr/share/man/man5/VirtualBindings.5
-		vmove usr/lib/LessTif
-		vmove usr/bin/uil
-		vmove usr/bin/mxmkmf
-		vmove usr/bin/motif-config
-	}
-}

From 4e2766716dcaa82229dcc715c8d1a56fd965e061 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:15:49 -0700
Subject: [PATCH 3/5] xastir: rebuild with motif

---
 srcpkgs/xastir/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/xastir/template b/srcpkgs/xastir/template
index b6b9de5ee2f..761c1c87e8d 100644
--- a/srcpkgs/xastir/template
+++ b/srcpkgs/xastir/template
@@ -1,11 +1,11 @@
 # Template file for 'xastir'
 pkgname=xastir
 version=2.1.4
-revision=1
+revision=2
 archs="i686 x86_64 ppc64le"
 wrksrc="Xastir-Release-${version}"
 build_style=gnu-configure
-makedepends="libXrender-devel libXt-devel libXp-devel libcurl-devel pcre-devel lesstif-devel libax25-devel"
+makedepends="libXrender-devel libXt-devel libXp-devel libcurl-devel pcre-devel motif-devel libax25-devel"
 short_desc="X Amateur Station Tracking and Information Reporting"
 maintainer="Michael Aldridge <maldridge@voidlinux.org>"
 license="GPL-2"

From 34483ea5af7bd702a890f1ec2d9b6b3f9129d73d Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:16:21 -0700
Subject: [PATCH 4/5] ddd: rebuild with motif

---
 srcpkgs/ddd/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/ddd/template b/srcpkgs/ddd/template
index 02ab5304bc7..312c246897b 100644
--- a/srcpkgs/ddd/template
+++ b/srcpkgs/ddd/template
@@ -1,9 +1,9 @@
 # Template build file for 'ddd'.
 pkgname=ddd
 version=3.3.12
-revision=5
+revision=6
 build_style=gnu-configure
-makedepends="ncurses-devel libXt-devel libXext-devel libXmu-devel lesstif-devel"
+makedepends="ncurses-devel libXt-devel libXext-devel libXmu-devel motif-devel"
 short_desc="Graphical front-end for command-line debuggers"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 homepage="http://www.gnu.org/software/ddd"

From b4d7dd62077ef0e3638d4f171ae6cfab09368777 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:17:41 -0700
Subject: [PATCH 5/5] yeahwm: rebuild with motif

---
 srcpkgs/yeahwm/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/yeahwm/template b/srcpkgs/yeahwm/template
index ca7af56230a..100e28e784b 100644
--- a/srcpkgs/yeahwm/template
+++ b/srcpkgs/yeahwm/template
@@ -1,10 +1,10 @@
 # Template file for 'yeahwm'
 pkgname=yeahwm
 version=0.3.5
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="XROOT=\${XBPS_CROSS_BASE}/usr"
-makedepends="lesstif-devel libX11-devel libXinerama-devel"
+makedepends="motif-devel libX11-devel libXinerama-devel"
 short_desc="A h* window manager for X based on evilwm and aewm"
 maintainer="Ananteris <ananteris@mailinator.com>"
 license="Public Domain"

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR REVIEW] New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
  2020-11-04 20:12 ` [PR REVIEW] " ericonr
  2020-11-04 20:18 ` [PR PATCH] [Updated] " abenson
@ 2020-11-04 20:19 ` abenson
  2020-11-05  8:26 ` mobinmob
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: abenson @ 2020-11-04 20:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

New review comment by abenson on void-packages repository

https://github.com/void-linux/void-packages/pull/26134#discussion_r517607638

Comment:
Yeah, I missed it on it and `xastir`. 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR REVIEW] New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
                   ` (2 preceding siblings ...)
  2020-11-04 20:19 ` [PR REVIEW] " abenson
@ 2020-11-05  8:26 ` mobinmob
  2020-11-05  8:29 ` mobinmob
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mobinmob @ 2020-11-05  8:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 279 bytes --]

New review comment by mobinmob on void-packages repository

https://github.com/void-linux/void-packages/pull/26134#discussion_r517867116

Comment:
license="GPL-2.0-or-later"
See:  https://github.com/Xastir/Xastir/blob/b17a63bbdfac4422612a99e8acc89c9b4f619340/src/dlm.h#L8-L11


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
                   ` (3 preceding siblings ...)
  2020-11-05  8:26 ` mobinmob
@ 2020-11-05  8:29 ` mobinmob
  2020-11-05 13:58 ` [PR PATCH] [Updated] " abenson
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mobinmob @ 2020-11-05  8:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 186 bytes --]

New comment by mobinmob on void-packages repository

https://github.com/void-linux/void-packages/pull/26134#issuecomment-722225027

Comment:
ddd should have licence="GPL-3.0-or-later" .

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
                   ` (4 preceding siblings ...)
  2020-11-05  8:29 ` mobinmob
@ 2020-11-05 13:58 ` abenson
  2020-11-05 15:46 ` abenson
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: abenson @ 2020-11-05 13:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

There is an updated pull request by abenson against master on the void-packages repository

https://github.com/abenson/void-packages np_motifwqemu
https://github.com/void-linux/void-packages/pull/26134

New package: motif-2.3.8


A patch file from https://github.com/void-linux/void-packages/pull/26134.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-np_motifwqemu-26134.patch --]
[-- Type: text/x-diff, Size: 87609 bytes --]

From cf48fc32d76a4d2402ca0f9b4d1b5cfc03b8bb81 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 21:11:58 -0700
Subject: [PATCH 1/5] New package: motif-2.3.8

---
 common/shlibs                                 |   6 +-
 srcpkgs/motif-demos                           |   1 +
 srcpkgs/motif-devel                           |   1 +
 srcpkgs/motif-mwm                             |   1 +
 srcpkgs/motif-xmbind                          |   1 +
 .../patches/02-fix-format-security.patch      | 607 ++++++++++++++++++
 srcpkgs/motif/patches/03-no-demos.patch       |  53 ++
 .../motif/patches/06-cast-size_t-to-int.patch |  17 +
 ...7-fix_lintian_reported_manpage_typos.patch | 118 ++++
 .../patches/08-fix_hyphen_in_man_pages.patch  | 156 +++++
 .../motif/patches/09-fix_typo_in_libxm.patch  |  25 +
 .../10-fix_manpage-has-bad-whatis-entry.patch |  49 ++
 .../motif/patches/11-fix_underlinking.patch   | 564 ++++++++++++++++
 .../13-fix_hardcoded_x11rgb_path.patch        |  54 ++
 .../patches/15-link_uil_against_libuil.patch  |  29 +
 .../16-fix-undefined-use-of-sprintf.patch     |  17 +
 .../17-switch-to-system-iswspace.patch        | 384 +++++++++++
 srcpkgs/motif/patches/20-cross-compile.patch  |  15 +
 srcpkgs/motif/template                        |  68 ++
 19 files changed, 2163 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/motif-demos
 create mode 120000 srcpkgs/motif-devel
 create mode 120000 srcpkgs/motif-mwm
 create mode 120000 srcpkgs/motif-xmbind
 create mode 100644 srcpkgs/motif/patches/02-fix-format-security.patch
 create mode 100644 srcpkgs/motif/patches/03-no-demos.patch
 create mode 100644 srcpkgs/motif/patches/06-cast-size_t-to-int.patch
 create mode 100644 srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
 create mode 100644 srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
 create mode 100644 srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
 create mode 100644 srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
 create mode 100644 srcpkgs/motif/patches/11-fix_underlinking.patch
 create mode 100644 srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
 create mode 100644 srcpkgs/motif/patches/15-link_uil_against_libuil.patch
 create mode 100644 srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
 create mode 100644 srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
 create mode 100644 srcpkgs/motif/patches/20-cross-compile.patch
 create mode 100644 srcpkgs/motif/template

diff --git a/common/shlibs b/common/shlibs
index 4270867b673..bc07b491b27 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1763,9 +1763,9 @@ libSDL2_net-2.0.so.0 SDL2_net-2.0.0_1
 libnxml.so.0 libnxml-0.18.3_1
 libmrss.so.0 libmrss-0.19.2_1
 libuv.so.1 libuv-1.0.0_1
-libXm.so.2 lesstif-0.95.2_1
-libMrm.so.2 lesstif-0.95.2_1
-libUil.so.2 lesstif-0.95.2_1
+libXm.so.4 motif-2.3.8_1
+libMrm.so.4 motif-2.3.8_1
+libUil.so.4 motif-2.3.8_1
 libgtest.so gtest-1.7.0_1
 libgtest_main.so gtest-1.7.0_1
 libxmlsec1-gcrypt.so.1 xmlsec1-1.2.20_2
diff --git a/srcpkgs/motif-demos b/srcpkgs/motif-demos
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-demos
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-devel b/srcpkgs/motif-devel
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-devel
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-mwm b/srcpkgs/motif-mwm
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-mwm
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-xmbind b/srcpkgs/motif-xmbind
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-xmbind
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif/patches/02-fix-format-security.patch b/srcpkgs/motif/patches/02-fix-format-security.patch
new file mode 100644
index 00000000000..18c4abdc271
--- /dev/null
+++ b/srcpkgs/motif/patches/02-fix-format-security.patch
@@ -0,0 +1,607 @@
+Description: Fix unsafe uses of fprintf and sprintf
+ prevent 'format not a string literal and no format arguments' errors
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1574
+Author: Graham Inggs <graham@nerve.org.za>
+Last-Update: 2012-12-25
+--- a/lib/Mrm/Mrmhier.c
++++ b/lib/Mrm/Mrmhier.c
+@@ -264,10 +264,10 @@
+ 	    case MrmSUCCESS:
+ 	      break;
+ 	    case MrmNOT_VALID:
+-	      sprintf (err_stg, _MrmMMsg_0113);
++	      sprintf (err_stg, "%s", _MrmMMsg_0113);
+ 	      break;
+ 	    default:
+-	      sprintf (err_stg, _MrmMMsg_0114);
++	      sprintf (err_stg, "%s", _MrmMMsg_0114);
+ 	      break;
+ 	    }
+ 	}
+--- a/lib/Mrm/Mrmicon.c
++++ b/lib/Mrm/Mrmicon.c
+@@ -1176,7 +1176,7 @@
+ 		}
+ 		break;
+ 	      default:
+-		sprintf(err_msg, _MrmMMsg_0040);
++		sprintf(err_msg, "%s", _MrmMMsg_0040);
+ 		return Urm__UT_Error ("Urm__RelizeColorTable",
+ 				      err_msg, NULL, NULL, MrmFAILURE) ;
+ 	      }
+@@ -1252,7 +1252,7 @@
+ 	      break;
+ 	    default:
+ 	      result = MrmFAILURE;
+-	      sprintf (err_msg, _MrmMMsg_0040);
++	      sprintf (err_msg, "%s", _MrmMMsg_0040);
+ 	      Urm__UT_Error ("Urm__RelizeColorTable",
+ 			     err_msg, NULL, NULL, MrmFAILURE) ;
+ 	    }
+--- a/lib/Mrm/Mrmlread.c
++++ b/lib/Mrm/Mrmlread.c
+@@ -698,7 +698,7 @@
+ 	 XBlackPixelOfScreen(XDefaultScreenOfDisplay(display)));
+       break;
+     default:
+-      sprintf(err_msg, _MrmMMsg_0040);
++      sprintf(err_msg, "%s", _MrmMMsg_0040);
+       result = Urm__UT_Error ("MrmFetchColorLiteral",
+ 			      err_msg, NULL, NULL, MrmFAILURE) ;
+       _MrmAppUnlock(app);
+--- a/lib/Mrm/Mrmwcrw.c
++++ b/lib/Mrm/Mrmwcrw.c
+@@ -1390,7 +1390,7 @@
+ 			}
+ 		      break;
+ 		    default:
+-		      sprintf (err_msg, _MrmMMsg_0040);
++		      sprintf (err_msg, "%s", _MrmMMsg_0040);
+ 		      result = Urm__UT_Error ("Urm__CW_ConvertValue",
+ 					      err_msg, NULL, NULL, MrmFAILURE) ;
+ 		    };
+@@ -2426,7 +2426,7 @@
+ 	    }
+ 	  break;
+ 	default:
+-	  sprintf(err_msg, _MrmMMsg_0040);
++	  sprintf(err_msg, "%s", _MrmMMsg_0040);
+ 	  return Urm__UT_Error ("Urm__CW_ConvertValue",
+ 				err_msg, NULL, NULL, MrmFAILURE) ;
+ 	};
+--- a/tools/wml/wmlouth.c
++++ b/tools/wml/wmlouth.c
+@@ -225,12 +225,12 @@
+     printf ("\nCouldn't open UilSymGen.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write the sym_k..._object literals
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
+@@ -244,7 +244,7 @@
+ /*
+  * Define the sym_k_..._reason literals
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_reason_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr;
+@@ -258,7 +258,7 @@
+ /*
+  * Define the sym_k_..._arg literals
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -272,7 +272,7 @@
+ /*
+  * Define the sym_k_..._enumset structs and literals
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -286,7 +286,7 @@
+ /*
+  * Define the sym_k_..._enumval literals
+  */
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
+     {
+     enumvalobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
+@@ -301,7 +301,7 @@
+  * Define the sym_k_..._charsize literals
+  * Define the sym_k_..._charset literals
+  */
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     charsetobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -315,7 +315,7 @@
+ /*
+  * Define the sym_k_..._child literals
+  */
+-fprintf (outfil, canned8);
++fprintf (outfil, "%s", canned8);
+ for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
+@@ -379,12 +379,12 @@
+     printf ("\nCouldn't open UilSymChCL.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
+@@ -392,7 +392,7 @@
+     fprintf (outfil, "    sym_k_%s_object,\n",
+ 	     classobj->tkname);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -446,12 +446,12 @@
+     printf ("\nCouldn't open UilSymArTy.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -459,7 +459,7 @@
+     fprintf (outfil, "    sym_k_%s_value,\n",
+ 	     datobj->tkname);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -509,19 +509,19 @@
+     printf ("\nCouldn't open UilSymRArg.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+     fprintf (outfil, "    %d,\n",
+ 	     resobj->related_code);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -621,12 +621,12 @@
+     printf ("\nCouldn't open UilUrmClas.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write entries for widgets
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
+@@ -637,7 +637,7 @@
+     else 
+ 	fprintf (outfil, "  \"%s\",\t\n", synobj->convfunc);
+     }
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ 
+ /*
+  * Write entries for gadget variants of widget classes
+@@ -661,7 +661,7 @@
+ 		     synobj->name);
+ 	}
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * Write entries for non-dialog widgets
+@@ -685,7 +685,7 @@
+ 		     synobj->name);
+ 	}
+     }
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ 
+ /*
+  * Write entries for the resource a widget's controls map to
+@@ -701,7 +701,7 @@
+     else
+ 	fprintf (outfil, "  sym_k_%s_arg,\n", mapresobj->tkname);
+     }
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ 
+ /*
+  * Write entries for arguments
+@@ -714,7 +714,7 @@
+     fprintf (outfil, "  %s,\n",
+ 	     synres->resliteral);
+     }
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ 
+ /*
+  * Write entries for reasons
+@@ -727,7 +727,7 @@
+     fprintf (outfil, "  %s,\n",
+ 	     synres->resliteral);
+     }
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ 
+ /*
+  * close the output file
+@@ -781,13 +781,13 @@
+     printf ("\nCouldn't open UilConst.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Process the arguments in code order. We start with 1, and write out
+  * the mask after processing 8 codes.
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ strcpy (maskbuf, "0");
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+@@ -805,7 +805,7 @@
+     }
+ if ( bitno != 8 )
+     fprintf (outfil, "%s", maskbuf);
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -878,8 +878,8 @@
+     printf ("\nCouldn't open UilSymReas.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the reason code,
+@@ -925,13 +925,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( resndx=0 ; resndx<wml_obj_reason_ptr->cnt ; resndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[resndx].objptr;
+     fprintf (outfil, "  reason_class_vec%d,\n", resobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1004,8 +1004,8 @@
+     printf ("\nCouldn't open UilSymArTa.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the argument code,
+@@ -1051,13 +1051,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( resndx=0 ; resndx<wml_obj_arg_ptr->cnt ; resndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[resndx].objptr;
+     fprintf (outfil, "  arg_class_vec%d,\n", resobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1129,8 +1129,8 @@
+     printf ("\nCouldn't open UilSymChTa.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the child code,
+@@ -1174,13 +1174,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( childndx=0 ; childndx<wml_obj_child_ptr->cnt ; childndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[childndx].objptr;
+     fprintf (outfil, "  child_class_vec%d,\n", childobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1251,8 +1251,8 @@
+     printf ("\nCouldn't open UilSymCtl.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the class code,
+@@ -1296,13 +1296,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( ctlndx=0 ; ctlndx<wml_obj_class_ptr->cnt ; ctlndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ctlndx].objptr;
+     fprintf (outfil, "  object_class_vec%d,\n", clsobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1438,7 +1438,7 @@
+     printf ("\nCouldn't open UilSymNam.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write entries for widgets
+@@ -1517,7 +1517,7 @@
+     fprintf (outfil, "    \"%s\",\n",
+ 	     synch->name);
+     }
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ 
+ /*
+  * close the output file
+@@ -1621,12 +1621,12 @@
+     printf ("\nCouldn't open UilSymEnum.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Generate the enumeration value vectors for each enumeration set.
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -1643,7 +1643,7 @@
+ /*
+  * Generate the enumeration set tables
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -1655,7 +1655,7 @@
+ /*
+  * Create enumset table entries for arguments, similar to writing sym_k...
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -1669,13 +1669,13 @@
+ /*
+  * Create the enumval values table.
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
+     {
+     evobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
+     fprintf (outfil, "  %s,\n", evobj->syndef->enumlit);
+     }
+-fprintf (outfil, canned5a);
++fprintf (outfil, "%s", canned5a);
+ 
+ /*
+  * close the output file
+@@ -1813,12 +1813,12 @@
+     printf ("\nCouldn't open UilSymCSet.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Generate the standards name table
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1836,7 +1836,7 @@
+ /*
+  * Generate the writing direction table
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1858,7 +1858,7 @@
+ /*
+  * Generate the parsing direction table
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1880,7 +1880,7 @@
+ /*
+  * Generate the character size table
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1906,7 +1906,7 @@
+ /*
+  * Generate the $LANG name recognition table
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ lang_max = 0;
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+@@ -1936,7 +1936,7 @@
+ /*
+  * Generate the $LANG code lookup table, in upper case
+  */
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+--- a/tools/wml/wmloutkey.c
++++ b/tools/wml/wmloutkey.c
+@@ -574,16 +574,16 @@
+     printf ("\nCouldn't open UilKeyTab.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Print the case sensitive and insensitive tables
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ wmlOutputUilKeyTabBody (outfil, wml_tok_sens_ptr, &maxlen, &maxkey);
+ fprintf (outfil, canned2, maxlen, maxkey);
+ wmlOutputUilKeyTabBody (outfil, wml_tok_insens_ptr, &maxlen, &maxkey);
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -812,8 +812,8 @@
+     printf ("\nCouldn't open UilTokName.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Print the token name entries
+--- a/tools/wml/wmloutmm.c
++++ b/tools/wml/wmloutmm.c
+@@ -209,9 +209,9 @@
+ /*
+  * Write out header information
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ fprintf (outfil, "%s\n", name);
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ 
+ /*
+  * Alphabetize the controls, reason, and argument lists
+@@ -287,7 +287,7 @@
+     else
+ 	fprintf (outfil, "\n");
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * Write out the argument table
+@@ -323,7 +323,7 @@
+     }    
+     argndx += 1;
+     }
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ 
+ }
+ 
diff --git a/srcpkgs/motif/patches/03-no-demos.patch b/srcpkgs/motif/patches/03-no-demos.patch
new file mode 100644
index 00000000000..03953c4f8f7
--- /dev/null
+++ b/srcpkgs/motif/patches/03-no-demos.patch
@@ -0,0 +1,53 @@
+Description: Add option to disable building of demos
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1575
+Author: Graham Inggs <graham@nerve.org.za>
+Last-Update: 2013-01-09
+--- a/configure.ac
++++ b/configure.ac
+@@ -311,7 +311,20 @@
+ doc/man/man5/Makefile \
+ tools/Makefile \
+ tools/wml/Makefile \
+-demos/Makefile \
++lib/Xm/xmstring.list \
++])
++
++AC_ARG_ENABLE(demos, [  --disable-demos
++                       Disable building demos])
++
++if test x$enable_demos = x
++then
++    enable_demos="yes"
++fi
++
++if test "$enable_demos" = "yes"
++then
++  AC_CONFIG_FILES([demos/Makefile
+ demos/lib/Makefile \
+ demos/lib/Xmd/Makefile \
+ demos/lib/Wsm/Makefile \
+@@ -395,6 +408,11 @@
+ demos/doc/programGuide/ch17/Makefile \
+ demos/doc/programGuide/ch17/simple_drop/Makefile \
+ demos/doc/programGuide/ch17/simple_drag/Makefile \
+-lib/Xm/xmstring.list \
+-])
++  ])
++  MAYBE_DEMOS=demos
++else
++  MAYBE_DEMOS=
++fi
++AC_SUBST(MAYBE_DEMOS)
++
+ AC_OUTPUT
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -29,6 +29,7 @@
+              tools \
+              clients \
+              doc \
+-             demos
++             $(MAYBE_DEMOS)
++
+ AUTOMAKE_OPTIONS = 1.4
+ ACLOCAL_AMFLAGS = -I .
diff --git a/srcpkgs/motif/patches/06-cast-size_t-to-int.patch b/srcpkgs/motif/patches/06-cast-size_t-to-int.patch
new file mode 100644
index 00000000000..b5ce9c643a7
--- /dev/null
+++ b/srcpkgs/motif/patches/06-cast-size_t-to-int.patch
@@ -0,0 +1,17 @@
+Description: To prevent build failure during building with Hardening options
+ enabled due to "format '%d' expects argument of type 'int', but argument 5 has
+ type 'size_t'", the fifth argument is cast to integer on the input.
+Author: Paul Gevers <elbrus@debian.org>
+Updated: 13-01-2013
+
+--- a/tools/wml/wmloutkey.c
++++ b/tools/wml/wmloutkey.c
+@@ -627,7 +627,7 @@
+     fprintf (outfil, "    {%s, %s, %d, %s, \"%s\"},\n",
+ 	     tkclass,
+ 	     tksym,
+-	     strlen(tokstg),
++	     (int)strlen(tokstg),
+ 	     tktoken,
+ 	     tokstg);
+     if ( (int)strlen(tokstg) > *maxlen )
diff --git a/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch b/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
new file mode 100644
index 00000000000..5ddfd760075
--- /dev/null
+++ b/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
@@ -0,0 +1,118 @@
+Description: lintian reports several typos in manpages. This patch fixes those
+ reported
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1587
+Last-reviewed: 14 Jan 2013
+
+--- a/doc/man/man1/mwm.1
++++ b/doc/man/man1/mwm.1
+@@ -359,7 +359,7 @@
+ (and other associated messages) by saving the geometries of its clients to a state file\&. 
+ \fBmwm\fP can then be restarted by the XSMP session manager\&.
+ The default location for the state file is \fB$HOME/\&.mwmclientdb\fP\&.
+-This location can be overriden with the resource \fBsessionClientDB\fP\&.
++This location can be overridden with the resource \fBsessionClientDB\fP\&.
+ .SS "X Resources"
+ .PP
+ The \fBmwm\fP command is configured from its resource
+--- a/doc/man/man3/VendorShell.3
++++ b/doc/man/man3/VendorShell.3
+@@ -76,7 +76,7 @@
+ to the VendorShell resources for controlling toolTips. VendorShell displays
+ the XmNtooTipString in an XmLabel that is a child of a transientShell. The name
+ of the transientShell is TipShell, and the name of the XmLabel is TipLabel.
+-The appearance of the tip can be controlled by specifing resources on these
++The appearance of the tip can be controlled by specifying resources on these
+ widgets.
+ .PP
+ If an application uses the \fBXmNmwmDecorations\fP,
+--- a/doc/man/man3/XmComboBox.3
++++ b/doc/man/man3/XmComboBox.3
+@@ -581,7 +581,7 @@
+ ComboBox \fBXmNcomboBoxType\fP is
+ \fBXmDROP_DOWN_LIST\fP,
+ \fB<osfActivate>\fP, \fB<osfCancel>\fP, and
+-\fBReturn\fP are overriden by ComboBox actions\&.
++\fBReturn\fP are overridden by ComboBox actions\&.
+ .IP "\fB:c\fP <Key>\fB<osfDown>\fP:" 10
+ CBDropDownList()
+ .IP "\fB:c\fP <Key>\fB<osfUp>\fP:" 10
+--- a/doc/man/man3/XmGetPixmap.3
++++ b/doc/man/man3/XmGetPixmap.3
+@@ -109,7 +109,7 @@
+ In addition to X bitmap files (XBM), Motif also supports XPM (X
+ Pixmap) file formats and, from version 2.3, JPEG and PNG image formats\&.
+ (Note that support of JPEG and PNG image format is an optional feature
+-of Motif, in order to check if current version supports PNG ang JPEG
++of Motif, in order to check if current version supports PNG and JPEG
+ image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked
+ correspondingly.)
+ The \fBXBMLANGPATH\fP specifies the path for
+--- a/doc/man/man3/XmGetPixmapByDepth.3
++++ b/doc/man/man3/XmGetPixmapByDepth.3
+@@ -111,7 +111,7 @@
+ In addition to X bitmap files (XBM), Motif also supports XPM (X
+ Pixmap) file formats, and, from version 2.3, JPEG and PNG image formats\&.
+ (Note that support of JPEG and PNG image format is an optional feature
+-of Motif, in order to check if current version supports PNG ang JPEG
++of Motif, in order to check if current version supports PNG and JPEG
+ image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked
+ correspondingly.)
+ The \fBXBMLANGPATH\fP specifies the path for
+--- a/doc/man/man3/XmHierarchyGetChildNodes.3
++++ b/doc/man/man3/XmHierarchyGetChildNodes.3
+@@ -69,8 +69,8 @@
+ \fBXmHierarchy\fP(3)\&.
+ .SH "RETURN"
+ .PP
+-Returns WidgetList with child nodes of the hierachy, or NULL
+-if the hierachy contains no children\&.
++Returns WidgetList with child nodes of the hierarchy, or NULL
++if the hierarchy contains no children\&.
+ .SH "RELATED"
+ .PP
+ \fBXmHierarchy\fP(3)\&.
+--- a/doc/man/man3/XmManager.3
++++ b/doc/man/man3/XmManager.3
+@@ -502,7 +502,7 @@
+ Indicates whether the posting process should continue\&. The
+ application may modify this field\&.
+ .IP "\fItarget\fP" 10
+-Specifies the most specific widget or gadget that the menu sytem found
++Specifies the most specific widget or gadget that the menu system found
+ from the event that matches the event\&.
+ .SS "Translations"
+ .PP
+--- a/doc/man/man3/XmPrimitive.3
++++ b/doc/man/man3/XmPrimitive.3
+@@ -609,7 +609,7 @@
+ Indicates whether the posting process should continue\&. The
+ application may modify this field\&.
+ .IP "\fItarget\fP" 10
+-Specifies the most specific widget or gadget that the menu sytem found
++Specifies the most specific widget or gadget that the menu system found
+ from the event that matches the event\&.
+ .SS "Translations"
+ .PP
+--- a/doc/man/man3/XmRendition.3
++++ b/doc/man/man3/XmRendition.3
+@@ -71,7 +71,7 @@
+ If a resource in a rendition is unspecified, usually by setting it to
+ \fBXmAS_IS\fP or \fBXmUNSPECIFIED_PIXEL\fP,
+ then the value to be used for that resource is the value of the
+-immediately preceeding rendition in \fBXmString\fR\&. If that value
++immediately preceding rendition in \fBXmString\fR\&. If that value
+ is unspecified, then the preceding value is used, and so on\&. If
+ no renditions specify a value for a resource, then a default value
+ will be used\&.
+--- a/doc/man/man3/XmStringGetNextComponent.3
++++ b/doc/man/man3/XmStringGetNextComponent.3
+@@ -111,7 +111,7 @@
+ \fBXmSTRING_COMPONENT_UNKNOWN\fP\&. The data returned by these
+ components is returned in the \fIunknown_tag\fP, \fIunknown_length\fP,
+ and \fIunknown_value\fP fields\&. This apparent inconsistency is
+-designed to accomodate older applications that may not be equipped to
++designed to accommodate older applications that may not be equipped to
+ handle the newer component types of Motif version 2\&.0 and beyond\&.
+ Consequently, the use of this procedure is not recommended\&. Instead,
+ use the \fBXmStringGetNextTriple\fP procedure, which provides all the
diff --git a/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch b/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
new file mode 100644
index 00000000000..bc1beb029cd
--- /dev/null
+++ b/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
@@ -0,0 +1,156 @@
+Description: lintian reports hyphen misuse in manpages. This patch fixes those
+ reported.
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1588
+Last-reviewed: 06 Feb 2013
+
+--- a/doc/man/man1/mwm.1
++++ b/doc/man/man1/mwm.1
+@@ -904,7 +904,7 @@
+ resizeCursors\aResizeCursors\aT/F\aT
+ transientDecoration\aTransientDecoration\astring\amenu title
+ transientFunctions\aTransientFunctions\astring\aT{
+--minimize-maximize
++\-minimize-maximize
+ T}
+ useIconBox\aUseIconBox\aT/F\aF
+ .TE
+@@ -941,7 +941,7 @@
+ screen size of the icon box window depends on the iconImageMaximum (size)
+ and \fIiconDecoration\fP resources\&. The default value for size
+ is (6 * iconWidth + padding) wide by (1 * iconHeight + padding) high\&. The
+-default value of the location is +0 -0\&.
++default value of the location is +0 \-0\&.
+ .IP "\fIiconBoxName\fP\ (class\  \fIIconBoxName\fP)" 10
+ This resource specifies the name that is used to look up icon box resources\&.
+ The default name is iconbox\&.
+@@ -1059,7 +1059,7 @@
+ This resource is used to indicate which window management functions
+ are applicable (or not applicable) to transient windows\&. The function specification
+ is exactly the same as for the \fIclientFunctions\fP (client
+-specific) resource\&. The default value for this resource is -minimize -maximize\&.
++specific) resource\&. The default value for this resource is \-minimize \-maximize\&.
+ .IP "" 10
+ An application can also specify which functions \fBmwm\fP
+ should apply to its windows\&. If it does so, \fBmwm\fP applies
+@@ -1176,7 +1176,7 @@
+ title\aTitle bar (includes border)\&.
+ .TE
+ .PP
+-Examples: \fIMwm*XClock\&.clientDecoration: -resizeh -maximize\fP This removes the resize handles and maximize button from XClock
++Examples: \fIMwm*XClock\&.clientDecoration: \-resizeh \-maximize\fP This removes the resize handles and maximize button from XClock
+ windows\&. \fIMwm*XClock\&.clientDecoration: menu minimize border\fP This does the same thing as above\&. Note that either \fImenu\fP or \fIminimize\fP implies
+ \fItitle\fP\&.
+ .IP "\fIclientFunctions\fP\ (class\  \fIClientFunctions\fP)" 10
+--- a/doc/man/man4/mwmrc.4
++++ b/doc/man/man4/mwmrc.4
+@@ -84,7 +84,7 @@
+ be specified from the command line:
+ .PP
+ .nf
+-\f(CW/usr/X11R6/bin/X11/mwm -xrm "mwm*configFile: mymwmrc"\fR
++\f(CW/usr/X11R6/bin/X11/mwm \-xrm "mwm*configFile: mymwmrc"\fR
+ .fi
+ .PP
+ .SS "Resource Types"
+--- a/doc/man/man3/XmFontList.3
++++ b/doc/man/man3/XmFontList.3
+@@ -119,7 +119,7 @@
+ without a font list entry tag;
+ .PP
+ .nf
+-\f(CW*fontList:  -Adobe-Times-Medium-I-Normal--10*\fR
++\f(CW*fontList:  \-Adobe\-Times\-Medium\-I\-Normal\-\-10*\fR
+ .fi
+ .PP
+ .PP
+@@ -138,9 +138,9 @@
+ and an explicit font list entry tag\&.
+ .PP
+ .nf
+-\f(CW*fontList: -Adobe-Courier-Bold-R-Normal--25-180-100-100-M-150;\
+--JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240;\
+--JIS-Fixed-Medium-R-Normal--26-180-100-100-C-120:MY_TAG\fR
++\f(CW*fontList: \-Adobe\-Courier\-Bold\-R\-Normal\-\-25\-180\-100\-100\-M\-150;\
++\-JIS\-Fixed\-Medium\-R\-Normal\-\-26\-180\-100\-100\-C\-240;\
++\-JIS\-Fixed\-Medium\-R\-Normal\-\-26\-180\-100\-100\-C\-120:MY_TAG\fR
+ .fi
+ .PP
+ .PP
+--- a/doc/man/man3/XmGetPixmapByDepth.3
++++ b/doc/man/man3/XmGetPixmapByDepth.3
+@@ -245,8 +245,8 @@
+ \f(CW/* XBM file */
+ #define plaid_width 22
+ #define plaid_height 22
+-#define plaid_x_hot -1
+-#define plaid_y_hot -1
++#define plaid_x_hot \-1
++#define plaid_y_hot \-1
+ static char plaid_bits[] = {
+    0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
+    0x75, 0xfd, 0x3f, 0xff, 0x57, 0x15, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
+--- a/doc/man/man3/XmList.3
++++ b/doc/man/man3/XmList.3
+@@ -182,7 +182,7 @@
+ A value of 1 transfers the first item in the List; a value of 2
+ transfers the second item; and so on\&.
+ If the entire contents of the List are being transferred, the value is
+--1\&.
++\-1\&.
+ .PP
+ As a source of data, List supports the following targets and associated
+ conversions of data to these targets:
+--- a/doc/man/man3/XmScreen.3
++++ b/doc/man/man3/XmScreen.3
+@@ -300,7 +300,7 @@
+ startup time, either by placing it within a defaults file or by using the
+ \fB-xrm\fP command line argument\&. For example:
+ .IP "" 10
+-\fBmyProg -xrm "*menuCursor: arrow"\fP
++\fBmyProg \-xrm "*menuCursor: arrow"\fP
+ .IP "" 10
+ The menu cursor can also be selected in the program through
+ the function \fBXmSetMenuCursor\fP\&.
+--- a/doc/man/man3/XmTabListCopy.3
++++ b/doc/man/man3/XmTabListCopy.3
+@@ -71,7 +71,7 @@
+ Specifies where to start copying\&. A value of 0 (zero) indicates begin
+ at the beginning, a value of 1 indicates to skip the first tab, and so
+ on\&. A negative indicates to begin counting backwards from the end\&.
+-A value of -1 indicates to start copying from the last tab\&.
++A value of \-1 indicates to start copying from the last tab\&.
+ .IP "\fIcount\fP" 10
+ Specifies the number of tabs to copy\&. A value of 0 (zero) indicates
+ to copy all elements from the starting point to the end (beginning if
+--- a/doc/man/man3/XmTabListInsertTabs.3
++++ b/doc/man/man3/XmTabListInsertTabs.3
+@@ -83,7 +83,7 @@
+ value of 1 makes it the second tab, and so on\&. If \fIposition\fP is
+ greater than the number of tabs in \fIoldlist\fP, then the tabs will
+ be inserted at the end\&. If \fIposition\fP is negative, the count will
+-be backwards from the end\&. A value of -1 makes the first new tab
++be backwards from the end\&. A value of \-1 makes the first new tab
+ the last tab, and so on\&.
+ .SH "RETURN"
+ .PP
+--- a/doc/man/man5/UIL.5
++++ b/doc/man/man5/UIL.5
+@@ -1211,7 +1211,7 @@
+ 3\&.1415E-2 (equals \&.031415)
+ T}\a2\&.87 e6 (embedded blanks)
+ T{
+--6\&.29e7 (equals -62900000)
++\-6\&.29e7 (equals \-62900000)
+ T}\a2\&.0e100 (out of range)
+ .TE
+ .PP
+@@ -1322,7 +1322,7 @@
+ You can use parentheses to override the normal precedence of operators\&.
+ In a sequence of unary operators, the operations are performed in
+ right-to-left
+-order\&. For example, \fB- + -A\fP is equivalent to \fB-(+(-A))\fP\&.
++order\&. For example, \fB- + \-A\fP is equivalent to \fB\-(+(\-A))\fP\&.
+ In a sequence of binary operators of the same precedence, the operations
+ are performed in left-to-right order\&. For example, \fBA*B/C*D\fP is
+ equivalent to \fB((A*B)/C)*D\fP\&.
diff --git a/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch b/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
new file mode 100644
index 00000000000..90d39a3f0c0
--- /dev/null
+++ b/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
@@ -0,0 +1,25 @@
+Description: lintian reports a typo in libXm. This patch fixes it.
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1589
+Last-reviewed: 06 Feb 2013
+
+--- a/lib/Xm/FontS.c
++++ b/lib/Xm/FontS.c
+@@ -1225,7 +1225,7 @@
+ 
+     if ((fontdata = XLoadQueryFont(XtDisplay((Widget) fsw), font)) == NULL)
+     {
+-	sprintf(buf, "Font '%s'\nis not availiable on this machine", font);
++	sprintf(buf, "Font '%s'\nis not available on this machine", font);
+ 	DisplayUserError(fsw, buf);
+ 	err = True;
+     }
+@@ -1275,7 +1275,7 @@
+ 					   fbuf)) == NULL) 
+ 	    {
+ 		sprintf(buf,
+-			    "Font '%s'\nis not availiable on this machine",
++			    "Font '%s'\nis not available on this machine",
+ 			    font);
+ 		DisplayUserError(fsw, buf);
+ 		    err = True;
diff --git a/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch b/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
new file mode 100644
index 00000000000..cf51d1fa3d4
--- /dev/null
+++ b/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
@@ -0,0 +1,49 @@
+Description: lintian reports bad whatis entries in manpages. Fixing here
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1590
+Last-reviewed: 17 Feb 2013
+
+--- a/doc/man/man3/XmColorSelector.3
++++ b/doc/man/man3/XmColorSelector.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmColorSelector 3X ""
+ .SH NAME
+-The Color Selector widget
++XmColorSelector \- The Color Selector widget
+ .SH SYNOPSIS
+ #include <Xm/ColorS.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmExt18List.3
++++ b/doc/man/man3/XmExt18List.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XxExt18LIst 3x ""
+ .SH NAME
+-The Internationalized Extended List widget
++XmExt18List \- The Internationalized Extended List widget
+ .SH SYNOPSIS
+ #include <Xm/Ext18List.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmFontSelector.3
++++ b/doc/man/man3/XmFontSelector.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmFontSelector 3X ""
+ .SH NAME
+-The Font Selector widget
++XmFontSelector \- The Font Selector widget
+ .SH SYNOPSIS
+ #include <Xm/FontS.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmIconButton.3
++++ b/doc/man/man3/XmIconButton.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmIconButton 3X "15 July 1992"
+ .SH NAME
+-The Icon Button widget
++XmIconButton \- The Icon Button widget
+ .SH SYNOPSIS
+ Documents the XmIconButton widget
+ .SH DESCRIPTION
diff --git a/srcpkgs/motif/patches/11-fix_underlinking.patch b/srcpkgs/motif/patches/11-fix_underlinking.patch
new file mode 100644
index 00000000000..601b0918632
--- /dev/null
+++ b/srcpkgs/motif/patches/11-fix_underlinking.patch
@@ -0,0 +1,564 @@
+Description: Fix underlinking of libXt, libXext and libX11
+ Recent changes to default linker behaviour prevent shared libraries from being
+ indirectly linked, resulting in FTBFS in Ubuntu Raring.
+ .
+ This patch fixes this by explicitly linking libXt, libXext and libX11 wherever
+ necessary.  Demos are patched even though they are not built for distribution.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1583
+Last-Update: 2013-02-26
+--- a/clients/mwm/Makefile.am
++++ b/clients/mwm/Makefile.am
+@@ -9,7 +9,7 @@
+ rc_DATA = system.mwmrc
+ 
+ bin_PROGRAMS = mwm
+-mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la 
++mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la -lXt -lXext -lX11
+ 
+ INCLUDES = -DLARGECURSORS -DR2_COMPAT -DUNMAP_ON_RESTART \
+            -DCDE_INSTALLATION_TOP=\"@CDE_INSTALLATION_TOP@\" \
+--- a/clients/uil/Makefile.am
++++ b/clients/uil/Makefile.am
+@@ -11,9 +11,9 @@
+ UilParser.lo: UilParser.c
+ 	$(LTCOMPILE) -DCALLABLE -c UilParser.c
+ 
+-libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la 
++libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+-uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la 
++uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
+--- a/clients/xmbind/Makefile.am
++++ b/clients/xmbind/Makefile.am
+@@ -2,6 +2,6 @@
+ 
+ bin_PROGRAMS = xmbind
+ 
+-LDADD = ../../lib/Xm/libXm.la
++LDADD = ../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS}
+--- a/demos/doc/programGuide/ch05/Scale/Makefile.am
++++ b/demos/doc/programGuide/ch05/Scale/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch06/combo_box/Makefile.am
++++ b/demos/doc/programGuide/ch06/combo_box/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch06/spin_box/Makefile.am
++++ b/demos/doc/programGuide/ch06/spin_box/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch08/Container/Makefile.am
++++ b/demos/doc/programGuide/ch08/Container/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch08/Notebook/Makefile.am
++++ b/demos/doc/programGuide/ch08/Notebook/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch16/Makefile.am
++++ b/demos/doc/programGuide/ch16/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch17/simple_drag/Makefile.am
++++ b/demos/doc/programGuide/ch17/simple_drag/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch17/simple_drop/Makefile.am
++++ b/demos/doc/programGuide/ch17/simple_drop/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/lib/Exm/wml/Makefile.am
++++ b/demos/lib/Exm/wml/Makefile.am
+@@ -18,7 +18,7 @@
+ 	-I$(top_builddir)/clients/uil \
+ 	${X_CFLAGS} 
+ 
+-LDADD = $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Xm/libXm.la -lXt
+ 
+ DISTCLEANFILES = motif.wmd
+ 
+--- a/demos/lib/Xmd/Makefile.am
++++ b/demos/lib/Xmd/Makefile.am
+@@ -12,7 +12,7 @@
+ Print.h PrintP.h \
+ RegEdit.h RegEditI.h
+ 
+-LDADD = libXmd.a ../../../lib/Xm/libXm.la
++LDADD = libXmd.a ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(srcdir)/../../../lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/ButtonBox/Makefile.am
++++ b/demos/programs/ButtonBox/Makefile.am
+@@ -8,6 +8,6 @@
+ bboxdemo_SOURCES = bboxdemo.c
+ data_DATA = $(EXTRA_DIST) $(bboxdemo_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/ColorSel/Makefile.am
++++ b/demos/programs/ColorSel/Makefile.am
+@@ -7,6 +7,6 @@
+ colordemo_SOURCES = util-c.c colordemo.c
+ EXTRA_DIST = Imakefile
+ data_DATA = $(colordemo_SOURCES) $(EXTRA_DIST)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Column/Makefile.am
++++ b/demos/programs/Column/Makefile.am
+@@ -8,5 +8,5 @@
+ EXTRA_DIST = Imakefile Column.ad
+ data_DATA = $(EXTRA_DIST) $(column_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Combo2/Makefile.am
++++ b/demos/programs/Combo2/Makefile.am
+@@ -8,5 +8,5 @@
+ combo_SOURCES = combo.c
+ data_DATA = $(EXTRA_DIST) $(combo_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Exm/app_in_c/Makefile.am
++++ b/demos/programs/Exm/app_in_c/Makefile.am
+@@ -14,4 +14,4 @@
+            -I$(top_builddir)/lib \
+             ${X_CFLAGS} 
+ LDADD = ../../../lib/Exm/libExm.a \
+-	../../../../lib/Xm/libXm.la
++	../../../../lib/Xm/libXm.la -lXt -lXext -lX11
+--- a/demos/programs/Exm/simple_app/Makefile.am
++++ b/demos/programs/Exm/simple_app/Makefile.am
+@@ -14,5 +14,6 @@
+            -I$(srcdir)/../../../lib \
+            -I$(top_builddir)/lib \
+            ${X_CFLAGS} 
+-LDADD = ../../../../lib/Xm/libXm.la \
+-        ../../../lib/Exm/libExm.a
++LDADD = ../../../lib/Exm/libExm.a \
++        ../../../../lib/Xm/libXm.la -lXt -lX11
++
+--- a/demos/programs/Ext18List/Makefile.am
++++ b/demos/programs/Ext18List/Makefile.am
+@@ -10,6 +10,6 @@
+ EXTRA_DIST = Imakefile
+ data_DATA = $(EXTRA_DIST) $(ext18list_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/FontSel/Makefile.am
++++ b/demos/programs/FontSel/Makefile.am
+@@ -7,6 +7,6 @@
+ fontsel_SOURCES = callbacks-c.c creation-c.c fontsel.c fontsel.h
+ EXTRA_DIST = Imakefile
+ data_DATA = $(EXTRA_DIST) $(fontsel_SOURCES)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/IconB/Makefile.am
++++ b/demos/programs/IconB/Makefile.am
+@@ -8,7 +8,7 @@
+ iconbuttondemo_SOURCES = misc.c  iconbuttondemo.c
+ data_DATA = $(iconbuttondemo_SOURCES) $(EXTRA_DIST)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. \
+            -I$(srcdir)/$(TOPDIR)/lib \
+--- a/demos/programs/Outline/Makefile.am
++++ b/demos/programs/Outline/Makefile.am
+@@ -7,6 +7,6 @@
+ bin_PROGRAMS = outline
+ outline_SOURCES = outline.c
+ data_DATA = $(outline_SOURCES) $(EXTRA_DIST)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Paned/Makefile.am
++++ b/demos/programs/Paned/Makefile.am
+@@ -8,6 +8,6 @@
+ paned_SOURCES = creation-c.c paned.c
+ data_DATA = $(EXTRA_DIST) $(paned_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/TabStack/Makefile.am
++++ b/demos/programs/TabStack/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = Imakefile
+ data_DATA = $(tabstack_SOURCES) $(EXTRA_DIST)            
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Tree/Makefile.am
++++ b/demos/programs/Tree/Makefile.am
+@@ -8,6 +8,6 @@
+ tree_SOURCES = bxutil-c.c  tree.c
+ data_DATA = $(EXTRA_DIST) $(tree_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/airport/Makefile.am
++++ b/demos/programs/airport/Makefile.am
+@@ -8,5 +8,5 @@
+                   dragsource.h dropsite.h main.h
+ EXTRA_DIST = Imakefile XmdAirport.ad README
+ data_DATA = $(airport_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/animate/Makefile.am
++++ b/demos/programs/animate/Makefile.am
+@@ -17,7 +17,7 @@
+ 
+ bin_PROGRAMS = xmanimate
+ 
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib \
+            -I$(srcdir)/../../lib \
+--- a/demos/programs/drag_and_drop/Makefile.am
++++ b/demos/programs/drag_and_drop/Makefile.am
+@@ -10,6 +10,6 @@
+ simpledrop_SOURCES = simpledrop.c
+ data_DATA = $(EXTRA_DIST) $(DNDDemo_SOURCES) $(simpledrop_SOURCES)
+ noinst_HEADERS = DNDDemo.h
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/draw/Makefile.am
++++ b/demos/programs/draw/Makefile.am
+@@ -7,5 +7,5 @@
+ draw_SOURCES = draw.c
+ EXTRA_DIST = Imakefile XmdDraw.ad README draw.help draw.man
+ data_DATA = $(EXTRA_DIST) $(draw_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/earth/Makefile.am
++++ b/demos/programs/earth/Makefile.am
+@@ -7,5 +7,5 @@
+ earth_SOURCES = earth.c
+ EXTRA_DIST = terre.xbm earth.man Imakefile README
+ data_DATA = $(EXTRA_DIST) $(earth_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lXext -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/filemanager/Makefile.am
++++ b/demos/programs/filemanager/Makefile.am
+@@ -11,7 +11,7 @@
+            obj.xpm pix.xpm s_dir.xpm s_exec.xpm s_file.xpm \
+            s_none.xpm s_pix.xpm
+ data_DATA = $(EXTRA_DIST) $(filemanager_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+ 
+--- a/demos/programs/fileview/Makefile.am
++++ b/demos/programs/fileview/Makefile.am
+@@ -11,7 +11,7 @@
+ 
+ UILS= French.uil German.uil English.uil
+ 
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/getsubres/Makefile.am
++++ b/demos/programs/getsubres/Makefile.am
+@@ -7,5 +7,5 @@
+ EXTRA_DIST = getsubres.help getsubres.man README Imakefile
+ getsubres_SOURCES = getsubres.c
+ data_DATA = $(EXTRA_DIST) $(getsubres_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/hellomotif/Makefile.am
++++ b/demos/programs/hellomotif/Makefile.am
+@@ -7,7 +7,7 @@
+ EXTRA_DIST = hellomotif.uil Imakefile README
+ hellomotif_SOURCES = hellomotif.c
+ data_DATA = $(EXTRA_DIST) $(hellomotif_SOURCES) hellomotif.uid
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+ all: hellomotif.uid
+--- a/demos/programs/hellomotifi18n/Makefile.am
++++ b/demos/programs/hellomotifi18n/Makefile.am
+@@ -12,7 +12,7 @@
+ helloint_DEPENDENCIES = helloint.uid C/uid/l_strings.uid english/uid/l_strings.uid french/uid/l_strings.uid hebrew/uid/l_strings.uid japan/uid/l_strings.uid japanese/uid/l_strings.uid swedish/uid/l_strings.uid
+ 
+ INCLUDES = -I$(top_srcdir)/lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la -lXt
+ 
+ SUFFIXES = .uil .uid
+ 
+--- a/demos/programs/i18ninput/Makefile.am
++++ b/demos/programs/i18ninput/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = XmdI18nInput.ad README i18ninput.man i18ninput.help \
+              Imakefile
+ data_DATA = $(EXTRA_DIST) $(i18ninput_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/panner/Makefile.am
++++ b/demos/programs/panner/Makefile.am
+@@ -7,5 +7,5 @@
+ panner_SOURCES = panner.c
+ EXTRA_DIST = README panner.man Imakefile
+ data_DATA = $(EXTRA_DIST) $(panner_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/periodic/Makefile.am
++++ b/demos/programs/periodic/Makefile.am
+@@ -7,7 +7,7 @@
+ EXTRA_DIST = periodic.uil periodic_l.uil XmdPeriodic.ad Imakefile README
+ periodic_SOURCES = periodic.c
+ data_DATA = $(EXTRA_DIST) $(periodic_SOURCES) periodic.uid
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/piano/Makefile.am
++++ b/demos/programs/piano/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = piano.images README Inv8_part1.piano Inv8_part2.piano \
+              piano.man Imakefile
+ data_DATA  = $(EXTRA_DIST) $(piano_SOURCES) 
+-LDADD = ../../../lib/Xm/libXm.la -lm
++LDADD = ../../../lib/Xm/libXm.la -lm -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/popups/Makefile.am
++++ b/demos/programs/popups/Makefile.am
+@@ -7,6 +7,6 @@
+ autopopups_SOURCES = autopopups.c
+ EXTRA_DIST = README autopopups.man Imakefile
+ data_DATA = $(EXTRA_DIST) $(autopopups_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/sampler2_0/Makefile.am
++++ b/demos/programs/sampler2_0/Makefile.am
+@@ -10,6 +10,6 @@
+ bin_PROGRAMS = sampler2_0
+ sampler2_0_SOURCES = sampler2_0.c
+ data_DATA = $(sampler2_0_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/setdate/Makefile.am
++++ b/demos/programs/setdate/Makefile.am
+@@ -7,6 +7,6 @@
+ EXTRA_DIST = XmdSetDate.ad README setDate.man Imakefile
+ setDate_SOURCES = setDate.c
+ data_DATA = $(EXTRA_DIST) $(setDate_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/todo/Makefile.am
++++ b/demos/programs/todo/Makefile.am
+@@ -9,4 +9,4 @@
+ data_DATA = $(EXTRA_DIST) $(todo_SOURCES)
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la 
++LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la -lXt -lXext -lX11
+--- a/demos/programs/tooltips/Makefile.am
++++ b/demos/programs/tooltips/Makefile.am
+@@ -7,6 +7,6 @@
+ bin_PROGRAMS = tooltips
+ tooltips_SOURCES = tooltips.c
+ data_DATA = $(tooltips_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/workspace/Makefile.am
++++ b/demos/programs/workspace/Makefile.am
+@@ -11,4 +11,4 @@
+               wsm.h wsmSend.h wsmStruct.h wsm_ui.h xrmLib.h
+ data_DATA = $(wsm_SOURCES) $(EXTRA_DIST)
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm
++LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm -lXt -lX11
+--- a/demos/unsupported/aicon/Makefile.am
++++ b/demos/unsupported/aicon/Makefile.am
+@@ -2,7 +2,7 @@
+ 
+ noinst_PROGRAMS = aicon
+  
+-LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la 
++LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/unsupported/dainput/Makefile.am
++++ b/demos/unsupported/dainput/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ dainput_SOURCES = dainput.c dainput_dlg.c dainput_ui.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/dogs/Makefile.am
++++ b/demos/unsupported/dogs/Makefile.am
+@@ -16,7 +16,7 @@
+ 
+ dogs_DEPENDENCIES = dogs.uid
+ 
+-LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/unsupported/hellomotif/Makefile.am
++++ b/demos/unsupported/hellomotif/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = hellomotif.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/motifshell/Makefile.am
++++ b/demos/unsupported/motifshell/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = motifshell.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmapdef/Makefile.am
++++ b/demos/unsupported/xmapdef/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmapdef.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmfonts/Makefile.am
++++ b/demos/unsupported/xmfonts/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmfonts.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmforc/Makefile.am
++++ b/demos/unsupported/xmforc/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmforc.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmform/Makefile.am
++++ b/demos/unsupported/xmform/Makefile.am
+@@ -6,6 +6,6 @@
+ 
+ EXTRA_DIST = Imakefile
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS}
+--- a/tools/wml/Makefile.am
++++ b/tools/wml/Makefile.am
+@@ -30,7 +30,7 @@
+ wml_LDADD = -L. -lwml
+ wml_DEPENDENCIES = libwml.a
+ 
+-wmldbcreate_LDADD = ../../lib/Xm/libXm.la
++wmldbcreate_LDADD = ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I../../lib -I$(srcdir)/../../lib -I$(srcdir)/../../include ${X_CFLAGS} 
+ 
diff --git a/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch b/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
new file mode 100644
index 00000000000..6d532859d73
--- /dev/null
+++ b/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
@@ -0,0 +1,54 @@
+Description: Fix hardcoded path to /usr/lib/X11/rgb.txt in lib/Xm/ColorS.c
+ LibXm is hardcoded to read rgb.txt from /usr/lib/X11 but this file, provided
+ by x11-common in Debian, is located in /etc/X11 and /usr/share/X11 via symlink.
+ .
+ This patch fixes this by allowing the directory in which rgb.txt resides to be
+ customized by the --with-x11rgbdir=DIR configure option.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1585
+Last-Update: 2013-03-12
+--- a/configure.ac
++++ b/configure.ac
+@@ -189,6 +189,10 @@
+ XMBINDDIR_FALLBACK="$xmbinddir"
+ AC_SUBST(XMBINDDIR_FALLBACK)
+ 
++AC_ARG_WITH(x11rgbdir, [  --with-x11rgbdir=DIR  rgb.txt is located in DIR], x11rgbdir=$withval, x11rgbdir="/usr/lib/X11")
++X11RGBPATH="$x11rgbdir/rgb.txt"
++AC_SUBST(X11RGBPATH)
++
+ RM="rm -f"
+ AC_SUBST(RM)
+ 
+--- a/lib/Xm/ColorS.c
++++ b/lib/Xm/ColorS.c
+@@ -123,6 +123,10 @@
+  *       STATIC DECLARATIONS
+  ************************************************************/
+ 
++#ifndef X11RGBPATH
++#define X11RGBPATH "/usr/lib/X11/rgb.txt"
++#endif
++
+ static XtResource resources[] =
+ {
+   {
+@@ -146,7 +150,7 @@
+   {
+     XmNrgbFile, XmCString, XmRString,
+     sizeof(String), XtOffsetOf(XmColorSelectorRec, cs.rgb_file),
+-    XmRString, (XtPointer) "/usr/lib/X11/rgb.txt"
++    XmRString, (XtPointer) X11RGBPATH
+   },
+ #endif
+   {
+--- a/lib/Xm/Makefile.am
++++ b/lib/Xm/Makefile.am
+@@ -8,6 +8,7 @@
+ INCLUDES = -I.. -I$(srcdir)/.. -DXMBINDDIR_FALLBACK=\"@XMBINDDIR_FALLBACK@\" \
+            -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
++           -DX11RGBPATH=\"@X11RGBPATH@\" \
+            ${X_CFLAGS}
+ xmdir = $(includedir)/Xm
+ 
diff --git a/srcpkgs/motif/patches/15-link_uil_against_libuil.patch b/srcpkgs/motif/patches/15-link_uil_against_libuil.patch
new file mode 100644
index 00000000000..11792a7a4c8
--- /dev/null
+++ b/srcpkgs/motif/patches/15-link_uil_against_libuil.patch
@@ -0,0 +1,29 @@
+Description: Link the uil executable against libUil
+ Linking the uil executable againt libUil instead of compiling with the libUil
+ code results in a reduction in size of the uil executable from about 348KB
+ to about 16KB.
+ .
+ This patch originates from Red Hat.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1586
+Last-Update: 2013-03-12
+--- a/clients/uil/Makefile.am
++++ b/clients/uil/Makefile.am
+@@ -13,7 +13,7 @@
+ 
+ libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+-uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
++uil_LDADD = libUil.la ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
+@@ -42,7 +42,7 @@
+ 		UilLstMac.c	UilSemVal.c	UilSemCSet.c	UilDB.c
+ 
+ SRCS =		$(COMMON_SRC)
+-SRCS2 =		$(COMMON_SRC)	UilMain.c
++SRCS2 =		UilMain.c
+ 
+ HEADERS_1 = 	Uil.h		UilSymGl.h	UilSymDef.h \
+ 		UilDef.h	XmAppl.uil
diff --git a/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch b/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
new file mode 100644
index 00000000000..95a753e083e
--- /dev/null
+++ b/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
@@ -0,0 +1,17 @@
+Description: Fix undefined use of sprintf
+ This patch fixes the undefined use of sprintf when the
+ source and destination buffers overlap.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1628
+Last-Update: 2013-09-24
+--- a/lib/Xm/XmRenderT.c
++++ b/lib/Xm/XmRenderT.c
+@@ -2703,7 +2703,7 @@
+       number = tlist -> count;
+       tab = (_XmTab) tlist -> start;
+       while(number > 0) {
+-	sprintf(temp, "%s %f %d %d %d, ", temp, tab -> value, 
++	sprintf(temp + strlen(temp), " %f %d %d %d, ", tab -> value,
+ 		tab -> units, tab -> alignment, tab -> offsetModel);
+ 	tab = (_XmTab) tab -> next;
+ 	number--;
diff --git a/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch b/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
new file mode 100644
index 00000000000..a77b8793a8e
--- /dev/null
+++ b/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
@@ -0,0 +1,384 @@
+Description: Switch to system iswspace() function
+ This patch replaces calls to _XmDataFieldIsWSpace() in lib/Xm/DataF.c
+ and _XmTextFieldIsWSpace() in lib/Xm/TextF.c with calls to the system
+ iswspace() function.
+ .
+ It fixes an array bounds error in lib/Xm/DataF.c where 
+ _XmDataFieldIsWSpace() is called with num_entries = 3.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1629
+Last-Update: 2013-11-18
+--- a/lib/Xm/DataF.c
++++ b/lib/Xm/DataF.c
+@@ -208,7 +208,6 @@
+ static Boolean df_VerifyLeave() ;
+ static Boolean _XmDataFieldIsWordBoundary() ;
+ static int _XmGetImage(Screen *, char *, XImage **);
+-static Boolean _XmDataFieldIsWSpace() ;
+ static void df_FindWord() ;
+ static void df_FindPrevWord() ;
+ static void df_FindNextWord() ;
+@@ -549,10 +548,6 @@
+                         XmDataFieldWidget tf,
+                         XmTextPosition pos1,
+                         XmTextPosition pos2) ;
+-static Boolean _XmDataFieldIsWSpace( 
+-                        wchar_t wide_char,
+-                        wchar_t *white_space,
+-                        int num_entries) ;
+ static void df_FindWord( 
+                         XmDataFieldWidget tf,
+                         XmTextPosition begin,
+@@ -4549,40 +4544,6 @@
+    return False;
+ }
+ 
+-/* This routine accepts an array of wchar_t's containing wchar encodings
+- * of whitespace characters (and the number of array elements), comparing
+- * the wide character passed to each element of the array.  If a match
+- * is found, we got a white space.  This routine exists only because
+- * iswspace(3c) is not yet standard.  If a system has isw* available,
+- * calls to this routine should be changed to iswspace(3c) (and callers
+- * should delete initialization of the array), and this routine should
+- * be deleted.  Its a stop gap measure to avoid allocating an instance
+- * variable for the white_space array and/or declaring a widget wide
+- * global for the data and using a macro.  Its ugly, but it works and 
+- * in the long run will be replaced by standard functionality. */
+-
+-/* ARGSUSED */
+-static Boolean
+-#ifdef _NO_PROTO
+-_XmDataFieldIsWSpace( wide_char, white_space, num_entries )
+-	wchar_t wide_char ;
+-	wchar_t * white_space ;
+-	int num_entries ;
+-#else
+-_XmDataFieldIsWSpace(
+-	wchar_t wide_char,
+-	wchar_t * white_space ,
+-	int num_entries )
+-#endif /* _NO_PROTO */
+-{
+-   int i;
+-
+-   for (i=num_entries; i > 0; i--){
+-      if (wide_char == white_space[i]) return True;
+-   }
+-   return False;
+-}
+-
+ static void 
+ #ifdef _NO_PROTO
+ df_FindWord( tf, begin, left, right )
+@@ -4599,7 +4560,6 @@
+ #endif /* _NO_PROTO */
+ {
+     XmTextPosition start, end;
+-    wchar_t white_space[3];
+ 
+     if (XmTextF_max_char_size(tf) == 1) {
+        for (start = begin; start > 0; start--) {
+@@ -4617,11 +4577,8 @@
+        }
+        *right = end - 1;
+     } else { /* check for iswspace and iswordboundary in each direction */
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+        for (start = begin; start > 0; start --) {
+-          if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start-1],white_space, 3)
++          if (iswspace(XmTextF_wc_value(tf)[start-1])
+ 	      || _XmDataFieldIsWordBoundary(tf, (XmTextPosition) start - 1, 
+ 					    start)) {
+ 		 break;
+@@ -4630,7 +4587,7 @@
+        *left = start;
+ 
+        for (end = begin; end <= XmTextF_string_length(tf); end++) {
+-	   if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)){
++	   if (iswspace(XmTextF_wc_value(tf)[end])){
+ 	      end++;
+ 	      break;
+ 	   } else if (end < XmTextF_string_length(tf)) {
+@@ -4659,14 +4616,6 @@
+ {
+ 
+     XmTextPosition start = XmTextF_cursor_position(tf);
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+-
+ 
+     if (XmTextF_max_char_size(tf) == 1) {
+        if ((start > 0) && 
+@@ -4680,11 +4629,9 @@
+        }
+        df_FindWord(tf, start, left, right);
+     } else { 
+-       if ((start > 0) && (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start - 1],
+-						white_space, 3))) {
++       if ((start > 0) && (iswspace(XmTextF_wc_value(tf)[start - 1]))) {
+           for (; start > 0; start--) {
+-	     if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start -1], 
+-				       white_space, 3)){
++	     if (!iswspace(XmTextF_wc_value(tf)[start -1])){
+ 		start--;
+ 		break;
+              }
+@@ -4713,14 +4660,6 @@
+ {
+ 
+     XmTextPosition end = XmTextF_cursor_position(tf);
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+-
+ 
+     if(XmTextF_max_char_size(tf) == 1) {
+        if (isspace((int)(unsigned char)XmTextF_value(tf)[end])) {
+@@ -4742,9 +4681,9 @@
+        if (*right < XmTextF_string_length(tf))
+           *right = *right - 1;
+    } else {
+-      if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) {
++      if (iswspace(XmTextF_wc_value(tf)[end])) {
+ 	 for ( ; end < XmTextF_string_length(tf); end ++) {
+-	   if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) {
++	   if (!iswspace(XmTextF_wc_value(tf)[end])) {
+ 	       break;
+            }
+          }
+@@ -4758,10 +4697,9 @@
+        * If word boundary caused by whitespace, set right to the last 
+        * whitespace following the end of the current word.
+        */
+-      if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], white_space, 3))      {
++      if (iswspace(XmTextF_wc_value(tf)[(int)*right]))      {
+          while (*right < XmTextF_string_length(tf) &&
+-               _XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], 
+-				    white_space, 3)) {
++               iswspace(XmTextF_wc_value(tf)[(int)*right])) {
+             *right = *right + 1;
+ 	 }
+ 	 if (*right < XmTextF_string_length(tf))
+@@ -5872,13 +5810,6 @@
+ {
+     XmDataFieldWidget tf = (XmDataFieldWidget) w;
+     XmTextPosition cursorPos, position, dummy;
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+ 
+     cursorPos = XmTextF_cursor_position(tf);
+ 
+@@ -5896,16 +5827,13 @@
+              }
+           }
+        } else {
+-	  if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[cursorPos],
+-				   white_space, 3))
++	  if (iswspace(XmTextF_wc_value(tf)[cursorPos]))
+ 	     df_FindWord(tf, cursorPos, &dummy, &position);
+ 	  else
+ 	     df_FindNextWord(tf, &dummy, &position);
+-          if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position],
+-				   white_space, 3)){
++          if (iswspace(XmTextF_wc_value(tf)[position])){
+ 	     for (; position < XmTextF_string_length(tf); position++) {
+-		if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position], 
+-					  white_space, 3))
++		if (!iswspace(XmTextF_wc_value(tf)[position]))
+ 		   break;
+ 	     }
+ 	  }
+--- a/lib/Xm/TextF.c
++++ b/lib/Xm/TextF.c
+@@ -360,10 +360,6 @@
+ 					  XmTextPosition pos1,
+ 					  XmTextPosition pos2);
+ 
+-static Boolean _XmTextFieldIsWSpace(wchar_t wide_char,
+-				    wchar_t *white_space,
+-				    int num_entries);
+-
+ static void FindWord(XmTextFieldWidget tf,
+ 		     XmTextPosition begin,
+ 		     XmTextPosition *left,
+@@ -3514,32 +3510,6 @@
+   return False;
+ }
+ 
+-/* This routine accepts an array of wchar_t's containing wchar encodings
+- * of whitespace characters (and the number of array elements), comparing
+- * the wide character passed to each element of the array.  If a match
+- * is found, we got a white space.  This routine exists only because
+- * iswspace(3c) is not yet standard.  If a system has isw* available,
+- * calls to this routine should be changed to iswspace(3c) (and callers
+- * should delete initialization of the array), and this routine should
+- * be deleted.  Its a stop gap measure to avoid allocating an instance
+- * variable for the white_space array and/or declaring a widget wide
+- * global for the data and using a macro.  Its ugly, but it works and 
+- * in the long run will be replaced by standard functionality. */
+-
+-/* ARGSUSED */
+-static Boolean
+-_XmTextFieldIsWSpace(wchar_t wide_char,
+-		     wchar_t * white_space ,
+-		     int num_entries)
+-{
+-  int i;
+-  
+-  for (i=0; i < num_entries; i++) {
+-    if (wide_char == white_space[i]) return True;
+-  }
+-  return False;
+-}
+-
+ static void 
+ FindWord(XmTextFieldWidget tf,
+ 	 XmTextPosition begin,
+@@ -3547,7 +3517,6 @@
+ 	 XmTextPosition *right)
+ {
+   XmTextPosition start, end;
+-  wchar_t white_space[3];
+   
+   if (tf->text.max_char_size == 1) {
+     for (start = begin; start > 0; start--) {
+@@ -3565,11 +3534,8 @@
+     }
+     *right = end - 1;
+   } else { /* check for iswspace and iswordboundary in each direction */
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+     for (start = begin; start > 0; start --) {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start-1],white_space, 3)
++      if (iswspace(TextF_WcValue(tf)[start-1])
+ 	  || _XmTextFieldIsWordBoundary(tf, (XmTextPosition) start - 1, 
+ 					start)) {
+ 	break;
+@@ -3578,7 +3544,7 @@
+     *left = start;
+     
+     for (end = begin; end <= tf->text.string_length; end++) {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++      if (iswspace(TextF_WcValue(tf)[end])) {
+ 	end++;
+ 	break;
+       } else if (end < tf->text.string_length) {
+@@ -3599,14 +3565,6 @@
+ {
+   
+   XmTextPosition start = TextF_CursorPosition(tf);
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+-  
+   
+   if (tf->text.max_char_size == 1) {
+     if ((start > 0) && 
+@@ -3620,11 +3578,9 @@
+     }
+     FindWord(tf, start, left, right);
+   } else { 
+-    if ((start > 0) && (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start - 1],
+-					     white_space, 3))) {
++    if ((start > 0) && (iswspace(TextF_WcValue(tf)[start - 1]))) {
+       for (; start > 0; start--) {
+-	if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[start -1], 
+-				  white_space, 3)) {
++	if (!iswspace(TextF_WcValue(tf)[start -1])) {
+ 	  start--;
+ 	  break;
+ 	}
+@@ -3645,14 +3601,6 @@
+ {
+   
+   XmTextPosition end = TextF_CursorPosition(tf);
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+-  
+   
+   if(tf->text.max_char_size == 1) {
+     if (isspace((unsigned char)TextF_Value(tf)[end])) {
+@@ -3674,9 +3622,9 @@
+     if (*right < tf->text.string_length)
+       *right = *right - 1;
+   } else {
+-    if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++    if (iswspace(TextF_WcValue(tf)[end])) {
+       for (; end < tf->text.string_length; end ++) {
+-	if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++	if (!iswspace(TextF_WcValue(tf)[end])) {
+ 	  break;
+ 	}
+       }
+@@ -3690,10 +3638,9 @@
+      * If word boundary caused by whitespace, set right to the last 
+      * whitespace following the end of the current word.
+      */
+-    if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], white_space, 3)) {
++    if (iswspace(TextF_WcValue(tf)[(int)*right])) {
+       while (*right < tf->text.string_length &&
+-	     _XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], 
+-				  white_space, 3)) {
++	     iswspace(TextF_WcValue(tf)[(int)*right])) {
+ 	*right = *right + 1;
+       }
+       if (*right < tf->text.string_length)
+@@ -4546,13 +4493,6 @@
+ {
+   XmTextFieldWidget tf = (XmTextFieldWidget) w;
+   XmTextPosition cursorPos, position, dummy;
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+   
+   cursorPos = TextF_CursorPosition(tf);
+   
+@@ -4570,16 +4510,13 @@
+ 	}
+       }
+     } else {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[cursorPos],
+-			       white_space, 3))
++      if (iswspace(TextF_WcValue(tf)[cursorPos]))
+ 	FindWord(tf, cursorPos, &dummy, &position);
+       else
+ 	FindNextWord(tf, &dummy, &position);
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[position],
+-			       white_space, 3)) {
++      if (iswspace(TextF_WcValue(tf)[position])) {
+ 	for (; position < tf->text.string_length; position++) {
+-	  if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[position], 
+-				    white_space, 3))
++	  if (!iswspace(TextF_WcValue(tf)[position]))
+ 	    break;
+ 	}
+       }
diff --git a/srcpkgs/motif/patches/20-cross-compile.patch b/srcpkgs/motif/patches/20-cross-compile.patch
new file mode 100644
index 00000000000..1994b26cc4a
--- /dev/null
+++ b/srcpkgs/motif/patches/20-cross-compile.patch
@@ -0,0 +1,15 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,10 +3,10 @@
+ AC_CONFIG_SRCDIR([lib/Xm/Form.c])
+ AC_PREREQ(2.52)
+ AC_CONFIG_AUX_DIR(.)
+-AC_CHECK_FILE(/usr/X/include/X11/X.h,
++AS_IF([test -f "/usr/X/include/X11/X.h"],
+   AC_PREFIX_DEFAULT(/usr/X),
+   AC_PREFIX_DEFAULT(/usr))
+-AC_CHECK_FILE(/usr/X11R6/include/X11/X.h,
++AS_IF([test -f "/usr/X11R6/include/X11/X.h"],
+   AC_PREFIX_DEFAULT(/usr/X11R6),
+   AC_PREFIX_DEFAULT(/usr))
+ 
diff --git a/srcpkgs/motif/template b/srcpkgs/motif/template
new file mode 100644
index 00000000000..8842817b4c2
--- /dev/null
+++ b/srcpkgs/motif/template
@@ -0,0 +1,68 @@
+# Template file for 'motif'
+pkgname=motif
+version=2.3.8
+revision=1
+build_style=gnu-configure
+build_helper=qemu
+configure_args="--disable-jpeg --disable-png --enable-xft --disable-demos"
+hostmakedepends="pkg-config automake libtool flex"
+makedepends="libX11-devel libXft-devel libXt-devel libXpm-devel libXext-devel xbitmaps"
+short_desc="User interface component toolkit"
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://sourceforge.net/projects/motif/"
+distfiles="${SOURCEFORGE_SITE}/motif/Motif%20${version}%20Source%20Code/motif-${version}.tar.gz"
+checksum=859b723666eeac7df018209d66045c9853b50b4218cecadb794e2359619ebce7
+replaces="lesstif>=0"
+patch_args="-Np1"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" $makedepends"
+fi
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		vsed -i lib/Xm/Makefile.am -e 's|$(top_builddir)/config/util/makestr|/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e 's|\./wmluiltok|/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e 's|\./wml |/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e '/motif.wmd:/a	\\tsed -i "s|      exec|& /usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static |" wmldbcreate'
+	fi
+	touch NEWS AUTHORS
+	autoreconf -fi
+	vsed -i tools/wml/wmluiltok.l -e '1i %option main'
+}
+
+motif-devel_package() {
+	short_desc+=" - development files"
+	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	replaces="lesstif-devel>=0"
+	pkg_install() {
+		vmove usr/bin/uil
+		vmove usr/share/man/man3
+		vmove usr/share/man/man1/uil.1
+		vmove usr/share/man/man5
+		vmove usr/include
+		vmove "usr/lib/*.so"
+	}
+}
+
+motif-mwm_package() {
+	short_desce="Motif window manager"
+	depends="${sourcepkg}>=${version}_${revision}"
+	replaces="lesstif-mwm>=0"
+	pkg_install() {
+		vmove usr/bin/mwm
+		vmove usr/share/man/man1/mwm.1
+		vmove usr/share/man/man4/mwmrc.4
+		vmove usr/lib/X11/system.mwmrc
+	}
+}
+
+motif-xmbind_package() {
+	short_desc="Configures the virtual key bindings of Motif applications"
+	replaces="lesstif-xmbind>=0"
+	pkg_install() {
+		vmove usr/bin/xmbind
+		vmove usr/share/man/man1/xmbind.1
+	}
+}

From 2d9e6844e1924eb77b53afa88a89be30465dae66 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:21:15 -0700
Subject: [PATCH 2/5] lesstif: remove deprecated package

---
 srcpkgs/lesstif-devel    |  1 -
 srcpkgs/lesstif-mwm      |  1 -
 srcpkgs/lesstif-xmbind   |  1 -
 srcpkgs/lesstif/template | 67 ----------------------------------------
 4 files changed, 70 deletions(-)
 delete mode 120000 srcpkgs/lesstif-devel
 delete mode 120000 srcpkgs/lesstif-mwm
 delete mode 120000 srcpkgs/lesstif-xmbind
 delete mode 100644 srcpkgs/lesstif/template

diff --git a/srcpkgs/lesstif-devel b/srcpkgs/lesstif-devel
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-devel
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif-mwm b/srcpkgs/lesstif-mwm
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-mwm
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif-xmbind b/srcpkgs/lesstif-xmbind
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-xmbind
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif/template b/srcpkgs/lesstif/template
deleted file mode 100644
index 96b858d5a64..00000000000
--- a/srcpkgs/lesstif/template
+++ /dev/null
@@ -1,67 +0,0 @@
-# Template file for 'lesstif'
-pkgname=lesstif
-version=0.95.2
-revision=6
-build_style=gnu-configure
-configure_args="--prefix=/usr --mandir=/usr/share/man --docdir=/usr/share/doc
- --with-xdnd --enable-production --enable-nonstandard-conversions
- --enable-editres --enable-build-21 --disable-static --disable-debug
- --x-includes=/usr/include --x-libraries=/usr/lib"
-hostmakedepends="pkg-config"
-makedepends="libXt-devel libXp-devel libXft-devel"
-short_desc="LGPL'd re-implementation of Motif"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="LGPL-2.1"
-homepage="http://lesstif.sourceforge.net/"
-distfiles="${SOURCEFORGE_SITE}/lesstif/lesstif-${version}.tar.bz2"
-checksum=eb4aa38858c29a4a3bcf605cfe7d91ca41f4522d78d770f69721e6e3a4ecf7e3
-
-pre_build() {
-	if [ -n "$CROSS_BUILD" ]; then
-		cd ${wrksrc}/scripts
-		msg_normal "Building man2html for $XBPS_ARCH\n"
-		cc -o man2html man2html.c
-		# Disable the rule for cross-gcc man2html
-		sed -i Makefile -e "/noinst_PROGRAMS = / s/man2html.*//"
-	fi
-}
-post_install() {
-	rm -rf $DESTDIR/usr/LessTif
-}
-
-lesstif-mwm_package() {
-	short_desc="LessTif clone of the Motif Window Manager"
-	pkg_install() {
-		vmove usr/bin/mwm
-		vmove usr/lib/X11/mwm
-		vmove usr/share/man/man1/mwm.1
-		vmove usr/share/man/man5/mwmrc.5
-		vmove usr/lib/X11/app-defaults/Mwm
-	}
-}
-
-lesstif-xmbind_package() {
-	short_desc="Configures the virtual key bindings of LessTif applications"
-	pkg_install() {
-		vmove usr/bin/xmbind
-		vmove usr/share/man/man1/xmbind.1
-	}
-}
-
-lesstif-devel_package() {
-	depends="${sourcepkg}>=${version}_${revision}"
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove "usr/lib/*.so"
-		vmove usr/share/man/man3
-		vmove usr/share/man/man1/ltversion.1
-		vmove usr/share/man/man1/uil.1
-		vmove usr/share/man/man1/lesstif.1
-		vmove usr/share/man/man5/VirtualBindings.5
-		vmove usr/lib/LessTif
-		vmove usr/bin/uil
-		vmove usr/bin/mxmkmf
-		vmove usr/bin/motif-config
-	}
-}

From 3df086c559ba463aaf7f8b2610b055c464c2542b Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:15:49 -0700
Subject: [PATCH 3/5] xastir: update to 2.1.6, rebuild with motif

---
 srcpkgs/xastir/template | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/xastir/template b/srcpkgs/xastir/template
index b6b9de5ee2f..645d1d5391a 100644
--- a/srcpkgs/xastir/template
+++ b/srcpkgs/xastir/template
@@ -1,17 +1,16 @@
 # Template file for 'xastir'
 pkgname=xastir
-version=2.1.4
+version=2.1.6
 revision=1
 archs="i686 x86_64 ppc64le"
 wrksrc="Xastir-Release-${version}"
 build_style=gnu-configure
-makedepends="libXrender-devel libXt-devel libXp-devel libcurl-devel pcre-devel lesstif-devel libax25-devel"
+makedepends="libXrender-devel libXt-devel libXp-devel libcurl-devel pcre-devel motif-devel libax25-devel"
 short_desc="X Amateur Station Tracking and Information Reporting"
 maintainer="Michael Aldridge <maldridge@voidlinux.org>"
-license="GPL-2"
+license="GPL-2.0-or-later"
 homepage="http://xastir.org"
 distfiles="https://github.com/Xastir/Xastir/archive/Release-${version}.tar.gz"
-checksum=0bd3768440422a666e1c4c532df0184374244b77ae6650e6690715a0ca1fe7bc
-python_version=2 #unverified
+checksum=5a71af2936d4d237c779b1c3a519211f8e3cd03b9873a260c849ddc8950e1a3e
 
 CFLAGS="-fcommon"

From c78cde28f417d8be67d514f9dabf4fe08afa5a70 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:16:21 -0700
Subject: [PATCH 4/5] ddd: rebuild with motif

---
 srcpkgs/ddd/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/ddd/template b/srcpkgs/ddd/template
index 02ab5304bc7..24f44a9abc2 100644
--- a/srcpkgs/ddd/template
+++ b/srcpkgs/ddd/template
@@ -1,12 +1,12 @@
-# Template build file for 'ddd'.
+# Template file for 'ddd'
 pkgname=ddd
 version=3.3.12
-revision=5
+revision=6
 build_style=gnu-configure
-makedepends="ncurses-devel libXt-devel libXext-devel libXmu-devel lesstif-devel"
+makedepends="ncurses-devel libXt-devel libXext-devel libXmu-devel motif-devel"
 short_desc="Graphical front-end for command-line debuggers"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/ddd"
-license="GPL-2"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.gz"
 checksum=3ad6cd67d7f4b1d6b2d38537261564a0d26aaed077bf25c51efc1474d0e8b65c

From e6bd5922597f86ba462f0512af0ee1aa4e0b2042 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:17:41 -0700
Subject: [PATCH 5/5] yeahwm: rebuild with motif

---
 srcpkgs/yeahwm/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/yeahwm/template b/srcpkgs/yeahwm/template
index ca7af56230a..100e28e784b 100644
--- a/srcpkgs/yeahwm/template
+++ b/srcpkgs/yeahwm/template
@@ -1,10 +1,10 @@
 # Template file for 'yeahwm'
 pkgname=yeahwm
 version=0.3.5
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="XROOT=\${XBPS_CROSS_BASE}/usr"
-makedepends="lesstif-devel libX11-devel libXinerama-devel"
+makedepends="motif-devel libX11-devel libXinerama-devel"
 short_desc="A h* window manager for X based on evilwm and aewm"
 maintainer="Ananteris <ananteris@mailinator.com>"
 license="Public Domain"

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
                   ` (5 preceding siblings ...)
  2020-11-05 13:58 ` [PR PATCH] [Updated] " abenson
@ 2020-11-05 15:46 ` abenson
  2020-11-24 18:18 ` [PR REVIEW] " ahesford
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: abenson @ 2020-11-05 15:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

There is an updated pull request by abenson against master on the void-packages repository

https://github.com/abenson/void-packages np_motifwqemu
https://github.com/void-linux/void-packages/pull/26134

New package: motif-2.3.8


A patch file from https://github.com/void-linux/void-packages/pull/26134.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-np_motifwqemu-26134.patch --]
[-- Type: text/x-diff, Size: 87709 bytes --]

From 7517c362f722c5f2edf4c67a6f1b9e674dfad361 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 21:11:58 -0700
Subject: [PATCH 1/5] New package: motif-2.3.8 [ci skip]

---
 common/shlibs                                 |   6 +-
 srcpkgs/motif-demos                           |   1 +
 srcpkgs/motif-devel                           |   1 +
 srcpkgs/motif-mwm                             |   1 +
 srcpkgs/motif-xmbind                          |   1 +
 .../patches/02-fix-format-security.patch      | 607 ++++++++++++++++++
 srcpkgs/motif/patches/03-no-demos.patch       |  53 ++
 .../motif/patches/06-cast-size_t-to-int.patch |  17 +
 ...7-fix_lintian_reported_manpage_typos.patch | 118 ++++
 .../patches/08-fix_hyphen_in_man_pages.patch  | 156 +++++
 .../motif/patches/09-fix_typo_in_libxm.patch  |  25 +
 .../10-fix_manpage-has-bad-whatis-entry.patch |  49 ++
 .../motif/patches/11-fix_underlinking.patch   | 564 ++++++++++++++++
 .../13-fix_hardcoded_x11rgb_path.patch        |  54 ++
 .../patches/15-link_uil_against_libuil.patch  |  29 +
 .../16-fix-undefined-use-of-sprintf.patch     |  17 +
 .../17-switch-to-system-iswspace.patch        | 384 +++++++++++
 srcpkgs/motif/patches/20-cross-compile.patch  |  15 +
 srcpkgs/motif/template                        |  68 ++
 19 files changed, 2163 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/motif-demos
 create mode 120000 srcpkgs/motif-devel
 create mode 120000 srcpkgs/motif-mwm
 create mode 120000 srcpkgs/motif-xmbind
 create mode 100644 srcpkgs/motif/patches/02-fix-format-security.patch
 create mode 100644 srcpkgs/motif/patches/03-no-demos.patch
 create mode 100644 srcpkgs/motif/patches/06-cast-size_t-to-int.patch
 create mode 100644 srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
 create mode 100644 srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
 create mode 100644 srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
 create mode 100644 srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
 create mode 100644 srcpkgs/motif/patches/11-fix_underlinking.patch
 create mode 100644 srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
 create mode 100644 srcpkgs/motif/patches/15-link_uil_against_libuil.patch
 create mode 100644 srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
 create mode 100644 srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
 create mode 100644 srcpkgs/motif/patches/20-cross-compile.patch
 create mode 100644 srcpkgs/motif/template

diff --git a/common/shlibs b/common/shlibs
index 4270867b673..bc07b491b27 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1763,9 +1763,9 @@ libSDL2_net-2.0.so.0 SDL2_net-2.0.0_1
 libnxml.so.0 libnxml-0.18.3_1
 libmrss.so.0 libmrss-0.19.2_1
 libuv.so.1 libuv-1.0.0_1
-libXm.so.2 lesstif-0.95.2_1
-libMrm.so.2 lesstif-0.95.2_1
-libUil.so.2 lesstif-0.95.2_1
+libXm.so.4 motif-2.3.8_1
+libMrm.so.4 motif-2.3.8_1
+libUil.so.4 motif-2.3.8_1
 libgtest.so gtest-1.7.0_1
 libgtest_main.so gtest-1.7.0_1
 libxmlsec1-gcrypt.so.1 xmlsec1-1.2.20_2
diff --git a/srcpkgs/motif-demos b/srcpkgs/motif-demos
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-demos
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-devel b/srcpkgs/motif-devel
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-devel
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-mwm b/srcpkgs/motif-mwm
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-mwm
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-xmbind b/srcpkgs/motif-xmbind
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-xmbind
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif/patches/02-fix-format-security.patch b/srcpkgs/motif/patches/02-fix-format-security.patch
new file mode 100644
index 00000000000..18c4abdc271
--- /dev/null
+++ b/srcpkgs/motif/patches/02-fix-format-security.patch
@@ -0,0 +1,607 @@
+Description: Fix unsafe uses of fprintf and sprintf
+ prevent 'format not a string literal and no format arguments' errors
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1574
+Author: Graham Inggs <graham@nerve.org.za>
+Last-Update: 2012-12-25
+--- a/lib/Mrm/Mrmhier.c
++++ b/lib/Mrm/Mrmhier.c
+@@ -264,10 +264,10 @@
+ 	    case MrmSUCCESS:
+ 	      break;
+ 	    case MrmNOT_VALID:
+-	      sprintf (err_stg, _MrmMMsg_0113);
++	      sprintf (err_stg, "%s", _MrmMMsg_0113);
+ 	      break;
+ 	    default:
+-	      sprintf (err_stg, _MrmMMsg_0114);
++	      sprintf (err_stg, "%s", _MrmMMsg_0114);
+ 	      break;
+ 	    }
+ 	}
+--- a/lib/Mrm/Mrmicon.c
++++ b/lib/Mrm/Mrmicon.c
+@@ -1176,7 +1176,7 @@
+ 		}
+ 		break;
+ 	      default:
+-		sprintf(err_msg, _MrmMMsg_0040);
++		sprintf(err_msg, "%s", _MrmMMsg_0040);
+ 		return Urm__UT_Error ("Urm__RelizeColorTable",
+ 				      err_msg, NULL, NULL, MrmFAILURE) ;
+ 	      }
+@@ -1252,7 +1252,7 @@
+ 	      break;
+ 	    default:
+ 	      result = MrmFAILURE;
+-	      sprintf (err_msg, _MrmMMsg_0040);
++	      sprintf (err_msg, "%s", _MrmMMsg_0040);
+ 	      Urm__UT_Error ("Urm__RelizeColorTable",
+ 			     err_msg, NULL, NULL, MrmFAILURE) ;
+ 	    }
+--- a/lib/Mrm/Mrmlread.c
++++ b/lib/Mrm/Mrmlread.c
+@@ -698,7 +698,7 @@
+ 	 XBlackPixelOfScreen(XDefaultScreenOfDisplay(display)));
+       break;
+     default:
+-      sprintf(err_msg, _MrmMMsg_0040);
++      sprintf(err_msg, "%s", _MrmMMsg_0040);
+       result = Urm__UT_Error ("MrmFetchColorLiteral",
+ 			      err_msg, NULL, NULL, MrmFAILURE) ;
+       _MrmAppUnlock(app);
+--- a/lib/Mrm/Mrmwcrw.c
++++ b/lib/Mrm/Mrmwcrw.c
+@@ -1390,7 +1390,7 @@
+ 			}
+ 		      break;
+ 		    default:
+-		      sprintf (err_msg, _MrmMMsg_0040);
++		      sprintf (err_msg, "%s", _MrmMMsg_0040);
+ 		      result = Urm__UT_Error ("Urm__CW_ConvertValue",
+ 					      err_msg, NULL, NULL, MrmFAILURE) ;
+ 		    };
+@@ -2426,7 +2426,7 @@
+ 	    }
+ 	  break;
+ 	default:
+-	  sprintf(err_msg, _MrmMMsg_0040);
++	  sprintf(err_msg, "%s", _MrmMMsg_0040);
+ 	  return Urm__UT_Error ("Urm__CW_ConvertValue",
+ 				err_msg, NULL, NULL, MrmFAILURE) ;
+ 	};
+--- a/tools/wml/wmlouth.c
++++ b/tools/wml/wmlouth.c
+@@ -225,12 +225,12 @@
+     printf ("\nCouldn't open UilSymGen.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write the sym_k..._object literals
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
+@@ -244,7 +244,7 @@
+ /*
+  * Define the sym_k_..._reason literals
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_reason_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr;
+@@ -258,7 +258,7 @@
+ /*
+  * Define the sym_k_..._arg literals
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -272,7 +272,7 @@
+ /*
+  * Define the sym_k_..._enumset structs and literals
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -286,7 +286,7 @@
+ /*
+  * Define the sym_k_..._enumval literals
+  */
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
+     {
+     enumvalobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
+@@ -301,7 +301,7 @@
+  * Define the sym_k_..._charsize literals
+  * Define the sym_k_..._charset literals
+  */
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     charsetobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -315,7 +315,7 @@
+ /*
+  * Define the sym_k_..._child literals
+  */
+-fprintf (outfil, canned8);
++fprintf (outfil, "%s", canned8);
+ for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
+@@ -379,12 +379,12 @@
+     printf ("\nCouldn't open UilSymChCL.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
+@@ -392,7 +392,7 @@
+     fprintf (outfil, "    sym_k_%s_object,\n",
+ 	     classobj->tkname);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -446,12 +446,12 @@
+     printf ("\nCouldn't open UilSymArTy.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -459,7 +459,7 @@
+     fprintf (outfil, "    sym_k_%s_value,\n",
+ 	     datobj->tkname);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -509,19 +509,19 @@
+     printf ("\nCouldn't open UilSymRArg.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+     fprintf (outfil, "    %d,\n",
+ 	     resobj->related_code);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -621,12 +621,12 @@
+     printf ("\nCouldn't open UilUrmClas.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write entries for widgets
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
+@@ -637,7 +637,7 @@
+     else 
+ 	fprintf (outfil, "  \"%s\",\t\n", synobj->convfunc);
+     }
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ 
+ /*
+  * Write entries for gadget variants of widget classes
+@@ -661,7 +661,7 @@
+ 		     synobj->name);
+ 	}
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * Write entries for non-dialog widgets
+@@ -685,7 +685,7 @@
+ 		     synobj->name);
+ 	}
+     }
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ 
+ /*
+  * Write entries for the resource a widget's controls map to
+@@ -701,7 +701,7 @@
+     else
+ 	fprintf (outfil, "  sym_k_%s_arg,\n", mapresobj->tkname);
+     }
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ 
+ /*
+  * Write entries for arguments
+@@ -714,7 +714,7 @@
+     fprintf (outfil, "  %s,\n",
+ 	     synres->resliteral);
+     }
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ 
+ /*
+  * Write entries for reasons
+@@ -727,7 +727,7 @@
+     fprintf (outfil, "  %s,\n",
+ 	     synres->resliteral);
+     }
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ 
+ /*
+  * close the output file
+@@ -781,13 +781,13 @@
+     printf ("\nCouldn't open UilConst.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Process the arguments in code order. We start with 1, and write out
+  * the mask after processing 8 codes.
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ strcpy (maskbuf, "0");
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+@@ -805,7 +805,7 @@
+     }
+ if ( bitno != 8 )
+     fprintf (outfil, "%s", maskbuf);
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -878,8 +878,8 @@
+     printf ("\nCouldn't open UilSymReas.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the reason code,
+@@ -925,13 +925,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( resndx=0 ; resndx<wml_obj_reason_ptr->cnt ; resndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[resndx].objptr;
+     fprintf (outfil, "  reason_class_vec%d,\n", resobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1004,8 +1004,8 @@
+     printf ("\nCouldn't open UilSymArTa.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the argument code,
+@@ -1051,13 +1051,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( resndx=0 ; resndx<wml_obj_arg_ptr->cnt ; resndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[resndx].objptr;
+     fprintf (outfil, "  arg_class_vec%d,\n", resobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1129,8 +1129,8 @@
+     printf ("\nCouldn't open UilSymChTa.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the child code,
+@@ -1174,13 +1174,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( childndx=0 ; childndx<wml_obj_child_ptr->cnt ; childndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[childndx].objptr;
+     fprintf (outfil, "  child_class_vec%d,\n", childobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1251,8 +1251,8 @@
+     printf ("\nCouldn't open UilSymCtl.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the class code,
+@@ -1296,13 +1296,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( ctlndx=0 ; ctlndx<wml_obj_class_ptr->cnt ; ctlndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ctlndx].objptr;
+     fprintf (outfil, "  object_class_vec%d,\n", clsobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1438,7 +1438,7 @@
+     printf ("\nCouldn't open UilSymNam.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write entries for widgets
+@@ -1517,7 +1517,7 @@
+     fprintf (outfil, "    \"%s\",\n",
+ 	     synch->name);
+     }
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ 
+ /*
+  * close the output file
+@@ -1621,12 +1621,12 @@
+     printf ("\nCouldn't open UilSymEnum.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Generate the enumeration value vectors for each enumeration set.
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -1643,7 +1643,7 @@
+ /*
+  * Generate the enumeration set tables
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -1655,7 +1655,7 @@
+ /*
+  * Create enumset table entries for arguments, similar to writing sym_k...
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -1669,13 +1669,13 @@
+ /*
+  * Create the enumval values table.
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
+     {
+     evobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
+     fprintf (outfil, "  %s,\n", evobj->syndef->enumlit);
+     }
+-fprintf (outfil, canned5a);
++fprintf (outfil, "%s", canned5a);
+ 
+ /*
+  * close the output file
+@@ -1813,12 +1813,12 @@
+     printf ("\nCouldn't open UilSymCSet.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Generate the standards name table
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1836,7 +1836,7 @@
+ /*
+  * Generate the writing direction table
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1858,7 +1858,7 @@
+ /*
+  * Generate the parsing direction table
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1880,7 +1880,7 @@
+ /*
+  * Generate the character size table
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1906,7 +1906,7 @@
+ /*
+  * Generate the $LANG name recognition table
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ lang_max = 0;
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+@@ -1936,7 +1936,7 @@
+ /*
+  * Generate the $LANG code lookup table, in upper case
+  */
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+--- a/tools/wml/wmloutkey.c
++++ b/tools/wml/wmloutkey.c
+@@ -574,16 +574,16 @@
+     printf ("\nCouldn't open UilKeyTab.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Print the case sensitive and insensitive tables
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ wmlOutputUilKeyTabBody (outfil, wml_tok_sens_ptr, &maxlen, &maxkey);
+ fprintf (outfil, canned2, maxlen, maxkey);
+ wmlOutputUilKeyTabBody (outfil, wml_tok_insens_ptr, &maxlen, &maxkey);
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -812,8 +812,8 @@
+     printf ("\nCouldn't open UilTokName.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Print the token name entries
+--- a/tools/wml/wmloutmm.c
++++ b/tools/wml/wmloutmm.c
+@@ -209,9 +209,9 @@
+ /*
+  * Write out header information
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ fprintf (outfil, "%s\n", name);
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ 
+ /*
+  * Alphabetize the controls, reason, and argument lists
+@@ -287,7 +287,7 @@
+     else
+ 	fprintf (outfil, "\n");
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * Write out the argument table
+@@ -323,7 +323,7 @@
+     }    
+     argndx += 1;
+     }
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ 
+ }
+ 
diff --git a/srcpkgs/motif/patches/03-no-demos.patch b/srcpkgs/motif/patches/03-no-demos.patch
new file mode 100644
index 00000000000..03953c4f8f7
--- /dev/null
+++ b/srcpkgs/motif/patches/03-no-demos.patch
@@ -0,0 +1,53 @@
+Description: Add option to disable building of demos
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1575
+Author: Graham Inggs <graham@nerve.org.za>
+Last-Update: 2013-01-09
+--- a/configure.ac
++++ b/configure.ac
+@@ -311,7 +311,20 @@
+ doc/man/man5/Makefile \
+ tools/Makefile \
+ tools/wml/Makefile \
+-demos/Makefile \
++lib/Xm/xmstring.list \
++])
++
++AC_ARG_ENABLE(demos, [  --disable-demos
++                       Disable building demos])
++
++if test x$enable_demos = x
++then
++    enable_demos="yes"
++fi
++
++if test "$enable_demos" = "yes"
++then
++  AC_CONFIG_FILES([demos/Makefile
+ demos/lib/Makefile \
+ demos/lib/Xmd/Makefile \
+ demos/lib/Wsm/Makefile \
+@@ -395,6 +408,11 @@
+ demos/doc/programGuide/ch17/Makefile \
+ demos/doc/programGuide/ch17/simple_drop/Makefile \
+ demos/doc/programGuide/ch17/simple_drag/Makefile \
+-lib/Xm/xmstring.list \
+-])
++  ])
++  MAYBE_DEMOS=demos
++else
++  MAYBE_DEMOS=
++fi
++AC_SUBST(MAYBE_DEMOS)
++
+ AC_OUTPUT
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -29,6 +29,7 @@
+              tools \
+              clients \
+              doc \
+-             demos
++             $(MAYBE_DEMOS)
++
+ AUTOMAKE_OPTIONS = 1.4
+ ACLOCAL_AMFLAGS = -I .
diff --git a/srcpkgs/motif/patches/06-cast-size_t-to-int.patch b/srcpkgs/motif/patches/06-cast-size_t-to-int.patch
new file mode 100644
index 00000000000..b5ce9c643a7
--- /dev/null
+++ b/srcpkgs/motif/patches/06-cast-size_t-to-int.patch
@@ -0,0 +1,17 @@
+Description: To prevent build failure during building with Hardening options
+ enabled due to "format '%d' expects argument of type 'int', but argument 5 has
+ type 'size_t'", the fifth argument is cast to integer on the input.
+Author: Paul Gevers <elbrus@debian.org>
+Updated: 13-01-2013
+
+--- a/tools/wml/wmloutkey.c
++++ b/tools/wml/wmloutkey.c
+@@ -627,7 +627,7 @@
+     fprintf (outfil, "    {%s, %s, %d, %s, \"%s\"},\n",
+ 	     tkclass,
+ 	     tksym,
+-	     strlen(tokstg),
++	     (int)strlen(tokstg),
+ 	     tktoken,
+ 	     tokstg);
+     if ( (int)strlen(tokstg) > *maxlen )
diff --git a/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch b/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
new file mode 100644
index 00000000000..5ddfd760075
--- /dev/null
+++ b/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
@@ -0,0 +1,118 @@
+Description: lintian reports several typos in manpages. This patch fixes those
+ reported
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1587
+Last-reviewed: 14 Jan 2013
+
+--- a/doc/man/man1/mwm.1
++++ b/doc/man/man1/mwm.1
+@@ -359,7 +359,7 @@
+ (and other associated messages) by saving the geometries of its clients to a state file\&. 
+ \fBmwm\fP can then be restarted by the XSMP session manager\&.
+ The default location for the state file is \fB$HOME/\&.mwmclientdb\fP\&.
+-This location can be overriden with the resource \fBsessionClientDB\fP\&.
++This location can be overridden with the resource \fBsessionClientDB\fP\&.
+ .SS "X Resources"
+ .PP
+ The \fBmwm\fP command is configured from its resource
+--- a/doc/man/man3/VendorShell.3
++++ b/doc/man/man3/VendorShell.3
+@@ -76,7 +76,7 @@
+ to the VendorShell resources for controlling toolTips. VendorShell displays
+ the XmNtooTipString in an XmLabel that is a child of a transientShell. The name
+ of the transientShell is TipShell, and the name of the XmLabel is TipLabel.
+-The appearance of the tip can be controlled by specifing resources on these
++The appearance of the tip can be controlled by specifying resources on these
+ widgets.
+ .PP
+ If an application uses the \fBXmNmwmDecorations\fP,
+--- a/doc/man/man3/XmComboBox.3
++++ b/doc/man/man3/XmComboBox.3
+@@ -581,7 +581,7 @@
+ ComboBox \fBXmNcomboBoxType\fP is
+ \fBXmDROP_DOWN_LIST\fP,
+ \fB<osfActivate>\fP, \fB<osfCancel>\fP, and
+-\fBReturn\fP are overriden by ComboBox actions\&.
++\fBReturn\fP are overridden by ComboBox actions\&.
+ .IP "\fB:c\fP <Key>\fB<osfDown>\fP:" 10
+ CBDropDownList()
+ .IP "\fB:c\fP <Key>\fB<osfUp>\fP:" 10
+--- a/doc/man/man3/XmGetPixmap.3
++++ b/doc/man/man3/XmGetPixmap.3
+@@ -109,7 +109,7 @@
+ In addition to X bitmap files (XBM), Motif also supports XPM (X
+ Pixmap) file formats and, from version 2.3, JPEG and PNG image formats\&.
+ (Note that support of JPEG and PNG image format is an optional feature
+-of Motif, in order to check if current version supports PNG ang JPEG
++of Motif, in order to check if current version supports PNG and JPEG
+ image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked
+ correspondingly.)
+ The \fBXBMLANGPATH\fP specifies the path for
+--- a/doc/man/man3/XmGetPixmapByDepth.3
++++ b/doc/man/man3/XmGetPixmapByDepth.3
+@@ -111,7 +111,7 @@
+ In addition to X bitmap files (XBM), Motif also supports XPM (X
+ Pixmap) file formats, and, from version 2.3, JPEG and PNG image formats\&.
+ (Note that support of JPEG and PNG image format is an optional feature
+-of Motif, in order to check if current version supports PNG ang JPEG
++of Motif, in order to check if current version supports PNG and JPEG
+ image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked
+ correspondingly.)
+ The \fBXBMLANGPATH\fP specifies the path for
+--- a/doc/man/man3/XmHierarchyGetChildNodes.3
++++ b/doc/man/man3/XmHierarchyGetChildNodes.3
+@@ -69,8 +69,8 @@
+ \fBXmHierarchy\fP(3)\&.
+ .SH "RETURN"
+ .PP
+-Returns WidgetList with child nodes of the hierachy, or NULL
+-if the hierachy contains no children\&.
++Returns WidgetList with child nodes of the hierarchy, or NULL
++if the hierarchy contains no children\&.
+ .SH "RELATED"
+ .PP
+ \fBXmHierarchy\fP(3)\&.
+--- a/doc/man/man3/XmManager.3
++++ b/doc/man/man3/XmManager.3
+@@ -502,7 +502,7 @@
+ Indicates whether the posting process should continue\&. The
+ application may modify this field\&.
+ .IP "\fItarget\fP" 10
+-Specifies the most specific widget or gadget that the menu sytem found
++Specifies the most specific widget or gadget that the menu system found
+ from the event that matches the event\&.
+ .SS "Translations"
+ .PP
+--- a/doc/man/man3/XmPrimitive.3
++++ b/doc/man/man3/XmPrimitive.3
+@@ -609,7 +609,7 @@
+ Indicates whether the posting process should continue\&. The
+ application may modify this field\&.
+ .IP "\fItarget\fP" 10
+-Specifies the most specific widget or gadget that the menu sytem found
++Specifies the most specific widget or gadget that the menu system found
+ from the event that matches the event\&.
+ .SS "Translations"
+ .PP
+--- a/doc/man/man3/XmRendition.3
++++ b/doc/man/man3/XmRendition.3
+@@ -71,7 +71,7 @@
+ If a resource in a rendition is unspecified, usually by setting it to
+ \fBXmAS_IS\fP or \fBXmUNSPECIFIED_PIXEL\fP,
+ then the value to be used for that resource is the value of the
+-immediately preceeding rendition in \fBXmString\fR\&. If that value
++immediately preceding rendition in \fBXmString\fR\&. If that value
+ is unspecified, then the preceding value is used, and so on\&. If
+ no renditions specify a value for a resource, then a default value
+ will be used\&.
+--- a/doc/man/man3/XmStringGetNextComponent.3
++++ b/doc/man/man3/XmStringGetNextComponent.3
+@@ -111,7 +111,7 @@
+ \fBXmSTRING_COMPONENT_UNKNOWN\fP\&. The data returned by these
+ components is returned in the \fIunknown_tag\fP, \fIunknown_length\fP,
+ and \fIunknown_value\fP fields\&. This apparent inconsistency is
+-designed to accomodate older applications that may not be equipped to
++designed to accommodate older applications that may not be equipped to
+ handle the newer component types of Motif version 2\&.0 and beyond\&.
+ Consequently, the use of this procedure is not recommended\&. Instead,
+ use the \fBXmStringGetNextTriple\fP procedure, which provides all the
diff --git a/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch b/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
new file mode 100644
index 00000000000..bc1beb029cd
--- /dev/null
+++ b/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
@@ -0,0 +1,156 @@
+Description: lintian reports hyphen misuse in manpages. This patch fixes those
+ reported.
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1588
+Last-reviewed: 06 Feb 2013
+
+--- a/doc/man/man1/mwm.1
++++ b/doc/man/man1/mwm.1
+@@ -904,7 +904,7 @@
+ resizeCursors\aResizeCursors\aT/F\aT
+ transientDecoration\aTransientDecoration\astring\amenu title
+ transientFunctions\aTransientFunctions\astring\aT{
+--minimize-maximize
++\-minimize-maximize
+ T}
+ useIconBox\aUseIconBox\aT/F\aF
+ .TE
+@@ -941,7 +941,7 @@
+ screen size of the icon box window depends on the iconImageMaximum (size)
+ and \fIiconDecoration\fP resources\&. The default value for size
+ is (6 * iconWidth + padding) wide by (1 * iconHeight + padding) high\&. The
+-default value of the location is +0 -0\&.
++default value of the location is +0 \-0\&.
+ .IP "\fIiconBoxName\fP\ (class\  \fIIconBoxName\fP)" 10
+ This resource specifies the name that is used to look up icon box resources\&.
+ The default name is iconbox\&.
+@@ -1059,7 +1059,7 @@
+ This resource is used to indicate which window management functions
+ are applicable (or not applicable) to transient windows\&. The function specification
+ is exactly the same as for the \fIclientFunctions\fP (client
+-specific) resource\&. The default value for this resource is -minimize -maximize\&.
++specific) resource\&. The default value for this resource is \-minimize \-maximize\&.
+ .IP "" 10
+ An application can also specify which functions \fBmwm\fP
+ should apply to its windows\&. If it does so, \fBmwm\fP applies
+@@ -1176,7 +1176,7 @@
+ title\aTitle bar (includes border)\&.
+ .TE
+ .PP
+-Examples: \fIMwm*XClock\&.clientDecoration: -resizeh -maximize\fP This removes the resize handles and maximize button from XClock
++Examples: \fIMwm*XClock\&.clientDecoration: \-resizeh \-maximize\fP This removes the resize handles and maximize button from XClock
+ windows\&. \fIMwm*XClock\&.clientDecoration: menu minimize border\fP This does the same thing as above\&. Note that either \fImenu\fP or \fIminimize\fP implies
+ \fItitle\fP\&.
+ .IP "\fIclientFunctions\fP\ (class\  \fIClientFunctions\fP)" 10
+--- a/doc/man/man4/mwmrc.4
++++ b/doc/man/man4/mwmrc.4
+@@ -84,7 +84,7 @@
+ be specified from the command line:
+ .PP
+ .nf
+-\f(CW/usr/X11R6/bin/X11/mwm -xrm "mwm*configFile: mymwmrc"\fR
++\f(CW/usr/X11R6/bin/X11/mwm \-xrm "mwm*configFile: mymwmrc"\fR
+ .fi
+ .PP
+ .SS "Resource Types"
+--- a/doc/man/man3/XmFontList.3
++++ b/doc/man/man3/XmFontList.3
+@@ -119,7 +119,7 @@
+ without a font list entry tag;
+ .PP
+ .nf
+-\f(CW*fontList:  -Adobe-Times-Medium-I-Normal--10*\fR
++\f(CW*fontList:  \-Adobe\-Times\-Medium\-I\-Normal\-\-10*\fR
+ .fi
+ .PP
+ .PP
+@@ -138,9 +138,9 @@
+ and an explicit font list entry tag\&.
+ .PP
+ .nf
+-\f(CW*fontList: -Adobe-Courier-Bold-R-Normal--25-180-100-100-M-150;\
+--JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240;\
+--JIS-Fixed-Medium-R-Normal--26-180-100-100-C-120:MY_TAG\fR
++\f(CW*fontList: \-Adobe\-Courier\-Bold\-R\-Normal\-\-25\-180\-100\-100\-M\-150;\
++\-JIS\-Fixed\-Medium\-R\-Normal\-\-26\-180\-100\-100\-C\-240;\
++\-JIS\-Fixed\-Medium\-R\-Normal\-\-26\-180\-100\-100\-C\-120:MY_TAG\fR
+ .fi
+ .PP
+ .PP
+--- a/doc/man/man3/XmGetPixmapByDepth.3
++++ b/doc/man/man3/XmGetPixmapByDepth.3
+@@ -245,8 +245,8 @@
+ \f(CW/* XBM file */
+ #define plaid_width 22
+ #define plaid_height 22
+-#define plaid_x_hot -1
+-#define plaid_y_hot -1
++#define plaid_x_hot \-1
++#define plaid_y_hot \-1
+ static char plaid_bits[] = {
+    0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
+    0x75, 0xfd, 0x3f, 0xff, 0x57, 0x15, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
+--- a/doc/man/man3/XmList.3
++++ b/doc/man/man3/XmList.3
+@@ -182,7 +182,7 @@
+ A value of 1 transfers the first item in the List; a value of 2
+ transfers the second item; and so on\&.
+ If the entire contents of the List are being transferred, the value is
+--1\&.
++\-1\&.
+ .PP
+ As a source of data, List supports the following targets and associated
+ conversions of data to these targets:
+--- a/doc/man/man3/XmScreen.3
++++ b/doc/man/man3/XmScreen.3
+@@ -300,7 +300,7 @@
+ startup time, either by placing it within a defaults file or by using the
+ \fB-xrm\fP command line argument\&. For example:
+ .IP "" 10
+-\fBmyProg -xrm "*menuCursor: arrow"\fP
++\fBmyProg \-xrm "*menuCursor: arrow"\fP
+ .IP "" 10
+ The menu cursor can also be selected in the program through
+ the function \fBXmSetMenuCursor\fP\&.
+--- a/doc/man/man3/XmTabListCopy.3
++++ b/doc/man/man3/XmTabListCopy.3
+@@ -71,7 +71,7 @@
+ Specifies where to start copying\&. A value of 0 (zero) indicates begin
+ at the beginning, a value of 1 indicates to skip the first tab, and so
+ on\&. A negative indicates to begin counting backwards from the end\&.
+-A value of -1 indicates to start copying from the last tab\&.
++A value of \-1 indicates to start copying from the last tab\&.
+ .IP "\fIcount\fP" 10
+ Specifies the number of tabs to copy\&. A value of 0 (zero) indicates
+ to copy all elements from the starting point to the end (beginning if
+--- a/doc/man/man3/XmTabListInsertTabs.3
++++ b/doc/man/man3/XmTabListInsertTabs.3
+@@ -83,7 +83,7 @@
+ value of 1 makes it the second tab, and so on\&. If \fIposition\fP is
+ greater than the number of tabs in \fIoldlist\fP, then the tabs will
+ be inserted at the end\&. If \fIposition\fP is negative, the count will
+-be backwards from the end\&. A value of -1 makes the first new tab
++be backwards from the end\&. A value of \-1 makes the first new tab
+ the last tab, and so on\&.
+ .SH "RETURN"
+ .PP
+--- a/doc/man/man5/UIL.5
++++ b/doc/man/man5/UIL.5
+@@ -1211,7 +1211,7 @@
+ 3\&.1415E-2 (equals \&.031415)
+ T}\a2\&.87 e6 (embedded blanks)
+ T{
+--6\&.29e7 (equals -62900000)
++\-6\&.29e7 (equals \-62900000)
+ T}\a2\&.0e100 (out of range)
+ .TE
+ .PP
+@@ -1322,7 +1322,7 @@
+ You can use parentheses to override the normal precedence of operators\&.
+ In a sequence of unary operators, the operations are performed in
+ right-to-left
+-order\&. For example, \fB- + -A\fP is equivalent to \fB-(+(-A))\fP\&.
++order\&. For example, \fB- + \-A\fP is equivalent to \fB\-(+(\-A))\fP\&.
+ In a sequence of binary operators of the same precedence, the operations
+ are performed in left-to-right order\&. For example, \fBA*B/C*D\fP is
+ equivalent to \fB((A*B)/C)*D\fP\&.
diff --git a/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch b/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
new file mode 100644
index 00000000000..90d39a3f0c0
--- /dev/null
+++ b/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
@@ -0,0 +1,25 @@
+Description: lintian reports a typo in libXm. This patch fixes it.
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1589
+Last-reviewed: 06 Feb 2013
+
+--- a/lib/Xm/FontS.c
++++ b/lib/Xm/FontS.c
+@@ -1225,7 +1225,7 @@
+ 
+     if ((fontdata = XLoadQueryFont(XtDisplay((Widget) fsw), font)) == NULL)
+     {
+-	sprintf(buf, "Font '%s'\nis not availiable on this machine", font);
++	sprintf(buf, "Font '%s'\nis not available on this machine", font);
+ 	DisplayUserError(fsw, buf);
+ 	err = True;
+     }
+@@ -1275,7 +1275,7 @@
+ 					   fbuf)) == NULL) 
+ 	    {
+ 		sprintf(buf,
+-			    "Font '%s'\nis not availiable on this machine",
++			    "Font '%s'\nis not available on this machine",
+ 			    font);
+ 		DisplayUserError(fsw, buf);
+ 		    err = True;
diff --git a/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch b/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
new file mode 100644
index 00000000000..cf51d1fa3d4
--- /dev/null
+++ b/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
@@ -0,0 +1,49 @@
+Description: lintian reports bad whatis entries in manpages. Fixing here
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1590
+Last-reviewed: 17 Feb 2013
+
+--- a/doc/man/man3/XmColorSelector.3
++++ b/doc/man/man3/XmColorSelector.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmColorSelector 3X ""
+ .SH NAME
+-The Color Selector widget
++XmColorSelector \- The Color Selector widget
+ .SH SYNOPSIS
+ #include <Xm/ColorS.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmExt18List.3
++++ b/doc/man/man3/XmExt18List.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XxExt18LIst 3x ""
+ .SH NAME
+-The Internationalized Extended List widget
++XmExt18List \- The Internationalized Extended List widget
+ .SH SYNOPSIS
+ #include <Xm/Ext18List.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmFontSelector.3
++++ b/doc/man/man3/XmFontSelector.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmFontSelector 3X ""
+ .SH NAME
+-The Font Selector widget
++XmFontSelector \- The Font Selector widget
+ .SH SYNOPSIS
+ #include <Xm/FontS.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmIconButton.3
++++ b/doc/man/man3/XmIconButton.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmIconButton 3X "15 July 1992"
+ .SH NAME
+-The Icon Button widget
++XmIconButton \- The Icon Button widget
+ .SH SYNOPSIS
+ Documents the XmIconButton widget
+ .SH DESCRIPTION
diff --git a/srcpkgs/motif/patches/11-fix_underlinking.patch b/srcpkgs/motif/patches/11-fix_underlinking.patch
new file mode 100644
index 00000000000..601b0918632
--- /dev/null
+++ b/srcpkgs/motif/patches/11-fix_underlinking.patch
@@ -0,0 +1,564 @@
+Description: Fix underlinking of libXt, libXext and libX11
+ Recent changes to default linker behaviour prevent shared libraries from being
+ indirectly linked, resulting in FTBFS in Ubuntu Raring.
+ .
+ This patch fixes this by explicitly linking libXt, libXext and libX11 wherever
+ necessary.  Demos are patched even though they are not built for distribution.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1583
+Last-Update: 2013-02-26
+--- a/clients/mwm/Makefile.am
++++ b/clients/mwm/Makefile.am
+@@ -9,7 +9,7 @@
+ rc_DATA = system.mwmrc
+ 
+ bin_PROGRAMS = mwm
+-mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la 
++mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la -lXt -lXext -lX11
+ 
+ INCLUDES = -DLARGECURSORS -DR2_COMPAT -DUNMAP_ON_RESTART \
+            -DCDE_INSTALLATION_TOP=\"@CDE_INSTALLATION_TOP@\" \
+--- a/clients/uil/Makefile.am
++++ b/clients/uil/Makefile.am
+@@ -11,9 +11,9 @@
+ UilParser.lo: UilParser.c
+ 	$(LTCOMPILE) -DCALLABLE -c UilParser.c
+ 
+-libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la 
++libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+-uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la 
++uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
+--- a/clients/xmbind/Makefile.am
++++ b/clients/xmbind/Makefile.am
+@@ -2,6 +2,6 @@
+ 
+ bin_PROGRAMS = xmbind
+ 
+-LDADD = ../../lib/Xm/libXm.la
++LDADD = ../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS}
+--- a/demos/doc/programGuide/ch05/Scale/Makefile.am
++++ b/demos/doc/programGuide/ch05/Scale/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch06/combo_box/Makefile.am
++++ b/demos/doc/programGuide/ch06/combo_box/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch06/spin_box/Makefile.am
++++ b/demos/doc/programGuide/ch06/spin_box/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch08/Container/Makefile.am
++++ b/demos/doc/programGuide/ch08/Container/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch08/Notebook/Makefile.am
++++ b/demos/doc/programGuide/ch08/Notebook/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch16/Makefile.am
++++ b/demos/doc/programGuide/ch16/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch17/simple_drag/Makefile.am
++++ b/demos/doc/programGuide/ch17/simple_drag/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch17/simple_drop/Makefile.am
++++ b/demos/doc/programGuide/ch17/simple_drop/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/lib/Exm/wml/Makefile.am
++++ b/demos/lib/Exm/wml/Makefile.am
+@@ -18,7 +18,7 @@
+ 	-I$(top_builddir)/clients/uil \
+ 	${X_CFLAGS} 
+ 
+-LDADD = $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Xm/libXm.la -lXt
+ 
+ DISTCLEANFILES = motif.wmd
+ 
+--- a/demos/lib/Xmd/Makefile.am
++++ b/demos/lib/Xmd/Makefile.am
+@@ -12,7 +12,7 @@
+ Print.h PrintP.h \
+ RegEdit.h RegEditI.h
+ 
+-LDADD = libXmd.a ../../../lib/Xm/libXm.la
++LDADD = libXmd.a ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(srcdir)/../../../lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/ButtonBox/Makefile.am
++++ b/demos/programs/ButtonBox/Makefile.am
+@@ -8,6 +8,6 @@
+ bboxdemo_SOURCES = bboxdemo.c
+ data_DATA = $(EXTRA_DIST) $(bboxdemo_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/ColorSel/Makefile.am
++++ b/demos/programs/ColorSel/Makefile.am
+@@ -7,6 +7,6 @@
+ colordemo_SOURCES = util-c.c colordemo.c
+ EXTRA_DIST = Imakefile
+ data_DATA = $(colordemo_SOURCES) $(EXTRA_DIST)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Column/Makefile.am
++++ b/demos/programs/Column/Makefile.am
+@@ -8,5 +8,5 @@
+ EXTRA_DIST = Imakefile Column.ad
+ data_DATA = $(EXTRA_DIST) $(column_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Combo2/Makefile.am
++++ b/demos/programs/Combo2/Makefile.am
+@@ -8,5 +8,5 @@
+ combo_SOURCES = combo.c
+ data_DATA = $(EXTRA_DIST) $(combo_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Exm/app_in_c/Makefile.am
++++ b/demos/programs/Exm/app_in_c/Makefile.am
+@@ -14,4 +14,4 @@
+            -I$(top_builddir)/lib \
+             ${X_CFLAGS} 
+ LDADD = ../../../lib/Exm/libExm.a \
+-	../../../../lib/Xm/libXm.la
++	../../../../lib/Xm/libXm.la -lXt -lXext -lX11
+--- a/demos/programs/Exm/simple_app/Makefile.am
++++ b/demos/programs/Exm/simple_app/Makefile.am
+@@ -14,5 +14,6 @@
+            -I$(srcdir)/../../../lib \
+            -I$(top_builddir)/lib \
+            ${X_CFLAGS} 
+-LDADD = ../../../../lib/Xm/libXm.la \
+-        ../../../lib/Exm/libExm.a
++LDADD = ../../../lib/Exm/libExm.a \
++        ../../../../lib/Xm/libXm.la -lXt -lX11
++
+--- a/demos/programs/Ext18List/Makefile.am
++++ b/demos/programs/Ext18List/Makefile.am
+@@ -10,6 +10,6 @@
+ EXTRA_DIST = Imakefile
+ data_DATA = $(EXTRA_DIST) $(ext18list_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/FontSel/Makefile.am
++++ b/demos/programs/FontSel/Makefile.am
+@@ -7,6 +7,6 @@
+ fontsel_SOURCES = callbacks-c.c creation-c.c fontsel.c fontsel.h
+ EXTRA_DIST = Imakefile
+ data_DATA = $(EXTRA_DIST) $(fontsel_SOURCES)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/IconB/Makefile.am
++++ b/demos/programs/IconB/Makefile.am
+@@ -8,7 +8,7 @@
+ iconbuttondemo_SOURCES = misc.c  iconbuttondemo.c
+ data_DATA = $(iconbuttondemo_SOURCES) $(EXTRA_DIST)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. \
+            -I$(srcdir)/$(TOPDIR)/lib \
+--- a/demos/programs/Outline/Makefile.am
++++ b/demos/programs/Outline/Makefile.am
+@@ -7,6 +7,6 @@
+ bin_PROGRAMS = outline
+ outline_SOURCES = outline.c
+ data_DATA = $(outline_SOURCES) $(EXTRA_DIST)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Paned/Makefile.am
++++ b/demos/programs/Paned/Makefile.am
+@@ -8,6 +8,6 @@
+ paned_SOURCES = creation-c.c paned.c
+ data_DATA = $(EXTRA_DIST) $(paned_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/TabStack/Makefile.am
++++ b/demos/programs/TabStack/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = Imakefile
+ data_DATA = $(tabstack_SOURCES) $(EXTRA_DIST)            
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Tree/Makefile.am
++++ b/demos/programs/Tree/Makefile.am
+@@ -8,6 +8,6 @@
+ tree_SOURCES = bxutil-c.c  tree.c
+ data_DATA = $(EXTRA_DIST) $(tree_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/airport/Makefile.am
++++ b/demos/programs/airport/Makefile.am
+@@ -8,5 +8,5 @@
+                   dragsource.h dropsite.h main.h
+ EXTRA_DIST = Imakefile XmdAirport.ad README
+ data_DATA = $(airport_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/animate/Makefile.am
++++ b/demos/programs/animate/Makefile.am
+@@ -17,7 +17,7 @@
+ 
+ bin_PROGRAMS = xmanimate
+ 
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib \
+            -I$(srcdir)/../../lib \
+--- a/demos/programs/drag_and_drop/Makefile.am
++++ b/demos/programs/drag_and_drop/Makefile.am
+@@ -10,6 +10,6 @@
+ simpledrop_SOURCES = simpledrop.c
+ data_DATA = $(EXTRA_DIST) $(DNDDemo_SOURCES) $(simpledrop_SOURCES)
+ noinst_HEADERS = DNDDemo.h
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/draw/Makefile.am
++++ b/demos/programs/draw/Makefile.am
+@@ -7,5 +7,5 @@
+ draw_SOURCES = draw.c
+ EXTRA_DIST = Imakefile XmdDraw.ad README draw.help draw.man
+ data_DATA = $(EXTRA_DIST) $(draw_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/earth/Makefile.am
++++ b/demos/programs/earth/Makefile.am
+@@ -7,5 +7,5 @@
+ earth_SOURCES = earth.c
+ EXTRA_DIST = terre.xbm earth.man Imakefile README
+ data_DATA = $(EXTRA_DIST) $(earth_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lXext -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/filemanager/Makefile.am
++++ b/demos/programs/filemanager/Makefile.am
+@@ -11,7 +11,7 @@
+            obj.xpm pix.xpm s_dir.xpm s_exec.xpm s_file.xpm \
+            s_none.xpm s_pix.xpm
+ data_DATA = $(EXTRA_DIST) $(filemanager_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+ 
+--- a/demos/programs/fileview/Makefile.am
++++ b/demos/programs/fileview/Makefile.am
+@@ -11,7 +11,7 @@
+ 
+ UILS= French.uil German.uil English.uil
+ 
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/getsubres/Makefile.am
++++ b/demos/programs/getsubres/Makefile.am
+@@ -7,5 +7,5 @@
+ EXTRA_DIST = getsubres.help getsubres.man README Imakefile
+ getsubres_SOURCES = getsubres.c
+ data_DATA = $(EXTRA_DIST) $(getsubres_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/hellomotif/Makefile.am
++++ b/demos/programs/hellomotif/Makefile.am
+@@ -7,7 +7,7 @@
+ EXTRA_DIST = hellomotif.uil Imakefile README
+ hellomotif_SOURCES = hellomotif.c
+ data_DATA = $(EXTRA_DIST) $(hellomotif_SOURCES) hellomotif.uid
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+ all: hellomotif.uid
+--- a/demos/programs/hellomotifi18n/Makefile.am
++++ b/demos/programs/hellomotifi18n/Makefile.am
+@@ -12,7 +12,7 @@
+ helloint_DEPENDENCIES = helloint.uid C/uid/l_strings.uid english/uid/l_strings.uid french/uid/l_strings.uid hebrew/uid/l_strings.uid japan/uid/l_strings.uid japanese/uid/l_strings.uid swedish/uid/l_strings.uid
+ 
+ INCLUDES = -I$(top_srcdir)/lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la -lXt
+ 
+ SUFFIXES = .uil .uid
+ 
+--- a/demos/programs/i18ninput/Makefile.am
++++ b/demos/programs/i18ninput/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = XmdI18nInput.ad README i18ninput.man i18ninput.help \
+              Imakefile
+ data_DATA = $(EXTRA_DIST) $(i18ninput_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/panner/Makefile.am
++++ b/demos/programs/panner/Makefile.am
+@@ -7,5 +7,5 @@
+ panner_SOURCES = panner.c
+ EXTRA_DIST = README panner.man Imakefile
+ data_DATA = $(EXTRA_DIST) $(panner_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/periodic/Makefile.am
++++ b/demos/programs/periodic/Makefile.am
+@@ -7,7 +7,7 @@
+ EXTRA_DIST = periodic.uil periodic_l.uil XmdPeriodic.ad Imakefile README
+ periodic_SOURCES = periodic.c
+ data_DATA = $(EXTRA_DIST) $(periodic_SOURCES) periodic.uid
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/piano/Makefile.am
++++ b/demos/programs/piano/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = piano.images README Inv8_part1.piano Inv8_part2.piano \
+              piano.man Imakefile
+ data_DATA  = $(EXTRA_DIST) $(piano_SOURCES) 
+-LDADD = ../../../lib/Xm/libXm.la -lm
++LDADD = ../../../lib/Xm/libXm.la -lm -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/popups/Makefile.am
++++ b/demos/programs/popups/Makefile.am
+@@ -7,6 +7,6 @@
+ autopopups_SOURCES = autopopups.c
+ EXTRA_DIST = README autopopups.man Imakefile
+ data_DATA = $(EXTRA_DIST) $(autopopups_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/sampler2_0/Makefile.am
++++ b/demos/programs/sampler2_0/Makefile.am
+@@ -10,6 +10,6 @@
+ bin_PROGRAMS = sampler2_0
+ sampler2_0_SOURCES = sampler2_0.c
+ data_DATA = $(sampler2_0_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/setdate/Makefile.am
++++ b/demos/programs/setdate/Makefile.am
+@@ -7,6 +7,6 @@
+ EXTRA_DIST = XmdSetDate.ad README setDate.man Imakefile
+ setDate_SOURCES = setDate.c
+ data_DATA = $(EXTRA_DIST) $(setDate_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/todo/Makefile.am
++++ b/demos/programs/todo/Makefile.am
+@@ -9,4 +9,4 @@
+ data_DATA = $(EXTRA_DIST) $(todo_SOURCES)
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la 
++LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la -lXt -lXext -lX11
+--- a/demos/programs/tooltips/Makefile.am
++++ b/demos/programs/tooltips/Makefile.am
+@@ -7,6 +7,6 @@
+ bin_PROGRAMS = tooltips
+ tooltips_SOURCES = tooltips.c
+ data_DATA = $(tooltips_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/workspace/Makefile.am
++++ b/demos/programs/workspace/Makefile.am
+@@ -11,4 +11,4 @@
+               wsm.h wsmSend.h wsmStruct.h wsm_ui.h xrmLib.h
+ data_DATA = $(wsm_SOURCES) $(EXTRA_DIST)
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm
++LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm -lXt -lX11
+--- a/demos/unsupported/aicon/Makefile.am
++++ b/demos/unsupported/aicon/Makefile.am
+@@ -2,7 +2,7 @@
+ 
+ noinst_PROGRAMS = aicon
+  
+-LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la 
++LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/unsupported/dainput/Makefile.am
++++ b/demos/unsupported/dainput/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ dainput_SOURCES = dainput.c dainput_dlg.c dainput_ui.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/dogs/Makefile.am
++++ b/demos/unsupported/dogs/Makefile.am
+@@ -16,7 +16,7 @@
+ 
+ dogs_DEPENDENCIES = dogs.uid
+ 
+-LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/unsupported/hellomotif/Makefile.am
++++ b/demos/unsupported/hellomotif/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = hellomotif.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/motifshell/Makefile.am
++++ b/demos/unsupported/motifshell/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = motifshell.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmapdef/Makefile.am
++++ b/demos/unsupported/xmapdef/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmapdef.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmfonts/Makefile.am
++++ b/demos/unsupported/xmfonts/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmfonts.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmforc/Makefile.am
++++ b/demos/unsupported/xmforc/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmforc.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmform/Makefile.am
++++ b/demos/unsupported/xmform/Makefile.am
+@@ -6,6 +6,6 @@
+ 
+ EXTRA_DIST = Imakefile
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS}
+--- a/tools/wml/Makefile.am
++++ b/tools/wml/Makefile.am
+@@ -30,7 +30,7 @@
+ wml_LDADD = -L. -lwml
+ wml_DEPENDENCIES = libwml.a
+ 
+-wmldbcreate_LDADD = ../../lib/Xm/libXm.la
++wmldbcreate_LDADD = ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I../../lib -I$(srcdir)/../../lib -I$(srcdir)/../../include ${X_CFLAGS} 
+ 
diff --git a/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch b/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
new file mode 100644
index 00000000000..6d532859d73
--- /dev/null
+++ b/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
@@ -0,0 +1,54 @@
+Description: Fix hardcoded path to /usr/lib/X11/rgb.txt in lib/Xm/ColorS.c
+ LibXm is hardcoded to read rgb.txt from /usr/lib/X11 but this file, provided
+ by x11-common in Debian, is located in /etc/X11 and /usr/share/X11 via symlink.
+ .
+ This patch fixes this by allowing the directory in which rgb.txt resides to be
+ customized by the --with-x11rgbdir=DIR configure option.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1585
+Last-Update: 2013-03-12
+--- a/configure.ac
++++ b/configure.ac
+@@ -189,6 +189,10 @@
+ XMBINDDIR_FALLBACK="$xmbinddir"
+ AC_SUBST(XMBINDDIR_FALLBACK)
+ 
++AC_ARG_WITH(x11rgbdir, [  --with-x11rgbdir=DIR  rgb.txt is located in DIR], x11rgbdir=$withval, x11rgbdir="/usr/lib/X11")
++X11RGBPATH="$x11rgbdir/rgb.txt"
++AC_SUBST(X11RGBPATH)
++
+ RM="rm -f"
+ AC_SUBST(RM)
+ 
+--- a/lib/Xm/ColorS.c
++++ b/lib/Xm/ColorS.c
+@@ -123,6 +123,10 @@
+  *       STATIC DECLARATIONS
+  ************************************************************/
+ 
++#ifndef X11RGBPATH
++#define X11RGBPATH "/usr/lib/X11/rgb.txt"
++#endif
++
+ static XtResource resources[] =
+ {
+   {
+@@ -146,7 +150,7 @@
+   {
+     XmNrgbFile, XmCString, XmRString,
+     sizeof(String), XtOffsetOf(XmColorSelectorRec, cs.rgb_file),
+-    XmRString, (XtPointer) "/usr/lib/X11/rgb.txt"
++    XmRString, (XtPointer) X11RGBPATH
+   },
+ #endif
+   {
+--- a/lib/Xm/Makefile.am
++++ b/lib/Xm/Makefile.am
+@@ -8,6 +8,7 @@
+ INCLUDES = -I.. -I$(srcdir)/.. -DXMBINDDIR_FALLBACK=\"@XMBINDDIR_FALLBACK@\" \
+            -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
++           -DX11RGBPATH=\"@X11RGBPATH@\" \
+            ${X_CFLAGS}
+ xmdir = $(includedir)/Xm
+ 
diff --git a/srcpkgs/motif/patches/15-link_uil_against_libuil.patch b/srcpkgs/motif/patches/15-link_uil_against_libuil.patch
new file mode 100644
index 00000000000..11792a7a4c8
--- /dev/null
+++ b/srcpkgs/motif/patches/15-link_uil_against_libuil.patch
@@ -0,0 +1,29 @@
+Description: Link the uil executable against libUil
+ Linking the uil executable againt libUil instead of compiling with the libUil
+ code results in a reduction in size of the uil executable from about 348KB
+ to about 16KB.
+ .
+ This patch originates from Red Hat.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1586
+Last-Update: 2013-03-12
+--- a/clients/uil/Makefile.am
++++ b/clients/uil/Makefile.am
+@@ -13,7 +13,7 @@
+ 
+ libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+-uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
++uil_LDADD = libUil.la ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
+@@ -42,7 +42,7 @@
+ 		UilLstMac.c	UilSemVal.c	UilSemCSet.c	UilDB.c
+ 
+ SRCS =		$(COMMON_SRC)
+-SRCS2 =		$(COMMON_SRC)	UilMain.c
++SRCS2 =		UilMain.c
+ 
+ HEADERS_1 = 	Uil.h		UilSymGl.h	UilSymDef.h \
+ 		UilDef.h	XmAppl.uil
diff --git a/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch b/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
new file mode 100644
index 00000000000..95a753e083e
--- /dev/null
+++ b/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
@@ -0,0 +1,17 @@
+Description: Fix undefined use of sprintf
+ This patch fixes the undefined use of sprintf when the
+ source and destination buffers overlap.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1628
+Last-Update: 2013-09-24
+--- a/lib/Xm/XmRenderT.c
++++ b/lib/Xm/XmRenderT.c
+@@ -2703,7 +2703,7 @@
+       number = tlist -> count;
+       tab = (_XmTab) tlist -> start;
+       while(number > 0) {
+-	sprintf(temp, "%s %f %d %d %d, ", temp, tab -> value, 
++	sprintf(temp + strlen(temp), " %f %d %d %d, ", tab -> value,
+ 		tab -> units, tab -> alignment, tab -> offsetModel);
+ 	tab = (_XmTab) tab -> next;
+ 	number--;
diff --git a/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch b/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
new file mode 100644
index 00000000000..a77b8793a8e
--- /dev/null
+++ b/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
@@ -0,0 +1,384 @@
+Description: Switch to system iswspace() function
+ This patch replaces calls to _XmDataFieldIsWSpace() in lib/Xm/DataF.c
+ and _XmTextFieldIsWSpace() in lib/Xm/TextF.c with calls to the system
+ iswspace() function.
+ .
+ It fixes an array bounds error in lib/Xm/DataF.c where 
+ _XmDataFieldIsWSpace() is called with num_entries = 3.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1629
+Last-Update: 2013-11-18
+--- a/lib/Xm/DataF.c
++++ b/lib/Xm/DataF.c
+@@ -208,7 +208,6 @@
+ static Boolean df_VerifyLeave() ;
+ static Boolean _XmDataFieldIsWordBoundary() ;
+ static int _XmGetImage(Screen *, char *, XImage **);
+-static Boolean _XmDataFieldIsWSpace() ;
+ static void df_FindWord() ;
+ static void df_FindPrevWord() ;
+ static void df_FindNextWord() ;
+@@ -549,10 +548,6 @@
+                         XmDataFieldWidget tf,
+                         XmTextPosition pos1,
+                         XmTextPosition pos2) ;
+-static Boolean _XmDataFieldIsWSpace( 
+-                        wchar_t wide_char,
+-                        wchar_t *white_space,
+-                        int num_entries) ;
+ static void df_FindWord( 
+                         XmDataFieldWidget tf,
+                         XmTextPosition begin,
+@@ -4549,40 +4544,6 @@
+    return False;
+ }
+ 
+-/* This routine accepts an array of wchar_t's containing wchar encodings
+- * of whitespace characters (and the number of array elements), comparing
+- * the wide character passed to each element of the array.  If a match
+- * is found, we got a white space.  This routine exists only because
+- * iswspace(3c) is not yet standard.  If a system has isw* available,
+- * calls to this routine should be changed to iswspace(3c) (and callers
+- * should delete initialization of the array), and this routine should
+- * be deleted.  Its a stop gap measure to avoid allocating an instance
+- * variable for the white_space array and/or declaring a widget wide
+- * global for the data and using a macro.  Its ugly, but it works and 
+- * in the long run will be replaced by standard functionality. */
+-
+-/* ARGSUSED */
+-static Boolean
+-#ifdef _NO_PROTO
+-_XmDataFieldIsWSpace( wide_char, white_space, num_entries )
+-	wchar_t wide_char ;
+-	wchar_t * white_space ;
+-	int num_entries ;
+-#else
+-_XmDataFieldIsWSpace(
+-	wchar_t wide_char,
+-	wchar_t * white_space ,
+-	int num_entries )
+-#endif /* _NO_PROTO */
+-{
+-   int i;
+-
+-   for (i=num_entries; i > 0; i--){
+-      if (wide_char == white_space[i]) return True;
+-   }
+-   return False;
+-}
+-
+ static void 
+ #ifdef _NO_PROTO
+ df_FindWord( tf, begin, left, right )
+@@ -4599,7 +4560,6 @@
+ #endif /* _NO_PROTO */
+ {
+     XmTextPosition start, end;
+-    wchar_t white_space[3];
+ 
+     if (XmTextF_max_char_size(tf) == 1) {
+        for (start = begin; start > 0; start--) {
+@@ -4617,11 +4577,8 @@
+        }
+        *right = end - 1;
+     } else { /* check for iswspace and iswordboundary in each direction */
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+        for (start = begin; start > 0; start --) {
+-          if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start-1],white_space, 3)
++          if (iswspace(XmTextF_wc_value(tf)[start-1])
+ 	      || _XmDataFieldIsWordBoundary(tf, (XmTextPosition) start - 1, 
+ 					    start)) {
+ 		 break;
+@@ -4630,7 +4587,7 @@
+        *left = start;
+ 
+        for (end = begin; end <= XmTextF_string_length(tf); end++) {
+-	   if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)){
++	   if (iswspace(XmTextF_wc_value(tf)[end])){
+ 	      end++;
+ 	      break;
+ 	   } else if (end < XmTextF_string_length(tf)) {
+@@ -4659,14 +4616,6 @@
+ {
+ 
+     XmTextPosition start = XmTextF_cursor_position(tf);
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+-
+ 
+     if (XmTextF_max_char_size(tf) == 1) {
+        if ((start > 0) && 
+@@ -4680,11 +4629,9 @@
+        }
+        df_FindWord(tf, start, left, right);
+     } else { 
+-       if ((start > 0) && (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start - 1],
+-						white_space, 3))) {
++       if ((start > 0) && (iswspace(XmTextF_wc_value(tf)[start - 1]))) {
+           for (; start > 0; start--) {
+-	     if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start -1], 
+-				       white_space, 3)){
++	     if (!iswspace(XmTextF_wc_value(tf)[start -1])){
+ 		start--;
+ 		break;
+              }
+@@ -4713,14 +4660,6 @@
+ {
+ 
+     XmTextPosition end = XmTextF_cursor_position(tf);
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+-
+ 
+     if(XmTextF_max_char_size(tf) == 1) {
+        if (isspace((int)(unsigned char)XmTextF_value(tf)[end])) {
+@@ -4742,9 +4681,9 @@
+        if (*right < XmTextF_string_length(tf))
+           *right = *right - 1;
+    } else {
+-      if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) {
++      if (iswspace(XmTextF_wc_value(tf)[end])) {
+ 	 for ( ; end < XmTextF_string_length(tf); end ++) {
+-	   if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) {
++	   if (!iswspace(XmTextF_wc_value(tf)[end])) {
+ 	       break;
+            }
+          }
+@@ -4758,10 +4697,9 @@
+        * If word boundary caused by whitespace, set right to the last 
+        * whitespace following the end of the current word.
+        */
+-      if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], white_space, 3))      {
++      if (iswspace(XmTextF_wc_value(tf)[(int)*right]))      {
+          while (*right < XmTextF_string_length(tf) &&
+-               _XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], 
+-				    white_space, 3)) {
++               iswspace(XmTextF_wc_value(tf)[(int)*right])) {
+             *right = *right + 1;
+ 	 }
+ 	 if (*right < XmTextF_string_length(tf))
+@@ -5872,13 +5810,6 @@
+ {
+     XmDataFieldWidget tf = (XmDataFieldWidget) w;
+     XmTextPosition cursorPos, position, dummy;
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+ 
+     cursorPos = XmTextF_cursor_position(tf);
+ 
+@@ -5896,16 +5827,13 @@
+              }
+           }
+        } else {
+-	  if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[cursorPos],
+-				   white_space, 3))
++	  if (iswspace(XmTextF_wc_value(tf)[cursorPos]))
+ 	     df_FindWord(tf, cursorPos, &dummy, &position);
+ 	  else
+ 	     df_FindNextWord(tf, &dummy, &position);
+-          if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position],
+-				   white_space, 3)){
++          if (iswspace(XmTextF_wc_value(tf)[position])){
+ 	     for (; position < XmTextF_string_length(tf); position++) {
+-		if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position], 
+-					  white_space, 3))
++		if (!iswspace(XmTextF_wc_value(tf)[position]))
+ 		   break;
+ 	     }
+ 	  }
+--- a/lib/Xm/TextF.c
++++ b/lib/Xm/TextF.c
+@@ -360,10 +360,6 @@
+ 					  XmTextPosition pos1,
+ 					  XmTextPosition pos2);
+ 
+-static Boolean _XmTextFieldIsWSpace(wchar_t wide_char,
+-				    wchar_t *white_space,
+-				    int num_entries);
+-
+ static void FindWord(XmTextFieldWidget tf,
+ 		     XmTextPosition begin,
+ 		     XmTextPosition *left,
+@@ -3514,32 +3510,6 @@
+   return False;
+ }
+ 
+-/* This routine accepts an array of wchar_t's containing wchar encodings
+- * of whitespace characters (and the number of array elements), comparing
+- * the wide character passed to each element of the array.  If a match
+- * is found, we got a white space.  This routine exists only because
+- * iswspace(3c) is not yet standard.  If a system has isw* available,
+- * calls to this routine should be changed to iswspace(3c) (and callers
+- * should delete initialization of the array), and this routine should
+- * be deleted.  Its a stop gap measure to avoid allocating an instance
+- * variable for the white_space array and/or declaring a widget wide
+- * global for the data and using a macro.  Its ugly, but it works and 
+- * in the long run will be replaced by standard functionality. */
+-
+-/* ARGSUSED */
+-static Boolean
+-_XmTextFieldIsWSpace(wchar_t wide_char,
+-		     wchar_t * white_space ,
+-		     int num_entries)
+-{
+-  int i;
+-  
+-  for (i=0; i < num_entries; i++) {
+-    if (wide_char == white_space[i]) return True;
+-  }
+-  return False;
+-}
+-
+ static void 
+ FindWord(XmTextFieldWidget tf,
+ 	 XmTextPosition begin,
+@@ -3547,7 +3517,6 @@
+ 	 XmTextPosition *right)
+ {
+   XmTextPosition start, end;
+-  wchar_t white_space[3];
+   
+   if (tf->text.max_char_size == 1) {
+     for (start = begin; start > 0; start--) {
+@@ -3565,11 +3534,8 @@
+     }
+     *right = end - 1;
+   } else { /* check for iswspace and iswordboundary in each direction */
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+     for (start = begin; start > 0; start --) {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start-1],white_space, 3)
++      if (iswspace(TextF_WcValue(tf)[start-1])
+ 	  || _XmTextFieldIsWordBoundary(tf, (XmTextPosition) start - 1, 
+ 					start)) {
+ 	break;
+@@ -3578,7 +3544,7 @@
+     *left = start;
+     
+     for (end = begin; end <= tf->text.string_length; end++) {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++      if (iswspace(TextF_WcValue(tf)[end])) {
+ 	end++;
+ 	break;
+       } else if (end < tf->text.string_length) {
+@@ -3599,14 +3565,6 @@
+ {
+   
+   XmTextPosition start = TextF_CursorPosition(tf);
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+-  
+   
+   if (tf->text.max_char_size == 1) {
+     if ((start > 0) && 
+@@ -3620,11 +3578,9 @@
+     }
+     FindWord(tf, start, left, right);
+   } else { 
+-    if ((start > 0) && (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start - 1],
+-					     white_space, 3))) {
++    if ((start > 0) && (iswspace(TextF_WcValue(tf)[start - 1]))) {
+       for (; start > 0; start--) {
+-	if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[start -1], 
+-				  white_space, 3)) {
++	if (!iswspace(TextF_WcValue(tf)[start -1])) {
+ 	  start--;
+ 	  break;
+ 	}
+@@ -3645,14 +3601,6 @@
+ {
+   
+   XmTextPosition end = TextF_CursorPosition(tf);
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+-  
+   
+   if(tf->text.max_char_size == 1) {
+     if (isspace((unsigned char)TextF_Value(tf)[end])) {
+@@ -3674,9 +3622,9 @@
+     if (*right < tf->text.string_length)
+       *right = *right - 1;
+   } else {
+-    if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++    if (iswspace(TextF_WcValue(tf)[end])) {
+       for (; end < tf->text.string_length; end ++) {
+-	if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++	if (!iswspace(TextF_WcValue(tf)[end])) {
+ 	  break;
+ 	}
+       }
+@@ -3690,10 +3638,9 @@
+      * If word boundary caused by whitespace, set right to the last 
+      * whitespace following the end of the current word.
+      */
+-    if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], white_space, 3)) {
++    if (iswspace(TextF_WcValue(tf)[(int)*right])) {
+       while (*right < tf->text.string_length &&
+-	     _XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], 
+-				  white_space, 3)) {
++	     iswspace(TextF_WcValue(tf)[(int)*right])) {
+ 	*right = *right + 1;
+       }
+       if (*right < tf->text.string_length)
+@@ -4546,13 +4493,6 @@
+ {
+   XmTextFieldWidget tf = (XmTextFieldWidget) w;
+   XmTextPosition cursorPos, position, dummy;
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+   
+   cursorPos = TextF_CursorPosition(tf);
+   
+@@ -4570,16 +4510,13 @@
+ 	}
+       }
+     } else {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[cursorPos],
+-			       white_space, 3))
++      if (iswspace(TextF_WcValue(tf)[cursorPos]))
+ 	FindWord(tf, cursorPos, &dummy, &position);
+       else
+ 	FindNextWord(tf, &dummy, &position);
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[position],
+-			       white_space, 3)) {
++      if (iswspace(TextF_WcValue(tf)[position])) {
+ 	for (; position < tf->text.string_length; position++) {
+-	  if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[position], 
+-				    white_space, 3))
++	  if (!iswspace(TextF_WcValue(tf)[position]))
+ 	    break;
+ 	}
+       }
diff --git a/srcpkgs/motif/patches/20-cross-compile.patch b/srcpkgs/motif/patches/20-cross-compile.patch
new file mode 100644
index 00000000000..1994b26cc4a
--- /dev/null
+++ b/srcpkgs/motif/patches/20-cross-compile.patch
@@ -0,0 +1,15 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,10 +3,10 @@
+ AC_CONFIG_SRCDIR([lib/Xm/Form.c])
+ AC_PREREQ(2.52)
+ AC_CONFIG_AUX_DIR(.)
+-AC_CHECK_FILE(/usr/X/include/X11/X.h,
++AS_IF([test -f "/usr/X/include/X11/X.h"],
+   AC_PREFIX_DEFAULT(/usr/X),
+   AC_PREFIX_DEFAULT(/usr))
+-AC_CHECK_FILE(/usr/X11R6/include/X11/X.h,
++AS_IF([test -f "/usr/X11R6/include/X11/X.h"],
+   AC_PREFIX_DEFAULT(/usr/X11R6),
+   AC_PREFIX_DEFAULT(/usr))
+ 
diff --git a/srcpkgs/motif/template b/srcpkgs/motif/template
new file mode 100644
index 00000000000..8842817b4c2
--- /dev/null
+++ b/srcpkgs/motif/template
@@ -0,0 +1,68 @@
+# Template file for 'motif'
+pkgname=motif
+version=2.3.8
+revision=1
+build_style=gnu-configure
+build_helper=qemu
+configure_args="--disable-jpeg --disable-png --enable-xft --disable-demos"
+hostmakedepends="pkg-config automake libtool flex"
+makedepends="libX11-devel libXft-devel libXt-devel libXpm-devel libXext-devel xbitmaps"
+short_desc="User interface component toolkit"
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://sourceforge.net/projects/motif/"
+distfiles="${SOURCEFORGE_SITE}/motif/Motif%20${version}%20Source%20Code/motif-${version}.tar.gz"
+checksum=859b723666eeac7df018209d66045c9853b50b4218cecadb794e2359619ebce7
+replaces="lesstif>=0"
+patch_args="-Np1"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" $makedepends"
+fi
+
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		vsed -i lib/Xm/Makefile.am -e 's|$(top_builddir)/config/util/makestr|/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e 's|\./wmluiltok|/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e 's|\./wml |/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e '/motif.wmd:/a	\\tsed -i "s|      exec|& /usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static |" wmldbcreate'
+	fi
+	touch NEWS AUTHORS
+	autoreconf -fi
+	vsed -i tools/wml/wmluiltok.l -e '1i %option main'
+}
+
+motif-devel_package() {
+	short_desc+=" - development files"
+	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	replaces="lesstif-devel>=0"
+	pkg_install() {
+		vmove usr/bin/uil
+		vmove usr/share/man/man3
+		vmove usr/share/man/man1/uil.1
+		vmove usr/share/man/man5
+		vmove usr/include
+		vmove "usr/lib/*.so"
+	}
+}
+
+motif-mwm_package() {
+	short_desce="Motif window manager"
+	depends="${sourcepkg}>=${version}_${revision}"
+	replaces="lesstif-mwm>=0"
+	pkg_install() {
+		vmove usr/bin/mwm
+		vmove usr/share/man/man1/mwm.1
+		vmove usr/share/man/man4/mwmrc.4
+		vmove usr/lib/X11/system.mwmrc
+	}
+}
+
+motif-xmbind_package() {
+	short_desc="Configures the virtual key bindings of Motif applications"
+	replaces="lesstif-xmbind>=0"
+	pkg_install() {
+		vmove usr/bin/xmbind
+		vmove usr/share/man/man1/xmbind.1
+	}
+}

From 05b7cc415e07e87297ba48ef2f3d71d327ed0eaf Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:21:15 -0700
Subject: [PATCH 2/5] lesstif: remove deprecated package

---
 srcpkgs/lesstif-devel    |  1 -
 srcpkgs/lesstif-mwm      |  1 -
 srcpkgs/lesstif-xmbind   |  1 -
 srcpkgs/lesstif/template | 67 ----------------------------------------
 4 files changed, 70 deletions(-)
 delete mode 120000 srcpkgs/lesstif-devel
 delete mode 120000 srcpkgs/lesstif-mwm
 delete mode 120000 srcpkgs/lesstif-xmbind
 delete mode 100644 srcpkgs/lesstif/template

diff --git a/srcpkgs/lesstif-devel b/srcpkgs/lesstif-devel
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-devel
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif-mwm b/srcpkgs/lesstif-mwm
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-mwm
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif-xmbind b/srcpkgs/lesstif-xmbind
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-xmbind
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif/template b/srcpkgs/lesstif/template
deleted file mode 100644
index 96b858d5a64..00000000000
--- a/srcpkgs/lesstif/template
+++ /dev/null
@@ -1,67 +0,0 @@
-# Template file for 'lesstif'
-pkgname=lesstif
-version=0.95.2
-revision=6
-build_style=gnu-configure
-configure_args="--prefix=/usr --mandir=/usr/share/man --docdir=/usr/share/doc
- --with-xdnd --enable-production --enable-nonstandard-conversions
- --enable-editres --enable-build-21 --disable-static --disable-debug
- --x-includes=/usr/include --x-libraries=/usr/lib"
-hostmakedepends="pkg-config"
-makedepends="libXt-devel libXp-devel libXft-devel"
-short_desc="LGPL'd re-implementation of Motif"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="LGPL-2.1"
-homepage="http://lesstif.sourceforge.net/"
-distfiles="${SOURCEFORGE_SITE}/lesstif/lesstif-${version}.tar.bz2"
-checksum=eb4aa38858c29a4a3bcf605cfe7d91ca41f4522d78d770f69721e6e3a4ecf7e3
-
-pre_build() {
-	if [ -n "$CROSS_BUILD" ]; then
-		cd ${wrksrc}/scripts
-		msg_normal "Building man2html for $XBPS_ARCH\n"
-		cc -o man2html man2html.c
-		# Disable the rule for cross-gcc man2html
-		sed -i Makefile -e "/noinst_PROGRAMS = / s/man2html.*//"
-	fi
-}
-post_install() {
-	rm -rf $DESTDIR/usr/LessTif
-}
-
-lesstif-mwm_package() {
-	short_desc="LessTif clone of the Motif Window Manager"
-	pkg_install() {
-		vmove usr/bin/mwm
-		vmove usr/lib/X11/mwm
-		vmove usr/share/man/man1/mwm.1
-		vmove usr/share/man/man5/mwmrc.5
-		vmove usr/lib/X11/app-defaults/Mwm
-	}
-}
-
-lesstif-xmbind_package() {
-	short_desc="Configures the virtual key bindings of LessTif applications"
-	pkg_install() {
-		vmove usr/bin/xmbind
-		vmove usr/share/man/man1/xmbind.1
-	}
-}
-
-lesstif-devel_package() {
-	depends="${sourcepkg}>=${version}_${revision}"
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove "usr/lib/*.so"
-		vmove usr/share/man/man3
-		vmove usr/share/man/man1/ltversion.1
-		vmove usr/share/man/man1/uil.1
-		vmove usr/share/man/man1/lesstif.1
-		vmove usr/share/man/man5/VirtualBindings.5
-		vmove usr/lib/LessTif
-		vmove usr/bin/uil
-		vmove usr/bin/mxmkmf
-		vmove usr/bin/motif-config
-	}
-}

From ec4cb9f769537fab9a1333e208c968ee36183a4f Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:15:49 -0700
Subject: [PATCH 3/5] xastir: update to 2.1.6, rebuild with motif

---
 srcpkgs/xastir/template | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/xastir/template b/srcpkgs/xastir/template
index b6b9de5ee2f..645d1d5391a 100644
--- a/srcpkgs/xastir/template
+++ b/srcpkgs/xastir/template
@@ -1,17 +1,16 @@
 # Template file for 'xastir'
 pkgname=xastir
-version=2.1.4
+version=2.1.6
 revision=1
 archs="i686 x86_64 ppc64le"
 wrksrc="Xastir-Release-${version}"
 build_style=gnu-configure
-makedepends="libXrender-devel libXt-devel libXp-devel libcurl-devel pcre-devel lesstif-devel libax25-devel"
+makedepends="libXrender-devel libXt-devel libXp-devel libcurl-devel pcre-devel motif-devel libax25-devel"
 short_desc="X Amateur Station Tracking and Information Reporting"
 maintainer="Michael Aldridge <maldridge@voidlinux.org>"
-license="GPL-2"
+license="GPL-2.0-or-later"
 homepage="http://xastir.org"
 distfiles="https://github.com/Xastir/Xastir/archive/Release-${version}.tar.gz"
-checksum=0bd3768440422a666e1c4c532df0184374244b77ae6650e6690715a0ca1fe7bc
-python_version=2 #unverified
+checksum=5a71af2936d4d237c779b1c3a519211f8e3cd03b9873a260c849ddc8950e1a3e
 
 CFLAGS="-fcommon"

From 58a9a1ab29f2fedb344ed68d3cc399d46a450df2 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:16:21 -0700
Subject: [PATCH 4/5] ddd: rebuild with motif

---
 srcpkgs/ddd/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/ddd/template b/srcpkgs/ddd/template
index 02ab5304bc7..24f44a9abc2 100644
--- a/srcpkgs/ddd/template
+++ b/srcpkgs/ddd/template
@@ -1,12 +1,12 @@
-# Template build file for 'ddd'.
+# Template file for 'ddd'
 pkgname=ddd
 version=3.3.12
-revision=5
+revision=6
 build_style=gnu-configure
-makedepends="ncurses-devel libXt-devel libXext-devel libXmu-devel lesstif-devel"
+makedepends="ncurses-devel libXt-devel libXext-devel libXmu-devel motif-devel"
 short_desc="Graphical front-end for command-line debuggers"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/ddd"
-license="GPL-2"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.gz"
 checksum=3ad6cd67d7f4b1d6b2d38537261564a0d26aaed077bf25c51efc1474d0e8b65c

From 2ea1d69e3ef771e3463899d64dc0c165802b2c36 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:17:41 -0700
Subject: [PATCH 5/5] yeahwm: rebuild with motif

---
 srcpkgs/yeahwm/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/yeahwm/template b/srcpkgs/yeahwm/template
index ca7af56230a..3574b02200e 100644
--- a/srcpkgs/yeahwm/template
+++ b/srcpkgs/yeahwm/template
@@ -1,11 +1,11 @@
 # Template file for 'yeahwm'
 pkgname=yeahwm
 version=0.3.5
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="XROOT=\${XBPS_CROSS_BASE}/usr"
-makedepends="lesstif-devel libX11-devel libXinerama-devel"
-short_desc="A h* window manager for X based on evilwm and aewm"
+makedepends="motif-devel libX11-devel libXinerama-devel"
+short_desc="Window manager for X based on evilwm and aewm"
 maintainer="Ananteris <ananteris@mailinator.com>"
 license="Public Domain"
 homepage="http://phrat.de"

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR REVIEW] New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
                   ` (6 preceding siblings ...)
  2020-11-05 15:46 ` abenson
@ 2020-11-24 18:18 ` ahesford
  2020-11-24 18:18 ` ahesford
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ahesford @ 2020-11-24 18:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 280 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/26134#discussion_r529780675

Comment:
I suggest moving this block to `post_patch`, so the changes can be verified after `xbps-src patch` wihthout requiring configuration.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR REVIEW] New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
                   ` (7 preceding siblings ...)
  2020-11-24 18:18 ` [PR REVIEW] " ahesford
@ 2020-11-24 18:18 ` ahesford
  2020-12-05  6:20 ` [PR PATCH] [Updated] " abenson
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ahesford @ 2020-11-24 18:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/26134#discussion_r529780825

Comment:
I believe this can be moved to `post_patch` as well.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Updated] New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
                   ` (8 preceding siblings ...)
  2020-11-24 18:18 ` ahesford
@ 2020-12-05  6:20 ` abenson
  2020-12-13 18:16 ` joshuakraemer
  2020-12-13 19:07 ` [PR PATCH] [Merged]: " abenson
  11 siblings, 0 replies; 13+ messages in thread
From: abenson @ 2020-12-05  6:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 320 bytes --]

There is an updated pull request by abenson against master on the void-packages repository

https://github.com/abenson/void-packages np_motifwqemu
https://github.com/void-linux/void-packages/pull/26134

New package: motif-2.3.8


A patch file from https://github.com/void-linux/void-packages/pull/26134.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-np_motifwqemu-26134.patch --]
[-- Type: text/x-diff, Size: 87706 bytes --]

From b19ec41d57fd6bcc32d54d3b52862fdaab347254 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 21:11:58 -0700
Subject: [PATCH 1/5] New package: motif-2.3.8 [ci skip]

---
 common/shlibs                                 |   6 +-
 srcpkgs/motif-demos                           |   1 +
 srcpkgs/motif-devel                           |   1 +
 srcpkgs/motif-mwm                             |   1 +
 srcpkgs/motif-xmbind                          |   1 +
 .../patches/02-fix-format-security.patch      | 607 ++++++++++++++++++
 srcpkgs/motif/patches/03-no-demos.patch       |  53 ++
 .../motif/patches/06-cast-size_t-to-int.patch |  17 +
 ...7-fix_lintian_reported_manpage_typos.patch | 118 ++++
 .../patches/08-fix_hyphen_in_man_pages.patch  | 156 +++++
 .../motif/patches/09-fix_typo_in_libxm.patch  |  25 +
 .../10-fix_manpage-has-bad-whatis-entry.patch |  49 ++
 .../motif/patches/11-fix_underlinking.patch   | 564 ++++++++++++++++
 .../13-fix_hardcoded_x11rgb_path.patch        |  54 ++
 .../patches/15-link_uil_against_libuil.patch  |  29 +
 .../16-fix-undefined-use-of-sprintf.patch     |  17 +
 .../17-switch-to-system-iswspace.patch        | 384 +++++++++++
 srcpkgs/motif/patches/20-cross-compile.patch  |  15 +
 srcpkgs/motif/template                        |  68 ++
 19 files changed, 2163 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/motif-demos
 create mode 120000 srcpkgs/motif-devel
 create mode 120000 srcpkgs/motif-mwm
 create mode 120000 srcpkgs/motif-xmbind
 create mode 100644 srcpkgs/motif/patches/02-fix-format-security.patch
 create mode 100644 srcpkgs/motif/patches/03-no-demos.patch
 create mode 100644 srcpkgs/motif/patches/06-cast-size_t-to-int.patch
 create mode 100644 srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
 create mode 100644 srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
 create mode 100644 srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
 create mode 100644 srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
 create mode 100644 srcpkgs/motif/patches/11-fix_underlinking.patch
 create mode 100644 srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
 create mode 100644 srcpkgs/motif/patches/15-link_uil_against_libuil.patch
 create mode 100644 srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
 create mode 100644 srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
 create mode 100644 srcpkgs/motif/patches/20-cross-compile.patch
 create mode 100644 srcpkgs/motif/template

diff --git a/common/shlibs b/common/shlibs
index 3ba07ad0ca2..aa3e71890c1 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -1766,9 +1766,9 @@ libSDL2_net-2.0.so.0 SDL2_net-2.0.0_1
 libnxml.so.0 libnxml-0.18.3_1
 libmrss.so.0 libmrss-0.19.2_1
 libuv.so.1 libuv-1.0.0_1
-libXm.so.2 lesstif-0.95.2_1
-libMrm.so.2 lesstif-0.95.2_1
-libUil.so.2 lesstif-0.95.2_1
+libXm.so.4 motif-2.3.8_1
+libMrm.so.4 motif-2.3.8_1
+libUil.so.4 motif-2.3.8_1
 libgtest.so gtest-1.7.0_1
 libgtest_main.so gtest-1.7.0_1
 libxmlsec1-gcrypt.so.1 xmlsec1-1.2.20_2
diff --git a/srcpkgs/motif-demos b/srcpkgs/motif-demos
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-demos
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-devel b/srcpkgs/motif-devel
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-devel
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-mwm b/srcpkgs/motif-mwm
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-mwm
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif-xmbind b/srcpkgs/motif-xmbind
new file mode 120000
index 00000000000..446f9d048ba
--- /dev/null
+++ b/srcpkgs/motif-xmbind
@@ -0,0 +1 @@
+motif
\ No newline at end of file
diff --git a/srcpkgs/motif/patches/02-fix-format-security.patch b/srcpkgs/motif/patches/02-fix-format-security.patch
new file mode 100644
index 00000000000..18c4abdc271
--- /dev/null
+++ b/srcpkgs/motif/patches/02-fix-format-security.patch
@@ -0,0 +1,607 @@
+Description: Fix unsafe uses of fprintf and sprintf
+ prevent 'format not a string literal and no format arguments' errors
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1574
+Author: Graham Inggs <graham@nerve.org.za>
+Last-Update: 2012-12-25
+--- a/lib/Mrm/Mrmhier.c
++++ b/lib/Mrm/Mrmhier.c
+@@ -264,10 +264,10 @@
+ 	    case MrmSUCCESS:
+ 	      break;
+ 	    case MrmNOT_VALID:
+-	      sprintf (err_stg, _MrmMMsg_0113);
++	      sprintf (err_stg, "%s", _MrmMMsg_0113);
+ 	      break;
+ 	    default:
+-	      sprintf (err_stg, _MrmMMsg_0114);
++	      sprintf (err_stg, "%s", _MrmMMsg_0114);
+ 	      break;
+ 	    }
+ 	}
+--- a/lib/Mrm/Mrmicon.c
++++ b/lib/Mrm/Mrmicon.c
+@@ -1176,7 +1176,7 @@
+ 		}
+ 		break;
+ 	      default:
+-		sprintf(err_msg, _MrmMMsg_0040);
++		sprintf(err_msg, "%s", _MrmMMsg_0040);
+ 		return Urm__UT_Error ("Urm__RelizeColorTable",
+ 				      err_msg, NULL, NULL, MrmFAILURE) ;
+ 	      }
+@@ -1252,7 +1252,7 @@
+ 	      break;
+ 	    default:
+ 	      result = MrmFAILURE;
+-	      sprintf (err_msg, _MrmMMsg_0040);
++	      sprintf (err_msg, "%s", _MrmMMsg_0040);
+ 	      Urm__UT_Error ("Urm__RelizeColorTable",
+ 			     err_msg, NULL, NULL, MrmFAILURE) ;
+ 	    }
+--- a/lib/Mrm/Mrmlread.c
++++ b/lib/Mrm/Mrmlread.c
+@@ -698,7 +698,7 @@
+ 	 XBlackPixelOfScreen(XDefaultScreenOfDisplay(display)));
+       break;
+     default:
+-      sprintf(err_msg, _MrmMMsg_0040);
++      sprintf(err_msg, "%s", _MrmMMsg_0040);
+       result = Urm__UT_Error ("MrmFetchColorLiteral",
+ 			      err_msg, NULL, NULL, MrmFAILURE) ;
+       _MrmAppUnlock(app);
+--- a/lib/Mrm/Mrmwcrw.c
++++ b/lib/Mrm/Mrmwcrw.c
+@@ -1390,7 +1390,7 @@
+ 			}
+ 		      break;
+ 		    default:
+-		      sprintf (err_msg, _MrmMMsg_0040);
++		      sprintf (err_msg, "%s", _MrmMMsg_0040);
+ 		      result = Urm__UT_Error ("Urm__CW_ConvertValue",
+ 					      err_msg, NULL, NULL, MrmFAILURE) ;
+ 		    };
+@@ -2426,7 +2426,7 @@
+ 	    }
+ 	  break;
+ 	default:
+-	  sprintf(err_msg, _MrmMMsg_0040);
++	  sprintf(err_msg, "%s", _MrmMMsg_0040);
+ 	  return Urm__UT_Error ("Urm__CW_ConvertValue",
+ 				err_msg, NULL, NULL, MrmFAILURE) ;
+ 	};
+--- a/tools/wml/wmlouth.c
++++ b/tools/wml/wmlouth.c
+@@ -225,12 +225,12 @@
+     printf ("\nCouldn't open UilSymGen.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write the sym_k..._object literals
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
+@@ -244,7 +244,7 @@
+ /*
+  * Define the sym_k_..._reason literals
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_reason_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[ndx].objptr;
+@@ -258,7 +258,7 @@
+ /*
+  * Define the sym_k_..._arg literals
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -272,7 +272,7 @@
+ /*
+  * Define the sym_k_..._enumset structs and literals
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -286,7 +286,7 @@
+ /*
+  * Define the sym_k_..._enumval literals
+  */
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
+     {
+     enumvalobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
+@@ -301,7 +301,7 @@
+  * Define the sym_k_..._charsize literals
+  * Define the sym_k_..._charset literals
+  */
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     charsetobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -315,7 +315,7 @@
+ /*
+  * Define the sym_k_..._child literals
+  */
+-fprintf (outfil, canned8);
++fprintf (outfil, "%s", canned8);
+ for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
+@@ -379,12 +379,12 @@
+     printf ("\nCouldn't open UilSymChCL.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_child_ptr->cnt ; ndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[ndx].objptr;
+@@ -392,7 +392,7 @@
+     fprintf (outfil, "    sym_k_%s_object,\n",
+ 	     classobj->tkname);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -446,12 +446,12 @@
+     printf ("\nCouldn't open UilSymArTy.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -459,7 +459,7 @@
+     fprintf (outfil, "    sym_k_%s_value,\n",
+ 	     datobj->tkname);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -509,19 +509,19 @@
+     printf ("\nCouldn't open UilSymRArg.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Create table entries, similar to writing sym_k...
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+     fprintf (outfil, "    %d,\n",
+ 	     resobj->related_code);
+     }
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -621,12 +621,12 @@
+     printf ("\nCouldn't open UilUrmClas.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write entries for widgets
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_class_ptr->cnt ; ndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ndx].objptr;
+@@ -637,7 +637,7 @@
+     else 
+ 	fprintf (outfil, "  \"%s\",\t\n", synobj->convfunc);
+     }
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ 
+ /*
+  * Write entries for gadget variants of widget classes
+@@ -661,7 +661,7 @@
+ 		     synobj->name);
+ 	}
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * Write entries for non-dialog widgets
+@@ -685,7 +685,7 @@
+ 		     synobj->name);
+ 	}
+     }
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ 
+ /*
+  * Write entries for the resource a widget's controls map to
+@@ -701,7 +701,7 @@
+     else
+ 	fprintf (outfil, "  sym_k_%s_arg,\n", mapresobj->tkname);
+     }
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ 
+ /*
+  * Write entries for arguments
+@@ -714,7 +714,7 @@
+     fprintf (outfil, "  %s,\n",
+ 	     synres->resliteral);
+     }
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ 
+ /*
+  * Write entries for reasons
+@@ -727,7 +727,7 @@
+     fprintf (outfil, "  %s,\n",
+ 	     synres->resliteral);
+     }
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ 
+ /*
+  * close the output file
+@@ -781,13 +781,13 @@
+     printf ("\nCouldn't open UilConst.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Process the arguments in code order. We start with 1, and write out
+  * the mask after processing 8 codes.
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ strcpy (maskbuf, "0");
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+@@ -805,7 +805,7 @@
+     }
+ if ( bitno != 8 )
+     fprintf (outfil, "%s", maskbuf);
+-fprintf (outfil, canned1a);
++fprintf (outfil, "%s", canned1a);
+ 
+ /*
+  * close the output file
+@@ -878,8 +878,8 @@
+     printf ("\nCouldn't open UilSymReas.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the reason code,
+@@ -925,13 +925,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( resndx=0 ; resndx<wml_obj_reason_ptr->cnt ; resndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_reason_ptr->hvec[resndx].objptr;
+     fprintf (outfil, "  reason_class_vec%d,\n", resobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1004,8 +1004,8 @@
+     printf ("\nCouldn't open UilSymArTa.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the argument code,
+@@ -1051,13 +1051,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( resndx=0 ; resndx<wml_obj_arg_ptr->cnt ; resndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[resndx].objptr;
+     fprintf (outfil, "  arg_class_vec%d,\n", resobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1129,8 +1129,8 @@
+     printf ("\nCouldn't open UilSymChTa.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the child code,
+@@ -1174,13 +1174,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( childndx=0 ; childndx<wml_obj_child_ptr->cnt ; childndx++ )
+     {
+     childobj = (WmlChildDefPtr) wml_obj_child_ptr->hvec[childndx].objptr;
+     fprintf (outfil, "  child_class_vec%d,\n", childobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1251,8 +1251,8 @@
+     printf ("\nCouldn't open UilSymCtl.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Generate the bit vectors for each class. Outer loop on the class code,
+@@ -1296,13 +1296,13 @@
+ /*
+  * Write the vector of vectors.
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( ctlndx=0 ; ctlndx<wml_obj_class_ptr->cnt ; ctlndx++ )
+     {
+     clsobj = (WmlClassDefPtr) wml_obj_class_ptr->hvec[ctlndx].objptr;
+     fprintf (outfil, "  object_class_vec%d,\n", clsobj->sym_code);
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -1438,7 +1438,7 @@
+     printf ("\nCouldn't open UilSymNam.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Write entries for widgets
+@@ -1517,7 +1517,7 @@
+     fprintf (outfil, "    \"%s\",\n",
+ 	     synch->name);
+     }
+-fprintf (outfil, canned7);
++fprintf (outfil, "%s", canned7);
+ 
+ /*
+  * close the output file
+@@ -1621,12 +1621,12 @@
+     printf ("\nCouldn't open UilSymEnum.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Generate the enumeration value vectors for each enumeration set.
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -1643,7 +1643,7 @@
+ /*
+  * Generate the enumeration set tables
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_enumset_ptr->cnt ; ndx++ )
+     {
+     enumsetobj = (WmlEnumSetDefPtr) wml_obj_enumset_ptr->hvec[ndx].objptr;
+@@ -1655,7 +1655,7 @@
+ /*
+  * Create enumset table entries for arguments, similar to writing sym_k...
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_arg_ptr->cnt ; ndx++ )
+     {
+     resobj = (WmlResourceDefPtr) wml_obj_arg_ptr->hvec[ndx].objptr;
+@@ -1669,13 +1669,13 @@
+ /*
+  * Create the enumval values table.
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ for ( ndx=0 ; ndx<wml_obj_enumval_ptr->cnt ; ndx++ )
+     {
+     evobj = (WmlEnumValueDefPtr) wml_obj_enumval_ptr->hvec[ndx].objptr;
+     fprintf (outfil, "  %s,\n", evobj->syndef->enumlit);
+     }
+-fprintf (outfil, canned5a);
++fprintf (outfil, "%s", canned5a);
+ 
+ /*
+  * close the output file
+@@ -1813,12 +1813,12 @@
+     printf ("\nCouldn't open UilSymCSet.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Generate the standards name table
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1836,7 +1836,7 @@
+ /*
+  * Generate the writing direction table
+  */
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1858,7 +1858,7 @@
+ /*
+  * Generate the parsing direction table
+  */
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1880,7 +1880,7 @@
+ /*
+  * Generate the character size table
+  */
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+@@ -1906,7 +1906,7 @@
+ /*
+  * Generate the $LANG name recognition table
+  */
+-fprintf (outfil, canned5);
++fprintf (outfil, "%s", canned5);
+ lang_max = 0;
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+@@ -1936,7 +1936,7 @@
+ /*
+  * Generate the $LANG code lookup table, in upper case
+  */
+-fprintf (outfil, canned6);
++fprintf (outfil, "%s", canned6);
+ for ( ndx=0 ; ndx<wml_obj_charset_ptr->cnt ; ndx++ )
+     {
+     csobj = (WmlCharSetDefPtr) wml_obj_charset_ptr->hvec[ndx].objptr;
+--- a/tools/wml/wmloutkey.c
++++ b/tools/wml/wmloutkey.c
+@@ -574,16 +574,16 @@
+     printf ("\nCouldn't open UilKeyTab.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
++fprintf (outfil, "%s", canned_warn);
+ 
+ /*
+  * Print the case sensitive and insensitive tables
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ wmlOutputUilKeyTabBody (outfil, wml_tok_sens_ptr, &maxlen, &maxkey);
+ fprintf (outfil, canned2, maxlen, maxkey);
+ wmlOutputUilKeyTabBody (outfil, wml_tok_insens_ptr, &maxlen, &maxkey);
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * close the output file
+@@ -812,8 +812,8 @@
+     printf ("\nCouldn't open UilTokName.h");
+     return;
+     }
+-fprintf (outfil, canned_warn);
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned_warn);
++fprintf (outfil, "%s", canned1);
+ 
+ /*
+  * Print the token name entries
+--- a/tools/wml/wmloutmm.c
++++ b/tools/wml/wmloutmm.c
+@@ -209,9 +209,9 @@
+ /*
+  * Write out header information
+  */
+-fprintf (outfil, canned1);
++fprintf (outfil, "%s", canned1);
+ fprintf (outfil, "%s\n", name);
+-fprintf (outfil, canned2);
++fprintf (outfil, "%s", canned2);
+ 
+ /*
+  * Alphabetize the controls, reason, and argument lists
+@@ -287,7 +287,7 @@
+     else
+ 	fprintf (outfil, "\n");
+     }
+-fprintf (outfil, canned3);
++fprintf (outfil, "%s", canned3);
+ 
+ /*
+  * Write out the argument table
+@@ -323,7 +323,7 @@
+     }    
+     argndx += 1;
+     }
+-fprintf (outfil, canned4);
++fprintf (outfil, "%s", canned4);
+ 
+ }
+ 
diff --git a/srcpkgs/motif/patches/03-no-demos.patch b/srcpkgs/motif/patches/03-no-demos.patch
new file mode 100644
index 00000000000..03953c4f8f7
--- /dev/null
+++ b/srcpkgs/motif/patches/03-no-demos.patch
@@ -0,0 +1,53 @@
+Description: Add option to disable building of demos
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1575
+Author: Graham Inggs <graham@nerve.org.za>
+Last-Update: 2013-01-09
+--- a/configure.ac
++++ b/configure.ac
+@@ -311,7 +311,20 @@
+ doc/man/man5/Makefile \
+ tools/Makefile \
+ tools/wml/Makefile \
+-demos/Makefile \
++lib/Xm/xmstring.list \
++])
++
++AC_ARG_ENABLE(demos, [  --disable-demos
++                       Disable building demos])
++
++if test x$enable_demos = x
++then
++    enable_demos="yes"
++fi
++
++if test "$enable_demos" = "yes"
++then
++  AC_CONFIG_FILES([demos/Makefile
+ demos/lib/Makefile \
+ demos/lib/Xmd/Makefile \
+ demos/lib/Wsm/Makefile \
+@@ -395,6 +408,11 @@
+ demos/doc/programGuide/ch17/Makefile \
+ demos/doc/programGuide/ch17/simple_drop/Makefile \
+ demos/doc/programGuide/ch17/simple_drag/Makefile \
+-lib/Xm/xmstring.list \
+-])
++  ])
++  MAYBE_DEMOS=demos
++else
++  MAYBE_DEMOS=
++fi
++AC_SUBST(MAYBE_DEMOS)
++
+ AC_OUTPUT
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -29,6 +29,7 @@
+              tools \
+              clients \
+              doc \
+-             demos
++             $(MAYBE_DEMOS)
++
+ AUTOMAKE_OPTIONS = 1.4
+ ACLOCAL_AMFLAGS = -I .
diff --git a/srcpkgs/motif/patches/06-cast-size_t-to-int.patch b/srcpkgs/motif/patches/06-cast-size_t-to-int.patch
new file mode 100644
index 00000000000..b5ce9c643a7
--- /dev/null
+++ b/srcpkgs/motif/patches/06-cast-size_t-to-int.patch
@@ -0,0 +1,17 @@
+Description: To prevent build failure during building with Hardening options
+ enabled due to "format '%d' expects argument of type 'int', but argument 5 has
+ type 'size_t'", the fifth argument is cast to integer on the input.
+Author: Paul Gevers <elbrus@debian.org>
+Updated: 13-01-2013
+
+--- a/tools/wml/wmloutkey.c
++++ b/tools/wml/wmloutkey.c
+@@ -627,7 +627,7 @@
+     fprintf (outfil, "    {%s, %s, %d, %s, \"%s\"},\n",
+ 	     tkclass,
+ 	     tksym,
+-	     strlen(tokstg),
++	     (int)strlen(tokstg),
+ 	     tktoken,
+ 	     tokstg);
+     if ( (int)strlen(tokstg) > *maxlen )
diff --git a/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch b/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
new file mode 100644
index 00000000000..5ddfd760075
--- /dev/null
+++ b/srcpkgs/motif/patches/07-fix_lintian_reported_manpage_typos.patch
@@ -0,0 +1,118 @@
+Description: lintian reports several typos in manpages. This patch fixes those
+ reported
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1587
+Last-reviewed: 14 Jan 2013
+
+--- a/doc/man/man1/mwm.1
++++ b/doc/man/man1/mwm.1
+@@ -359,7 +359,7 @@
+ (and other associated messages) by saving the geometries of its clients to a state file\&. 
+ \fBmwm\fP can then be restarted by the XSMP session manager\&.
+ The default location for the state file is \fB$HOME/\&.mwmclientdb\fP\&.
+-This location can be overriden with the resource \fBsessionClientDB\fP\&.
++This location can be overridden with the resource \fBsessionClientDB\fP\&.
+ .SS "X Resources"
+ .PP
+ The \fBmwm\fP command is configured from its resource
+--- a/doc/man/man3/VendorShell.3
++++ b/doc/man/man3/VendorShell.3
+@@ -76,7 +76,7 @@
+ to the VendorShell resources for controlling toolTips. VendorShell displays
+ the XmNtooTipString in an XmLabel that is a child of a transientShell. The name
+ of the transientShell is TipShell, and the name of the XmLabel is TipLabel.
+-The appearance of the tip can be controlled by specifing resources on these
++The appearance of the tip can be controlled by specifying resources on these
+ widgets.
+ .PP
+ If an application uses the \fBXmNmwmDecorations\fP,
+--- a/doc/man/man3/XmComboBox.3
++++ b/doc/man/man3/XmComboBox.3
+@@ -581,7 +581,7 @@
+ ComboBox \fBXmNcomboBoxType\fP is
+ \fBXmDROP_DOWN_LIST\fP,
+ \fB<osfActivate>\fP, \fB<osfCancel>\fP, and
+-\fBReturn\fP are overriden by ComboBox actions\&.
++\fBReturn\fP are overridden by ComboBox actions\&.
+ .IP "\fB:c\fP <Key>\fB<osfDown>\fP:" 10
+ CBDropDownList()
+ .IP "\fB:c\fP <Key>\fB<osfUp>\fP:" 10
+--- a/doc/man/man3/XmGetPixmap.3
++++ b/doc/man/man3/XmGetPixmap.3
+@@ -109,7 +109,7 @@
+ In addition to X bitmap files (XBM), Motif also supports XPM (X
+ Pixmap) file formats and, from version 2.3, JPEG and PNG image formats\&.
+ (Note that support of JPEG and PNG image format is an optional feature
+-of Motif, in order to check if current version supports PNG ang JPEG
++of Motif, in order to check if current version supports PNG and JPEG
+ image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked
+ correspondingly.)
+ The \fBXBMLANGPATH\fP specifies the path for
+--- a/doc/man/man3/XmGetPixmapByDepth.3
++++ b/doc/man/man3/XmGetPixmapByDepth.3
+@@ -111,7 +111,7 @@
+ In addition to X bitmap files (XBM), Motif also supports XPM (X
+ Pixmap) file formats, and, from version 2.3, JPEG and PNG image formats\&.
+ (Note that support of JPEG and PNG image format is an optional feature
+-of Motif, in order to check if current version supports PNG ang JPEG
++of Motif, in order to check if current version supports PNG and JPEG
+ image formats the PNG_SUPPORT and JPEG_SUPPORT macros should be checked
+ correspondingly.)
+ The \fBXBMLANGPATH\fP specifies the path for
+--- a/doc/man/man3/XmHierarchyGetChildNodes.3
++++ b/doc/man/man3/XmHierarchyGetChildNodes.3
+@@ -69,8 +69,8 @@
+ \fBXmHierarchy\fP(3)\&.
+ .SH "RETURN"
+ .PP
+-Returns WidgetList with child nodes of the hierachy, or NULL
+-if the hierachy contains no children\&.
++Returns WidgetList with child nodes of the hierarchy, or NULL
++if the hierarchy contains no children\&.
+ .SH "RELATED"
+ .PP
+ \fBXmHierarchy\fP(3)\&.
+--- a/doc/man/man3/XmManager.3
++++ b/doc/man/man3/XmManager.3
+@@ -502,7 +502,7 @@
+ Indicates whether the posting process should continue\&. The
+ application may modify this field\&.
+ .IP "\fItarget\fP" 10
+-Specifies the most specific widget or gadget that the menu sytem found
++Specifies the most specific widget or gadget that the menu system found
+ from the event that matches the event\&.
+ .SS "Translations"
+ .PP
+--- a/doc/man/man3/XmPrimitive.3
++++ b/doc/man/man3/XmPrimitive.3
+@@ -609,7 +609,7 @@
+ Indicates whether the posting process should continue\&. The
+ application may modify this field\&.
+ .IP "\fItarget\fP" 10
+-Specifies the most specific widget or gadget that the menu sytem found
++Specifies the most specific widget or gadget that the menu system found
+ from the event that matches the event\&.
+ .SS "Translations"
+ .PP
+--- a/doc/man/man3/XmRendition.3
++++ b/doc/man/man3/XmRendition.3
+@@ -71,7 +71,7 @@
+ If a resource in a rendition is unspecified, usually by setting it to
+ \fBXmAS_IS\fP or \fBXmUNSPECIFIED_PIXEL\fP,
+ then the value to be used for that resource is the value of the
+-immediately preceeding rendition in \fBXmString\fR\&. If that value
++immediately preceding rendition in \fBXmString\fR\&. If that value
+ is unspecified, then the preceding value is used, and so on\&. If
+ no renditions specify a value for a resource, then a default value
+ will be used\&.
+--- a/doc/man/man3/XmStringGetNextComponent.3
++++ b/doc/man/man3/XmStringGetNextComponent.3
+@@ -111,7 +111,7 @@
+ \fBXmSTRING_COMPONENT_UNKNOWN\fP\&. The data returned by these
+ components is returned in the \fIunknown_tag\fP, \fIunknown_length\fP,
+ and \fIunknown_value\fP fields\&. This apparent inconsistency is
+-designed to accomodate older applications that may not be equipped to
++designed to accommodate older applications that may not be equipped to
+ handle the newer component types of Motif version 2\&.0 and beyond\&.
+ Consequently, the use of this procedure is not recommended\&. Instead,
+ use the \fBXmStringGetNextTriple\fP procedure, which provides all the
diff --git a/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch b/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
new file mode 100644
index 00000000000..bc1beb029cd
--- /dev/null
+++ b/srcpkgs/motif/patches/08-fix_hyphen_in_man_pages.patch
@@ -0,0 +1,156 @@
+Description: lintian reports hyphen misuse in manpages. This patch fixes those
+ reported.
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1588
+Last-reviewed: 06 Feb 2013
+
+--- a/doc/man/man1/mwm.1
++++ b/doc/man/man1/mwm.1
+@@ -904,7 +904,7 @@
+ resizeCursors\aResizeCursors\aT/F\aT
+ transientDecoration\aTransientDecoration\astring\amenu title
+ transientFunctions\aTransientFunctions\astring\aT{
+--minimize-maximize
++\-minimize-maximize
+ T}
+ useIconBox\aUseIconBox\aT/F\aF
+ .TE
+@@ -941,7 +941,7 @@
+ screen size of the icon box window depends on the iconImageMaximum (size)
+ and \fIiconDecoration\fP resources\&. The default value for size
+ is (6 * iconWidth + padding) wide by (1 * iconHeight + padding) high\&. The
+-default value of the location is +0 -0\&.
++default value of the location is +0 \-0\&.
+ .IP "\fIiconBoxName\fP\ (class\  \fIIconBoxName\fP)" 10
+ This resource specifies the name that is used to look up icon box resources\&.
+ The default name is iconbox\&.
+@@ -1059,7 +1059,7 @@
+ This resource is used to indicate which window management functions
+ are applicable (or not applicable) to transient windows\&. The function specification
+ is exactly the same as for the \fIclientFunctions\fP (client
+-specific) resource\&. The default value for this resource is -minimize -maximize\&.
++specific) resource\&. The default value for this resource is \-minimize \-maximize\&.
+ .IP "" 10
+ An application can also specify which functions \fBmwm\fP
+ should apply to its windows\&. If it does so, \fBmwm\fP applies
+@@ -1176,7 +1176,7 @@
+ title\aTitle bar (includes border)\&.
+ .TE
+ .PP
+-Examples: \fIMwm*XClock\&.clientDecoration: -resizeh -maximize\fP This removes the resize handles and maximize button from XClock
++Examples: \fIMwm*XClock\&.clientDecoration: \-resizeh \-maximize\fP This removes the resize handles and maximize button from XClock
+ windows\&. \fIMwm*XClock\&.clientDecoration: menu minimize border\fP This does the same thing as above\&. Note that either \fImenu\fP or \fIminimize\fP implies
+ \fItitle\fP\&.
+ .IP "\fIclientFunctions\fP\ (class\  \fIClientFunctions\fP)" 10
+--- a/doc/man/man4/mwmrc.4
++++ b/doc/man/man4/mwmrc.4
+@@ -84,7 +84,7 @@
+ be specified from the command line:
+ .PP
+ .nf
+-\f(CW/usr/X11R6/bin/X11/mwm -xrm "mwm*configFile: mymwmrc"\fR
++\f(CW/usr/X11R6/bin/X11/mwm \-xrm "mwm*configFile: mymwmrc"\fR
+ .fi
+ .PP
+ .SS "Resource Types"
+--- a/doc/man/man3/XmFontList.3
++++ b/doc/man/man3/XmFontList.3
+@@ -119,7 +119,7 @@
+ without a font list entry tag;
+ .PP
+ .nf
+-\f(CW*fontList:  -Adobe-Times-Medium-I-Normal--10*\fR
++\f(CW*fontList:  \-Adobe\-Times\-Medium\-I\-Normal\-\-10*\fR
+ .fi
+ .PP
+ .PP
+@@ -138,9 +138,9 @@
+ and an explicit font list entry tag\&.
+ .PP
+ .nf
+-\f(CW*fontList: -Adobe-Courier-Bold-R-Normal--25-180-100-100-M-150;\
+--JIS-Fixed-Medium-R-Normal--26-180-100-100-C-240;\
+--JIS-Fixed-Medium-R-Normal--26-180-100-100-C-120:MY_TAG\fR
++\f(CW*fontList: \-Adobe\-Courier\-Bold\-R\-Normal\-\-25\-180\-100\-100\-M\-150;\
++\-JIS\-Fixed\-Medium\-R\-Normal\-\-26\-180\-100\-100\-C\-240;\
++\-JIS\-Fixed\-Medium\-R\-Normal\-\-26\-180\-100\-100\-C\-120:MY_TAG\fR
+ .fi
+ .PP
+ .PP
+--- a/doc/man/man3/XmGetPixmapByDepth.3
++++ b/doc/man/man3/XmGetPixmapByDepth.3
+@@ -245,8 +245,8 @@
+ \f(CW/* XBM file */
+ #define plaid_width 22
+ #define plaid_height 22
+-#define plaid_x_hot -1
+-#define plaid_y_hot -1
++#define plaid_x_hot \-1
++#define plaid_y_hot \-1
+ static char plaid_bits[] = {
+    0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
+    0x75, 0xfd, 0x3f, 0xff, 0x57, 0x15, 0x75, 0xfd, 0x3f, 0xaa, 0xfa, 0x3e,
+--- a/doc/man/man3/XmList.3
++++ b/doc/man/man3/XmList.3
+@@ -182,7 +182,7 @@
+ A value of 1 transfers the first item in the List; a value of 2
+ transfers the second item; and so on\&.
+ If the entire contents of the List are being transferred, the value is
+--1\&.
++\-1\&.
+ .PP
+ As a source of data, List supports the following targets and associated
+ conversions of data to these targets:
+--- a/doc/man/man3/XmScreen.3
++++ b/doc/man/man3/XmScreen.3
+@@ -300,7 +300,7 @@
+ startup time, either by placing it within a defaults file or by using the
+ \fB-xrm\fP command line argument\&. For example:
+ .IP "" 10
+-\fBmyProg -xrm "*menuCursor: arrow"\fP
++\fBmyProg \-xrm "*menuCursor: arrow"\fP
+ .IP "" 10
+ The menu cursor can also be selected in the program through
+ the function \fBXmSetMenuCursor\fP\&.
+--- a/doc/man/man3/XmTabListCopy.3
++++ b/doc/man/man3/XmTabListCopy.3
+@@ -71,7 +71,7 @@
+ Specifies where to start copying\&. A value of 0 (zero) indicates begin
+ at the beginning, a value of 1 indicates to skip the first tab, and so
+ on\&. A negative indicates to begin counting backwards from the end\&.
+-A value of -1 indicates to start copying from the last tab\&.
++A value of \-1 indicates to start copying from the last tab\&.
+ .IP "\fIcount\fP" 10
+ Specifies the number of tabs to copy\&. A value of 0 (zero) indicates
+ to copy all elements from the starting point to the end (beginning if
+--- a/doc/man/man3/XmTabListInsertTabs.3
++++ b/doc/man/man3/XmTabListInsertTabs.3
+@@ -83,7 +83,7 @@
+ value of 1 makes it the second tab, and so on\&. If \fIposition\fP is
+ greater than the number of tabs in \fIoldlist\fP, then the tabs will
+ be inserted at the end\&. If \fIposition\fP is negative, the count will
+-be backwards from the end\&. A value of -1 makes the first new tab
++be backwards from the end\&. A value of \-1 makes the first new tab
+ the last tab, and so on\&.
+ .SH "RETURN"
+ .PP
+--- a/doc/man/man5/UIL.5
++++ b/doc/man/man5/UIL.5
+@@ -1211,7 +1211,7 @@
+ 3\&.1415E-2 (equals \&.031415)
+ T}\a2\&.87 e6 (embedded blanks)
+ T{
+--6\&.29e7 (equals -62900000)
++\-6\&.29e7 (equals \-62900000)
+ T}\a2\&.0e100 (out of range)
+ .TE
+ .PP
+@@ -1322,7 +1322,7 @@
+ You can use parentheses to override the normal precedence of operators\&.
+ In a sequence of unary operators, the operations are performed in
+ right-to-left
+-order\&. For example, \fB- + -A\fP is equivalent to \fB-(+(-A))\fP\&.
++order\&. For example, \fB- + \-A\fP is equivalent to \fB\-(+(\-A))\fP\&.
+ In a sequence of binary operators of the same precedence, the operations
+ are performed in left-to-right order\&. For example, \fBA*B/C*D\fP is
+ equivalent to \fB((A*B)/C)*D\fP\&.
diff --git a/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch b/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
new file mode 100644
index 00000000000..90d39a3f0c0
--- /dev/null
+++ b/srcpkgs/motif/patches/09-fix_typo_in_libxm.patch
@@ -0,0 +1,25 @@
+Description: lintian reports a typo in libXm. This patch fixes it.
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1589
+Last-reviewed: 06 Feb 2013
+
+--- a/lib/Xm/FontS.c
++++ b/lib/Xm/FontS.c
+@@ -1225,7 +1225,7 @@
+ 
+     if ((fontdata = XLoadQueryFont(XtDisplay((Widget) fsw), font)) == NULL)
+     {
+-	sprintf(buf, "Font '%s'\nis not availiable on this machine", font);
++	sprintf(buf, "Font '%s'\nis not available on this machine", font);
+ 	DisplayUserError(fsw, buf);
+ 	err = True;
+     }
+@@ -1275,7 +1275,7 @@
+ 					   fbuf)) == NULL) 
+ 	    {
+ 		sprintf(buf,
+-			    "Font '%s'\nis not availiable on this machine",
++			    "Font '%s'\nis not available on this machine",
+ 			    font);
+ 		DisplayUserError(fsw, buf);
+ 		    err = True;
diff --git a/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch b/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
new file mode 100644
index 00000000000..cf51d1fa3d4
--- /dev/null
+++ b/srcpkgs/motif/patches/10-fix_manpage-has-bad-whatis-entry.patch
@@ -0,0 +1,49 @@
+Description: lintian reports bad whatis entries in manpages. Fixing here
+Author: Paul Gevers <elbrus@debian.org>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1590
+Last-reviewed: 17 Feb 2013
+
+--- a/doc/man/man3/XmColorSelector.3
++++ b/doc/man/man3/XmColorSelector.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmColorSelector 3X ""
+ .SH NAME
+-The Color Selector widget
++XmColorSelector \- The Color Selector widget
+ .SH SYNOPSIS
+ #include <Xm/ColorS.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmExt18List.3
++++ b/doc/man/man3/XmExt18List.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XxExt18LIst 3x ""
+ .SH NAME
+-The Internationalized Extended List widget
++XmExt18List \- The Internationalized Extended List widget
+ .SH SYNOPSIS
+ #include <Xm/Ext18List.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmFontSelector.3
++++ b/doc/man/man3/XmFontSelector.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmFontSelector 3X ""
+ .SH NAME
+-The Font Selector widget
++XmFontSelector \- The Font Selector widget
+ .SH SYNOPSIS
+ #include <Xm/FontS.h>
+ .SH DESCRIPTION
+--- a/doc/man/man3/XmIconButton.3
++++ b/doc/man/man3/XmIconButton.3
+@@ -1,7 +1,7 @@
+ .DT
+ .TH XmIconButton 3X "15 July 1992"
+ .SH NAME
+-The Icon Button widget
++XmIconButton \- The Icon Button widget
+ .SH SYNOPSIS
+ Documents the XmIconButton widget
+ .SH DESCRIPTION
diff --git a/srcpkgs/motif/patches/11-fix_underlinking.patch b/srcpkgs/motif/patches/11-fix_underlinking.patch
new file mode 100644
index 00000000000..601b0918632
--- /dev/null
+++ b/srcpkgs/motif/patches/11-fix_underlinking.patch
@@ -0,0 +1,564 @@
+Description: Fix underlinking of libXt, libXext and libX11
+ Recent changes to default linker behaviour prevent shared libraries from being
+ indirectly linked, resulting in FTBFS in Ubuntu Raring.
+ .
+ This patch fixes this by explicitly linking libXt, libXext and libX11 wherever
+ necessary.  Demos are patched even though they are not built for distribution.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1583
+Last-Update: 2013-02-26
+--- a/clients/mwm/Makefile.am
++++ b/clients/mwm/Makefile.am
+@@ -9,7 +9,7 @@
+ rc_DATA = system.mwmrc
+ 
+ bin_PROGRAMS = mwm
+-mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la 
++mwm_LDADD = ./WmWsmLib/libWsm.a ../../lib/Xm/libXm.la -lXt -lXext -lX11
+ 
+ INCLUDES = -DLARGECURSORS -DR2_COMPAT -DUNMAP_ON_RESTART \
+            -DCDE_INSTALLATION_TOP=\"@CDE_INSTALLATION_TOP@\" \
+--- a/clients/uil/Makefile.am
++++ b/clients/uil/Makefile.am
+@@ -11,9 +11,9 @@
+ UilParser.lo: UilParser.c
+ 	$(LTCOMPILE) -DCALLABLE -c UilParser.c
+ 
+-libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la 
++libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+-uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la 
++uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
+--- a/clients/xmbind/Makefile.am
++++ b/clients/xmbind/Makefile.am
+@@ -2,6 +2,6 @@
+ 
+ bin_PROGRAMS = xmbind
+ 
+-LDADD = ../../lib/Xm/libXm.la
++LDADD = ../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS}
+--- a/demos/doc/programGuide/ch05/Scale/Makefile.am
++++ b/demos/doc/programGuide/ch05/Scale/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch06/combo_box/Makefile.am
++++ b/demos/doc/programGuide/ch06/combo_box/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch06/spin_box/Makefile.am
++++ b/demos/doc/programGuide/ch06/spin_box/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch08/Container/Makefile.am
++++ b/demos/doc/programGuide/ch08/Container/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch08/Notebook/Makefile.am
++++ b/demos/doc/programGuide/ch08/Notebook/Makefile.am
+@@ -8,4 +8,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch16/Makefile.am
++++ b/demos/doc/programGuide/ch16/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch17/simple_drag/Makefile.am
++++ b/demos/doc/programGuide/ch17/simple_drag/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/doc/programGuide/ch17/simple_drop/Makefile.am
++++ b/demos/doc/programGuide/ch17/simple_drop/Makefile.am
+@@ -9,4 +9,4 @@
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(top_srcdir)/lib -I$(top_srcdir)/demos/lib $(X_CFLAGS)
+ 
+-LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la
++LDADD = -L$(top_builddir)/demos/lib/Xmd -lXmd $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+--- a/demos/lib/Exm/wml/Makefile.am
++++ b/demos/lib/Exm/wml/Makefile.am
+@@ -18,7 +18,7 @@
+ 	-I$(top_builddir)/clients/uil \
+ 	${X_CFLAGS} 
+ 
+-LDADD = $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Xm/libXm.la -lXt
+ 
+ DISTCLEANFILES = motif.wmd
+ 
+--- a/demos/lib/Xmd/Makefile.am
++++ b/demos/lib/Xmd/Makefile.am
+@@ -12,7 +12,7 @@
+ Print.h PrintP.h \
+ RegEdit.h RegEditI.h
+ 
+-LDADD = libXmd.a ../../../lib/Xm/libXm.la
++LDADD = libXmd.a ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(top_builddir)/lib -I$(srcdir)/../../../lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/ButtonBox/Makefile.am
++++ b/demos/programs/ButtonBox/Makefile.am
+@@ -8,6 +8,6 @@
+ bboxdemo_SOURCES = bboxdemo.c
+ data_DATA = $(EXTRA_DIST) $(bboxdemo_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/ColorSel/Makefile.am
++++ b/demos/programs/ColorSel/Makefile.am
+@@ -7,6 +7,6 @@
+ colordemo_SOURCES = util-c.c colordemo.c
+ EXTRA_DIST = Imakefile
+ data_DATA = $(colordemo_SOURCES) $(EXTRA_DIST)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Column/Makefile.am
++++ b/demos/programs/Column/Makefile.am
+@@ -8,5 +8,5 @@
+ EXTRA_DIST = Imakefile Column.ad
+ data_DATA = $(EXTRA_DIST) $(column_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Combo2/Makefile.am
++++ b/demos/programs/Combo2/Makefile.am
+@@ -8,5 +8,5 @@
+ combo_SOURCES = combo.c
+ data_DATA = $(EXTRA_DIST) $(combo_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Exm/app_in_c/Makefile.am
++++ b/demos/programs/Exm/app_in_c/Makefile.am
+@@ -14,4 +14,4 @@
+            -I$(top_builddir)/lib \
+             ${X_CFLAGS} 
+ LDADD = ../../../lib/Exm/libExm.a \
+-	../../../../lib/Xm/libXm.la
++	../../../../lib/Xm/libXm.la -lXt -lXext -lX11
+--- a/demos/programs/Exm/simple_app/Makefile.am
++++ b/demos/programs/Exm/simple_app/Makefile.am
+@@ -14,5 +14,6 @@
+            -I$(srcdir)/../../../lib \
+            -I$(top_builddir)/lib \
+            ${X_CFLAGS} 
+-LDADD = ../../../../lib/Xm/libXm.la \
+-        ../../../lib/Exm/libExm.a
++LDADD = ../../../lib/Exm/libExm.a \
++        ../../../../lib/Xm/libXm.la -lXt -lX11
++
+--- a/demos/programs/Ext18List/Makefile.am
++++ b/demos/programs/Ext18List/Makefile.am
+@@ -10,6 +10,6 @@
+ EXTRA_DIST = Imakefile
+ data_DATA = $(EXTRA_DIST) $(ext18list_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/FontSel/Makefile.am
++++ b/demos/programs/FontSel/Makefile.am
+@@ -7,6 +7,6 @@
+ fontsel_SOURCES = callbacks-c.c creation-c.c fontsel.c fontsel.h
+ EXTRA_DIST = Imakefile
+ data_DATA = $(EXTRA_DIST) $(fontsel_SOURCES)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/IconB/Makefile.am
++++ b/demos/programs/IconB/Makefile.am
+@@ -8,7 +8,7 @@
+ iconbuttondemo_SOURCES = misc.c  iconbuttondemo.c
+ data_DATA = $(iconbuttondemo_SOURCES) $(EXTRA_DIST)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. \
+            -I$(srcdir)/$(TOPDIR)/lib \
+--- a/demos/programs/Outline/Makefile.am
++++ b/demos/programs/Outline/Makefile.am
+@@ -7,6 +7,6 @@
+ bin_PROGRAMS = outline
+ outline_SOURCES = outline.c
+ data_DATA = $(outline_SOURCES) $(EXTRA_DIST)
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ TOPDIR = ../../..
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Paned/Makefile.am
++++ b/demos/programs/Paned/Makefile.am
+@@ -8,6 +8,6 @@
+ paned_SOURCES = creation-c.c paned.c
+ data_DATA = $(EXTRA_DIST) $(paned_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/TabStack/Makefile.am
++++ b/demos/programs/TabStack/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = Imakefile
+ data_DATA = $(tabstack_SOURCES) $(EXTRA_DIST)            
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/Tree/Makefile.am
++++ b/demos/programs/Tree/Makefile.am
+@@ -8,6 +8,6 @@
+ tree_SOURCES = bxutil-c.c  tree.c
+ data_DATA = $(EXTRA_DIST) $(tree_SOURCES)
+ TOPDIR = ../../..
+-LDADD = $(TOPDIR)/lib/Xm/libXm.la
++LDADD = $(TOPDIR)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(TOPDIR)/lib -I$(srcdir)/.. -I$(srcdir)/$(TOPDIR)/lib ${X_CFLAGS} 
+--- a/demos/programs/airport/Makefile.am
++++ b/demos/programs/airport/Makefile.am
+@@ -8,5 +8,5 @@
+                   dragsource.h dropsite.h main.h
+ EXTRA_DIST = Imakefile XmdAirport.ad README
+ data_DATA = $(airport_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/animate/Makefile.am
++++ b/demos/programs/animate/Makefile.am
+@@ -17,7 +17,7 @@
+ 
+ bin_PROGRAMS = xmanimate
+ 
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Mrm/libMrm.la ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib \
+            -I$(srcdir)/../../lib \
+--- a/demos/programs/drag_and_drop/Makefile.am
++++ b/demos/programs/drag_and_drop/Makefile.am
+@@ -10,6 +10,6 @@
+ simpledrop_SOURCES = simpledrop.c
+ data_DATA = $(EXTRA_DIST) $(DNDDemo_SOURCES) $(simpledrop_SOURCES)
+ noinst_HEADERS = DNDDemo.h
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/draw/Makefile.am
++++ b/demos/programs/draw/Makefile.am
+@@ -7,5 +7,5 @@
+ draw_SOURCES = draw.c
+ EXTRA_DIST = Imakefile XmdDraw.ad README draw.help draw.man
+ data_DATA = $(EXTRA_DIST) $(draw_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/earth/Makefile.am
++++ b/demos/programs/earth/Makefile.am
+@@ -7,5 +7,5 @@
+ earth_SOURCES = earth.c
+ EXTRA_DIST = terre.xbm earth.man Imakefile README
+ data_DATA = $(EXTRA_DIST) $(earth_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lXext -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/filemanager/Makefile.am
++++ b/demos/programs/filemanager/Makefile.am
+@@ -11,7 +11,7 @@
+            obj.xpm pix.xpm s_dir.xpm s_exec.xpm s_file.xpm \
+            s_none.xpm s_pix.xpm
+ data_DATA = $(EXTRA_DIST) $(filemanager_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+ 
+--- a/demos/programs/fileview/Makefile.am
++++ b/demos/programs/fileview/Makefile.am
+@@ -11,7 +11,7 @@
+ 
+ UILS= French.uil German.uil English.uil
+ 
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/getsubres/Makefile.am
++++ b/demos/programs/getsubres/Makefile.am
+@@ -7,5 +7,5 @@
+ EXTRA_DIST = getsubres.help getsubres.man README Imakefile
+ getsubres_SOURCES = getsubres.c
+ data_DATA = $(EXTRA_DIST) $(getsubres_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/hellomotif/Makefile.am
++++ b/demos/programs/hellomotif/Makefile.am
+@@ -7,7 +7,7 @@
+ EXTRA_DIST = hellomotif.uil Imakefile README
+ hellomotif_SOURCES = hellomotif.c
+ data_DATA = $(EXTRA_DIST) $(hellomotif_SOURCES) hellomotif.uid
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+ all: hellomotif.uid
+--- a/demos/programs/hellomotifi18n/Makefile.am
++++ b/demos/programs/hellomotifi18n/Makefile.am
+@@ -12,7 +12,7 @@
+ helloint_DEPENDENCIES = helloint.uid C/uid/l_strings.uid english/uid/l_strings.uid french/uid/l_strings.uid hebrew/uid/l_strings.uid japan/uid/l_strings.uid japanese/uid/l_strings.uid swedish/uid/l_strings.uid
+ 
+ INCLUDES = -I$(top_srcdir)/lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la -lXt
+ 
+ SUFFIXES = .uil .uid
+ 
+--- a/demos/programs/i18ninput/Makefile.am
++++ b/demos/programs/i18ninput/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = XmdI18nInput.ad README i18ninput.man i18ninput.help \
+              Imakefile
+ data_DATA = $(EXTRA_DIST) $(i18ninput_SOURCES)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/panner/Makefile.am
++++ b/demos/programs/panner/Makefile.am
+@@ -7,5 +7,5 @@
+ panner_SOURCES = panner.c
+ EXTRA_DIST = README panner.man Imakefile
+ data_DATA = $(EXTRA_DIST) $(panner_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/periodic/Makefile.am
++++ b/demos/programs/periodic/Makefile.am
+@@ -7,7 +7,7 @@
+ EXTRA_DIST = periodic.uil periodic_l.uil XmdPeriodic.ad Imakefile README
+ periodic_SOURCES = periodic.c
+ data_DATA = $(EXTRA_DIST) $(periodic_SOURCES) periodic.uid
+-LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la
++LDADD = ../../../lib/Xm/libXm.la ../../../lib/Mrm/libMrm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/programs/piano/Makefile.am
++++ b/demos/programs/piano/Makefile.am
+@@ -8,6 +8,6 @@
+ EXTRA_DIST = piano.images README Inv8_part1.piano Inv8_part2.piano \
+              piano.man Imakefile
+ data_DATA  = $(EXTRA_DIST) $(piano_SOURCES) 
+-LDADD = ../../../lib/Xm/libXm.la -lm
++LDADD = ../../../lib/Xm/libXm.la -lm -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/popups/Makefile.am
++++ b/demos/programs/popups/Makefile.am
+@@ -7,6 +7,6 @@
+ autopopups_SOURCES = autopopups.c
+ EXTRA_DIST = README autopopups.man Imakefile
+ data_DATA = $(EXTRA_DIST) $(autopopups_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/sampler2_0/Makefile.am
++++ b/demos/programs/sampler2_0/Makefile.am
+@@ -10,6 +10,6 @@
+ bin_PROGRAMS = sampler2_0
+ sampler2_0_SOURCES = sampler2_0.c
+ data_DATA = $(sampler2_0_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la
++LDADD = ../../lib/Xmd/libXmd.a ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../lib -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/setdate/Makefile.am
++++ b/demos/programs/setdate/Makefile.am
+@@ -7,6 +7,6 @@
+ EXTRA_DIST = XmdSetDate.ad README setDate.man Imakefile
+ setDate_SOURCES = setDate.c
+ data_DATA = $(EXTRA_DIST) $(setDate_SOURCES)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/todo/Makefile.am
++++ b/demos/programs/todo/Makefile.am
+@@ -9,4 +9,4 @@
+ data_DATA = $(EXTRA_DIST) $(todo_SOURCES)
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la 
++LDADD = -L../../lib/Xmd -lXmd -L../../lib/Exm -lExm ../../../lib/Xm/libXm.la -lXt -lXext -lX11
+--- a/demos/programs/tooltips/Makefile.am
++++ b/demos/programs/tooltips/Makefile.am
+@@ -7,6 +7,6 @@
+ bin_PROGRAMS = tooltips
+ tooltips_SOURCES = tooltips.c
+ data_DATA = $(tooltips_SOURCES) $(EXTRA_DIST)
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+--- a/demos/programs/workspace/Makefile.am
++++ b/demos/programs/workspace/Makefile.am
+@@ -11,4 +11,4 @@
+               wsm.h wsmSend.h wsmStruct.h wsm_ui.h xrmLib.h
+ data_DATA = $(wsm_SOURCES) $(EXTRA_DIST)
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+-LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm
++LDADD = ../../../lib/Xm/libXm.la -L../../lib/Wsm -lWsm -lXt -lX11
+--- a/demos/unsupported/aicon/Makefile.am
++++ b/demos/unsupported/aicon/Makefile.am
+@@ -2,7 +2,7 @@
+ 
+ noinst_PROGRAMS = aicon
+  
+-LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la 
++LDADD = -L../../lib/Xmd -lXmd ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(srcdir)/../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/unsupported/dainput/Makefile.am
++++ b/demos/unsupported/dainput/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ dainput_SOURCES = dainput.c dainput_dlg.c dainput_ui.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/dogs/Makefile.am
++++ b/demos/unsupported/dogs/Makefile.am
+@@ -16,7 +16,7 @@
+ 
+ dogs_DEPENDENCIES = dogs.uid
+ 
+-LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la
++LDADD = $(top_builddir)/lib/Mrm/libMrm.la $(top_builddir)/lib/Xm/libXm.la -lXt -lX11
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS} 
+ 
+--- a/demos/unsupported/hellomotif/Makefile.am
++++ b/demos/unsupported/hellomotif/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = hellomotif.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/motifshell/Makefile.am
++++ b/demos/unsupported/motifshell/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = motifshell.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmapdef/Makefile.am
++++ b/demos/unsupported/xmapdef/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmapdef.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmfonts/Makefile.am
++++ b/demos/unsupported/xmfonts/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmfonts.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt -lX11
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmforc/Makefile.am
++++ b/demos/unsupported/xmforc/Makefile.am
+@@ -4,7 +4,7 @@
+ 
+ SOURCES = xmforc.c
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ EXTRA_DIST = Imakefile
+ 
+--- a/demos/unsupported/xmform/Makefile.am
++++ b/demos/unsupported/xmform/Makefile.am
+@@ -6,6 +6,6 @@
+ 
+ EXTRA_DIST = Imakefile
+ 
+-LDADD = ../../../lib/Xm/libXm.la
++LDADD = ../../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I$(srcdir)/../../../lib -I$(top_builddir)/lib ${X_CFLAGS}
+--- a/tools/wml/Makefile.am
++++ b/tools/wml/Makefile.am
+@@ -30,7 +30,7 @@
+ wml_LDADD = -L. -lwml
+ wml_DEPENDENCIES = libwml.a
+ 
+-wmldbcreate_LDADD = ../../lib/Xm/libXm.la
++wmldbcreate_LDADD = ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -I../../lib -I$(srcdir)/../../lib -I$(srcdir)/../../include ${X_CFLAGS} 
+ 
diff --git a/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch b/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
new file mode 100644
index 00000000000..6d532859d73
--- /dev/null
+++ b/srcpkgs/motif/patches/13-fix_hardcoded_x11rgb_path.patch
@@ -0,0 +1,54 @@
+Description: Fix hardcoded path to /usr/lib/X11/rgb.txt in lib/Xm/ColorS.c
+ LibXm is hardcoded to read rgb.txt from /usr/lib/X11 but this file, provided
+ by x11-common in Debian, is located in /etc/X11 and /usr/share/X11 via symlink.
+ .
+ This patch fixes this by allowing the directory in which rgb.txt resides to be
+ customized by the --with-x11rgbdir=DIR configure option.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1585
+Last-Update: 2013-03-12
+--- a/configure.ac
++++ b/configure.ac
+@@ -189,6 +189,10 @@
+ XMBINDDIR_FALLBACK="$xmbinddir"
+ AC_SUBST(XMBINDDIR_FALLBACK)
+ 
++AC_ARG_WITH(x11rgbdir, [  --with-x11rgbdir=DIR  rgb.txt is located in DIR], x11rgbdir=$withval, x11rgbdir="/usr/lib/X11")
++X11RGBPATH="$x11rgbdir/rgb.txt"
++AC_SUBST(X11RGBPATH)
++
+ RM="rm -f"
+ AC_SUBST(RM)
+ 
+--- a/lib/Xm/ColorS.c
++++ b/lib/Xm/ColorS.c
+@@ -123,6 +123,10 @@
+  *       STATIC DECLARATIONS
+  ************************************************************/
+ 
++#ifndef X11RGBPATH
++#define X11RGBPATH "/usr/lib/X11/rgb.txt"
++#endif
++
+ static XtResource resources[] =
+ {
+   {
+@@ -146,7 +150,7 @@
+   {
+     XmNrgbFile, XmCString, XmRString,
+     sizeof(String), XtOffsetOf(XmColorSelectorRec, cs.rgb_file),
+-    XmRString, (XtPointer) "/usr/lib/X11/rgb.txt"
++    XmRString, (XtPointer) X11RGBPATH
+   },
+ #endif
+   {
+--- a/lib/Xm/Makefile.am
++++ b/lib/Xm/Makefile.am
+@@ -8,6 +8,7 @@
+ INCLUDES = -I.. -I$(srcdir)/.. -DXMBINDDIR_FALLBACK=\"@XMBINDDIR_FALLBACK@\" \
+            -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
++           -DX11RGBPATH=\"@X11RGBPATH@\" \
+            ${X_CFLAGS}
+ xmdir = $(includedir)/Xm
+ 
diff --git a/srcpkgs/motif/patches/15-link_uil_against_libuil.patch b/srcpkgs/motif/patches/15-link_uil_against_libuil.patch
new file mode 100644
index 00000000000..11792a7a4c8
--- /dev/null
+++ b/srcpkgs/motif/patches/15-link_uil_against_libuil.patch
@@ -0,0 +1,29 @@
+Description: Link the uil executable against libUil
+ Linking the uil executable againt libUil instead of compiling with the libUil
+ code results in a reduction in size of the uil executable from about 348KB
+ to about 16KB.
+ .
+ This patch originates from Red Hat.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1586
+Last-Update: 2013-03-12
+--- a/clients/uil/Makefile.am
++++ b/clients/uil/Makefile.am
+@@ -13,7 +13,7 @@
+ 
+ libUil_la_LIBADD = UilParser.lo ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+-uil_LDADD = ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
++uil_LDADD = libUil.la ../../lib/Mrm/libMrm.la ../../lib/Xm/libXm.la -lXt
+ 
+ INCLUDES = -DINCDIR=\"@INCDIR@\" \
+            -DLIBDIR=\"@LIBDIR@\" \
+@@ -42,7 +42,7 @@
+ 		UilLstMac.c	UilSemVal.c	UilSemCSet.c	UilDB.c
+ 
+ SRCS =		$(COMMON_SRC)
+-SRCS2 =		$(COMMON_SRC)	UilMain.c
++SRCS2 =		UilMain.c
+ 
+ HEADERS_1 = 	Uil.h		UilSymGl.h	UilSymDef.h \
+ 		UilDef.h	XmAppl.uil
diff --git a/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch b/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
new file mode 100644
index 00000000000..95a753e083e
--- /dev/null
+++ b/srcpkgs/motif/patches/16-fix-undefined-use-of-sprintf.patch
@@ -0,0 +1,17 @@
+Description: Fix undefined use of sprintf
+ This patch fixes the undefined use of sprintf when the
+ source and destination buffers overlap.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1628
+Last-Update: 2013-09-24
+--- a/lib/Xm/XmRenderT.c
++++ b/lib/Xm/XmRenderT.c
+@@ -2703,7 +2703,7 @@
+       number = tlist -> count;
+       tab = (_XmTab) tlist -> start;
+       while(number > 0) {
+-	sprintf(temp, "%s %f %d %d %d, ", temp, tab -> value, 
++	sprintf(temp + strlen(temp), " %f %d %d %d, ", tab -> value,
+ 		tab -> units, tab -> alignment, tab -> offsetModel);
+ 	tab = (_XmTab) tab -> next;
+ 	number--;
diff --git a/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch b/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
new file mode 100644
index 00000000000..a77b8793a8e
--- /dev/null
+++ b/srcpkgs/motif/patches/17-switch-to-system-iswspace.patch
@@ -0,0 +1,384 @@
+Description: Switch to system iswspace() function
+ This patch replaces calls to _XmDataFieldIsWSpace() in lib/Xm/DataF.c
+ and _XmTextFieldIsWSpace() in lib/Xm/TextF.c with calls to the system
+ iswspace() function.
+ .
+ It fixes an array bounds error in lib/Xm/DataF.c where 
+ _XmDataFieldIsWSpace() is called with num_entries = 3.
+Author: Graham Inggs <graham@nerve.org.za>
+Forwarded: http://bugs.motifzone.net/show_bug.cgi?id=1629
+Last-Update: 2013-11-18
+--- a/lib/Xm/DataF.c
++++ b/lib/Xm/DataF.c
+@@ -208,7 +208,6 @@
+ static Boolean df_VerifyLeave() ;
+ static Boolean _XmDataFieldIsWordBoundary() ;
+ static int _XmGetImage(Screen *, char *, XImage **);
+-static Boolean _XmDataFieldIsWSpace() ;
+ static void df_FindWord() ;
+ static void df_FindPrevWord() ;
+ static void df_FindNextWord() ;
+@@ -549,10 +548,6 @@
+                         XmDataFieldWidget tf,
+                         XmTextPosition pos1,
+                         XmTextPosition pos2) ;
+-static Boolean _XmDataFieldIsWSpace( 
+-                        wchar_t wide_char,
+-                        wchar_t *white_space,
+-                        int num_entries) ;
+ static void df_FindWord( 
+                         XmDataFieldWidget tf,
+                         XmTextPosition begin,
+@@ -4549,40 +4544,6 @@
+    return False;
+ }
+ 
+-/* This routine accepts an array of wchar_t's containing wchar encodings
+- * of whitespace characters (and the number of array elements), comparing
+- * the wide character passed to each element of the array.  If a match
+- * is found, we got a white space.  This routine exists only because
+- * iswspace(3c) is not yet standard.  If a system has isw* available,
+- * calls to this routine should be changed to iswspace(3c) (and callers
+- * should delete initialization of the array), and this routine should
+- * be deleted.  Its a stop gap measure to avoid allocating an instance
+- * variable for the white_space array and/or declaring a widget wide
+- * global for the data and using a macro.  Its ugly, but it works and 
+- * in the long run will be replaced by standard functionality. */
+-
+-/* ARGSUSED */
+-static Boolean
+-#ifdef _NO_PROTO
+-_XmDataFieldIsWSpace( wide_char, white_space, num_entries )
+-	wchar_t wide_char ;
+-	wchar_t * white_space ;
+-	int num_entries ;
+-#else
+-_XmDataFieldIsWSpace(
+-	wchar_t wide_char,
+-	wchar_t * white_space ,
+-	int num_entries )
+-#endif /* _NO_PROTO */
+-{
+-   int i;
+-
+-   for (i=num_entries; i > 0; i--){
+-      if (wide_char == white_space[i]) return True;
+-   }
+-   return False;
+-}
+-
+ static void 
+ #ifdef _NO_PROTO
+ df_FindWord( tf, begin, left, right )
+@@ -4599,7 +4560,6 @@
+ #endif /* _NO_PROTO */
+ {
+     XmTextPosition start, end;
+-    wchar_t white_space[3];
+ 
+     if (XmTextF_max_char_size(tf) == 1) {
+        for (start = begin; start > 0; start--) {
+@@ -4617,11 +4577,8 @@
+        }
+        *right = end - 1;
+     } else { /* check for iswspace and iswordboundary in each direction */
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+        for (start = begin; start > 0; start --) {
+-          if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start-1],white_space, 3)
++          if (iswspace(XmTextF_wc_value(tf)[start-1])
+ 	      || _XmDataFieldIsWordBoundary(tf, (XmTextPosition) start - 1, 
+ 					    start)) {
+ 		 break;
+@@ -4630,7 +4587,7 @@
+        *left = start;
+ 
+        for (end = begin; end <= XmTextF_string_length(tf); end++) {
+-	   if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)){
++	   if (iswspace(XmTextF_wc_value(tf)[end])){
+ 	      end++;
+ 	      break;
+ 	   } else if (end < XmTextF_string_length(tf)) {
+@@ -4659,14 +4616,6 @@
+ {
+ 
+     XmTextPosition start = XmTextF_cursor_position(tf);
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+-
+ 
+     if (XmTextF_max_char_size(tf) == 1) {
+        if ((start > 0) && 
+@@ -4680,11 +4629,9 @@
+        }
+        df_FindWord(tf, start, left, right);
+     } else { 
+-       if ((start > 0) && (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start - 1],
+-						white_space, 3))) {
++       if ((start > 0) && (iswspace(XmTextF_wc_value(tf)[start - 1]))) {
+           for (; start > 0; start--) {
+-	     if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[start -1], 
+-				       white_space, 3)){
++	     if (!iswspace(XmTextF_wc_value(tf)[start -1])){
+ 		start--;
+ 		break;
+              }
+@@ -4713,14 +4660,6 @@
+ {
+ 
+     XmTextPosition end = XmTextF_cursor_position(tf);
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+-
+ 
+     if(XmTextF_max_char_size(tf) == 1) {
+        if (isspace((int)(unsigned char)XmTextF_value(tf)[end])) {
+@@ -4742,9 +4681,9 @@
+        if (*right < XmTextF_string_length(tf))
+           *right = *right - 1;
+    } else {
+-      if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) {
++      if (iswspace(XmTextF_wc_value(tf)[end])) {
+ 	 for ( ; end < XmTextF_string_length(tf); end ++) {
+-	   if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[end], white_space, 3)) {
++	   if (!iswspace(XmTextF_wc_value(tf)[end])) {
+ 	       break;
+            }
+          }
+@@ -4758,10 +4697,9 @@
+        * If word boundary caused by whitespace, set right to the last 
+        * whitespace following the end of the current word.
+        */
+-      if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], white_space, 3))      {
++      if (iswspace(XmTextF_wc_value(tf)[(int)*right]))      {
+          while (*right < XmTextF_string_length(tf) &&
+-               _XmDataFieldIsWSpace(XmTextF_wc_value(tf)[(int)*right], 
+-				    white_space, 3)) {
++               iswspace(XmTextF_wc_value(tf)[(int)*right])) {
+             *right = *right + 1;
+ 	 }
+ 	 if (*right < XmTextF_string_length(tf))
+@@ -5872,13 +5810,6 @@
+ {
+     XmDataFieldWidget tf = (XmDataFieldWidget) w;
+     XmTextPosition cursorPos, position, dummy;
+-    wchar_t white_space[3];
+-
+-    if (XmTextF_max_char_size(tf) != 1) {
+-       (void)mbtowc(&white_space[0], " ", 1);
+-       (void)mbtowc(&white_space[1], "\n", 1);
+-       (void)mbtowc(&white_space[2], "\t", 1);
+-    }
+ 
+     cursorPos = XmTextF_cursor_position(tf);
+ 
+@@ -5896,16 +5827,13 @@
+              }
+           }
+        } else {
+-	  if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[cursorPos],
+-				   white_space, 3))
++	  if (iswspace(XmTextF_wc_value(tf)[cursorPos]))
+ 	     df_FindWord(tf, cursorPos, &dummy, &position);
+ 	  else
+ 	     df_FindNextWord(tf, &dummy, &position);
+-          if (_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position],
+-				   white_space, 3)){
++          if (iswspace(XmTextF_wc_value(tf)[position])){
+ 	     for (; position < XmTextF_string_length(tf); position++) {
+-		if (!_XmDataFieldIsWSpace(XmTextF_wc_value(tf)[position], 
+-					  white_space, 3))
++		if (!iswspace(XmTextF_wc_value(tf)[position]))
+ 		   break;
+ 	     }
+ 	  }
+--- a/lib/Xm/TextF.c
++++ b/lib/Xm/TextF.c
+@@ -360,10 +360,6 @@
+ 					  XmTextPosition pos1,
+ 					  XmTextPosition pos2);
+ 
+-static Boolean _XmTextFieldIsWSpace(wchar_t wide_char,
+-				    wchar_t *white_space,
+-				    int num_entries);
+-
+ static void FindWord(XmTextFieldWidget tf,
+ 		     XmTextPosition begin,
+ 		     XmTextPosition *left,
+@@ -3514,32 +3510,6 @@
+   return False;
+ }
+ 
+-/* This routine accepts an array of wchar_t's containing wchar encodings
+- * of whitespace characters (and the number of array elements), comparing
+- * the wide character passed to each element of the array.  If a match
+- * is found, we got a white space.  This routine exists only because
+- * iswspace(3c) is not yet standard.  If a system has isw* available,
+- * calls to this routine should be changed to iswspace(3c) (and callers
+- * should delete initialization of the array), and this routine should
+- * be deleted.  Its a stop gap measure to avoid allocating an instance
+- * variable for the white_space array and/or declaring a widget wide
+- * global for the data and using a macro.  Its ugly, but it works and 
+- * in the long run will be replaced by standard functionality. */
+-
+-/* ARGSUSED */
+-static Boolean
+-_XmTextFieldIsWSpace(wchar_t wide_char,
+-		     wchar_t * white_space ,
+-		     int num_entries)
+-{
+-  int i;
+-  
+-  for (i=0; i < num_entries; i++) {
+-    if (wide_char == white_space[i]) return True;
+-  }
+-  return False;
+-}
+-
+ static void 
+ FindWord(XmTextFieldWidget tf,
+ 	 XmTextPosition begin,
+@@ -3547,7 +3517,6 @@
+ 	 XmTextPosition *right)
+ {
+   XmTextPosition start, end;
+-  wchar_t white_space[3];
+   
+   if (tf->text.max_char_size == 1) {
+     for (start = begin; start > 0; start--) {
+@@ -3565,11 +3534,8 @@
+     }
+     *right = end - 1;
+   } else { /* check for iswspace and iswordboundary in each direction */
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+     for (start = begin; start > 0; start --) {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start-1],white_space, 3)
++      if (iswspace(TextF_WcValue(tf)[start-1])
+ 	  || _XmTextFieldIsWordBoundary(tf, (XmTextPosition) start - 1, 
+ 					start)) {
+ 	break;
+@@ -3578,7 +3544,7 @@
+     *left = start;
+     
+     for (end = begin; end <= tf->text.string_length; end++) {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++      if (iswspace(TextF_WcValue(tf)[end])) {
+ 	end++;
+ 	break;
+       } else if (end < tf->text.string_length) {
+@@ -3599,14 +3565,6 @@
+ {
+   
+   XmTextPosition start = TextF_CursorPosition(tf);
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+-  
+   
+   if (tf->text.max_char_size == 1) {
+     if ((start > 0) && 
+@@ -3620,11 +3578,9 @@
+     }
+     FindWord(tf, start, left, right);
+   } else { 
+-    if ((start > 0) && (_XmTextFieldIsWSpace(TextF_WcValue(tf)[start - 1],
+-					     white_space, 3))) {
++    if ((start > 0) && (iswspace(TextF_WcValue(tf)[start - 1]))) {
+       for (; start > 0; start--) {
+-	if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[start -1], 
+-				  white_space, 3)) {
++	if (!iswspace(TextF_WcValue(tf)[start -1])) {
+ 	  start--;
+ 	  break;
+ 	}
+@@ -3645,14 +3601,6 @@
+ {
+   
+   XmTextPosition end = TextF_CursorPosition(tf);
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+-  
+   
+   if(tf->text.max_char_size == 1) {
+     if (isspace((unsigned char)TextF_Value(tf)[end])) {
+@@ -3674,9 +3622,9 @@
+     if (*right < tf->text.string_length)
+       *right = *right - 1;
+   } else {
+-    if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++    if (iswspace(TextF_WcValue(tf)[end])) {
+       for (; end < tf->text.string_length; end ++) {
+-	if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[end], white_space, 3)) {
++	if (!iswspace(TextF_WcValue(tf)[end])) {
+ 	  break;
+ 	}
+       }
+@@ -3690,10 +3638,9 @@
+      * If word boundary caused by whitespace, set right to the last 
+      * whitespace following the end of the current word.
+      */
+-    if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], white_space, 3)) {
++    if (iswspace(TextF_WcValue(tf)[(int)*right])) {
+       while (*right < tf->text.string_length &&
+-	     _XmTextFieldIsWSpace(TextF_WcValue(tf)[(int)*right], 
+-				  white_space, 3)) {
++	     iswspace(TextF_WcValue(tf)[(int)*right])) {
+ 	*right = *right + 1;
+       }
+       if (*right < tf->text.string_length)
+@@ -4546,13 +4493,6 @@
+ {
+   XmTextFieldWidget tf = (XmTextFieldWidget) w;
+   XmTextPosition cursorPos, position, dummy;
+-  wchar_t white_space[3];
+-  
+-  if (tf->text.max_char_size != 1) {
+-    (void)mbtowc(&white_space[0], " ", 1);
+-    (void)mbtowc(&white_space[1], "\n", 1);
+-    (void)mbtowc(&white_space[2], "\t", 1);
+-  }
+   
+   cursorPos = TextF_CursorPosition(tf);
+   
+@@ -4570,16 +4510,13 @@
+ 	}
+       }
+     } else {
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[cursorPos],
+-			       white_space, 3))
++      if (iswspace(TextF_WcValue(tf)[cursorPos]))
+ 	FindWord(tf, cursorPos, &dummy, &position);
+       else
+ 	FindNextWord(tf, &dummy, &position);
+-      if (_XmTextFieldIsWSpace(TextF_WcValue(tf)[position],
+-			       white_space, 3)) {
++      if (iswspace(TextF_WcValue(tf)[position])) {
+ 	for (; position < tf->text.string_length; position++) {
+-	  if (!_XmTextFieldIsWSpace(TextF_WcValue(tf)[position], 
+-				    white_space, 3))
++	  if (!iswspace(TextF_WcValue(tf)[position]))
+ 	    break;
+ 	}
+       }
diff --git a/srcpkgs/motif/patches/20-cross-compile.patch b/srcpkgs/motif/patches/20-cross-compile.patch
new file mode 100644
index 00000000000..1994b26cc4a
--- /dev/null
+++ b/srcpkgs/motif/patches/20-cross-compile.patch
@@ -0,0 +1,15 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -3,10 +3,10 @@
+ AC_CONFIG_SRCDIR([lib/Xm/Form.c])
+ AC_PREREQ(2.52)
+ AC_CONFIG_AUX_DIR(.)
+-AC_CHECK_FILE(/usr/X/include/X11/X.h,
++AS_IF([test -f "/usr/X/include/X11/X.h"],
+   AC_PREFIX_DEFAULT(/usr/X),
+   AC_PREFIX_DEFAULT(/usr))
+-AC_CHECK_FILE(/usr/X11R6/include/X11/X.h,
++AS_IF([test -f "/usr/X11R6/include/X11/X.h"],
+   AC_PREFIX_DEFAULT(/usr/X11R6),
+   AC_PREFIX_DEFAULT(/usr))
+ 
diff --git a/srcpkgs/motif/template b/srcpkgs/motif/template
new file mode 100644
index 00000000000..56f330f259a
--- /dev/null
+++ b/srcpkgs/motif/template
@@ -0,0 +1,68 @@
+# Template file for 'motif'
+pkgname=motif
+version=2.3.8
+revision=1
+build_style=gnu-configure
+build_helper=qemu
+configure_args="--disable-jpeg --disable-png --enable-xft --disable-demos"
+hostmakedepends="pkg-config automake libtool flex"
+makedepends="libX11-devel libXft-devel libXt-devel libXpm-devel libXext-devel xbitmaps"
+short_desc="User interface component toolkit"
+maintainer="Andrew Benson <abenson+void@gmail.com>"
+license="LGPL-2.1-only"
+homepage="https://sourceforge.net/projects/motif/"
+distfiles="${SOURCEFORGE_SITE}/motif/Motif%20${version}%20Source%20Code/motif-${version}.tar.gz"
+checksum=859b723666eeac7df018209d66045c9853b50b4218cecadb794e2359619ebce7
+replaces="lesstif>=0"
+patch_args="-Np1"
+
+if [ "$CROSS_BUILD" ]; then
+	hostmakedepends+=" $makedepends"
+fi
+
+post_patch() {
+	if [ "$CROSS_BUILD" ]; then
+		vsed -i lib/Xm/Makefile.am -e 's|$(top_builddir)/config/util/makestr|/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e 's|\./wmluiltok|/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e 's|\./wml |/usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static &|'
+		vsed -i tools/wml/Makefile.am -e '/motif.wmd:/a	\\tsed -i "s|      exec|& /usr/bin/qemu-${XBPS_TARGET_QEMU_MACHINE}-static |" wmldbcreate'
+	fi
+	touch NEWS AUTHORS
+	autoreconf -fi
+	vsed -i tools/wml/wmluiltok.l -e '1i %option main'
+}
+
+motif-devel_package() {
+	short_desc+=" - development files"
+	depends="${makedepends} ${sourcepkg}>=${version}_${revision}"
+	replaces="lesstif-devel>=0"
+	pkg_install() {
+		vmove usr/bin/uil
+		vmove usr/share/man/man3
+		vmove usr/share/man/man1/uil.1
+		vmove usr/share/man/man5
+		vmove usr/include
+		vmove "usr/lib/*.so"
+	}
+}
+
+motif-mwm_package() {
+	short_desce="Motif window manager"
+	depends="${sourcepkg}>=${version}_${revision}"
+	replaces="lesstif-mwm>=0"
+	pkg_install() {
+		vmove usr/bin/mwm
+		vmove usr/share/man/man1/mwm.1
+		vmove usr/share/man/man4/mwmrc.4
+		vmove usr/lib/X11/system.mwmrc
+	}
+}
+
+motif-xmbind_package() {
+	short_desc="Configures the virtual key bindings of Motif applications"
+	replaces="lesstif-xmbind>=0"
+	pkg_install() {
+		vmove usr/bin/xmbind
+		vmove usr/share/man/man1/xmbind.1
+	}
+}

From 04bdad475bb0bd93b346c2465886292ef9f29f31 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:21:15 -0700
Subject: [PATCH 2/5] lesstif: remove deprecated package

---
 srcpkgs/lesstif-devel    |  1 -
 srcpkgs/lesstif-mwm      |  1 -
 srcpkgs/lesstif-xmbind   |  1 -
 srcpkgs/lesstif/template | 67 ----------------------------------------
 4 files changed, 70 deletions(-)
 delete mode 120000 srcpkgs/lesstif-devel
 delete mode 120000 srcpkgs/lesstif-mwm
 delete mode 120000 srcpkgs/lesstif-xmbind
 delete mode 100644 srcpkgs/lesstif/template

diff --git a/srcpkgs/lesstif-devel b/srcpkgs/lesstif-devel
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-devel
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif-mwm b/srcpkgs/lesstif-mwm
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-mwm
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif-xmbind b/srcpkgs/lesstif-xmbind
deleted file mode 120000
index 850b8392255..00000000000
--- a/srcpkgs/lesstif-xmbind
+++ /dev/null
@@ -1 +0,0 @@
-lesstif
\ No newline at end of file
diff --git a/srcpkgs/lesstif/template b/srcpkgs/lesstif/template
deleted file mode 100644
index 96b858d5a64..00000000000
--- a/srcpkgs/lesstif/template
+++ /dev/null
@@ -1,67 +0,0 @@
-# Template file for 'lesstif'
-pkgname=lesstif
-version=0.95.2
-revision=6
-build_style=gnu-configure
-configure_args="--prefix=/usr --mandir=/usr/share/man --docdir=/usr/share/doc
- --with-xdnd --enable-production --enable-nonstandard-conversions
- --enable-editres --enable-build-21 --disable-static --disable-debug
- --x-includes=/usr/include --x-libraries=/usr/lib"
-hostmakedepends="pkg-config"
-makedepends="libXt-devel libXp-devel libXft-devel"
-short_desc="LGPL'd re-implementation of Motif"
-maintainer="Enno Boland <gottox@voidlinux.org>"
-license="LGPL-2.1"
-homepage="http://lesstif.sourceforge.net/"
-distfiles="${SOURCEFORGE_SITE}/lesstif/lesstif-${version}.tar.bz2"
-checksum=eb4aa38858c29a4a3bcf605cfe7d91ca41f4522d78d770f69721e6e3a4ecf7e3
-
-pre_build() {
-	if [ -n "$CROSS_BUILD" ]; then
-		cd ${wrksrc}/scripts
-		msg_normal "Building man2html for $XBPS_ARCH\n"
-		cc -o man2html man2html.c
-		# Disable the rule for cross-gcc man2html
-		sed -i Makefile -e "/noinst_PROGRAMS = / s/man2html.*//"
-	fi
-}
-post_install() {
-	rm -rf $DESTDIR/usr/LessTif
-}
-
-lesstif-mwm_package() {
-	short_desc="LessTif clone of the Motif Window Manager"
-	pkg_install() {
-		vmove usr/bin/mwm
-		vmove usr/lib/X11/mwm
-		vmove usr/share/man/man1/mwm.1
-		vmove usr/share/man/man5/mwmrc.5
-		vmove usr/lib/X11/app-defaults/Mwm
-	}
-}
-
-lesstif-xmbind_package() {
-	short_desc="Configures the virtual key bindings of LessTif applications"
-	pkg_install() {
-		vmove usr/bin/xmbind
-		vmove usr/share/man/man1/xmbind.1
-	}
-}
-
-lesstif-devel_package() {
-	depends="${sourcepkg}>=${version}_${revision}"
-	short_desc+=" - development files"
-	pkg_install() {
-		vmove usr/include
-		vmove "usr/lib/*.so"
-		vmove usr/share/man/man3
-		vmove usr/share/man/man1/ltversion.1
-		vmove usr/share/man/man1/uil.1
-		vmove usr/share/man/man1/lesstif.1
-		vmove usr/share/man/man5/VirtualBindings.5
-		vmove usr/lib/LessTif
-		vmove usr/bin/uil
-		vmove usr/bin/mxmkmf
-		vmove usr/bin/motif-config
-	}
-}

From 676c328be627b871113b9492be2332c54f56641e Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:15:49 -0700
Subject: [PATCH 3/5] xastir: update to 2.1.6, rebuild with motif

---
 srcpkgs/xastir/template | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/xastir/template b/srcpkgs/xastir/template
index b6b9de5ee2f..645d1d5391a 100644
--- a/srcpkgs/xastir/template
+++ b/srcpkgs/xastir/template
@@ -1,17 +1,16 @@
 # Template file for 'xastir'
 pkgname=xastir
-version=2.1.4
+version=2.1.6
 revision=1
 archs="i686 x86_64 ppc64le"
 wrksrc="Xastir-Release-${version}"
 build_style=gnu-configure
-makedepends="libXrender-devel libXt-devel libXp-devel libcurl-devel pcre-devel lesstif-devel libax25-devel"
+makedepends="libXrender-devel libXt-devel libXp-devel libcurl-devel pcre-devel motif-devel libax25-devel"
 short_desc="X Amateur Station Tracking and Information Reporting"
 maintainer="Michael Aldridge <maldridge@voidlinux.org>"
-license="GPL-2"
+license="GPL-2.0-or-later"
 homepage="http://xastir.org"
 distfiles="https://github.com/Xastir/Xastir/archive/Release-${version}.tar.gz"
-checksum=0bd3768440422a666e1c4c532df0184374244b77ae6650e6690715a0ca1fe7bc
-python_version=2 #unverified
+checksum=5a71af2936d4d237c779b1c3a519211f8e3cd03b9873a260c849ddc8950e1a3e
 
 CFLAGS="-fcommon"

From ced065cee221badd1cd07acbed35c7ada892ea6f Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:16:21 -0700
Subject: [PATCH 4/5] ddd: rebuild with motif

---
 srcpkgs/ddd/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/ddd/template b/srcpkgs/ddd/template
index 02ab5304bc7..24f44a9abc2 100644
--- a/srcpkgs/ddd/template
+++ b/srcpkgs/ddd/template
@@ -1,12 +1,12 @@
-# Template build file for 'ddd'.
+# Template file for 'ddd'
 pkgname=ddd
 version=3.3.12
-revision=5
+revision=6
 build_style=gnu-configure
-makedepends="ncurses-devel libXt-devel libXext-devel libXmu-devel lesstif-devel"
+makedepends="ncurses-devel libXt-devel libXext-devel libXmu-devel motif-devel"
 short_desc="Graphical front-end for command-line debuggers"
 maintainer="Enno Boland <gottox@voidlinux.org>"
+license="GPL-3.0-or-later"
 homepage="http://www.gnu.org/software/ddd"
-license="GPL-2"
 distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.gz"
 checksum=3ad6cd67d7f4b1d6b2d38537261564a0d26aaed077bf25c51efc1474d0e8b65c

From 1123699235a11bd5f4f88e68888b1aba08670b62 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Mon, 26 Nov 2018 22:17:41 -0700
Subject: [PATCH 5/5] yeahwm: rebuild with motif

---
 srcpkgs/yeahwm/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/yeahwm/template b/srcpkgs/yeahwm/template
index ca7af56230a..3574b02200e 100644
--- a/srcpkgs/yeahwm/template
+++ b/srcpkgs/yeahwm/template
@@ -1,11 +1,11 @@
 # Template file for 'yeahwm'
 pkgname=yeahwm
 version=0.3.5
-revision=2
+revision=3
 build_style=gnu-makefile
 make_build_args="XROOT=\${XBPS_CROSS_BASE}/usr"
-makedepends="lesstif-devel libX11-devel libXinerama-devel"
-short_desc="A h* window manager for X based on evilwm and aewm"
+makedepends="motif-devel libX11-devel libXinerama-devel"
+short_desc="Window manager for X based on evilwm and aewm"
 maintainer="Ananteris <ananteris@mailinator.com>"
 license="Public Domain"
 homepage="http://phrat.de"

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
                   ` (9 preceding siblings ...)
  2020-12-05  6:20 ` [PR PATCH] [Updated] " abenson
@ 2020-12-13 18:16 ` joshuakraemer
  2020-12-13 19:07 ` [PR PATCH] [Merged]: " abenson
  11 siblings, 0 replies; 13+ messages in thread
From: joshuakraemer @ 2020-12-13 18:16 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

New comment by joshuakraemer on void-packages repository

https://github.com/void-linux/void-packages/pull/26134#issuecomment-744046970

Comment:
I think hostmakedepends is missing "flex".

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PR PATCH] [Merged]: New package: motif-2.3.8
  2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
                   ` (10 preceding siblings ...)
  2020-12-13 18:16 ` joshuakraemer
@ 2020-12-13 19:07 ` abenson
  11 siblings, 0 replies; 13+ messages in thread
From: abenson @ 2020-12-13 19:07 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 158 bytes --]

There's a merged pull request on the void-packages repository

New package: motif-2.3.8
https://github.com/void-linux/void-packages/pull/26134

Description:


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-12-13 19:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04 19:44 [PR PATCH] New package: motif-2.3.8 abenson
2020-11-04 20:12 ` [PR REVIEW] " ericonr
2020-11-04 20:18 ` [PR PATCH] [Updated] " abenson
2020-11-04 20:19 ` [PR REVIEW] " abenson
2020-11-05  8:26 ` mobinmob
2020-11-05  8:29 ` mobinmob
2020-11-05 13:58 ` [PR PATCH] [Updated] " abenson
2020-11-05 15:46 ` abenson
2020-11-24 18:18 ` [PR REVIEW] " ahesford
2020-11-24 18:18 ` ahesford
2020-12-05  6:20 ` [PR PATCH] [Updated] " abenson
2020-12-13 18:16 ` joshuakraemer
2020-12-13 19:07 ` [PR PATCH] [Merged]: " abenson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).