Skip to content

Commit 55b65a4

Browse files
authored
mailsend: unbreak on GCC 14, modernize (#388552)
2 parents a701033 + c975699 commit 55b65a4

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed
Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
{
22
lib,
33
stdenv,
4-
fetchurl,
4+
fetchFromGitHub,
55
fetchpatch,
66
openssl,
7+
versionCheckHook,
78
}:
89

9-
stdenv.mkDerivation rec {
10+
stdenv.mkDerivation (finalAttrs: {
1011
pname = "mailsend";
1112
version = "1.19";
1213

13-
src = fetchurl {
14-
url = "https://github.com/muquit/mailsend/archive/${version}.tar.gz";
15-
sha256 = "sha256-Vl72vibFjvdQZcVRnq6N1VuuMUKShhlpayjSQrc0k/c=";
14+
src = fetchFromGitHub {
15+
owner = "muquit";
16+
repo = "mailsend";
17+
tag = finalAttrs.version;
18+
hash = "sha256-g1V4NrFlIz8oh7IS+cGWG6eje6kBGvPZS7Q131ESrXI=";
1619
};
1720

1821
buildInputs = [
@@ -23,9 +26,11 @@ stdenv.mkDerivation rec {
2326
];
2427

2528
patches = [
26-
(fetchurl {
29+
# OpenSSL 1.1 support for HMAC api
30+
(fetchpatch {
31+
name = "openssl-1-1-hmac.patch";
2732
url = "https://github.com/muquit/mailsend/commit/960df6d7a11eef90128dc2ae660866b27f0e4336.patch";
28-
sha256 = "0vz373zcfl19inflybfjwshcq06rvhx0i5g0f4b021cxfhyb1sm0";
33+
hash = "sha256-Gy4pZMYoUXcjMatw5BSk+IUKXjgpLCwPXtfC++WPKAM=";
2934
})
3035
# Pull fix pending upstream inclusion for parallel build failures:
3136
# https://github.com/muquit/mailsend/pull/165
@@ -36,15 +41,23 @@ stdenv.mkDerivation rec {
3641
})
3742
];
3843

44+
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
45+
3946
enableParallelBuilding = true;
4047

41-
meta = with lib; {
48+
nativeInstallCheckInputs = [
49+
versionCheckHook
50+
];
51+
doInstallCheck = true;
52+
versionCheckProgramArg = "-V";
53+
54+
meta = {
4255
description = "CLI email sending tool";
43-
license = licenses.bsd3;
44-
maintainers = with maintainers; [ raskin ];
45-
platforms = platforms.linux;
56+
license = lib.licenses.bsd3;
57+
maintainers = with lib.maintainers; [ raskin ];
58+
platforms = lib.platforms.linux;
4659
homepage = "https://github.com/muquit/mailsend";
4760
downloadPage = "https://github.com/muquit/mailsend/releases";
4861
mainProgram = "mailsend";
4962
};
50-
}
63+
})

0 commit comments

Comments
 (0)