aerc: 0.2.1 -> 0.3.0

- bump version
- build with notmuch support
- substitute @SHAREDIR@ in aerc.conf for the `template-dirs` key
- place ncurses instead of ncurses.dev in PATH (cannot find infocmp otherwise)
This commit is contained in:
David Terry 2019-11-25 10:43:54 +01:00 committed by Jon
parent 053f6ffd2a
commit cb8aa201e2
2 changed files with 29 additions and 13 deletions

View File

@ -1,21 +1,22 @@
{ stdenv, buildGoModule, fetchurl { stdenv, buildGoModule, fetchurl
, go, ncurses, scdoc , go, ncurses, notmuch, scdoc
, python3, perl, w3m, dante , python3, perl, w3m, dante
}: }:
buildGoModule rec { buildGoModule rec {
pname = "aerc"; pname = "aerc";
version = "0.2.1"; version = "0.3.0";
src = fetchurl { src = fetchurl {
url = "https://git.sr.ht/~sircmpwn/aerc/archive/${version}.tar.gz"; url = "https://git.sr.ht/~sircmpwn/aerc/archive/${version}.tar.gz";
sha256 = "1ky1nl5b54lf5jnac2kb5404fplwnwypjplas8imdlsf517fw32n"; sha256 = "188jln8hmgiqn5il5m54bns0wk4grj09di8y6mmid58ibw6spma4";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
go go
scdoc scdoc
python3.pkgs.wrapPython python3.pkgs.wrapPython
notmuch
]; ];
patches = [ patches = [
@ -28,6 +29,8 @@ buildGoModule rec {
buildInputs = [ python3 perl ]; buildInputs = [ python3 perl ];
GOFLAGS="-tags=notmuch";
buildPhase = " buildPhase = "
runHook preBuild runHook preBuild
# we use make instead of go build # we use make instead of go build
@ -43,12 +46,12 @@ buildGoModule rec {
postFixup = '' postFixup = ''
wrapProgram $out/bin/aerc --prefix PATH ":" \ wrapProgram $out/bin/aerc --prefix PATH ":" \
"$out/share/aerc/filters:${stdenv.lib.makeBinPath [ ncurses.dev ]}" "$out/share/aerc/filters:${stdenv.lib.makeBinPath [ ncurses ]}"
wrapProgram $out/share/aerc/filters/html --prefix PATH ":" \ wrapProgram $out/share/aerc/filters/html --prefix PATH ":" \
${stdenv.lib.makeBinPath [ w3m dante ]} ${stdenv.lib.makeBinPath [ w3m dante ]}
''; '';
modSha256 = "0fc9m1qb8innypc8cxzbqyrfkawawyaqq3gqy7lqwmyh32f300jh"; modSha256 = "0pxbv4zfhii0g41cy0ycfpkkxw6nnd4ibavic6zqw30j476jnm2x";
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "aerc is an email client for your terminal"; description = "aerc is an email client for your terminal";

View File

@ -1,18 +1,19 @@
From 7ea68a2eef026723903d72f54ca54b629881ec06 Mon Sep 17 00:00:00 2001 From 6cf3c2e42d219b9665a43ca65f321c653b0aa102 Mon Sep 17 00:00:00 2001
From: Tadeo Kondrak <me@tadeo.ca> From: Tadeo Kondrak <me@tadeo.ca>
Date: Mon, 28 Oct 2019 08:36:36 -0600 Date: Mon, 28 Oct 2019 08:36:36 -0600
Subject: [PATCH] Fix aerc breaking every time the package is rebuilt. Subject: [PATCH] Fix aerc breaking every time the package is rebuilt.
On NixOS, the SHAREDIR changes on every rebuild to the package, but aerc On NixOS, the SHAREDIR changes on every rebuild to the package, but aerc
fills it in as part of the default config. Fix this by not substituting fills it in as part of the default config and then installs that config
@SHAREDIR@ in the default config until runtime. to the users home folder. Fix this by not substituting @SHAREDIR@ in the
default config until runtime.
--- ---
Makefile | 2 +- Makefile | 2 +-
config/config.go | 3 +++ config/config.go | 8 ++++++++
2 files changed, 4 insertions(+), 1 deletion(-) 2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile diff --git a/Makefile b/Makefile
index d3072d3..17ca0be 100644 index d1c755d..1185a96 100644
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -24,7 +24,7 @@ aerc: $(GOSRC) @@ -24,7 +24,7 @@ aerc: $(GOSRC)
@ -25,10 +26,22 @@ index d3072d3..17ca0be 100644
DOCS := \ DOCS := \
aerc.1 \ aerc.1 \
diff --git a/config/config.go b/config/config.go diff --git a/config/config.go b/config/config.go
index bfcbecf..2f4e703 100644 index 32d07fc..8ffd3e8 100644
--- a/config/config.go --- a/config/config.go
+++ b/config/config.go +++ b/config/config.go
@@ -377,6 +377,9 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) { @@ -355,6 +355,11 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
return nil, err
}
}
+ if sec, err := file.GetSection("templates"); err == nil {
+ if key, err := sec.GetKey("template-dirs"); err == nil {
+ sec.NewKey("template-dirs", strings.ReplaceAll(key.String(), "@SHAREDIR@", sharedir))
+ }
+ }
file.NameMapper = mapName
config := &AercConfig{
Bindings: BindingConfig{
@@ -423,6 +428,9 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
if err = config.LoadConfig(file); err != nil { if err = config.LoadConfig(file); err != nil {
return nil, err return nil, err
} }