Holy shit they did it

https://issues.guix.gnu.org/76770#7
538fc4917f
This commit is contained in:
Kimapr 2025-04-12 15:09:31 +05:00
parent 9264265c7b
commit b008d601ce
Signed by: kimapr
GPG key ID: 9F631B9803377CE4

View file

@ -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))))))