From 748beddc9d6ba39f42ed9b58fdfdac9ffe0e543f Mon Sep 17 00:00:00 2001 From: YAKSH BARIYA Date: Fri, 4 Feb 2022 01:51:37 +0000 Subject: [PATCH] add package: scdoc (#8893) --- packages/scdoc/Makefile.patch | 60 +++++++++++++++++++++++++++++++++++ packages/scdoc/build.sh | 21 ++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 packages/scdoc/Makefile.patch create mode 100644 packages/scdoc/build.sh diff --git a/packages/scdoc/Makefile.patch b/packages/scdoc/Makefile.patch new file mode 100644 index 000000000..bad724803 --- /dev/null +++ b/packages/scdoc/Makefile.patch @@ -0,0 +1,60 @@ +--- ./Makefile.orig 2022-02-03 18:20:50.006850878 +0530 ++++ ./Makefile 2022-02-03 18:21:34.996850861 +0530 +@@ -1,14 +1,14 @@ + VERSION=1.11.2 + CFLAGS?=-g + MAINFLAGS:=-DVERSION='"$(VERSION)"' -Wall -Wextra -Werror -Wno-unused-parameter +-LDFLAGS+=-static ++LDFLAGS+= + INCLUDE+=-Iinclude + PREFIX?=/usr/local + BINDIR?=$(PREFIX)/bin + MANDIR?=$(PREFIX)/share/man + PCDIR?=$(PREFIX)/share/pkgconfig +-OUTDIR=.build +-HOST_SCDOC=./scdoc ++OUTDIR?=.build ++HOST_SCDOC?=$(OUTDIR)/scdoc + .DEFAULT_GOAL=all + + OBJECTS=\ +@@ -26,29 +26,29 @@ + @mkdir -p $(OUTDIR) + $(CC) -std=c99 -pedantic -c -o $@ $(CFLAGS) $(MAINFLAGS) $(INCLUDE) $< + +-scdoc: $(OBJECTS) ++$(OUTDIR)/scdoc: $(OBJECTS) + $(CC) $(LDFLAGS) -o $@ $^ + +-scdoc.1: scdoc.1.scd $(HOST_SCDOC) ++$(OUTDIR)/scdoc.1: scdoc.1.scd $(HOST_SCDOC) + $(HOST_SCDOC) < $< > $@ + +-scdoc.5: scdoc.5.scd $(HOST_SCDOC) ++$(OUTDIR)/scdoc.5: scdoc.5.scd $(HOST_SCDOC) + $(HOST_SCDOC) < $< > $@ + +-scdoc.pc: scdoc.pc.in ++$(OUTDIR)/scdoc.pc: scdoc.pc.in + sed -e 's:@prefix@:$(PREFIX):g' -e 's:@version@:$(VERSION):g' < $< > $@ + +-all: scdoc scdoc.1 scdoc.5 scdoc.pc ++all: $(OUTDIR)/scdoc $(OUTDIR)/scdoc.1 $(OUTDIR)/scdoc.5 $(OUTDIR)/scdoc.pc + + clean: +- rm -rf $(OUTDIR) scdoc scdoc.1 scdoc.5 scdoc.pc ++ rm -rf $(OUTDIR) + + install: all + mkdir -p $(DESTDIR)/$(BINDIR) $(DESTDIR)/$(MANDIR)/man1 $(DESTDIR)/$(MANDIR)/man5 $(DESTDIR)/$(PCDIR) +- install -m755 scdoc $(DESTDIR)/$(BINDIR)/scdoc +- install -m644 scdoc.1 $(DESTDIR)/$(MANDIR)/man1/scdoc.1 +- install -m644 scdoc.5 $(DESTDIR)/$(MANDIR)/man5/scdoc.5 +- install -m644 scdoc.pc $(DESTDIR)/$(PCDIR)/scdoc.pc ++ install -m755 $(OUTDIR)/scdoc $(DESTDIR)/$(BINDIR)/scdoc ++ install -m644 $(OUTDIR)/scdoc.1 $(DESTDIR)/$(MANDIR)/man1/scdoc.1 ++ install -m644 $(OUTDIR)/scdoc.5 $(DESTDIR)/$(MANDIR)/man5/scdoc.5 ++ install -m644 $(OUTDIR)/scdoc.pc $(DESTDIR)/$(PCDIR)/scdoc.pc + + uninstall: + rm -f $(DESTDIR)/$(BINDIR)/scdoc diff --git a/packages/scdoc/build.sh b/packages/scdoc/build.sh new file mode 100644 index 000000000..8b90870f6 --- /dev/null +++ b/packages/scdoc/build.sh @@ -0,0 +1,21 @@ +TERMUX_PKG_HOMEPAGE=https://git.sr.ht/~sircmpwn/scdoc +TERMUX_PKG_DESCRIPTION="Small man page generator" +TERMUX_PKG_LICENSE="MIT" +TERMUX_PKG_MAINTAINER="Yaksh Bariya " +TERMUX_PKG_VERSION=1.11.2 +TERMUX_PKG_SRCURL=https://git.sr.ht/~sircmpwn/scdoc/archive/$TERMUX_PKG_VERSION.tar.gz +TERMUX_PKG_SHA256=e9ff9981b5854301789a6778ee64ef1f6d1e5f4829a9dd3e58a9a63eacc2e6f0 +TERMUX_PKG_BUILD_IN_SRC=true + +termux_step_make() { + cd $TERMUX_PKG_SRCDIR + ( + unset CC CXX CFLAGS CXXFLAGS LD LDFLAGS + make PREFIX=/usr OUTDIR=$TERMUX_PKG_HOSTBUILD_DIR CC=clang + ) + make PREFIX=$TERMUX_PREFIX OUTDIR=$TERMUX_PKG_SRCDIR HOST_SCDOC=$TERMUX_PKG_HOSTBUILD_DIR/scdoc install +} + +termux_step_make_install() { + : +}