[hackers] [libgrapheme] Install a simple pkg-config-file if desired || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Tue, 25 Oct 2022 15:42:01 +0200 (CEST)

commit 4027860f6a5384fe60181d79337862bf53116bec
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Tue Oct 25 15:35:30 2022 +0200
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Tue Oct 25 15:39:12 2022 +0200

    Install a simple pkg-config-file if desired
    
    This was requested by a few packagers and it doesn't hurt to add a bit
    of metadata.
    
    Signed-off-by: Laslo Hunhold <dev_AT_frign.de>

diff --git a/Makefile b/Makefile
index 70e773e..248da61 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -325,6 +325,7 @@ install: all
         if [ "$(SOSYMLINK)" = "true" ]; then ln -sf "$(SONAME)" "$(DESTDIR)$(LIBPREFIX)/libgrapheme.so"; fi
         cp -f grapheme.h "$(DESTDIR)$(INCPREFIX)"
         if ! [ -z "$(LDCONFIG)" ]; then $(SHELL) -c "$(LDCONFIG)"; fi
+ if ! [ -z "$(PCPREFIX)" ]; then mkdir -p "$(DESTDIR)$(PCPREFIX)"; printf "Name: libgrapheme\nDescription: Unicode string library\nURL: https://libs.suckless.org/libgrapheme/\nVersion: $(VERSION)\nCflags: -I$(INCPREFIX)\nLibs: -L$(LIBPREFIX) -lgrapheme\n" > "$(DESTDIR)$(PCPREFIX)/libgrapheme.pc"; fi
 
 uninstall:
         for m in $(MAN3:=.3); do rm -f "$(DESTDIR)$(MANPREFIX)/man3/`basename $$m`"; done
_AT_@ -336,6 +337,7 @@ uninstall:
         if [ "$(SOSYMLINK)" = "true" ]; then rm -f "$(DESTDIR)$(LIBPREFIX)/libgrapheme.so"; fi
         rm -f "$(DESTDIR)$(INCPREFIX)/grapheme.h"
         if ! [ -z "$(LDCONFIG)" ]; then $(SHELL) -c "$(LDCONFIG)"; fi
+ if ! [ -z "$(PCPREFIX)" ]; then rm -f "$(DESTDIR)$(PCPREFIX)/libgrapheme.pc"; fi
 
 clean:
         rm -f $(BENCHMARK:=.o) benchmark/util.o $(BENCHMARK) $(GEN:=.h) $(GEN:=.o) gen/util.o $(GEN) $(SRC:=.o) src/util.o $(TEST:=.o) test/util.o $(TEST) libgrapheme.a $(SONAME) $(MAN3:=.3) $(MAN7:=.7)
diff --git a/config.mk b/config.mk
index f1ba0c6..0bb45d4 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -1,10 +1,12 @@
 # Customize below to fit your system (run ./configure for automatic presets)
 
 # paths
-PREFIX = /usr/local
+DESTDIR =
+PREFIX = /usr/local
 INCPREFIX = $(PREFIX)/include
 LIBPREFIX = $(PREFIX)/lib
 MANPREFIX = $(PREFIX)/share/man
+PCPREFIX = $(LIBPREFIX)/pkgconfig # unset to not install a pkg-config-file
 
 # flags
 CPPFLAGS = -D_DEFAULT_SOURCE
Received on Tue Oct 25 2022 - 15:42:01 CEST

This archive was generated by hypermail 2.3.0 : Tue Oct 25 2022 - 15:48:35 CEST