summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.mk5
-rw-r--r--nvi2/Makefile4
-rw-r--r--nvi2/nvi2.patch23
3 files changed, 31 insertions, 1 deletions
diff --git a/build.mk b/build.mk
index 41b85d9..45b5fea 100644
--- a/build.mk
+++ b/build.mk
@@ -2,7 +2,6 @@
#
# TODO:
# - rules for pre-req dependencies
-# - rules to build patches from .orig
# - rules to run tests before installing
# - build and run in chroot
# - detect inflate command
@@ -42,6 +41,9 @@ debug:
@echo arc = $(arc)
@echo dir = $(dir)
+genpatch:
+ find $(dir) -name *.orig | while read -r f; do diff -u $$f $${f%.orig}; done > $(dir).patch || true
+
uninstall: .install
cd $(dir) && $(uninstall_cmd)
rm .install
@@ -76,3 +78,4 @@ fetch: .fetch
.fetch:
$(fetch_cmd)
@touch $@
+
diff --git a/nvi2/Makefile b/nvi2/Makefile
new file mode 100644
index 0000000..4d3ebfa
--- /dev/null
+++ b/nvi2/Makefile
@@ -0,0 +1,4 @@
+git_url = git@github.com:lichray/nvi2
+configure_cmd = cmake .
+
+include ../build.mk
diff --git a/nvi2/nvi2.patch b/nvi2/nvi2.patch
new file mode 100644
index 0000000..b872b62
--- /dev/null
+++ b/nvi2/nvi2.patch
@@ -0,0 +1,23 @@
+--- nvi2/CMakeLists.txt.orig 2025-09-12 23:00:29.164429638 +0200
++++ nvi2/CMakeLists.txt 2025-09-12 23:07:41.504027121 +0200
+@@ -219,18 +219,8 @@
+ if(NOT DBOPEN_IN_LIBC)
+ target_link_libraries(nvi PRIVATE db1)
+ endif()
+-if (APPLE)
+- # Avoid using an incompatible db.h installed to /usr/local (since this is
+- # part of the default search path on macOS)
+- set(DB_H_GUESS "${CMAKE_OSX_SYSROOT}/usr/include/db.h")
+- if (NOT EXISTS ${DB_H_GUESS})
+- message(FATAL_ERROR "Could not find db.h at the expected path (${DB_H_GUESS}).")
+- endif()
+- add_definitions("-DDB_H_ABS_PATH=<${DB_H_GUESS}>")
+-else()
+- find_path(DB_INCLUDE_DIR db.h PATH_SUFFIXES db1)
+- target_include_directories(nvi PRIVATE ${DB_INCLUDE_DIR})
+-endif()
++find_path(DB_INCLUDE_DIR db.h PATH_SUFFIXES db1)
++target_include_directories(nvi PRIVATE ${DB_INCLUDE_DIR})
+
+ check_include_files(libutil.h HAVE_LIBUTIL_H)
+ check_include_files(ncurses.h HAVE_NCURSES_H)