How to apply a patch to a port

Clay Daniels clay.daniels.jr at
Mon Oct 21 23:21:24 UTC 2019

On 10/21/19 3:39 PM, Yasuhiro KIMURA wrote:
> Assuming that you don't set WRKDIRPREFIX in /etc/make.conf, take
> following steps.
No, make.conf does not yet exist.
> 1. cd /usr/ports/graphics/drm-current-kmod
OK, but should my patch file be here, or do I need to make a /files 
subdirectory and put it there?
> 2. make patch
> 3. cd work/kms-drm-2d2852e
> 4. patch -p 0 -s -i /path/to/patch/patch-linuxkpi_gplv2_src_linux__page.c
>     (You may need to change '-p 0' to '-p 1' or '-p 2' or ...)
> 5. cd ../..
> 6. make makepatch
> 7. make clean
> Then new patch file is created under files subdirectory.

Then change back to main port directory & run make install (clean) for 
the whole port, right?

I have just now re-installed a fresh FreeBSD installation. I'm going to 
wait until I figure out this /files subdirectory. I'm not comfortable 
with having to create it. Just to look at another port I intend to 
install later, located at /usr/ports/security/gnupg, it already has a 
files directory.


> ---
> Yasuhiro KIMURA
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

More information about the freebsd-questions mailing list