pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/x11/xphoon



Module Name:    pkgsrc
Committed By:   vins
Date:           Thu Feb 13 21:09:02 UTC 2025

Modified Files:
        pkgsrc/x11/xphoon: DESCR Makefile distinfo
Added Files:
        pkgsrc/x11/xphoon/patches: patch-Imakefile patch-Makefile patch-vroot.h
            patch-xphoon.c
Removed Files:
        pkgsrc/x11/xphoon/patches: patch-ab patch-ac patch-ad patch-ae patch-af
            patch-ag patch-ah

Log Message:
x11/xphoon: update to xphoon-20140814

No changelog available. The code has been largely reworked, at least
partially incorporating our previous patches. Several files have been
deprecated and moved to a old/ directory.
Added LICENSE.
This commit also brings a patch adding Xrandr support.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 pkgsrc/x11/xphoon/DESCR
cvs rdiff -u -r1.29 -r1.30 pkgsrc/x11/xphoon/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/x11/xphoon/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/x11/xphoon/patches/patch-Imakefile \
    pkgsrc/x11/xphoon/patches/patch-Makefile \
    pkgsrc/x11/xphoon/patches/patch-vroot.h \
    pkgsrc/x11/xphoon/patches/patch-xphoon.c
cvs rdiff -u -r1.2 -r0 pkgsrc/x11/xphoon/patches/patch-ab \
    pkgsrc/x11/xphoon/patches/patch-ac
cvs rdiff -u -r1.1 -r0 pkgsrc/x11/xphoon/patches/patch-ad \
    pkgsrc/x11/xphoon/patches/patch-ae pkgsrc/x11/xphoon/patches/patch-af \
    pkgsrc/x11/xphoon/patches/patch-ag pkgsrc/x11/xphoon/patches/patch-ah

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/x11/xphoon/DESCR
diff -u pkgsrc/x11/xphoon/DESCR:1.1 pkgsrc/x11/xphoon/DESCR:1.2
--- pkgsrc/x11/xphoon/DESCR:1.1 Wed Oct 31 22:12:28 2001
+++ pkgsrc/x11/xphoon/DESCR     Thu Feb 13 21:09:01 2025
@@ -1 +1,5 @@
-Xphoon sets X the root window to a picture of the moon in its current phase.
+Xphoon sets X the root window to a picture of the moon in its current
+phase, including the partial lighting of the dark side by reflected
+earthlight. Picture is a monochrome dithered bitmap which is calculated
+via mathematical formulae. It keeps running on background updating the
+picture accordingly as time goes by.

Index: pkgsrc/x11/xphoon/Makefile
diff -u pkgsrc/x11/xphoon/Makefile:1.29 pkgsrc/x11/xphoon/Makefile:1.30
--- pkgsrc/x11/xphoon/Makefile:1.29     Mon Jul 17 22:00:25 2023
+++ pkgsrc/x11/xphoon/Makefile  Thu Feb 13 21:09:01 2025
@@ -1,19 +1,34 @@
-# $NetBSD: Makefile,v 1.29 2023/07/17 22:00:25 nia Exp $
+# $NetBSD: Makefile,v 1.30 2025/02/13 21:09:01 vins Exp $
 #
 
-DISTNAME=      xphoon.tar
-PKGNAME=       xphoon-19910918
-PKGREVISION=   3
+DISTNAME=      xphoon_14Aug2014
+PKGNAME=       xphoon-20140814
 CATEGORIES=    x11
-MASTER_SITES=  ftp://ftp.x.org/R5contrib/
-EXTRACT_SUFX=  .Z
+MASTER_SITES=  https://www.acme.com/software/xphoon/
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://www.acme.com/software/xphoon/
 COMMENT=       Set the root window to the moon in its current phase
+LICENSE=       2-clause-bsd
 
