Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
RadxaYuntian committed Oct 24, 2022
0 parents commit e995d9b
Show file tree
Hide file tree
Showing 20 changed files with 1,016 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build & Release
on:
workflow_dispatch:
push:

jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Test
run: |
make test
- name: Build
run: |
sudo apt-get update
sudo apt-get build-dep --no-install-recommends -y .
make all deb
- name: Check if the latest version is releasable
run: |
echo "version=$(dpkg-parsechangelog -S Version)" >> $GITHUB_ENV
echo "changes<<EOF" >> $GITHUB_ENV
echo '```' >> $GITHUB_ENV
echo "$(dpkg-parsechangelog -S Changes)" >> $GITHUB_ENV
echo '```' >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
if [[ -n "$(git tag -l "$(dpkg-parsechangelog -S Version)")" ]]
then
echo "distro=UNRELEASED" >> $GITHUB_ENV
else
echo "distro=$(dpkg-parsechangelog -S Distribution)" >> $GITHUB_ENV
fi
- name: Release
if: env.distro != 'UNRELEASED'
uses: softprops/action-gh-release@cd28b0f5ee8571b76cfdaa62a30d51d752317477
with:
tag_name: ${{ env.version }}
body_path: README.md
token: ${{ secrets.GITHUB_TOKEN }}
target_commitish: main
draft: false
files: |
../*.deb
pkg.conf
- name: Append changelog
if: env.distro != 'UNRELEASED'
uses: softprops/action-gh-release@cd28b0f5ee8571b76cfdaa62a30d51d752317477
with:
tag_name: ${{ env.version }}
body: |
## Changelog for ${{ env.version }}
${{ env.changes }}
append_body: true
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.vscode*
SOURCE
/boot
/config
/etc
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
PROJECT ?= rockchip-iqfiles
PREFIX ?= /usr
ETCDIR ?= /etc
BINDIR ?= $(PREFIX)/bin
LIBDIR ?= $(PREFIX)/lib
SHAREDIR ?= $(PREFIX)/share
MANDIR ?= $(SHAREDIR)/man

.PHONY: all
all: build

#
# Test
#
.PHONY: test
test:

#
# Build
#
.PHONY: build
build: build-man build-doc

SRC-MAN := man
SRCS-MAN := $(wildcard $(SRC-MAN)/*.md)
MANS := $(SRCS-MAN:.md=)
.PHONY: build-man
build-man: $(MANS)

$(SRC-MAN)/%: $(SRC-MAN)/%.md
pandoc "$<" -o "$@" --from markdown --to man -s

SRC-DOC := .
DOCS := $(SRC-DOC)/SOURCE
build-doc: $(DOCS)

$(SRC-DOC):
mkdir -p $(SRC-DOC)

.PHONY: $(SRC-DOC)/SOURCE
$(SRC-DOC)/SOURCE: $(SRC-DOC)
echo -e "git clone $(shell git remote get-url origin)\ngit checkout $(shell git rev-parse HEAD)" > "$@"

#
# Install
#
.PHONY: install
install: install-man
install -d $(DESTDIR)$(SHAREDIR)/${PROJECT}
install -m 644 usr/share/${PROJECT}/* $(DESTDIR)$(SHAREDIR)/${PROJECT}
install -d $(DESTDIR)$(ETCDIR)/iqfiles
ln -fs $(SHAREDIR)/${PROJECT}/imx219_rpi-camera-v2_default.xml $(DESTDIR)$(ETCDIR)/iqfiles/imx219_rpi-camera-v2_default.xml

.PHONY: install-man
install-man: build-man
install -d $(DESTDIR)$(MANDIR)/man7
install -m 644 $(SRC-MAN)/*.7 $(DESTDIR)$(MANDIR)/man7/

#
# Clean
#
.PHONY: distclean
distclean: clean

.PHONY: clean
clean: clean-man clean-doc clean-deb

.PHONY: clean-man
clean-man:
rm -rf $(MANS)

.PHONY: clean-doc
clean-doc:
rm -rf $(DOCS)

.PHONY: clean-deb
clean-deb:
rm -rf debian/.debhelper debian/${PROJECT} debian/debhelper-build-stamp debian/files debian/*.debhelper.log debian/*.postrm.debhelper debian/*.substvars

#
# Release
#
.PHONY: dch
dch: debian/changelog
gbp dch --debian-branch=main

.PHONY: deb
deb: debian
debuild --no-sign
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# rockchip-iqfiles

[![Build & Release](https://github.com/radxa-pkg/rockchip-iqfiles/actions/workflows/release.yml/badge.svg)](https://github.com/radxa-pkg/rockchip-iqfiles/actions/workflows/release.yml)

Additional camera tuning profiles for Rockchip SoC

## Development dependencies

<details>
<summary>Arch</summary>

```bash
yay -Syu devscripts dh-autoreconf dh-strip-nondeterminism git-buildpackage pandoc shellcheck
sudo tee -a /etc/devscripts.conf <<< 'DEBUILD_DPKG_BUILDPACKAGE_OPTS="-d"'
# Install missing dependencies of debhelper's dependencies
yay -Syu perl-sub-override
# Install missing dependencies of debhelper
yay -Syu dh-autoreconf dh-strip-nondeterminism

# As of 2022-09-22, it is not easy to install lintian on Arch right now.
# So here is a dedicated section for it.
#
# lintian depends on apt, which is currently broken on AUR
mkdir -p ~/.cache/yay/apt
wget https://github.com/Debian/apt/pull/133.patch -O ~/.cache/yay/apt/133.patch
yay -Syu --editmenu apt
# When editing apt's PKGBUILD, add the following info to support patching
# source 133.patch
# sha512sums 07256958ee808c1a07476c4f95df603c964174e910866553db1023e24b797219217333369816a5d38791761e5b7446f9f311b602521d1658038e31a51dc8556d
# prepare() {
# patch --directory="$pkgname-$pkgver" --forward --strip=1 --input="${srcdir}/133.patch"
#}
# Additional missing make dependcies for lintian's dependencies
yay -Syu perl-iterator perl-test-requires perl-module-build-tiny
# Additional missing make dependcies for lintian
yay -Syu python-docutils
# Finally install lintian
yay -Syu lintian
# Additional missing lintian runtime dependencies
yay -Syu perl-data-validate-uri perl-list-someutils perl-moox-aliases perl-namespace-clean perl-path-tiny perl-xml-libxml
# Copy profile for Arch
sudo cp -r /usr/share/lintian/profiles/debian/. /usr/share/lintian/profiles/archlinux/
```
</details>

<details>
<summary>Debian</summary>

```bash
sudo apt-get update
sudo apt-get build-dep --no-install-recommends .
sudo apt-get install git-buildpackage
```
</details>

## Developer commands

`make dch`: generate changelog from git log

`make deb`: create Debian package
7 changes: 7 additions & 0 deletions debian/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/.debhelper
/debhelper-build-stamp
/files
/rockchip-iqfiles
/*.debhelper.log
/*.postrm.debhelper
/*.substvars
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rockchip-iqfiles (0.1.0) stable; urgency=medium

* Add support for Raspberry Pi Camera Module 2 (IMX219)

-- "Radxa Computer Co., Ltd" <dev@radxa.com> Mon, 24 Oct 2022 15:18:52 +0800
1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12
19 changes: 19 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Source: rockchip-iqfiles
Maintainer: "Radxa Computer Co., Ltd" <dev@radxa.com>
Section: libs
Priority: optional
Standards-Version: 4.6.0
Build-Depends: debhelper (>=12~),
devscripts,
lintian,
pandoc,

Package: rockchip-iqfiles
Architecture: all
Section: libs
Priority: optional
Depends: camera-engine-rkaiq | rkisp-engine,
${misc:Depends},
Description: Radxa system setup utility
This package contains additional camera tuning profiles that is not
included in the official Rockchip packages.
26 changes: 26 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: rockchip-iqfiles
Source: https://github.com/radxa-pkg/rockchip-iqfiles

Files: *
Copyright: © 2022 Radxa Computer Co., Ltd
License: GPL-3+

License: GPL-3+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
02110-1301, USA.
.
On Debian systems, the complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3.
1 change: 1 addition & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SOURCE
2 changes: 2 additions & 0 deletions debian/rockchip-iqfiles.lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Small bug number is very probable for us.
rockchip-iqfiles: improbable-bug-number-in-closes
10 changes: 10 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk

%:
dh $@

override_dh_builddeb:
dh_builddeb -- -Zxz
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
4 changes: 4 additions & 0 deletions debian/source/lintian-overrides
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Our package is built on GitHub-hosted runner,
# which uses Ubuntu, and will default to zstd compression.
# This is currently not supported in Debian.
rockchip-iqfiles source: custom-compression-in-debian-rules
1 change: 1 addition & 0 deletions man/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/*.7
14 changes: 14 additions & 0 deletions man/rockchip-iqfiles.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ROCKCHIP-IQFILES(7)

## NAME

rockchip-iqfiles - Additional camera tuning profiles for Rockchip SoC

## SYNOPSIS

**rockchip-iqfiles**

## DESCRIPTION

This package contains additional camera tuning profiles that is not
included in the official Rockchip packages.
8 changes: 8 additions & 0 deletions pkg.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"*": {
"Releases": [
"rockchip-bullseye",
"rockchip-jammy"
]
}
}
25 changes: 25 additions & 0 deletions usr/share/rockchip-iqfiles/imx219_rpi-camera-v2_default.xml

Large diffs are not rendered by default.

0 comments on commit e995d9b

Please sign in to comment.