push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,145 @@
{
stdenv,
lib,
fetchFromGitHub,
coreutils,
lazarus,
fpc,
libX11,
# GTK2/3
pango,
cairo,
glib,
atk,
gtk2,
gtk3,
gdk-pixbuf,
python3,
# Qt5
libsForQt5,
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 hash;
}
) (lib.importJSON ./deps.json);
in
stdenv.mkDerivation rec {
pname = "cudatext";
version = "1.202.1";
src = fetchFromGitHub {
owner = "Alexey-T";
repo = "CudaText";
rev = version;
hash = "sha256-ZFMO986D4RtrTnLFdcL0a2BNjcsB+9pIolylblku7j4=";
};
patches = [ ./proc_globdata.patch ];
postPatch = ''
substituteInPlace app/proc_globdata.pas \
--subst-var out \
--subst-var-by python3 ${python3}
substituteInPlace app/proc_editor_saving.pas \
--replace-fail '/bin/cp' "${coreutils}/bin/cp"
'';
nativeBuildInputs = [
lazarus
fpc
]
++ lib.optional (widgetset == "qt5") libsForQt5.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") libsForQt5.libqtpas;
NIX_LDFLAGS = "--as-needed -rpath ${lib.makeLibraryPath buildInputs}";
buildPhase =
lib.concatStringsSep "\n" (
lib.mapAttrsToList (name: dep: ''
cp -r ${dep} ${name}
'') deps
)
+ ''
# See https://wiki.freepascal.org/CudaText#How_to_compile_CudaText
substituteInPlace ATSynEdit/atsynedit/atsynedit_package.lpk \
--replace GTK2_IME_CODE _GTK2_IME_CODE
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 -t $out/bin
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: ''
if [ -d "CudaText-lexers/${lexer}" ]; then
install -Dm644 CudaText-lexers/${lexer}/*.{cuda-lexmap,lcf} $out/share/cudatext/data/lexlib
else
echo "${lexer} lexer not found"
exit 1
fi
'') additionalLexers;
passthru.updateScript = ./update.sh;
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 = "https://cudatext.github.io/";
changelog = "https://cudatext.github.io/history.txt";
license = licenses.mpl20;
maintainers = with maintainers; [ sikmir ];
platforms = platforms.linux;
mainProgram = "cudatext";
};
}

View File

@@ -0,0 +1,57 @@
{
"EncConv": {
"owner": "Alexey-T",
"rev": "2023.04.16",
"hash": "sha256-6KaYv4OO6Ctk+vgow67LKGkbEEd1+lFJ9B1wSk4m3pc="
},
"ATBinHex-Lazarus": {
"owner": "Alexey-T",
"rev": "2023.08.12",
"hash": "sha256-dEwz052aYcJtKpRcP8t7gE2RHuHPQ4T0zHFMv6zVZ6g="
},
"ATFlatControls": {
"owner": "Alexey-T",
"rev": "2023.10.30",
"hash": "sha256-fuTQnnuWjIsABx457y+n6luLxQf+b9TiZGLXYjNsUrw="
},
"ATSynEdit": {
"owner": "Alexey-T",
"rev": "2023.11.23",
"hash": "sha256-LGYGCxEPdZL4BU3TGiFxydu7AN8g5kqOdW+dcbiCf7E="
},
"ATSynEdit_Cmp": {
"owner": "Alexey-T",
"rev": "2023.05.31",
"hash": "sha256-QXu/p3o0RSwMyntFYrjIQBtOBGvL9rAsINaglG3fZvo="
},
"EControl": {
"owner": "Alexey-T",
"rev": "2023.11.16",
"hash": "sha256-FxUV+K9JRsdr0xqQzvg1UI4bBHyhqxiVoPN58h2+WVg="
},
"ATSynEdit_Ex": {
"owner": "Alexey-T",
"rev": "2023.11.23",
"hash": "sha256-RNXP8O3UF+hwA3TNzLorZqlt04Idnc4Z9LA87JJSsZE="
},
"Python-for-Lazarus": {
"owner": "Alexey-T",
"rev": "2023.06.30",
"hash": "sha256-mO8/RNJjy9KtFuDUmV2Y8Ff+Jjm9yRd7GSrI6mOONUc="
},
"Emmet-Pascal": {
"owner": "Alexey-T",
"rev": "2023.08.12",
"hash": "sha256-s9ZKrL+XIWIwejnLz+uuyDbbDuOZLJhiuiMChKB4Reg="
},
"CudaText-lexers": {
"owner": "Alexey-T",
"rev": "2021.07.09",
"hash": "sha256-OyC85mTMi9m5kbtx8TAK2V4voL1i+J+TFoLVwxlHiD4="
},
"bgrabitmap": {
"owner": "bgrabitmap",
"rev": "v11.5.6",
"hash": "sha256-7TuHCCaH8/RxiVQmDILPW4T6op/XW6djwA5iSh/Yb5w="
}
}

View File

@@ -0,0 +1,30 @@
diff --git i/app/proc_globdata.pas w/app/proc_globdata.pas
index d161b09c7..0fcfbdc09 100644
--- i/app/proc_globdata.pas
+++ w/app/proc_globdata.pas
@@ -1342,6 +1342,7 @@ begin
{$ifdef unix}
for Dir in [
+ '@python3@/lib',
'/usr/lib64',
'/usr/lib',
'/usr/lib/x86_64-linux-gnu'
@@ -1364,7 +1365,7 @@ var
function GetDirPrecopy: string;
begin
{$ifdef linux}
- exit('/usr/share/cudatext');
+ exit('@out@/share/cudatext');
{$endif}
{$ifdef darwin}
@@ -2056,7 +2057,7 @@ begin
FindWrapAtEdge_Delay:= 350;
FindWrapAtEdge_ThemeItem:= ''; //'EdMarkedRangeBg';
- AllowProgramUpdates:= true;
+ AllowProgramUpdates:= false;
EscapeClose:= false;
EscapeCloseConsole:= true;
EscapeCloseFinder:= true;

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnused jq nix-prefetch moreutils
set -euo pipefail
cd "$(dirname "$0")"
nixpkgs="$(git rev-parse --show-toplevel)"
oldVersion=$(nix-instantiate --eval -E "(import \"$nixpkgs\" { config = {}; overlays = []; }).cudatext.version" | tr -d '"')
version=$(curl -s https://api.github.com/repos/Alexey-T/CudaText/releases/latest | jq -r '.tag_name')
if [[ $version == $oldVersion ]]; then
echo "Already at latest version $version"
exit 0
fi
echo "New version: $version"
url="https://github.com/Alexey-T/CudaText/archive/refs/tags/${version}.tar.gz"
hash=$(nix-prefetch-url --quiet --unpack --type sha256 $url)
sriHash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $hash)
sed -i "s#version = \".*\"#version = \"$version\"#" default.nix
sed -i "s#hash = \".*\"#hash = \"$sriHash\"#" default.nix
while IFS=$'\t' read repo owner rev; do
latest=$(curl -s https://api.github.com/repos/${owner}/${repo}/releases/latest | jq -r '.tag_name')
if [ "$latest" != "$rev" ]; then
url="https://github.com/${owner}/${repo}/archive/refs/tags/${latest}.tar.gz"
hash=$(nix-prefetch-url --quiet --unpack --type sha256 $url)
sriHash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $hash)
jq ".\"${repo}\".rev = \"${latest}\" | .\"${repo}\".hash = \"${sriHash}\"" deps.json | sponge deps.json
fi
done <<< $(jq -r 'to_entries[]|[.key,.value.owner,.value.rev]|@tsv' deps.json)