summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/0001-Replace-makefile-by-meson-build-system.patch92
-rw-r--r--debian/patches/series1
2 files changed, 93 insertions, 0 deletions
diff --git a/debian/patches/0001-Replace-makefile-by-meson-build-system.patch b/debian/patches/0001-Replace-makefile-by-meson-build-system.patch
new file mode 100644
index 0000000..b7861df
--- /dev/null
+++ b/debian/patches/0001-Replace-makefile-by-meson-build-system.patch
@@ -0,0 +1,92 @@
+From ee134d214144c0932b555db87f72d19664487bd8 Mon Sep 17 00:00:00 2001
+From: Olivier Gayot <olivier.gayot@sigexec.com>
+Date: Mon, 15 May 2023 00:34:05 +0200
+Subject: [PATCH] Replace makefile by meson build system
+
+This is ok for debian packaging but does not run the build-time test
+suite.
+
+Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
+---
+ makefile | 41 -----------------------------------------
+ meson.build | 20 ++++++++++++++++++++
+ 2 files changed, 20 insertions(+), 41 deletions(-)
+ delete mode 100644 makefile
+ create mode 100644 meson.build
+
+diff --git a/makefile b/makefile
+deleted file mode 100644
+index 0ca9ee1..0000000
+--- a/makefile
++++ /dev/null
+@@ -1,41 +0,0 @@
+-NAME = sample
+-CC = gcc
+-FLAGS = -std=c99 -pedantic -g
+-FLAGS+= -Wall -Wno-unused-parameter -Wextra -Werror=vla -Werror
+-VALGRIND = --show-leak-kinds=all --track-origins=yes --leak-check=full
+-
+-BIND = bin
+-OBJD = obj
+-SRCD = src
+-RESD = res
+-
+-INCL = -I$(SRCD)
+-
+-SRCS = $(SRCD)/example.c
+-SRCS+= $(SRCD)/configator.c
+-
+-OBJS:= $(patsubst $(SRCD)/%.c,$(OBJD)/$(SRCD)/%.o,$(SRCS))
+-
+-.PHONY: all
+-all: $(BIND)/$(NAME) run
+-
+-$(OBJD)/%.o: %.c
+- @echo "building object $@"
+- @mkdir -p $(@D)
+- @$(CC) $(INCL) $(FLAGS) -c -o $@ $<
+-
+-$(BIND)/$(NAME): $(OBJS)
+- @echo "compiling executable $@"
+- @mkdir -p $(@D)
+- @$(CC) -o $@ $^ $(LINK)
+- @cp $(RESD)/test.ini $(BIND)/config.ini
+-
+-run:
+- @cd $(BIND) && ./$(NAME)
+-
+-leakgrind: $(BIND)/$(NAME)
+- @cd $(BIND) && valgrind $(VALGRIND) 2> ../valgrind.log ./$(NAME)
+-
+-clean:
+- @echo "cleaning"
+- @rm -rf $(BIND) $(OBJD) valgrind.log
+diff --git a/meson.build b/meson.build
+new file mode 100644
+index 0000000..1153b55
+--- /dev/null
++++ b/meson.build
+@@ -0,0 +1,20 @@
++project('libconfigator', 'c')
++
++src_libconfigator = [
++ 'src/configator.c',
++]
++
++pkgconfig = import('pkgconfig')
++
++lib_libconfigator = library('configator', src_libconfigator,
++ version: '0.0.1',
++ install: true)
++
++install_headers('src/configator.h')
++
++pkgconfig.generate(
++ filebase: 'libconfigator',
++ name: 'LibConfigator',
++ description: 'Lightweight library for ini config file parsing',
++ version: meson.project_version(),
++ libraries: lib_libconfigator)
+--
+2.39.2
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..c9d13de
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Replace-makefile-by-meson-build-system.patch