MCPcopy Index your code
hub / github.com/BuddySirJava/SSH-Studio / install

Method install

Formula/ssh-studio.rb:25–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 end
24
25 def install
26 resource("blueprint-compiler").stage do
27 system "meson", "setup", "build", "--prefix=#{libexec}", "--buildtype=release"
28 system "meson", "compile", "-C", "build"
29 system "meson", "install", "-C", "build"
30 end
31 ENV.prepend_path "PATH", libexec/"bin"
32
33 ENV["PYTHON"] = Formula["python@3.13"].opt_bin/"python3"
34
35 inreplace "data/ssh-studio.in", "python3", "#{Formula["python@3.13"].opt_bin}/python3"
36
37 system "meson", "setup", "build", *std_meson_args
38 system "meson", "compile", "-C", "build"
39 system "meson", "install", "-C", "build"
40
41 python_version = Formula["python@3.13"].version.major_minor
42 python_site_packages = lib/"python#{python_version}/site-packages"
43 python_site_packages.mkpath
44
45 (python_site_packages/"ssh_studio").mkpath
46 (python_site_packages/"ssh_studio/ui").mkpath
47
48 cp_r "src/ssh_config_parser.py", python_site_packages/"ssh_studio/"
49 cp_r "src/main.py", python_site_packages/"ssh_studio/"
50 cp_r "src/__init__.py", python_site_packages/"ssh_studio/"
51 cp_r Dir["src/ui/*.py"], python_site_packages/"ssh_studio/ui/"
52 cp_r "src/ui/__init__.py", python_site_packages/"ssh_studio/ui/"
53
54 (libexec/"bin").mkpath
55 mv bin/"ssh-studio", libexec/"bin/ssh-studio" if (bin/"ssh-studio").exist?
56 resource_file = share/"io.github.BuddySirJava.SSH-Studio/ssh-studio-resources.gresource"
57
58 launcher = libexec/"ssh-studio-launch.py"
59 launcher.write <<~PY
60 #!/usr/bin/env python3
61 import sys
62 from gi.repository import Gio
63 Gio.resources_register(Gio.Resource.load("#{resource_file}"))
64 from ssh_studio import main as _main
65 sys.exit(_main.main())
66 PY
67 chmod 0755, launcher
68
69 (bin/"ssh-studio").write <<~SH
70 #!/bin/bash
71 export PYTHONPATH="#{python_site_packages}"
72 exec "#{Formula["python@3.13"].opt_bin}/python3" "#{launcher}" "$@"
73 SH
74 chmod 0755, bin/"ssh-studio"
75
76 app_root = prefix/"Applications/SSH Studio.app/Contents"
77 (app_root/"MacOS").mkpath
78 (app_root/"Resources").mkpath
79
80 (app_root/"Info.plist").write <<~PLIST
81 <?xml version="1.0" encoding="UTF-8"?>
82 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected