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,60 @@
{ lib
, buildGoPackage
, fetchFromGitHub
, buildGoModule
, sqlite
, callPackage
}:
buildGoModule rec {
pname = "gotify-server";
# should be update just like all other files imported like that via the
# `update.sh` script.
version = import ./version.nix;
src = fetchFromGitHub {
owner = "gotify";
repo = "server";
rev = "v${version}";
sha256 = import ./source-sha.nix;
};
# With `allowGoReference = true;`, `buildGoModule` adds the `-trimpath`
# argument for Go builds which apparently breaks the UI like this:
#
# server[780]: stat /var/lib/private/ui/build/index.html: no such file or directory
allowGoReference = true;
vendorSha256 = import ./vendor-sha.nix;
doCheck = false;
buildInputs = [ sqlite ];
ui = callPackage ./ui.nix { };
preBuild = ''
cp -r ${ui}/libexec/gotify-ui/deps/gotify-ui/build ui/build && go run hack/packr/packr.go
'';
passthru = {
updateScript = ./update.sh;
};
# Otherwise, all other subpackages are built as well and from some reason,
# produce binaries which panic when executed and are not interesting at all
subPackages = [ "." ];
ldflags = [
"-X main.Version=${version}" "-X main.Mode=prod"
];
meta = with lib; {
description = "A simple server for sending and receiving messages in real-time per WebSocket";
homepage = "https://gotify.net";
license = licenses.mit;
maintainers = with maintainers; [ doronbehar ];
mainProgram = "server";
};
}

View file

