2021-10-13 22:55:51 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchgit
|
|
|
|
, SDL2
|
|
|
|
, alsa-lib
|
|
|
|
, babl
|
2023-06-10 15:32:11 +02:00
|
|
|
, bash
|
2021-10-13 22:55:51 +02:00
|
|
|
, curl
|
|
|
|
, libdrm # Not documented
|
2023-09-28 00:54:29 +02:00
|
|
|
, pkg-config
|
|
|
|
, xxd
|
2021-10-13 22:55:51 +02:00
|
|
|
, enableFb ? false
|
2020-11-13 19:54:56 +01:00
|
|
|
, nixosTests
|
2021-10-13 22:55:51 +02:00
|
|
|
}:
|
|
|
|
|
2023-09-28 00:54:29 +02:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-10-13 22:55:51 +02:00
|
|
|
pname = "ctx";
|
2023-09-28 00:54:29 +02:00
|
|
|
version = "unstable-2023-09-03";
|
2021-10-13 22:55:51 +02:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
name = "ctx-source"; # because of a dash starting the directory
|
|
|
|
url = "https://ctx.graphics/.git/";
|
2023-09-28 00:54:29 +02:00
|
|
|
rev = "1bac18c152eace3ca995b3c2b829a452085d46fb";
|
|
|
|
hash = "sha256-fOcQJ2XCeomdtAUmy0A+vU7Vt325OSwrb1+ccW+gZ38=";
|
2021-10-13 22:55:51 +02:00
|
|
|
};
|
|
|
|
|
2023-06-10 15:32:11 +02:00
|
|
|
patches = [
|
2023-09-28 00:54:29 +02:00
|
|
|
# Many problematic things fixed - it should be upstreamed somehow:
|
|
|
|
# - babl changed its name in pkg-config files
|
|
|
|
# - arch detection made optional
|
|
|
|
# - LD changed to CCC
|
|
|
|
# - remove inexistent reference to static/*/*
|
|
|
|
./0001-fix-detections.diff
|
2023-06-10 15:32:11 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs ./tools/gen_fs.sh
|
|
|
|
'';
|
|
|
|
|
2021-10-13 22:55:51 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkg-config
|
2023-06-10 15:32:11 +02:00
|
|
|
xxd
|
2021-10-13 22:55:51 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
alsa-lib
|
|
|
|
babl
|
2023-06-10 15:32:11 +02:00
|
|
|
bash # for ctx-audioplayer
|
2021-10-13 22:55:51 +02:00
|
|
|
curl
|
|
|
|
libdrm
|
|
|
|
];
|
|
|
|
|
2023-09-28 00:54:29 +02:00
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
env.ARCH = stdenv.hostPlatform.parsed.cpu.arch;
|
|
|
|
|
2021-10-13 22:55:51 +02:00
|
|
|
configureScript = "./configure.sh";
|
|
|
|
configureFlags = lib.optional enableFb "--enable-fb";
|
2023-06-10 15:32:11 +02:00
|
|
|
configurePlatforms = [];
|
2021-10-13 22:55:51 +02:00
|
|
|
dontAddPrefix = true;
|
2023-06-10 15:32:11 +02:00
|
|
|
dontDisableStatic = true;
|
2021-10-13 22:55:51 +02:00
|
|
|
|
|
|
|
installFlags = [
|
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
];
|
|
|
|
|
2020-11-13 19:54:56 +01:00
|
|
|
passthru.tests.test = nixosTests.terminal-emulators.ctx;
|
|
|
|
|
2023-09-28 00:54:29 +02:00
|
|
|
meta = {
|
2021-10-13 22:55:51 +02:00
|
|
|
homepage = "https://ctx.graphics/";
|
|
|
|
description = "Vector graphics terminal";
|
2023-09-28 00:54:29 +02:00
|
|
|
longDescription = ''
|
2021-10-13 22:55:51 +02:00
|
|
|
ctx is an interactive 2D vector graphics, audio, text- canvas and
|
|
|
|
terminal, with escape sequences that enable a 2D vector drawing API using
|
|
|
|
a vector graphics protocol.
|
|
|
|
'';
|
2023-09-28 00:54:29 +02:00
|
|
|
license = lib.licenses.gpl3Plus;
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
platforms = lib.platforms.unix;
|
2021-10-13 22:55:51 +02:00
|
|
|
};
|
2023-09-28 00:54:29 +02:00
|
|
|
})
|