Hello. I am new to the Guix GNU+Linux distro. And I’m trying to get the latest version of Anki (2.1.65). However, the newest version is not in the Guix channel. I’m reading here that a simple edit to the education.scm file (the version var) would fix it. Unfortunately, the education.scm file in a Guix system is readonly. Unless they update the code, my only option is to make a custom module and package to supply a newer version. Though, I don’t know how to do that (I’m a noobie). I just need help on figuring that out. Any help is appreciated.

  • rrobin@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    If the recipe change is small you can create your own file that imports the existing package and extends it to modify the version.

    This is a minimal example that inherits from the existing one

    (define-module (mystuffypackages)
    	       #:use-module (guix packages)
    	       #:use-module (guix download)
    	       #:use-module (gnu packages)
    	       #:use-module (gnu packages education)
    	       )
    
    
    (define-public my-anki 
      (package
        (inherit anki)
        (version "2.1.65")
        (source
             (origin
               (method url-fetch)
    	   ;; Changed the url to github - could not download from site archive
               (uri (string-append "https://github.com/ankitects/anki/archive/refs/tags/"
                                   version ".tar.gz"))
               (sha256
                (base32 "1s28kdaw864rj6x9zgq5wwwl0gi5cyn2kg91jkq05v1bwgl3f76a"))
               ;; FIXME 2.1.16 uses a patch - check education.scm - it is not
    	   ;; applying
               ))
        ;; FIXME currently failing to build due to disable-update-check
        ))
    
    my-anki
    

    You can call guix build directly to build the package from this file. To be clear this is currently failing for me :D

    Check this blog article for a pretty nice overview of how to create your own packages and channel https://guix.gnu.org/blog/2023/from-development-environments-to-continuous-integrationthe-ultimate-guide-to-software-development-with-guix/