diff --git a/artoria/packages.scm b/artoria/packages.scm new file mode 100644 index 0000000..3b52186 --- /dev/null +++ b/artoria/packages.scm @@ -0,0 +1,30 @@ +(define-module (artoria 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 "/artoria/packages.scm"))) + %load-path)) + +(define %patch-path + (make-parameter + (append + (list (string-append %channel-root "/artoria/packages/patches")) + (gnu:%patch-path)))) diff --git a/artoria/packages/gl.scm b/artoria/packages/gl.scm index 47287ee..1c50247 100644 --- a/artoria/packages/gl.scm +++ b/artoria/packages/gl.scm @@ -40,6 +40,8 @@ #:use-module (guix packages) #:use-module (guix utils) #:use-module (ice-9 match) + #:use-module (artoria packages) ; patches + #:use-module ((srfi srfi-1) #:hide (zip)) #:use-module ((guix licenses) #:prefix license:))