Compare commits
10 Commits
c06dc77bb9
...
b45fe16764
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b45fe16764 | ||
|
|
77f485e64d | ||
|
|
ada09060b6 | ||
|
|
e8713f1773 | ||
|
|
7477f0ec55 | ||
|
|
d27069175d | ||
|
|
f972174165 | ||
|
|
a62437dcf6 | ||
|
|
66c4e43f83 | ||
|
|
07dd1559e4 |
4
Makefile
4
Makefile
@@ -1,4 +1,6 @@
|
||||
# VARIABLES
|
||||
USER= `git config --get user.name`
|
||||
MAIL= `git config --get user.email`
|
||||
ARCH=x86_64-musl
|
||||
CACHEDIR = ${XDG_CACHE_HOME}/xbps-make
|
||||
BUILDDIR = ${XDG_RUNTIME_DIR}/xbps-make
|
||||
@@ -32,6 +34,8 @@ ${CACHEDIR}/${package}.src: ${CACHEDIR}
|
||||
${CACHEDIR}/${package}.xbps: ${CACHEDIR} ${BUILDDIR}/root
|
||||
xbps-create \
|
||||
-A ${ARCH} \
|
||||
-B xbps-make_0 \
|
||||
-m "${USER} <${MAIL}>" \
|
||||
-n ${package}-${pkgver} \
|
||||
-s "${description}" \
|
||||
-C "${conflicts}" \
|
||||
|
||||
38
README
38
README
@@ -1,38 +0,0 @@
|
||||
xbps-make: xbps Makefiles repository
|
||||
====================================
|
||||
This is a repository of posix Makefiles used to build diferent xbps
|
||||
packages with one simple generic command and minimum dependecies.
|
||||
Easy to hack if you don't use xbps, or any other dependecie.
|
||||
|
||||
Usage:
|
||||
$ make devel/tcc.src (download source)
|
||||
$ make devel/tcc.xbps (build and make package)
|
||||
|
||||
Options:
|
||||
MAN=no (Do not install manuals)
|
||||
POSIX=no (Do not install complice)
|
||||
BUILDDIR=path (compile .src on path)
|
||||
CACHEDIR=path (save .src on path)
|
||||
XBPSDIR=path (save .xbps on path)
|
||||
|
||||
Dependecies:
|
||||
* xbps
|
||||
* make
|
||||
* tar
|
||||
* gzip
|
||||
_ curl
|
||||
_ git
|
||||
_ sha256
|
||||
_ sed
|
||||
_ find
|
||||
_ xargs
|
||||
|
||||
Warning:
|
||||
* This proyect it's used with bmake, other posix make programs
|
||||
haven't been tested, but it should work, feel free to adapt it
|
||||
if needed.
|
||||
* GNU make doesn't work because the "include" command work
|
||||
diferent than posix make "include" command.
|
||||
|
||||
Licence:
|
||||
0BSD - Zero Clause BSD Licence
|
||||
40
README.md
Normal file
40
README.md
Normal file
@@ -0,0 +1,40 @@
|
||||
# xbps-make: Minimal Package Builder for XBPS
|
||||
A lightweight, POSIX-compliant Makefile wrapper to automate building packages
|
||||
for the XBPS package manager (used in Void Linux). Designed for developers who
|
||||
want a simple, scriptable interface to streamline package builds without
|
||||
complex tooling.
|
||||
|
||||
## Features
|
||||
- Minimal dependecies (coreutils, xbps, bmake, git, curl, sed, tar, gzip)
|
||||
- Declarative build system
|
||||
- Hackable for other package managments
|
||||
- Rebuilds only when necessary
|
||||
|
||||
## Usage
|
||||
```sh
|
||||
bmake devel/tcc.src # download source
|
||||
bmake devel/tcc.xbps # build and make package
|
||||
bmake clean # clean build directory if failed
|
||||
```
|
||||
|
||||
## Options
|
||||
You can customize behavior with these environment variables:
|
||||
|
||||
Variable|Description
|
||||
--------|------------
|
||||
MAN=no|Skip installinkg man pages
|
||||
POSIX=no|Skip installing POSIX-compilant options
|
||||
BUILDDIR=path|Set custom path to compile `.src` files
|
||||
CACHEDIR=path|Set custom cache directory fo `.src` files
|
||||
XBPSDIR=path|Set custom path to output directory for `.xbps` packages
|
||||
|
||||
## Warning
|
||||
- This project is built with `bmake` (NetBSD make). Other POSIX-compliant make tools should work, but haven't been tested.
|
||||
- *GNU Make is not supported* — its include syntax is incompatible with POSIX make.
|
||||
|
||||
## Licence
|
||||
0BSD – Zero Clause BSD License. See [LICENSE](./LICENSE) for details.
|
||||
Feel free to use, modify, and share freely — no restrictions.
|
||||
|
||||
## Contributing
|
||||
Contributions are welcome! Feel free to submit issues or pull requests.
|
||||
@@ -1,10 +1,12 @@
|
||||
package=nldev
|
||||
version=662ba24641d02fd93e6a5e43041805ce2bee9328
|
||||
version=0.4
|
||||
pkgver=${version}_0
|
||||
description=netlink device manager
|
||||
homepage=http://r-36.net/scm/nldev/log.html
|
||||
homepage=http://r-36.net/scm/${package}/log.html
|
||||
license=MIT/X Consorium License
|
||||
|
||||
shlib-requires=libc.so
|
||||
|
||||
SOURCES = \
|
||||
${package}
|
||||
|
||||
@@ -14,14 +16,15 @@ FILES = \
|
||||
include ../../Makefile
|
||||
|
||||
${package}:
|
||||
export url=git://r-36.net pkg=$@ commit=${version} && ${GITCLONE}
|
||||
${SHA256D} "c33daf0cf87c57940b16dce3727cea86432a1a48021212bccd5a6e5324ac0a2e"
|
||||
export url=git://r-36.net pkg=$@ commit=v${version} && ${GITCLONE}
|
||||
${SHA256D} "08a4bdcfe118857afa868c197f0488b0c9c4104f3425ed79bd19c3999c2a1723"
|
||||
|
||||
prepare: ${SOURCES}
|
||||
mv ${package} build
|
||||
mv -f files/config.h build/
|
||||
: > config.mk
|
||||
|
||||
root:
|
||||
${MAKE}
|
||||
${MAKE} LDFLAGS=
|
||||
install -Dm 755 nldev "${root}/usr/bin/nldev"
|
||||
install -Dm 644 nldev.8 "${root}/usr/share/man/man8/nldev.8"
|
||||
|
||||
@@ -2,7 +2,7 @@ package=oksh
|
||||
version=7.1
|
||||
pkgver=${version}_0
|
||||
description=Portable OpenBSD ksh
|
||||
homepage=http://github.com/ibara/oksh
|
||||
homepage=http://github.com/ibara/${package}
|
||||
license=BSD-3-Clause
|
||||
|
||||
alternatives=sh:/usr/bin/sh:oksh
|
||||
@@ -14,7 +14,7 @@ SOURCES = \
|
||||
${package}-${version}.tar.gz
|
||||
|
||||
${package}-${version}.tar.gz:
|
||||
${DOWNLOAD} https://github.com/ibara/oksh/archive/$@
|
||||
${DOWNLOAD} ${homepage}/archive/$@
|
||||
${SHA256} "244ac5fed6e22b5cb0e817e9825f8fe755d5d648ed925940e77a3725f5b763a4"
|
||||
|
||||
prepare: ${SOURCES}
|
||||
|
||||
@@ -2,7 +2,7 @@ package=sdhcp
|
||||
version=8455fd2d090bd9b227340c30c92c6aa13302c91a
|
||||
pkgver=${version}_0
|
||||
description=Suckless dhcp client
|
||||
homepage=http://git.2f30.org/sdhcp
|
||||
homepage=http://git.2f30.org/${package}
|
||||
license=MIT/X Consortium License
|
||||
|
||||
shlib-requires=libc.so
|
||||
|
||||
@@ -2,7 +2,7 @@ package=smdev
|
||||
version=0.2.3
|
||||
pkgver=${version}_0
|
||||
description=suckless mdev
|
||||
homepage=http://git.suckless.org/smdev
|
||||
homepage=http://git.suckless.org/${package}
|
||||
license=MIT/X Consortium License
|
||||
|
||||
shlib-requires=libc.so
|
||||
|
||||
46
core/wsupp-libc.d/Makefile
Normal file
46
core/wsupp-libc.d/Makefile
Normal file
@@ -0,0 +1,46 @@
|
||||
package=wsupp-libc
|
||||
version=ba3de6001c02304fa9da7af886958bc13a3760b8
|
||||
pkgver=${version}_0
|
||||
description=wpa supplicant from minibase ported to standard libc
|
||||
homepage=https://github.com/arsv/${package}
|
||||
license=GPL-3.0 license
|
||||
|
||||
shlib-requires=libc.so
|
||||
|
||||
include ../../Makefile
|
||||
|
||||
SOURCES = \
|
||||
${version}.tar.gz
|
||||
|
||||
FILES = \
|
||||
files/Makefile \
|
||||
files/common.mk \
|
||||
files/crypto.mk \
|
||||
files/nlusctl.mk \
|
||||
files/netlink.mk
|
||||
|
||||
${version}.tar.gz:
|
||||
${DOWNLOAD} ${homepage}/archive/$@
|
||||
${SHA256} "260d50874378509a0a67245f3765ffbfe515c8a2b61fe3171104aa887c62d71c"
|
||||
|
||||
prepare: ${SOURCES}
|
||||
tar -zxf ${version}.tar.gz
|
||||
mv ${package}-${version} build
|
||||
mv files/Makefile build
|
||||
mv files/common.mk build/common/Makefile
|
||||
mv files/crypto.mk build/crypto/Makefile
|
||||
mv files/nlusctl.mk build/nlusctl/Makefile
|
||||
mv files/netlink.mk build/netlink/Makefile
|
||||
|
||||
sed "s/\"dhcp/\"\/bin\/sdhcp/g" build/wsupp_ifmon.c > _
|
||||
mv _ build/wsupp_ifmon.c
|
||||
|
||||
sed "s/ctrl\///" build/control.h > _
|
||||
mv _ build/control.h
|
||||
|
||||
|
||||
root:
|
||||
${MAKE}
|
||||
install -Dm 755 wifi "${root}/usr/bin/wifi"
|
||||
install -Dm 755 wsupp "${root}/usr/bin/wsupp"
|
||||
|
||||
38
core/wsupp-libc.d/files/Makefile
Normal file
38
core/wsupp-libc.d/files/Makefile
Normal file
@@ -0,0 +1,38 @@
|
||||
all: libs wsupp wifi
|
||||
|
||||
libs: common.a crypto.a nlusctl.a netlink.a
|
||||
|
||||
WSUPP_OBJ= \
|
||||
wsupp.o wsupp_netlink.o wsupp_eapol.o wsupp_crypto.o wsupp_cntrl.o \
|
||||
wsupp_slots.o wsupp_sta_ies.o wsupp_config.o wsupp_apsel.o \
|
||||
wsupp_rfkill.o wsupp_ifmon.o \
|
||||
common.a crypto.a nlusctl.a netlink.a
|
||||
|
||||
WIFI_OBJ= \
|
||||
wifi.o wifi_dump.o wifi_pass.o wifi_wire.o \
|
||||
common.a crypto.a nlusctl.a
|
||||
|
||||
wsupp: $(WSUPP_OBJ)
|
||||
$(CC) $(LDFLAGS) -o $@ $(WSUPP_OBJ)
|
||||
|
||||
wifi: $(WIFI_OBJ)
|
||||
$(CC) $(LDFLAGS) -o $@ $(WIFI_OBJ)
|
||||
|
||||
common.a:
|
||||
$(MAKE) -C common
|
||||
$(AR) cr $@ common/*.o
|
||||
|
||||
crypto.a:
|
||||
$(MAKE) -C crypto
|
||||
$(AR) cr $@ crypto/*.o
|
||||
|
||||
nlusctl.a:
|
||||
$(MAKE) -C nlusctl
|
||||
$(AR) cr $@ nlusctl/*.o
|
||||
|
||||
netlink.a:
|
||||
$(MAKE) -C netlink
|
||||
$(AR) cr $@ netlink/*.o
|
||||
|
||||
clean:
|
||||
rm -f *.a *.o */*.o
|
||||
10
core/wsupp-libc.d/files/common.mk
Normal file
10
core/wsupp-libc.d/files/common.mk
Normal file
@@ -0,0 +1,10 @@
|
||||
OBJ = \
|
||||
fail.o \
|
||||
memzero.o \
|
||||
nonzero.o \
|
||||
writeall.o
|
||||
|
||||
all: $(OBJ)
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
13
core/wsupp-libc.d/files/crypto.mk
Normal file
13
core/wsupp-libc.d/files/crypto.mk
Normal file
@@ -0,0 +1,13 @@
|
||||
OBJ = \
|
||||
aes128.o \
|
||||
aes128_unwrap.o \
|
||||
aes128_wrap.o \
|
||||
pbkdf2_sha1.o \
|
||||
sha1.o \
|
||||
sha1_hash.o \
|
||||
sha1_hmac.o
|
||||
|
||||
all: $(OBJ)
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
23
core/wsupp-libc.d/files/netlink.mk
Normal file
23
core/wsupp-libc.d/files/netlink.mk
Normal file
@@ -0,0 +1,23 @@
|
||||
OBJ = \
|
||||
attr_bin.o \
|
||||
attr_buf.o \
|
||||
attr_gen.o \
|
||||
attr_nst.o \
|
||||
attr_str.o \
|
||||
attr_sub.o \
|
||||
base_err.o \
|
||||
base_gen.o \
|
||||
ctx.o \
|
||||
ctx_cmd.o \
|
||||
ctx_gen.o \
|
||||
ctx_grp.o \
|
||||
genl_fam.o \
|
||||
genl_grp.o \
|
||||
pack.o \
|
||||
pack_str.o \
|
||||
pack_sub.o
|
||||
|
||||
all: $(OBJ)
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
12
core/wsupp-libc.d/files/nlusctl.mk
Normal file
12
core/wsupp-libc.d/files/nlusctl.mk
Normal file
@@ -0,0 +1,12 @@
|
||||
OBJ= \
|
||||
get.o \
|
||||
get_base.o \
|
||||
get_nest.o \
|
||||
put.o \
|
||||
recv.o \
|
||||
recv_msg.o
|
||||
|
||||
all: $(OBJ)
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
@@ -2,9 +2,8 @@ version=79a8229fb5da15135ac0c54c2c696a8da8988b24
|
||||
package=tcc
|
||||
pkgver=${version}_0
|
||||
description=Tiny C compiler
|
||||
homepage=
|
||||
homepage=https://repo.or.cz/w/tinycc.git
|
||||
license=LGPL-2.1
|
||||
|
||||
alternatives=cc:/usr/bin/cc:tcc
|
||||
shlib-requires=libc.so
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ version=16
|
||||
package=neatvi
|
||||
pkgver=${version}_0
|
||||
description=A small vi/ex editor editing bidirectional UTF-8 text
|
||||
homepage=https://github.com/aligrudi/neatvi
|
||||
homepage=https://github.com/aligrudi/${package}
|
||||
license=ISC
|
||||
replaces=nvi
|
||||
|
||||
|
||||
@@ -10,15 +10,19 @@ static struct filetype {
|
||||
char *sec;
|
||||
} filetypes[] = {
|
||||
{"sh", "\\.sh$"}, // shell script
|
||||
{"odin", "\\.odin$"}, // odin
|
||||
{"go", "\\.go$"}, // go
|
||||
{"zig", "\\.zig$"}, // zig
|
||||
{"c", "\\.(h|c)$"}, // C
|
||||
{"roff", "\\.(t|aux|[1-9]|bib)$|tmac\\."}, // troff
|
||||
{"roff", "\\.(ms|t|aux|[1-9]|bib)$|tmac\\."}, // troff
|
||||
{"tex", "\\.tex$"}, // latex
|
||||
{"msg", "(mutt|COMMIT)"}, // email
|
||||
{"mk", "\\.(d|mk)$|[Mm]akefile$"}, // makefile
|
||||
{"diff", "\\.(patch|diff)$"} // diff
|
||||
};
|
||||
|
||||
#define COMMENT 7 | SYN_IT
|
||||
#define STRING 9 | SYN_IT
|
||||
#define COMMENT 7 //| SYN_IT
|
||||
#define STRING 9 //| SYN_IT
|
||||
#define KEYWORD 4
|
||||
#define OTHER 3
|
||||
|
||||
@@ -39,13 +43,39 @@ static struct highlight {
|
||||
{"c", {OTHER}, "[-+]?\\<(0[xX][0-9a-fA-F]+|0[bB][0-1]+|[0-9]+)\\>"},
|
||||
{"c", {OTHER}, "'\\\\?.'" },
|
||||
|
||||
// go code
|
||||
{"go", {COMMENT}, "//.*$"},
|
||||
{"go", {STRING}, "\"[^\"]*\""},
|
||||
{"go", {OTHER}, "[-+]?\\<(0[xX][0-9a-fA-F]+|0[bB][0-1]+|[0-9]+)\\>"},
|
||||
{"go", {KEYWORD}, "\\<(func|package|import|if|return|switch|var|nil)\\>"},
|
||||
{"go", {KEYWORD}, "\\<(type|struct|case|default|defer)\\>"},
|
||||
{"go", {KEYWORD}, "\\<(string|byte|uint)\\>"},
|
||||
|
||||
// odin
|
||||
{"odin", {COMMENT}, "//.*$"},
|
||||
{"odin", {STRING}, "\"[^\"]*\""},
|
||||
{"odin", {KEYWORD}, "\\<(return|for|in|struct|if|else|when|switch|break|do)\\>"},
|
||||
{"odin", {KEYWORD}, "\\<(proc|cast|transmute|package|import|defer)\\>"},
|
||||
{"odin", {KEYWORD}, "\\<(struct|string|union|dinstinct|typeid|any|rawptr|cstring|rune)\\>"},
|
||||
{"odin", {OTHER}, "[-+]?\\<(0[xX][0-9a-fA-F]+|0[bB][0-1]+|[0-9]+)\\>"},
|
||||
{"odin", {OTHER}, "[ui]\\<(8|16|32|64|128)//>"},
|
||||
{"odin", {OTHER}, "[f]\\<(16|32|64)//>"},
|
||||
//{"odin", {KEYWORD}, "\\<(quaternions\\<(64|128|256)\\>|complex\\<(32|64|228)\\>)\\>"},
|
||||
|
||||
// roff
|
||||
{"roff", {SYN_BD | KEYWORD}, "^[%.][ \t]*[^ \t$]+" },
|
||||
{"roff", {SYN_BD | KEYWORD}, "^[ \t]*\\.[^ \t$]+" },
|
||||
{"roff", {OTHER}, "\\$[^$]+\\$"},
|
||||
{"roff", {STRING}, "\\\\[\\]?[AbBCDhHlLNRsSvwxXZ]'[^']+'"},
|
||||
{"roff", {OTHER}, "\\\\[\\]?[\\*fFgkmMnsVY]?[+-]?(\\[[^\\]+\\]|\\(..)"},
|
||||
{"roff", {OTHER}, "\\\\[\\]?([a-zA-Z]+|\\$.)"},
|
||||
|
||||
{"tex", {COMMENT}, "%.*$" },
|
||||
{"tex", {SYN_BD | KEYWORD}, "\\\\[a-zA_Z]+" },
|
||||
{"tex", {SYN_BD | KEYWORD}, "\\\\." },
|
||||
{"tex", {OTHER}, "\\{[^}]+\\}"},
|
||||
{"tex", {OTHER}, "\\\\[[^\\]]+\\\\]"},
|
||||
{"tex", {STRING}, "\\$[^$]+\\$"},
|
||||
|
||||
// mail
|
||||
{"msg", {COMMENT}, "#.*$" },
|
||||
{"msg", {SYN_BD}, "^.+:"},
|
||||
@@ -53,9 +83,9 @@ static struct highlight {
|
||||
|
||||
// makefile
|
||||
{"mk", {COMMENT}, "#.*$"},
|
||||
{"mk", {KEYWORD}, "^[^\t]+[^\t ]*="},
|
||||
{"mk", {SYN_BD}, "^[^\t]+:"},
|
||||
{"mk", {KEYWORD}, "^[^\t][^=]+="},
|
||||
{"mk", {OTHER}, "\\$[\\{\\(][^ \t\\}\\)]+[\\}\\)]"},
|
||||
{"mk", {SYN_BD}, "^[^\t][^:]+:"},
|
||||
{"mk", {OTHER}, "\\$."},
|
||||
|
||||
// diff
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
version=0.9.2
|
||||
package=st
|
||||
pkgver=${version}_0
|
||||
description=st is a simple terminal implementation for X
|
||||
homepage=https://git.suckless.org/st
|
||||
description=st is a simple terminal implementation for Wayland
|
||||
homepage=https://git.suckless.org/${package}
|
||||
license=MIT/X Consortium License
|
||||
|
||||
shlib-requires=libc.so libXft.so.2
|
||||
@@ -14,14 +14,14 @@ SOURCES = \
|
||||
${package}
|
||||
|
||||
FILES = \
|
||||
files/config.h
|
||||
files/config.h \
|
||||
|
||||
${package}:
|
||||
export url="git://git.suckless.org" pkg=${package} commit=${version} && ${GITCLONE}
|
||||
$(SHA256D) "b734416dd95db2e5bc029f25c28a62e28b7b4f22558488e215f7477a0f092899"
|
||||
#$(SHA256D) "161bbf218209d4278ab3d4124b42c3aeee7abe928ee5dc3771075f1bafd3ac76"
|
||||
|
||||
prepare: ${SOURCES}
|
||||
mv ${package} build/
|
||||
mv st build/
|
||||
mv -f files/config.h build
|
||||
|
||||
root:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
static char *font = "Source code pro:pixelsize=24:antialias=true:autohint=true";
|
||||
static char *font = "Source Code Pro, Source Code Pro Italics:pixelsize=24";
|
||||
static int borderpx = 10;
|
||||
|
||||
static char *shell = "/bin/sh";
|
||||
@@ -104,7 +104,7 @@ static unsigned int defaultattr = 11;
|
||||
* Note that if you want to use ShiftMask with selmasks, set this to an other
|
||||
* modifier, set to 0 to not use it.
|
||||
*/
|
||||
static uint forcemousemod = ShiftMask;
|
||||
static uint forcemousemod = 0;//ShiftMask;
|
||||
|
||||
/*
|
||||
* Internal mouse shortcuts.
|
||||
|
||||
351
extra/st.d/files/st-scrollback-0.9.2.diff
Normal file
351
extra/st.d/files/st-scrollback-0.9.2.diff
Normal file
@@ -0,0 +1,351 @@
|
||||
diff --git a/config.def.h b/config.def.h
|
||||
index 2cd740a..40b7d93 100644
|
||||
--- a/config.def.h
|
||||
+++ b/config.def.h
|
||||
@@ -201,6 +201,8 @@ static Shortcut shortcuts[] = {
|
||||
{ TERMMOD, XK_Y, selpaste, {.i = 0} },
|
||||
{ ShiftMask, XK_Insert, selpaste, {.i = 0} },
|
||||
{ TERMMOD, XK_Num_Lock, numlock, {.i = 0} },
|
||||
+ { ShiftMask, XK_Page_Up, kscrollup, {.i = -1} },
|
||||
+ { ShiftMask, XK_Page_Down, kscrolldown, {.i = -1} },
|
||||
};
|
||||
|
||||
/*
|
||||
diff --git a/st.c b/st.c
|
||||
index b9f66e7..2478942 100644
|
||||
--- a/st.c
|
||||
+++ b/st.c
|
||||
@@ -35,6 +35,7 @@
|
||||
#define ESC_ARG_SIZ 16
|
||||
#define STR_BUF_SIZ ESC_BUF_SIZ
|
||||
#define STR_ARG_SIZ ESC_ARG_SIZ
|
||||
+#define HISTSIZE 2000
|
||||
|
||||
/* macros */
|
||||
#define IS_SET(flag) ((term.mode & (flag)) != 0)
|
||||
@@ -42,6 +43,9 @@
|
||||
#define ISCONTROLC1(c) (BETWEEN(c, 0x80, 0x9f))
|
||||
#define ISCONTROL(c) (ISCONTROLC0(c) || ISCONTROLC1(c))
|
||||
#define ISDELIM(u) (u && wcschr(worddelimiters, u))
|
||||
+#define TLINE(y) ((y) < term.scr ? term.hist[((y) + term.histi - \
|
||||
+ term.scr + HISTSIZE + 1) % HISTSIZE] : \
|
||||
+ term.line[(y) - term.scr])
|
||||
|
||||
enum term_mode {
|
||||
MODE_WRAP = 1 << 0,
|
||||
@@ -115,6 +119,9 @@ typedef struct {
|
||||
int col; /* nb col */
|
||||
Line *line; /* screen */
|
||||
Line *alt; /* alternate screen */
|
||||
+ Line hist[HISTSIZE]; /* history buffer */
|
||||
+ int histi; /* history index */
|
||||
+ int scr; /* scroll back */
|
||||
int *dirty; /* dirtyness of lines */
|
||||
TCursor c; /* cursor */
|
||||
int ocx; /* old cursor col */
|
||||
@@ -185,8 +192,8 @@ static void tnewline(int);
|
||||
static void tputtab(int);
|
||||
static void tputc(Rune);
|
||||
static void treset(void);
|
||||
-static void tscrollup(int, int);
|
||||
-static void tscrolldown(int, int);
|
||||
+static void tscrollup(int, int, int);
|
||||
+static void tscrolldown(int, int, int);
|
||||
static void tsetattr(const int *, int);
|
||||
static void tsetchar(Rune, const Glyph *, int, int);
|
||||
static void tsetdirt(int, int);
|
||||
@@ -409,10 +416,10 @@ tlinelen(int y)
|
||||
{
|
||||
int i = term.col;
|
||||
|
||||
- if (term.line[y][i - 1].mode & ATTR_WRAP)
|
||||
+ if (TLINE(y)[i - 1].mode & ATTR_WRAP)
|
||||
return i;
|
||||
|
||||
- while (i > 0 && term.line[y][i - 1].u == ' ')
|
||||
+ while (i > 0 && TLINE(y)[i - 1].u == ' ')
|
||||
--i;
|
||||
|
||||
return i;
|
||||
@@ -521,7 +528,7 @@ selsnap(int *x, int *y, int direction)
|
||||
* Snap around if the word wraps around at the end or
|
||||
* beginning of a line.
|
||||
*/
|
||||
- prevgp = &term.line[*y][*x];
|
||||
+ prevgp = &TLINE(*y)[*x];
|
||||
prevdelim = ISDELIM(prevgp->u);
|
||||
for (;;) {
|
||||
newx = *x + direction;
|
||||
@@ -536,14 +543,14 @@ selsnap(int *x, int *y, int direction)
|
||||
yt = *y, xt = *x;
|
||||
else
|
||||
yt = newy, xt = newx;
|
||||
- if (!(term.line[yt][xt].mode & ATTR_WRAP))
|
||||
+ if (!(TLINE(yt)[xt].mode & ATTR_WRAP))
|
||||
break;
|
||||
}
|
||||
|
||||
if (newx >= tlinelen(newy))
|
||||
break;
|
||||
|
||||
- gp = &term.line[newy][newx];
|
||||
+ gp = &TLINE(newy)[newx];
|
||||
delim = ISDELIM(gp->u);
|
||||
if (!(gp->mode & ATTR_WDUMMY) && (delim != prevdelim
|
||||
|| (delim && gp->u != prevgp->u)))
|
||||
@@ -564,14 +571,14 @@ selsnap(int *x, int *y, int direction)
|
||||
*x = (direction < 0) ? 0 : term.col - 1;
|
||||
if (direction < 0) {
|
||||
for (; *y > 0; *y += direction) {
|
||||
- if (!(term.line[*y-1][term.col-1].mode
|
||||
+ if (!(TLINE(*y-1)[term.col-1].mode
|
||||
& ATTR_WRAP)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (direction > 0) {
|
||||
for (; *y < term.row-1; *y += direction) {
|
||||
- if (!(term.line[*y][term.col-1].mode
|
||||
+ if (!(TLINE(*y)[term.col-1].mode
|
||||
& ATTR_WRAP)) {
|
||||
break;
|
||||
}
|
||||
@@ -602,13 +609,13 @@ getsel(void)
|
||||
}
|
||||
|
||||
if (sel.type == SEL_RECTANGULAR) {
|
||||
- gp = &term.line[y][sel.nb.x];
|
||||
+ gp = &TLINE(y)[sel.nb.x];
|
||||
lastx = sel.ne.x;
|
||||
} else {
|
||||
- gp = &term.line[y][sel.nb.y == y ? sel.nb.x : 0];
|
||||
+ gp = &TLINE(y)[sel.nb.y == y ? sel.nb.x : 0];
|
||||
lastx = (sel.ne.y == y) ? sel.ne.x : term.col-1;
|
||||
}
|
||||
- last = &term.line[y][MIN(lastx, linelen-1)];
|
||||
+ last = &TLINE(y)[MIN(lastx, linelen-1)];
|
||||
while (last >= gp && last->u == ' ')
|
||||
--last;
|
||||
|
||||
@@ -844,6 +851,9 @@ void
|
||||
ttywrite(const char *s, size_t n, int may_echo)
|
||||
{
|
||||
const char *next;
|
||||
+ Arg arg = (Arg) { .i = term.scr };
|
||||
+
|
||||
+ kscrolldown(&arg);
|
||||
|
||||
if (may_echo && IS_SET(MODE_ECHO))
|
||||
twrite(s, n, 1);
|
||||
@@ -1055,13 +1065,53 @@ tswapscreen(void)
|
||||
}
|
||||
|
||||
void
|
||||
-tscrolldown(int orig, int n)
|
||||
+kscrolldown(const Arg* a)
|
||||
+{
|
||||
+ int n = a->i;
|
||||
+
|
||||
+ if (n < 0)
|
||||
+ n = term.row + n;
|
||||
+
|
||||
+ if (n > term.scr)
|
||||
+ n = term.scr;
|
||||
+
|
||||
+ if (term.scr > 0) {
|
||||
+ term.scr -= n;
|
||||
+ selscroll(0, -n);
|
||||
+ tfulldirt();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+kscrollup(const Arg* a)
|
||||
+{
|
||||
+ int n = a->i;
|
||||
+
|
||||
+ if (n < 0)
|
||||
+ n = term.row + n;
|
||||
+
|
||||
+ if (term.scr <= HISTSIZE-n) {
|
||||
+ term.scr += n;
|
||||
+ selscroll(0, n);
|
||||
+ tfulldirt();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+tscrolldown(int orig, int n, int copyhist)
|
||||
{
|
||||
int i;
|
||||
Line temp;
|
||||
|
||||
LIMIT(n, 0, term.bot-orig+1);
|
||||
|
||||
+ if (copyhist) {
|
||||
+ term.histi = (term.histi - 1 + HISTSIZE) % HISTSIZE;
|
||||
+ temp = term.hist[term.histi];
|
||||
+ term.hist[term.histi] = term.line[term.bot];
|
||||
+ term.line[term.bot] = temp;
|
||||
+ }
|
||||
+
|
||||
tsetdirt(orig, term.bot-n);
|
||||
tclearregion(0, term.bot-n+1, term.col-1, term.bot);
|
||||
|
||||
@@ -1071,17 +1121,28 @@ tscrolldown(int orig, int n)
|
||||
term.line[i-n] = temp;
|
||||
}
|
||||
|
||||
- selscroll(orig, n);
|
||||
+ if (term.scr == 0)
|
||||
+ selscroll(orig, n);
|
||||
}
|
||||
|
||||
void
|
||||
-tscrollup(int orig, int n)
|
||||
+tscrollup(int orig, int n, int copyhist)
|
||||
{
|
||||
int i;
|
||||
Line temp;
|
||||
|
||||
LIMIT(n, 0, term.bot-orig+1);
|
||||
|
||||
+ if (copyhist) {
|
||||
+ term.histi = (term.histi + 1) % HISTSIZE;
|
||||
+ temp = term.hist[term.histi];
|
||||
+ term.hist[term.histi] = term.line[orig];
|
||||
+ term.line[orig] = temp;
|
||||
+ }
|
||||
+
|
||||
+ if (term.scr > 0 && term.scr < HISTSIZE)
|
||||
+ term.scr = MIN(term.scr + n, HISTSIZE-1);
|
||||
+
|
||||
tclearregion(0, orig, term.col-1, orig+n-1);
|
||||
tsetdirt(orig+n, term.bot);
|
||||
|
||||
@@ -1091,7 +1152,8 @@ tscrollup(int orig, int n)
|
||||
term.line[i+n] = temp;
|
||||
}
|
||||
|
||||
- selscroll(orig, -n);
|
||||
+ if (term.scr == 0)
|
||||
+ selscroll(orig, -n);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1120,7 +1182,7 @@ tnewline(int first_col)
|
||||
int y = term.c.y;
|
||||
|
||||
if (y == term.bot) {
|
||||
- tscrollup(term.top, 1);
|
||||
+ tscrollup(term.top, 1, 1);
|
||||
} else {
|
||||
y++;
|
||||
}
|
||||
@@ -1285,14 +1347,14 @@ void
|
||||
tinsertblankline(int n)
|
||||
{
|
||||
if (BETWEEN(term.c.y, term.top, term.bot))
|
||||
- tscrolldown(term.c.y, n);
|
||||
+ tscrolldown(term.c.y, n, 0);
|
||||
}
|
||||
|
||||
void
|
||||
tdeleteline(int n)
|
||||
{
|
||||
if (BETWEEN(term.c.y, term.top, term.bot))
|
||||
- tscrollup(term.c.y, n);
|
||||
+ tscrollup(term.c.y, n, 0);
|
||||
}
|
||||
|
||||
int32_t
|
||||
@@ -1730,11 +1792,11 @@ csihandle(void)
|
||||
case 'S': /* SU -- Scroll <n> line up */
|
||||
if (csiescseq.priv) break;
|
||||
DEFAULT(csiescseq.arg[0], 1);
|
||||
- tscrollup(term.top, csiescseq.arg[0]);
|
||||
+ tscrollup(term.top, csiescseq.arg[0], 0);
|
||||
break;
|
||||
case 'T': /* SD -- Scroll <n> line down */
|
||||
DEFAULT(csiescseq.arg[0], 1);
|
||||
- tscrolldown(term.top, csiescseq.arg[0]);
|
||||
+ tscrolldown(term.top, csiescseq.arg[0], 0);
|
||||
break;
|
||||
case 'L': /* IL -- Insert <n> blank lines */
|
||||
DEFAULT(csiescseq.arg[0], 1);
|
||||
@@ -2306,7 +2368,7 @@ eschandle(uchar ascii)
|
||||
return 0;
|
||||
case 'D': /* IND -- Linefeed */
|
||||
if (term.c.y == term.bot) {
|
||||
- tscrollup(term.top, 1);
|
||||
+ tscrollup(term.top, 1, 1);
|
||||
} else {
|
||||
tmoveto(term.c.x, term.c.y+1);
|
||||
}
|
||||
@@ -2319,7 +2381,7 @@ eschandle(uchar ascii)
|
||||
break;
|
||||
case 'M': /* RI -- Reverse index */
|
||||
if (term.c.y == term.top) {
|
||||
- tscrolldown(term.top, 1);
|
||||
+ tscrolldown(term.top, 1, 1);
|
||||
} else {
|
||||
tmoveto(term.c.x, term.c.y-1);
|
||||
}
|
||||
@@ -2542,7 +2604,7 @@ twrite(const char *buf, int buflen, int show_ctrl)
|
||||
void
|
||||
tresize(int col, int row)
|
||||
{
|
||||
- int i;
|
||||
+ int i, j;
|
||||
int minrow = MIN(row, term.row);
|
||||
int mincol = MIN(col, term.col);
|
||||
int *bp;
|
||||
@@ -2579,6 +2641,14 @@ tresize(int col, int row)
|
||||
term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty));
|
||||
term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs));
|
||||
|
||||
+ for (i = 0; i < HISTSIZE; i++) {
|
||||
+ term.hist[i] = xrealloc(term.hist[i], col * sizeof(Glyph));
|
||||
+ for (j = mincol; j < col; j++) {
|
||||
+ term.hist[i][j] = term.c.attr;
|
||||
+ term.hist[i][j].u = ' ';
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
/* resize each row to new width, zero-pad if needed */
|
||||
for (i = 0; i < minrow; i++) {
|
||||
term.line[i] = xrealloc(term.line[i], col * sizeof(Glyph));
|
||||
@@ -2637,7 +2707,7 @@ drawregion(int x1, int y1, int x2, int y2)
|
||||
continue;
|
||||
|
||||
term.dirty[y] = 0;
|
||||
- xdrawline(term.line[y], x1, y, x2);
|
||||
+ xdrawline(TLINE(y), x1, y, x2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2658,8 +2728,9 @@ draw(void)
|
||||
cx--;
|
||||
|
||||
drawregion(0, 0, term.col, term.row);
|
||||
- xdrawcursor(cx, term.c.y, term.line[term.c.y][cx],
|
||||
- term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
|
||||
+ if (term.scr == 0)
|
||||
+ xdrawcursor(cx, term.c.y, term.line[term.c.y][cx],
|
||||
+ term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
|
||||
term.ocx = cx;
|
||||
term.ocy = term.c.y;
|
||||
xfinishdraw();
|
||||
diff --git a/st.h b/st.h
|
||||
index fd3b0d8..818a6f8 100644
|
||||
--- a/st.h
|
||||
+++ b/st.h
|
||||
@@ -81,6 +81,8 @@ void die(const char *, ...);
|
||||
void redraw(void);
|
||||
void draw(void);
|
||||
|
||||
+void kscrolldown(const Arg *);
|
||||
+void kscrollup(const Arg *);
|
||||
void printscreen(const Arg *);
|
||||
void printsel(const Arg *);
|
||||
void sendbreak(const Arg *);
|
||||
@@ -2,7 +2,7 @@ version=2.29
|
||||
package=thttpd
|
||||
pkgver=${version}_0
|
||||
description=thttpd is a simple, small, portable, fast, and secure HTTP server.
|
||||
homepage=https://www.acme.com/software/thttpd
|
||||
homepage=https://www.acme.com/software/${package}
|
||||
license=BSD-2-Clause
|
||||
|
||||
shlib-requires=libc.so
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
version=1.0.3
|
||||
|
||||
package=libudev-zero
|
||||
pkgver=${version}_0
|
||||
description=Daemonless replacement for libudev
|
||||
conflicts=eudev-libudev
|
||||
homepage=
|
||||
homepage=https://github.com/illiliti/${package}
|
||||
license=ISC
|
||||
conflicts=eudev-libudev
|
||||
replaces=eudev-libudev
|
||||
|
||||
shlib-provides=libudev.so.1
|
||||
@@ -16,7 +15,7 @@ SOURCES = \
|
||||
${version}.tar.gz
|
||||
|
||||
${version}.tar.gz:
|
||||
${DOWNLOAD} https://github.com/illiliti/libudev-zero/archive/$@
|
||||
${DOWNLOAD} ${homepage}/archive/$@
|
||||
${SHA256} "0bd89b657d62d019598e6c7ed726ff8fed80e8ba092a83b484d66afb80b77da5"
|
||||
|
||||
prepare: ${SOURCES}
|
||||
|
||||
Reference in New Issue
Block a user