Compare commits

...

8 commits
v1.4 ... main

Author SHA1 Message Date
jaseg
1212a9cc6c Correct DESTDIR/PREFIX usage in Makefile
Closes #56
2024-07-16 11:43:44 +02:00
jaseg
621b604edd Add CPPFLAGS and LDFLAGS to compiler invocation
Fixes #57
2024-07-16 11:39:09 +02:00
jaseg
1ea54a14d5 Make images embedded in README use relative paths
Fixes #59
2024-07-16 11:36:46 +02:00
jaseg
e460e3d132 Add a little release script to keep the version numbers in sync
Fixes #58
2024-07-16 11:35:08 +02:00
jaseg
10b56bcdc2 Fix version number in autotools and PKGBUILD build scripts 2024-07-16 11:24:39 +02:00
Ellam ByDefault
bfd7446198 ignore lolcat and censor, add Debian dependency 2024-07-16 11:16:39 +02:00
jaseg
a9ab81839f Bump version to v1.5 2024-07-04 11:49:59 +02:00
jaseg
f2c26ed7a7 Make lolcat interleave nicely with non-colored stderr
This works by making lolcat always reset the color at the end of a line
on its input, and only setting a new color immediately before printing
the first character on the next line. This way, assuming that whatever
process is piped into lolcat follow the standard convention where stdout
is buffered line-wise, and only writes full lines to stderr, a process
that outputs to both stdout and stderr but that has only stdout piped
through lolcat (as most people would do) would have it's stderr output
interleave nicely uncolored with the lolcat-colored stdout output.

This won't always work, but it gets us most of the way there with little
effort and negligible (2 extra escape sequences per line of output)
performance overhead.

Thanks to github user @kolayne for reporting this as an issue!
2024-07-04 11:45:58 +02:00
7 changed files with 48 additions and 10 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
lolcat.o
censor.o
lolcat
censor

View file

@ -3,7 +3,7 @@ CC ?= gcc
CFLAGS ?= -std=c11 -Wall -Wextra -O3 -Wno-sign-compare
LIBS := -lm
DESTDIR ?= /usr/local/bin
PREFIX ?= /usr/local
all: lolcat censor
@ -16,14 +16,14 @@ xterm256lut.h: xterm256lut_gen.py
python $< > $@
lolcat: lolcat.c xterm256lut.h
$(CC) $(CFLAGS) -o $@ $< $(LIBS)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
censor: censor.c
$(CC) $(CFLAGS) -o $@ $< $(LIBS)
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
install: lolcat censor
install lolcat $(DESTDIR)/lolcat
install censor $(DESTDIR)/censor
install lolcat $(DESTDIR)$(PREFIX)/bin/lolcat
install censor $(DESTDIR)$(PREFIX)/bin/censor
clean:
rm -f lolcat censor

View file

@ -1,7 +1,7 @@
# Maintainer: Ricardo (XenGi) Band <email@ricardo.band>
pkgname=c-lolcat
pkgver=v1.3
pkgver=v1.5
pkgrel=1
pkgdesc="High-performance implementation of lolcat"
arch=('i686' 'x86_64')

View file

@ -1,10 +1,10 @@
# What?
![](https://raw.githubusercontent.com/jaseg/lolcat/master/LOLCat-Rainbow.jpg)
![](./LOLCat-Rainbow.jpg)
## Screenshot
![](https://raw.githubusercontent.com/jaseg/lolcat/master/screenshot.png)
![](./screenshot.png)
![](./sl.gif)
@ -44,6 +44,8 @@ $ make lolcat
### Others
Note: Debian users may need the `python-is-python3` package.
```bash
$ make && sudo make install
```

View file

@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([lolcat], [1.3], [jaseg <github@jaseg.de>])
AC_INIT([lolcat], [1.5], [jaseg <github@jaseg.de>])
AC_CONFIG_SRCDIR([../lolcat.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([autoscripts])

31
do_release.sh Executable file
View file

@ -0,0 +1,31 @@
#!/bin/sh
set -e
if [ $# -lt 1 ]; then
echo "do_release.sh must be called with a version number as its first argument."
exit 1
fi
if [ -n "$(git status --porcelain|grep -v '^??')" ]; then
echo "do_release.sh must be called from a clean working directory."
exit 2
fi
VER="$1"
if echo "$VER" | grep -v '^[0-9]\+\.[0-9]\+$'; then
echo "do_release.sh must be called with a version number formatted like "1.23" as its first argument, with no leading \"v\"."
exit 1
fi
echo "Updating files for version v$VER"
sed -i "/L\"lolcat version [0-9.]\+, (c) [0-9]\+ jaseg\\\\n\"/s/version [0-9.]\+/version $VER/" lolcat.c
sed -i "s/^pkgver=v[0-9.]\+/pkgver=v$VER/" PKGBUILD
sed -i "/^AC_INIT/s/\[[0-9.]\+\]/[$VER]/" autotools/configure.ac
git add lolcat.c PKGBUILD autotools/configure.ac
git commit -m 'Bump version to v$VER'
git tag "v$VER"
echo "Success."

View file

@ -180,7 +180,7 @@ static void usage(void)
static void version(void)
{
wprintf(L"lolcat version 1.4, (c) 2023 jaseg\n");
wprintf(L"lolcat version 1.5, (c) 2024 jaseg\n");
exit(0);
}
@ -390,8 +390,11 @@ int main(int argc, char** argv)
if (c == '\n') {
l++;
i = 0;
cc = -1;
if (invert) {
wprintf(L"\033[49m");
} else {
wprintf(L"\033[0m");
}
} else {