uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,117 @@
{ 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;
}
)
(lib.importJSON ./deps.json);
in
stdenv.mkDerivation rec {
pname = "cudatext";
version = "1.165.2";
src = fetchFromGitHub {
owner = "Alexey-T";
repo = "CudaText";
rev = version;
sha256 = "sha256-eNpU7PpzyL2KHPL6cPmxZw/49VALjCWUdavV6Ex1IQI=";
};
postPatch = ''
substituteInPlace app/proc_globdata.pas \
--replace "/usr/share/cudatext" "$out/share/cudatext" \
--replace "libpython3.so" "${python3}/lib/libpython${python3.pythonVersion}.so" \
--replace "AllowProgramUpdates:= true;" "AllowProgramUpdates:= false;"
'';
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: ''
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;
};
}

View file

@ -0,0 +1,57 @@
{
"EncConv": {
"owner": "Alexey-T",
"rev": "2022.04.18",
"sha256": "sha256-UV07a9qNzd0JQWCq/eD0K9fA7kxAKj5OP7dOpECo8xw="
},
"ATBinHex-Lazarus": {
"owner": "Alexey-T",
"rev": "2022.04.16",
"sha256": "sha256-7ye73KSpoPvvxBNwBC3uloufFE+448RDyNScumk1ViE="
},
"ATFlatControls": {
"owner": "Alexey-T",
"rev": "2022.05.06",
"sha256": "sha256-mYZ3mgtUpQ8sry5WmdluHca/CR7RqR9GRrxIoeZFLes="
},
"ATSynEdit": {
"owner": "Alexey-T",
"rev": "2022.06.01",
"sha256": "sha256-dilFwvtD8OLLq7QOPWSG3FeBM12Yy4ztM+CedJQAAaU="
},
"ATSynEdit_Cmp": {
"owner": "Alexey-T",
"rev": "2022.05.04",
"sha256": "sha256-6O4RijSejPogokLSBuC6pKrOpihMi/ykS06YyV64Sak="
},
"EControl": {
"owner": "Alexey-T",
"rev": "2022.05.06",
"sha256": "sha256-ppm8Wuxhi5N3Er0f0h9d+v2spwEMr7ksf9tz4vI42+M="
},
"ATSynEdit_Ex": {
"owner": "Alexey-T",
"rev": "2022.05.23",
"sha256": "sha256-/PqEx2Z1TVjnxfeWR9qBZUNzdqDBttuLmSBzIEPe1MY="
},
"Python-for-Lazarus": {
"owner": "Alexey-T",
"rev": "2021.10.27",
"sha256": "sha256-ikXdDUMJ9MxRejEVAhwUsXYVh0URVFHzEpnXuN5NGpA="
},
"Emmet-Pascal": {
"owner": "Alexey-T",
"rev": "2022.01.17",
"sha256": "sha256-5yqxRW7xFJ4MwHjKnxYL8/HrCDLn30a1gyQRjGMx/qw="
},
"CudaText-lexers": {
"owner": "Alexey-T",
"rev": "2021.07.09",
"sha256": "sha256-OyC85mTMi9m5kbtx8TAK2V4voL1i+J+TFoLVwxlHiD4="
},
"bgrabitmap": {
"owner": "bgrabitmap",
"rev": "v11.4",
"sha256": "sha256-jZL8lzjua033E76IL0HIk/fihC73ifCb4LqMni7vvb0="
}
}

View file

@ -0,0 +1,23 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnused jq nix-prefetch moreutils
set -euo pipefail
cd "$(dirname "$0")"
version=$(curl -s https://api.github.com/repos/Alexey-T/CudaText/releases/latest | jq -r '.tag_name')
url="https://github.com/Alexey-T/CudaText/archive/refs/tags/${version}.tar.gz"
hash=$(nix-prefetch-url --quiet --unpack --type sha256 $url)
sriHash=$(nix hash to-sri --type sha256 $hash)
sed -i "s#version = \".*\"#version = \"$version\"#" default.nix
sed -i "s#sha256 = \".*\"#sha256 = \"$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 hash to-sri --type sha256 $hash)
jq ".\"${repo}\".rev = \"${latest}\" | .\"${repo}\".sha256 = \"${sriHash}\"" deps.json | sponge deps.json
fi
done <<< $(jq -r 'to_entries[]|[.key,.value.owner,.value.rev]|@tsv' deps.json)