new file mode 100644
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+VERSION=$1
+LIBDIR=$2
+INCLUDEDIR=$3
+
+cat <<ENDPC
+libdir=${LIBDIR}
+includedir=${INCLUDEDIR}
+
+Name: libxdo
+Description: fake keyboard/mouse input, window management, and more
+Version: ${VERSION}
+Requires: x11
+Libs: -L\${libdir} -lxdo
+Cflags: -I\${includedir}
+ENDPC
@@ -9,7 +9,13 @@ inherit features_check pkgconfig perlnative
# depends on virtual/libx11
REQUIRED_DISTRO_FEATURES = "x11"
-SRC_URI = "https://github.com/jordansissel/${BPN}/releases/download/v${PV}/${BP}.tar.gz"
+# The release tarball ships a prebuilt (and wrongly pathed) libxdo.pc but omits
+# pc.sh, which the Makefile's installpc rule needs to (re)generate libxdo.pc.
+# Depending on the unpack mtime ordering of VERSION vs libxdo.pc, make tries to
+# rebuild libxdo.pc and fails with "sh: 0: cannot open pc.sh". Supply the
+# upstream pc.sh so regeneration works with the correct libdir/includedir.
+SRC_URI = "https://github.com/jordansissel/${BPN}/releases/download/v${PV}/${BP}.tar.gz \
+ file://pc.sh"
SRC_URI[sha256sum] = "eee789b00d6a13d47b31bbc139727e6408c21b5f6ba5e804fdf6ecfb8c781356"
EXTRA_OEMAKE = "PREFIX=${prefix} INSTALLLIB=${libdir} INSTALLMAN=${mandir} WITHOUT_RPATH_FIX=1"
@@ -17,6 +23,10 @@ EXTRA_OEMAKE = "PREFIX=${prefix} INSTALLLIB=${libdir} INSTALLMAN=${mandir} WITHO
UPSTREAM_CHECK_URI = "https://github.com/jordansissel/xdotool/tags"
UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+\.\d{8}\.\d+)"
+do_configure:append() {
+ install -m 0755 ${UNPACKDIR}/pc.sh ${S}/pc.sh
+}
+
do_install() {
oe_runmake install DESTDIR=${D} PREFIX=${prefix} LDCONFIG=true
}