diff --git a/.forgejo/workflows/build-alpine.yaml b/.forgejo/workflows/build-alpine.yaml new file mode 100644 index 000000000..9fc5ff5ea --- /dev/null +++ b/.forgejo/workflows/build-alpine.yaml @@ -0,0 +1,58 @@ +name: PostmarketOS Build +run-name: PostmarketOS Build +on: + push: + workflow_dispatch: + +jobs: + prepare: + name: Prepare + runs-on: Pmbootstrap + outputs: + time: ${{ steps.time.outputs.time }} + steps: + - name: Set start Time + id: time + shell: sh + run: echo time=$(date +"%Y%m%d%H%M%S") >> $GITHUB_OUTPUT + - name: Update pmbootstrap + uses: actions/pmbootstrap-update@master + - name: Remove libcamera aport + run: rm -rf ${{env.PMB_PMAPORTS}}/temp/libcamera + + build: + name: Build for ${{ matrix.info.arch }} + runs-on: Pmbootstrap + strategy: + matrix: + info: + - arch: x86_64 + - arch: aarch64 + needs: prepare + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Build packages + id: build + uses: actions/pmbootstrap-build@main + with: + name: libcamera + aports: ${{github.workspace}}/package/alpine + arch: ${{ matrix.info.arch }} + src: ${{github.workspace}} + time: ${{ needs.prepare.outputs.time }} + - name: "Upload packages" + uses: actions/upload-alpine-package@main + with: + files: ${{steps.build.outputs.packages}} + secret: ${{secrets.PACKAGE_TOKEN}} + + clean: + name: "Clean" + runs-on: Pmbootstrap + needs: build + if: always() + continue-on-error: true + steps: + - name: Update pmbootstrap + uses: actions/pmbootstrap-update@master diff --git a/.forgejo/workflows/sync-with-upstream.yaml b/.forgejo/workflows/sync-with-upstream.yaml new file mode 100644 index 000000000..651aeaa4a --- /dev/null +++ b/.forgejo/workflows/sync-with-upstream.yaml @@ -0,0 +1,35 @@ +name: Sync fork with upstream +run-name: Sync fork with upstream +on: + schedule: + - cron: "@daily" + workflow_dispatch: + +jobs: + sync: + name: Sync + runs-on: Misc + steps: + - name: Check out repository code + uses: actions/checkout@v4 + with: + depth: 0 + token: ${{ secrets.PUSH_TOKEN }} + - name: Add upstream remote + run: git remote add upstream ${{ github.server_url }}/mirror/libcamera + - name: Status + run: git status + - name: Fetch upstream changes + run: git fetch upstream + - name: Status + run: git status + - name: Checkout to branch + run: git checkout ${{ github.ref_name }} + - name: Status + run: git status + - name: Status + run: git remote get-url --all upstream + - name: Rebase changes + run: git rebase upstream/master || git status + - name: Push changes + run: git push --force diff --git a/package/alpine/APKBUILD b/package/alpine/APKBUILD new file mode 100644 index 000000000..93ede5b0f --- /dev/null +++ b/package/alpine/APKBUILD @@ -0,0 +1,117 @@ +pkgname=libcamera +pkgver=9999999 +pkgrel=0 +pkgdesc="Linux camera framework" +url="https://libcamera.org/" +arch="all" +license="LGPL-2.1-or-later AND GPL-2.0-or-later" +depends_dev=" + eudev-dev + glib-dev + gnutls-dev + gst-plugins-bad-dev + qt6-qtbase-dev + " + +makedepends="$depends_dev + coreutils + doxygen + graphviz + gtest-dev + libevent-dev + libpisp-dev + libunwind-dev + libyuv-dev + linux-headers + meson + py3-jinja2 + py3-ply + py3-sphinx + py3-yaml + qt6-qttools-dev + yaml-dev + " +subpackages=" + $pkgname-dbg + $pkgname-dev + $pkgname-doc + $pkgname-gstreamer + $pkgname-tools + " +source="" +builddir="$srcdir/$pkgname" +# gstreamer tests fail +# manual strip because ipa .sign files depend on the file contents- have to re-sign after strip +options="!strip !check" + +case "$CARCH" in +arm*|aarch64) + subpackages="$subpackages" + ;; +esac + +case "$CARCH" in +ppc64le|s390x|riscv64|loongarch64) + # doesn't install any ipa + ;; +*) + depends="$pkgname-ipa" + subpackages="$subpackages $pkgname-ipa" + ;; +esac + +build() { + abuild-meson \ + -Dtest=false \ + -Dv4l2=false \ + -Dwerror=false \ + -Dpipelines=simple \ + -Dipas=simple \ + . output + meson compile -C output +} + +check() { + meson test -C output --print-errorlogs +} + +package() { + DESTDIR="$pkgdir" meson install --no-rebuild -C output + + # manual strip first.. + scanelf --recursive \ + --nobanner \ + --etype "ET_DYN,ET_EXEC" \ + --format "%F" \ + "$pkgdir" \ + | while read -r file; do + strip "$file" + done +} + +ipa() { + depends="" + amove usr/lib/libcamera + # then sign ipa's + local ipa + for ipa in "$subpkgdir"/usr/lib/libcamera/ipa/ipa*.so; do + msg "signing $ipa" + "$builddir"/src/ipa/ipa-sign.sh \ + "$(find "$builddir"/output -type f -iname "*ipa-priv-key.pem")" \ + "$ipa" \ + "$ipa".sign + done +} + +gstreamer() { + depends="" + amove usr/lib/gstreamer-1.0 +} + +tools() { + depends="" + amove usr/bin/cam + amove usr/bin/lc-compliance +} + +sha512sums=""