Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-24.11] contour: 0.4.3.6442 -> 0.5.1.7247 #358386

Merged
merged 4 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 0 additions & 106 deletions pkgs/applications/terminal-emulators/contour/default.nix

This file was deleted.

114 changes: 114 additions & 0 deletions pkgs/by-name/co/contour/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
boxed-cpp,
freetype,
fontconfig,
libunicode,
libutempter,
termbench-pro,
qt6,
pcre,
boost,
catch2_3,
fmt,
microsoft-gsl,
range-v3,
yaml-cpp,
ncurses,
file,
apple-sdk_11,
libutil,
sigtool,
nixosTests,
installShellFiles,
}:

stdenv.mkDerivation (final: {
pname = "contour";
version = "0.5.1.7247";

src = fetchFromGitHub {
owner = "contour-terminal";
repo = "contour";
rev = "v${final.version}";
hash = "sha256-/vpbyaULemyM3elwaoofvbeeID7jNrmu8X8HlZxWGCk";
};

patches = [ ./dont-fix-app-bundle.diff ];

outputs = [
"out"
"terminfo"
];

nativeBuildInputs = [
cmake
pkg-config
ncurses
file
qt6.wrapQtAppsHook
installShellFiles
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ sigtool ];

buildInputs =
[
boxed-cpp
fontconfig
freetype
libunicode
termbench-pro
qt6.qtmultimedia
qt6.qt5compat
pcre
boost
catch2_3
fmt
microsoft-gsl
range-v3
yaml-cpp
]
++ lib.optionals stdenv.hostPlatform.isLinux [ libutempter ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
apple-sdk_11
libutil
];

cmakeFlags = [ "-DCONTOUR_QT_VERSION=6" ];

postInstall =
''
mkdir -p $out/nix-support $terminfo/share
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir $out/Applications
installShellCompletion --zsh $out/contour.app/Contents/Resources/shell-integration/shell-integration.zsh
installShellCompletion --fish $out/contour.app/Contents/Resources/shell-integration/shell-integration.fish
cp -r $out/contour.app/Contents/Resources/terminfo $terminfo/share
mv $out/contour.app $out/Applications
ln -s $out/bin $out/Applications/contour.app/Contents/MacOS
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
mv $out/share/terminfo $terminfo/share/
installShellCompletion --zsh $out/share/contour/shell-integration/shell-integration.zsh
installShellCompletion --fish $out/share/contour/shell-integration/shell-integration.fish
''
+ ''
echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
'';

passthru.tests.test = nixosTests.terminal-emulators.contour;

meta = with lib; {
description = "Modern C++ Terminal Emulator";
homepage = "https://github.com/contour-terminal/contour";
changelog = "https://github.com/contour-terminal/contour/raw/v${version}/Changelog.md";
license = licenses.asl20;
maintainers = with maintainers; [ moni ];
platforms = platforms.unix;
mainProgram = "contour";
};
})
29 changes: 29 additions & 0 deletions pkgs/by-name/gl/glaze/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
enableAvx2 ? false,
}:

stdenv.mkDerivation (final: {
pname = "glaze";
version = "4.0.0";

src = fetchFromGitHub {
owner = "stephenberry";
repo = "glaze";
rev = "v${final.version}";
hash = "sha256-zaGKYEnYTyAhtP0Hywxp8Y33wvjB1RkEoOGF41CaVnY";
};

nativeBuildInputs = [ cmake ];
cmakeFlags = [ (lib.cmakeBool "glaze_ENABLE_AVX2" enableAvx2) ];

meta = with lib; {
description = "Extremely fast, in memory, JSON and interface library for modern C++";
platforms = platforms.all;
maintainers = with maintainers; [ moni ];
license = licenses.mit;
};
})
Original file line number Diff line number Diff line change
@@ -1,34 +1,50 @@
{ lib, stdenv, fetchFromGitHub, fetchzip, cmake, catch2, fmt, python3 }:
{
lib,
stdenv,
fetchFromGitHub,
fetchzip,
cmake,
catch2_3,
fmt,
python3,
}:

let
ucd-version = "15.0.0";
ucd-version = "16.0.0";

ucd-src = fetchzip {
url = "https://www.unicode.org/Public/${ucd-version}/ucd/UCD.zip";
hash = "sha256-jj6bX46VcnH7vpc9GwM9gArG+hSPbOGL6E4SaVd0s60=";
hash = "sha256-GgEYjOLrxxfTAQsc2bpi7ShoAr3up8z7GXXpe+txFuw";
stripRoot = false;
};
in stdenv.mkDerivation (final: {
in
stdenv.mkDerivation (final: {
pname = "libunicode";
version = "0.4.0";
version = "0.6.0";

src = fetchFromGitHub {
owner = "contour-terminal";
repo = "libunicode";
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.
patches = [ ./remove-target-properties.diff ];

nativeBuildInputs = [ cmake python3 ];
buildInputs = [ catch2 fmt ];
nativeBuildInputs = [
cmake
python3
];
buildInputs = [
catch2_3
fmt
];

cmakeFlags = [ "-DLIBUNICODE_UCD_DIR=${ucd-src}" ];

meta = with lib; {
description = "Modern C++17 Unicode library";
description = "Modern C++20 Unicode library";
mainProgram = "unicode-query";
license = licenses.asl20;
platforms = platforms.unix;
Expand Down
19 changes: 19 additions & 0 deletions pkgs/by-name/li/libunicode/remove-target-properties.diff
Original file line number Diff line number Diff line change
@@ -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)
41 changes: 41 additions & 0 deletions pkgs/by-name/te/termbench-pro/dont-fetchcontent.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6948010..1ee264f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,14 +14,15 @@ if(NOT WIN32 AND NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release MinSizeRel RelWithDebInfo)
endif()

-include(FetchContent)
-FetchContent_Declare(
- glaze
- GIT_REPOSITORY https://github.com/stephenberry/glaze.git
- GIT_TAG v3.4.2
- GIT_SHALLOW TRUE
-)
-FetchContent_MakeAvailable(glaze)
+#include(FetchContent)
+#FetchContent_Declare(
+ #glaze
+ #GIT_REPOSITORY https://github.com/stephenberry/glaze.git
+ #GIT_TAG v3.4.2
+ # GIT_SHALLOW TRUE
+ #)
+#FetchContent_MakeAvailable(glaze)
+#add()

set(MASTER_PROJECT OFF)
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
diff --git a/libtermbench/CMakeLists.txt b/libtermbench/CMakeLists.txt
index f0ddc75..93f63ed 100644
--- a/libtermbench/CMakeLists.txt
+++ b/libtermbench/CMakeLists.txt
@@ -25,6 +25,8 @@ set_target_properties(termbench PROPERTIES

target_include_directories(termbench PUBLIC $<BUILD_INTERFACE:${${PROJECT_NAME}_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+
+find_package(glaze REQUIRED)
target_link_libraries(termbench PUBLIC glaze::glaze)

install(TARGETS termbench
Loading