From owner-freebsd-questions@freebsd.org Sat Jan 23 03:33:34 2021 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 AB4AE4E1E4F for ; Sat, 23 Jan 2021 03:33:34 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from nightmare.dreamchaser.org (ns.dreamchaser.org [66.109.141.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dreamchaser.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DN1tj2Tgcz4qZx for ; Sat, 23 Jan 2021 03:33:32 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from breakaway.dreamchaser.org (breakaway [192.168.151.122]) by nightmare.dreamchaser.org (8.15.2/8.15.2) with ESMTP id 10N3XKAK016984; Fri, 22 Jan 2021 20:33:20 -0700 (MST) (envelope-from freebsd@dreamchaser.org) Reply-To: freebsd@dreamchaser.org Subject: Re: tweaking a port (build issue) To: FreeBSD Mailing List Cc: Christoph Brinkhaus , Polytropon References: From: Gary Aitken Message-ID: <9c72d8fa-e60b-9953-0002-a61e012a1870@dreamchaser.org> Date: Fri, 22 Jan 2021 20:28:35 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (nightmare.dreamchaser.org [192.168.151.101]); Fri, 22 Jan 2021 20:33:20 -0700 (MST) X-Rspamd-Queue-Id: 4DN1tj2Tgcz4qZx X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@dreamchaser.org designates 66.109.141.57 as permitted sender) smtp.mailfrom=freebsd@dreamchaser.org X-Spamd-Result: default: False [-3.30 / 15.00]; HAS_REPLYTO(0.00)[freebsd@dreamchaser.org]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; REPLYTO_ADDR_EQ_FROM(0.00)[]; DMARC_NA(0.00)[dreamchaser.org]; SPAMHAUS_ZRD(0.00)[66.109.141.57:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-0.999]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[66.109.141.57:from]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:21947, ipnet:66.109.128.0/19, country:US]; MAILMAN_DEST(0.00)[freebsd-questions]; FREEMAIL_CC(0.00)[t-online.de,edvax.de] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jan 2021 03:33:34 -0000 On 1/22/21 1:27 AM, Christoph Brinkhaus wrote: > Am Thu, Jan 21, 2021 at 05:17:15PM -0700 schrieb Gary Aitken: > > Hi Gary, > >> I'm trying to tweak a port (cad/freecad) and am having an issue getting the >> build to work. >> >> I modified a file in the /usr/ports/cad/freecad directory tree >> work/FreeCAD-0.18.4/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp >> and did: >> pkg deinstall >> make build >> make install >> pkg deinstall >> modify something else >> make build >> doesn't look like anything changed. >> >> Apparently I'm using some old forgotten lore which is wrong... clues? ...> To preserve > the change it should be the best practice to follow the porters > handbook. > After make extract copy the orininal file to > ViewProviderSketch.cpp.orig. Then modify the cpp file. > cd to /usr/ports/cad/freecad and run make makepatch. > Now a patch-ViewProviderSketch.cpp or so should have been generated in > /usr/ports/cad/freecad/files. May be the path to the file is added to > the name after the patch-. make makepatch takes are for the proper > file name. Thanks, I didn't know about makepatch. I see it is in the new version of the porter's handbook but not in my 2020-08-09 (11.4) version Unfortunately, there was a file which I did *not* modify which also had a .orig version. In the files directory, a patch was generated for that file also. The build failed because of that patch. Renaming the failed patch to no-patch... prevented it from being used. I'm assuming the .orig file is cruft left over from the porting process. The above process works, but it's painfully slow, rebuilding the whole port rather than just the changed file, the library it's in, and the final executable. Is there an easy way to get just those rebuilt? On 1/21/21 10:23 PM, Polytropon wrote: > You probably don't need to invoke pkg manually. The "deinstall" > target should do that, as it did in ye olden times. Thanks > After making a code change, try this: >> # cd /usr/ports/cad/freecad > # make deinstall <--- remove installed program > # make clean <--- remove compiler cruft > # make <--- build everything new > # make reinstall <--- (re)install program > > This should work as expected even in the modern pkg times. :-) Nope. The make clean deletes the work subtree, and the changes, so you're back where you started. Gary