unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Caleb Herbert <csh@bluehome.net>
To: help-guix@gnu.org
Subject: chromebook-ucm-conf
Date: Mon, 20 Nov 2023 12:28:36 -0600	[thread overview]
Message-ID: <1b7ba9f1-6c62-8a45-3b2b-795beefdcc40@bluehome.net> (raw)

[-- 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

             reply	other threads:[~2023-11-20 18:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 18:28 Caleb Herbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-12-02 18:12 chromebook-ucm-conf Caleb Herbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b7ba9f1-6c62-8a45-3b2b-795beefdcc40@bluehome.net \
    --to=csh@bluehome.net \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).