From 3723b18c7200c8cd380b7e07f3ec971e5aabcbe8 Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Sun, 11 Oct 2020 11:05:23 -0400 Subject: [PATCH 1/3] gnu: Add linux-surface. * nongnu/packages/linux.scm (linux-surface): New variable. --- nongnu/packages/linux.scm | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm index 35348f39..d33e37e4 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") From e2807a5b3bc062a446160ad86c6d56bae7c834da Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Sun, 11 Oct 2020 11:29:26 -0400 Subject: [PATCH 2/3] fix string-match not being found --- nongnu/packages/linux.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm index d33e37e4..be1ca209 100644 --- a/nongnu/packages/linux.scm +++ b/nongnu/packages/linux.scm @@ -86,6 +86,9 @@ System on hardware which requires nonfree software to function."))) (name "linux-surface") (arguments (substitute-keyword-arguments (package-arguments linux-5.8) + ((#:modules modules) + `((ice-9 regex) + ,@modules)) ((#:phases phases) `(modify-phases ,phases (add-after 'unpack 'apply-patches From bedeac8640e455333188751cf479cb28b40c5139 Mon Sep 17 00:00:00 2001 From: Morgan Smith Date: Sun, 11 Oct 2020 11:29:51 -0400 Subject: [PATCH 3/3] use linux-surface-base instead of linux-5.8 --- nongnu/packages/linux.scm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nongnu/packages/linux.scm b/nongnu/packages/linux.scm index be1ca209..28689ed5 100644 --- a/nongnu/packages/linux.scm +++ b/nongnu/packages/linux.scm @@ -80,12 +80,19 @@ System on hardware which requires nonfree software to function."))) (define-public linux linux-5.8) +(define-public linux-surface-base + (hidden-package + (corrupt-linux linux-libre-5.8 "5.8.14" + "1bzh82jpwcxsdzp6p1r8qlq9v5x79flhnzyimkcll8wdh28pjxpf"))) + (define-public linux-surface (package - (inherit linux-5.8) + (inherit linux-surface-base) (name "linux-surface") + (properties `((hidden? . #f) + ,@(package-properties linux-surface-base))) (arguments - (substitute-keyword-arguments (package-arguments linux-5.8) + (substitute-keyword-arguments (package-arguments linux-surface-base) ((#:modules modules) `((ice-9 regex) ,@modules)) @@ -105,7 +112,7 @@ System on hardware which requires nonfree software to function."))) patches) #t))))))) (native-inputs - `(,@(package-native-inputs linux-5.8) + `(,@(package-native-inputs linux-surface-base) ("linux-surface-patches" ;; Commit marked as release 5.8.14-1 ,(let ((commit "e230e9aeac4635aefccebf9d56b6c0ce838ceb7b"))