mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-10 06:55:10 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
75 lines
2.2 KiB
Nix
75 lines
2.2 KiB
Nix
{ lib, stdenv, fetchurl, mono, libmediainfo, sqlite, curl, makeWrapper, icu, dotnet-runtime, openssl, nixosTests, zlib }:
|
|
|
|
let
|
|
pname = "prowlarr";
|
|
|
|
unsupported = throw "Unsupported system ${stdenv.hostPlatform.system} for ${pname}";
|
|
|
|
os =
|
|
if stdenv.hostPlatform.isDarwin then
|
|
"osx"
|
|
else if stdenv.hostPlatform.isLinux then
|
|
"linux"
|
|
else
|
|
unsupported;
|
|
|
|
arch = {
|
|
aarch64-darwin = "arm64";
|
|
aarch64-linux = "arm64";
|
|
x86_64-darwin = "x64";
|
|
x86_64-linux = "x64";
|
|
}.${stdenv.hostPlatform.system} or unsupported;
|
|
|
|
hash = {
|
|
aarch64-darwin = "sha256-ZvkuScsFGlt6Cd6wTtikygCSYAzOuHmJLJa9Bos8VvM=";
|
|
aarch64-linux = "sha256-Ojf2PjoN+Vcxc0N0durgQOM9aumyggOtYr2rc7+IaZI=";
|
|
x86_64-darwin = "sha256-Uv4wunz/flGFzxeneW9NRmKLF831HR0Kjfkz6lnmhfA=";
|
|
x86_64-linux = "sha256-7LdJvJYArfpYMKdAt98jxW08p8a+o5OTjoTRRX74ds8=";
|
|
}.${stdenv.hostPlatform.system} or unsupported;
|
|
|
|
in stdenv.mkDerivation rec {
|
|
inherit pname;
|
|
version = "1.23.1.4708";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/Prowlarr/Prowlarr/releases/download/v${version}/Prowlarr.master.${version}.${os}-core-${arch}.tar.gz";
|
|
inherit hash;
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/{bin,share/${pname}-${version}}
|
|
cp -r * $out/share/${pname}-${version}/.
|
|
|
|
makeWrapper "${dotnet-runtime}/bin/dotnet" $out/bin/Prowlarr \
|
|
--add-flags "$out/share/${pname}-${version}/Prowlarr.dll" \
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
|
|
curl sqlite libmediainfo mono openssl icu zlib ]}
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru = {
|
|
updateScript = ./update.sh;
|
|
tests.smoke-test = nixosTests.prowlarr;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Indexer manager/proxy built on the popular arr .net/reactjs base stack";
|
|
homepage = "https://wiki.servarr.com/prowlarr";
|
|
changelog = "https://github.com/Prowlarr/Prowlarr/releases/tag/v${version}";
|
|
license = licenses.gpl3Only;
|
|
maintainers = with maintainers; [ jdreaver ];
|
|
mainProgram = "Prowlarr";
|
|
platforms = [
|
|
"aarch64-darwin"
|
|
"aarch64-linux"
|
|
"x86_64-darwin"
|
|
"x86_64-linux"
|
|
];
|
|
};
|
|
}
|