Make a start on prerequisite data.

This commit is contained in:
Ray Miller 2024-08-15 16:16:53 +01:00
parent 2a8fb2ce5b
commit 6f217e006e
3 changed files with 21 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
scratch/
/.dir-locals.el

View file

@ -0,0 +1,17 @@
(define-module (ordo prerequisite-data)
#:use-module (oop goops))
(define-class <prerequisite-data> ())
(define-class <local-file> (<prerequisite-data>)
(path #:init-keyword #:path #:getter get-path))
(define-method (equal? (x <local-file>) (y <local-file>))
(equal? (get-path x) (get-path y)))
(define (local-file path)
(make <local-file> #:path path))
(define-class <local-lookup> (<prerequisite-data>)
(handler #:init-keyword #:handler #:getter get-handler)
(args #:init-keyword #:args :getter get-args))

View file

@ -34,6 +34,8 @@
;; This is based on reading guix/build/syscalls.scm but less general
;; than their implementation.
;; TODO: why is this needed? The guile standard library has mkdtemp
;; that seems to do the same thing.
(define mkdtemp!
(let* ((ptr (dynamic-func "mkdtemp" (dynamic-link)))
(proc (pointer->procedure '* ptr '(*) #:return-errno? #t)))