@@ -0,0 +1,58 @@
1+{ lib
2+, stdenv
3+, fetchgit
4+, SDL2
5+, alsa-lib
6+, babl
7+, curl
8+, libdrm # Not documented
9+, pkg-config
10+, enableFb ? false
11+}:
12+
13+stdenv.mkDerivation rec {
14+ pname = "ctx";
15+ version = "0.pre+date=2021-10-09";
16+
17+ src = fetchgit {
18+ name = "ctx-source"; # because of a dash starting the directory
19+ url = "https://ctx.graphics/.git/";
20+ rev = "d11d0d1a719a3c77712528e2feed8c0878e0ea64";
21+ sha256 = "sha256-Az3POgdvDOVaaRtzLlISDODhAKbefpGx5KgwO3dttqs=";
22+ };
23+
24+ nativeBuildInputs = [
25+ pkg-config
26+ ];
27+
28+ buildInputs = [
29+ SDL2
30+ alsa-lib
31+ babl
32+ curl
33+ libdrm
34+ ];
35+
36+ configureScript = "./configure.sh";
37+ configureFlags = lib.optional enableFb "--enable-fb";
38+ dontAddPrefix = true;
39+
40+ hardeningDisable = [ "format" ];
41+
42+ installFlags = [
43+ "PREFIX=${placeholder "out"}"
44+ ];
45+
46+ meta = with lib; {
47+ homepage = "https://ctx.graphics/";
48+ description = "Vector graphics terminal";
49+ longDescription= ''
50+ ctx is an interactive 2D vector graphics, audio, text- canvas and
51+ terminal, with escape sequences that enable a 2D vector drawing API using
52+ a vector graphics protocol.
53+ '';
54+ license = licenses.gpl3Plus;
55+ maintainers = with maintainers; [ AndersonTorres];
56+ platforms = platforms.unix;
57+ };
58+}