nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 libiconv,
7 nix-update-script,
8 testers,
9 validatePkgConfig,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "simdutf";
14 version = "8.0.0";
15
16 src = fetchFromGitHub {
17 owner = "simdutf";
18 repo = "simdutf";
19 rev = "v${finalAttrs.version}";
20 hash = "sha256-v9t/2EgxEOVostS/BY+DkDZbpq/coBhk2LaVpI2/y9c=";
21 };
22
23 # Fix build on darwin
24 postPatch = ''
25 substituteInPlace tools/CMakeLists.txt --replace "-Wl,--gc-sections" ""
26 '';
27
28 cmakeFlags = [
29 (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
30 ];
31
32 nativeBuildInputs = [
33 cmake
34 validatePkgConfig
35 ];
36
37 buildInputs = [
38 libiconv
39 ];
40
41 passthru = {
42 updateScript = nix-update-script { };
43
44 tests.pkg-config = testers.hasPkgConfigModules {
45 package = finalAttrs.finalPackage;
46 };
47 };
48
49 meta = {
50 description = "Unicode routines validation and transcoding at billions of characters per second";
51 homepage = "https://github.com/simdutf/simdutf";
52 license = with lib.licenses; [
53 asl20
54 mit
55 ];
56 maintainers = with lib.maintainers; [ wineee ];
57 pkgConfigModules = [ "simdutf" ];
58 platforms = lib.platforms.all;
59 };
60})