blob: 2fbcb4397f3666aecc663802b6345b9107415326 [file] [log] [blame]
Brad Bishop6e60e8b2018-02-01 10:27:11 -05001DESCRIPTION = "Drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags."
2HOMEPAGE = "https://github.com/spf13/pflag"
3SECTION = "devel/go"
4LICENSE = "BSD"
5LIC_FILES_CHKSUM = "file://src/${PKG_NAME}/LICENSE;md5=1e8b7dc8b906737639131047a590f21d"
6
7SRCNAME = "pflag"
8
9PKG_NAME = "github.com/spf13/${SRCNAME}"
10SRC_URI = "git://${PKG_NAME}.git;destsuffix=git/src/${PKG_NAME}"
11
12SRCREV = "9ff6c6923cfffbcd502984b8e0c80539a94968b7"
13PV = "v1.0.0-rc4+git${SRCPV}"
14
15S = "${WORKDIR}/git"
16
17# NO-OP the do compile rule because this recipe is source only.
18do_compile() {
19}
20
21do_install() {
22 install -d ${D}${prefix}/local/go/src/${PKG_NAME}
23 for j in $(cd ${S} && find src/${PKG_NAME} -name "*.go" -not -path "*/.tool/*"); do
24 if [ ! -d ${D}${prefix}/local/go/$(dirname $j) ]; then
25 mkdir -p ${D}${prefix}/local/go/$(dirname $j)
26 fi
27 cp $j ${D}${prefix}/local/go/$j
28 done
29 cp -r ${S}/src/${PKG_NAME}/LICENSE ${D}${prefix}/local/go/src/${PKG_NAME}/
30}
31
32SYSROOT_PREPROCESS_FUNCS += "pflag_file_sysroot_preprocess"
33
34pflag_file_sysroot_preprocess () {
35 install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
36 cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
37}
38
39FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"
40
41CLEANBROKEN = "1"