Merge remote-tracking branch 'origin/master' into staging-next
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
diff --git a/src/timeshift-launcher b/src/timeshift-launcher
|
||||
index 29b8fc4..5f6cb17 100755
|
||||
--- a/src/timeshift-launcher
|
||||
+++ b/src/timeshift-launcher
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
-app_command='timeshift-gtk'
|
||||
+app_command=''"$(realpath "$(dirname "$0")")"'/timeshift-gtk'
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
# user is admin
|
||||
@@ -14,11 +14,11 @@ else
|
||||
# script is running in non-interactive mode
|
||||
if [ "$XDG_SESSION_TYPE" = "wayland" ] ; then
|
||||
xhost +SI:localuser:root
|
||||
- pkexec ${app_command}
|
||||
+ pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" "${app_command}"
|
||||
xhost -SI:localuser:root
|
||||
xhost
|
||||
elif command -v pkexec >/dev/null 2>&1; then
|
||||
- pkexec ${app_command}
|
||||
+ pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" "${app_command}"
|
||||
elif command -v sudo >/dev/null 2>&1; then
|
||||
x-terminal-emulator -e "sudo ${app_command}"
|
||||
elif command -v su >/dev/null 2>&1; then
|
||||
@@ -27,17 +27,20 @@ stdenv.mkDerivation rec {
|
||||
hash = "sha256-umMekxP9bvV01KzfIh2Zxa9Xb+tR5x+tG9dOnBIOkjY=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./timeshift-launcher.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
while IFS="" read -r -d $'\0' FILE; do
|
||||
for FILE in src/Core/Main.vala src/Utility/Device.vala; do
|
||||
substituteInPlace "$FILE" \
|
||||
--replace "/sbin/blkid" "${util-linux}/bin/blkid"
|
||||
done < <(find ./src -mindepth 1 -name "*.vala" -type f -print0)
|
||||
--replace-fail "/sbin/blkid" "${lib.getExe' util-linux "blkid"}"
|
||||
done
|
||||
|
||||
substituteInPlace ./src/Utility/IconManager.vala \
|
||||
--replace "/usr/share" "$out/share"
|
||||
--replace-fail "/usr/share" "$out/share"
|
||||
|
||||
# Substitute app_command to look for the `timeshift-gtk` in $out.
|
||||
# Substitute the `pkexec ...` as a hack to run a GUI application like Timeshift as root without setting up the corresponding pkexec policy.
|
||||
substituteInPlace ./src/timeshift-launcher \
|
||||
--replace-fail "app_command='timeshift-gtk'" "app_command=$out/bin/timeshift-gtk" \
|
||||
--replace-fail ${lib.escapeShellArg ''pkexec ''${app_command}''} ${lib.escapeShellArg ''pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" "''${app_command}"''}
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
||||
@@ -45,6 +45,11 @@ stdenvNoCC.mkDerivation {
|
||||
)
|
||||
wrapProgram "$out/bin/timeshift" "''${makeWrapperArgs[@]}"
|
||||
wrapProgram "$out/bin/timeshift-gtk" "''${gappsWrapperArgs[@]}"
|
||||
# Substitute app_command to look for the `timeshift-gtk` in $out.
|
||||
unlink "$out/bin/timeshift-launcher"
|
||||
substitute ${lib.getExe' timeshift-unwrapped "timeshift-launcher"} "$out/bin/timeshift-launcher" \
|
||||
--replace-fail "app_command=${lib.getExe' timeshift-unwrapped "timeshift-gtk"}" "app_command=$out/bin/timeshift-gtk"
|
||||
chmod +x "$out/bin/timeshift-launcher"
|
||||
'';
|
||||
|
||||
inherit (timeshift-unwrapped) meta;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
xcbuild,
|
||||
darwin,
|
||||
apple-sdk_11,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
@@ -19,11 +19,11 @@ stdenv.mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = [ xcbuild ];
|
||||
|
||||
buildInputs = [ darwin.apple_sdk.frameworks.Cocoa ];
|
||||
buildInputs = [ apple-sdk_11 ];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
xcodebuild -arch ${stdenv.hostPlatform.darwinArch} -configuration Release SYMROOT="./output" build
|
||||
xcodebuild -configuration Release SYMROOT="./output" HOME="$(mktemp -d)" build
|
||||
cp ./output/Release/choose choose
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
@@ -2,36 +2,52 @@
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
buildGoModule,
|
||||
callPackage,
|
||||
enableWebui ? true,
|
||||
pnpm_9,
|
||||
nodejs,
|
||||
nixosTests,
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "rmfakecloud";
|
||||
version = "0.0.21";
|
||||
version = "0.0.23";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ddvk";
|
||||
repo = pname;
|
||||
repo = "rmfakecloud";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-Opx39FUo4Kzezi96D9iraA8gkqCPVfMf4LhxtVpsuNQ=";
|
||||
hash = "sha256-XlKqh6GKGreWLPjS8XfEUJCMMxiOw8pP2qX8otD+RCo=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-9tfxE03brUvCYusmewiqNpCkKyIS9qePqylrzDWrJLY=";
|
||||
|
||||
ui = callPackage ./webui.nix { inherit version src; };
|
||||
# if using webUI build it
|
||||
# use env because of https://github.com/NixOS/nixpkgs/issues/358844
|
||||
env.pnpmRoot = "ui";
|
||||
env.pnpmDeps = pnpm_9.fetchDeps {
|
||||
inherit pname version src;
|
||||
sourceRoot = "${src.name}/ui";
|
||||
pnpmLock = "${src}/ui/pnpm-lock.yaml";
|
||||
hash = "sha256-VNmCT4um2W2ii8jAm+KjQSjixYEKoZkw7CeRwErff/o=";
|
||||
};
|
||||
preBuild = lib.optionals enableWebui ''
|
||||
# using sass-embedded fails at executing node_modules/sass-embedded-linux-x64/dart-sass/src/dart
|
||||
rm -r ui/node_modules/sass-embedded ui/node_modules/.pnpm/sass-embedded*
|
||||
|
||||
postPatch =
|
||||
if enableWebui then
|
||||
''
|
||||
mkdir -p ui/build
|
||||
cp -r ${ui}/* ui/build
|
||||
''
|
||||
else
|
||||
''
|
||||
sed -i '/go:/d' ui/assets.go
|
||||
'';
|
||||
# avoid re-running pnpm i...
|
||||
touch ui/pnpm-lock.yaml
|
||||
|
||||
make ui/dist
|
||||
'';
|
||||
nativeBuildInputs = lib.optionals enableWebui [
|
||||
nodejs
|
||||
pnpm_9.configHook
|
||||
];
|
||||
|
||||
# ... or don't embed it in the server
|
||||
postPatch = lib.optionals (!enableWebui) ''
|
||||
sed -i '/go:/d' ui/assets.go
|
||||
'';
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
{ version, src, stdenv, lib, fetchYarnDeps, fixup-yarn-lock, yarn, nodejs }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
inherit version src;
|
||||
|
||||
pname = "rmfakecloud-webui";
|
||||
|
||||
yarnOfflineCache = fetchYarnDeps {
|
||||
yarnLock = "${src}/ui/yarn.lock";
|
||||
hash = "sha256-9//uQ4ZLLTf2N1WSwsOwFjBuDmThuMtMXU4SzMljAMM=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ fixup-yarn-lock yarn nodejs ];
|
||||
|
||||
buildPhase = ''
|
||||
export HOME=$(mktemp -d)
|
||||
cd ui
|
||||
fixup-yarn-lock yarn.lock
|
||||
yarn config --offline set yarn-offline-mirror ${yarnOfflineCache}
|
||||
yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
|
||||
patchShebangs node_modules
|
||||
export PATH=$PWD/node_modules/.bin:$PATH
|
||||
./node_modules/.bin/react-scripts build
|
||||
mkdir -p $out
|
||||
cd ..
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
cp -r ui/build/* $out
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Only the webui files for rmfakecloud";
|
||||
homepage = "https://ddvk.github.io/rmfakecloud/";
|
||||
license = licenses.agpl3Only;
|
||||
};
|
||||
}
|
||||
@@ -9,7 +9,10 @@
|
||||
let
|
||||
inherit (stdenvNoCC.hostPlatform) system;
|
||||
sources =
|
||||
if "${version-channel}" == "main" then import ./sources-main.nix else import ./sources-stable.nix;
|
||||
if "${version-channel}" == "main" then
|
||||
lib.importJSON ./sources-main.json
|
||||
else
|
||||
lib.importJSON ./sources-stable.json;
|
||||
arch = sources.archMap.${system};
|
||||
|
||||
in
|
||||
@@ -18,13 +21,13 @@ stdenvNoCC.mkDerivation {
|
||||
version = sources.version;
|
||||
srcs = [
|
||||
(fetchurl {
|
||||
url = sources.fetchurlAttrSet.${system}.docker-credential-up.url;
|
||||
sha256 = sources.fetchurlAttrSet.${system}.docker-credential-up.hash;
|
||||
url = sources.fetchurlAttrSet.docker-credential-up.${system}.url;
|
||||
sha256 = sources.fetchurlAttrSet.docker-credential-up.${system}.hash;
|
||||
})
|
||||
|
||||
(fetchurl {
|
||||
url = sources.fetchurlAttrSet.${system}.up.url;
|
||||
sha256 = sources.fetchurlAttrSet.${system}.up.hash;
|
||||
url = sources.fetchurlAttrSet.up.${system}.url;
|
||||
sha256 = sources.fetchurlAttrSet.up.${system}.hash;
|
||||
})
|
||||
];
|
||||
|
||||
@@ -63,12 +66,13 @@ stdenvNoCC.mkDerivation {
|
||||
doCheck = false;
|
||||
|
||||
passthru.updateScript = [
|
||||
./update.sh
|
||||
./update
|
||||
"${version-channel}"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "CLI for interacting with Upbound Cloud, Upbound Enterprise, and Universal Crossplane (UXP)";
|
||||
changelog = "https://docs.upbound.io/reference/cli/rel-notes/#whats-changed";
|
||||
homepage = "https://upbound.io";
|
||||
license = lib.licenses.unfree;
|
||||
maintainers = with lib.maintainers; [
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"archMap": {
|
||||
"aarch64-darwin": "darwin_arm64",
|
||||
"aarch64-linux": "linux_arm64",
|
||||
"x86_64-darwin": "darwin_amd64",
|
||||
"x86_64-linux": "linux_amd64"
|
||||
},
|
||||
"fetchurlAttrSet": {
|
||||
"docker-credential-up": {
|
||||
"aarch64-darwin": {
|
||||
"hash": "sha256-3fx/wjBoFxmeo55QbRw9cl4GFCFehGpZeVAw1bvooSk=",
|
||||
"url": "https://cli.upbound.io/main/v0.38.0-0.rc.0.29.g59359e0/bundle/docker-credential-up/darwin_arm64.tar.gz"
|
||||
},
|
||||
"aarch64-linux": {
|
||||
"hash": "sha256-FeF7D8WLpK8S6b7QCLaOI7Dm2EzbDqJVp9tfh13BJuU=",
|
||||
"url": "https://cli.upbound.io/main/v0.38.0-0.rc.0.29.g59359e0/bundle/docker-credential-up/linux_arm64.tar.gz"
|
||||
},
|
||||
"x86_64-darwin": {
|
||||
"hash": "sha256-00y9wGMwu5ZsTzlNkSvdwEse5eV4xzLiwQjgSTnmW5w=",
|
||||
"url": "https://cli.upbound.io/main/v0.38.0-0.rc.0.29.g59359e0/bundle/docker-credential-up/darwin_amd64.tar.gz"
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"hash": "sha256-oObO/T/2yOFDaNVJGQCqna130Tyx/sEOCAQMDYhVlNI=",
|
||||
"url": "https://cli.upbound.io/main/v0.38.0-0.rc.0.29.g59359e0/bundle/docker-credential-up/linux_amd64.tar.gz"
|
||||
}
|
||||
},
|
||||
"up": {
|
||||
"aarch64-darwin": {
|
||||
"hash": "sha256-Bf6O6rsth3D5h5olxqHxULuxxPtNhxP+gN69mJnlQTg=",
|
||||
"url": "https://cli.upbound.io/main/v0.38.0-0.rc.0.29.g59359e0/bundle/up/darwin_arm64.tar.gz"
|
||||
},
|
||||
"aarch64-linux": {
|
||||
"hash": "sha256-svTHCjw2ZrTEscNpizOmg9leQAbzhWcPfst3nMUhUXg=",
|
||||
"url": "https://cli.upbound.io/main/v0.38.0-0.rc.0.29.g59359e0/bundle/up/linux_arm64.tar.gz"
|
||||
},
|
||||
"x86_64-darwin": {
|
||||
"hash": "sha256-1LxqRHQjNlRFTGhEyOR9uW407LkqdpVjB3w57hNT/Zk=",
|
||||
"url": "https://cli.upbound.io/main/v0.38.0-0.rc.0.29.g59359e0/bundle/up/darwin_amd64.tar.gz"
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"hash": "sha256-ZLjhD7uCpBURYozX1IjUTJDzPuKFedIZQhRvMqMMsLY=",
|
||||
"url": "https://cli.upbound.io/main/v0.38.0-0.rc.0.29.g59359e0/bundle/up/linux_amd64.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"platformList": [
|
||||
"aarch64-darwin",
|
||||
"aarch64-linux",
|
||||
"x86_64-darwin",
|
||||
"x86_64-linux"
|
||||
],
|
||||
"version": "0.38.0-0.rc.0.29.g59359e0"
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
# Generated by "update.sh main" - do not update manually!
|
||||
{
|
||||
version = "0.37.0-0.rc.0.38.g797e121";
|
||||
|
||||
platformList = [
|
||||
"aarch64-linux"
|
||||
"x86_64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
archMap = {
|
||||
aarch64-linux = "linux_arm64";
|
||||
x86_64-linux = "linux_amd64";
|
||||
x86_64-darwin = "darwin_amd64";
|
||||
aarch64-darwin = "darwin_arm64";
|
||||
};
|
||||
|
||||
fetchurlAttrSet = {
|
||||
|
||||
aarch64-linux.docker-credential-up = {
|
||||
hash = "sha256-nZXniTuLzmV7tK/Pd4BjUzqYYH2OmQKC4yoCHOhZ3C8=";
|
||||
url = "https://cli.upbound.io/main/v0.37.0-0.rc.0.38.g797e121/bundle/docker-credential-up/linux_arm64.tar.gz";
|
||||
};
|
||||
x86_64-linux.docker-credential-up = {
|
||||
hash = "sha256-LILaT+vn2CdKzNWxYOeda+Zid9V11I94+vwDGkGwxuQ=";
|
||||
url = "https://cli.upbound.io/main/v0.37.0-0.rc.0.38.g797e121/bundle/docker-credential-up/linux_amd64.tar.gz";
|
||||
};
|
||||
x86_64-darwin.docker-credential-up = {
|
||||
hash = "sha256-7eUWveGIbimxbwOGtA6qrU7F8p8EpOCTHXN4vj74qqA=";
|
||||
url = "https://cli.upbound.io/main/v0.37.0-0.rc.0.38.g797e121/bundle/docker-credential-up/darwin_amd64.tar.gz";
|
||||
};
|
||||
aarch64-darwin.docker-credential-up = {
|
||||
hash = "sha256-XTgSZjbHXyt1BXNeaHXqdi4gs8eeD/7rE657oAeQKv4=";
|
||||
url = "https://cli.upbound.io/main/v0.37.0-0.rc.0.38.g797e121/bundle/docker-credential-up/darwin_arm64.tar.gz";
|
||||
};
|
||||
aarch64-linux.up = {
|
||||
hash = "sha256-cNk4uaXcdH3EucwGnGXGsPbmKGGO+ig3xfJ+fAcwEbo=";
|
||||
url = "https://cli.upbound.io/main/v0.37.0-0.rc.0.38.g797e121/bundle/up/linux_arm64.tar.gz";
|
||||
};
|
||||
x86_64-linux.up = {
|
||||
hash = "sha256-3h+Jtl84UdWvs2cbrDsbtqlCCpvvYjzXZLmzDY/9aXE=";
|
||||
url = "https://cli.upbound.io/main/v0.37.0-0.rc.0.38.g797e121/bundle/up/linux_amd64.tar.gz";
|
||||
};
|
||||
x86_64-darwin.up = {
|
||||
hash = "sha256-WzngxshyHnR1H7Rhkbw/wkN1i3TWyV8CcBTwLNVggdU=";
|
||||
url = "https://cli.upbound.io/main/v0.37.0-0.rc.0.38.g797e121/bundle/up/darwin_amd64.tar.gz";
|
||||
};
|
||||
aarch64-darwin.up = {
|
||||
hash = "sha256-KLcxE4847DE6e0AznjlNZnS6GNhT1JJaCnYDecTZ6EQ=";
|
||||
url = "https://cli.upbound.io/main/v0.37.0-0.rc.0.38.g797e121/bundle/up/darwin_arm64.tar.gz";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"archMap": {
|
||||
"aarch64-darwin": "darwin_arm64",
|
||||
"aarch64-linux": "linux_arm64",
|
||||
"x86_64-darwin": "darwin_amd64",
|
||||
"x86_64-linux": "linux_amd64"
|
||||
},
|
||||
"fetchurlAttrSet": {
|
||||
"docker-credential-up": {
|
||||
"aarch64-darwin": {
|
||||
"hash": "sha256-WuNC7E1i/Yikwe3uq1Hxf4mpAzgqe9T6tI2DFqJFYq8=",
|
||||
"url": "https://cli.upbound.io/stable/v0.37.0/bundle/docker-credential-up/darwin_arm64.tar.gz"
|
||||
},
|
||||
"aarch64-linux": {
|
||||
"hash": "sha256-b5ylPJxIVkI3EDY5IFTHll/4F6KDtQLm7eq8J7eGmtA=",
|
||||
"url": "https://cli.upbound.io/stable/v0.37.0/bundle/docker-credential-up/linux_arm64.tar.gz"
|
||||
},
|
||||
"x86_64-darwin": {
|
||||
"hash": "sha256-jJV0SX96Isz7+E0MOQ6aq3KDwFZt4knTVuDU3iSIC+4=",
|
||||
"url": "https://cli.upbound.io/stable/v0.37.0/bundle/docker-credential-up/darwin_amd64.tar.gz"
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"hash": "sha256-Ek8xTUKFjYekaee+8rjjOKSQQ1jX3asyvVa/jATWR5c=",
|
||||
"url": "https://cli.upbound.io/stable/v0.37.0/bundle/docker-credential-up/linux_amd64.tar.gz"
|
||||
}
|
||||
},
|
||||
"up": {
|
||||
"aarch64-darwin": {
|
||||
"hash": "sha256-jDhAB0b1XMAwGgTeL1uXIIg4YoBgpgI9KBdsbyBXjF4=",
|
||||
"url": "https://cli.upbound.io/stable/v0.37.0/bundle/up/darwin_arm64.tar.gz"
|
||||
},
|
||||
"aarch64-linux": {
|
||||
"hash": "sha256-mVS1knNDtQjbxj2FXIyx/m/HVUhUSuN2E7HNmdxgtd4=",
|
||||
"url": "https://cli.upbound.io/stable/v0.37.0/bundle/up/linux_arm64.tar.gz"
|
||||
},
|
||||
"x86_64-darwin": {
|
||||
"hash": "sha256-5nr+5tCbqoVel97ROn2OamV0s90O6QS9vrbSXIjhJoo=",
|
||||
"url": "https://cli.upbound.io/stable/v0.37.0/bundle/up/darwin_amd64.tar.gz"
|
||||
},
|
||||
"x86_64-linux": {
|
||||
"hash": "sha256-MZgQlxi4MrzXG59Q4g5Bjb240E5pf5l1bHGASqSc+OU=",
|
||||
"url": "https://cli.upbound.io/stable/v0.37.0/bundle/up/linux_amd64.tar.gz"
|
||||
}
|
||||
}
|
||||
},
|
||||
"platformList": [
|
||||
"aarch64-darwin",
|
||||
"aarch64-linux",
|
||||
"x86_64-darwin",
|
||||
"x86_64-linux"
|
||||
],
|
||||
"version": "0.37.0"
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
# Generated by "update.sh stable" - do not update manually!
|
||||
{
|
||||
version = "0.36.1";
|
||||
|
||||
platformList = [
|
||||
"aarch64-linux"
|
||||
"x86_64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
archMap = {
|
||||
aarch64-linux = "linux_arm64";
|
||||
x86_64-linux = "linux_amd64";
|
||||
x86_64-darwin = "darwin_amd64";
|
||||
aarch64-darwin = "darwin_arm64";
|
||||
};
|
||||
|
||||
fetchurlAttrSet = {
|
||||
|
||||
aarch64-linux.docker-credential-up = {
|
||||
hash = "sha256-BnEQWK1Y4rCDEk5BgkUIeF0oK6C77AQZh6KWhS+MfqM=";
|
||||
url = "https://cli.upbound.io/stable/v0.36.1/bundle/docker-credential-up/linux_arm64.tar.gz";
|
||||
};
|
||||
x86_64-linux.docker-credential-up = {
|
||||
hash = "sha256-4A0Di92G/vi9NR/pH20E8aaSn/jYhduQbYH6aLL2R3E=";
|
||||
url = "https://cli.upbound.io/stable/v0.36.1/bundle/docker-credential-up/linux_amd64.tar.gz";
|
||||
};
|
||||
x86_64-darwin.docker-credential-up = {
|
||||
hash = "sha256-/i4VsDUk0B+htRv0UCjCLT1ByewO8UNHOMbbxqIfvvE=";
|
||||
url = "https://cli.upbound.io/stable/v0.36.1/bundle/docker-credential-up/darwin_amd64.tar.gz";
|
||||
};
|
||||
aarch64-darwin.docker-credential-up = {
|
||||
hash = "sha256-gaaaOfn8oOxjlYruGePFZ+e65cUgRJSlsr4iweVYdSE=";
|
||||
url = "https://cli.upbound.io/stable/v0.36.1/bundle/docker-credential-up/darwin_arm64.tar.gz";
|
||||
};
|
||||
aarch64-linux.up = {
|
||||
hash = "sha256-mxuDhdO0nZkozMsKiKcDPBscgrY0pSChJP5TUJz729E=";
|
||||
url = "https://cli.upbound.io/stable/v0.36.1/bundle/up/linux_arm64.tar.gz";
|
||||
};
|
||||
x86_64-linux.up = {
|
||||
hash = "sha256-oZ1RpPZAKzChRWKUhUcKPRXhqmf3FBXvpFCICMsWh+w=";
|
||||
url = "https://cli.upbound.io/stable/v0.36.1/bundle/up/linux_amd64.tar.gz";
|
||||
};
|
||||
x86_64-darwin.up = {
|
||||
hash = "sha256-a4QsXlfmmFhRYxC0yZ7yVIHmP8VUgggfOZSenMXGlKA=";
|
||||
url = "https://cli.upbound.io/stable/v0.36.1/bundle/up/darwin_amd64.tar.gz";
|
||||
};
|
||||
aarch64-darwin.up = {
|
||||
hash = "sha256-PPHlADbIiQ/CAF746lulvuHjwwo1V563K9Haf/7IjEI=";
|
||||
url = "https://cli.upbound.io/stable/v0.36.1/bundle/up/darwin_arm64.tar.gz";
|
||||
};
|
||||
};
|
||||
}
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
||||
exec "$SCRIPT_DIR"/update.hs "$(realpath "$0")" "$1"
|
||||
Executable
+96
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i runhaskell --packages 'haskellPackages.ghcWithPackages (ps: [ps.aeson ps.aeson-pretty ps.directory ps.process ps.optparse-applicative])'
|
||||
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-# LANGUAGE RecordWildCards #-}
|
||||
|
||||
module Main where
|
||||
|
||||
import Options.Applicative
|
||||
import System.FilePath (takeDirectory, (</>))
|
||||
import System.Process (readProcess)
|
||||
import Data.Aeson (object, (.=))
|
||||
import Data.Aeson.Encode.Pretty (encodePretty', Config(..), defConfig, Indent(..), keyOrder)
|
||||
import qualified Data.ByteString.Lazy.Char8 as BL
|
||||
import qualified Data.Map.Strict as Map
|
||||
import Control.Monad (forM)
|
||||
import qualified Data.Text as T
|
||||
|
||||
data Options = Options
|
||||
{ scriptPath :: FilePath
|
||||
, channel :: String
|
||||
}
|
||||
|
||||
optionsParser :: Parser Options
|
||||
optionsParser = Options
|
||||
<$> argument str
|
||||
( metavar "SCRIPT_PATH"
|
||||
<> help "The path to the script" )
|
||||
<*> argument channelReader
|
||||
( metavar "CHANNEL"
|
||||
<> help "The release channel (main or stable)" )
|
||||
|
||||
channelReader :: ReadM String
|
||||
channelReader = eitherReader $ \arg ->
|
||||
if arg `elem` ["main", "stable"]
|
||||
then Right arg
|
||||
else Left "CHANNEL must be one of: main, stable"
|
||||
|
||||
-- Custom configuration for pretty-printing JSON
|
||||
prettyConfig :: Config
|
||||
prettyConfig = defConfig
|
||||
{ confIndent = Spaces 2
|
||||
, confCompare = keyOrder ["archMap", "fetchurlAttrSet", "platformList", "version"]
|
||||
}
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
let opts = info (optionsParser <**> helper)
|
||||
( fullDesc
|
||||
<> progDesc "Updates the sources-{main|stable}.json files based on the upstream release channel"
|
||||
<> header "update.hs - Haskell script with argument parsing" )
|
||||
|
||||
-- Parse the command-line arguments
|
||||
Options {..} <- execParser opts
|
||||
|
||||
-- Process the arguments
|
||||
let scriptDir = takeDirectory scriptPath
|
||||
let outputFile = scriptDir </> ("sources-" ++ channel ++ ".json")
|
||||
|
||||
-- Fetch current version
|
||||
let baseUrl = "https://cli.upbound.io/" ++ channel
|
||||
currentVersion <- readProcess "curl" ["-s", baseUrl ++ "/current/version"] ""
|
||||
let version = filter (\x -> x /= 'v' && x /= '\n') currentVersion -- Remove the leading 'v' and the new line char
|
||||
|
||||
-- Architecture mapping
|
||||
let archMapping = Map.fromList
|
||||
[ ("aarch64-darwin", "darwin_arm64")
|
||||
, ("x86_64-darwin", "darwin_amd64")
|
||||
, ("aarch64-linux", "linux_arm64")
|
||||
, ("x86_64-linux", "linux_amd64")
|
||||
]
|
||||
|
||||
-- Build platformList
|
||||
let platformList = Map.keys archMapping
|
||||
|
||||
-- Build fetchurlAttrSet
|
||||
fetchurlAttrSet <- fmap Map.fromList $ forM ["docker-credential-up", "up"] $ \cmd -> do
|
||||
attrs <- forM (Map.toList archMapping) $ \(key, arch) -> do
|
||||
let url = baseUrl ++ "/v" ++ version ++ "/bundle/" ++ cmd ++ "/" ++ arch ++ ".tar.gz"
|
||||
_hash <- readProcess "nix-prefetch-url" [url] ""
|
||||
let hash = T.unpack $ T.strip $ T.pack _hash
|
||||
_sha256Hash <- readProcess "nix" ["hash", "convert", hash, "--hash-algo", "sha256"] ""
|
||||
let sha256Hash = T.unpack $ T.strip $ T.pack _sha256Hash
|
||||
return (key, object ["hash" .= sha256Hash, "url" .= url])
|
||||
return (cmd, object attrs)
|
||||
|
||||
-- Write output to JSON
|
||||
let output = object
|
||||
[ "version" .= version
|
||||
, "platformList" .= platformList
|
||||
, "archMap" .= archMapping
|
||||
, "fetchurlAttrSet" .= fetchurlAttrSet
|
||||
]
|
||||
BL.writeFile outputFile $ BL.snoc (encodePretty' prettyConfig output) '\n'
|
||||
|
||||
putStrLn $ "Output written to: " ++ outputFile
|
||||
@@ -1,83 +0,0 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl
|
||||
|
||||
#set -euo pipefail
|
||||
|
||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
||||
|
||||
# value can be main | stable
|
||||
# Ensure at least one argument is passed
|
||||
if [[ $# -lt 1 ]]; then
|
||||
echo "Error: No argument provided. Please specify 'main' or 'stable'."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if the first argument is 'main' or 'stable'
|
||||
if [[ "$1" == "main" || "$1" == "stable" ]]; then
|
||||
echo "Valid input: $1"
|
||||
else
|
||||
echo "Error: Invalid input. Please specify 'main' or 'stable'."
|
||||
exit 1
|
||||
fi
|
||||
channel=$1
|
||||
|
||||
baseUrl="https://cli.upbound.io/${channel}"
|
||||
currentVersion=$(curl ${baseUrl}/current/version)
|
||||
|
||||
version="${currentVersion:1}"
|
||||
|
||||
declare -A archMapping
|
||||
archMapping["aarch64-darwin"]="darwin_arm64"
|
||||
archMapping["x86_64-darwin"]="darwin_amd64"
|
||||
archMapping["aarch64-linux"]="linux_arm64"
|
||||
archMapping["x86_64-linux"]="linux_amd64"
|
||||
|
||||
archMapBlock=
|
||||
for key in "${!archMapping[@]}"; do
|
||||
line=$(printf "$key = \"${archMapping[$key]}\"; ")
|
||||
archMapBlock="$archMapBlock$line"
|
||||
done
|
||||
|
||||
platformListBlock=
|
||||
for key in "${!archMapping[@]}"; do
|
||||
platformListBlock="$platformListBlock\"$key\" "
|
||||
done
|
||||
|
||||
cmds=("docker-credential-up" "up")
|
||||
fetchurlAttrSetBlock=
|
||||
for cmd in "${cmds[@]}"; do
|
||||
for key in "${!archMapping[@]}"; do
|
||||
arch=${archMapping[$key]}
|
||||
url="${baseUrl}/v${version}/bundle/$cmd/${arch}.tar.gz";
|
||||
hash=$(nix-prefetch-url $url)
|
||||
hash=$(nix hash convert "${hash}" --hash-algo sha256)
|
||||
fetchurlAttrSetBlock="
|
||||
${fetchurlAttrSetBlock}
|
||||
$key.$cmd = {
|
||||
hash = \"${hash}\";
|
||||
url = ${url};
|
||||
};"
|
||||
done
|
||||
done
|
||||
|
||||
OUT_FILE="$SCRIPT_DIR/sources-${channel}.nix"
|
||||
cat >$OUT_FILE <<EOF
|
||||
# Generated by "update.sh ${channel}" - do not update manually!
|
||||
{
|
||||
version = "${version}";
|
||||
|
||||
platformList = [
|
||||
${platformListBlock}
|
||||
];
|
||||
|
||||
archMap = {
|
||||
${archMapBlock}
|
||||
};
|
||||
|
||||
fetchurlAttrSet = {
|
||||
${fetchurlAttrSetBlock}
|
||||
};
|
||||
}
|
||||
EOF
|
||||
|
||||
nixfmt $OUT_FILE
|
||||
@@ -335,6 +335,13 @@ rec {
|
||||
doCheck = false; # Some compiler spec problems on x86-64_linux with the .0 release
|
||||
};
|
||||
|
||||
crystal_1_15 = generic {
|
||||
version = "1.15.1";
|
||||
sha256 = "sha256-L/Q8yZdDq/wn4kJ+zpLfi4pxznAtgjxTCbLnEiCC2K0=";
|
||||
binary = binaryCrystal_1_10;
|
||||
llvmPackages = llvmPackages_18;
|
||||
doCheck = false;
|
||||
};
|
||||
|
||||
crystal = crystal_1_14;
|
||||
crystal = crystal_1_15;
|
||||
}
|
||||
|
||||
@@ -103,8 +103,7 @@ stdenv.mkDerivation {
|
||||
"-DBUILD_SHARED_LIBS=ON"
|
||||
"-DITK_FORBID_DOWNLOADS=ON"
|
||||
"-DITK_USE_SYSTEM_LIBRARIES=ON" # finds common libraries e.g. hdf5, libpng, libtiff, zlib, but not GDCM, NIFTI, MINC, etc.
|
||||
"-DITK_USE_SYSTEM_EIGEN=ON"
|
||||
"-DITK_USE_SYSTEM_EIGEN=OFF"
|
||||
(lib.cmakeBool "ITK_USE_SYSTEM_EIGEN" (lib.versionAtLeast version "5.4"))
|
||||
"-DITK_USE_SYSTEM_GOOGLETEST=OFF" # ANTs build failure due to https://github.com/ANTsX/ANTs/issues/1489
|
||||
"-DITK_USE_SYSTEM_GDCM=ON"
|
||||
"-DITK_USE_SYSTEM_MINC=ON"
|
||||
@@ -142,10 +141,10 @@ stdenv.mkDerivation {
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
eigen
|
||||
libX11
|
||||
libuuid
|
||||
]
|
||||
++ lib.optionals (lib.versionAtLeast version "5.4") [ eigen ]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa ]
|
||||
++ lib.optionals enablePython [ python ]
|
||||
++ lib.optionals withVtk [ vtk ];
|
||||
|
||||
@@ -5762,6 +5762,7 @@ with pkgs;
|
||||
crystal_1_11
|
||||
crystal_1_12
|
||||
crystal_1_14
|
||||
crystal_1_15
|
||||
crystal;
|
||||
|
||||
crystalline = callPackage ../development/tools/language-servers/crystalline {
|
||||
|
||||
Reference in New Issue
Block a user