-WRKSRC=                ${WRKDIR}/xphoon
 USE_IMAKE=     yes
 
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "Linux"
+SUBST_CLASSES+=                defs
+SUBST_STAGE.defs=      post-configure
+SUBST_FILES.defs+=     Makefile
+SUBST_SED.defs=                -e 's|-D_BSD_SOURCE[[:space:]]*-D_SVID_SOURCE|-D_DEFAULT_SOURCE|g'
+SUBST_MESSAGE.defs=    Replacing deprecated preprocessor-defined macros.
+.endif
+
+MAKE_FLAGS+=   CCOPTIONS=${CFLAGS:Q}
+MAKE_FLAGS+=   LOCAL_LDFLAGS=${LDFLAGS:Q}
+
+WRKSRC=        ${WRKDIR}/${PKGBASE}
+
+.include "../../x11/libXrandr/buildlink3.mk"
 .include "../../x11/libXext/buildlink3.mk"
 .include "../../x11/libX11/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"

Index: pkgsrc/x11/xphoon/distinfo
diff -u pkgsrc/x11/xphoon/distinfo:1.6 pkgsrc/x11/xphoon/distinfo:1.7
--- pkgsrc/x11/xphoon/distinfo:1.6      Tue Oct 26 11:34:55 2021
+++ pkgsrc/x11/xphoon/distinfo  Thu Feb 13 21:09:01 2025
@@ -1,12 +1,9 @@
-$NetBSD: distinfo,v 1.6 2021/10/26 11:34:55 nia Exp $
+$NetBSD: distinfo,v 1.7 2025/02/13 21:09:01 vins Exp $
 
-BLAKE2s (xphoon.tar.Z) = e1c972b314890061a5540c74519c62e6c785a928d989bc39c254db5dd09ed11d
-SHA512 (xphoon.tar.Z) = 6801bc3bec5337664be6eb90254abbf4e084a42d417470810018ab6099e44b79f367ee90c3a9312e3552c7abc747e9c27103d43112b9284b6bbb0aa9cae546c9
-Size (xphoon.tar.Z) = 95407 bytes
-SHA1 (patch-ab) = 94647ef046da68e750a2cbe387d1e775483b208c
-SHA1 (patch-ac) = fbed89ba75f4dea2e9ecb3f865b6e1499e0e4245
-SHA1 (patch-ad) = 24bc9922d8adc84b0598d0d75a6794913e776abb
-SHA1 (patch-ae) = c331c6fc4568312e586cf0827e206df157826f2b
-SHA1 (patch-af) = 540e43756f62600f4152507b5548079b64413d2c
-SHA1 (patch-ag) = ba81413b85506e4f5eeb4b5d12a9a8fc71465018
-SHA1 (patch-ah) = 72d418638535f56147ad2d624a7ecf70cc407102
+BLAKE2s (xphoon_14Aug2014.tar.gz) = 9f6df7ff034315dfc08dba667c57c2377b494217a9c82d47c4d1e04c6bfd3a1f
+SHA512 (xphoon_14Aug2014.tar.gz) = 6f0cf53b305cbf15d3b28fdfbcf49ff78689d49fb7b95815b590f3d42f43bda31df1bfd515eefa849579f9055f004cc7bf901741d98e2a10ac4841cc4ed95a00
+Size (xphoon_14Aug2014.tar.gz) = 103903 bytes
+SHA1 (patch-Imakefile) = cc9091b8bbec7bfd7029c5b8179e0e9064596349
+SHA1 (patch-Makefile) = 154cb0169f81817e8f60719d077c40d6a031ad90
+SHA1 (patch-vroot.h) = e06529cf5a373e3f87f0a825dec28545e5aaae6d
+SHA1 (patch-xphoon.c) = 981c2adbb0e9c5e82a898c68c41c1cc4a0b67ad6

Added files:

