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:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
54
pkgs/servers/nitter/default.nix
Normal file
54
pkgs/servers/nitter/default.nix
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{ lib
|
||||
, fetchFromGitHub
|
||||
, nimPackages
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
nimPackages.buildNimPackage rec {
|
||||
pname = "nitter";
|
||||
version = "unstable-2022-06-04";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "zedeus";
|
||||
repo = "nitter";
|
||||
rev = "138826fb4fbdec73fc6fee2e025fda88f7f2fb49";
|
||||
hash = "sha256-fdzVfzmEFIej6Kb/K9MQyvbN8aN3hO7RetHL53cD59k=";
|
||||
};
|
||||
|
||||
buildInputs = with nimPackages; [
|
||||
flatty
|
||||
jester
|
||||
jsony
|
||||
karax
|
||||
markdown
|
||||
nimcrypto
|
||||
packedjson
|
||||
redis
|
||||
redpool
|
||||
sass
|
||||
supersnappy
|
||||
zippy
|
||||
];
|
||||
|
||||
nimBinOnly = true;
|
||||
|
||||
postBuild = ''
|
||||
nim c --hint[Processing]:off -r tools/gencss
|
||||
nim c --hint[Processing]:off -r tools/rendermd
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/nitter
|
||||
cp -r public $out/share/nitter/public
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/zedeus/nitter";
|
||||
description = "Alternative Twitter front-end";
|
||||
license = licenses.agpl3Only;
|
||||
maintainers = with maintainers; [ erdnaxe ];
|
||||
mainProgram = "nitter";
|
||||
};
|
||||
|
||||
passthru.tests = { inherit (nixosTests) nitter; };
|
||||
}
|
||||
40
pkgs/servers/nitter/update.sh
Executable file
40
pkgs/servers/nitter/update.sh
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p common-updater-scripts curl jq nix nix-prefetch-git patchutils
|
||||
set -euo pipefail
|
||||
|
||||
info() {
|
||||
if [ -t 2 ]; then
|
||||
set -- '\033[32m%s\033[39m\n' "$@"
|
||||
else
|
||||
set -- '%s\n' "$@"
|
||||
fi
|
||||
printf "$@" >&2
|
||||
}
|
||||
|
||||
nitter_old_version=$(nix-instantiate --eval --strict --json -A nitter.version . | jq -r .)
|
||||
nitter_old_rev=$(nix-instantiate --eval --strict --json -A nitter.src.rev . | jq -r .)
|
||||
today=$(LANG=C date -u +'%Y-%m-%d')
|
||||
|
||||
# use latest commit before today, we should not call the version *today*
|
||||
# because there might still be commits coming
|
||||
# use the day of the latest commit we picked as version
|
||||
commit=$(curl -Sfs "https://api.github.com/repos/zedeus/nitter/compare/$nitter_old_rev~1...master" \
|
||||
| jq '.commits | map(select(.commit.committer.date < $today) | {sha, date: .commit.committer.date}) | .[-1]' --arg today "$today")
|
||||
nitter_new_rev=$(jq -r '.sha' <<< "$commit")
|
||||
nitter_new_version="unstable-$(jq -r '.date[0:10]' <<< "$commit")"
|
||||
info "latest commit before $today: $nitter_new_rev ($(jq -r '.date' <<< "$commit"))"
|
||||
|
||||
if [ "$nitter_new_rev" = "$nitter_old_rev" ]; then
|
||||
info "nitter is up-to-date."
|
||||
exit
|
||||
fi
|
||||
|
||||
if curl -Sfs "https://github.com/zedeus/nitter/compare/$nitter_old_rev...$nitter_new_rev.patch" \
|
||||
| lsdiff | grep -Fxe 'a/nitter.nimble' -e 'b/nitter.nimble' > /dev/null; then
|
||||
info "nitter.nimble changed, some dependencies probably need updating."
|
||||
fi
|
||||
|
||||
nitter_new_sha256=$(nix-prefetch-git --rev "$nitter_new_rev" "https://github.com/zedeus/nitter.git" | jq -r .sha256)
|
||||
update-source-version nitter "$nitter_new_version" "$nitter_new_sha256" --rev="$nitter_new_rev"
|
||||
git commit --all --verbose --message "nitter: $nitter_old_version -> $nitter_new_version"
|
||||
info "Updated nitter to $nitter_new_version."
|
||||
Loading…
Add table
Add a link
Reference in a new issue