Error: betterbird ... removed ... insufficient maintainers

What options do I have besides switching to another client?

Package it yourself as part of your NixOS config, which would effectively make you the maintainer of said package (and you’d be responsible for updating it and fixing breakages with it).

Personally my recommendation in situations like these is to look for another avenue. In this case, it looks like Betterbird is available via Flatpak. You can set up Flatpak via your NixOS configuration then use it normally.

If you want to declaratively install Flatpak applications, there is nix-flatpak. See the project page and discussion.

Of course, this has a number of trade-offs and might not be the right choice for you. If you would prefer lifting the derivation into your configuration instead, we can probably help you figure that out. However, if it’s much like the Firefox build process, without the benefit of Hydra caching, this will probably not be a great experience.

If the developers provide an executable binary, you can create a Nix package for that. You’d likely need to use autoPatchelfHook (or buildFHSEnv) to get it to run, but the build would be much faster than trying to build such a large application from source.

Error: betterbird … removed … insufficient maintainers

That is only half the story. People put pressure on me to both support stable (I have no graphical system on stable) and unstable. Building betterbird even on good hardware, usually takes like 20 minutes and when it fails at the linking stage it is a bit annoying and can take a few tries to update. I usually did it on weekends when I usually have a lot of time but sometimes it feel through. Also I sometimes get the feeling that people get overzealous about packages other maintainers packages when they lack the security updates late.

If someone wants to help me maintain it, I think we could bring it back especially if people have the need for it.

3 Likes

Thanks for the suggestion. I feel like if I’m going to go that route, I might as well just switch to blendos or use distrobox.

I appreciate all of the maintainers but that just isn’t me anymore. I used to run gentoo on everything a decade ago but I guess I’m too old for this $#!+…?

I don’t think it’s so dire to be honest. I use Flatpak apps on all of my NixOS machines (mainly The GIMP nightly releases.) It does have some potential caveats but in my experience it is a perfectly reasonable escape hatch.

Of course, it’s all up to you. Distrobox and blendOS are also perfectly fine choices if you think those would fit your needs better.

Here is a working build file/nix file of the latest Betterbird 128.8.0 ESR if anyone is interested.

I don’t really know what i’m doing when it comes to creating build files for NixOS, but it’s working fine here on NixOS Unstable.

I had to add feature-1562737-body-search-encrypted.patch to the “blacklist”, since that patch wouldn’t apply cleanly.

It’s not creating a desktop icon. I haven’t been able to figure that one out yet.

{
  lib,
  buildMozillaMach,
  cacert,
  fetchFromGitHub,
  fetchurl,
  git,
  libdbusmenu-gtk3,
  runtimeShell,
  thunderbirdPackages,
}:

let
  thunderbird-unwrapped = thunderbirdPackages.thunderbird-128;

  version = "128.8.0";
  majVer = lib.versions.major version;

  betterbird-patches = fetchFromGitHub {
    owner = "Betterbird";
    repo = "thunderbird-patches";
    rev = "${version}esr-bb23";
    postFetch = ''
      echo "Retrieving external patches"

      echo "#!${runtimeShell}" > external.sh
      # if no external patches need to be downloaded, don't fail
      { grep " # " $out/${majVer}/series-M-C || true ; } >> external.sh
      { grep " # " $out/${majVer}/series || true ; } >> external.sh
      sed -i -e '/^#/d' external.sh
      sed -i -e 's/\/rev\//\/raw-rev\//' external.sh
      sed -i -e 's|\(.*\) # \(.*\)|curl \2 -o $out/${majVer}/external/\1|' external.sh
      chmod 700 external.sh

      mkdir $out/${majVer}/external
      SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
      . ./external.sh
      rm external.sh
    '';
    hash = "sha256-v4MNb0UF1nxrykM111zZEXu7fvM7pSwD6bGtjPJcGBM=";
  };
in
(
  (buildMozillaMach {
    pname = "betterbird";
    inherit version;

    applicationName = "Betterbird";
    binaryName = "betterbird";
    branding = "comm/mail/branding/betterbird";
    inherit (thunderbird-unwrapped) application extraPatches;

    src = fetchurl {
      # https://download.cdn.mozilla.net/pub/thunderbird/releases/
      url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}esr.source.tar.xz";
      hash = "sha256-2si7cn5/7URdOXcJPVGDKp0RbeB4+GzAcIGr2OQrb0M=";
    };

    extraPostPatch =
      thunderbird-unwrapped.extraPostPatch or ""
      # bash
      + ''
        PATH=$PATH:${lib.makeBinPath [ git ]}
        patches=$(mktemp -d)
        for dir in branding bugs external features misc; do
          cp -r ${betterbird-patches}/${majVer}/$dir/*.patch $patches/
        done
        cp ${betterbird-patches}/${majVer}/series* $patches/
        chmod -R +w $patches
        cd $patches
        # fix FHS paths to libdbusmenu
        substituteInPlace 12-feature-linux-systray.patch \
          --replace-fail "/usr/include/libdbusmenu-glib-0.4/" "${lib.getDev libdbusmenu-gtk3}/include/libdbusmenu-glib-0.4/" \
          --replace-fail "/usr/include/libdbusmenu-gtk3-0.4/" "${lib.getDev libdbusmenu-gtk3}/include/libdbusmenu-gtk3-0.4/"
        cd -
        chmod -R +w dom/base/test/gtest/
        while read patch; do
          patch="''${patch%%#*}"
          patch="''${patch% }"
          if [[ $patch == "" ]]; then
            continue
          fi
          # requires vendored icu, fails to link with our icu
          # feature-506064 depends on those icu patches
          if [[ $patch == 14-feature-regexp-searchterm.patch || $patch == 14-feature-regexp-searchterm-m-c.patch || $patch == feature-506064-match-diacritics.patch || $patch == feature-506064-match-diacritics-m-c.patch ||$patch = feature-1562737-body-search-encrypted.patch  ]]; then
            continue
          fi
          echo Applying patch $patch.
          if [[ $patch == *-m-c.patch ]]; then
            git apply -p1 -v < $patches/$patch
          else
            cd comm
            git apply -p1 -v < $patches/$patch
            cd ..
          fi
        done < <(cat $patches/series $patches/series-M-C)
      '';

    extraBuildInputs = [
      libdbusmenu-gtk3
    ];

    meta = with lib; {
      description = "Betterbird is a fine-tuned version of Mozilla Thunderbird, Thunderbird on steroids, if you will";
      homepage = "https://www.betterbird.eu/";
      mainProgram = "betterbird";
      maintainers = with maintainers; [  dp ];
      inherit (thunderbird-unwrapped.meta) platforms broken license;
    };
  }).override
  {
    crashreporterSupport = false; # not supported
    geolocationSupport = false;
    webrtcSupport = false;

    pgoSupport = false; # console.warn: feeds: "downloadFeed: network connection unavailable"

    inherit (thunderbird-unwrapped.passthru) icu73;
  }
).overrideAttrs
  (oldAttrs: {
    postInstall =
      oldAttrs.postInstall or ""
      + ''
        #mv $out/lib/thunderbird/* $out/lib/betterbird
        #rmdir $out/lib/thunderbird/
        #rm $out/bin/thunderbird
        ln -srf $out/lib/betterbird/betterbird $out/bin/betterbird
      '';

    doInstallCheck = false;

    passthru = oldAttrs.passthru // {
      inherit betterbird-patches;
    };
  })
2 Likes