From dd5aea75bc2a0297ebf06b6591d5ffeacdd84910 Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Sun, 9 Jan 2022 02:00:37 +0900 Subject: [PATCH] no-more-secrets: Build both with and without ncurses --- packages/no-more-secrets/Makefile.patch | 21 +++++++++++++++------ packages/no-more-secrets/build.sh | 8 +++++--- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/packages/no-more-secrets/Makefile.patch b/packages/no-more-secrets/Makefile.patch index b2902e76f..63d873b58 100644 --- a/packages/no-more-secrets/Makefile.patch +++ b/packages/no-more-secrets/Makefile.patch @@ -1,23 +1,32 @@ --- a/Makefile +++ b/Makefile -@@ -14,6 +14,7 @@ - +@@ -15,23 +15,25 @@ CC ?= gcc CFLAGS ?= -Wextra -Wall -O2 -+LDFLAGS ?= -lncursesw ++NCURSES_LIBS ?= -lncursesw ++ .PHONY: all install uninstall clean -@@ -28,10 +29,10 @@ + nms: $(OBJ)/input.o $(OBJ)/error.o $(OBJ)/nmscharset.o $(OBJ)/nmstermio.o $(OBJ)/nmseffect.o $(OBJ)/nms.o | $(BIN) +- $(CC) $(CFLAGS) -o $(BIN)/$@ $^ ++ $(CC) $(CFLAGS) -o $(BIN)/$@ $^ $(LDFLAGS) + + sneakers: $(OBJ)/nmscharset.o $(OBJ)/nmstermio.o $(OBJ)/nmseffect.o $(OBJ)/sneakers.o | $(BIN) +- $(CC) $(CFLAGS) -o $(BIN)/$@ $^ ++ $(CC) $(CFLAGS) -o $(BIN)/$@ $^ $(LDFLAGS) + + all: nms sneakers + all-ncurses: nms-ncurses sneakers-ncurses nms-ncurses: $(OBJ)/input.o $(OBJ)/error.o $(OBJ)/nmscharset.o $(OBJ)/nmstermio_ncurses.o $(OBJ)/nmseffect.o $(OBJ)/nms.o | $(BIN) - $(CC) $(CFLAGS) -o $(BIN)/nms $^ -lncursesw -+ $(CC) $(CFLAGS) -o $(BIN)/nms $^ $(LDFLAGS) ++ $(CC) $(CFLAGS) $(NCURSES_CFLAGS) -o $(BIN)/nms-ncurses $^ $(LDFLAGS) $(NCURSES_LIBS) sneakers-ncurses: $(OBJ)/nmscharset.o $(OBJ)/nmstermio_ncurses.o $(OBJ)/nmseffect.o $(OBJ)/sneakers.o | $(BIN) - $(CC) $(CFLAGS) -o $(BIN)/sneakers $^ -lncursesw -+ $(CC) $(CFLAGS) -o $(BIN)/sneakers $^ $(LDFLAGS) ++ $(CC) $(CFLAGS) $(NCURSES_CFLAGS) -o $(BIN)/sneakers-ncurses $^ $(LDFLAGS) $(NCURSES_LIBS) $(OBJ)/%.o: $(SRC)/%.c | $(OBJ) $(CC) $(CFLAGS) -o $@ -c $< diff --git a/packages/no-more-secrets/build.sh b/packages/no-more-secrets/build.sh index b0284e4d6..bf13d9f6d 100644 --- a/packages/no-more-secrets/build.sh +++ b/packages/no-more-secrets/build.sh @@ -3,13 +3,15 @@ TERMUX_PKG_DESCRIPTION="This project provides a command line tool called nms tha TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION=1.0.1 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/bartobri/no-more-secrets/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=4422e59bb3cf62bca3c73d1fdae771b83aab686cd044f73fe14b1b9c2af1cb1b TERMUX_PKG_DEPENDS="libandroid-support, ncurses" TERMUX_PKG_BUILD_IN_SRC=true -TERMUX_PKG_EXTRA_MAKE_ARGS="all-ncurses" +TERMUX_PKG_EXTRA_MAKE_ARGS="all all-ncurses" termux_step_pre_configure() { - CFLAGS+=" $(pkg-config --cflags ncurses)" - LDFLAGS+=" $(pkg-config --libs ncurses)" + CFLAGS+=" $CPPFLAGS" + export NCURSES_CFLAGS="$(pkg-config --cflags ncurses)" + export NCURSES_LIBS="$(pkg-config --libs ncurses)" }