about summary refs log tree commit diff
path: root/pkgs/applications/editors/code-browser
diff options
context:
space:
mode:
authorJorge Acereda <jacereda@gmail.com>2021-12-12 14:23:00 +0100
committerJorge Acereda <jacereda@gmail.com>2021-12-12 14:23:00 +0100
commit0241614f27d28c23212ee6bec355b48b29d74246 (patch)
tree799f9fd8f7787eddb29b1b588b7a0a788e66bba6 /pkgs/applications/editors/code-browser
parent89f9319f09b3bf4cc49d371024660e271257ec03 (diff)
code-browser: 7.1.20 -> 8.0
Diffstat (limited to 'pkgs/applications/editors/code-browser')
-rw-r--r--pkgs/applications/editors/code-browser/default.nix49
1 files changed, 29 insertions, 20 deletions
diff --git a/pkgs/applications/editors/code-browser/default.nix b/pkgs/applications/editors/code-browser/default.nix
index ea4398cc4a5ce..b9f9ce1608a1e 100644
--- a/pkgs/applications/editors/code-browser/default.nix
+++ b/pkgs/applications/editors/code-browser/default.nix
@@ -1,46 +1,55 @@
 { lib, stdenv
 , fetchurl
 , copper
-, ruby
 , python3
-, qtbase
-, gtk3
 , pkg-config
-, withQt ? false
-, withGtk ? false, wrapQtAppsHook ? null
+, withQt ? false, qtbase ? null, wrapQtAppsHook ? null
+, withGtk2 ? false, gtk2
+, withGtk3 ? false, gtk3
+, mkDerivation ? stdenv.mkDerivation
 }:
-stdenv.mkDerivation rec {
+mkDerivation rec {
   pname = "code-browser";
-  version = "7.1.20";
+  version = "8.0";
   src = fetchurl {
     url = "https://tibleiz.net/download/code-browser-${version}-src.tar.gz";
-    sha256 = "1svi0v3h42h2lrb8c7pjvqc8019v1p20ibsnl48pfhl8d96mmdnz";
+    sha256 = "sha256-beCp4lx4MI1+hVgWp2h3piE/zu51zfwQdB5g7ImgmwY=";
   };
   postPatch = ''
     substituteInPlace Makefile --replace "LFLAGS=-no-pie" "LFLAGS=-no-pie -L."
-    substituteInPlace libs/copper-ui/Makefile --replace "moc -o" "${qtbase.dev}/bin/moc -o"
     patchShebangs .
-  '';
+  ''
+  + lib.optionalString withQt ''
+    substituteInPlace libs/copper-ui/Makefile --replace "moc -o" "${qtbase.dev}/bin/moc -o"
+    substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: qt"
+  ''
+  + lib.optionalString withGtk2 ''
+    substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: gtk2"
+  ''
+  + lib.optionalString withGtk3 ''
+    substituteInPlace libs/copper-ui/Makefile --replace "all: qt gtk gtk2" "all: gtk"
+  ''
+  ;
   nativeBuildInputs = [ copper
                         python3
-                        ruby
-                        qtbase
-                        gtk3
                         pkg-config
                       ]
-  ++ lib.optionals withQt [ wrapQtAppsHook ];
+  ++ lib.optionals withGtk2 [ gtk2 ]
+  ++ lib.optionals withGtk3 [ gtk3 ]
+  ++ lib.optionals withQt [ qtbase wrapQtAppsHook ];
   buildInputs = lib.optionals withQt [ qtbase ]
-                ++ lib.optionals withGtk [ gtk3 ];
+                ++ lib.optionals withGtk2 [ gtk2 ]
+                ++ lib.optionals withGtk3 [ gtk3 ];
   makeFlags = [
     "prefix=$(out)"
     "COPPER=${copper}/bin/copper-elf64"
     "with-local-libs"
-    "QINC=${qtbase.dev}/include"
   ]
-  ++ lib.optionals withQt [ "UI=qt" ]
-  ++ lib.optionals withGtk [ "UI=gtk" ];
-
-  dontWrapQtApps = true;
+  ++ lib.optionals withQt [ "QINC=${qtbase.dev}/include"
+                            "UI=qt"
+                          ]
+  ++ lib.optionals withGtk2 [ "UI=gtk2" ]
+  ++ lib.optionals withGtk3 [ "UI=gtk" ];
 
   meta = with lib; {
     description = "Folding text editor, designed to hierarchically structure any kind of text file and especially source code";