diff options
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/applications/editors/cudatext')
3 files changed, 182 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/applications/editors/cudatext/default.nix b/infra/libkookie/nixpkgs/pkgs/applications/editors/cudatext/default.nix new file mode 100644 index 000000000000..af3f087dae26 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/applications/editors/cudatext/default.nix @@ -0,0 +1,113 @@ +{ stdenv +, lib +, fetchFromGitHub +, lazarus +, fpc +, libX11 + +# GTK2/3 +, pango +, cairo +, glib +, atk +, gtk2 +, gtk3 +, gdk-pixbuf +, python3 + +# Qt5 +, libqt5pas +, qt5 + +, widgetset ? "qt5" +# See https://github.com/Alexey-T/CudaText-lexers +, additionalLexers ? [ "Nix" ] +}: + +assert builtins.elem widgetset [ "gtk2" "gtk3" "qt5" ]; + +let + deps = lib.mapAttrs + (name: spec: + fetchFromGitHub { + repo = name; + inherit (spec) owner rev sha256; + } + ) + (builtins.fromJSON (builtins.readFile ./deps.json)); +in +stdenv.mkDerivation rec { + pname = "cudatext"; + version = "1.115.0"; + + src = fetchFromGitHub { + owner = "Alexey-T"; + repo = "CudaText"; + rev = version; + sha256 = "0q7gfpzc97fvyvabjdb9a4d3c2qhm4zf5bqgnsj73vkly80kgww8"; + }; + + patches = [ + # Don't check for update + ./dont-check-update.patch + ]; + + postPatch = '' + substituteInPlace app/proc_globdata.pas \ + --replace "/usr/share/cudatext" "$out/share/cudatext" \ + --replace "libpython3.so" "${python3}/lib/libpython3.so" + ''; + + nativeBuildInputs = [ lazarus fpc ] + ++ lib.optional (widgetset == "qt5") qt5.wrapQtAppsHook; + + buildInputs = [ libX11 ] + ++ lib.optionals (lib.hasPrefix "gtk" widgetset) [ pango cairo glib atk gdk-pixbuf ] + ++ lib.optional (widgetset == "gtk2") gtk2 + ++ lib.optional (widgetset == "gtk3") gtk3 + ++ lib.optional (widgetset == "qt5") libqt5pas; + + NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}"; + + buildPhase = lib.concatStringsSep "\n" (lib.mapAttrsToList (name: dep: '' + cp -r --no-preserve=mode ${dep} ${name} + '') deps) + '' + lazbuild --lazarusdir=${lazarus}/share/lazarus --pcp=./lazarus --ws=${widgetset} \ + bgrabitmap/bgrabitmap/bgrabitmappack.lpk \ + EncConv/encconv/encconv_package.lpk \ + ATBinHex-Lazarus/atbinhex/atbinhex_package.lpk \ + ATFlatControls/atflatcontrols/atflatcontrols_package.lpk \ + ATSynEdit/atsynedit/atsynedit_package.lpk \ + ATSynEdit_Cmp/atsynedit_cmp/atsynedit_cmp_package.lpk \ + EControl/econtrol/econtrol_package.lpk \ + ATSynEdit_Ex/atsynedit_ex/atsynedit_ex_package.lpk \ + Python-for-Lazarus/python4lazarus/python4lazarus_package.lpk \ + Emmet-Pascal/emmet/emmet_package.lpk \ + app/cudatext.lpi + ''; + + installPhase = '' + install -Dm755 app/cudatext $out/bin/cudatext + + install -dm755 $out/share/cudatext + cp -r app/{data,py,settings_default} $out/share/cudatext + + install -Dm644 setup/debfiles/cudatext-512.png -t $out/share/pixmaps + install -Dm644 setup/debfiles/cudatext.desktop -t $out/share/applications + '' + lib.concatMapStringsSep "\n" (lexer: '' + install -Dm644 CudaText-lexers/${lexer}/*.{cuda-lexmap,lcf} $out/share/cudatext/data/lexlib + '') additionalLexers; + + meta = with lib; { + description = "Cross-platform code editor"; + longDescription = '' + Text/code editor with lite UI. Syntax highlighting for 200+ languages. + Config system in JSON files. Multi-carets and multi-selections. + Search and replace with RegEx. Extendable by Python plugins and themes. + ''; + homepage = "http://www.uvviewsoft.com/cudatext/"; + license = licenses.mpl20; + maintainers = with maintainers; [ sikmir ]; + platforms = platforms.linux; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/applications/editors/cudatext/deps.json b/infra/libkookie/nixpkgs/pkgs/applications/editors/cudatext/deps.json new file mode 100644 index 000000000000..02418d25842d --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/applications/editors/cudatext/deps.json @@ -0,0 +1,57 @@ +{ + "EncConv": { + "owner": "Alexey-T", + "rev": "2020.06.15", + "sha256": "07dpvq3ppfq3b70i1smkf7vwdlzq8qnxs3fk94hi9h1z36bz2rw3" + }, + "ATBinHex-Lazarus": { + "owner": "Alexey-T", + "rev": "2020.09.05", + "sha256": "022yx5vic4hnc9lz53wvr4h7hf0h71801dzlilj55x5mf8p59072" + }, + "ATFlatControls": { + "owner": "Alexey-T", + "rev": "2020.09.20", + "sha256": "09svn8yyqp6znvfpcxrsybkclh828h5rvah7nhbhk7nrfzj8i63x" + }, + "ATSynEdit": { + "owner": "Alexey-T", + "rev": "2020.10.12", + "sha256": "07vznwwfa3c1jr1cd32yppw0mmmm1ja9bmsxhxlcbnc2nb30n9zr" + }, + "ATSynEdit_Cmp": { + "owner": "Alexey-T", + "rev": "2020.10.11", + "sha256": "11vx685i85izp7wzb34dalcwlkmkbz1vzva5j9cf2yz1jff1v4qw" + }, + "EControl": { + "owner": "Alexey-T", + "rev": "2020.10.04", + "sha256": "0ypbaca3y5biw2207yh3x5p28gm8g51qf7glm5622w3cgbrf9mdq" + }, + "ATSynEdit_Ex": { + "owner": "Alexey-T", + "rev": "2020.10.04", + "sha256": "0z66cm9pgdi7whqaim6hva4aa08zrr1881n1fal7lnz6wlla824k" + }, + "Python-for-Lazarus": { + "owner": "Alexey-T", + "rev": "2020.07.31", + "sha256": "0qbs51h6gw8qd3h06kwy1j7db35shbg7r2rayrhvvw0vzr9n330j" + }, + "Emmet-Pascal": { + "owner": "Alexey-T", + "rev": "2020.09.05", + "sha256": "0qfiirxnk5g3whx8y8hp54ch3h6gkkd01yf79m95bwar5qvdfybg" + }, + "CudaText-lexers": { + "owner": "Alexey-T", + "rev": "2020.08.10", + "sha256": "1gzs2psyfhb9si1qyacxzfjb3dz2v255hv7y4jlkbxdxv0kckqr6" + }, + "bgrabitmap": { + "owner": "bgrabitmap", + "rev": "v11.2.4", + "sha256": "1zk88crfn07md16wg6af4i8nlx4ikkhxq9gfk49jirwimgwbf1md" + } +} diff --git a/infra/libkookie/nixpkgs/pkgs/applications/editors/cudatext/dont-check-update.patch b/infra/libkookie/nixpkgs/pkgs/applications/editors/cudatext/dont-check-update.patch new file mode 100644 index 000000000000..5c896bc046c0 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/applications/editors/cudatext/dont-check-update.patch @@ -0,0 +1,12 @@ +diff --git i/app/formmain.pas w/app/formmain.pas +index f6f37febb..cf993d75e 100644 +--- i/app/formmain.pas ++++ w/app/formmain.pas +@@ -2156,6 +2156,7 @@ begin + false + {$endif}; + *) ++ mnuHelpCheckUpd.Enabled:=false; + + with AppPanels[cPaneSide] do + begin |