mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-06 04:53:27 +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" ```
84 lines
2.3 KiB
Nix
84 lines
2.3 KiB
Nix
{
|
|
fetchurl,
|
|
lib,
|
|
stdenv,
|
|
autoPatchelfHook,
|
|
}:
|
|
|
|
let
|
|
arch =
|
|
{
|
|
i686-linux = "386";
|
|
x86_64-linux = "amd64";
|
|
aarch64-linux = "arm64";
|
|
armv7l-linux = "arm";
|
|
x86_64-darwin = "amd64";
|
|
aarch64-darwin = "arm64";
|
|
}
|
|
."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
os =
|
|
if stdenv.hostPlatform.isLinux then
|
|
"linux"
|
|
else if stdenv.hostPlatform.isDarwin then
|
|
"darwin"
|
|
else
|
|
throw "Unsupported OS";
|
|
|
|
hash =
|
|
{
|
|
hash_386-linux = "sha256-4yEgg0Ve8tjNn2weH9d91tfRaU1TE569VvZLxzuzXsw=";
|
|
hash_amd64-linux = "sha256-YAIhtHv/cO4yFpkWoRNMf6t4+ifMtGPTcYu84ZMvfD4=";
|
|
hash_arm64-linux = "sha256-OdtT9NOhh0Fkk+8CDic0NWWbGflk3FcuKB60OycJU5E=";
|
|
hash_arm-linux = "sha256-foMsZ8Nq+Q5lqt2XZCDvQ+/sFM8/1/rPfogzsyrQHqs=";
|
|
hash_amd64-darwin = "sha256-6jaX9iqyqztykeXZX3YqwRV/silFiyfeB9gJyreAfF8=";
|
|
hash_arm64-darwin = "sha256-KJqMJct7YWocE4eVjMF36adqTIf7WcutZlG3QEoMhCI=";
|
|
}
|
|
."hash_${arch}-${os}";
|
|
in
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "ocis-bin";
|
|
version = "5.0.5";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/owncloud/ocis/releases/download/v${finalAttrs.version}/ocis-${finalAttrs.version}-${os}-${arch}";
|
|
inherit hash;
|
|
};
|
|
|
|
dontUnpack = true;
|
|
|
|
nativeBuildInputs = [ autoPatchelfHook ];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
install -D $src $out/bin/ocis
|
|
runHook postInstall
|
|
'';
|
|
|
|
passthru.updateScript = ./update.py;
|
|
|
|
meta = with lib; {
|
|
description = "ownCloud Infinite Scale Stack";
|
|
homepage = "https://owncloud.dev/ocis/";
|
|
changelog = "https://github.com/owncloud/ocis/releases/tag/v${finalAttrs.version}";
|
|
# oCIS is licensed under non-free EULA which can be found here :
|
|
# https://github.com/owncloud/ocis/releases/download/v5.0.1/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf
|
|
license = licenses.unfree;
|
|
maintainers = with maintainers; [
|
|
ramblurr
|
|
bhankas
|
|
danth
|
|
ramblurr
|
|
];
|
|
|
|
platforms =
|
|
(lib.intersectLists platforms.linux (
|
|
lib.platforms.arm ++ lib.platforms.aarch64 ++ lib.platforms.x86
|
|
))
|
|
++ (lib.intersectLists platforms.darwin (lib.platforms.aarch64 ++ lib.platforms.x86_64));
|
|
|
|
sourceProvenance = [ sourceTypes.binaryNativeCode ];
|
|
mainProgram = "ocis";
|
|
};
|
|
})
|