Accepting request 768008 from devel:openQA
https://progress.opensuse.org/issues/62627 OBS-URL: https://build.opensuse.org/request/show/768008 OBS-URL: https://build.opensuse.org/package/show/devel:openQA:tested/xterm-console?expand=0&rev=1
This commit is contained in:
commit
4545978a96
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
119
psf2bdf.pl
Normal file
119
psf2bdf.pl
Normal file
@ -0,0 +1,119 @@
|
||||
#!/usr/bin/env perl
|
||||
# Convert PC Screen Font (PSF) font to Glyph Bitmap Distribution Format (BDF).
|
||||
# Copyright (c) 2015 Kacper Gutowski
|
||||
# Copyright (c) 2015 Susanne Oberhauser-Hirschoff
|
||||
# The MIT License applies (http://opensource.org/licenses/MIT)
|
||||
|
||||
# https://gist.github.com/mwgamera/6ad86e71e002e5aef1b8/01ffe8208b2763dd353ea7afacedf83072477372
|
||||
# with minor fixes
|
||||
|
||||
use strict;
|
||||
|
||||
use constant {
|
||||
PSF1_MODE512 => 0x01,
|
||||
PSF1_MODEHASTAB => 0x02,
|
||||
PSF2_HAS_UNICODE_TABLE => 0x01,
|
||||
};
|
||||
|
||||
push @ARGV, '-' unless scalar @ARGV;
|
||||
|
||||
for (@ARGV) {
|
||||
my $fn = /^-$/ ? 'stdin' : $_;
|
||||
eval {
|
||||
|
||||
my ($length, $width, $height);
|
||||
my (@glyphs, @unicode);
|
||||
|
||||
open my $fh, $_ or die $!;
|
||||
binmode $fh;
|
||||
read $fh, $_, 4 or die $!;
|
||||
|
||||
if (0x0436 == unpack 'v') { # psf1
|
||||
my ($mode, $size) = unpack 'x2CC';
|
||||
$length = $mode & PSF1_MODE512 ? 512 : 256;
|
||||
$height = $size;
|
||||
$width = 8;
|
||||
read $fh, $_, $length * $size;
|
||||
@glyphs = unpack "(a$size)$length";
|
||||
if ($mode & PSF1_MODEHASTAB) {
|
||||
for my $i (0 .. $length - 1) {
|
||||
my ($u, @u) = 0;
|
||||
do {
|
||||
read $fh, $_, 2;
|
||||
$u = unpack 'v';
|
||||
push @u, $u if $u < 0xFFFE;
|
||||
} while $u < 0xFFFE;
|
||||
while ($u != 0xFFFF) {
|
||||
read $fh, $_, 2;
|
||||
$u = unpack 'v';
|
||||
warn 'Unicode sequence ignored' if $u == 0xFFFE;
|
||||
}
|
||||
$unicode[$i] = [@u];
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif (0x864ab572 == unpack 'V') { # psf2
|
||||
read $fh, $_, 28 or die $!;
|
||||
(my ($ver, $hlen, $flg), $length, my $size, $height, $width) = unpack 'V7';
|
||||
die "Unknown version $ver\n" unless $ver == 0;
|
||||
warn "Unexpected glyph size $size bytes for ${width}×$height px\n"
|
||||
unless $size == $height * int(($width + 7) / 8);
|
||||
read $fh, $_, $hlen - 32; # skip to data
|
||||
read $fh, $_, $length * $size;
|
||||
@glyphs = unpack "(a$size)$length";
|
||||
if ($flg & PSF2_HAS_UNICODE_TABLE) {
|
||||
my $buf = do { local $/; <$fh>; };
|
||||
for my $i (0 .. $length - 1) {
|
||||
$buf =~ m/\G([^\xfe\xff]*+)(?:\xfe[^\xfe\xff]++)*\xff/sg;
|
||||
utf8::decode(my $str = $1);
|
||||
$unicode[$i] = [map ord, split //, $str];
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
die "Bad format\n";
|
||||
}
|
||||
|
||||
|
||||
print "STARTFONT 2.1\n";
|
||||
printf "FONT %s\n", '-psf-';
|
||||
printf "SIZE %u 72 72\n", $height;
|
||||
printf "FONTBOUNDINGBOX %u %u 0 0\n", $width, $height;
|
||||
|
||||
printf "STARTPROPERTIES %u\n", 6 + 2 * !!@unicode;
|
||||
printf "PIXEL_SIZE %u\n", $height;
|
||||
printf "POINT_SIZE %u\n", 10 * $height;
|
||||
printf "FONT_ASCENT %u\n", $height;
|
||||
print "FONT_DESCENT 0\n";
|
||||
print "RESOLUTION_X 72\n";
|
||||
print "RESOLUTION_Y 72\n";
|
||||
if (@unicode) {
|
||||
print "CHARSET_REGISTRY \"ISO10646\"\n";
|
||||
print "CHARSET_ENCODING \"1\"\n";
|
||||
}
|
||||
print "ENDPROPERTIES\n";
|
||||
|
||||
printf "CHARS %u\n", $length;
|
||||
|
||||
for my $i (0 .. $length - 1) {
|
||||
printf "STARTCHAR psf%03x\n", $i;
|
||||
if (@unicode && @{$unicode[$i]}) {
|
||||
printf "ENCODING %u\n", $unicode[$i][0];
|
||||
}
|
||||
else {
|
||||
printf "ENCODING -1 %u\n", $i;
|
||||
}
|
||||
printf "SWIDTH %u 0\n", $width * 1000 / $height;
|
||||
printf "DWIDTH %u 0\n", $width;
|
||||
printf "BBX %u %u 0 0\n", $width, $height;
|
||||
my $bw = (($width + 7) & ~7) >> 3;
|
||||
printf "BITMAP\n%s\n", join "\n", map unpack('H*', $_), unpack "(a$bw)*", $glyphs[$i];
|
||||
printf "ENDCHAR\n";
|
||||
}
|
||||
|
||||
print "ENDFONT\n";
|
||||
|
||||
};
|
||||
warn "$fn: $@" if $@;
|
||||
last;
|
||||
}
|
74
xterm-console
Normal file
74
xterm-console
Normal file
@ -0,0 +1,74 @@
|
||||
#!/usr/bin/python3
|
||||
# Copyright (C) 2015 Susanne Oberhauser-Hirschoff <froh@suse.de>
|
||||
# The MIT License applies (http://opensource.org/licenses/MIT)
|
||||
|
||||
"""start an xterm that looks like a linux console
|
||||
|
||||
|
||||
# do this once, to let the xserver know about the fonts
|
||||
xset fp+ $(pwd)
|
||||
|
||||
# for each font you want to try...
|
||||
gunzip -c /usr/share/kbd/consolefonts/lat9w-16.psfu.gz | perl psf2bdf.pl > lat9w-16.bdf
|
||||
|
||||
sed -i -e s,-psf-,lat9w_16, lat9w-16.bdf
|
||||
|
||||
# update the fonts.dir file
|
||||
mkfontdir
|
||||
# notify X about the new font
|
||||
xset fp rehash
|
||||
|
||||
# have a look :)
|
||||
# start an xterm with the right colors and all, script is attached [3]
|
||||
python3 xterm_linux_vt.py
|
||||
|
||||
"""
|
||||
|
||||
# from pprint import pprint as pp
|
||||
default_kernel_vt_colors = {}
|
||||
RGB = ("red", "grn", "blu")
|
||||
for cname in RGB:
|
||||
with open("/sys/module/vt/parameters/default_{}".format(cname)) as f:
|
||||
colors = f.read().rstrip().split(',')
|
||||
default_kernel_vt_colors[cname] = map(int, colors)
|
||||
|
||||
xterm_colors= list()
|
||||
|
||||
for r, g, b in zip(*(default_kernel_vt_colors[c] for c in RGB)):
|
||||
xterm_colors.append("rgb:{r:02x}/{g:02x}/{b:02x}".format(**locals()))
|
||||
|
||||
def xtc(label, color):
|
||||
return ("-xrm", "xterm*{label}: {color}".format(**locals()))
|
||||
|
||||
def xrm_color_options():
|
||||
yield(xtc("foreground", xterm_colors[7]))
|
||||
yield(xtc("background", xterm_colors[0]))
|
||||
for i, c in enumerate(xterm_colors):
|
||||
yield(xtc("color{}".format(i), c))
|
||||
|
||||
from itertools import chain
|
||||
|
||||
import os
|
||||
|
||||
xx = [
|
||||
"xterm",
|
||||
# console font
|
||||
"-fn", "lat9w-16",
|
||||
"-fullscreen",
|
||||
# no scrollbar
|
||||
"+sb",
|
||||
# no border
|
||||
"-b", "0",
|
||||
# blinking underline cursor
|
||||
"-bc", "-uc", "-bcf", "200", "-bcn", "200",
|
||||
# intense colors for bold
|
||||
"+bdc",
|
||||
# intense for bold...
|
||||
"-xrm", "xterm*boldMode: false",
|
||||
]
|
||||
|
||||
import sys # for argv
|
||||
sys.argv.pop(0) # strip command name
|
||||
xx.extend(chain(*xrm_color_options()))
|
||||
xx.extend(sys.argv)
|
||||
os.execvp("xterm", xx)
|
19
xterm-console.changes
Normal file
19
xterm-console.changes
Normal file
@ -0,0 +1,19 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 25 13:21:00 UTC 2018 - slindomansilla@suse.com
|
||||
|
||||
- Use supplemments to os-autoinst
|
||||
|
||||
When using svirt backend (s390x, XEN), xterm-console is needed.
|
||||
It is expected the use of this backend only on special cases,
|
||||
so this package is not added as required. But it may help to
|
||||
mark it as supplement os os-autoinst.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Apr 29 08:55:11 UTC 2015 - coolo@suse.com
|
||||
|
||||
- remove nonexistant +itc option
|
||||
|
||||
-------------------------------------------------------------------
|
||||
* Mon Apr 27 2015 - froh@suse.de
|
||||
|
||||
- initial version
|
92
xterm-console.spec
Normal file
92
xterm-console.spec
Normal file
@ -0,0 +1,92 @@
|
||||
#
|
||||
# spec file for package xterm
|
||||
#
|
||||
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%define vttest_version 20120506
|
||||
%define splitbin 0%{?suse_version} >= 1300
|
||||
Name: xterm-console
|
||||
Version: 1.0
|
||||
Release: 0
|
||||
Summary: A Linux vt console look-alike xterm wrapper
|
||||
License: MIT
|
||||
Group: System/X11/Utilities
|
||||
Url: https://build.opensuse.org/package/show/home:froh/xterm-console
|
||||
Source: xterm-console
|
||||
Source1: psf2bdf.pl
|
||||
|
||||
# svirt, eg. s390x, xen
|
||||
Supplements: os-autoinst
|
||||
|
||||
#BuildRequires: perl
|
||||
# the original consolefonts:
|
||||
BuildRequires: kbd
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: fontpackages-devel
|
||||
BuildRequires: bdftopcf
|
||||
Requires: fonts-config
|
||||
%{reconfigure_fonts_prereq}
|
||||
|
||||
%description
|
||||
This package contains the basic X.Org terminal program.
|
||||
|
||||
%prep
|
||||
|
||||
%setup -c -T
|
||||
cp %SOURCE1 .
|
||||
%build
|
||||
# suse 10.x uses older X11 directory structure
|
||||
%if 0%{?suse_version} < 1100
|
||||
%define xappdefs %{_prefix}/X11R6/lib/X11/app-defaults
|
||||
%define xfontsd %{_prefix}/X11R6/lib/X11/fonts
|
||||
%else
|
||||
%define xappdefs %{_datadir}/X11/app-defaults
|
||||
%define xfontsd %{_datadir}/fonts
|
||||
%endif
|
||||
|
||||
|
||||
if ! which bdftopcf &> /dev/null; then exit 1; fi
|
||||
|
||||
chmod +x ./psf2bdf.pl
|
||||
for font in /usr/share/kbd/consolefonts/*.psfu.gz
|
||||
do
|
||||
fontname="${font##*/}"
|
||||
fontname="${fontname%.psfu.gz}"
|
||||
gunzip -c $font | ./psf2bdf.pl | sed -e "s,FONT \+-psf-,FONT ${fontname}," > "$fontname".bdf
|
||||
done
|
||||
|
||||
for i in *.bdf
|
||||
do
|
||||
bdftopcf "$i" | gzip -9 >"${i%.bdf}.pcf.gz"
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
mkdir -p %{buildroot}%{_prefix}/bin
|
||||
install -m 755 %SOURCE0 %{buildroot}%{_prefix}/bin
|
||||
|
||||
mkdir -p %{buildroot}%{xfontsd}/misc/
|
||||
install -m 644 *.pcf.gz %{buildroot}%{xfontsd}/misc/
|
||||
|
||||
%{reconfigure_fonts_scriptlets}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/xterm-console
|
||||
%dir %{xfontsd}/misc
|
||||
%{xfontsd}/misc/*.pcf.gz
|
||||
|
||||
%changelog
|
Loading…
Reference in New Issue
Block a user