From 0e1a95e5a1f77ebe46fd69c2436742368079628c Mon Sep 17 00:00:00 2001 From: crertel Date: Fri, 10 Jan 2025 13:47:13 -0600 Subject: [PATCH] lmstudio: 0.3.5 -> 0.3.6 --- pkgs/by-name/lm/lmstudio/darwin.nix | 26 ++++++++++++++++++++++++-- pkgs/by-name/lm/lmstudio/linux.nix | 4 ++-- pkgs/by-name/lm/lmstudio/package.nix | 4 ++-- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/lm/lmstudio/darwin.nix b/pkgs/by-name/lm/lmstudio/darwin.nix index 7948b936f94c8..4f32b73f6f634 100644 --- a/pkgs/by-name/lm/lmstudio/darwin.nix +++ b/pkgs/by-name/lm/lmstudio/darwin.nix @@ -11,8 +11,8 @@ stdenv.mkDerivation { inherit meta pname version; src = fetchurl { - url = "https://releases.lmstudio.ai/darwin/arm64/${version}/${rev}/LM-Studio-${version}-arm64.dmg"; - hash = "sha256-XPaXIWd/Xl3i5dS+5WY9OEIB9PNWe5y9C1MwoZMDht0="; + url = "https://installers.lmstudio.ai/darwin/arm64/${version}-${rev}/LM-Studio-${version}-${rev}-arm64.dmg"; + hash = "sha256-x4IRT1PjBz9eafmwNRyLVq+4/Rkptz6RVWDFdRrGnGY="; }; nativeBuildInputs = [ undmg ]; @@ -25,4 +25,26 @@ stdenv.mkDerivation { cp -r *.app $out/Applications runHook postInstall ''; + + # LM Studio ships Scripts inside the App Bundle, which may be messed up by standard fixups + dontFixup = true; + + # undmg doesn't support APFS and 7zz does break the xattr. Took that approach from https://github.com/NixOS/nixpkgs/blob/a3c6ed7ad2649c1a55ffd94f7747e3176053b833/pkgs/by-name/in/insomnia/package.nix#L52 + unpackCmd = '' + echo "Creating temp directory" + mnt=$(TMPDIR=/tmp mktemp -d -t nix-XXXXXXXXXX) + function finish { + echo "Ejecting temp directory" + /usr/bin/hdiutil detach $mnt -force + rm -rf $mnt + } + # Detach volume when receiving SIG "0" + trap finish EXIT + # Mount DMG file + echo "Mounting DMG file into \"$mnt\"" + /usr/bin/hdiutil attach -nobrowse -mountpoint $mnt $curSrc + # Copy content to local dir for later use + echo 'Copying extracted content into "sourceRoot"' + cp -a $mnt/LM\ Studio.app $PWD/ + ''; } diff --git a/pkgs/by-name/lm/lmstudio/linux.nix b/pkgs/by-name/lm/lmstudio/linux.nix index 18328a1972dc0..35ec1655ed810 100644 --- a/pkgs/by-name/lm/lmstudio/linux.nix +++ b/pkgs/by-name/lm/lmstudio/linux.nix @@ -8,8 +8,8 @@ }: let src = fetchurl { - url = "https://releases.lmstudio.ai/linux/x86/${version}/${rev}/LM_Studio-${version}.AppImage"; - hash = "sha256-ylUS6WrGavNW1WbroBnCLeeMBeBX41ontwKeQLug6/s="; + url = "https://installers.lmstudio.ai/linux/x64/${version}-${rev}/LM-Studio-${version}-${rev}-x64.AppImage"; + hash = "sha256-laROBUr1HLoaQT6rYhhhulR1KZuKczNomKbrXXkDANY="; }; appimageContents = appimageTools.extractType2 { inherit pname version src; }; diff --git a/pkgs/by-name/lm/lmstudio/package.nix b/pkgs/by-name/lm/lmstudio/package.nix index 0df6732d9a0cf..b1f157ed8e461 100644 --- a/pkgs/by-name/lm/lmstudio/package.nix +++ b/pkgs/by-name/lm/lmstudio/package.nix @@ -6,8 +6,8 @@ }: let pname = "lmstudio"; - version = "0.3.5"; - rev = "2"; + version = "0.3.6"; + rev = "8"; meta = { description = "LM Studio is an easy to use desktop app for experimenting with local and open-source Large Language Models (LLMs)"; homepage = "https://lmstudio.ai/";