Files
chromebrew/packages/lmstudio.rb
SupeChicken666 3ee0c82139 glibc-standalone: Rename to glibc, add a LD_PRELOAD library with useful features (#11911)
* crew: Add a LD_PRELOAD library for hijacking linker/library path

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Add `glibc_{build,dev.lib}` to deprecated package list

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Bump version

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Minor changes

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Move static libraries to CREW_LIB_PREFIX

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Remove glibc_build from const.rb

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Make rubocop happy

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Fix arm build and add binaries.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* cleanup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust x86_64 unit tests to use the Nocturne M90 container image and armv7l unit tests to use the fievel M91 container image since we are using the same glibc for everything now.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust build containers to use the oldest glibc based containers.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add i686 builds.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add x86_64 build.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Set LD_PRELOAD before running any command

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Use File.join

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Use File.join

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* adjust unit tests.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Fix arm CREW_GLIBC_INTERPRETER

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update Rhythmbox

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update Rhythmbox

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* lint

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Do not install crew_sudo in container.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Bump version

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

---------

Signed-off-by: SupeChicken666 <me@supechicken666.dev>
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: Satadru Pramanik <satadru@gmail.com>
2025-05-20 10:21:15 +00:00

84 lines
2.4 KiB
Ruby

require 'package'
class Lmstudio < Package
description 'Discover, download, and run local LLMs'
homepage 'https://lmstudio.ai/'
version '0.2.26'
license 'MIT'
compatibility 'x86_64'
source_url "https://releases.lmstudio.ai/linux/x86/#{version}/beta/LM_Studio-#{version}.AppImage"
source_sha256 '857aa577b83e8af4182e830dc4f77482f04007ae6df52092242d5a8319868926'
depends_on 'alsa_lib' # R
depends_on 'at_spi2_core' # R
depends_on 'cairo' # R
depends_on 'harfbuzz' # R
depends_on 'cups' # R
depends_on 'dbus' # R
depends_on 'dbus_glib' # R
depends_on 'expat' # R
depends_on 'gcc_lib' # R
depends_on 'gdk_pixbuf' # R
depends_on 'glib' # R
depends_on 'glibc' # R
depends_on 'gtk2' # R
depends_on 'gtk3' # R
depends_on 'libdrm' # R
depends_on 'libx11' # R
depends_on 'libxcb' # R
depends_on 'libxcomposite' # R
depends_on 'libxdamage' # R
depends_on 'libxext' # R
depends_on 'libxfixes' # R
depends_on 'libxkbcommon' # R
depends_on 'libxrandr' # R
depends_on 'mesa' # R
depends_on 'nss' # R
depends_on 'opencl_icd_loader' # R
depends_on 'pango' # R
depends_on 'gdk_base' # R
depends_on 'sommelier' # R
no_shrink
no_compile_needed
print_source_bashrc
def self.build
File.write 'lmstudio.sh', <<~EOF
#!/bin/bash
rm -f "#{HOME}/.cache/lm-studio/gpu-preferences.json"
cd #{CREW_PREFIX}/share/lmstudio
GDK_BACKEND=x11 ./AppRun "$@"
EOF
end
def self.install
FileUtils.rm 'lm-studio.png'
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
FileUtils.mv 'usr/share', CREW_DEST_PREFIX
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/lmstudio"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/share/applications"
FileUtils.mv 'lm-studio.desktop', "#{CREW_DEST_PREFIX}/share/applications"
FileUtils.install 'lmstudio.sh', "#{CREW_DEST_PREFIX}/bin/lmstudio", mode: 0o755
FileUtils.mv Dir['*'], "#{CREW_DEST_PREFIX}/share/lmstudio"
end
def self.postinstall
ExitMessage.add "\nType 'lmstudio' to get started.\n".lightblue
end
def self.postremove
config_dir = "#{HOME}/.cache/lm-studio"
if Dir.exist? config_dir
print "Would you like to remove the #{config_dir} directory? [y/N] "
case $stdin.gets.chomp.downcase
when 'y', 'yes'
FileUtils.rm_rf config_dir
puts "#{config_dir} removed.".lightgreen
else
puts "#{config_dir} saved.".lightgreen
end
end
end
end