FreshPorts / freshports

The website part of FreshPorts
http://www.freshports.org/
BSD 2-Clause "Simplified" License
69 stars 24 forks source link

Where src is a requirement, maybe offer a hint #365

Open grahamperrin opened 2 years ago

grahamperrin commented 2 years ago

https://gitter.im/FreeBSDDesktop/Lobby/archives/2022/06/25?at=62b7477f1227f62be3c5c326:

All ports kmod builds require the kernel source. It must be in /usr/src unless SRC_TOP is set.

So, for example, https://www.freshports.org/graphics/drm-510-kmod/#add is not entirely true:

To install the port: cd /usr/ports/graphics/drm-510-kmod/ && make install clean

https://github.com/FreshPorts/freshports/issues/152#issue-628006547 had the svnweb reference for what's now (in Git):

https://github.com/freebsd/freebsd-ports/blob/main/Mk/Uses/kmod.mk

– essentially, from https://github.com/freebsd/freebsd-ports/commit/d24567369ec79e227da796ae022efc1c9ba9fdf2

… trying to build kmod ports without a src tree in /usr/src results in a failure reporting that the build requires kernel source files in /usr/src. …

As a nicety (not essential), FreshPorts would benefit from a generic hint for this class of port. For the reader to know the requirement, before encountering the failure.

dlangille commented 2 years ago

Adding new features, such this, which can be handled entirely within code, is the goal.

For knowing that /usr/src is required, how do we detect that?

Via USES= kmod?

CyberCr33p commented 2 years ago

Via USES= kmod?

I know that wireguard-kmod port needs /usr/src , so you are correct:

grep -R 'USES=' /usr/ports | grep kmod

