Merge pull request #150424 from jacereda/code-browser80

code-browser 8.0
This commit is contained in:
Ryan Mulligan 2021-12-15 11:50:32 -08:00 committed by GitHub
commit dc9b2267e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 28 deletions

View file

@ -1,46 +1,57 @@
{ lib, stdenv { lib, stdenv
, fetchurl , fetchurl
, copper , copper
, ruby
, python3 , python3
, qtbase
, gtk3
, pkg-config , pkg-config
, withQt ? false , withQt ? false, qtbase ? null, wrapQtAppsHook ? null
, withGtk ? false, wrapQtAppsHook ? null , withGtk2 ? false, gtk2
, withGtk3 ? false, gtk3
, mkDerivation ? stdenv.mkDerivation
}: }:
stdenv.mkDerivation rec { let onlyOneEnabled = xs: 1 == builtins.length (builtins.filter lib.id xs);
in assert onlyOneEnabled [ withQt withGtk2 withGtk3 ];
mkDerivation rec {
pname = "code-browser"; pname = "code-browser";
version = "7.1.20"; version = "8.0";
src = fetchurl { src = fetchurl {
url = "https://tibleiz.net/download/code-browser-${version}-src.tar.gz"; url = "https://tibleiz.net/download/code-browser-${version}-src.tar.gz";
sha256 = "1svi0v3h42h2lrb8c7pjvqc8019v1p20ibsnl48pfhl8d96mmdnz"; sha256 = "sha256-beCp4lx4MI1+hVgWp2h3piE/zu51zfwQdB5g7ImgmwY=";
}; };
postPatch = '' postPatch = ''
substituteInPlace Makefile --replace "LFLAGS=-no-pie" "LFLAGS=-no-pie -L." substituteInPlace Makefile --replace "LFLAGS=-no-pie" "LFLAGS=-no-pie -L."
substituteInPlace libs/copper-ui/Makefile --replace "moc -o" "${qtbase.dev}/bin/moc -o"
patchShebangs . 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 nativeBuildInputs = [ copper
python3 python3
ruby
qtbase
gtk3
pkg-config pkg-config
] ]
++ lib.optionals withQt [ wrapQtAppsHook ]; ++ lib.optionals withGtk2 [ gtk2 ]
++ lib.optionals withGtk3 [ gtk3 ]
++ lib.optionals withQt [ qtbase wrapQtAppsHook ];
buildInputs = lib.optionals withQt [ qtbase ] buildInputs = lib.optionals withQt [ qtbase ]
++ lib.optionals withGtk [ gtk3 ]; ++ lib.optionals withGtk2 [ gtk2 ]
++ lib.optionals withGtk3 [ gtk3 ];
makeFlags = [ makeFlags = [
"prefix=$(out)" "prefix=$(out)"
"COPPER=${copper}/bin/copper-elf64" "COPPER=${copper}/bin/copper-elf64"
"with-local-libs" "with-local-libs"
"QINC=${qtbase.dev}/include"
] ]
++ lib.optionals withQt [ "UI=qt" ] ++ lib.optionals withQt [ "QINC=${qtbase.dev}/include"
++ lib.optionals withGtk [ "UI=gtk" ]; "UI=qt"
]
dontWrapQtApps = true; ++ lib.optionals withGtk2 [ "UI=gtk2" ]
++ lib.optionals withGtk3 [ "UI=gtk" ];
meta = with lib; { meta = with lib; {
description = "Folding text editor, designed to hierarchically structure any kind of text file and especially source code"; description = "Folding text editor, designed to hierarchically structure any kind of text file and especially source code";

View file

@ -4,16 +4,15 @@
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "copper"; pname = "copper";
version = "4.4"; version = "4.6";
src = fetchurl { src = fetchurl {
url = "https://tibleiz.net/download/copper-${version}-src.tar.gz"; url = "https://tibleiz.net/download/copper-${version}-src.tar.gz";
sha256 = "1nf0bw143rjhd019yms3k6k531rahl8anidwh6bif0gm7cngfwfw"; sha256 = "sha256-tyxAMJp4H50eBz8gjt2O3zj5fq6nOIXKX47wql8aUUg=";
}; };
buildInputs = [ buildInputs = [
libffi libffi
]; ];
postPatch = '' postPatch = ''
substituteInPlace Makefile --replace "-s scripts/" "scripts/"
patchShebangs . patchShebangs .
''; '';
buildPhase = '' buildPhase = ''

View file

@ -4289,11 +4289,9 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; inherit (darwin.apple_sdk.frameworks) CoreFoundation Security;
}; };
code-browser-qt = libsForQt5.callPackage ../applications/editors/code-browser { withQt = true; code-browser-qt = libsForQt5.callPackage ../applications/editors/code-browser { withQt = true; };
}; code-browser-gtk2 = callPackage ../applications/editors/code-browser { withGtk2 = true; };
code-browser-gtk = callPackage ../applications/editors/code-browser { withGtk = true; code-browser-gtk = callPackage ../applications/editors/code-browser { withGtk3 = true; };
qtbase = qt5.qtbase;
};
c14 = callPackage ../applications/networking/c14 { }; c14 = callPackage ../applications/networking/c14 { };