2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
2023-07-15 17:15:38 +00:00
|
|
|
, fetchpatch
|
2021-12-06 16:07:01 +00:00
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, meson
|
|
|
|
, libevent
|
|
|
|
, curl
|
|
|
|
, spdlog
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "coeurl";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.3.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "nheko.im";
|
|
|
|
owner = "nheko-reborn";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-sN+YSddUOdnJLcnHyWdjNm1PpxCwnkwiqSvyrwUrg6w=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
patches = [
|
|
|
|
# Fix compatibility issues with curl > 7.85, see:
|
|
|
|
# https://nheko.im/nheko-reborn/coeurl/-/commit/d926893007c353fbc149d8538a5762ca8384273a
|
|
|
|
# PATCH CAN BE REMOVED AFTER 0.3.0
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://nheko.im/nheko-reborn/coeurl/-/commit/d926893007c353fbc149d8538a5762ca8384273a.patch";
|
|
|
|
hash = "sha256-hOBk7riuVI7k7qe/SMq3XJnFzyZ0gB9kVG7dKvWOsPY=";
|
|
|
|
})
|
|
|
|
# Fix error when building with fmt >= 10, see:
|
|
|
|
# https://nheko.im/nheko-reborn/coeurl/-/commit/831e2ee8e9cf08ea1ee9736cde8370f9d0312abc
|
|
|
|
# PATCH CAN BE REMOVED AFTER 0.3.0
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://nheko.im/nheko-reborn/coeurl/-/commit/831e2ee8e9cf08ea1ee9736cde8370f9d0312abc.patch";
|
|
|
|
hash = "sha256-a52Id7Nm3Mmmwv7eL58j6xovjlkpAO4KahVM/Q3H65w=";
|
|
|
|
})
|
|
|
|
];
|
2023-08-22 20:05:09 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace subprojects/curl.wrap --replace '[provides]' '[provide]'
|
|
|
|
'';
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ ninja pkg-config meson ];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildInputs = [ libevent curl spdlog ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A simple async wrapper around CURL for C++";
|
|
|
|
homepage = "https://nheko.im/nheko-reborn/coeurl";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
|
|
|
};
|
|
|
|
}
|