Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Oct 2019 05:39:26 +0900 (JST)
From:      Yasuhiro KIMURA <yasu@utahime.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: How to apply a patch to a port
Message-ID:  <20191022.053926.1076439053946694541.yasu@utahime.org>
In-Reply-To: <CAGLDxTW8VCjfKGAEp9b1gn_==XsxRjSizvRbiw%2BTkzRgt49hDA@mail.gmail.com>
References:  <CAGLDxTW8VCjfKGAEp9b1gn_==XsxRjSizvRbiw%2BTkzRgt49hDA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
From: "Clay Daniels Jr." <clay.daniels.jr@gmail.com>
Subject: How to apply a patch to a port
Date: Mon, 21 Oct 2019 15:23:51 -0500

> I have a patch to apply to a port:
> patch-linuxkpi_gplv2_src_linux__page.c
> /usr/ports/graphics/drm-current-kmod
> 
> I've looked at the Handbook Chap 4.4-Patching. Several times...
> 
> This is on a fresh base install of this week's snapshot.
> I have the ports and source installed in the base, but none "made".
> 
> I go to the drm-current-kmod port directory.
> There is no files subdirectory, so I make one.
> I copy the patch to:
> /usr/ports/graphics/drm-current-kmod/files
> Then cd to main port directory, run "make makepatch" like it says in the
> Handbook,
> which creates a /work subdirectory.
> Then I run "make install" (no clean yet) which cannot seem to find my
> patch, and asks for patch:
> I tried giving it the full path but it still did not find it. I am new to
> patching (obviously).
> What am I doing wrong?

Assuming that you don't set WRKDIRPREFIX in /etc/make.conf, take
following steps.

1. cd /usr/ports/graphics/drm-current-kmod
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.

---
Yasuhiro KIMURA



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20191022.053926.1076439053946694541.yasu>