1{ lib
2, stdenv
3, fetchFromGitLab
4, fetchpatch
5, ninja
6, pkg-config
7, meson
8, libevent
9, curl
10, spdlog
11}:
12
13stdenv.mkDerivation rec {
14 pname = "coeurl";
15 version = "0.3.0";
16
17 src = fetchFromGitLab {
18 domain = "nheko.im";
19 owner = "nheko-reborn";
20 repo = pname;
21 rev = "v${version}";
22 hash = "sha256-sN+YSddUOdnJLcnHyWdjNm1PpxCwnkwiqSvyrwUrg6w=";
23 };
24 patches = [
25 # Fix compatibility issues with curl > 7.85, see:
26 # https://nheko.im/nheko-reborn/coeurl/-/commit/d926893007c353fbc149d8538a5762ca8384273a
27 # PATCH CAN BE REMOVED AFTER 0.3.0
28 (fetchpatch {
29 url = "https://nheko.im/nheko-reborn/coeurl/-/commit/d926893007c353fbc149d8538a5762ca8384273a.patch";
30 hash = "sha256-hOBk7riuVI7k7qe/SMq3XJnFzyZ0gB9kVG7dKvWOsPY=";
31 })
32 # Fix error when building with fmt >= 10, see:
33 # https://nheko.im/nheko-reborn/coeurl/-/commit/831e2ee8e9cf08ea1ee9736cde8370f9d0312abc
34 # PATCH CAN BE REMOVED AFTER 0.3.0
35 (fetchpatch {
36 url = "https://nheko.im/nheko-reborn/coeurl/-/commit/831e2ee8e9cf08ea1ee9736cde8370f9d0312abc.patch";
37 hash = "sha256-a52Id7Nm3Mmmwv7eL58j6xovjlkpAO4KahVM/Q3H65w=";
38 })
39 ];
40 postPatch = ''
41 substituteInPlace subprojects/curl.wrap --replace '[provides]' '[provide]'
42 '';
43
44 nativeBuildInputs = [ ninja pkg-config meson ];
45
46 buildInputs = [ libevent curl spdlog ];
47
48 meta = with lib; {
49 description = "Simple async wrapper around CURL for C++";
50 homepage = "https://nheko.im/nheko-reborn/coeurl";
51 license = licenses.mit;
52 platforms = platforms.all;
53 maintainers = with maintainers; [ rnhmjoj ];
54 };
55}