nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 pkg-config,
7 boxed-cpp,
8 cairo,
9 freetype,
10 fontconfig,
11 libunicode,
12 libutempter,
13 termbench-pro,
14 qt6,
15 pcre,
16 boost,
17 catch2_3,
18 fmt,
19 microsoft-gsl,
20 range-v3,
21 yaml-cpp,
22 ncurses,
23 file,
24 darwin,
25 nixosTests,
26 installShellFiles,
27 reflection-cpp,
28}:
29
30stdenv.mkDerivation (finalAttrs: {
31 pname = "contour";
32 version = "0.6.2.8008";
33
34 src = fetchFromGitHub {
35 owner = "contour-terminal";
36 repo = "contour";
37 tag = "v${finalAttrs.version}";
38 hash = "sha256-xbJxV1q7+ddhnH0jDYzqVHwARCD0EyVh3POFRkl4d1Q=";
39 };
40
41 patches = lib.optionals stdenv.hostPlatform.isDarwin [
42 ./dont-fix-app-bundle.diff
43 ./remove-deep-flag-from-codesign.diff
44 ];
45
46 outputs = [
47 "out"
48 "terminfo"
49 ];
50
51 nativeBuildInputs = [
52 cmake
53 pkg-config
54 ncurses
55 file
56 qt6.wrapQtAppsHook
57 installShellFiles
58 ]
59 ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ];
60
61 buildInputs = [
62 boxed-cpp
63 cairo
64 fontconfig
65 freetype
66 libunicode
67 termbench-pro
68 qt6.qtmultimedia
69 qt6.qt5compat
70 pcre
71 boost
72 catch2_3
73 fmt
74 microsoft-gsl
75 range-v3
76 yaml-cpp
77 reflection-cpp
78 ]
79 ++ lib.optionals stdenv.hostPlatform.isLinux [ libutempter ]
80 ++ lib.optionals stdenv.hostPlatform.isDarwin [
81 darwin.libutil
82 ];
83
84 postInstall = ''
85 mkdir -p $out/nix-support $terminfo/share
86 ''
87 + lib.optionalString stdenv.hostPlatform.isDarwin ''
88 mkdir $out/Applications $out/bin
89 cp -r $out/contour.app/Contents/Resources/terminfo $terminfo/share
90 mv $out/contour.app $out/Applications
91 ln -s $out/Applications/contour.app/Contents/MacOS/contour $out/bin/contour
92 ''
93 + lib.optionalString stdenv.hostPlatform.isLinux ''
94 mv $out/share/terminfo $terminfo/share/
95 rm -r $out/share/contour
96 ''
97 + ''
98 echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
99 '';
100
101 passthru.tests.test = nixosTests.terminal-emulators.contour;
102
103 meta = {
104 description = "Modern C++ Terminal Emulator";
105 homepage = "https://github.com/contour-terminal/contour";
106 changelog = "https://github.com/contour-terminal/contour/raw/v${finalAttrs.version}/Changelog.md";
107 license = lib.licenses.asl20;
108 maintainers = with lib.maintainers; [ moni ];
109 platforms = lib.platforms.unix;
110 mainProgram = "contour";
111 };
112})