pkgsrc-Changes archive

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

CVS commit: pkgsrc/sysutils/fastfetch



Module Name:    pkgsrc
Committed By:   vins
Date:           Sat Jan 25 22:16:09 UTC 2025

Modified Files:
        pkgsrc/sysutils/fastfetch: Makefile distinfo options.mk
Added Files:
        pkgsrc/sysutils/fastfetch/patches: patch-CMakeLists.txt
            patch-src_detection_sound_sound__bsd.c

Log Message:
sysutils/fastfetch: add sound support for NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 pkgsrc/sysutils/fastfetch/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/sysutils/fastfetch/distinfo
cvs rdiff -u -r1.10 -r1.11 pkgsrc/sysutils/fastfetch/options.mk
cvs rdiff -u -r0 -r1.3 pkgsrc/sysutils/fastfetch/patches/patch-CMakeLists.txt
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/sysutils/fastfetch/patches/patch-src_detection_sound_sound__bsd.c

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

Modified files:

Index: pkgsrc/sysutils/fastfetch/Makefile
diff -u pkgsrc/sysutils/fastfetch/Makefile:1.8 pkgsrc/sysutils/fastfetch/Makefile:1.9
--- pkgsrc/sysutils/fastfetch/Makefile:1.8      Sun Jan 19 11:59:51 2025
+++ pkgsrc/sysutils/fastfetch/Makefile  Sat Jan 25 22:16:08 2025
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.8 2025/01/19 11:59:51 vins Exp $
+# $NetBSD: Makefile,v 1.9 2025/01/25 22:16:08 vins Exp $
 
 DISTNAME=      fastfetch-2.34.1
-PKGREVISION=   2
+PKGREVISION=   3
 CATEGORIES=    sysutils
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=fastfetch-cli/}
 GITHUB_TAG=    ${PKGVERSION_NOREV}

Index: pkgsrc/sysutils/fastfetch/distinfo
diff -u pkgsrc/sysutils/fastfetch/distinfo:1.6 pkgsrc/sysutils/fastfetch/distinfo:1.7
--- pkgsrc/sysutils/fastfetch/distinfo:1.6      Fri Jan 17 16:28:09 2025
+++ pkgsrc/sysutils/fastfetch/distinfo  Sat Jan 25 22:16:08 2025
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.6 2025/01/17 16:28:09 vins Exp $
+$NetBSD: distinfo,v 1.7 2025/01/25 22:16:08 vins Exp $
 
 BLAKE2s (fastfetch-2.34.1.tar.gz) = a5e6fc60ee3376e5f054e12ce209bc3e4f4b7d2118b76d5ede064873e85620d7
 SHA512 (fastfetch-2.34.1.tar.gz) = 026b71c8d6ad5d5683ededf173d4cb2e936b3e934c7f27227fa7c5f665b9628717e90413626a4fab25fa5f5fde50cae6cdeb75621d6a2cac1ca6368c943293de
 Size (fastfetch-2.34.1.tar.gz) = 1168310 bytes
+SHA1 (patch-CMakeLists.txt) = e0a5e9758d0aac9c908b645116b2f44fb079eeb8
 SHA1 (patch-src_detection_disk_disk__bsd.c) = 807794a5c46963813e82dbb0af11668ad468bc0c
+SHA1 (patch-src_detection_sound_sound__bsd.c) = 20472a40a218798761cdc2628f96b6593791b45f

Index: pkgsrc/sysutils/fastfetch/options.mk
diff -u pkgsrc/sysutils/fastfetch/options.mk:1.10 pkgsrc/sysutils/fastfetch/options.mk:1.11
--- pkgsrc/sysutils/fastfetch/options.mk:1.10   Sun Jan 19 15:59:08 2025
+++ pkgsrc/sysutils/fastfetch/options.mk        Sat Jan 25 22:16:08 2025
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.10 2025/01/19 15:59:08 vins Exp $
+# $NetBSD: options.mk,v 1.11 2025/01/25 22:16:08 vins Exp $
 
 PKG_OPTIONS_VAR=               PKG_OPTIONS.fastfetch
 PKG_OPTIONS_OPTIONAL_GROUPS=   server sound
@@ -22,6 +22,7 @@ PKG_SUGGESTED_OPTIONS+=       threads
 PKG_SUGGESTED_OPTIONS+=        opencl
 .endif
 
+PKG_SUGGESTED_OPTIONS.NetBSD+=         oss
 PKG_SUGGESTED_OPTIONS.SunOS+=          pulseaudio
 PKG_SUGGESTED_OPTIONS.Linux+=          dbus pulseaudio sqlite3
 PKG_SUGGESTED_OPTIONS.FreeBSD+=                oss sqlite3

