diff options
| author | Tobias Geerinckx-Rice <me@tobias.gr> | 2024-10-06 02:00:00 +0200 |
|---|---|---|
| committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2025-02-09 01:00:00 +0100 |
| commit | 5f95d4af6ebaea232e2461284a063e3e0e69bd85 (patch) | |
| tree | 12e8d3330d2ba98de2b83129451cc0b8a3dcf7e3 | |
| parent | f7744227699d27045e87be9eac3464c2f62ff7e3 (diff) | |
gnu: corefreq: Update to 1.98.4.
* gnu/packages/linux.scm (corefreq): Update to 1.98.4.
[arguments]: Set #:source-directory. Remove the
'untangle-module-targets and 'gnu:build phases as they've become too
entangled. Add new 'patch-Makefile, 'prepare, 'resolve-symlink, and
'create-output phases.
Change-Id: Ib7e643108d2e8d75c436706b3dcaedc9c6dd4d27
| -rw-r--r-- | gnu/packages/linux.scm | 58 |
1 files changed, 42 insertions, 16 deletions
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index ce0d37b11b3..30d6b944f2d 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm | |||
| @@ -1530,7 +1530,7 @@ and should be used with caution, especially on untested models.") | |||
| 1530 | (define-public corefreq | 1530 | (define-public corefreq |
| 1531 | (package | 1531 | (package |
| 1532 | (name "corefreq") | 1532 | (name "corefreq") |
| 1533 | (version "1.96.5") | 1533 | (version "1.98.4") |
| 1534 | (source | 1534 | (source |
| 1535 | (origin | 1535 | (origin |
| 1536 | (method git-fetch) | 1536 | (method git-fetch) |
| @@ -1539,7 +1539,11 @@ and should be used with caution, especially on untested models.") | |||
| 1539 | (commit version))) | 1539 | (commit version))) |
| 1540 | (file-name (git-file-name name version)) | 1540 | (file-name (git-file-name name version)) |
| 1541 | (sha256 | 1541 | (sha256 |
| 1542 | (base32 "15wi9v7zcd62ab03zji43l33f1mc70lsdvqylv33kfpaf3k72lm4")))) | 1542 | (base32 "0mxp5h23y09674syaj5gpdifr53zvgjv7g7hargwg6897883qfln")))) |
| 1543 | ;; The upstream Makefile is now such a proprietary mess that standard builds | ||
| 1544 | ;; as performed by our linux-module-build-system are more or less impossible | ||
| 1545 | ;; without heavy patching. However, we still keep it as the main build | ||
| 1546 | ;; system because lifting out LINUX-MODULE-BUILDER would be even messier. | ||
| 1543 | (build-system linux-module-build-system) | 1547 | (build-system linux-module-build-system) |
| 1544 | (outputs (list "out" "linux-module")) | 1548 | (outputs (list "out" "linux-module")) |
| 1545 | (arguments | 1549 | (arguments |
| @@ -1550,30 +1554,52 @@ and should be used with caution, especially on untested models.") | |||
| 1550 | (guix build utils)) | 1554 | (guix build utils)) |
| 1551 | #:make-flags | 1555 | #:make-flags |
| 1552 | #~(list (string-append "CC=" #$(cc-for-target)) | 1556 | #~(list (string-append "CC=" #$(cc-for-target)) |
| 1553 | "OPTIM_LVL=3" | 1557 | "OPTIM_LVL=3" |
| 1554 | (string-append "PREFIX=" #$output)) | 1558 | (string-append "PREFIX=" #$output)) |
| 1555 | #:tests? #f ; no test suite | 1559 | #:tests? #f ;no test suite |
| 1560 | #:source-directory "../build" ;must contain modules.order | ||
| 1556 | #:phases | 1561 | #:phases |
| 1557 | #~(modify-phases %standard-phases | 1562 | #~(modify-phases %standard-phases |
| 1558 | (add-after 'unpack 'untangle-module-targets | 1563 | (add-after 'unpack 'patch-Makefile |
| 1559 | ;; Having to build everything in one pass would complicate the | 1564 | (lambda* (#:key inputs #:allow-other-keys) |
| 1560 | ;; definition. Let each build system handle what it's good at. | 1565 | (let ((dir (search-input-directory |
| 1566 | inputs "lib/modules/build"))) | ||
| 1567 | (substitute* "Makefile" | ||
| 1568 | (("^(KERNELREL \\?= ).*" _ =) | ||
| 1569 | (string-append = (dirname dir) "\n")) | ||
| 1570 | (("^(KERNELDIR \\?= ).*" _ =) | ||
| 1571 | (string-append = dir "\n")) | ||
| 1572 | (("^([[:space:]]+)(.* modules_install.*)" | ||
| 1573 | _ indent command) | ||
| 1574 | (string-append indent "@echo skipping " command)))))) | ||
| 1575 | (add-before 'build 'prepare | ||
| 1576 | (lambda* (#:key source-directory make-flags #:allow-other-keys) | ||
| 1577 | ;; Lazily fix another mismatch between what the kernel module | ||
| 1578 | ;; build system expects and what this package provides. | ||
| 1579 | (symlink "source/build" source-directory) ;$(BUILD) | ||
| 1580 | ;; Set up symbolic links inside $(BUILD), for some reason. | ||
| 1581 | (apply invoke "make" "prepare" make-flags))) | ||
| 1582 | (replace 'build (assoc-ref gnu:%standard-phases 'build)) | ||
| 1583 | (add-before 'install 'resolve-symlink | ||
| 1584 | ;; The build system silently fails to install from a symlink. | ||
| 1561 | (lambda _ | 1585 | (lambda _ |
| 1562 | (substitute* "Makefile" | 1586 | (delete-file "../build") |
| 1563 | ((".*MAKE.*KERNELDIR.*") "")))) | 1587 | (copy-recursively "build" "../build"))) |
| 1564 | (add-after 'build 'gnu:build | 1588 | (add-before 'install 'create-output |
| 1565 | (assoc-ref gnu:%standard-phases 'build)) | 1589 | (lambda _ |
| 1590 | ;; Avoid installing the corefreq binary as …/bin. | ||
| 1591 | (mkdir-p (string-append #$output "/bin")))) | ||
| 1566 | (add-after 'install 'gnu:install | 1592 | (add-after 'install 'gnu:install |
| 1567 | (assoc-ref gnu:%standard-phases 'install)) | 1593 | (assoc-ref gnu:%standard-phases 'install)) |
| 1568 | (add-after 'install 'separate-module | 1594 | (add-after 'install 'separate-module |
| 1569 | (lambda* (#:key outputs #:allow-other-keys) | 1595 | (lambda* (#:key outputs #:allow-other-keys) |
| 1570 | ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an | 1596 | ;; Adding INSTALL_MOD_PATH= to #:make-flags would still create an |
| 1571 | ;; empty <out>/lib/modules directory, so just do it all by hand. | 1597 | ;; empty <out>/lib/modules directory, so just do it all by hand. |
| 1572 | (let* ((out (assoc-ref outputs "out")) | 1598 | (let* ((output (assoc-ref outputs "out")) |
| 1573 | (module (assoc-ref outputs "linux-module"))) | 1599 | (module (assoc-ref outputs "linux-module"))) |
| 1574 | (mkdir-p (string-append module "/lib")) | 1600 | (mkdir-p module) |
| 1575 | (rename-file (string-append out "/lib/modules") | 1601 | (rename-file (string-append output "/lib") |
| 1576 | (string-append module "/lib/modules"))))) | 1602 | (string-append module "/lib"))))) |
| 1577 | (add-after 'install 'install-README | 1603 | (add-after 'install 'install-README |
| 1578 | ;; There is no proper documentation. Provide something. | 1604 | ;; There is no proper documentation. Provide something. |
| 1579 | (lambda* (#:key outputs #:allow-other-keys) | 1605 | (lambda* (#:key outputs #:allow-other-keys) |
