2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2024-01-02 11:29:13 +00:00
|
|
|
, fetchurl
|
2022-06-16 17:23:12 +00:00
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, freetype
|
|
|
|
, fontconfig
|
2024-01-02 11:29:13 +00:00
|
|
|
, libunicode
|
|
|
|
, libutempter
|
|
|
|
, termbench-pro
|
|
|
|
, qtmultimedia
|
|
|
|
, wrapQtAppsHook
|
2022-06-16 17:23:12 +00:00
|
|
|
, pcre
|
|
|
|
, boost
|
|
|
|
, catch2
|
|
|
|
, fmt
|
2023-07-15 17:15:38 +00:00
|
|
|
, microsoft-gsl
|
2022-06-16 17:23:12 +00:00
|
|
|
, range-v3
|
2023-02-02 18:25:31 +00:00
|
|
|
, yaml-cpp
|
2022-06-16 17:23:12 +00:00
|
|
|
, ncurses
|
|
|
|
, file
|
2024-01-02 11:29:13 +00:00
|
|
|
, utmp
|
|
|
|
, sigtool
|
2022-06-16 17:23:12 +00:00
|
|
|
, nixosTests
|
2024-01-02 11:29:13 +00:00
|
|
|
, installShellFiles
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
stdenv.mkDerivation (final: {
|
2021-06-28 23:13:55 +00:00
|
|
|
pname = "contour";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.3.12.262";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-06-16 17:23:12 +00:00
|
|
|
owner = "contour-terminal";
|
2024-01-02 11:29:13 +00:00
|
|
|
repo = "contour";
|
|
|
|
rev = "v${final.version}";
|
|
|
|
hash = "sha256-4R0NyUtsyr3plYfVPom+EjJ5W0Cb/uuaSB5zyJ0yIB4=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
outputs = [ "out" "terminfo" ];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
# fix missing <QtMultimedia/QAudioSink> on Darwin and codesign the binary
|
|
|
|
patches = [ ./contour-cmakelists.diff ./macos-codesign.diff ];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
ncurses
|
|
|
|
file
|
2024-01-02 11:29:13 +00:00
|
|
|
wrapQtAppsHook
|
|
|
|
installShellFiles
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [ sigtool ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2024-01-02 11:29:13 +00:00
|
|
|
libunicode
|
|
|
|
termbench-pro
|
|
|
|
qtmultimedia
|
2022-06-16 17:23:12 +00:00
|
|
|
pcre
|
|
|
|
boost
|
|
|
|
catch2
|
|
|
|
fmt
|
2023-07-15 17:15:38 +00:00
|
|
|
microsoft-gsl
|
2022-06-16 17:23:12 +00:00
|
|
|
range-v3
|
2023-02-02 18:25:31 +00:00
|
|
|
yaml-cpp
|
2024-01-02 11:29:13 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isLinux [ libutempter ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ utmp ];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
cmakeFlags = [ "-DCONTOUR_QT_VERSION=6" ];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
preConfigure = ''
|
2022-06-16 17:23:12 +00:00
|
|
|
# Don't fix Darwin app bundle
|
|
|
|
sed -i '/fixup_bundle/d' src/contour/CMakeLists.txt
|
|
|
|
'';
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/nix-support $terminfo/share
|
2024-01-02 11:29:13 +00:00
|
|
|
'' + lib.optionalString stdenv.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.isLinux ''
|
2023-10-09 19:29:22 +00:00
|
|
|
mv $out/share/terminfo $terminfo/share/
|
2024-01-02 11:29:13 +00:00
|
|
|
installShellCompletion --zsh $out/share/contour/shell-integration/shell-integration.zsh
|
|
|
|
installShellCompletion --fish $out/share/contour/shell-integration/shell-integration.fish
|
|
|
|
'' + ''
|
2023-10-09 19:29:22 +00:00
|
|
|
echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
|
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
passthru.tests.test = nixosTests.terminal-emulators.contour;
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Modern C++ Terminal Emulator";
|
2022-06-16 17:23:12 +00:00
|
|
|
homepage = "https://github.com/contour-terminal/contour";
|
|
|
|
changelog = "https://github.com/contour-terminal/contour/raw/v${version}/Changelog.md";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = licenses.asl20;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ moni ];
|
2021-06-28 23:13:55 +00:00
|
|
|
platforms = platforms.unix;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "contour";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
2024-01-02 11:29:13 +00:00
|
|
|
})
|