1 From 77a34d31695e02bc3d06b68c7ca3ff9c3cb67844 Mon Sep 17 00:00:00 2001
2 From: Maximilian Bosch <maximilian@mbosch.me>
3 Date: Sun, 26 May 2019 19:46:27 +0200
4 Subject: [PATCH] Don't detect package version with Git
6 This will build in a Nix-based build environment. Instead we ismply
7 replace `@version@` using `substituteAll`.
9 dwarf/Makefile | 19 +++++++++----------
10 elf/Makefile | 15 +++++++--------
11 2 files changed, 16 insertions(+), 18 deletions(-)
13 diff --git a/dwarf/Makefile b/dwarf/Makefile
14 index 71456bd..f871227 100644
17 @@ -43,16 +43,15 @@ CLEAN += libdwarf++.so
18 # Create pkg-config for local library and headers. This will be
19 # transformed in to the correct global pkg-config by install.
21 - @(VER=$$(git describe --match 'v*' | sed -e s/^v//); \
22 - echo "libdir=$$PWD"; \
23 - echo "includedir=$$PWD"; \
25 - echo "Name: libdwarf++"; \
26 - echo "Description: C++11 DWARF library"; \
27 - echo "Version: $$VER"; \
28 - echo "Requires: libelf++ = $$VER"; \
29 - echo "Libs: -L\$${libdir} -ldwarf++"; \
30 - echo "Cflags: -I\$${includedir}") > $@
31 + @(echo "libdir=$$PWD"; \
32 + echo "includedir=$$PWD"; \
34 + echo "Name: libdwarf++"; \
35 + echo "Description: C++11 DWARF library"; \
36 + echo "Version: @version@"; \
37 + echo "Requires: libelf++ = @version@"; \
38 + echo "Libs: -L\$${libdir} -ldwarf++"; \
39 + echo "Cflags: -I\$${includedir}") > $@
40 CLEAN += libdwarf++.pc
43 diff --git a/elf/Makefile b/elf/Makefile
44 index 9c7c224..50630a7 100644
47 @@ -42,15 +42,14 @@ CLEAN += libelf++.so
48 # Create pkg-config for local library and headers. This will be
49 # transformed in to the correct global pkg-config by install.
51 - @(VER=$$(git describe --match 'v*' | sed -e s/^v//); \
52 - echo "libdir=$$PWD"; \
53 + @(echo "libdir=$$PWD"; \
54 echo "includedir=$$PWD"; \
56 - echo "Name: libelf++"; \
57 - echo "Description: C++11 ELF library"; \
58 - echo "Version: $$VER"; \
59 - echo "Libs: -L\$${libdir} -lelf++"; \
60 - echo "Cflags: -I\$${includedir}") > $@
62 + echo "Name: libelf++"; \
63 + echo "Description: C++11 ELF library"; \
64 + echo "Version: @version@"; \
65 + echo "Libs: -L\$${libdir} -lelf++"; \
66 + echo "Cflags: -I\$${includedir}") > $@