Index: pkgsrc/x11/xphoon/patches/patch-Imakefile
diff -u /dev/null pkgsrc/x11/xphoon/patches/patch-Imakefile:1.1
--- /dev/null   Thu Feb 13 21:09:02 2025
+++ pkgsrc/x11/xphoon/patches/patch-Imakefile   Thu Feb 13 21:09:01 2025
@@ -0,0 +1,16 @@
+$NetBSD: patch-Imakefile,v 1.1 2025/02/13 21:09:01 vins Exp $
+
+Link with libXrandr.
+
+--- Imakefile.orig     2014-08-11 19:15:00.000000000 +0000
++++ Imakefile
+@@ -1,7 +1,7 @@
+ CCOPTIONS =           -ansi -pedantic -U__STRICT_ANSI__ -Wall -Wpointer-arith -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls 
-Wno-long-long
+ INCLUDES =            -I. -I$(TOP) -I$(TOP)/X11 -I$(TOP)/X11/bitmaps
+-LOCAL_LIBRARIES =     $(XLIB)
+-DEPLIBS =             $(DEPXLIB)
++LOCAL_LIBRARIES =     $(XLIB) $(XRANDRLIB)
++DEPLIBS =             $(DEPXLIB) $(DEPXRANDRLIB)
+ LDLIBS =              -lm
+ 
+ SRCS =                        xphoon.c moon.c astro.c date_parse.c
Index: pkgsrc/x11/xphoon/patches/patch-Makefile
diff -u /dev/null pkgsrc/x11/xphoon/patches/patch-Makefile:1.1
--- /dev/null   Thu Feb 13 21:09:02 2025
+++ pkgsrc/x11/xphoon/patches/patch-Makefile    Thu Feb 13 21:09:01 2025
@@ -0,0 +1,17 @@
+$NetBSD: patch-Makefile,v 1.1 2025/02/13 21:09:01 vins Exp $
+
+Link with libXrandr.
+
+--- Makefile.orig      2014-08-11 19:15:03.000000000 +0000
++++ Makefile
+@@ -934,8 +934,8 @@ CXXPROJECT_DEFINES =
+ 
+ CCOPTIONS =           -ansi -pedantic -U__STRICT_ANSI__ -Wall -Wpointer-arith -Wshadow -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls 
-Wno-long-long
+ INCLUDES =            -I. -I$(TOP) -I$(TOP)/X11 -I$(TOP)/X11/bitmaps
+-LOCAL_LIBRARIES =     $(XLIB)
+-DEPLIBS =             $(DEPXLIB)
++LOCAL_LIBRARIES =     $(XLIB) $(XRANDRLIB)
++DEPLIBS =             $(DEPXLIB)  $(DEPXRANDRLIB)
+ LDLIBS =              -lm
+ 
+ SRCS =                        xphoon.c moon.c astro.c date_parse.c
Index: pkgsrc/x11/xphoon/patches/patch-vroot.h
diff -u /dev/null pkgsrc/x11/xphoon/patches/patch-vroot.h:1.1
--- /dev/null   Thu Feb 13 21:09:02 2025
+++ pkgsrc/x11/xphoon/patches/patch-vroot.h     Thu Feb 13 21:09:02 2025
@@ -0,0 +1,35 @@
+$NetBSD: patch-vroot.h,v 1.1 2025/02/13 21:09:02 vins Exp $
+
+Fix signedness mismatch warning.
+
+--- vroot.h.orig       2014-07-02 05:48:38.000000000 +0000
++++ vroot.h
+@@ -45,7 +45,7 @@ VirtualRootWindowOfScreen( Screen* scree
+       if (screen != save_screen) {
+               Display *dpy = DisplayOfScreen(screen);
+               Atom __SWM_VROOT = None;
+-              int i;
++              unsigned int i;
+               Window rootReturn, parentReturn, *children;
+               unsigned int numChildren;
+ 
+@@ -59,14 +59,16 @@ VirtualRootWindowOfScreen( Screen* scree
+                               Atom actual_type;
+                               int actual_format;
+                               unsigned long nitems, bytesafter;
+-                              Window *newRoot = (Window *)0;
++                              Window *newRoot;
++                              unsigned char *newRootTmp = NULL;
+ 
+                               if (XGetWindowProperty(dpy, children[i],
+                                       __SWM_VROOT, 0, 1, False, XA_WINDOW,
+                                       &actual_type, &actual_format,
+                                       &nitems, &bytesafter,
+-                                      (unsigned char **) &newRoot) == Success
+-                                  && newRoot) {
++                                      &newRootTmp) == Success
++                                  && newRootTmp) {
++                                  newRoot = (Window *) newRootTmp;
+                                   root = *newRoot;
+                                   break;
+                               }
Index: pkgsrc/x11/xphoon/patches/patch-xphoon.c
diff -u /dev/null pkgsrc/x11/xphoon/patches/patch-xphoon.c:1.1
--- /dev/null   Thu Feb 13 21:09:02 2025
+++ pkgsrc/x11/xphoon/patches/patch-xphoon.c    Thu Feb 13 21:09:02 2025
@@ -0,0 +1,197 @@
+$NetBSD: patch-xphoon.c,v 1.1 2025/02/13 21:09:02 vins Exp $
+
+* Add Xrandr support.
+* Do not require a tty when forking to background.
+
+--- xphoon.c.orig      2014-08-04 21:57:59.000000000 +0000
++++ xphoon.c
+@@ -27,11 +27,13 @@
+ #include <stdio.h>
+ #include <time.h>
+ #include <math.h>
++#include <errno.h>
+ #include <sys/ioctl.h>
+ #include <X11/Xos.h>
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
+ #include <X11/Xatom.h>
++#include <X11/extensions/Xrandr.h>
+ #include "vroot.h"
+ #include "astro.h"
+ #include "date_parse.h"
+@@ -190,13 +192,20 @@ usage:
+       (void) fflush( stdout );
+ 
+       /* Go stealth (ditch our controlling tty). */
++#ifdef TIOCNOTTY
+       tty = open( "/dev/tty", 0 );
+       if ( tty < 0 )
+           {
+-          (void) fprintf( stderr, "%s: ", argv0 );
+-          perror( "/dev/tty open" );
+-          exit( 1 );
+-          }
++          if ( errno != ENXIO )
++              {
++              (void) fprintf( stderr, "%s: ", argv0 );
++              perror( "/dev/tty open" );
++              exit( 1 );
++              }
++      }
++#else
++      setsid();
++#endif
+       else
+           {
+           if ( ioctl( tty, TIOCNOTTY, 0 ) < 0 )
+@@ -236,6 +245,10 @@ usage:
+ 
+ /* xinit - initialize X stuff */
+ 
++struct crtcinfo {
++    int x, y, w, h;
++    };
++
+ static Display* display;
+ static int screen;
+ static Window root;
+@@ -244,11 +257,14 @@ static GC onegc;
+ static GC zerogc;
+ static GC copygc;
+ static GC clipgc;
++static int hasrandr, ncrtc;
++struct crtcinfo *crtcs;
+ 
+ static void
+ xinit( char* display_name )
+     {
+     Pixmap temp_pixmap;
++    int i, j;
+ 
+     display = XOpenDisplay( display_name );
+     if ( display == (Display*) 0 )
+@@ -260,8 +276,23 @@ xinit( char* display_name )
+       }
+     screen = DefaultScreen( display );
+     root = DefaultRootWindow( display );
+-    root_w = DisplayWidth( display, screen );
+-    root_h = DisplayHeight( display, screen );
++    hasrandr = XRRQueryExtension( display, &i, &j );
++    if ( ! hasrandr )
++      {
++      root_w = DisplayWidth( display, screen );
++      root_h = DisplayHeight( display, screen );
++      ncrtc = 1;
++      crtcs = malloc( sizeof( struct crtcinfo ) );
++      if ( crtcs == NULL )
++          {
++          (void) fprintf( stderr, "%s: couldn't allocate crtc", argv0 );
++          exit( 1 );
++          }
++      crtcs[0].x = 0;
++      crtcs[0].y = 0;
++      crtcs[0].w = root_w;
++      crtcs[0].h = root_h;
++      }
+     temp_pixmap = XCreatePixmap( display, root, 1, 1, 1 );
+     onegc = XCreateGC( display, temp_pixmap, 0, (XGCValues*) 0 );
+     XSetForeground( display, onegc, 1L );
+@@ -278,6 +309,52 @@ xinit( char* display_name )
+     XSetBackground( display, clipgc, WhitePixel( display, screen ) );
+     }
+ 
++static void
++xrrinit( void )
++    {
++    XRRScreenResources *sr;
++    XRRCrtcInfo *ci;
++    int i;
++
++    if ( ! hasrandr )
++      return;
++    root_w = DisplayWidth( display, screen );
++    root_h = DisplayHeight( display, screen );
++    sr = XRRGetScreenResources( display, root );
++    ncrtc = sr->ncrtc;
++    crtcs = malloc( sizeof( struct crtcinfo ) * ncrtc );
++    if ( crtcs == NULL )
++      {
++      (void) fprintf( stderr, "%s: couldn't allocate crtc", argv0 );
++      exit( 1 );
++      }
++    memset( crtcs, 0, sizeof( struct crtcinfo ) * ncrtc);
++    for ( i = 0; i < ncrtc; i++ )
++      {
++      ci = XRRGetCrtcInfo( display, sr, sr->crtcs[i] );
++      if ( ci == NULL )
++          continue;
++      if ( ci->noutput != 0 )
++          {
++          crtcs[i].x = ci->x;
++          crtcs[i].y = ci->y;
++          crtcs[i].w = ci->width;
++          crtcs[i].h = ci->height;
++          }
++      XRRFreeCrtcInfo( ci );
++      }
++    XRRFreeScreenResources( sr );
++    }
++
++static void
++xrrcleanup( void )
++    {
++    if ( ! hasrandr )
++      return;
++    free( crtcs );
++    crtcs = NULL;
++    }
++
+ 
+ /* make_star_tiles - make random star tiles */
+ 
+@@ -518,6 +595,8 @@ set_root( int bits_w, int bits_h, unsign
+       display, mask_bitmap, onegc, cx - r + 2, cy - r + 2,
+       r * 2 - 3, r * 2 - 3, 0, 360 * 64 );
+ 
++    xrrinit();
++
+     /* Make the root pixmap. */
+     root_pixmap = XCreatePixmap(
+       display, root, root_w, root_h, DefaultDepth( display, screen ) );
+@@ -545,13 +624,20 @@ set_root( int bits_w, int bits_h, unsign
+       }
+ 
+     /* Put the moon into the stars. */
+-    x = ( root_w - bits_w ) / 2;
+-    y = ( root_h - bits_h ) / 2;
+-    XSetClipMask( display, clipgc, mask_bitmap );
+-    XSetClipOrigin( display, clipgc, x, y );
+-    XCopyPlane(
+-      display, moon_bitmap, root_pixmap, clipgc, 0, 0, bits_w, bits_h, x, y,
+-      1 );
++    for ( i = 0; i < ncrtc; i++ )
++      {
++      if ( crtcs[i].w == 0 )
++          continue;
++      x = crtcs[i].x + ( ( crtcs[i].w - bits_w ) / 2 );
++      y = crtcs[i].y + ( ( crtcs[i].h - bits_h ) / 2 );
++      XSetClipMask( display, clipgc, mask_bitmap );
++      XSetClipOrigin( display, clipgc, x, y );
++      XCopyPlane(
++          display, moon_bitmap, root_pixmap, clipgc, 0, 0, bits_w, bits_h,
++          x, y, 1 );
++      }
++
++    xrrcleanup();
+ 
+     /* And set the root. */
+     XSetWindowBackgroundPixmap( display, root, root_pixmap );
+@@ -585,6 +671,8 @@ cleanup( void )
+     if ( star_tiles_made )
+       for ( i = 0; i < NUM_TILES; ++i )
+           XFreePixmap( display, star_tile[i] );
++    if ( ! hasrandr )
++      free( crtcs );
+     XFreeGC( display, onegc );
+     XFreeGC( display, zerogc );
+     XFreeGC( display, copygc );



Home | Main Index | Thread Index | Old Index