Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port build system to meson #6

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
result*
*.o
*.a
/*.exe

.dep**
.target.*
.lock.*
/build

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good news, even this single line is unnecessary: https://mesonbuild.com/FAQ.html#how-do-i-ignore-the-build-directory-in-my-vcs

:)


# directory used to store fonts for testing
/fonts
25 changes: 0 additions & 25 deletions Makefile

This file was deleted.

25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,35 @@ i. e. [openlab's flipdot display](https://wiki.openlab-augsburg.de/Flipdots).

requirements:

* [redo-c](https://github.com/leahneukirchen/redo-c)
* Optionally `make` for install script and such
* [meson](https://mesonbuild.com)
* [ninja](https://ninja-build.org/)
* [utf8proc](https://juliastrings.github.io/utf8proc)
* [harfbuzz](harfbuzz.github.io/)
* [harfbuzz](https://harfbuzz.github.io/)
* [libschrift](https://github.com/tomolt/libschrift) == 0.10.1

```
# run inside nix-shell if you have nix!

# static library
$ redo libbuchstabensuppe.a
$ meson build

# demo binary
$ redo bs-renderflipdot.exe
$ cd build

# tests
$ redo test.exe && ./test.exe
$ ninja
```

alternatively you can just run `nix-build`

## demo

if you want to play around with the font rendering in binary
mode you can use the dry run mode of the supplied `./bs-renderflipdot.exe`
(or `./result/bin/bs-renderflipdot` if you use nix) binary.
mode you can use the dry run mode of the `bs-renderflipdot`
(in `./result/bin` with Nix, `./build` with meson) binary.

Run `./bs-renderflipdot.exe -?` for usage instructions and don't forget `-n`
Run `bs-renderflipdot -?` for usage instructions and don't forget `-n`
for dry running!

```
$ ./bs-renderflipdot.exe -f fonts/unifont.ttf -f fonts/unifont_upper.ttf -n "Greetings ❣️" 2>/dev/null
$ bs-renderflipdot -f /path/to/unifont.ttf -f /path/to/unifont_upper.ttf -n "Greetings ❣️" 2>/dev/null

███ ███
█████████
Expand Down Expand Up @@ -112,7 +109,7 @@ See [bs-renderflipdot(1)](https://sternenseemann.github.io/buchstabensuppe/bs-re
for more usage details.

```
./bs-renderflipdot.exe -f /path/to/unifont.ttf -f /path/to/unifont_upper.ttf -i "Hello World"
bs-renderflipdot -f /path/to/unifont.ttf -f /path/to/unifont_upper.ttf -i "Hello World"
```

## caveats
Expand Down
2 changes: 1 addition & 1 deletion bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <stdlib.h>
#include <string.h>

#include <buchstabensuppe/bitmap.h>
#include <buchstabensuppe.h>

bool bs_bitmap_extend(bs_bitmap_t *b, int new_w, int new_h, unsigned char init) {
int diff_x = fmax(new_w - b->bs_bitmap_width, 0);
Expand Down
1 change: 0 additions & 1 deletion bs-renderflipdot.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <unistd.h>

#include <buchstabensuppe.h>
#include <buchstabensuppe/flipdot.h>

#define DEFAULT_FONT_SIZE 16
#define DEFAULT_FLIPDOT_WIDTH 80
Expand Down
7 changes: 0 additions & 7 deletions build_config

This file was deleted.

9 changes: 0 additions & 9 deletions default.exe.do

This file was deleted.

7 changes: 4 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ assert pkgs.lib.versionAtLeast pkgs.libschrift.version "0.10.1";
let
gi = pkgs.nix-gitignore;

buchstabensuppe = { stdenv, utf8proc, harfbuzz, libschrift, redo-c }:
buchstabensuppe = { stdenv, utf8proc, harfbuzz, libschrift, meson, ninja, pkg-config }:
stdenv.mkDerivation rec {
pname = "buchstabensuppe";
version = "unstable";
Expand All @@ -16,11 +16,12 @@ let
filter = gi.gitignoreFilter (builtins.readFile ./.gitignore) ./.;
};

makeFlags = [ "PREFIX=${placeholder "out"}" ];
nativeBuildInputs = [ meson ninja pkg-config ];

nativeBuildInputs = [ redo-c ];
buildInputs = [ utf8proc harfbuzz libschrift ];

outputs = [ "out" "lib" "dev" "man" ];

doCheck = true;
};
in
Expand Down
30 changes: 0 additions & 30 deletions default.o.do

This file was deleted.

2 changes: 1 addition & 1 deletion flipdot.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <errno.h>
#include <stdlib.h>

#include <buchstabensuppe/flipdot.h>
#include <buchstabensuppe.h>

bool bs_scroll_next_view(bs_view_t *view, int step, enum bs_dimension dim) {
if(step == 0) {
Expand Down
Loading
Loading