From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id aDq/EWvELWS8PwAASxT56A (envelope-from ) for ; Wed, 05 Apr 2023 20:56:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id sN9pEGvELWTyVwEAG6o9tA (envelope-from ) for ; Wed, 05 Apr 2023 20:56:43 +0200 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 8947E12BCD for ; Wed, 5 Apr 2023 20:56:42 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pk8J2-0006kg-SA; Wed, 05 Apr 2023 14:56:28 -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 1pk8J0-0006kX-Uz for help-guix@gnu.org; Wed, 05 Apr 2023 14:56:26 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pk8Iy-0008Ov-Gu for help-guix@gnu.org; Wed, 05 Apr 2023 14:56:26 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 8F9C6240273 for ; Wed, 5 Apr 2023 20:56:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1680720981; bh=76pBHXEmsjzLZb7QMrlGSbanVLCL6ICBMZ8whPwszlA=; h=From:To:Subject:Date:From; b=mJzU3KMf+35MrdjxrdF8CTYV2k64r5QhBpYgufWK3AvuUsAq5BLj11bJEOD9bI42m zuIurWPOhL/V8wJuuNqkCW0dFGB8/j2ZHb0PiIyrRaBTYvMDV6biIGxG/iVvn3BLBf NXs6nuuc/BgwGTaeMipGeXGx1vUeFGvtHYnzFLlaznFHr4WyJMSpKeE2mAMWxl5DHW Ja/0qFzGOh4+6BP9fkdBob5uVz80o4BjNrogwlEKp2huAePYxLv+rLYqnjn5awXkem Sw9j3cTbLOccTLwEckDHCO3Eu8s6j0gGl22j8dfTJXVzQaeTYf/tkNlLsGE/9udC2H AAjDa0HEPEY1g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PsDPJ5K1pz9rxL for ; Wed, 5 Apr 2023 20:56:20 +0200 (CEST) From: Kyle Andrews To: help-guix Subject: Advice on handling optional dependencies or packaging yp-tools Date: Wed, 05 Apr 2023 16:04:17 +0000 Message-ID: <87wn2qupil.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=kyle@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1680721003; a=rsa-sha256; cv=none; b=fUP6O3zPFqnwz9eh1E5DgtG+BB0yEETnThbzmk1YWBoD482yJnupCT6K/aoSZxvUOsw83Y 8s1mIS/Pg+cq8l2iX6at/CARqtoGWxtSdeDCO7WcGYMpsb6xVMW/RHnNqmIO5d7qN7F8A9 enWuCr4x1v6TQNqcv14720dvAMLNnOeEmtAvUv/zDNv9mQpzHH+axSunxZ8u8T4k7/xd6K WfPKlepjRKzQZRtAEGs2jYOBkXLl1J7UROBNUUBzfPmq1NZlAeAzCV8xIPLk3Q/2RQ4ec9 rF6qrdJ16nc9H4R8cB+68jGS7qBkgYkX3DqbRkseaW1zY6ff5So8uWnS3670lg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=mJzU3KMf; dmarc=pass (policy=none) header.from=posteo.net; 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=1680721003; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=asY68b79HzxMcc2Y7X+6xfWXgR9ApSXgZbWcRsPrs0s=; b=n79VXuJtYIhyIhBoGPfMJmnWLwDQK1WlvBAoExQVa8/DhMUD2HtOT48fvHQD/cHmPfBv/W ZnrzdWLoFICUHm5WI6UpHD7CQ2Mqzbp92Psq3AUjOeAEXu3URpLm6frkHg470tbY1Ee4t0 ne3LFKhTxoup0yZFGivxKqqqMRzSNtjsPEV6g3sHG89QH2dn5Pmu3Jt0WayJ/fkOTwUOit 5dwQ/w1uo3WrDGnsxiMSuqBMMUp19qIdr1tLjHFtIxiKAXxIcgNak0YHF6epB2sTBXKhQZ pQNdIP+PJEzLs9UbSSxkmbIc2jXfqtw5hsWAHIoyuafYhFBhUuYXwdlmPjxxfw== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=mJzU3KMf; dmarc=pass (policy=none) header.from=posteo.net; 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" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -8.01 X-Spam-Score: -8.01 X-Migadu-Queue-Id: 8947E12BCD X-TUID: KWj4yCo8nCx+ Dear Guix, I'd like to be able to have access the yp-tools package with Guix from a foreign distro. Particularly, I want to be able to call yp-cat since I have placed some optional functionality which does this in an R package using it's `system` command. I had been using yp-cat on Ubuntu (where I use Guix as a foreign distro) to help get some additional data about the meaning of some registration codes setup and configured and provided by the network administrators. I am not knowledgeable about networking and just want to package up my workflow on Guix while also perhaps being able to have the shell environment fall through to the Ubuntu yp-tools configuration if it's not available in Guix. I'm guessing that the output from yp-cat would be fairly installation specific, and I am not relying on it for the workflow. It's just their because some optional R code can use it if it's available which will otherwise error. R tends to inject some library paths into it's system calls in `/gnu/store/*-r-minimal-*/lib/R/etc/ldpaths`. However, I can override this by including an .Renviron file that can set LD_LIBRARY_PATH explicitly or I can set it directly at system call time. Maybe this is the right way to go about it? Just use the Ubuntu version and ignore this input from Guix? Does or should Guix support specifying metadata which would say that something was a passthrough dependency to a library on a foreign distribution? I'm seeking guidance on what the best approach for dealing with this would be. If the package is pretty simple to write and it's just a matter of me needing to learn how to work through making a few substitutions in the source code I would be happy to go through that exercise. If not, then at least I want to record what my approach was in the hopes it might inspire others to try and verbalize their packaging strategies so that it becomes easier for new users to get started in the future. The package uses autotools and friends. I thought I had figured out most of the build dependencies. However, now I'm not so sure. The current error mentions the libcom library which in debian depends on epics-base and doesn't appear to be provided by Guix. Here is what my package looks like so far. ``` (use-modules (guix git-download) (guix packages) (guix build utils) (gnu packages gettext) (guix licenses) (gnu packages m4) (gnu packages base) (gnu packages kerberos) (guix gexp) (gnu packages onc-rpc) (gnu packages crypto) (gnu packages pkg-config) (gnu packages autotools) (guix build-system gnu)) (package (name "yp-tools") (version "v4.2.3") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/thkukuk/yp-tools.git") (commit version))) (file-name (git-file-name name version)) (sha256 (base32 "1gbh03sfp05hh9qfg95qf22x5zvfalf20am48g4r4rprv9n3vm3v")))) (build-system gnu-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-after 'unpack 'fix-varyp (lambda _ (substitute* `("etc/Makefile.am") (("varypdir = /var/yp") (string-append "varypdir = " #$output "/var/yp"))) #t))))) (native-inputs (list m4 automake autoconf mit-krb5 libnsl libtirpc libxcrypt binutils gettext-minimal pkg-config libtool)) (description #f) (home-page #f) (synopsis #f) (license gpl2)) ``` grep'ing for other locations with hardcoded values for /var/yp I saw ${SOURCE}/src/yp_dump_binding.c and ${SOURCE}/etc/nicknames.h. I suppose they would also need to be substituted like above. I'm not very familiar with autotools or how to think about it. I read the gentoo overview which helped give me the big picture of how makefiles and configure scripts are generated portably, but it didn't give me any further insights towards actually patching a program. => https://devmanual.gentoo.org/general-concepts/autotools/index.html The more effective thing I did was search through the Guix source code for packages which might serve as examples. The thing which seemed the most effective was to look through packages under lines with (add-after 'unpack ...) in them. I also thought to read the packages made for Debian and Arch Linux. => https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=yp-tools => https://packages.debian.org/bullseye/yp-tools I was confused that libcom was not listed as a dependency on Debian. => https://packages.debian.org/sid/libcom3.17.6 => https://github.com/epicsdeb/epics-base I tried to package up epics but I didn't get far. ``` (use-modules (guix git-download) (guix packages) (gnu packages perl) (guix build utils) (guix licenses) (guix gexp) (gnu packages pkg-config) (guix build-system gnu)) (package (name "epics") (version "3.15.6") (source (origin (method git-fetch) (uri (git-reference (url "https://github.com/epicsdeb/epics-base.git") (commit "c595b238d04c7f5aaa739c9a6976487709d952bd"))) (file-name (git-file-name name version)) (sha256 (base32 "0knck7gw6m93881vm7hqf50wl9ccka3rqny71k7p88z59vhfdyri")))) (build-system gnu-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (delete 'configure)))) (native-inputs (list pkg-config perl)) (description #f) (home-page #f) (synopsis #f) (license #f)) ``` It seems to have a whole configuration directory instead of just a ./configure script. Another issue is that this package uses a custom license and I'm not sure whether it is a variant of one of the existing licenses or if there needs to be an additional entry in Guix licenses. That was a bit of a mouthful. Obviously, after packaging epics, libcom would also need to be packaged. I will stop there and see if anyone thinks they might be able to offer some advice. Thanks, Kyle