10 wrapQtAppsHook ? null,
15 mkDerivation ? stdenv.mkDerivation,
18 onlyOneEnabled = xs: 1 == builtins.length (builtins.filter lib.id xs);
20 assert onlyOneEnabled [
26 pname = "code-browser";
29 url = "https://tibleiz.net/download/code-browser-${version}-src.tar.gz";
30 sha256 = "sha256-beCp4lx4MI1+hVgWp2h3piE/zu51zfwQdB5g7ImgmwY=";
34 substituteInPlace Makefile --replace "LFLAGS=-no-pie" "LFLAGS=-no-pie -L."
37 + lib.optionalString withQt ''
38 substituteInPlace libs/copper-ui/Makefile --replace "moc -o" "${qtbase.dev}/bin/moc -o"
39 substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: qt"
41 + lib.optionalString withGtk2 ''
42 substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: gtk2"
44 + lib.optionalString withGtk3 ''
45 substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: gtk"
53 ++ lib.optionals withGtk2 [ gtk2 ]
54 ++ lib.optionals withGtk3 [ gtk3 ]
55 ++ lib.optionals withQt [
60 lib.optionals withQt [ qtbase ]
61 ++ lib.optionals withGtk2 [ gtk2 ]
62 ++ lib.optionals withGtk3 [ gtk3 ];
66 "COPPER=${copper}/bin/copper-elf64"
69 ++ lib.optionals withQt [
70 "QINC=${qtbase.dev}/include"
73 ++ lib.optionals withGtk2 [ "UI=gtk2" ]
74 ++ lib.optionals withGtk3 [ "UI=gtk" ];
77 description = "Folding text editor, designed to hierarchically structure any kind of text file and especially source code";
78 homepage = "https://tibleiz.net/code-browser/";
79 license = licenses.gpl2;
80 platforms = platforms.x86_64;