Merge pull request #272856 from aaronjheng/utf8cpp-4

utf8cpp: 3.2.5 -> 4.0.3
This commit is contained in:
Mario Rodas 2023-12-17 10:36:24 -05:00 committed by GitHub
commit a6bf3d54f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 53 additions and 14 deletions

View file

@ -2,26 +2,18 @@
stdenv.mkDerivation rec {
pname = "utf8cpp";
version = "3.2.5";
version = "4.0.3";
src = fetchFromGitHub {
owner = "nemtrif";
repo = "utfcpp";
rev = "v${version}";
fetchSubmodules = true;
sha256 = "sha256-cWiGggn2GP25K/8eopvnFPq6iwcBteNI3i9Lo1Sr+ig=";
hash = "sha256-oUr476HMBYzX64x28Kcudw0B1BVqLUPVVdRzRe82AOc=";
};
cmakeFlags = [
"-DCMAKE_INSTALL_LIBDIR=lib"
];
nativeBuildInputs = [ cmake ];
# Tests fail on darwin, probably due to a bug in the test framework:
# https://github.com/nemtrif/utfcpp/issues/84
doCheck = !stdenv.isDarwin;
meta = with lib; {
homepage = "https://github.com/nemtrif/utfcpp";
changelog = "https://github.com/nemtrif/utfcpp/releases/tag/v${version}";

View file

@ -15,7 +15,8 @@ let
mkAntlr = {
version, sourceSha256, jarSha256,
extraCppBuildInputs ? [],
extraCppCmakeFlags ? []
extraCppCmakeFlags ? [],
extraPatches ? [ ]
}: rec {
source = fetchFromGitHub {
owner = "antlr";
@ -81,7 +82,8 @@ let
pname = "antlr-runtime-cpp";
inherit version;
src = source;
sourceRoot = "${source.name}/runtime/Cpp";
patches = extraPatches;
outputs = [ "out" "dev" "doc" ];
@ -90,6 +92,8 @@ let
lib.optional stdenv.isDarwin CoreFoundation ++
extraCppBuildInputs;
cmakeDir = "../runtime/Cpp";
cmakeFlags = extraCppCmakeFlags;
meta = with lib; {
@ -162,6 +166,12 @@ in {
jarSha256 = "0dnz2x54kigc58bxnynjhmr5iq49f938vj6p50gdir1xdna41kdg";
extraCppBuildInputs = [ utf8cpp ]
++ lib.optional stdenv.isLinux libuuid;
extraCppCmakeFlags = [
"-DCMAKE_CXX_FLAGS='-I${lib.getDev utf8cpp}/include/utf8cpp'"
];
extraPatches = [
./utf8cpp.patch
];
}).antlr;
antlr4_8 = (mkAntlr {

View file

@ -0,0 +1,15 @@
diff --git a/runtime/Cpp/runtime/CMakeLists.txt b/runtime/Cpp/runtime/CMakeLists.txt
index c8b16c6cf..e8da7960d 100644
--- a/runtime/Cpp/runtime/CMakeLists.txt
+++ b/runtime/Cpp/runtime/CMakeLists.txt
@@ -40,8 +40,8 @@ find_package(utf8cpp QUIET)
set(INSTALL_utf8cpp FALSE)
if (utf8cpp_FOUND)
- target_link_libraries(antlr4_shared utf8cpp)
- target_link_libraries(antlr4_static utf8cpp)
+ target_link_libraries(antlr4_shared utf8cpp::utf8cpp)
+ target_link_libraries(antlr4_static utf8cpp::utf8cpp)
else()
# older utf8cpp doesn't define the package above

View file

@ -26,7 +26,11 @@ stdenv.mkDerivation rec {
rev = version;
sha256 = "sha256-sLNO4vkmlirsqJmCV9YWpyNnIiigU1KMls7rOgWgSmQ=";
};
sourceRoot = "${src.name}/desktop_version";
patches = [
./utf8cpp.patch
];
dataZip = fetchurl {
url = "https://thelettervsixtim.es/makeandplay/data.zip";
name = "data.zip";
@ -51,7 +55,12 @@ stdenv.mkDerivation rec {
# Help CMake find SDL_mixer.h
env.NIX_CFLAGS_COMPILE = "-I${lib.getDev SDL2_mixer}/include/SDL2";
cmakeFlags = [ "-DBUNDLE_DEPENDENCIES=OFF" ] ++ lib.optional makeAndPlay "-DMAKEANDPLAY=ON";
cmakeDir = "../desktop_version";
cmakeFlags = [
"-DBUNDLE_DEPENDENCIES=OFF"
"-DCMAKE_CXX_FLAGS='-I${lib.getDev utf8cpp}/include/utf8cpp'"
] ++ lib.optional makeAndPlay "-DMAKEANDPLAY=ON";
desktopItems = [
(makeDesktopItem {

View file

@ -0,0 +1,13 @@
diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt
index 7405c122..68ba40e3 100644
--- a/desktop_version/CMakeLists.txt
+++ b/desktop_version/CMakeLists.txt
@@ -296,7 +296,7 @@ if(BUNDLE_DEPENDENCIES)
else()
find_package(utf8cpp CONFIG)
- target_link_libraries(VVVVVV physfs tinyxml2 utf8cpp lodepng-static)
+ target_link_libraries(VVVVVV physfs tinyxml2 utf8cpp::utf8cpp lodepng-static)
endif()
# SDL2 Dependency (Detection pulled from FAudio)