libunicode: 0.4.0 -> 0.6.0

This commit is contained in:
moni 2024-11-03 07:06:49 +08:00
parent fcfcc8e0f4
commit 08151b58b3
4 changed files with 56 additions and 31 deletions

View File

@ -1,34 +1,50 @@
{ lib, stdenv, fetchFromGitHub, fetchzip, cmake, catch2, fmt, python3 }: {
lib,
stdenv,
fetchFromGitHub,
fetchzip,
cmake,
catch2_3,
fmt,
python3,
}:
let let
ucd-version = "15.0.0"; ucd-version = "16.0.0";
ucd-src = fetchzip { ucd-src = fetchzip {
url = "https://www.unicode.org/Public/${ucd-version}/ucd/UCD.zip"; url = "https://www.unicode.org/Public/${ucd-version}/ucd/UCD.zip";
hash = "sha256-jj6bX46VcnH7vpc9GwM9gArG+hSPbOGL6E4SaVd0s60="; hash = "sha256-GgEYjOLrxxfTAQsc2bpi7ShoAr3up8z7GXXpe+txFuw";
stripRoot = false; stripRoot = false;
}; };
in stdenv.mkDerivation (final: { in
stdenv.mkDerivation (final: {
pname = "libunicode"; pname = "libunicode";
version = "0.4.0"; version = "0.6.0";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "contour-terminal"; owner = "contour-terminal";
repo = "libunicode"; repo = "libunicode";
rev = "v${final.version}"; rev = "v${final.version}";
hash = "sha256-Us3T4fnGsArdsVB7IUhwdex43C+H1+lfL8yK9enhf2c="; hash = "sha256-zX33aTQ7Wgl8MABu+o6nA2HWrfXD4zQ9b3NDB+T2saI";
}; };
# Fix: set_target_properties Can not find target to add properties to: Catch2, et al. # Fix: set_target_properties Can not find target to add properties to: Catch2, et al.
patches = [ ./remove-target-properties.diff ]; patches = [ ./remove-target-properties.diff ];
nativeBuildInputs = [ cmake python3 ]; nativeBuildInputs = [
buildInputs = [ catch2 fmt ]; cmake
python3
];
buildInputs = [
catch2_3
fmt
];
cmakeFlags = [ "-DLIBUNICODE_UCD_DIR=${ucd-src}" ]; cmakeFlags = [ "-DLIBUNICODE_UCD_DIR=${ucd-src}" ];
meta = with lib; { meta = with lib; {
description = "Modern C++17 Unicode library"; description = "Modern C++20 Unicode library";
mainProgram = "unicode-query"; mainProgram = "unicode-query";
license = licenses.asl20; license = licenses.asl20;
platforms = platforms.unix; platforms = platforms.unix;

View File

@ -0,0 +1,19 @@
diff --git a/src/libunicode/CMakeLists.txt b/src/libunicode/CMakeLists.txt
index bb1a824..166834c 100644
--- a/src/libunicode/CMakeLists.txt
+++ b/src/libunicode/CMakeLists.txt
@@ -235,10 +235,10 @@ if(LIBUNICODE_TESTING)
# supress conversion warnings for Catch2
# https://github.com/catchorg/Catch2/issues/2583
# https://github.com/SFML/SFML/blob/e45628e2ebc5843baa3739781276fa85a54d4653/test/CMakeLists.txt#L18-L22
- set_target_properties(Catch2 PROPERTIES COMPILE_OPTIONS "" EXPORT_COMPILE_COMMANDS OFF)
- set_target_properties(Catch2WithMain PROPERTIES EXPORT_COMPILE_COMMANDS OFF)
- get_target_property(CATCH2_INCLUDE_DIRS Catch2 INTERFACE_INCLUDE_DIRECTORIES)
- target_include_directories(Catch2 SYSTEM INTERFACE ${CATCH2_INCLUDE_DIRS})
+ # set_target_properties(Catch2 PROPERTIES COMPILE_OPTIONS "" EXPORT_COMPILE_COMMANDS OFF)
+ # set_target_properties(Catch2WithMain PROPERTIES EXPORT_COMPILE_COMMANDS OFF)
+ # get_target_property(CATCH2_INCLUDE_DIRS Catch2 INTERFACE_INCLUDE_DIRECTORIES)
+ # target_include_directories(Catch2 SYSTEM INTERFACE ${CATCH2_INCLUDE_DIRS})
endif()
target_link_libraries(unicode_test unicode Catch2::Catch2WithMain)

View File

@ -1,19 +0,0 @@
diff --git a/src/libunicode/CMakeLists.txt b/src/libunicode/CMakeLists.txt
index 6c5ac20..9fa13a3 100644
--- a/src/libunicode/CMakeLists.txt
+++ b/src/libunicode/CMakeLists.txt
@@ -223,10 +223,10 @@ if(LIBUNICODE_TESTING)
# supress conversion warnings for Catch2
# https://github.com/catchorg/Catch2/issues/2583
# https://github.com/SFML/SFML/blob/e45628e2ebc5843baa3739781276fa85a54d4653/test/CMakeLists.txt#L18-L22
- set_target_properties(Catch2 PROPERTIES COMPILE_OPTIONS "" EXPORT_COMPILE_COMMANDS OFF)
- set_target_properties(Catch2WithMain PROPERTIES EXPORT_COMPILE_COMMANDS OFF)
- get_target_property(CATCH2_INCLUDE_DIRS Catch2 INTERFACE_INCLUDE_DIRECTORIES)
- target_include_directories(Catch2 SYSTEM INTERFACE ${CATCH2_INCLUDE_DIRS})
+ # set_target_properties(Catch2 PROPERTIES COMPILE_OPTIONS "" EXPORT_COMPILE_COMMANDS OFF)
+ # set_target_properties(Catch2WithMain PROPERTIES EXPORT_COMPILE_COMMANDS OFF)
+ # get_target_property(CATCH2_INCLUDE_DIRS Catch2 INTERFACE_INCLUDE_DIRECTORIES)
+ # target_include_directories(Catch2 SYSTEM INTERFACE ${CATCH2_INCLUDE_DIRS})
target_link_libraries(unicode_test unicode Catch2::Catch2WithMain fmt::fmt-header-only)
add_test(unicode_test unicode_test)

View File

@ -10302,11 +10302,20 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) IOKit Security; inherit (darwin.apple_sdk.frameworks) IOKit Security;
}; };
libunicode = callPackage ../development/libraries/libunicode { libunicode = callPackage ../by-name/li/libunicode/package.nix {
catch2 = catch2_3; stdenv = if stdenv.hostPlatform.isDarwin then llvmPackages_17.stdenv else stdenv;
fmt = fmt_9;
}; };
libusbgx = callPackage ../development/libraries/libusbgx { };
libusbsio = callPackage ../development/libraries/libusbsio { };
libucontext = callPackage ../development/libraries/libucontext { };
libutempter = callPackage ../development/libraries/libutempter { };
libuldaq = callPackage ../development/libraries/libuldaq { };
libunwind = libunwind =
# Use the system unwinder in the SDK but provide a compatibility package to: # Use the system unwinder in the SDK but provide a compatibility package to:
# 1. avoid evaluation errors with setting `unwind` to `null`; and # 1. avoid evaluation errors with setting `unwind` to `null`; and