git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #32710 from matthiasbeyer/update-lumail
2f00a50Jörg Thalheim
pkgs/applications/networking/mailreaders/lumail/default.nix+42−10
@@ -1,20 +1,42 @@
1−{ stdenv, fetchurl, pkgconfig, lua5_2, file, ncurses, gmime, pcre-cpp
1+{ stdenv, fetchurl, pkgconfig, lua, file, ncurses, gmime, pcre-cpp
2−, perl, perlPackages }:
2+, perl, perlPackages, makeWrapper
3+, debugBuild ? false
4+, alternativeGlobalConfigFilePath ? null
5+}:
3
6
4let
7let
5− version = "2.9";
8+ version = "3.1";
9+ binaryName = if debugBuild then "lumail2-debug" else "lumail2";
10+ alternativeConfig = builtins.toFile "lumail2.lua"
11+ (builtins.readFile alternativeGlobalConfigFilePath);
12+
13+ globalConfig = if isNull alternativeGlobalConfigFilePath then ''
14+ mkdir -p $out/etc/lumail2
15+ cp global.config.lua $out/etc/lumail2.lua
16+ for n in ./lib/*.lua; do
17+ cp "$n" $out/etc/lumail2/
18+ done
19+ '' else ''
20+ ln -s ${alternativeConfig} $out/etc/lumail2.lua
21+ '';
22+
23+ getPath = type : "${lua}/lib/?.${type};";
24+ luaPath = getPath "lua";
25+ luaCPath = getPath "so";
6in
26in
7stdenv.mkDerivation {
27stdenv.mkDerivation {
8 name = "lumail-${version}";
28 name = "lumail-${version}";
9
29
10 src = fetchurl {
30 src = fetchurl {
11 url = "https://lumail.org/download/lumail-${version}.tar.gz";
31 url = "https://lumail.org/download/lumail-${version}.tar.gz";
12− sha256 = "1rni5lbic36v4cd1r0l28542x0hlmfqkl6nac79gln491in2l2sc";
32+ sha256 = "0vj7p7f02m3w8wb74ilajcwznc4ai4h2ikkz9ildy0c00aqsi5w4";
13 };
33 };
14
34
35+ enableParallelBuilding = true;
36+
15− nativeBuildInputs = [ pkgconfig ];
37+ nativeBuildInputs = [ pkgconfig makeWrapper ];
16 buildInputs = [
38 buildInputs = [
17− lua5_2 file ncurses gmime pcre-cpp
39+ lua file ncurses gmime pcre-cpp
18 perl perlPackages.JSON perlPackages.NetIMAPClient
40 perl perlPackages.JSON perlPackages.NetIMAPClient
19 ];
41 ];
20
42
@@ -29,16 +51,26 @@ stdenv.mkDerivation {
29 sed -e "s|^#\!\(.*/perl.*\)$|#\!\1$perlFlags|" -i perl.d/imap-proxy
51 sed -e "s|^#\!\(.*/perl.*\)$|#\!\1$perlFlags|" -i perl.d/imap-proxy
30 '';
52 '';
31
53
54+ buildFlags = if debugBuild then "lumail2-debug" else "";
55+
56+ installPhase = ''
57+ mkdir -p $out/bin || true
58+ install -m755 ${binaryName} $out/bin/
59+ ''
60+ + globalConfig
61+ + ''
62+ wrapProgram $out/bin/${binaryName} \
63+ --prefix LUA_PATH : "${luaPath}" \
64+ --prefix LUA_CPATH : "${luaCPath}"
65+ '';
66+
32 makeFlags = [
67 makeFlags = [
33 "LVER=lua"
68 "LVER=lua"
34 "PREFIX=$(out)"
69 "PREFIX=$(out)"
35 "SYSCONFDIR=$(out)/etc"
70 "SYSCONFDIR=$(out)/etc"
71+ "LUMAIL_LIBS=$(out)/etc/lumail2"
36 ];
72 ];
37
73
38− postInstall = ''
39− cp lumail2.user.lua $out/etc/lumail2/
40− '';
41−
42 meta = with stdenv.lib; {
74 meta = with stdenv.lib; {
43 description = "Console-based email client";
75 description = "Console-based email client";
44 homepage = https://lumail.org/;
76 homepage = https://lumail.org/;
pkgs/top-level/all-packages.nix+3−1
@@ -16440,7 +16440,9 @@ with pkgs;
16440
16440
16441 looking-glass-client = callPackage ../applications/virtualization/looking-glass-client { };
16441 looking-glass-client = callPackage ../applications/virtualization/looking-glass-client { };
16442
16442
16443− lumail = callPackage ../applications/networking/mailreaders/lumail { };
16443+ lumail = callPackage ../applications/networking/mailreaders/lumail {
16444+ lua = lua5_1;
16445+ };
16444
16446
16445 lv2bm = callPackage ../applications/audio/lv2bm { };
16447 lv2bm = callPackage ../applications/audio/lv2bm { };
16446
16448