Make the docs and man pages available in the macos bundle as well
This commit is contained in:
parent
1f499a7c6c
commit
3288400005
6
Makefile
6
Makefile
@ -35,6 +35,12 @@ profile:
|
|||||||
app:
|
app:
|
||||||
python3 setup.py kitty.app $(VVAL)
|
python3 setup.py kitty.app $(VVAL)
|
||||||
|
|
||||||
|
linux-package: FORCE
|
||||||
|
rm -rf linux-package
|
||||||
|
python3 setup.py linux-package
|
||||||
|
|
||||||
|
FORCE:
|
||||||
|
|
||||||
man:
|
man:
|
||||||
$(MAKE) -C docs man
|
$(MAKE) -C docs man
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@ def ref_map() -> Dict[str, Dict[str, str]]:
|
|||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
|
||||||
def resolve_ref(ref: str) -> str:
|
def resolve_ref(ref: str, website_url: Callable[[str], str] = website_url) -> str:
|
||||||
m = ref_map()
|
m = ref_map()
|
||||||
href = m['ref'].get(ref, '')
|
href = m['ref'].get(ref, '')
|
||||||
if href:
|
if href:
|
||||||
|
|||||||
@ -249,3 +249,22 @@ def clear_handled_signals(*a: Any) -> None:
|
|||||||
signal.pthread_sigmask(signal.SIG_UNBLOCK, handled_signals)
|
signal.pthread_sigmask(signal.SIG_UNBLOCK, handled_signals)
|
||||||
for s in handled_signals:
|
for s in handled_signals:
|
||||||
signal.signal(s, signal.SIG_DFL)
|
signal.signal(s, signal.SIG_DFL)
|
||||||
|
|
||||||
|
|
||||||
|
@run_once
|
||||||
|
def local_docs() -> str:
|
||||||
|
d = os.path.dirname
|
||||||
|
base = d(d(kitty_exe()))
|
||||||
|
subdir = os.path.join('doc', 'kitty', 'html')
|
||||||
|
linux_ans = os.path.join(base, 'share', subdir)
|
||||||
|
if getattr(sys, 'frozen', False):
|
||||||
|
if is_macos:
|
||||||
|
return os.path.join(d(d(d(extensions_dir))), subdir)
|
||||||
|
return linux_ans
|
||||||
|
if os.path.isdir(linux_ans):
|
||||||
|
return linux_ans
|
||||||
|
for candidate in ('/usr', '/usr/local', '/opt/homebrew'):
|
||||||
|
q = os.path.join(candidate, 'share', subdir)
|
||||||
|
if os.path.isdir(q):
|
||||||
|
return q
|
||||||
|
return ''
|
||||||
|
|||||||
@ -51,13 +51,15 @@ class TestBuild(BaseTest):
|
|||||||
|
|
||||||
def test_filesystem_locations(self) -> None:
|
def test_filesystem_locations(self) -> None:
|
||||||
from kitty.constants import (
|
from kitty.constants import (
|
||||||
logo_png_file, shell_integration_dir, terminfo_dir
|
local_docs, logo_png_file, shell_integration_dir, terminfo_dir
|
||||||
)
|
)
|
||||||
zsh = os.path.join(shell_integration_dir, 'zsh')
|
zsh = os.path.join(shell_integration_dir, 'zsh')
|
||||||
self.assertTrue(os.path.isdir(terminfo_dir), f'Terminfo dir: {terminfo_dir}')
|
self.assertTrue(os.path.isdir(terminfo_dir), f'Terminfo dir: {terminfo_dir}')
|
||||||
self.assertTrue(os.path.exists(logo_png_file), f'Logo file: {logo_png_file}')
|
self.assertTrue(os.path.exists(logo_png_file), f'Logo file: {logo_png_file}')
|
||||||
self.assertTrue(os.path.exists(zsh), f'Shell integration: {zsh}')
|
self.assertTrue(os.path.exists(zsh), f'Shell integration: {zsh}')
|
||||||
self.assertTrue(os.access(os.path.join(shell_integration_dir, 'ssh', 'askpass.py'), os.X_OK))
|
self.assertTrue(os.access(os.path.join(shell_integration_dir, 'ssh', 'askpass.py'), os.X_OK))
|
||||||
|
if getattr(sys, 'frozen', False):
|
||||||
|
self.assertTrue(os.path.isdir(local_docs()), f'Local docs: {local_docs()}')
|
||||||
|
|
||||||
def test_ca_certificates(self):
|
def test_ca_certificates(self):
|
||||||
import ssl
|
import ssl
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -1280,6 +1280,8 @@ def create_macos_bundle_gunk(dest: str) -> None:
|
|||||||
os.mkdir(ddir / 'Contents')
|
os.mkdir(ddir / 'Contents')
|
||||||
with open(ddir / 'Contents/Info.plist', 'wb') as fp:
|
with open(ddir / 'Contents/Info.plist', 'wb') as fp:
|
||||||
fp.write(macos_info_plist())
|
fp.write(macos_info_plist())
|
||||||
|
copy_man_pages(str(ddir))
|
||||||
|
copy_html_docs(str(ddir))
|
||||||
os.rename(ddir / 'share', ddir / 'Contents/Resources')
|
os.rename(ddir / 'share', ddir / 'Contents/Resources')
|
||||||
os.rename(ddir / 'bin', ddir / 'Contents/MacOS')
|
os.rename(ddir / 'bin', ddir / 'Contents/MacOS')
|
||||||
os.rename(ddir / 'lib', ddir / 'Contents/Frameworks')
|
os.rename(ddir / 'lib', ddir / 'Contents/Frameworks')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user