1{ lib, stdenv, fetchFromGitHub, cmake }:
2
3stdenv.mkDerivation rec {
4 pname = "utf8proc";
5 version = "2.6.1";
6
7 src = fetchFromGitHub {
8 owner = "JuliaStrings";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "1zqc6airkzkssbjxanx5v8blfk90180gc9id0dx8ncs54f1ib8w7";
12 };
13
14 nativeBuildInputs = [ cmake ];
15
16 cmakeFlags = [
17 "-DBUILD_SHARED_LIBS=ON"
18 "-DUTF8PROC_ENABLE_TESTING=ON"
19 "-DCMAKE_SKIP_BUILD_RPATH=OFF"
20 ];
21
22 # the pkg-config file is not created in the cmake installation
23 # process, so we use the Makefile and install it manually
24 # see https://github.com/JuliaStrings/utf8proc/issues/198
25 preConfigure = "make libutf8proc.pc prefix=$out";
26 postInstall = "install -Dm644 ../libutf8proc.pc -t $out/lib/pkgconfig/";
27
28 doCheck = true;
29
30 meta = with lib; {
31 description = "A clean C library for processing UTF-8 Unicode data";
32 homepage = "https://juliastrings.github.io/utf8proc/";
33 license = licenses.mit;
34 platforms = platforms.all;
35 maintainers = [ maintainers.ftrvxmtrx ];
36 };
37}