@ -0,0 +1,87 @@
{
"name": "gotify-ui",
"version": "0.2.0",
"private": true,
"homepage": ".",
"proxy": "http://localhost:80",
"dependencies": {
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.9.1",
"axios": "^0.21.1",
"codemirror": "^5.61.1",
"detect-browser": "^5.2.0",
"js-base64": "^3.6.1",
"mobx": "^5.15.6",
"mobx-react": "^6.3.0",
"mobx-utils": "^5.6.1",
"notifyjs": "^3.0.0",
"prop-types": "^15.6.2",
"react": "^16.4.2",
"react-codemirror2": "^7.2.1",
"react-dom": "^16.4.2",
"react-infinite": "^0.13.0",
"react-markdown": "^6.0.2",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-timeago": "^6.2.1",
"remark-gfm": "^1.0.0",
"remove-markdown": "^0.3.0",
"typeface-roboto": "1.1.13"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=node",
"eject": "react-scripts eject",
"lint": "eslint \"src/**/*.{ts,tsx}\"",
"format": "prettier \"src/**/*.{ts,tsx}\" --write",
"testformat": "prettier \"src/**/*.{ts,tsx}\" --list-different"
},
"devDependencies": {
"@types/codemirror": "5.60.0",
"@types/detect-browser": "^4.0.0",
"@types/get-port": "^4.0.0",
"@types/jest": "^26.0.23",
"@types/js-base64": "^3.3.1",
"@types/node": "^15.12.2",
"@types/notifyjs": "^3.0.2",
"@types/puppeteer": "^5.4.3",
"@types/react": "^16.9.49",
"@types/react-dom": "^16.9.8",
"@types/react-infinite": "0.0.35",
"@types/react-router-dom": "^5.1.7",
"@types/remove-markdown": "^0.3.0",
"@types/rimraf": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^4.1.0",
"@typescript-eslint/parser": "^4.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^24.0.0",
"eslint-plugin-prefer-arrow": "^1.2.2",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-unicorn": "^21.0.0",
"get-port": "^5.1.1",
"prettier": "^2.3.1",
"puppeteer": "^10.0.0",
"react-scripts": "^4.0.3",
"rimraf": "^3.0.2",
"tree-kill": "^1.2.0",
"typescript": "4.0.2",
"wait-on": "^5.3.0"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

View file

@ -0,0 +1 @@
"1c8f7y580sq9495l2cxb2jkhgqs2wf0j3x073l1xnr9lv6crfvhn"

View file

@ -0,0 +1,61 @@
{ yarn2nix-moretea
, fetchFromGitHub, applyPatches
}:
yarn2nix-moretea.mkYarnPackage rec {
pname = "gotify-ui";
packageJSON = ./package.json;
yarnNix = ./yarndeps.nix;
version = import ./version.nix;
src_all = applyPatches {
src = fetchFromGitHub {
owner = "gotify";
repo = "server";
rev = "v${version}";
sha256 = import ./source-sha.nix;
};
postPatch = ''
substituteInPlace ui/yarn.lock \
--replace \
"https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001237.tgz" \
"https___registry.npmjs.org_caniuse_lite___caniuse_lite_1.0.30001237.tgz"
'';
};
src = "${src_all}/ui";
buildPhase = ''
export HOME=$(mktemp -d)
export WRITABLE_NODE_MODULES="$(pwd)/tmp"
mkdir -p "$WRITABLE_NODE_MODULES"
# react-scripts requires a writable node_modules/.cache, so we have to copy the symlink's contents back
# into `node_modules/`.
# See https://github.com/facebook/create-react-app/issues/11263
cd deps/gotify-ui
node_modules="$(readlink node_modules)"
rm node_modules
mkdir -p "$WRITABLE_NODE_MODULES"/.cache
cp -r $node_modules/* "$WRITABLE_NODE_MODULES"
# In `node_modules/.bin` are relative symlinks that would be broken after copying them over,
# so we take care of them here.
mkdir -p "$WRITABLE_NODE_MODULES"/.bin
for x in "$node_modules"/.bin/*; do
ln -sfv "$node_modules"/.bin/"$(readlink "$x")" "$WRITABLE_NODE_MODULES"/.bin/"$(basename "$x")"
done
ln -sfv "$WRITABLE_NODE_MODULES" node_modules
cd ../..
yarn build
cd deps/gotify-ui
rm -rf node_modules
ln -sf $node_modules node_modules
cd ../..
'';
}

40
pkgs/servers/gotify/update.sh Executable file
View file

@ -0,0 +1,40 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p wget yarn2nix-moretea.yarn2nix nix-prefetch-git jq
set -euo pipefail
dirname="$(dirname "$0")"
latest_release=$(curl --silent https://api.github.com/repos/gotify/server/releases/latest)
version=$(jq -r '.tag_name' <<<"$latest_release")
echo got version $version
echo \""${version#v}"\" > "$dirname/version.nix"
printf '%s\n' $(nix-prefetch-git --quiet --rev ${version} https://github.com/gotify/server | jq .sha256) > $dirname/source-sha.nix
tput setaf 1
echo zeroing vendorSha256 in $dirname/vendor-sha.nix
tput sgr0
printf '"%s"\n' "0000000000000000000000000000000000000000000000000000" > $dirname/vendor-sha.nix
GOTIFY_WEB_SRC="https://raw.githubusercontent.com/gotify/server/$version"
curl --silent "$GOTIFY_WEB_SRC/ui/package.json" -o $dirname/package.json
echo downloaded package.json
curl --silent "$GOTIFY_WEB_SRC/ui/yarn.lock" -o $dirname/yarn.lock
echo downloaded yarndeps.nix
echo running yarn2nix
yarn2nix --lockfile=$dirname/yarn.lock > $dirname/yarndeps.nix
rm $dirname/yarn.lock
echo removed yarn.lock
echo running nix-build for ui
nix-build -A gotify-server.ui
echo running nix-build for gotify itself in order to get vendorSha256
set +e
vendorSha256="$(nix-build -A gotify-server 2>&1 | grep "got:" | cut -d':' -f3)"
set -e
printf '"%s"\n' "$vendorSha256" > $dirname/vendor-sha.nix
tput setaf 2
echo got vendorSha256 of: $vendorSha256
tput sgr0
echo running nix-build -A gotify-server which should build gotify-server normally
nix-build -A gotify-server

View file

@ -0,0 +1 @@
"sha256-ktmJ8rIBYL6/gwYG109sLqo16M0Xgre3wLBTuOTz3CY="

View file

@ -0,0 +1 @@
"2.1.4"

File diff suppressed because it is too large Load diff