Merge branch 'main' of git.snaile.de:snailed/st-custom

This commit is contained in:
Luca Bilke 2024-05-18 23:50:39 +02:00
commit 351d62e8ba
No known key found for this signature in database
GPG Key ID: C9E851809C1A5BDE
12 changed files with 90 additions and 75 deletions

View File

@ -3,15 +3,13 @@ name: Build/Publish XBPS
on:
push:
paths-ignore:
- ".forgejo**"
- ".renovaterc.json"
- "build.sh"
paths:
- "config**"
jobs:
build-and-publish:
runs-on: docker
container: git.snaile.de/snailed/xbps-builder:2024.0418.1149
container: git.snaile.de/snailed/xbps-builder:2024.0511.2201@sha256:0ca263f8a97fbd29f88349e731153f60569d19ddd7320f2c7c80047a35260c9b
env:
LICENSE: "GPL-2.0"
SHORT_DESCRIPTION: "Customized st"
@ -36,20 +34,13 @@ jobs:
- name: Build
run: |
set -xeu
cp -f config.mk Makefile patches.h st-flexipatch/
flexipatch-finalizer/flexipatch-finalizer.sh -r -d st-flexipatch -o st-final
for patch in patches/*.diff; do
patch -d st-final <"$patch"
done
cp -f config.h st-final/
cd st-final && make clean install DESTDIR="${GITHUB_WORKSPACE}/pkg" PREFIX="/usr"
make clean install DESTDIR="${GITHUB_WORKSPACE}/pkg" PREFIX="/usr"
- name: Create package
run: |
set -xeu
export XBPS_TARGET_ARCH=${{ env.ARCH }}
mkdir /target
cd /target || exit 1
mkdir /target && cd /target || exit 1
xbps-create -A ${{ env.ARCH }} \
-H "${{ github.server_url }}/${{ github.repository }}" \
-l "${{ env.LICENSE }}" \

View File

@ -17,7 +17,7 @@ jobs:
RENOVATE_GIT_AUTHOR: "Johnny5 <bot@snaile.de>"
steps:
- uses: https://code.forgejo.org/actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: https://code.forgejo.org/actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Renovate
run: renovate ${{ github.repository }}

24
.gitignore vendored
View File

@ -1,3 +1,27 @@
st-final
pkg
*.xbps
patch
FAQ
LEGACY
LICENSE
README
TODO
arg.h
config.def.h
config.h
config.mk
hb.c
hb.h
sixel.c
sixel.h
sixel_hls.c
sixel_hls.h
st.1
st.c
st.desktop
st.h
st.info
win.h
x.c
terminfo/s

View File

@ -1,5 +1,7 @@
# st - simple terminal
# See LICENSE file for copyright and license details.
.PHONY: all clean install uninstall
.POSIX:
include config.mk
@ -7,52 +9,67 @@ include config.mk
SRC = st.c x.c $(LIGATURES_C) $(SIXEL_C)
OBJ = $(SRC:.c=.o)
all: st
all: st terminfo
# TODO: Update command to update submodules
clean:
find . -maxdepth 1 -type f | grep -Pv "^\./\.|Makefile$$" | xargs -r rm
rm -r tmp patch terminfo 2>/dev/null || true
git -C st-flexipatch reset --hard HEAD
git -C st-flexipatch clean -fdx
buildroot:
cp config/patches.h st-flexipatch/patches.h
flexipatch-finalizer/flexipatch-finalizer.sh -r -d st-flexipatch -o tmp
rm -r tmp/Makefile
mv tmp/* ./
for patch in config/patches/*.diff; do patch <"$$patch"; done
config.mk:
cp config/config.mk ./config.mk
config.h:
cp config.def.h config.h
patches.h:
cp patches.def.h patches.h
cp config/config.h ./config.h
*.c: buildroot
*.h: buildroot
.c.o:
$(CC) $(STCFLAGS) -c $<
st.o: config.h st.h win.h
x.o: arg.h config.h st.h win.h $(LIGATURES_H)
st.o: buildroot config.h st.h win.h
x.o: buildroot arg.h config.h st.h win.h $(LIGATURES_H)
$(OBJ): config.h config.mk patches.h
$(OBJ): config.h config.mk buildroot
st: $(OBJ)
st: buildroot $(OBJ)
$(CC) -o $@ $(OBJ) $(STLDFLAGS)
clean:
rm -f st $(OBJ) st-$(VERSION).tar.gz
terminfo: buildroot
tic -sx -o terminfo st.info
dist: clean
mkdir -p st-$(VERSION)
cp -R FAQ LEGACY TODO LICENSE Makefile README config.mk\
config.def.h st.info st.1 arg.h st.h win.h $(LIGATURES_H) $(SRC)\
st-$(VERSION)
tar -cf - st-$(VERSION) | gzip > st-$(VERSION).tar.gz
rm -rf st-$(VERSION)
install: st
install: st terminfo
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp -f st $(DESTDIR)$(PREFIX)/bin
chmod 755 $(DESTDIR)$(PREFIX)/bin/st
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
mkdir -p $(DESTDIR)$(PREFIX)/share/terminfo
tic -sx -o $(DESTDIR)$(PREFIX)/share/terminfo st.info
mkdir -p $(DESTDIR)$(PREFIX)/share/applications # desktop-entry patch
test -f ${DESTDIR}${PREFIX}/share/applications/st.desktop || cp -n st.desktop $(DESTDIR)$(PREFIX)/share/applications # desktop-entry patch
@echo Please see the README file regarding the terminfo entry of st.
mkdir -p $(DESTDIR)$(PREFIX)/share
cp -a terminfo $(DESTDIR)$(PREFIX)/share/terminfo
chmod 755 $(DESTDIR)$(PREFIX)/share/terminfo/s
chmod 644 $(DESTDIR)$(PREFIX)/share/terminfo/s/st-*
# mkdir -p $(DESTDIR)$(PREFIX)/share/applications # desktop-entry patch
# test -f ${DESTDIR}${PREFIX}/share/applications/st.desktop || cp -n st.desktop $(DESTDIR)$(PREFIX)/share/applications # desktop-entry patch
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/st
rm -f $(DESTDIR)$(MANPREFIX)/man1/st.1
rm -f $(DESTDIR)$(PREFIX)/share/applications/st.desktop # desktop-entry patch
.PHONY: all clean dist install uninstall
rm -f $(DESTDIR)$(PREFIX)/share/terminfo/s/st
rm -f $(DESTDIR)$(PREFIX)/share/terminfo/s/st-256color
rm -f $(DESTDIR)$(PREFIX)/share/terminfo/s/st-bs
rm -f $(DESTDIR)$(PREFIX)/share/terminfo/s/st-bs-256color
rm -f $(DESTDIR)$(PREFIX)/share/terminfo/s/st-meta
rm -f $(DESTDIR)$(PREFIX)/share/terminfo/s/st-meta-256color
rm -f $(DESTDIR)$(PREFIX)/share/terminfo/s/st-mono

View File

@ -1,15 +0,0 @@
#!/bin/sh
cp -f config.mk Makefile patches.h st-flexipatch/
flexipatch-finalizer/flexipatch-finalizer.sh -r -d st-flexipatch -o st-final
git -C st-flexipatch reset --hard HEAD && git -C st-flexipatch clean -fd
for patch in patches/*.diff; do
patch -d st-final <"$patch"
done
cp -f config.h st-final/
cd st-final || exit 1
if [ "$1" = "-i" ]; then
sudo make install
else
make
fi

View File

@ -153,31 +153,27 @@ static const char *colorname[] = {
[255] = 0,
/* more colors can be added after 255 to use with DefaultXX */
"#c0caf5", /* 256 -> default cursor colour */
"#1a1b26", /* 257 -> default inverted cursor colour */
"#c0caf5", /* 258 -> default foreground colour */
"#1a1b26", /* 259 -> default background colour */
"#c0caf5", /* 260 -> default selection foreground colour */
"#33467C", /* 261 -> default selection background colour */
"#1a1b26", /* 256 -> darker black */
"#283457", /* 257 -> selection background colour */
};
/*
* Default colors (colorname index)
* foreground, background, cursor, reverse cursor
*/
unsigned int defaultfg = 258;
unsigned int defaultbg = 259;
unsigned int defaultcs = 256;
unsigned int defaultrcs = 257;
unsigned int selectionfg = 260;
unsigned int selectionbg = 261;
unsigned int defaultfg = 15;
unsigned int defaultbg = 256;
unsigned int defaultcs = 15;
unsigned int defaultrcs = 256;
unsigned int selectionfg = 15;
unsigned int selectionbg = 257;
/* If 0 use selectionfg as foreground in order to have a uniform
* foreground-color */
/* Else if 1 keep original foreground-color of each cell => more colors :) */
static int ignoreselfg = 1;
/* Foreground and background color of search results */
unsigned int highlightfg = 3;
unsigned int highlightbg = 0;
unsigned int highlightfg = 256;
unsigned int highlightbg = 3;
/*
* https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Functions-using-CSI-_-ordered-by-the-final-character-lparen-s-rparen:CSI-Ps-SP-q.1D81
@ -255,8 +251,10 @@ static Shortcut shortcuts[] = {
{TERMMOD, XK_C, clipcopy, {.i = 0}},
{TERMMOD, XK_V, clippaste, {.i = 0}},
{TERMMOD, XK_Y, selpaste, {.i = 0}},
{TERMMOD, XK_K, kscrollup, {.i = 20}, S_PRI},
{TERMMOD, XK_J, kscrolldown, {.i = 20}, S_PRI},
{TERMMOD, XK_K, kscrollup, {.i = 1}, S_PRI},
{TERMMOD, XK_J, kscrolldown, {.i = 1}, S_PRI},
{TERMMOD, XK_U, kscrollup, {.i = 20}, S_PRI},
{TERMMOD, XK_D, kscrolldown, {.i = 20}, S_PRI},
{TERMMOD, XK_Num_Lock, numlock, {.i = 0}},
{TERMMOD, XK_Escape, keyboard_select, {0}},
{TERMMOD, XK_F, searchforward, {0}},

@ -1 +1 @@
Subproject commit 118e965d0c8bd9c29b5e6bcba3ffcc1dd41064a7
Subproject commit aa5957495d315a2aca2a846a48ba9f7557353ec5