Skip to content

Commit e90c5cb

Browse files
committed
GPU (OpenBSD): fix pci.ids file location
1 parent 03cd283 commit e90c5cb

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ jobs:
452452
version: '7.5'
453453
run: |
454454
uname -a
455-
sudo pkg_add -r cmake git pkgconf wayland vulkan-headers vulkan-loader glib2 dconf dbus sqlite3 xfconf imagemagick chafa pulseaudio py3-requests
455+
sudo pkg_add -r cmake git pkgconf wayland vulkan-headers vulkan-loader glib2 dconf dbus sqlite3 xfconf imagemagick chafa pulseaudio hwdata py3-requests
456456
cmake -DSET_TWEAK=Off -DBUILD_TESTS=On -DENABLE_EMBEDDED_PCIIDS=ON .
457457
cmake --build . --target package --verbose -j4
458458
./fastfetch --list-features

src/detection/gpu/gpu_pci.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33

44
#include <stdlib.h>
55
#ifdef __FreeBSD__
6-
#include <paths.h>
6+
#include <paths.h>
77
#ifndef _PATH_LOCALBASE
88
#define _PATH_LOCALBASE "/usr/local"
99
#endif
10+
#elif __OpenBSD__
11+
#define _PATH_LOCALBASE "/usr/local"
12+
#elif __NetBSD__
13+
#define _PATH_LOCALBASE "/usr/pkg"
1014
#endif
1115

1216
#if FF_HAVE_EMBEDDED_PCIIDS
@@ -37,17 +41,10 @@ static const FFstrbuf* loadPciIds()
3741
if (pciids.length == 0)
3842
ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/local/share/hwdata/pci.ids", &pciids);
3943
}
40-
#elif __FreeBSD__
41-
// https://github.com/freebsd/freebsd-src/blob/main/usr.sbin/pciconf/pathnames.h
44+
#elif __FreeBSD__ || __OpenBSD__ || __NetBSD__
4245
ffReadFileBuffer(_PATH_LOCALBASE "/share/pciids/pci.ids", &pciids);
43-
if (pciids.length == 0)
44-
ffReadFileBuffer(FASTFETCH_TARGET_DIR_USR "/share/pciids/pci.ids", &pciids);
4546
#elif __sun
4647
ffReadFileBuffer(FASTFETCH_TARGET_DIR_ROOT "/usr/share/hwdata/pci.ids", &pciids);
47-
#elif __OpenBSD__
48-
ffReadFileBuffer(FASTFETCH_TARGET_DIR_ROOT "/usr/local/share/pci.ids", &pciids);
49-
#elif __NetBSD__
50-
ffReadFileBuffer(FASTFETCH_TARGET_DIR_ROOT "/usr/pkg/share/pciutils/pci.ids", &pciids);
5148
#endif
5249

5350
#endif // FF_CUSTOM_PCI_IDS_PATH

0 commit comments

Comments
 (0)