void-packages/srcpkgs/xcolorsel/patches/xcolorsel.patch
Đoàn Trần Công Danh 3353bf4722 srcpkgs/x*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

145 lines
3.6 KiB
Diff

--- a/RgbSink.c
+++ b/RgbSink.c
@@ -98,6 +99,12 @@
#endif /* LIB_X11R5 */
#endif /* LIB_X11R6 */
+/* workaround for Xaw 7.x */
+#if XawVersion >= 7000002L
+typedef int (*_XawSinkIntFunc)();
+typedef void (*_XawSinkVoidFunc)();
+#endif
+
/* No resources */
/* No actions */
--- a/RgbText.c
+++ b/RgbText.c
@@ -146,7 +146,7 @@
{ XtNcolumns, XtCColumns, XtRDimension, sizeof(Dimension), offset(columns),
XtRString, (XtPointer) "30" },
{ XtNfile, XtCFile, XtRString, sizeof(String), offset(file),
- XtRString, (XtPointer) "/usr/lib/X11/rgb.txt" },
+ XtRString, (XtPointer) "/usr/share/X11/rgb.txt" },
{ XtNtileWidth, XtCTileWidth, XtRDimension, sizeof(Dimension), offset(tile_width),
XtRString, (XtPointer) "3" },
{ XtNmaxRed, XtCMaxRed, XtRShort, sizeof(unsigned short), offset(max_red),
--- a/RgbSrc.c
+++ b/RgbSrc.c
@@ -81,8 +81,14 @@
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
+#include <X11/Xaw/XawInit.h>
#include "RgbSrcP.h"
+/* workaround for Xaw 7.x */
+#if (defined(XawVersion) && (XawVersion <= 7000002L))
+typedef XawTextPosition (*_XawTextPositionFunc)();
+#endif
+
/* No resources */
/* No actions */
--- a/Xcolorsel.ad
+++ b/Xcolorsel.ad
@@ -1,4 +1,6 @@
! Standard layout:
+Xcolorsel.width: 420
+
*.text.scrollHorizontal: WhenNeeded
*.text.scrollVertical: WhenNeeded
*.text.displayCaret: False
--- a/Imakefile
+++ b/Imakefile
@@ -82,9 +82,9 @@
DependTarget()
appdef-c.h: Xcolorsel-color.ad
- app2head Xcolorsel-color.ad > appdef-c.h
+ ./app2head Xcolorsel-color.ad > appdef-c.h
appdef.h: Xcolorsel.ad
- app2head Xcolorsel.ad > appdef.h
+ ./app2head Xcolorsel.ad > appdef.h
purge:
$(RM) xcolorsel *.o appdef.h appdef-c.h Xcolorsel.help *.tar.Z Makefile Makefile.bak makefile *.tar *.tar.gz
Xcolorsel.help: xcolorsel.man
--- a/Xcolorsel-color.ad
+++ b/Xcolorsel-color.ad
@@ -13,57 +13,57 @@
! If this is the case you may also want to include the following
! (by removing the leading !)
-!*.message.borderWidth:0
+*.message.borderWidth:0
! and to exclude (by inserting ! as the first character) the next lines:
-*.message.borderWidth:2
-*.Scrollbar.background: Chocolate2
-*.Scrollbar.foreground: Chocolate4
+!*.message.borderWidth:2
+!*.Scrollbar.background: Chocolate2
+!*.Scrollbar.foreground: Chocolate4
! Other (generic) color settings:
-*.borderColor: LightSalmon4
+!*.borderColor: LightSalmon4
*.pointerColor: Black
*.pointerColorBackground: White
-*.Background: SandyBrown
-*.Foreground: Salmon4
+!*.Background: SandyBrown
+!*.Foreground: Salmon4
*.text.borderWidth: 2
*.displayMenu.borderWidth: 2
-*.Command.background: Chocolate1
-*.Command.foreground: Chocolate4
+!*.Command.background: Chocolate1
+!*.Command.foreground: Chocolate4
-*.Toggle.background: Chocolate2
-*.Toggle.foreground: Chocolate4
+!*.Toggle.background: Chocolate2
+!*.Toggle.foreground: Chocolate4
*.quit.background: OrangeRed2
-*.quit.foreground: OrangeRed4
+!*.quit.foreground: OrangeRed4
*.close.background: OrangeRed2
-*.close.foreground: OrangeRed4
+!*.close.foreground: OrangeRed4
*.about.background: OliveDrab2
-*.about.foreground: OliveDrab4
+!*.about.foreground: OliveDrab4
*.defaults.background: OliveDrab2
-*.defaults.foreground: OliveDrab4
+!*.defaults.foreground: OliveDrab4
*.grab.background: Gold1
-*.grab.foreground: Gold4
+!*.grab.foreground: Gold4
*.display.background: Gold1
-*.display.foreground: Gold4
+!*.display.foreground: Gold4
*.fileinfo.background: Gold2
-*.fileinfo.foreground: Gold4
+!*.fileinfo.foreground: Gold4
*.reverse.background: Gold2
-*.reverse.foreground: Gold4
+!*.reverse.foreground: Gold4
! Include standard settings: