pkgsrc-Changes archive

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

CVS commit: pkgsrc/x11/hsetroot



Module Name:    pkgsrc
Committed By:   vins
Date:           Sun Jul 13 15:13:35 UTC 2025

Modified Files:
        pkgsrc/x11/hsetroot: Makefile PLIST distinfo
Added Files:
        pkgsrc/x11/hsetroot/patches: patch-hsetroot.1 patch-hsetroot.c
            patch-make.local

Log Message:
x11/hsetroot: package revision

* Do not require pkg-config and gmake (use local makefile)
* Import patch from FreeBSD ports, introducing a "sane" rendering mode.
* Add manual page.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 pkgsrc/x11/hsetroot/Makefile
cvs rdiff -u -r1.2 -r1.3 pkgsrc/x11/hsetroot/PLIST
cvs rdiff -u -r1.6 -r1.7 pkgsrc/x11/hsetroot/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/x11/hsetroot/patches/patch-hsetroot.1 \
    pkgsrc/x11/hsetroot/patches/patch-hsetroot.c \
    pkgsrc/x11/hsetroot/patches/patch-make.local

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

Modified files:

Index: pkgsrc/x11/hsetroot/Makefile
diff -u pkgsrc/x11/hsetroot/Makefile:1.34 pkgsrc/x11/hsetroot/Makefile:1.35
--- pkgsrc/x11/hsetroot/Makefile:1.34   Tue Jan 21 11:00:18 2025
+++ pkgsrc/x11/hsetroot/Makefile        Sun Jul 13 15:13:34 2025
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.34 2025/01/21 11:00:18 nia Exp $
+# $NetBSD: Makefile,v 1.35 2025/07/13 15:13:34 vins Exp $
 
 DISTNAME=      hsetroot-1.0.5
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    x11
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=himdel/}
 
@@ -10,19 +10,11 @@ HOMEPAGE=   https://github.com/himdel/hset
 COMMENT=       Allows you to compose wallpapers for X
 LICENSE=       gnu-gpl-v2
 
-USE_TOOLS+=    gmake pkg-config
-
 # error: 'for' loop initial declarations are only allowed in C99 mode
 FORCE_C_STD=   c99
 
-BUILDLINK_TRANSFORM.Darwin+=   rm:-Wl,--no-as-needed
-BUILDLINK_TRANSFORM.SunOS+=    rm:-Wl,--no-as-needed
-
-INSTALLATION_DIRS+=    bin
-
-do-install:
-       ${INSTALL_PROGRAM} ${WRKSRC}/hsetroot ${DESTDIR}${PREFIX}/bin
-       ${INSTALL_PROGRAM} ${WRKSRC}/hsr-outputs ${DESTDIR}${PREFIX}/bin
+MAKE_FILE=     make.local
+MAKE_FLAGS+=   CC=${CC:Q} PREFIX=${PREFIX}
 
 .include "../../graphics/imlib2/buildlink3.mk"
 .include "../../x11/libX11/buildlink3.mk"

Index: pkgsrc/x11/hsetroot/PLIST
diff -u pkgsrc/x11/hsetroot/PLIST:1.2 pkgsrc/x11/hsetroot/PLIST:1.3
--- pkgsrc/x11/hsetroot/PLIST:1.2       Sun May 17 14:40:29 2020
+++ pkgsrc/x11/hsetroot/PLIST   Sun Jul 13 15:13:34 2025
@@ -1,3 +1,4 @@
-@comment $NetBSD: PLIST,v 1.2 2020/05/17 14:40:29 nia Exp $
+@comment $NetBSD: PLIST,v 1.3 2025/07/13 15:13:34 vins Exp $
 bin/hsetroot
 bin/hsr-outputs
+man/man1/hsetroot.1

Index: pkgsrc/x11/hsetroot/distinfo
diff -u pkgsrc/x11/hsetroot/distinfo:1.6 pkgsrc/x11/hsetroot/distinfo:1.7
--- pkgsrc/x11/hsetroot/distinfo:1.6    Tue Oct 26 11:33:54 2021
+++ pkgsrc/x11/hsetroot/distinfo        Sun Jul 13 15:13:34 2025
@@ -1,5 +1,8 @@
-$NetBSD: distinfo,v 1.6 2021/10/26 11:33:54 nia Exp $
+$NetBSD: distinfo,v 1.7 2025/07/13 15:13:34 vins Exp $
 
 BLAKE2s (hsetroot-1.0.5.tar.gz) = 67d05a00b5f6488e189ed46194d633d0c68797d580451f2b74d5442ffd675138
 SHA512 (hsetroot-1.0.5.tar.gz) = b43f7cd75886e72cb6134446d383d7d9a684c818f2d8a0f829670c8dfca5eaaa1eb6c25f30dda41f3483609b25e8a44a3a3cb3a969bba7f77a9b9df712fa2167
 Size (hsetroot-1.0.5.tar.gz) = 12878 bytes
+SHA1 (patch-hsetroot.1) = 921ef0f8538d4915182150fecc234fc47df8955b
+SHA1 (patch-hsetroot.c) = 7da5e8303a179f60f71cefa51b3983f56d13ed88
+SHA1 (patch-make.local) = 65c6b3efb52e1c085e08bf3a4c87e6cc57aaee3a

Added files:

Index: pkgsrc/x11/hsetroot/patches/patch-hsetroot.1
diff -u /dev/null pkgsrc/x11/hsetroot/patches/patch-hsetroot.1:1.1
--- /dev/null   Sun Jul 13 15:13:35 2025
+++ pkgsrc/x11/hsetroot/patches/patch-hsetroot.1        Sun Jul 13 15:13:34 2025
@@ -0,0 +1,123 @@
+$NetBSD: patch-hsetroot.1,v 1.1 2025/07/13 15:13:34 vins Exp $
+
+hsetroot man page (from OpenBSD ports).
+
+--- hsetroot.1.orig    2025-07-13 12:57:50.268843512 +0000
++++ hsetroot.1
+@@ -0,0 +1,116 @@
++.\" Original author: Hyriand <hyriand%thegraveyard.org@localhost> (2003)
++.\" Updated by Martin Hradil (2019)
++.\" License: GPL version 2
++.Dd August 13, 2020
++.Dt HSETROOT 1
++.Os
++.Sh NAME
++.Nm hsetroot
++.Nd imlib2-based wallpaper changer
++.Sh SYNOPSIS
++.Nm
++.Op Ar command1 Op Ar arg1 ...
++.Op Ar command2 Op Ar arg2 ...
++.Sh DESCRIPTION
++.Nm
++is a tool which allows you to compose wallpapers ("root pixmaps") for X.
++It has a lot of options like rendering gradients, solids and images and
++manipulate these in various ways.
++.Nm
++also supports alpha-channels.
++.Pp
++.Nm
++uses
++.Xr XSetWindowBackgroundPixmap 3
++instead of
++.Xr XSetWindowBackground 3
++for solid colors.
++This makes it a good
++.Xr xsetroot 1
++replacement when a compositor (compton, xcompmgr, ...) is in use.
++.Pp
++Colors are in the #rgb, #rrggbb, #rrggbbaa, rgb:1/2/3 formats or a X color name.
++.Sh GENERIC OPTIONS
++.Bl -tag -width Ds
++.It Fl root
++Treat multiple displays as one big screen (ignore xrandr outputs)
++.It Fl screens Ar int
++Set a screenmask to use
++.El
++.Sh GRADIENTS
++.Bl -tag -width Ds
++.It Fl add Ar color
++Add color to range using distance 1
++.It Fl addd Ar color Ar distance
++Add color to range using custom distance
++.It Fl gradient Ar angle
++Render gradient using specified angle
++.It Fl clear
++Clear the color range
++.El
++.Sh SOLID COLOR
++.Bl -tag -width Ds
++.It Fl solid Ar color
++Render a solid using the specified color
++.El
++.Sh IMAGE FILES
++.Bl -tag -width Ds
++.It Fl center Ar image
++Render an image centered on screen
++.It Fl cover Ar image
++Render an image centered on screen scaled to fill the screen fully
++.It Fl tile Ar image
++Render an image tiled
++.It Fl full Ar image
++Render an image maximum aspect
++.It Fl extend Ar image
++Render an image max aspect and fill borders
++.It Fl fill Ar image
++Render an image stretched
++.It Fl sane Ar image
++Select the best aspect ratio and render image with minimal scaling
++.El
++.Sh IMAGE MANIPULATION
++.Bl -tag -width Ds
++.It Fl tint Ar color
++Tint the current image
++.It Fl blur Ar radius
++Blur the current image
++.It Fl sharpen Ar radius
++Sharpen the current image
++.It Fl contrast Ar amount
++Adjust contrast of current image
++.It Fl brightness Ar amount
++Adjust brightness of current image
++.It Fl gamma Ar amount
++Adjust gamma level of current image
++.It Fl flipv
++Flip the current image vertically
++.It Fl fliph
++Flip the current image horizontally
++.It Fl flipd
++Flip the current image diagonally
++.El
++.Sh MISC
++.Bl -tag -width Ds
++.It Fl alpha Ar amount
++Adjust alpha level for colors and images
++.It Fl write Ar filename
++Write current image to file
++.El
++.Sh SEE ALSO
++.Xr xcompmgr 1 ,
++.Xr xsetroot 1 ,
++.Xr XSetWindowBackgroundPixmap 3
++.Sh AUTHORS
++.Nm
++was written by
++.An Hyriand Aq Mt hyriand%thegraveyard.org@localhost
++in 2003.
++Martin Hradil updated it in 2019.
++.Pp
++This manual page was written by
++.An Stefan Hagen Aq Mt sh+ports%codevoid.de@localhost
++for the
++.Ox
++project (but may be used by others).
Index: pkgsrc/x11/hsetroot/patches/patch-hsetroot.c
diff -u /dev/null pkgsrc/x11/hsetroot/patches/patch-hsetroot.c:1.1
--- /dev/null   Sun Jul 13 15:13:35 2025
+++ pkgsrc/x11/hsetroot/patches/patch-hsetroot.c        Sun Jul 13 15:13:34 2025
@@ -0,0 +1,79 @@
+$NetBSD: patch-hsetroot.c,v 1.1 2025/07/13 15:13:34 vins Exp $
+
+* Fix atom name used when clearing previous background.
+* Introduce "sane" image rendering mode (from FreeBSD ports).
+
+--- hsetroot.c.orig    2025-07-13 12:57:50.284721804 +0000
++++ hsetroot.c
+@@ -8,7 +8,7 @@
+ #include <string.h>
+ 
+ 
+-typedef enum { Full, Fill, Center, Tile, Xtend, Cover } ImageMode;
++typedef enum { Full, Fill, Center, Tile, Xtend, Cover, Sane } ImageMode;
+ 
+ void
+ usage(char *commandline)
+@@ -34,6 +34,7 @@ usage(char *commandline)
+     "Image files:\n"
+     " -center <image>            Render an image centered on screen\n"
+     " -cover <image>             Render an image centered on screen scaled to fill the screen fully\n"
++    " -sane <image>              Render an image in sane mode (choose the best aspect, but do not center)\n"
+     " -tile <image>              Render an image tiled\n"
+     " -full <image>              Render an image maximum aspect\n"
+     " -extend <image>            Render an image max aspect and fill borders\n"
+@@ -134,7 +135,7 @@ parse_color(char *arg, Color *c, int def
+ int
+ load_image(ImageMode mode, const char *arg, int alpha, Imlib_Image rootimg, XineramaScreenInfo *outputs, int noutputs)
+ {
+-  int imgW, imgH, o;
++  int i, imgW, imgH, o;
+   Imlib_Image buffer = imlib_load_image(arg);
+ 
+   if (!buffer)
+@@ -162,7 +163,7 @@ load_image(ImageMode mode, const char *a
+ 
+   imlib_context_set_image(rootimg);
+ 
+-  for (int i = 0; i < noutputs; i++) {
++  for (i = 0; i < noutputs; i++) {
+     XineramaScreenInfo o = outputs[i];
+     printf("output %d: size(%d, %d) pos(%d, %d)\n", i, o.width, o.height, o.x_org, o.y_org);
+ 
+@@ -198,6 +199,20 @@ load_image(ImageMode mode, const char *a
+           }
+         }
+       }
++    } else if (mode == Sane) {
++      int newW, newH;
++      double aspect_w = ((double) o.width) / imgW;
++      double aspect_h = ((double) o.height) / imgH;
++      if (aspect_h < aspect_w) {
++        // image is taller
++        newW = o.width;
++        newH = (int) (imgH * aspect_w);
++      } else {
++        // image is wider
++        newW = (int) (imgW * aspect_h);
++        newH = o.height;
++      }
++      imlib_blend_image_onto_image(buffer, 0, 0, 0, imgW, imgH, 0, 0, newW, newH);
+     } else {  // Center || Tile
+       int left = (o.width - imgW) / 2;
+       int top = (o.height - imgH) / 2;
+@@ -452,6 +467,15 @@ main(int argc, char **argv)
+           fprintf (stderr, "Bad image (%s)\n", argv[i]);
+           continue;
+         }
++      } else if (strcmp (argv[i], "-sane") == 0) {
++        if ((++i) >= argc) {
++          fprintf(stderr, "Missing image\n");
++          continue;
++        }
++        if (load_image(Sane, argv[i], alpha, image, outputs, noutputs) == 0) {
++          fprintf(stderr, "Bad image (%s)\n", argv[i]);
++          continue;
++        }
+       } else if (strcmp(argv[i], "-tint") == 0) {
+         Color c;
+         DATA8 r[256], g[256], b[256], a[256];
Index: pkgsrc/x11/hsetroot/patches/patch-make.local
diff -u /dev/null pkgsrc/x11/hsetroot/patches/patch-make.local:1.1
--- /dev/null   Sun Jul 13 15:13:35 2025
+++ pkgsrc/x11/hsetroot/patches/patch-make.local        Sun Jul 13 15:13:34 2025
@@ -0,0 +1,31 @@
+$NetBSD: patch-make.local,v 1.1 2025/07/13 15:13:34 vins Exp $
+
+Local makefile for pkgsrc.
+
+--- make.local.orig    2025-07-13 14:21:28.214790743 +0000
++++ make.local
+@@ -0,0 +1,24 @@
++CC    ?= gcc
++
++CFLAGS        += -Wall
++LDFLAGS       += -lX11 -lXinerama -lImlib2
++
++PREFIX        ?=
++BINDIR        ?= $(PREFIX)/bin
++MANDIR        ?= $(PREFIX)/$(PKGMANDIR)/man1
++
++PROGS=        hsetroot hsr-outputs
++
++all: $(PROGS)
++
++.c.o:
++      $(CC) $(CFLAGS) -c -o $(<:.c=.o) $>
++
++install: all
++      $(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(BINDIR)
++      $(BSD_INSTALL_PROGRAM) $(PROGS) $(DESTDIR)$(BINDIR)
++      $(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(MANDIR)
++      $(BSD_INSTALL_MAN) hsetroot.1 $(DESTDIR)$(MANDIR)
++
++clean:
++      rm -f *.o hsetroot hsr-outputs



Home | Main Index | Thread Index | Old Index