Search code examples
macosgitpatchmutt

How to apply this mutt sidebar patch?


Since the homebrew guys now have removed the option of appying the mutt sidebar patch during installation i went searching and found someone who had created an updated mutt sidebar patch for version 1.5.22 of mutt (every mutt sidebar versions seems to always be incompatible with the previous or the next).

The patch however, which is just a .patch file on a github repository, located here https://github.com/nedos/mutt-sidebar-patch doesnt contain any installation instructons. Since the homebrew package is a binary package im not sure how to install this since you usually need to point the patch command at a file you want to patch.

After some more searching i found out how someone had used a patch they found on git to patch some other software, they had cloned the git repository and used the git command to apply the patch, but then again im dont know the github repository url (if git is being used) for the 1.5.22 version of mutt, and im also not sure if i would have to recompile it.

Can someone point me in the right direction and give me some hints? Preferably a solution. Thanks for your time.


Solution

  • UPDATE

    This answer has become a bit out of date. Thankfully some people have created some homebrew taps to solve this problem for us and make it much simpler. All you have to do now is the following:

    brew uninstall mutt
    brew tap sgeb/mutt
    brew install sgeb/mutt/mutt --with-sidebar-patch
    

    If you want to install mutt with some other patches, have a look to see what you can install with this tap, by typing:

    brew options sgeb/mutt/mutt
    

    The output for me was:

    --with-confirm-attachment-patch
        Apply confirm attachment patch
    --with-debug
        Build with debug option enabled
    --with-forwref-patch
        Apply forward_references patch
    --with-gettext
        Build with gettext support
    --with-gmail-labels-patch
        Apply gmail labels patch
    --with-gmail-server-search-patch
        Apply gmail server search patch
    --with-gpgme
        Build with gpgme support
    --with-ignore-thread-patch
        Apply ignore-thread patch
    --with-libidn
        Build with libidn support
    --with-pgp-verbose-mime-patch
        Apply PGP verbose mime patch
    --with-s-lang
        Build against slang instead of ncurses
    --with-sidebar-patch
        Apply sidebar patch
    --with-trash-patch
        Apply trash folder patch
    --HEAD
        Install HEAD version
    

    I had problems following all of the answers above. I did actually manage to get it to work in the end. What I did was the following

    brew edit mutt
    

    then I scrolled down to a section of commands that all start with "option", sort of like:

    option "with-debug", "Build with debug option enabled"
    option "with-trash-patch", "Apply trash folder patch"
    option "with-s-lang", "Build against slang instead of ncurses"
    option "with-ignore-thread-patch", "Apply ignore-thread patch"
    option "with-pgp-verbose-mime-patch", "Apply PGP verbose mime patch"
    option "with-confirm-attachment-patch", "Apply confirm attachment patch"
    

    I then added a line at the bottom of this block

    option "with-sidebar-patch", "Apply sidebar patch"
    

    After that I scrolled down further to the section with all the patches, e.g.

    patch do
      url "http://patch-tracker.debian.org/patch/series/dl/mutt/1.5.21-6.2+deb7u1/features/trash-folder"
      sha1 "6c8ce66021d89a063e67975a3730215c20cf2859"
    end if build.with? "trash-patch"
    

    And I added the patch for sidebar (as I found here: https://github.com/kevwil/homebrew-patches/blob/master/mutt.rb)

    patch do
      url "https://raw.github.com/nedos/mutt-sidebar-patch/7ba0d8db829fe54c4940a7471ac2ebc2283ecb15/mutt-sidebar.patch"
      sha1 "1e151d4ff3ce83d635cf794acf0c781e1b748ff1"
    end if build.with? "sidebar-patch"
    

    Finally, exit the editor for the brew file and in the commandline:

    brew install mutt --with-sidebar-patch
    

    Best of luck!

    p.s. if it gives you an error of the form aclocal then you need to install automake, brew install automake