Added files:

Index: pkgsrc/sysutils/fastfetch/patches/patch-CMakeLists.txt
diff -u /dev/null pkgsrc/sysutils/fastfetch/patches/patch-CMakeLists.txt:1.3
--- /dev/null   Sat Jan 25 22:16:09 2025
+++ pkgsrc/sysutils/fastfetch/patches/patch-CMakeLists.txt      Sat Jan 25 22:16:09 2025
@@ -0,0 +1,24 @@
+$NetBSD: patch-CMakeLists.txt,v 1.3 2025/01/25 22:16:09 vins Exp $
+
+Enable sound support on NetBSD via ossaudio(3). 
+
+--- CMakeLists.txt.orig        2025-01-13 07:57:52.000000000 +0000
++++ CMakeLists.txt
+@@ -761,7 +761,7 @@ elseif(NetBSD)
+         src/detection/poweradapter/poweradapter_nosupport.c
+         src/detection/processes/processes_nbsd.c
+         src/detection/gtk_qt/qt.c
+-        src/detection/sound/sound_linux.c
++        src/detection/sound/sound_bsd.c
+         src/detection/swap/swap_obsd.c
+         src/detection/terminalfont/terminalfont_linux.c
+         src/detection/terminalshell/terminalshell_linux.c
+@@ -1205,7 +1205,7 @@ elseif(SunOS)
+ elseif(NetBSD)
+     target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE)
+     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-char-subscripts")
+-    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,/usr/X11R7/lib -Wl,-rpath,/usr/pkg/lib") # ditto
++    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,/usr/X11R7/lib -Wl,-rpath,/usr/pkg/lib -lossaudio") # ditto
+ endif()
+ 
+ if(FreeBSD OR OpenBSD OR NetBSD)

Index: pkgsrc/sysutils/fastfetch/patches/patch-src_detection_sound_sound__bsd.c
diff -u /dev/null pkgsrc/sysutils/fastfetch/patches/patch-src_detection_sound_sound__bsd.c:1.1
--- /dev/null   Sat Jan 25 22:16:09 2025
+++ pkgsrc/sysutils/fastfetch/patches/patch-src_detection_sound_sound__bsd.c    Sat Jan 25 22:16:09 2025
@@ -0,0 +1,55 @@
+$NetBSD: patch-src_detection_sound_sound__bsd.c,v 1.1 2025/01/25 22:16:09 vins Exp $
+
+* Default sound unit detection on NetBSD, via audiocfg(1). 
+* Fix undefined macros on NetBSD.
+
+--- src/detection/sound/sound_bsd.c.orig       2025-01-13 07:57:52.000000000 +0000
++++ src/detection/sound/sound_bsd.c
+@@ -5,14 +5,38 @@
+ #include <fcntl.h>
+ #include <sys/soundcard.h>
+ 
++/* Obsolete macros */
++#ifndef SOUND_MIXER_MUTE      // unavailable on some platforms
++#define SOUND_MIXER_MUTE      SOUND_MIXER_NONE
++#define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE)
++#endif
++
+ const char* ffDetectSound(FFlist* devices)
+ {
+     char path[] = "/dev/mixer0";
++#ifdef __NetBSD__
++    const char* const cmd = "audiocfg list | grep [*] | cut -d: -f1";
++    char buf[32];
++    long defaultDev = 0;
++
++    FILE* f = popen(cmd, "r");
++    if (f == NULL)
++        return "popen() failed";
++
++    while (fgets(buf, sizeof buf, f) != NULL) {
++        defaultDev = strtol(buf, NULL, 10);
++
++    if (pclose(f) != 0)
++        return "pclose() failed";
++
++    }
++#else
+     int defaultDev = ffSysctlGetInt("hw.snd.default_unit", -1);
+ 
+     if (defaultDev == -1)
+         return "sysctl(hw.snd.default_unit) failed";
+ 
++#endif
+     for (int idev = 0; idev <= 9; ++idev)
+     {
+         path[strlen("/dev/mixer")] = (char) ('0' + idev);
+@@ -26,7 +50,7 @@ const char* ffDetectSound(FFlist* device
+             continue;
+ 
+         uint32_t mutemask = 0;
+-        ioctl(fd, SOUND_MIXER_READ_MUTE, &mutemask); // doesn't seem to be available on DragonFly
++        ioctl(fd, SOUND_MIXER_READ_MUTE, &mutemask);
+ 
+         struct oss_card_info ci = { .card = idev };
+         if (ioctl(fd, SNDCTL_CARDINFO, &ci) < 0)



Home | Main Index | Thread Index | Old Index