10 Commits

Author SHA1 Message Date
klemek 9426f4267b margen v1.2.4 2025-08-20 09:14:19 +00:00
klemek bb82ae6458 feat: Github CI (#12)
* feat: Github CI

* add verbose to gcc

* reorder jobs

* add extra warnings and small fix
2025-08-20 11:10:08 +02:00
klemek 70c2f02b0b update release guide 2025-08-20 08:42:08 +00:00
klemek 6670ed0167 margen v1.2.3 2025-08-20 08:31:13 +00:00
klemek 101c5b6de6 faster compilation 2025-08-20 08:28:23 +00:00
klemek f1ba3b32dc update arch sha256 and release tools 2025-07-03 12:30:02 +02:00
klemek 01e2e5376b margen v1.2.2 2025-07-03 12:14:01 +02:00
klemek 2a749714e5 fix seed parsing and help text 2025-07-03 12:12:50 +02:00
klemek 259860e998 PKGBUILD 2025-06-06 00:00:18 +02:00
klemek 7b9ab384f1 new gif 2025-06-05 17:54:45 +02:00
9 changed files with 105 additions and 9 deletions
+33
View File
@@ -0,0 +1,33 @@
name: C-lang CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: gcc
run: mkdir -p build && gcc -v -Wall -Wextra -Werror src/*.c src/*.h -lm
build-release:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: aclocal
run: aclocal
- name: autoconf
run: autoconf
- name: automake
run: automake --add-missing
- name: configure
run: ./configure
- name: make
run: make
- name: make distcheck
run: make distcheck
+6 -1
View File
@@ -7,6 +7,8 @@ build
Makefile
*.log
*.o
*.h.gch
*.out
.dirstamp
aclocal.m4
compile
@@ -18,4 +20,7 @@ configure~
config.status
margen
*.tar.gz
configure
configure
src/margen*
*.pkg.tar.zst
pkg
+1
View File
@@ -1,4 +1,5 @@
AUTOMAKE_OPTIONS = foreign subdir-objects -Wall
bin_PROGRAMS = margen
margen_SOURCES = src/main.c src/args.c src/bmp.c src/generator.c src/rand.c
margen_CFLAGS = -Ofast -march=native -flto -funroll-loops -fprefetch-loop-arrays -fno-exceptions -fopenmp
include_HEADERS = src/main.h src/args.h src/bmp.h src/generator.h src/rand.h src/config.h src/types.h
+7 -1
View File
@@ -9,7 +9,7 @@ clean:
build:
@mkdir -p build
gcc -Wall src/*.c src/*.h -lm -o build/$(TARGET)
gcc -v -Wall -Wextra src/*.c src/*.h -lm -o build/$(TARGET)
.PHONY: install
install: build
@@ -31,6 +31,12 @@ release:
./configure
make distcheck
.PHONY: release-arch
release-arch: clean
mkdir -p build
cp PKGBUILD build
cd build && makepkg
.PHONY: gif
gif: build
mkdir -p tmp
+20
View File
@@ -0,0 +1,20 @@
pkgname=margen
pkgver=1.2.4
pkgrel=1
pkgdesc="Generate a marble-like pattern bitmap image, blazing fast."
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64' 'riscv64')
url="https://github.com/klemek/margen"
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/klemek/margen/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('38fc6a66be97f6f77f9dffdbf75c214c7aa3ee8d1600b28506e943e6bfb93870')
srcdir=build
build() {
cd "$srcdir/$pkgname-$pkgver"
./configure --prefix=/usr
make
}
package() {
cd "$srcdir/$pkgname-$pkgver"
sudo make DESTDIR="$pkgdir" install
}
+34 -3
View File
@@ -14,7 +14,7 @@ Written in pure C without librairies.
See [Releases](https://github.com/klemek/margen/releases)
```bash
```sh
tar xvzf margen-x.y.z.tar.gz
cd margen-x.y.z
./configure
@@ -22,9 +22,18 @@ make
make install
```
### From repository (PKGBUILD)
```sh
git clone https://github.com/klemek/margen
cd margen
makepkg -si
```
### From repository (dev version)
```bash
```sh
git clone https://github.com/klemek/margen
cd margen
aclocal
@@ -48,7 +57,7 @@ options:
-w, --width image width (default: 1920)
-h, --height image height (default: 1080)
-o, --output output file (default: output.bmp)
-seed random seed (default: time based)
--seed random seed (default: time based)
-p, --pixel pixel size (default: random)
-s, --slope slope [0-255] (default: random)
-c, --color base color [0-255,0-255,0-255] (default: random)
@@ -57,3 +66,25 @@ options:
-r, --rotation start corner rotation [0-3] (default: random)
-m, --monochrome grayscale generation
```
## Release guide
```bash
# get latest version
git pull origin master
# update configure.ac with new version
$EDITOR configure.ac
# make full build
make -f Makefile.dev release
# update PKGBUILD with new version and sha256 sum
sha256sum margen-x.y.z.tar.gz
$EDITOR PKGBUILD
# push to repo
git commit -am "margen vX.Y.Z"
git tag vX.Y.Z
git push origin master --tags
# create release from tag on github
# attach .tar.gz to the github release
make -f Makefile.dev release-arch
# attach .pkg.tar.zst to the github release
```
+1 -1
View File
@@ -1,4 +1,4 @@
AC_INIT([margen], [1.2.1], [klemek.dev@proton.me])
AC_INIT([margen], [1.2.4], [klemek.dev@proton.me])
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_CHECK_HEADERS([stdio.h])
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 MiB

After

Width:  |  Height:  |  Size: 8.1 MiB

+3 -3
View File
@@ -32,7 +32,7 @@ void print_help(int status_code) {
" -w, --width image width (default: 1920)\n"
" -h, --height image height (default: 1080)\n"
" -o, --output output file (default: output.bmp)\n"
" -seed random seed (default: time based)\n"
" --seed random seed (default: time based)\n"
" -p, --pixel pixel size (default: random)\n"
" -s, --slope slope [0-255] (default: random)\n"
" -c, --color base color [0-255,0-255,0-255] (default: random)\n"
@@ -68,7 +68,7 @@ bool is_number(char *value) {
return false;
}
unsigned long value_len = strlen(value);
int i;
unsigned int i;
for (i = 0; i < value_len; i++) {
if (!is_digit(value[i])) {
return false;
@@ -99,7 +99,7 @@ unsigned short parse_ushort(char *arg, char *value) {
return (unsigned short)tmp_value;
}
unsigned short parse_ulong(char *arg, char *value) {
unsigned long parse_ulong(char *arg, char *value) {
if (!is_number(value)) {
invalid_value(arg, value);
}