1{ lib, stdenv, fetchFromGitHub, fetchzip, cmake, catch2, fmt, python3 }:
2
3let
4 ucd-version = "15.0.0";
5
6 ucd-src = fetchzip {
7 url = "https://www.unicode.org/Public/${ucd-version}/ucd/UCD.zip";
8 hash = "sha256-jj6bX46VcnH7vpc9GwM9gArG+hSPbOGL6E4SaVd0s60=";
9 stripRoot = false;
10 };
11in stdenv.mkDerivation (final: {
12 pname = "libunicode";
13 version = "0.4.0";
14
15 src = fetchFromGitHub {
16 owner = "contour-terminal";
17 repo = "libunicode";
18 rev = "v${final.version}";
19 hash = "sha256-Us3T4fnGsArdsVB7IUhwdex43C+H1+lfL8yK9enhf2c=";
20 };
21
22 # Fix: set_target_properties Can not find target to add properties to: Catch2, et al.
23 patches = [ ./remove-target-properties.diff ];
24
25 nativeBuildInputs = [ cmake python3 ];
26 buildInputs = [ catch2 fmt ];
27
28 cmakeFlags = [ "-DLIBUNICODE_UCD_DIR=${ucd-src}" ];
29
30 meta = with lib; {
31 description = "Modern C++17 Unicode library";
32 mainProgram = "unicode-query";
33 license = licenses.asl20;
34 platforms = platforms.unix;
35 maintainers = with maintainers; [ moni ];
36 };
37})