From 1182bd00bdf877f1c61f592790a1925a4610ccee Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sat, 23 Nov 2024 14:29:32 +0900 Subject: [PATCH 01/10] rmfakecloud: 0.0.21 -> 0.0.23 0.0.22 - fix regression in 0.0.21 for old remarkable tablet versions (see https://github.com/ddvk/rmfakecloud/issues/330 ) - fix build with new UI... 0.0.23 - fix other regression with 0.0.22... --- pkgs/by-name/rm/rmfakecloud/package.nix | 9 +++-- pkgs/by-name/rm/rmfakecloud/webui.nix | 45 +++++++++++++++---------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/pkgs/by-name/rm/rmfakecloud/package.nix b/pkgs/by-name/rm/rmfakecloud/package.nix index f68229b10a16..dfd9269f764e 100644 --- a/pkgs/by-name/rm/rmfakecloud/package.nix +++ b/pkgs/by-name/rm/rmfakecloud/package.nix @@ -9,13 +9,13 @@ 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="; @@ -25,8 +25,7 @@ buildGoModule rec { postPatch = if enableWebui then '' - mkdir -p ui/build - cp -r ${ui}/* ui/build + cp -a ${ui} ui/dist '' else '' diff --git a/pkgs/by-name/rm/rmfakecloud/webui.nix b/pkgs/by-name/rm/rmfakecloud/webui.nix index 928a624cba2b..bdfa8bfc41c6 100644 --- a/pkgs/by-name/rm/rmfakecloud/webui.nix +++ b/pkgs/by-name/rm/rmfakecloud/webui.nix @@ -1,37 +1,46 @@ -{ version, src, stdenv, lib, fetchYarnDeps, fixup-yarn-lock, yarn, nodejs }: +{ + version, + src, + stdenv, + lib, + pnpm_9, + nodejs, +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { inherit version src; pname = "rmfakecloud-webui"; - yarnOfflineCache = fetchYarnDeps { - yarnLock = "${src}/ui/yarn.lock"; - hash = "sha256-9//uQ4ZLLTf2N1WSwsOwFjBuDmThuMtMXU4SzMljAMM="; + pnpmDeps = pnpm_9.fetchDeps { + inherit (finalAttrs) pname version src; + sourceRoot = "${finalAttrs.src.name}/ui"; + pnpmLock = "${src}/ui/pnpm-lock.yaml"; + hash = "sha256-VNmCT4um2W2ii8jAm+KjQSjixYEKoZkw7CeRwErff/o="; }; - - nativeBuildInputs = [ fixup-yarn-lock yarn nodejs ]; + pnpmRoot = "ui"; 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 .. + + # using sass-embedded fails at executing node_modules/sass-embedded-linux-x64/dart-sass/src/dart + rm -r node_modules/sass-embedded node_modules/.pnpm/sass-embedded* + + pnpm build ''; installPhase = '' - cp -r ui/build/* $out + cp -a dist/. $out ''; + nativeBuildInputs = [ + nodejs + pnpm_9.configHook + ]; + meta = with lib; { description = "Only the webui files for rmfakecloud"; homepage = "https://ddvk.github.io/rmfakecloud/"; license = licenses.agpl3Only; }; -} +}) From de4a766794e72248d0c3ef23a2dab7843e564e15 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sat, 23 Nov 2024 19:29:29 +0900 Subject: [PATCH 02/10] rmfakecloud: build the webui together with the app This avoids maintaining an artificial derivation for the web UI, and hopefully will allow the auto-update bot to make PRs for further updates --- pkgs/by-name/rm/rmfakecloud/package.nix | 39 +++++++++++++++------ pkgs/by-name/rm/rmfakecloud/webui.nix | 46 ------------------------- 2 files changed, 28 insertions(+), 57 deletions(-) delete mode 100644 pkgs/by-name/rm/rmfakecloud/webui.nix diff --git a/pkgs/by-name/rm/rmfakecloud/package.nix b/pkgs/by-name/rm/rmfakecloud/package.nix index dfd9269f764e..e57dc8350084 100644 --- a/pkgs/by-name/rm/rmfakecloud/package.nix +++ b/pkgs/by-name/rm/rmfakecloud/package.nix @@ -2,8 +2,9 @@ lib, fetchFromGitHub, buildGoModule, - callPackage, enableWebui ? true, + pnpm_9, + nodejs, nixosTests, }: @@ -20,17 +21,33 @@ buildGoModule rec { 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 - '' - cp -a ${ui} ui/dist - '' - 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" diff --git a/pkgs/by-name/rm/rmfakecloud/webui.nix b/pkgs/by-name/rm/rmfakecloud/webui.nix deleted file mode 100644 index bdfa8bfc41c6..000000000000 --- a/pkgs/by-name/rm/rmfakecloud/webui.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - version, - src, - stdenv, - lib, - pnpm_9, - nodejs, -}: - -stdenv.mkDerivation (finalAttrs: { - inherit version src; - - pname = "rmfakecloud-webui"; - - pnpmDeps = pnpm_9.fetchDeps { - inherit (finalAttrs) pname version src; - sourceRoot = "${finalAttrs.src.name}/ui"; - pnpmLock = "${src}/ui/pnpm-lock.yaml"; - hash = "sha256-VNmCT4um2W2ii8jAm+KjQSjixYEKoZkw7CeRwErff/o="; - }; - pnpmRoot = "ui"; - - buildPhase = '' - cd ui - - # using sass-embedded fails at executing node_modules/sass-embedded-linux-x64/dart-sass/src/dart - rm -r node_modules/sass-embedded node_modules/.pnpm/sass-embedded* - - pnpm build - ''; - - installPhase = '' - cp -a dist/. $out - ''; - - nativeBuildInputs = [ - nodejs - pnpm_9.configHook - ]; - - meta = with lib; { - description = "Only the webui files for rmfakecloud"; - homepage = "https://ddvk.github.io/rmfakecloud/"; - license = licenses.agpl3Only; - }; -}) From cb41be55860f68834868896f644270c372541185 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sat, 7 Dec 2024 19:44:19 +0800 Subject: [PATCH 03/10] timeshift: use substituteInPlace --replace-fail --- pkgs/applications/backup/timeshift/unwrapped.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/backup/timeshift/unwrapped.nix b/pkgs/applications/backup/timeshift/unwrapped.nix index 86d6794051ef..357f533bd845 100644 --- a/pkgs/applications/backup/timeshift/unwrapped.nix +++ b/pkgs/applications/backup/timeshift/unwrapped.nix @@ -31,12 +31,13 @@ stdenv.mkDerivation rec { ]; 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" ''; nativeBuildInputs = [ From b201cc703f531a54d6e04552c6ed402753a8465c Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sat, 7 Dec 2024 20:08:05 +0800 Subject: [PATCH 04/10] timeshift: patch timeshift-launcher with escapeShellArg instead of a patch file --- .../backup/timeshift/timeshift-launcher.patch | 26 ------------------- .../backup/timeshift/unwrapped.nix | 8 +++--- 2 files changed, 4 insertions(+), 30 deletions(-) delete mode 100644 pkgs/applications/backup/timeshift/timeshift-launcher.patch diff --git a/pkgs/applications/backup/timeshift/timeshift-launcher.patch b/pkgs/applications/backup/timeshift/timeshift-launcher.patch deleted file mode 100644 index 765c101e1629..000000000000 --- a/pkgs/applications/backup/timeshift/timeshift-launcher.patch +++ /dev/null @@ -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 diff --git a/pkgs/applications/backup/timeshift/unwrapped.nix b/pkgs/applications/backup/timeshift/unwrapped.nix index 357f533bd845..cb62703ab37c 100644 --- a/pkgs/applications/backup/timeshift/unwrapped.nix +++ b/pkgs/applications/backup/timeshift/unwrapped.nix @@ -26,10 +26,6 @@ stdenv.mkDerivation rec { hash = "sha256-2qNLgUZLMcfoemdLvvjdkR7Ln5loSKGqbd402y5Id8k="; }; - patches = [ - ./timeshift-launcher.patch - ]; - postPatch = '' for FILE in src/Core/Main.vala src/Utility/Device.vala; do substituteInPlace "$FILE" \ @@ -38,6 +34,10 @@ stdenv.mkDerivation rec { substituteInPlace ./src/Utility/IconManager.vala \ --replace-fail "/usr/share" "$out/share" + + substituteInPlace ./src/timeshift-launcher \ + --replace-fail "app_command='timeshift-gtk'" ${lib.escapeShellArg ''app_command="$(realpath "$(dirname "$0")")/timeshift-gtk"''} \ + --replace-fail ${lib.escapeShellArg ''pkexec ''${app_command}''} ${lib.escapeShellArg ''pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" "''${app_command}"''} ''; nativeBuildInputs = [ From 8c5116e6a52a2e6ea878d0ecdee4d5f3be58088f Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sat, 7 Dec 2024 20:35:23 +0800 Subject: [PATCH 05/10] timeshift: explain the timeshift-launcher string substitution --- pkgs/applications/backup/timeshift/unwrapped.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/backup/timeshift/unwrapped.nix b/pkgs/applications/backup/timeshift/unwrapped.nix index cb62703ab37c..8b26c3ca0f28 100644 --- a/pkgs/applications/backup/timeshift/unwrapped.nix +++ b/pkgs/applications/backup/timeshift/unwrapped.nix @@ -35,6 +35,8 @@ stdenv.mkDerivation rec { substituteInPlace ./src/Utility/IconManager.vala \ --replace-fail "/usr/share" "$out/share" + # Substitute app_command to look for the `timeshift-gtk` in the same directory as the executed `timeshift-launcher`. + # 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'" ${lib.escapeShellArg ''app_command="$(realpath "$(dirname "$0")")/timeshift-gtk"''} \ --replace-fail ${lib.escapeShellArg ''pkexec ''${app_command}''} ${lib.escapeShellArg ''pkexec env DISPLAY="$DISPLAY" XAUTHORITY="$XAUTHORITY" "''${app_command}"''} From c00b800033c21aa39e0e6e4842ebc3deb21ca61d Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Sat, 7 Dec 2024 21:51:03 +0800 Subject: [PATCH 06/10] timeshift: timeshift-launcher: hard-code the timeshift-gtk path --- pkgs/applications/backup/timeshift/unwrapped.nix | 4 ++-- pkgs/applications/backup/timeshift/wrapper.nix | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/backup/timeshift/unwrapped.nix b/pkgs/applications/backup/timeshift/unwrapped.nix index 8b26c3ca0f28..83ec44f9d846 100644 --- a/pkgs/applications/backup/timeshift/unwrapped.nix +++ b/pkgs/applications/backup/timeshift/unwrapped.nix @@ -35,10 +35,10 @@ stdenv.mkDerivation rec { substituteInPlace ./src/Utility/IconManager.vala \ --replace-fail "/usr/share" "$out/share" - # Substitute app_command to look for the `timeshift-gtk` in the same directory as the executed `timeshift-launcher`. + # 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'" ${lib.escapeShellArg ''app_command="$(realpath "$(dirname "$0")")/timeshift-gtk"''} \ + --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}"''} ''; diff --git a/pkgs/applications/backup/timeshift/wrapper.nix b/pkgs/applications/backup/timeshift/wrapper.nix index 84b3f14ac2ff..d02aad0fe562 100644 --- a/pkgs/applications/backup/timeshift/wrapper.nix +++ b/pkgs/applications/backup/timeshift/wrapper.nix @@ -39,6 +39,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; From d69eac078539d2a95ba99f6249fa46d7f917dc93 Mon Sep 17 00:00:00 2001 From: Spencer Heywood Date: Tue, 12 Nov 2024 16:18:20 -0700 Subject: [PATCH 07/10] choose-gui: fix x86_64-darwin build --- pkgs/by-name/ch/choose-gui/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ch/choose-gui/package.nix b/pkgs/by-name/ch/choose-gui/package.nix index bbf1ff2a8578..da7d1e6e7be9 100644 --- a/pkgs/by-name/ch/choose-gui/package.nix +++ b/pkgs/by-name/ch/choose-gui/package.nix @@ -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 ''; From f0cae1e3c684960a590f6cc5feb2285c467f9f76 Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Mon, 16 Dec 2024 22:11:51 -0500 Subject: [PATCH 08/10] itk: fix contradictory ITK_USE_SYSTEM_EIGEN cmake flags --- pkgs/development/libraries/itk/generic.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/itk/generic.nix b/pkgs/development/libraries/itk/generic.nix index b569c84e4ed6..383baaabc194 100644 --- a/pkgs/development/libraries/itk/generic.nix +++ b/pkgs/development/libraries/itk/generic.nix @@ -115,8 +115,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" @@ -152,10 +151,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 ]; From 95a6a51e116a2f77d98b9cbfb8879497bacd891a Mon Sep 17 00:00:00 2001 From: Jean-Luc Jox Date: Fri, 20 Dec 2024 20:12:31 +1000 Subject: [PATCH 09/10] upbound: 0.36.1 -> 0.37.0, upbound-main: 0.37.0-0.rc.0.38.g797e121 -> 0.38.0-0.rc.0.29.g59359e0 --- pkgs/by-name/up/upbound/package.nix | 16 ++-- pkgs/by-name/up/upbound/sources-main.json | 53 ++++++++++++ pkgs/by-name/up/upbound/sources-main.nix | 54 ------------ pkgs/by-name/up/upbound/sources-stable.json | 53 ++++++++++++ pkgs/by-name/up/upbound/sources-stable.nix | 54 ------------ pkgs/by-name/up/upbound/update | 4 + pkgs/by-name/up/upbound/update.hs | 96 +++++++++++++++++++++ pkgs/by-name/up/upbound/update.sh | 83 ------------------ 8 files changed, 216 insertions(+), 197 deletions(-) create mode 100644 pkgs/by-name/up/upbound/sources-main.json delete mode 100644 pkgs/by-name/up/upbound/sources-main.nix create mode 100644 pkgs/by-name/up/upbound/sources-stable.json delete mode 100644 pkgs/by-name/up/upbound/sources-stable.nix create mode 100755 pkgs/by-name/up/upbound/update create mode 100755 pkgs/by-name/up/upbound/update.hs delete mode 100755 pkgs/by-name/up/upbound/update.sh diff --git a/pkgs/by-name/up/upbound/package.nix b/pkgs/by-name/up/upbound/package.nix index 51046a403ff2..caa377efe0f3 100644 --- a/pkgs/by-name/up/upbound/package.nix +++ b/pkgs/by-name/up/upbound/package.nix @@ -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; [ diff --git a/pkgs/by-name/up/upbound/sources-main.json b/pkgs/by-name/up/upbound/sources-main.json new file mode 100644 index 000000000000..a99993068f14 --- /dev/null +++ b/pkgs/by-name/up/upbound/sources-main.json @@ -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" +} diff --git a/pkgs/by-name/up/upbound/sources-main.nix b/pkgs/by-name/up/upbound/sources-main.nix deleted file mode 100644 index acf3aee01529..000000000000 --- a/pkgs/by-name/up/upbound/sources-main.nix +++ /dev/null @@ -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"; - }; - }; -} diff --git a/pkgs/by-name/up/upbound/sources-stable.json b/pkgs/by-name/up/upbound/sources-stable.json new file mode 100644 index 000000000000..cbf434da428d --- /dev/null +++ b/pkgs/by-name/up/upbound/sources-stable.json @@ -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" +} diff --git a/pkgs/by-name/up/upbound/sources-stable.nix b/pkgs/by-name/up/upbound/sources-stable.nix deleted file mode 100644 index 1dfc1b574cd2..000000000000 --- a/pkgs/by-name/up/upbound/sources-stable.nix +++ /dev/null @@ -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"; - }; - }; -} diff --git a/pkgs/by-name/up/upbound/update b/pkgs/by-name/up/upbound/update new file mode 100755 index 000000000000..d65588ec3579 --- /dev/null +++ b/pkgs/by-name/up/upbound/update @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +exec "$SCRIPT_DIR"/update.hs "$(realpath "$0")" "$1" diff --git a/pkgs/by-name/up/upbound/update.hs b/pkgs/by-name/up/upbound/update.hs new file mode 100755 index 000000000000..d7406f8717a9 --- /dev/null +++ b/pkgs/by-name/up/upbound/update.hs @@ -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 diff --git a/pkgs/by-name/up/upbound/update.sh b/pkgs/by-name/up/upbound/update.sh deleted file mode 100755 index ad0460aaade0..000000000000 --- a/pkgs/by-name/up/upbound/update.sh +++ /dev/null @@ -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 < Date: Wed, 5 Feb 2025 09:46:37 +0900 Subject: [PATCH 10/10] crystal_1_15: init at 1.15.1 Signed-off-by: misilelab --- pkgs/development/compilers/crystal/default.nix | 9 ++++++++- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/crystal/default.nix b/pkgs/development/compilers/crystal/default.nix index 702a6ec37dbb..52557ca4a64a 100644 --- a/pkgs/development/compilers/crystal/default.nix +++ b/pkgs/development/compilers/crystal/default.nix @@ -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; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index aa6cdc64dc4f..446b40b765b6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5764,6 +5764,7 @@ with pkgs; crystal_1_11 crystal_1_12 crystal_1_14 + crystal_1_15 crystal; crystalline = callPackage ../development/tools/language-servers/crystalline {