Skip to content

Commit 6f1f25c

Browse files
committed
Initial commit of v1.0.0 of libpisp
Signed-off-by: Naushir Patuck <[email protected]>
0 parents  commit 6f1f25c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+8055
-0
lines changed

.clang-format

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# SPDX-License-Identifier: GPL-2.0-only
2+
#
3+
# clang-format configuration file. Intended for clang-format >= 7.
4+
#
5+
# For more information, see:
6+
#
7+
# Documentation/process/clang-format.rst
8+
# https://clang.llvm.org/docs/ClangFormat.html
9+
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
10+
#
11+
---
12+
Language: Cpp
13+
AccessModifierOffset: -4
14+
AlignAfterOpenBracket: Align
15+
AlignConsecutiveAssignments: false
16+
AlignConsecutiveDeclarations: false
17+
AlignEscapedNewlines: Right
18+
AlignOperands: true
19+
AlignTrailingComments: false
20+
AllowAllParametersOfDeclarationOnNextLine: false
21+
AllowShortBlocksOnASingleLine: false
22+
AllowShortCaseLabelsOnASingleLine: false
23+
AllowShortLambdasOnASingleLine: Inline
24+
AllowShortFunctionsOnASingleLine: InlineOnly
25+
AllowShortIfStatementsOnASingleLine: false
26+
AllowShortLoopsOnASingleLine: false
27+
AlwaysBreakAfterDefinitionReturnType: None
28+
AlwaysBreakAfterReturnType: None
29+
AlwaysBreakBeforeMultilineStrings: false
30+
AlwaysBreakTemplateDeclarations: Yes
31+
BinPackArguments: true
32+
BinPackParameters: true
33+
BreakBeforeBraces: Allman
34+
BraceWrapping:
35+
SplitEmptyFunction: true
36+
SplitEmptyRecord: true
37+
SplitEmptyNamespace: true
38+
AfterNamespace: false
39+
AfterClass: true
40+
BreakBeforeBinaryOperators: None
41+
BreakBeforeInheritanceComma: false
42+
BreakInheritanceList: BeforeColon
43+
BreakBeforeTernaryOperators: true
44+
BreakConstructorInitializers: BeforeColon
45+
BreakAfterJavaFieldAnnotations: false
46+
BreakStringLiterals: false
47+
CommentPragmas: '^ IWYU pragma:'
48+
CompactNamespaces: false
49+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
50+
Cpp11BracedListStyle: false
51+
DerivePointerAlignment: false
52+
DisableFormat: false
53+
ExperimentalAutoDetectBinPacking: false
54+
FixNamespaceComments: true
55+
ForEachMacros:
56+
- 'udev_list_entry_foreach'
57+
IncludeBlocks: Preserve
58+
IncludeCategories:
59+
- Regex: '.*'
60+
Priority: 1
61+
IncludeIsMainRegex: '(_test)?$'
62+
IndentCaseLabels: false
63+
IndentPPDirectives: None
64+
IndentWrappedFunctionNames: false
65+
JavaScriptQuotes: Leave
66+
JavaScriptWrapImports: true
67+
KeepEmptyLinesAtTheStartOfBlocks: false
68+
MacroBlockBegin: ''
69+
MacroBlockEnd: ''
70+
MaxEmptyLinesToKeep: 1
71+
NamespaceIndentation: None
72+
ObjCBinPackProtocolList: Auto
73+
ObjCBlockIndentWidth: 8
74+
ObjCSpaceAfterProperty: true
75+
ObjCSpaceBeforeProtocolList: true
76+
77+
# Taken from git's rules
78+
PenaltyBreakAssignment: 10
79+
PenaltyBreakBeforeFirstCallParameter: 30
80+
PenaltyBreakComment: 10
81+
PenaltyBreakFirstLessLess: 0
82+
PenaltyBreakString: 10
83+
PenaltyBreakTemplateDeclaration: 10
84+
PenaltyExcessCharacter: 100
85+
PenaltyReturnTypeOnItsOwnLine: 60
86+
87+
PointerAlignment: Right
88+
ReflowComments: false
89+
SortIncludes: true
90+
SortUsingDeclarations: true
91+
SpaceAfterCStyleCast: false
92+
SpaceAfterTemplateKeyword: true
93+
SpaceAfterLogicalNot: false
94+
#SpaceBeforeCaseColon: false
95+
SpaceBeforeAssignmentOperators: true
96+
SpaceBeforeCpp11BracedList: true
97+
SpaceBeforeCtorInitializerColon: true
98+
SpaceBeforeInheritanceColon: true
99+
SpaceBeforeParens: ControlStatements
100+
SpaceBeforeRangeBasedForLoopColon: true
101+
SpaceInEmptyParentheses: false
102+
SpacesBeforeTrailingComments: 1
103+
SpacesInAngles: false
104+
SpacesInContainerLiterals: false
105+
SpacesInCStyleCastParentheses: false
106+
SpacesInParentheses: false
107+
SpacesInSquareBrackets: false
108+
IndentWidth: 4
109+
TabWidth: 4
110+
UseTab: Always
111+
ConstructorInitializerIndentWidth: 4
112+
ContinuationIndentWidth: 4
113+
ColumnLimit: 120
114+
...
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: libpisp build test
2+
3+
on:
4+
workflow_dispatch:
5+
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-test:
11+
12+
runs-on: [ ubuntu-latest ]
13+
14+
strategy:
15+
matrix:
16+
compiler: [ g++, clang++ ]
17+
build_type: [ release, debug ]
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 1
23+
clean: true
24+
25+
- name: Install meson and ninja
26+
run: pip3 install --user meson ninja
27+
28+
- name: Install boost dependencies
29+
run: sudo apt install -y libboost-log-dev libboost-thread-dev
30+
31+
- name: Configure meson
32+
run: CXX=${{matrix.compiler}} meson setup build_${{matrix.compiler}}_${{matrix.build_type}} -Dbuildtype=${{matrix.build_type}}
33+
timeout-minutes: 5
34+
35+
- name: Build
36+
run: ninja -C build_${{matrix.compiler}}_${{matrix.build_type}}
37+
timeout-minutes: 10
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: libpisp style checker
2+
on:
3+
pull_request:
4+
branches: [ main ]
5+
6+
jobs:
7+
style-check:
8+
9+
runs-on: [ ubuntu-latest ]
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
clean: true
16+
17+
- name: Check style
18+
run: ${{github.workspace}}/utils/checkstyle.py $(git log --format=%P -1 | awk '{print $1 ".." $2}')

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

LICENSE

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
BSD 2-Clause License
2+
3+
Copyright (c) 2023, Raspberry Pi Ltd
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# libpisp
2+
3+
A helper library to generate run-time configuration for the Raspberry Pi ISP (PiSP), consisting of the Frontend and Backend hardware components.
4+
5+
## Building and installing
6+
To build, setup the meson project as follows:
7+
8+
```sh
9+
meson setup <build_dir>
10+
```
11+
To optionally disable the Boost logging library, add ``-Dlogging=disabled`` as an argument to the ``meson setup`` command.
12+
13+
To compile and install the ``libpisp.so`` artefact:
14+
```sh
15+
meson compile -C <build_dir>
16+
sudo meson install -C <build_dir>
17+
```
18+
19+
## Linking libpisp with an application
20+
libpisp can be built and linked as a [meson subproject](https://mesonbuild.com/Subprojects.html) with the following dependency declaration in the target project:
21+
```meson
22+
libpisp_dep = dependency('libpisp', fallback : ['libpisp', 'libpisp_dep'])
23+
```
24+
Alternatively [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) can be used to locate ``libpisp.so`` installed in on of the system directories for other build environments.
25+
26+
## License
27+
Copyright © 2023, Raspberry Pi Ltd. Released under the BSD-2-Clause License.

meson.build

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
project('libpisp', 'c', 'cpp',
2+
meson_version : '>= 0.58.0',
3+
version : '1.0.0',
4+
default_options : [
5+
'werror=true',
6+
'warning_level=2',
7+
'cpp_std=c++17',
8+
'buildtype=release',
9+
],
10+
license : 'BSD-2-Clause')
11+
12+
subdir('src')

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
option('logging', type : 'feature', value : 'auto')

0 commit comments

Comments
 (0)