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
56
pkgs/servers/ombi/default.nix
Normal file
56
pkgs/servers/ombi/default.nix
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{ lib, stdenv, fetchurl, makeWrapper, autoPatchelfHook, fixDarwinDylibNames, zlib, krb5, openssl, icu, nixosTests }:
|
||||
|
||||
let
|
||||
os = if stdenv.isDarwin then "osx" else "linux";
|
||||
arch = {
|
||||
x86_64-linux = "x64";
|
||||
aarch64-linux = "arm64";
|
||||
x86_64-darwin = "x64";
|
||||
}."${stdenv.hostPlatform.system}" or (throw
|
||||
"Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
|
||||
hash = {
|
||||
x64-linux_hash = "sha256-8Y6I6vitkgIV6WMXF1YXzgRfhJd/O6hcdpC9yZLpDA4=";
|
||||
arm64-linux_hash = "sha256-OXbJbwjNDd3GNL4bvuZLwNOjfAp8YBnJiylid0w8kLI=";
|
||||
x64-osx_hash = "sha256-BoYqplC8ahMhpgntZVozyPCp08YqmiZ3ED7TgKlXPXc=";
|
||||
}."${arch}-${os}_hash";
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "ombi";
|
||||
version = "4.16.12";
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/Ombi-app/Ombi/releases/download/v${version}/${os}-${arch}.tar.gz";
|
||||
sha256 = hash;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ]
|
||||
++ lib.optional stdenv.hostPlatform.isLinux autoPatchelfHook
|
||||
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
|
||||
|
||||
propagatedBuildInputs = [ stdenv.cc.cc zlib krb5 ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/{bin,share/${pname}-${version}}
|
||||
cp -r * $out/share/${pname}-${version}
|
||||
|
||||
makeWrapper $out/share/${pname}-${version}/Ombi $out/bin/Ombi \
|
||||
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ openssl icu ]} \
|
||||
--chdir "$out/share/${pname}-${version}"
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
updateScript = ./update.sh;
|
||||
tests.smoke-test = nixosTests.ombi;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Self-hosted web application that automatically gives your shared Plex or Emby users the ability to request content by themselves";
|
||||
homepage = "https://ombi.io/";
|
||||
license = licenses.gpl2Only;
|
||||
maintainers = with maintainers; [ woky ];
|
||||
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
}
|
||||
42
pkgs/servers/ombi/update.sh
Executable file
42
pkgs/servers/ombi/update.sh
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl gnused nix-prefetch jq
|
||||
|
||||
set -e
|
||||
|
||||
dirname="$(dirname "$0")"
|
||||
|
||||
updateHash()
|
||||
{
|
||||
version=$1
|
||||
arch=$2
|
||||
os=$3
|
||||
|
||||
hashKey="${arch}-${os}_hash"
|
||||
|
||||
url="https://github.com/Ombi-app/Ombi/releases/download/v$version/$os-$arch.tar.gz"
|
||||
hash=$(nix-prefetch-url --type sha256 $url)
|
||||
sriHash="$(nix hash to-sri --type sha256 $hash)"
|
||||
|
||||
sed -i "s|$hashKey = \"[a-zA-Z0-9\/+-=]*\";|$hashKey = \"$sriHash\";|g" "$dirname/default.nix"
|
||||
}
|
||||
|
||||
updateVersion()
|
||||
{
|
||||
sed -i "s/version = \"[0-9.]*\";/version = \"$1\";/g" "$dirname/default.nix"
|
||||
}
|
||||
|
||||
currentVersion=$(cd $dirname && nix eval --raw -f ../../.. ombi.version)
|
||||
|
||||
latestTag=$(curl https://api.github.com/repos/Ombi-App/Ombi/releases/latest | jq -r ".tag_name")
|
||||
latestVersion="$(expr $latestTag : 'v\(.*\)')"
|
||||
|
||||
if [[ "$currentVersion" == "$latestVersion" ]]; then
|
||||
echo "Ombi is up-to-date: ${currentVersion}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
updateVersion $latestVersion
|
||||
|
||||
updateHash $latestVersion x64 linux
|
||||
updateHash $latestVersion arm64 linux
|
||||
updateHash $latestVersion x64 osx
|
||||
Loading…
Add table
Add a link
Reference in a new issue