Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22f092c8f0
|
@@ -1,5 +1,10 @@
|
||||
(define-module (oerv packages rvck)
|
||||
#:use-module (guix git)
|
||||
#:use-module (srfi srfi-71)
|
||||
#:use-module (guix store)
|
||||
#:use-module (guix http-client)
|
||||
#:use-module (guix import json)
|
||||
#:use-module (json)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (gnu packages linux)
|
||||
#:use-module (gnu packages cpio)
|
||||
@@ -7,7 +12,8 @@
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix utils)
|
||||
#:export (make-linux-rvck))
|
||||
#:export (make-linux-rvck
|
||||
make-linux-rvck-from-github-pr))
|
||||
|
||||
(define make-linux-libre* (@@ (gnu packages linux) make-linux-libre*))
|
||||
|
||||
@@ -61,6 +67,45 @@
|
||||
(modify-inputs (package-native-inputs base)
|
||||
(append cpio))))))
|
||||
|
||||
(define* (make-linux-rvck-from-github-pr
|
||||
#:key
|
||||
(name "linux-rvck")
|
||||
(defconfig "defconfig")
|
||||
(pr-number #f)
|
||||
(version "6.6.101")
|
||||
(url "https://github.com/rvck-project/rvck"))
|
||||
(let ((clone_url sha hash (github-pr #:repo (pk 'sc url) #:pr-number pr-number)))
|
||||
(make-linux-rvck
|
||||
#:url clone_url
|
||||
#:version version
|
||||
#:hash hash
|
||||
#:commit sha
|
||||
#:defconfig defconfig)))
|
||||
|
||||
|
||||
(define* (github-pr
|
||||
#:key
|
||||
(repo "RVCK-Project/rvck")
|
||||
pr-number)
|
||||
(define repo* (if (string-prefix? "https://github.com/" repo)
|
||||
(string-drop repo (string-length "https://github.com/"))
|
||||
repo))
|
||||
(define meta (json-fetch
|
||||
(string-append "https://api.github.com/repos/"
|
||||
repo*
|
||||
"/pulls/"
|
||||
(number->string pr-number))))
|
||||
(define ref (assoc-ref (assoc-ref meta "head") "ref"))
|
||||
(define sha (assoc-ref (assoc-ref meta "head") "sha"))
|
||||
(define clone_url (assoc-ref (assoc-ref (assoc-ref meta "head") "repo") "clone_url"))
|
||||
(let ((o hash (with-store store
|
||||
(latest-repository-commit store clone_url
|
||||
#:ref `(commit . ,sha)))))
|
||||
(pk 'o o 'sha sha 'clone_url clone_url 'hash hash)
|
||||
(values clone_url sha hash)))
|
||||
|
||||
|
||||
|
||||
(define-public linux-rvck
|
||||
(make-linux-rvck
|
||||
#:commit "b2214529735a61b93960f43e4235706329cdbe09"
|
||||
|
||||
Reference in New Issue
Block a user