-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Vendor the terminfo database for use with base/terminfo.jl #55411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -245,7 +245,8 @@ end | |
Locate the terminfo file for `term`, return `nothing` if none could be found. | ||
|
||
The lookup policy is described in `terminfo(5)` "Fetching Compiled | ||
Descriptions". | ||
Descriptions". A terminfo database is included by default with Julia and is | ||
taken to be the first entry of `@TERMINFO_DIRS@`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I actually do see it mentioned on macOS:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's just a broken docs build 😛 the source text is:
In your example, only On my system, for comparison:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ha, incredible. Well, the function isn't really user-facing anyway; I'm sure a sufficiently motivated individual could decipher what this docstring means. 😅 |
||
""" | ||
function find_terminfo_file(term::String) | ||
isempty(term) && return | ||
|
@@ -261,15 +262,23 @@ function find_terminfo_file(term::String) | |
append!(terminfo_dirs, | ||
replace(split(ENV["TERMINFO_DIRS"], ':'), | ||
"" => "/usr/share/terminfo")) | ||
push!(terminfo_dirs, normpath(Sys.BINDIR, DATAROOTDIR, "terminfo")) | ||
Sys.isunix() && | ||
push!(terminfo_dirs, "/etc/terminfo", "/lib/terminfo", "/usr/share/terminfo") | ||
for dir in terminfo_dirs | ||
if isfile(joinpath(dir, chr, term)) | ||
return joinpath(dir, chr, term) | ||
elseif isfile(joinpath(dir, chrcode, term)) | ||
return joinpath(dir, chrcode, term) | ||
elseif isfile(joinpath(dir, lowercase(chr), lowercase(term))) | ||
# The vendored terminfo database is fully lowercase to avoid issues on | ||
# case-sensitive filesystems. On Unix-like systems, terminfo files with | ||
# different cases are hard links to one another, so this is still | ||
# correct for non-vendored terminfo, just redundant. | ||
return joinpath(dir, lowercase(chr), lowercase(term)) | ||
end | ||
end | ||
return nothing | ||
end | ||
|
||
""" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
TermInfoDB-v2023.12.9.any.tar.gz/md5/573d9b5adaf6af500e3dfae6e3d15ebf | ||
TermInfoDB-v2023.12.9.any.tar.gz/sha512/e0a5bfe54346f9d5690a840628b329f6fac7375b0d29337bc70813ae3553a72bb397f8034d221c544289e40c4cfc685d5805777b7528f05bbe0123b5905c24a4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
## TERMINFO-DB ## | ||
include $(SRCDIR)/terminfo.version | ||
|
||
$(SRCCACHE)/TermInfoDB-v$(TERMINFO_VER).any.tar.gz: | $(SRCCACHE) | ||
$(JLDOWNLOAD) $@ https://github.com/JuliaBinaryWrappers/TermInfoDB_jll.jl/releases/download/$(TERMINFO_TAG)/TermInfoDB.v$(TERMINFO_VER).any.tar.gz | ||
touch -c $@ | ||
|
||
$(BUILDDIR)/TermInfoDB-v$(TERMINFO_VER)/source-extracted: $(SRCCACHE)/TermInfoDB-v$(TERMINFO_VER).any.tar.gz | ||
$(JLCHECKSUM) $< | ||
rm -rf $(dir $@) | ||
mkdir -p $(dir $@) | ||
$(TAR) -C $(dir $@) --strip-components 1 -xf $< | ||
echo 1 > $@ | ||
|
||
checksum-terminfo: $(SRCCACHE)/TermInfoDB-v$(TERMINFO_VER).any.tar.gz | ||
$(JLCHECKSUM) $< | ||
|
||
$(BUILDDIR)/TermInfoDB-v$(TERMINFO_VER)/build-compiled: $(BUILDDIR)/TermInfoDB-v$(TERMINFO_VER)/source-extracted | ||
echo 1 > $@ | ||
|
||
$(BUILDDIR)/TermInfoDB-v$(TERMINFO_VER)/build-checked: $(BUILDDIR)/TermInfoDB-v$(TERMINFO_VER)/build-compiled | ||
echo 1 > $@ | ||
|
||
define TERMINFO_INSTALL | ||
mkdir -p $2/$$(build_datarootdir) | ||
cp -R $1/terminfo $2/$$(build_datarootdir) | ||
endef | ||
$(eval $(call staged-install, \ | ||
terminfo,TermInfoDB-v$(TERMINFO_VER), \ | ||
TERMINFO_INSTALL,,,,)) | ||
|
||
clean-terminfo: | ||
-rm -f $(BUILDDIR)/TermInfoDB-v$(TERMINFO_VER)/build-compiled | ||
|
||
distclean-terminfo: | ||
rm -rf $(SRCCACHE)/TermInfoDB*.tar.gz $(SRCCACHE)/TermInfoDB-v$(TERMINFO_VER) $(BUILDDIR)/TermInfoDB-v$(TERMINFO_VER) | ||
|
||
get-terminfo: $(SRCCACHE)/TermInfoDB-v$(TERMINFO_VER).any.tar.gz | ||
extract-terminfo: $(BUILDDIR)/TermInfoDB-v$(TERMINFO_VER)/source-extracted | ||
configure-terminfo: extract-terminfo | ||
compile-terminfo: $(BUILDDIR)/TermInfoDB-v$(TERMINFO_VER)/build-compiled | ||
fastcheck-terminfo: check-terminfo | ||
check-terminfo: $(BUILDDIR)/TermInfoDB-v$(TERMINFO_VER)/build-checked |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# -*- makefile -*- | ||
TERMINFO_VER := 2023.12.9 | ||
ararslan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
TERMINFO_TAG := TermInfoDB-v$(TERMINFO_VER)+0 |
Uh oh!
There was an error while loading. Please reload this page.