summaryrefslogtreecommitdiffstats
path: root/bitbake/contrib
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
commit972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch)
tree97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /bitbake/contrib
downloadpoky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'bitbake/contrib')
-rw-r--r--bitbake/contrib/README1
-rw-r--r--bitbake/contrib/bbdev.sh31
-rwxr-xr-xbitbake/contrib/dump_cache.py68
-rw-r--r--bitbake/contrib/vim/ftdetect/bitbake.vim24
-rw-r--r--bitbake/contrib/vim/ftplugin/bitbake.vim2
-rwxr-xr-xbitbake/contrib/vim/plugin/newbb.vim84
-rw-r--r--bitbake/contrib/vim/syntax/bitbake.vim126
7 files changed, 336 insertions, 0 deletions
diff --git a/bitbake/contrib/README b/bitbake/contrib/README
new file mode 100644
index 0000000000..25e5156619
--- /dev/null
+++ b/bitbake/contrib/README
@@ -0,0 +1 @@
This directory is for additional contributed files which may be useful.
diff --git a/bitbake/contrib/bbdev.sh b/bitbake/contrib/bbdev.sh
new file mode 100644
index 0000000000..33a78531e1
--- /dev/null
+++ b/bitbake/contrib/bbdev.sh
@@ -0,0 +1,31 @@
1# This is a shell function to be sourced into your shell or placed in your .profile,
2# which makes setting things up for BitBake a bit easier.
3#
4# The author disclaims copyright to the contents of this file and places it in the
5# public domain.
6
7bbdev () {
8 local BBDIR PKGDIR BUILDDIR
9 if test x"$1" = "x--help"; then echo >&2 "syntax: bbdev [bbdir [pkgdir [builddir]]]"; return 1; fi
10 if test x"$1" = x; then BBDIR=`pwd`; else BBDIR=$1; fi
11 if test x"$2" = x; then PKGDIR=`pwd`; else PKGDIR=$2; fi
12 if test x"$3" = x; then BUILDDIR=`pwd`; else BUILDDIR=$3; fi
13
14 BBDIR=`readlink -f $BBDIR`
15 PKGDIR=`readlink -f $PKGDIR`
16 BUILDDIR=`readlink -f $BUILDDIR`
17 if ! (test -d $BBDIR && test -d $PKGDIR && test -d $BUILDDIR); then
18 echo >&2 "syntax: bbdev [bbdir [pkgdir [builddir]]]"
19 return 1
20 fi
21
22 PATH=$BBDIR/bin:$PATH
23 BBPATH=$BBDIR
24 if test x"$BBDIR" != x"$PKGDIR"; then
25 BBPATH=$PKGDIR:$BBPATH
26 fi
27 if test x"$PKGDIR" != x"$BUILDDIR"; then
28 BBPATH=$BUILDDIR:$BBPATH
29 fi
30 export BBPATH
31}
diff --git a/bitbake/contrib/dump_cache.py b/bitbake/contrib/dump_cache.py
new file mode 100755
index 0000000000..e1f23090b9
--- /dev/null
+++ b/bitbake/contrib/dump_cache.py
@@ -0,0 +1,68 @@
1#!/usr/bin/env python
2# ex:ts=4:sw=4:sts=4:et
3# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
4#
5# Copyright (C) 2012 Wind River Systems, Inc.
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 2 as
9# published by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program; if not, write to the Free Software Foundation, Inc.,
18# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20#
21# This is used for dumping the bb_cache.dat, the output format is:
22# recipe_path PN PV PACKAGES
23#
24import os
25import sys
26import warnings
27
28# For importing bb.cache
29sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), '../lib'))
30from bb.cache import CoreRecipeInfo
31
32import cPickle as pickle
33
34def main(argv=None):
35 """
36 Get the mapping for the target recipe.
37 """
38 if len(argv) != 1:
39 print >>sys.stderr, "Error, need one argument!"
40 return 2
41
42 cachefile = argv[0]
43
44 with open(cachefile, "rb") as cachefile:
45 pickled = pickle.Unpickler(cachefile)
46 while cachefile:
47 try:
48 key = pickled.load()
49 val = pickled.load()
50 except Exception:
51 break
52 if isinstance(val, CoreRecipeInfo) and (not val.skipped):
53 pn = val.pn
54 # Filter out the native recipes.
55 if key.startswith('virtual:native:') or pn.endswith("-native"):
56 continue
57
58 # 1.0 is the default version for a no PV recipe.
59 if val.__dict__.has_key("pv"):
60 pv = val.pv
61 else:
62 pv = "1.0"
63
64 print("%s %s %s %s" % (key, pn, pv, ' '.join(val.packages)))
65
66if __name__ == "__main__":
67 sys.exit(main(sys.argv[1:]))
68
diff --git a/bitbake/contrib/vim/ftdetect/bitbake.vim b/bitbake/contrib/vim/ftdetect/bitbake.vim
new file mode 100644
index 0000000000..200f8ae49b
--- /dev/null
+++ b/bitbake/contrib/vim/ftdetect/bitbake.vim
@@ -0,0 +1,24 @@
1" Vim filetype detection file
2" Language: BitBake
3" Author: Ricardo Salveti <rsalveti@rsalveti.net>
4" Copyright: Copyright (C) 2008 Ricardo Salveti <rsalveti@rsalveti.net>
5" Licence: You may redistribute this under the same terms as Vim itself
6"
7" This sets up the syntax highlighting for BitBake files, like .bb, .bbclass and .inc
8
9if &compatible || version < 600
10 finish
11endif
12
13" .bb, .bbappend and .bbclass
14au BufNewFile,BufRead *.{bb,bbappend,bbclass} set filetype=bitbake
15
16" .inc
17au BufNewFile,BufRead *.inc set filetype=bitbake
18
19" .conf
20au BufNewFile,BufRead *.conf
21 \ if (match(expand("%:p:h"), "conf") > 0) |
22 \ set filetype=bitbake |
23 \ endif
24
diff --git a/bitbake/contrib/vim/ftplugin/bitbake.vim b/bitbake/contrib/vim/ftplugin/bitbake.vim
new file mode 100644
index 0000000000..db0d75319a
--- /dev/null
+++ b/bitbake/contrib/vim/ftplugin/bitbake.vim
@@ -0,0 +1,2 @@
1set sts=4 sw=4 et
2set cms=#%s
diff --git a/bitbake/contrib/vim/plugin/newbb.vim b/bitbake/contrib/vim/plugin/newbb.vim
new file mode 100755
index 0000000000..874e338059
--- /dev/null
+++ b/bitbake/contrib/vim/plugin/newbb.vim
@@ -0,0 +1,84 @@
1" Vim plugin file
2" Purpose: Create a template for new bb files
3" Author: Ricardo Salveti <rsalveti@gmail.com>
4" Copyright: Copyright (C) 2008 Ricardo Salveti <rsalveti@gmail.com>
5"
6" This file is licensed under the MIT license, see COPYING.MIT in
7" this source distribution for the terms.
8"
9" Based on the gentoo-syntax package
10"
11" Will try to use git to find the user name and email
12
13if &compatible || v:version < 600
14 finish
15endif
16
17fun! <SID>GetUserName()
18 let l:user_name = system("git config --get user.name")
19 if v:shell_error
20 return "Unknown User"
21 else
22 return substitute(l:user_name, "\n", "", "")
23endfun
24
25fun! <SID>GetUserEmail()
26 let l:user_email = system("git config --get user.email")
27 if v:shell_error
28 return "unknow@user.org"
29 else
30 return substitute(l:user_email, "\n", "", "")
31endfun
32
33fun! BBHeader()
34 let l:current_year = strftime("%Y")
35 let l:user_name = <SID>GetUserName()
36 let l:user_email = <SID>GetUserEmail()
37 0 put ='# Copyright (C) ' . l:current_year .
38 \ ' ' . l:user_name . ' <' . l:user_email . '>'
39 put ='# Released under the MIT license (see COPYING.MIT for the terms)'
40 $
41endfun
42
43fun! NewBBTemplate()
44 let l:paste = &paste
45 set nopaste
46
47 " Get the header
48 call BBHeader()
49
50 " New the bb template
51 put ='DESCRIPTION = \"\"'
52 put ='HOMEPAGE = \"\"'
53 put ='LICENSE = \"\"'
54 put ='SECTION = \"\"'
55 put ='DEPENDS = \"\"'
56 put =''
57 put ='SRC_URI = \"\"'
58
59 " Go to the first place to edit
60 0
61 /^DESCRIPTION =/
62 exec "normal 2f\""
63
64 if paste == 1
65 set paste
66 endif
67endfun
68
69if !exists("g:bb_create_on_empty")
70 let g:bb_create_on_empty = 1
71endif
72
73" disable in case of vimdiff
74if v:progname =~ "vimdiff"
75 let g:bb_create_on_empty = 0
76endif
77
78augroup NewBB
79 au BufNewFile *.bb
80 \ if g:bb_create_on_empty |
81 \ call NewBBTemplate() |
82 \ endif
83augroup END
84
diff --git a/bitbake/contrib/vim/syntax/bitbake.vim b/bitbake/contrib/vim/syntax/bitbake.vim
new file mode 100644
index 0000000000..fb55f91022
--- /dev/null
+++ b/bitbake/contrib/vim/syntax/bitbake.vim
@@ -0,0 +1,126 @@
1" Vim syntax file
2" Language: BitBake bb/bbclasses/inc
3" Author: Chris Larson <kergoth@handhelds.org>
4" Ricardo Salveti <rsalveti@rsalveti.net>
5" Copyright: Copyright (C) 2004 Chris Larson <kergoth@handhelds.org>
6" Copyright (C) 2008 Ricardo Salveti <rsalveti@rsalveti.net>
7"
8" This file is licensed under the MIT license, see COPYING.MIT in
9" this source distribution for the terms.
10"
11" Syntax highlighting for bb, bbclasses and inc files.
12"
13" It's an entirely new type, just has specific syntax in shell and python code
14
15if &compatible || v:version < 600
16 finish
17endif
18if exists("b:current_syntax")
19 finish
20endif
21
22syn include @python syntax/python.vim
23if exists("b:current_syntax")
24 unlet b:current_syntax
25endif
26
27" BitBake syntax
28
29" Matching case
30syn case match
31
32" Indicates the error when nothing is matched
33syn match bbUnmatched "."
34
35" Comments
36syn cluster bbCommentGroup contains=bbTodo,@Spell
37syn keyword bbTodo COMBAK FIXME TODO XXX contained
38syn match bbComment "#.*$" contains=@bbCommentGroup
39
40" String helpers
41syn match bbQuote +['"]+ contained
42syn match bbDelimiter "[(){}=]" contained
43syn match bbArrayBrackets "[\[\]]" contained
44
45" BitBake strings
46syn match bbContinue "\\$"
47syn region bbString matchgroup=bbQuote start=+"+ skip=+\\$+ end=+"+ contained contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell
48syn region bbString matchgroup=bbQuote start=+'+ skip=+\\$+ end=+'+ contained contains=bbTodo,bbContinue,bbVarDeref,bbVarPyValue,@Spell
49
50" Vars definition
51syn match bbExport "^export" nextgroup=bbIdentifier skipwhite
52syn keyword bbExportFlag export contained nextgroup=bbIdentifier skipwhite
53syn match bbIdentifier "[a-zA-Z0-9\-_\.\/\+]\+" display contained
54syn match bbVarDeref "${[a-zA-Z0-9\-_\.\/\+]\+}" contained
55syn match bbVarEq "\(:=\|+=\|=+\|\.=\|=\.\|?=\|??=\|=\)" contained nextgroup=bbVarValue
56syn match bbVarDef "^\(export\s*\)\?\([a-zA-Z0-9\-_\.\/\+]\+\(_[${}a-zA-Z0-9\-_\.\/\+]\+\)\?\)\s*\(:=\|+=\|=+\|\.=\|=\.\|?=\|??=\|=\)\@=" contains=bbExportFlag,bbIdentifier,bbVarDeref nextgroup=bbVarEq
57syn match bbVarValue ".*$" contained contains=bbString,bbVarDeref,bbVarPyValue
58syn region bbVarPyValue start=+${@+ skip=+\\$+ end=+}+ contained contains=@python
59
60" Vars metadata flags
61syn match bbVarFlagDef "^\([a-zA-Z0-9\-_\.]\+\)\(\[[a-zA-Z0-9\-_\.]\+\]\)\@=" contains=bbIdentifier nextgroup=bbVarFlagFlag
62syn region bbVarFlagFlag matchgroup=bbArrayBrackets start="\[" end="\]\s*\(=\|+=\|=+\|?=\)\@=" contained contains=bbIdentifier nextgroup=bbVarEq
63
64" Includes and requires
65syn keyword bbInclude inherit include require contained
66syn match bbIncludeRest ".*$" contained contains=bbString,bbVarDeref
67syn match bbIncludeLine "^\(inherit\|include\|require\)\s\+" contains=bbInclude nextgroup=bbIncludeRest
68
69" Add taks and similar
70syn keyword bbStatement addtask addhandler after before EXPORT_FUNCTIONS contained
71syn match bbStatementRest ".*$" skipwhite contained contains=bbStatement
72syn match bbStatementLine "^\(addtask\|addhandler\|after\|before\|EXPORT_FUNCTIONS\)\s\+" contains=bbStatement nextgroup=bbStatementRest
73
74" OE Important Functions
75syn keyword bbOEFunctions do_fetch do_unpack do_patch do_configure do_compile do_stage do_install do_package contained
76
77" Generic Functions
78syn match bbFunction "\h[0-9A-Za-z_-]*" display contained contains=bbOEFunctions
79
80" BitBake shell metadata
81syn include @shell syntax/sh.vim
82if exists("b:current_syntax")
83 unlet b:current_syntax
84endif
85syn keyword bbShFakeRootFlag fakeroot contained
86syn match bbShFuncDef "^\(fakeroot\s*\)\?\([0-9A-Za-z_${}-]\+\)\(python\)\@<!\(\s*()\s*\)\({\)\@=" contains=bbShFakeRootFlag,bbFunction,bbVarDeref,bbDelimiter nextgroup=bbShFuncRegion skipwhite
87syn region bbShFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@shell
88
89" Python value inside shell functions
90syn region shDeref start=+${@+ skip=+\\$+ excludenl end=+}+ contained contains=@python
91
92" BitBake python metadata
93syn keyword bbPyFlag python contained
94syn match bbPyFuncDef "^\(python\s\+\)\([0-9A-Za-z_${}-]\+\)\?\(\s*()\s*\)\({\)\@=" contains=bbPyFlag,bbFunction,bbVarDeref,bbDelimiter nextgroup=bbPyFuncRegion skipwhite
95syn region bbPyFuncRegion matchgroup=bbDelimiter start="{\s*$" end="^}\s*$" contained contains=@python
96
97" BitBake 'def'd python functions
98syn keyword bbPyDef def contained
99syn region bbPyDefRegion start='^\(def\s\+\)\([0-9A-Za-z_-]\+\)\(\s*(.*)\s*\):\s*$' end='^\(\s\|$\)\@!' contains=@python
100
101" Highlighting Definitions
102hi def link bbUnmatched Error
103hi def link bbInclude Include
104hi def link bbTodo Todo
105hi def link bbComment Comment
106hi def link bbQuote String
107hi def link bbString String
108hi def link bbDelimiter Keyword
109hi def link bbArrayBrackets Statement
110hi def link bbContinue Special
111hi def link bbExport Type
112hi def link bbExportFlag Type
113hi def link bbIdentifier Identifier
114hi def link bbVarDeref PreProc
115hi def link bbVarDef Identifier
116hi def link bbVarValue String
117hi def link bbShFakeRootFlag Type
118hi def link bbFunction Function
119hi def link bbPyFlag Type
120hi def link bbPyDef Statement
121hi def link bbStatement Statement
122hi def link bbStatementRest Identifier
123hi def link bbOEFunctions Special
124hi def link bbVarPyValue PreProc
125
126let b:current_syntax = "bb"