From 4849a5b03f8663f5f01832c2c7191c6e4dbc69bf Mon Sep 17 00:00:00 2001 From: "Christopher R. Nelson" Date: Sun, 26 Mar 2023 12:21:08 -0400 Subject: initial commit --- crn/packages.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 crn/packages.scm (limited to 'crn/packages.scm') diff --git a/crn/packages.scm b/crn/packages.scm new file mode 100644 index 0000000..2d869c9 --- /dev/null +++ b/crn/packages.scm @@ -0,0 +1,48 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020 Andrew Whatson +;;; +;;; This file is NOT part of GNU Guix. +;;; +;;; This program is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation, either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program. If not, see . + +(define-module (crn packages) + #:use-module ((gnu packages) #:prefix gnu:) + #:use-module (guix diagnostics) + #:use-module (guix i18n) + #:use-module (srfi srfi-1) + #:export (search-patch + search-patches + %patch-path)) + +(define (search-patch file-name) + "Search the patch FILE-NAME. Raise an error if not found." + (or (search-path (%patch-path) file-name) + (raise (formatted-message (G_ "~a: patch not found") + file-name)))) + +(define-syntax-rule (search-patches file-name ...) + "Return the list of absolute file names corresponding to each +FILE-NAME found in %PATCH-PATH." + (list (search-patch file-name) ...)) + +(define %channel-root + (find (lambda (path) + (file-exists? (string-append path "/crn/packages.scm"))) + %load-path)) + +(define %patch-path + (make-parameter + (cons + (string-append %channel-root "/crn/packages/patches") + (gnu:%patch-path)))) -- cgit v1.2.3