From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id KNERIt7Rw2bfrAAAqHPOHw:P1 (envelope-from ) for ; Mon, 19 Aug 2024 23:14:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id KNERIt7Rw2bfrAAAqHPOHw (envelope-from ) for ; Tue, 20 Aug 2024 01:14:38 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=retrospec.tv header.s=fm3 header.b=BijhY0dg; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="u DJcNSW"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1724109278; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=u7AJZbcWhZNd2AOZoTPihzDLEVofKBmc0xZ4n9Ho4Aw=; b=k40wlrtGRD8LvLGnghIdLk+Q/nYFODkTT0SJKlJDDuwmzXW2gk+xc8RLgI/Ycg/YxCEC6r wPwp4kKtbFVSx9hf7L3EEfwrpvTVDOMd7IQ5GgT0fgLQoj00gN7jKJ8x660IY2FWGUl91m uL01X8qSkJDJnlTN+Yhg5z6Fh4OuWb8f2bdkWFE1Lxjy5n6Nkv087y8Tqq1RqcaG1Y79A8 wtDveydPApmblxi6M7ohoWV3peZpnhEwAT53Lpsr+HFMoTvyXpT+8FMVsvVgEfYHtAG1BO 9mr8WytdSTGAi3/+IbX8GMzzeMaT+2ZplvB9rzKxVv/LTNSvL0eH9gKck9Kmng== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1724109278; a=rsa-sha256; cv=none; b=HZ9doktr1K6zAghiABJRqRD172PCtSwktkH/LrqB7Th9d/NE3gSnpS1sabOtMy2J9Q0rQj q2kZAHAPyhfY4ORBupuP0p/T1Yd+Dn+OVtszhPwv2CiLK9nH3InUrqVizjXjv0udYMFZuE NLhD+szbhriVfrDkf8YiNIrwP+GtoU4Rp/gn+U3EGlYC5T3Eaj7MPk8i22C3OEmizzjdmM h6CoT9+h3BIUa/lAUDt4OPUvgaxRrGncMycxsXXJOuQgCW+O4VUXDTZp1RuZehMoIODD7o q+LQHbV+tCjo8Recavmz2nySuIceB+NzGtOcwfpDOkB2aFBYHKE3iA4ack746w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=retrospec.tv header.s=fm3 header.b=BijhY0dg; dkim=pass header.d=messagingengine.com header.s=fm1 header.b="u DJcNSW"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3DEB13C11C for ; Tue, 20 Aug 2024 01:14:38 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgBZg-00058s-4m; Mon, 19 Aug 2024 19:14:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgBZd-00058e-Uq for help-guix@gnu.org; Mon, 19 Aug 2024 19:14:05 -0400 Received: from fout4-smtp.messagingengine.com ([103.168.172.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgBZb-0003Vz-Jp for help-guix@gnu.org; Mon, 19 Aug 2024 19:14:05 -0400 Received: from phl-compute-05.internal (phl-compute-05.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 5851E138FD0B; Mon, 19 Aug 2024 19:14:02 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Mon, 19 Aug 2024 19:14:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1724109242; x=1724195642; bh=u7AJZbcWhZNd2AOZoTPihzDLEVofKBmc0xZ4n9Ho4Aw=; b= BijhY0dgVR15xHYPxXbIg/a0MpxAstu3rjyORVzb65t5VYIiEuHxEirJ3hRDLvYi WfN26mlWUHqXnJkw2+Z9mSJFuqcxVajFfgqLJdk7kH7Pm7B67P7rkXvPh3njc5a8 w+1oW9Y0pqDlQh4xz2XnQ8ADae1FxxKDNo74fk5UNha9T8y2kMCTk26XBB92vTT3 YutXG2c67LJspZMRt4gQ4HnNLqnUr0yFbTDveFZXrR3WqvHsU0rtybOspQ+rUARN nDXwm/m5Temc05YooAFmODDhxzG1TeARmjV82153eQvBWL80KPQMpos1cGJQM+z6 JX4pzO28M66eCCA0kUMmGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1724109242; x= 1724195642; bh=u7AJZbcWhZNd2AOZoTPihzDLEVofKBmc0xZ4n9Ho4Aw=; b=u DJcNSW2bIBtbrQW7lvSNFoWkFHdlLjS1haexRL3xLeZ9Inu6aJDNGZdQmQD7HMZ9 QlykDWVKddGq6BhosuGdsM06Y2i2uprdYZcoYM1T+LxeQHixlbmGzumtt7PH3E5d YrPsPmL1zRD60pMMIJhvHFSsj5BjNF9xcO8+vxbQhOGbNGfTGKsBph4dlD7Lejim AHCuLdL7SavvHR6JT8wTvoaXlVpymWar4aORnK1+rwUccNOWMazDQxszBSfOUQv6 5/yfcRCMG5bEcpRVkPKRVwxaEIq1dU7EjP/Xy9DQLTOuxs9Fqp6c+iAAj3hctJwe QS9FFJhJJWVj8DrtmGV5g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudduhedgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpehffgfhvf evufffjgfkgggtgfesthhqredttderjeenucfhrhhomhepkfgrnhcugfhurhgvuceoihgr nhesrhgvthhrohhsphgvtgdrthhvqeenucggtffrrghtthgvrhhnpeeukeeugfekteekge dvkeeihffgffdvhedvleelvefgffegieehfeeijeffleejgfenucffohhmrghinhepuggv nhigrdguvgenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpehirghnsehrvghtrhhoshhpvggtrdhtvhdpnhgspghrtghpthhtohepvddpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohephhgvlhhpqdhguhhigiesghhnuhdrohhrghdprh gtphhtthhopeguvghvsehitggvphhitgdruggv X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 19 Aug 2024 19:14:01 -0400 (EDT) References: <87sev0sz4k.fsf@icepic.de> User-agent: mu4e 1.8.13; emacs 28.2 From: Ian Eure To: Christoph Buck Cc: help-guix@gnu.org Subject: Re: Apply a patch to a given package definition Date: Mon, 19 Aug 2024 16:02:10 -0700 In-reply-to: <87sev0sz4k.fsf@icepic.de> Message-ID: <87ikvw3y2u.fsf@meson> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=103.168.172.147; envelope-from=ian@retrospec.tv; helo=fout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -6.64 X-Spam-Score: -6.64 X-Migadu-Queue-Id: 3DEB13C11C X-Migadu-Scanner: mx11.migadu.com X-TUID: hTmO7bFxmWY4 Hi Christoph, Christoph Buck writes: > Hi! > > How do i define a new package which is just a variation of a=20 > given > package defined in guix? > > In my concrete example i try to add a new board definition file=20 > via a > patch to the u-boot bootloader. What i come up with, looks like=20 > this: > > ``` > ;; Defines a package ub which will compile u-boot for the > ;; `new-cool-board` description file > > (define ub (make-u-boot-package "new-cool-board"=20 > "arm-linux-gnueabihf")) > > (define-public u-boot-new-cool-board-arm > (package > (inherit ub) > (version "2024.01") > (source (origin > (patches=20 > '("0001-Add-board-description-for-new-cool-board.patch")) > (method url-fetch) > (uri (string-append > "https://ftp.denx.de/pub/u-boot/" > "u-boot-" version ".tar.bz2")) > (sha256 > (base32 > "1czmpszalc6b8cj9j7q6cxcy19lnijv3916w3dag6yr3xpqi35mr")))= ))) > > ``` > > I create a u-boot variant for my "new-cool-board" using the=20 > build in > `make-u-boot-package` function, then i define a new package and=20 > inherit > from the package variant created with the `make-u-boot-package` > function. Then i overwrite `source` entry with an entry which=20 > also > applies my patch file. This works, however the original u-boot=20 > package > also apply some patches, which are now lost and must manually=20 > added by > me again. This seems rather error prone. Is there a better=20 > solution? > You can have your source inherit from the original package=E2=80=99s, but=20 with modifications -- just like the package itself. This might=20 not be exaxtly right, but should give you the right idea: (define-public u-boot-new-cool-board-arm (package (inherit ub) (version "2024.01") (source (origin (inherit (package-source ub)) (patches (append (origin-patches (package-source ub)) '("0001-Add-board-description-for-new-cool-boar= d.patch"))))))) Any fields you don=E2=80=99t want to modify will be inherited, so you may=20 be able to eliminate the version field as well. =E2=80=94 Ian