1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchzip,
6 cmake,
7 catch2_3,
8 fmt,
9 python3,
10}:
11
12let
13 ucd-version = "16.0.0";
14
15 ucd-src = fetchzip {
16 url = "https://www.unicode.org/Public/${ucd-version}/ucd/UCD.zip";
17 hash = "sha256-GgEYjOLrxxfTAQsc2bpi7ShoAr3up8z7GXXpe+txFuw";
18 stripRoot = false;
19 };
20in
21stdenv.mkDerivation (final: {
22 pname = "libunicode";
23 version = "0.6.0";
24
25 src = fetchFromGitHub {
26 owner = "contour-terminal";
27 repo = "libunicode";
28 rev = "v${final.version}";
29 hash = "sha256-zX33aTQ7Wgl8MABu+o6nA2HWrfXD4zQ9b3NDB+T2saI";
30 };
31
32 # Fix: set_target_properties Can not find target to add properties to: Catch2, et al.
33 patches = [ ./remove-target-properties.diff ];
34
35 nativeBuildInputs = [
36 cmake
37 python3
38 ];
39 buildInputs = [
40 catch2_3
41 fmt
42 ];
43
44 cmakeFlags = [ "-DLIBUNICODE_UCD_DIR=${ucd-src}" ];
45
46 meta = with lib; {
47 description = "Modern C++20 Unicode library";
48 mainProgram = "unicode-query";
49 license = licenses.asl20;
50 platforms = platforms.unix;
51 maintainers = with maintainers; [ moni ];
52 };
53})