From owner-freebsd-questions@freebsd.org Fri Dec 7 06:18:13 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36096132B86D for ; Fri, 7 Dec 2018 06:18:13 +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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AF2279479 for ; Fri, 7 Dec 2018 06:18:12 +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 wB76I9FG078693 for ; Thu, 6 Dec 2018 23:18:09 -0700 (MST) (envelope-from freebsd@dreamchaser.org) Subject: Re: CMakeLists.txt format and generation [SOLVED] From: Gary Aitken To: FreeBSD Mailing List Reply-To: freebsd@dreamchaser.org, freebsd@dreamchaser.org References: <1f3cd5c3-6861-7b03-8073-f2c402c89342@dreamchaser.org> Message-ID: Date: Thu, 6 Dec 2018 23:17:54 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <1f3cd5c3-6861-7b03-8073-f2c402c89342@dreamchaser.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (nightmare.dreamchaser.org [192.168.151.101]); Thu, 06 Dec 2018 23:18:09 -0700 (MST) X-Rspamd-Queue-Id: 3AF2279479 X-Spamd-Result: default: False [-0.95 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[freebsd@dreamchaser.org]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; DMARC_NA(0.00)[dreamchaser.org]; NEURAL_SPAM_MEDIUM(0.01)[0.012,0]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.91)[-0.911,0]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: nightmare.dreamchaser.org]; NEURAL_SPAM_SHORT(0.27)[0.274,0]; IP_SCORE(-0.02)[country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:21947, ipnet:66.109.128.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org 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: Fri, 07 Dec 2018 06:18:13 -0000 On 12/6/18 2:30 PM, Gary Aitken wrote: > Trying to build a dev version of a port, and need to tweak patch-CMakeLists.txt > to match the dev version's CMakeList.txt which is different. > > It's not clear to me how these are generated. > > In particular, if I look at the old one for this port, cad/freecad/files/patch-CMakeLists.txt, I see this: > > --- CMakeLists.txt.orig 2017-07-28 17:35:48 UTC > +++ CMakeLists.txt > @@ -661,33 +661,7 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darw >              if (WIN32) >                  find_package(HDF5 COMPONENTS NO_MODULE REQUIRED static) >              else() > -                find_package(PkgConfig) > > If I look at .../work/xxx/CMakeLists.txt.orig nothing seems to line up. > Starting at line 661, I see: > >         if(UNIX OR WIN32) >             find_package(VTK COMPONENTS vtkCommonCore REQUIRED NO_MODULE) > ... > It is not until line 699 that the above diff lines appear. > > The >   @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darw > referred to on the @@ line is at line 561. > What is its significance, and must this reference be unique? > It looks like it is the closest preceeding conditional beginning at the > first char in a line.  If the new code has an intervening if() and endif(), > referencing the endif won't be unique, but the corresponding if() would be. > > I've tried various tweaks and guesses but can't get make patch to accept > what I've supplied for patch-CMakeLists.txt > > Any helpful hints would be much appreciated. > Thanks, I finally found this link for understanding the format of the patches: http://kirste.userpage.fu-berlin.de/chemnet/use/info/diff/diff_3.html The problem was a missing space at the start of the context lines which were unchanged.