From owner-freebsd-questions@freebsd.org Mon Oct 21 20:40:44 2019 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBF57161D8B for ; Mon, 21 Oct 2019 20:40:44 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from gate.utahime.jp (gate.utahime.jp [183.180.29.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46xpSC6fM2z3N2x for ; Mon, 21 Oct 2019 20:40:43 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from eastasia.home.utahime.org (eastasia.home.utahime.org [192.168.174.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by gate.utahime.jp (Postfix) with ESMTPS id 6E93C17C61 for ; Tue, 22 Oct 2019 05:40:38 +0900 (JST) Received: from localhost (rolling.home.utahime.org [192.168.174.11]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by eastasia.home.utahime.org (Postfix) with ESMTPSA id 8F4AC4CF5D; Tue, 22 Oct 2019 05:40:37 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.0-rc at eastasia.home.utahime.org Date: Tue, 22 Oct 2019 05:39:26 +0900 (JST) Message-Id: <20191022.053926.1076439053946694541.yasu@utahime.org> To: freebsd-questions@freebsd.org Subject: Re: How to apply a patch to a port From: Yasuhiro KIMURA In-Reply-To: References: X-Mailer: Mew version 6.8 on Emacs 26.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46xpSC6fM2z3N2x X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of yasu@utahime.org designates 183.180.29.210 as permitted sender) smtp.mailfrom=yasu@utahime.org X-Spamd-Result: default: False [0.09 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-0.93)[-0.933,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a:spf-authorized.utahime.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.50)[-0.499,0]; RCVD_COUNT_THREE(0.00)[3]; DMARC_NA(0.00)[utahime.org]; MV_CASE(0.50)[]; MID_CONTAINS_FROM(1.00)[]; IP_SCORE(0.32)[ip: (0.21), ipnet: 183.180.0.0/16(0.10), asn: 2519(1.30), country: JP(-0.00)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:2519, ipnet:183.180.0.0/16, country:JP]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2019 20:40:45 -0000 From: "Clay Daniels Jr." 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