/usr/ports/multimedia/cx88/Makefile:USES=                       kmod libedit pkgconfig uidfix
/usr/ports/multimedia/pwcbsd/Makefile:USES=             kmod
/usr/ports/multimedia/linux_dvbwrapper-kmod/Makefile:USES=              kmod uidfix
/usr/ports/multimedia/ptx-kmod/Makefile:USES=           kmod shebangfix
/usr/ports/misc/utouch-kmod/Makefile:USES=              kmod uidfix
/usr/ports/misc/raspberrypi-gpioshutdown/Makefile:USES=         kmod
/usr/ports/misc/dahdi-kmod26/Makefile:USES=             kmod uidfix
/usr/ports/misc/dahdi-kmod/Makefile:USES=               kmod uidfix
/usr/ports/sysutils/rtsx-kmod/Makefile:USES=            kmod uidfix
/usr/ports/sysutils/kvmclock-kmod/Makefile:USES=                kmod uidfix
/usr/ports/sysutils/mac_nonet/Makefile:USES=            kmod uidfix
/usr/ports/sysutils/pefs-kmod/Makefile:USES=            kmod uidfix
/usr/ports/sysutils/openzfs-kmod/Makefile:USES=         cpe kmod
/usr/ports/sysutils/acerhdf-kmod/Makefile:USES=         kmod uidfix
/usr/ports/sysutils/mbgtools/Makefile:USES=             kmod uidfix
/usr/ports/sysutils/acpi_call/Makefile:USES=            kmod
/usr/ports/sysutils/vordog/Makefile:USES=               kmod
/usr/ports/sysutils/sysctlinfo-kmod/Makefile:USES=              kmod
/usr/ports/sysutils/sysctlbyname-improved-kmod/Makefile:USES=           kmod
/usr/ports/sysutils/biosfont/Makefile:USES=             uidfix kmod
/usr/ports/sysutils/mac_rtprio/Makefile:USES=           kmod uidfix
/usr/ports/sysutils/nfs-over-tls/Makefile:USES=         kmod ssl
/usr/ports/sysutils/bhyve+/Makefile:USES=               kmod uidfix
/usr/ports/sysutils/iichid/Makefile:USES=       kmod uidfix
/usr/ports/emulators/rtc/Makefile:USES=         kmod uidfix
/usr/ports/emulators/open-vm-tools/Makefile:USES=               autoreconf gettext-runtime gnome kmod libtool localbase \
/usr/ports/emulators/virtualbox-ose-kmod-legacy/Makefile:USES=          cpe kmod tar:bzip2
/usr/ports/emulators/parallels-tools/Makefile:USES=             kmod tar:bzip2 uidfix
/usr/ports/emulators/virtualbox-ose-additions-legacy/Makefile:USES=             compiler:c++11-lang cpe iconv kmod tar:bzip2
/usr/ports/emulators/virtualbox-ose-additions/Makefile:USES=            compiler:c++11-lang cpe iconv kmod tar:bzip2
/usr/ports/emulators/virtualbox-ose-kmod/Makefile:USES=         cpe compiler:c++14-lang kmod tar:bzip2
/usr/ports/x11/nvidia-driver/Makefile:USES=             kmod uidfix xorg
/usr/ports/devel/arduino/Makefile:USES=         dos2unix tar:tgz kmod
/usr/ports/net-mgmt/ng_ipacct/Makefile:USES=            kmod uidfix
/usr/ports/security/ktls_isa-l_crypto-kmod/Makefile:USES=               kmod uidfix
/usr/ports/security/quantis-kmod/Makefile:USES=         kmod uidfix zip:infozip
/usr/ports/security/isal-kmod/Makefile:USES=            kmod uidfix
/usr/ports/audio/oss/Makefile:USES=             gnome tar:bzip2 kmod pkgconfig
/usr/ports/audio/mikmod/Makefile:USES=          gmake ncurses
/usr/ports/audio/libmikmod/Makefile:USES=               cpe gmake libtool pathfix pkgconfig
/usr/ports/Mk/Uses/kmod.mk:# Usage:     USES=kmod
/usr/ports/Mk/Uses/kmod.mk:IGNORE=      USES=kmod takes either no arguments or 'debug'
/usr/ports/CHANGES:  USES=kmod takes no arguments and:
/usr/ports/net/aoe/Makefile:USES=       kmod
/usr/ports/net/nfs-ganesha-kmod/Makefile:USES=          kmod
/usr/ports/net/isboot-kmod/Makefile:USES=               kmod uidfix
/usr/ports/net/dpdk/Makefile:USES=              meson kmod pkgconfig:both shebangfix tar:xz python:3.5+
/usr/ports/net/ndproxy/Makefile:USES=           compiler kmod
/usr/ports/net/malo-firmware-kmod/Makefile:USES=                kmod uidfix
/usr/ports/net/dpdk-20.11/Makefile:USES=                meson kmod pkgconfig:both shebangfix tar:xz python:3.5+
/usr/ports/net/ng_mikrotik_eoip/Makefile:USES=          kmod uidfix
/usr/ports/net/bwi-firmware-kmod/Makefile:USES=         kmod uidfix
/usr/ports/net/wireguard-kmod/Makefile:USES=            kmod tar:xz uidfix
/usr/ports/net/bwn-firmware-kmod/Makefile:USES=         kmod uidfix
/usr/ports/net/realtek-re-kmod/Makefile:USES=           kmod tar:tgz uidfix
/usr/ports/net/intel-ixl-kmod/Makefile:USES=            kmod
/usr/ports/net/vether-kmod/Makefile:USES=               kmod uidfix
/usr/ports/net/aquantia-atlantic-kmod/Makefile:USES=            kmod uidfix
/usr/ports/graphics/drm-kmod/Makefile:USES=             metaport
/usr/ports/graphics/drm-fbsd13-kmod/Makefile:USES=              kmod uidfix compiler:c++11-lang
/usr/ports/graphics/plasma-kmod/Makefile:USES=          kmod uidfix
/usr/ports/graphics/drm-510-kmod/Makefile:USES=         kmod uidfix compiler:c++11-lang
/usr/ports/graphics/drm-fbsd12.0-kmod/Makefile:USES=            kmod uidfix compiler:c++11-lang
/usr/ports/graphics/gpu-firmware-radeon-kmod/Makefile:USES=             kmod uidfix
/usr/ports/graphics/gpu-firmware-amd-kmod/Makefile:USES=                kmod uidfix
/usr/ports/graphics/gpu-firmware-intel-kmod/Makefile:USES=              kmod uidfix
/usr/ports/graphics/drm-54-kmod/Makefile:USES=          kmod uidfix compiler:c++11-lang
/usr/ports/graphics/gpu-firmware-kmod/Makefile:USES=            metaport
/usr/ports/comms/uartlirc/Makefile:USES=                kmod
/usr/ports/comms/uarduno/Makefile:USES=         kmod uidfix
/usr/ports/comms/opencbm-kmod/Makefile:USES=    kmod uidfix