From cde1a1a95ecbb2674729f14dd66ecdf42e015984 Mon Sep 17 00:00:00 2001 From: wael <40663@protonmail.com> Date: Sun, 10 Apr 2022 22:56:44 +0300 Subject: [PATCH] New package: oneko-1.2.5 --- srcpkgs/oneko/patches/cursorrecover.diff | 73 +++++++++++++++++++++ srcpkgs/oneko/patches/fix-warnings.diff | 43 ++++++++++++ srcpkgs/oneko/patches/rmshape_fixtypos.diff | 69 +++++++++++++++++++ srcpkgs/oneko/template | 22 +++++++ 4 files changed, 207 insertions(+) create mode 100644 srcpkgs/oneko/patches/cursorrecover.diff create mode 100644 srcpkgs/oneko/patches/fix-warnings.diff create mode 100644 srcpkgs/oneko/patches/rmshape_fixtypos.diff create mode 100644 srcpkgs/oneko/template diff --git a/srcpkgs/oneko/patches/cursorrecover.diff b/srcpkgs/oneko/patches/cursorrecover.diff new file mode 100644 index 000000000000..f19497812f32 --- /dev/null +++ b/srcpkgs/oneko/patches/cursorrecover.diff @@ -0,0 +1,73 @@ +diff --git a/oneko.c b/oneko.c +index d2b81fe..8c0d965 100644 +--- a/oneko.c ++++ b/oneko.c +@@ -8,6 +8,10 @@ static char rcsid[] = "$Header: /home/sun/unix/kato/xsam/oneko/oneko.c,v 1.5 90/ + + #include "oneko.h" + #include "patchlevel.h" ++ ++#include ++int restoredCursor = 0; ++ + /* + * グローバル変数 + */ +@@ -716,7 +720,14 @@ RestoreCursor() + XSetWindowAttributes theWindowAttributes; + BitmapGCData *BitmapGCDataTablePtr; + +- theWindowAttributes.cursor = None; ++ Cursor font_cursor; ++ if(restoredCursor >= XC_X_cursor && restoredCursor < XC_X_cursor + XC_num_glyphs) ++ font_cursor=XCreateFontCursor(theDisplay, restoredCursor ); ++ if(font_cursor) ++ theWindowAttributes.cursor = font_cursor; ++ else ++ theWindowAttributes.cursor = None; ++ + XChangeWindowAttributes(theDisplay, theRoot, CWCursor, + &theWindowAttributes); + for (BitmapGCDataTablePtr = BitmapGCDataTable; +@@ -1376,6 +1387,7 @@ char *message[] = { + "-tofocus : Neko runs on top of focus window", + "-rv : Reverse video. (effects monochrome display only)", + "-position : adjust position relative to mouse pointer.", ++"-cursor : cursor number to set when quitting.", + "-debug : puts you in synchronous mode.", + "-patchlevel : print out your current patchlevel.", + NULL }; +@@ -1504,6 +1516,10 @@ GetArguments(argc, argv, theDisplayName) + ArgCounter++; + result=XParseGeometry(argv[ArgCounter],&XOffset,&YOffset,&foo,&bar); + } ++ else if (strcmp(argv[ArgCounter], "-cursor") == 0) { ++ ArgCounter++; ++ restoredCursor=atoi(argv[ArgCounter]); ++ } + else if (strcmp(argv[ArgCounter], "-debug") ==0) { + Synchronous = True; + } +diff --git a/oneko.man b/oneko.man +index d6d2b40..333388a 100644 +--- a/oneko.man ++++ b/oneko.man +@@ -9,7 +9,7 @@ The program oneko creates a cute cat chasing around your mouse cursor. + [¥fB-time¥fP ¥fIn¥fP] [¥fB-speed¥fP ¥fIn¥fP] [¥fB-idle¥fP ¥fIn¥fP] + [¥fB-name¥fP ¥fIname¥fP] [¥fB-towindow¥fP] [¥fB-toname¥fP ¥fIname¥fP] + [¥fB-tofocus¥fP] +-[¥fB-position¥fP ¥fIgeometry¥fP] ++[¥fB-position¥fP ¥fIgeometry¥fP] [¥fB-cursor¥fP] + [¥fB-rv¥fP] [¥fB-noshape¥fP] [¥fB-fg¥fP] [¥fB-bg¥fP] + .SH DESCRIPTION + .I oneko +@@ -88,6 +88,9 @@ When focus window is not in sight, cat chases mouse as usually. + Specify X and Y offsets in pixels to adjust position of cat relative + to mouse pointer. + .TP ++.BI ¥-cursor " cursornumber" ++Specify a cursor number to set when quitting. For example, 132 is the ++default root cursor. + .B -rv + Reverse background color and foreground color. + .TP diff --git a/srcpkgs/oneko/patches/fix-warnings.diff b/srcpkgs/oneko/patches/fix-warnings.diff new file mode 100644 index 000000000000..7e2593ba8357 --- /dev/null +++ b/srcpkgs/oneko/patches/fix-warnings.diff @@ -0,0 +1,43 @@ +diff --git a/oneko.c b/oneko.c +index d569eb5..926c1cd 100644 +--- a/oneko.c ++++ b/oneko.c +@@ -335,7 +335,7 @@ char *resource; + * リソース・データベースからオプションを設定 + */ + +-GetResources() ++void GetResources() + { + char *resource; + int num; +@@ -434,7 +434,7 @@ GetResources() + * ねずみ型カーソルを作る + */ + +-MakeMouseCursor() ++void MakeMouseCursor() + { + Pixmap theCursorSource; + Pixmap theCursorMask; +@@ -463,7 +463,7 @@ MakeMouseCursor() + * 色を初期設定する + */ + +-SetupColors() ++void SetupColors() + { + XColor theExactColor; + Colormap theColormap; +diff --git a/oneko.h b/oneko.h +index 414e12f..225d975 100644 +--- a/oneko.h ++++ b/oneko.h +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + + /* diff --git a/srcpkgs/oneko/patches/rmshape_fixtypos.diff b/srcpkgs/oneko/patches/rmshape_fixtypos.diff new file mode 100644 index 000000000000..4a5a96c88b83 --- /dev/null +++ b/srcpkgs/oneko/patches/rmshape_fixtypos.diff @@ -0,0 +1,69 @@ +diff --git a/oneko.c b/oneko.c +index d2b81fe..39b8b1d 100644 +--- a/oneko.c ++++ b/oneko.c +@@ -618,13 +618,11 @@ InitScreen(DisplayName) + XSynchronize(theDisplay,True); + } + +-#ifdef SHAPE + if (!NoShape && XShapeQueryExtension(theDisplay, + &event_base, &error_base) == False) { +- fprintf(stderr, "Display not suported shape extension.¥n"); ++ fprintf(stderr, "Display does not support shape extension.¥n"); + NoShape = True; + } +-#endif SHAPE + + theScreen = DefaultScreen(theDisplay); + theDepth = DefaultDepth(theDisplay, theScreen); +@@ -803,13 +801,11 @@ DrawNeko(x, y, DrawAnime) + theChanges.x = x; + theChanges.y = y; + XConfigureWindow(theDisplay, theWindow, CWX | CWY, &theChanges); +-#ifdef SHAPE + if (NoShape == False) { + XShapeCombineMask(theDisplay, theWindow, ShapeBounding, + 0, 0, DrawMask, ShapeSet); + + } +-#endif SHAPE + if (DontMapped) { + XMapWindow(theDisplay, theWindow); + DontMapped = 0; +diff --git a/oneko.man b/oneko.man +index d6d2b40..f24f19c 100644 +--- a/oneko.man ++++ b/oneko.man +@@ -1,6 +1,6 @@ + .TH ONEKO 6 +-.SH NAME oneko +-The program oneko creates a cute cat chasing around your mouse cursor. ++.SH NAME ++oneko ¥- Creates a cute cat chasing around your mouse cursor. + .SH SYNOPSIS + .B oneko + [¥fB-help¥fP] [¥fB-tora¥fP] +@@ -22,8 +22,7 @@ start sleeping. + Prints help message on usage. + .TP + .B -tora +-Make cat into "tora-neko". "Tora-neko" means cat wite tiger-like stripe. +-I don't know how to say it in English. ++Make cat into "tora-neko", a cat with a tiger-like stripe. + .TP + .B -dog + Runs a dog instead of a cat. +diff --git a/oneko.man.jp b/oneko.man.jp +index 96f9e3a..ed795bf 100644 +--- a/oneko.man.jp ++++ b/oneko.man.jp +@@ -1,6 +1,6 @@ + .TH ONEKO 6 +-.SH 名称 oneko +-かわいい猫がマウスカーソルを追いかけるプログラム ++.SH 名称 ++oneko ¥- かわいい猫がマウスカーソルを追いかけるプログラム + .SH 書式 + .B oneko + [¥fB-help¥fP] [¥fB-tora¥fP] diff --git a/srcpkgs/oneko/template b/srcpkgs/oneko/template new file mode 100644 index 000000000000..9f9d3201853c --- /dev/null +++ b/srcpkgs/oneko/template @@ -0,0 +1,22 @@ +# Template file for 'oneko' +pkgname=oneko +version=1.2.sakura.5 +revision=2 +hostmakedepends="pkg-config" +makedepends="libX11-devel libXext-devel" +short_desc="Cat that chases around your cursor" +maintainer="wael <40663@protonmail.com>" +license="Public Domain" +homepage="http://www.daidouji.com/oneko" +distfiles="http://www.daidouji.com/oneko/distfiles/oneko-${version}.tar.gz" +checksum=2c2e05f1241e9b76f54475b5577cd4fb6670de058218d04a741a04ebd4a2b22f + +do_build() { + ${CC} ${CFLAGS} -DSHAPE oneko.c -o oneko $(pkg-config --libs xext x11) -lm +} + +do_install() { + vbin oneko + vman oneko.man oneko.1 + vman oneko.man.jp oneko.jp.1 +}