unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* chromebook-ucm-conf
@ 2023-11-20 18:28 Caleb Herbert
  0 siblings, 0 replies; 2+ messages in thread
From: Caleb Herbert @ 2023-11-20 18:28 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 618 bytes --]

Hi Guix,

Can anyone help me get my audio working?

I've been trying to "install" some configuration files for my audio 
setup on a Chromebook. On a normal GNU/Linux system, one installs them 
under /usr/share, but Guix doesn't have that, so I made a package based 
on alsa-ucm-conf.

But packaging the config files is not enough, it seems. You also have to 
modify alsa-lib, which efraim was kind enough to do last night.

But apparently, alsa-lib needs updated to support certain features of 
the config, so the attached Scheme code will not work. Can someone show 
me how to get it to work?

Thanks,

Caleb Herbert

[-- Attachment #2: chromebook-alsa-lib.scm --]
[-- Type: text/x-scheme, Size: 4010 bytes --]

;; chromebook-alsa-lib.scm - Install Chromebook ALSA config
;; Copyright (C) 2023  Caleb Herbert <csh@bluehome.net>
;; Copyright (C) 2023  efraim
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

(use-modules (guix packages)
             (guix utils)
             (guix git-download)
             (guix build-system copy)
             (guix build-system trivial)
             ((guix licenses) #:prefix license:)
             (gnu packages linux))

(define-public chromebook-ucm-conf
  (let ((commit "1328e46bfca6db2c609df9c68d37bb418e6fe279")
        (revision "1"))
    (package
      (name "chromebook-ucm-conf")
      (version (git-version "0.0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                       (url (string-append "https://github.com/WeirdTreeThing/"
                                           name))
                       (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "1i9wi2z8izjg3xzkyya88lrxskcjdp4nig1qwjiy40vj0li20d0c"))))
      (build-system copy-build-system)
      (arguments
       '(#:install-plan
         '(("glk" "share/alsa/ucm2/conf.d")
           ("common" "share/alsa/ucm2"))))
      (home-page "https://github.com/WeirdTreeThing/chromebook-ucm-conf")
      (synopsis "Alsa UCM configuration for chrome devices")
      (description
       "A collection of modified ChromeOS UCM configuration files optimized
for mainline Linux")
      (license license:bsd-3))))

(define alsa-bonus-inputs
  (package
    (name "alsa-bonus-inputs")
    (version (package-version alsa-lib))
    (source #f)
    (build-system trivial-build-system)
    (arguments
     `(#:modules ((guix build union))
       #:builder
       (begin
         (use-modules (ice-9 match)
                      (guix build union))
         (match %build-inputs
           (((names . directories) ...)
            (union-build (assoc-ref %outputs "out")
                         directories)
            #t)))))
    (inputs
     (list alsa-ucm-conf alsa-topology-conf chromebook-ucm-conf))
    (home-page "")
    (synopsis "")
    (description "")
    (license #f)))


(define chromebook-alsa-lib
  (package
    (inherit alsa-lib)
    (arguments
     (substitute-keyword-arguments (package-arguments alsa-lib)
       ((#:phases phases)
        `(modify-phases ,phases
           (replace 'pre-install
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (let* ((alsa (string-append
                              (assoc-ref outputs "out") "/share/alsa"))
                     (bonus-inputs (assoc-ref inputs "alsa-bonus-inputs"))
                     (ucm (string-append bonus-inputs "/share/alsa/ucm"))
                     (ucm2 (string-append bonus-inputs "/share/alsa/ucm2"))
                     (topology (string-append
                                 bonus-inputs "/share/alsa/topology")))
                 (mkdir-p alsa)
                 (symlink ucm (string-append alsa "/ucm"))
                 (symlink ucm2 (string-append alsa "/ucm2"))
                 (symlink topology (string-append alsa "/topology")))))))))
    (inputs
     (modify-inputs (package-inputs alsa-lib)
                    (prepend alsa-bonus-inputs)
                    (delete "alsa-ucm-conf" "alsa-topology-conf")))))

chromebook-alsa-lib

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: chromebook-ucm-conf
@ 2023-12-02 18:12 Caleb Herbert
  0 siblings, 0 replies; 2+ messages in thread
From: Caleb Herbert @ 2023-12-02 18:12 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 554 bytes --]

Hi Guix,

I still need help getting audio to work.  I recently updated the code to
the package.

I'm still trying to package these ALSA configs, but alsa-lib might need
to be updated.

https://codeberg.org/csh/guix-channel/src/branch/main/kolev/packages/linux.scm

I haven't packaged anything before.  I don't know how to get this whole
thing to work.

Thanks,

-- 
Caleb Herbert
https://bluehome.net/csh/
OpenPGP fingerprint: 631C C434 A56B 5CBD FF21  2346 9764 3795 FA3E 4BCE
What's a fingerprint? https://emailselfdefense.fsf.org/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 682 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-02 18:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-20 18:28 chromebook-ucm-conf Caleb Herbert
  -- strict thread matches above, loose matches on Subject: below --
2023-12-02 18:12 chromebook-ucm-conf Caleb Herbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).