Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchurl,
6 cmake,
7 withQt ? true,
8 libsForQt5,
9 withCurses ? false,
10 ncurses,
11}:
12stdenv.mkDerivation (finalAttrs: {
13 version = "12.4";
14 pname = "textadept";
15
16 src = fetchFromGitHub {
17 name = "textadept11";
18 owner = "orbitalquark";
19 repo = "textadept";
20 tag = "textadept_${finalAttrs.version}";
21 hash = "sha256-nPgpQeBq5Stv2o0Ke4W2Ltnx6qLe5TIC5a8HSYVkmfI=";
22 };
23
24 nativeBuildInputs = [ cmake ] ++ lib.optionals withQt [ libsForQt5.wrapQtAppsHook ];
25
26 buildInputs = lib.optionals withQt [ libsForQt5.qtbase ] ++ lib.optionals withCurses ncurses;
27
28 cmakeFlags =
29 lib.optional withQt [ "-DQT=ON" ]
30 ++ lib.optional withCurses [
31 "-DCURSES=ON"
32 "-DQT=OFF"
33 ];
34
35 preConfigure = ''
36 mkdir -p $PWD/build/_deps
37
38 ''
39 + lib.concatStringsSep "\n" (
40 lib.mapAttrsToList (
41 name: params: "ln -s ${fetchurl params} $PWD/build/_deps/${name}"
42 ) (import ./deps.nix)
43 );
44
45 meta = {
46 description = "Extensible text editor based on Scintilla with Lua scripting";
47 homepage = "http://foicica.com/textadept";
48 downloadPage = "https://github.com/orbitalquark/textadept";
49 changelog = "https://github.com/orbitalquark/textadept/releases/tag/textadept_${finalAttrs.version}";
50 license = lib.licenses.mit;
51 maintainers = with lib.maintainers; [
52 raskin
53 mirrexagon
54 arcuru
55 ];
56 platforms = lib.platforms.linux;
57 mainProgram = "textadept";
58 };
59})