mark cross.patch as applied upstream
[debian/iodine.git] / debian / patches / cross.patch
1 Description: Fix cross compilation
2  src/osflags hard codes the build architecture pkg-config. After making it
3  substitutable and substituting it from the build environment, iodine cross
4  builds successfully.
5 Origin: vendor
6 Bug: https://github.com/yarrick/iodine/pull/33
7 Bug-Debian: https://bugs.debian.org/921822
8 Forwarded: https://github.com/yarrick/iodine/pull/33
9 Author: Helmut Grohne <helmut@subdivi.de>
10 Reviewed-by: gregor herrmann <gregoa@debian.org>
11 Last-Update: 2019-08-04
12 Applied-Upstream: https://github.com/yarrick/iodine/commit/024481c94b97ef37981621cdc38f8b20f8919418
13
14 --- a/src/osflags
15 +++ b/src/osflags
16 @@ -1,5 +1,7 @@
17  #!/bin/sh
18  
19 +: "${PKG_CONFIG:=pkg-config}"
20 +
21  case $2 in
22  link)
23  
24 @@ -19,8 +21,8 @@
25                 Linux)
26                         FLAGS="";
27                         [ -e /usr/include/selinux/selinux.h ] && FLAGS="$FLAGS -lselinux";
28 -                       [ -e /usr/include/systemd/sd-daemon.h ] && FLAGS="$FLAGS $(pkg-config --libs libsystemd-daemon)";
29 -                       [ -e /usr/include/systemd/sd-daemon.h ] && FLAGS="$FLAGS $(pkg-config --libs libsystemd)";
30 +                       "$PKG_CONFIG" --exists libsystemd-daemon && FLAGS="$FLAGS $($PKG_CONFIG --libs libsystemd-daemon)";
31 +                       "$PKG_CONFIG" --exists libsystemd && FLAGS="$FLAGS $($PKG_CONFIG --libs libsystemd)";
32                         echo $FLAGS;
33                 ;;
34         esac
35 @@ -36,7 +38,8 @@
36                 Linux)
37                         FLAGS="-D_GNU_SOURCE"
38                         [ -e /usr/include/selinux/selinux.h ] && FLAGS="$FLAGS -DHAVE_SETCON";
39 -                       [ -e /usr/include/systemd/sd-daemon.h ] && FLAGS="$FLAGS -DHAVE_SYSTEMD";
40 +                       "$PKG_CONFIG" --exists libsystemd-daemon && FLAGS="$FLAGS -DHAVE_SYSTEMD";
41 +                       "$PKG_CONFIG" --exists libsystemd && FLAGS="$FLAGS -DHAVE_SYSTEMD";
42                         echo $FLAGS;
43                 ;;
44                 GNU/kFreeBSD|GNU)