diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm index 35348f3..d33e37e 100644 --- a/nongnu/packages/linux.scm +++ b/nongnu/packages/linux.scm @@ -80,6 +80,41 @@ System on hardware which requires nonfree software to function."))) (define-public linux linux-5.8) +(define-public linux-surface + (package + (inherit linux-5.8) + (name "linux-surface") + (arguments + (substitute-keyword-arguments (package-arguments linux-5.8) + ((#:phases phases) + `(modify-phases ,phases + (add-after 'unpack 'apply-patches + (lambda* (#:key inputs #:allow-other-keys) + (let* ((patch-dir + (string-append (assoc-ref inputs "linux-surface-patches") + "/patches/5.8")) + (patches (scandir patch-dir + (lambda (file) (string-match ".*.patch" file))))) + (for-each + (lambda (patch) + (invoke "patch" "-p1" "-i" + (string-append patch-dir "/" patch))) + patches) + #t))))))) + (native-inputs + `(,@(package-native-inputs linux-5.8) + ("linux-surface-patches" + ;; Commit marked as release 5.8.14-1 + ,(let ((commit "e230e9aeac4635aefccebf9d56b6c0ce838ceb7b")) + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/linux-surface/linux-surface") + (commit commit))) + (sha256 + (base32 "07b7pf9yn2v7qqkqxg18jvmf9a4fkykv9ah6piam09rf64b2v7na")) + (file-name (git-file-name "linux-surface-patches" commit))))))))) + (define-public linux-firmware (package (name "linux-firmware")