From b008d601ce1db886d1e51a46c7d515937a96f381 Mon Sep 17 00:00:00 2001 From: Kimapr Date: Sat, 12 Apr 2025 15:09:31 +0500 Subject: [PATCH] Holy shit they did it https://issues.guix.gnu.org/76770#7 https://codeberg.org/guix/guix-mirror/commit/538fc4917f55cb2ab0b7c090de00855fa421db69 --- kimapr/packages/override.scm | 76 ++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 39 deletions(-) diff --git a/kimapr/packages/override.scm b/kimapr/packages/override.scm index d9ffc76..3abb5f9 100644 --- a/kimapr/packages/override.scm +++ b/kimapr/packages/override.scm @@ -4,13 +4,16 @@ #:use-module (guix packages) #:use-module ((gnu packages base) #:prefix gnu:) - #:use-module ((gnu packages lua) - #:prefix gnu:) #:use-module ((gnu packages video) #:prefix gnu:) #:use-module ((gnu packages audio) #:prefix gnu:) - #:replace (lua-5.4 ffmpeg-7 ffmpeg)) + #:replace (ffmpeg-7 ffmpeg)) + + +;; +;; Utils +;; (define rewrite-rules '()) @@ -19,17 +22,37 @@ (set! rewrite-rules (cons `(,old unquote new) rewrite-rules)) new) -;; Guix won't merge my patch for this after 1 grillion years -(define lua-5.4 - (add-rewrite gnu:lua-5.4 - (package - (inherit gnu:lua-5.4) - (arguments - (substitute-keyword-arguments (package-arguments gnu:lua-5.4) - ((#:make-flags flags) - (append (list-head flags - (- (length flags) 1)) - '("linux-readline")))))))) +(define-public (specs/pkgs->pkgs pkgs) + (map (lambda (x) + (if (string? x) + (specification->package x) x)) pkgs)) + +(define-public (unfuck-packages pkgs) + ;; kind of a hack but i'm laziggy + ;; P.S. this too ktoo much work to debug goddamn i shoud ve done somehting less sus amongus + (map (lambda (x) + (if (string? (car x)) + (let ((y (cdr x))) + (if (pair? (cdr y)) y + (car y))) x)) + (package-inputs ((package-input-rewriting rewrite-rules) + (package + (inherit gnu:hello) + (inputs pkgs)))))) + +(define-public (unpropagate-inputs pkg) + (set! pkg + (car (specs/pkgs->pkgs `(,pkg)))) + (package + (inherit pkg) + (inputs (append (package-inputs pkg) + (package-propagated-inputs pkg))) + (propagated-inputs '()))) + + +;; +;; packag +;; (define (unfuck-ffmpeg ffmpeg) (add-rewrite ffmpeg @@ -49,30 +72,5 @@ (define ffmpeg (unfuck-ffmpeg gnu:ffmpeg)) -(define-public (unpropagate-inputs pkg) - (package - (inherit pkg) - (inputs (append (package-inputs pkg) - (package-propagated-inputs pkg))) - (propagated-inputs '()))) - (define-public mpv-noprop-gnu (unpropagate-inputs gnu:mpv)) - -(define-public (specs/pkgs->pkgs pkgs) - (map (lambda (x) - (if (string? x) - (specification->package x) x)) pkgs)) - -(define-public (unfuck-packages pkgs) - ;; kind of a hack but i'm laziggy - ;; P.S. this too ktoo much work to debug goddamn i shoud ve done somehting less sus amongus - (map (lambda (x) - (if (string? (car x)) - (let ((y (cdr x))) - (if (pair? (cdr y)) y - (car y))) x)) - (package-inputs ((package-input-rewriting rewrite-rules) - (package - (inherit gnu:hello) - (inputs pkgs))))))