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
@@ -40,13 +45,19 @@ stdenv.mkDerivation rec {
4045
4146 enableParallelBuilding = true ;
4247
43- meta = with lib ; {
48+ nativeInstallCheckInputs = [
49+ versionCheckHook
50+ ] ;
51+ doInstallCheck = true ;
52+ versionCheckProgramArg = "-V" ;
53+
54+ meta = {
4455 description = "CLI email sending tool" ;
45- license = licenses . bsd3 ;
46- maintainers = with maintainers ; [ raskin ] ;
47- platforms = platforms . linux ;
56+ license = lib . licenses . bsd3 ;
57+ maintainers = with lib . maintainers ; [ raskin ] ;
58+ platforms = lib . platforms . linux ;
4859 homepage = "https://github.com/muquit/mailsend" ;
4960 downloadPage = "https://github.com/muquit/mailsend/releases" ;
5061 mainProgram = "mailsend" ;
5162 } ;
52- }
63+ } )
0 commit comments