aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-04-06 17:35:22 +0530
committersinanmohd <sinan@sinanmohd.com>2024-04-06 17:46:55 +0530
commit4ff6158a6cd29e87222387870e6f01aca41b8183 (patch)
treeeedc21363355691d2bc48d942ebe1cac8db0685d
parent246fa34293969eed0ebd650944e52b46c677b054 (diff)
meson: init
-rw-r--r--.gitignore2
-rw-r--r--Makefile13
-rw-r--r--flake.nix2
-rw-r--r--include/gpg.h (renamed from gpg.h)0
-rw-r--r--include/libnpass.h (renamed from pass_util.h)0
-rw-r--r--include/util.h (renamed from util.h)0
-rw-r--r--libnpass/gpg.c (renamed from gpg.c)0
-rw-r--r--libnpass/libnpass.c (renamed from pass_util.c)2
-rw-r--r--libnpass/meson.build11
-rw-r--r--libnpass/util.c (renamed from util.c)0
-rw-r--r--meson.build16
-rw-r--r--npass/meson.build8
-rw-r--r--npass/npass.c (renamed from pass.c)2
13 files changed, 38 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 5fe4433..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.o
-pass
diff --git a/Makefile b/Makefile
deleted file mode 100644
index c636e6d..0000000
--- a/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-OBJECTS = pass.o pass_util.o util.o gpg.o
-CC = gcc
-CFLAGS = -g -Wvla -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Wpedantic -fsanitize=address
-
-pass: $(OBJECTS)
- $(CC) $(CFLAGS) -o pass $(OBJECTS) -l gpgme
-
-pass.o: pass_util.h util.h
-pass_util.o: util.h gpg.h
-
-.PHONY: clean
-clean:
- rm -f pass $(OBJECTS)
diff --git a/flake.nix b/flake.nix
index eb7c190..f025d16 100644
--- a/flake.nix
+++ b/flake.nix
@@ -17,7 +17,7 @@
default = pkgs.mkShell {
name = "dev";
- buildInputs = with pkgs; [ gpgme ];
+ buildInputs = with pkgs; [ gpgme meson ninja ];
shellHook = ''
[ -z "$XDG_DATA_HOME" ] &&
export XDG_DATA_HOME="$HOME/.local/share"
diff --git a/gpg.h b/include/gpg.h
index f5053bf..f5053bf 100644
--- a/gpg.h
+++ b/include/gpg.h
diff --git a/pass_util.h b/include/libnpass.h
index d4b7fb4..d4b7fb4 100644
--- a/pass_util.h
+++ b/include/libnpass.h
diff --git a/util.h b/include/util.h
index f36965a..f36965a 100644
--- a/util.h
+++ b/include/util.h
diff --git a/gpg.c b/libnpass/gpg.c
index 574a492..574a492 100644
--- a/gpg.c
+++ b/libnpass/gpg.c
diff --git a/pass_util.c b/libnpass/libnpass.c
index de8308a..72e51df 100644
--- a/pass_util.c
+++ b/libnpass/libnpass.c
@@ -8,7 +8,7 @@
#include <termios.h>
#include <stdio.h>
-#include "pass_util.h"
+#include "libnpass.h"
#include "util.h"
#include "gpg.h"
diff --git a/libnpass/meson.build b/libnpass/meson.build
new file mode 100644
index 0000000..1ce4621
--- /dev/null
+++ b/libnpass/meson.build
@@ -0,0 +1,11 @@
+lib_npass = static_library(
+ 'libnpass',
+ [
+ 'util.c',
+ 'gpg.c',
+ 'libnpass.c'
+ ],
+
+ dependencies: gpgme_dep,
+ include_directories: npass_inc,
+)
diff --git a/util.c b/libnpass/util.c
index 8e3a108..8e3a108 100644
--- a/util.c
+++ b/libnpass/util.c
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..a0c5988
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,16 @@
+project(
+ 'npass',
+ 'c',
+ version : '0.1',
+ license: 'GPL-3.0-only',
+ default_options : [
+ 'warning_level=3',
+ ]
+)
+
+gpgme_dep = dependency('gpgme', version: '>= 1.0')
+
+npass_inc = include_directories('include')
+
+subdir('libnpass')
+subdir('npass')
diff --git a/npass/meson.build b/npass/meson.build
new file mode 100644
index 0000000..2371298
--- /dev/null
+++ b/npass/meson.build
@@ -0,0 +1,8 @@
+executable(
+ 'pass',
+ 'npass.c',
+
+ include_directories: npass_inc,
+ link_with: lib_npass,
+ install: true,
+)
diff --git a/pass.c b/npass/npass.c
index 91a4817..8aacc14 100644
--- a/pass.c
+++ b/npass/npass.c
@@ -4,7 +4,7 @@
#include <stdlib.h>
#include <errno.h>
-#include "pass_util.h"
+#include "libnpass.h"
#include "util.h"
void print_usage(void);