From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Sat, 10 Sep 2022 14:28:42 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oWzbD-00DAak-5X for lore@lore.pengutronix.de; Sat, 10 Sep 2022 14:28:42 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1oWzbE-00064X-7U; Sat, 10 Sep 2022 14:28:40 +0200 Received: from lx20.hoststar.hosting ([168.119.41.54]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWzaP-00064K-Jl; Sat, 10 Sep 2022 14:27:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at; s=mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Cc: References:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe :List-Post:List-Owner:List-Archive; bh=2SZSYwVp5El3HoB9qC152Ae+nINdrzPT30RDpuzNEW0=; b=L9zFbKV9Jhh9I5pqgNDafQZzk1 Q7SiNQKRsnqvdIVKe7QHPAqC2QQGpInh+JEK3EcDfn1GSulayYWF/tf0NmOIBEOodc9OMXPD0Hy9Y BagXWJOpxWqH2fHRTFO9xXdupvx40XAheFa4yDSV/IviyqdBkn6JO40SMB1LLkWUNvk4=; Received: from 194-208-208-245.tele.net ([194.208.208.245]:63665 helo=[192.168.100.105]) by lx20.hoststar.hosting with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.93) (envelope-from ) id 1oWzaM-00HYk7-Dg; Sat, 10 Sep 2022 14:27:48 +0200 Message-ID: <49557c69-0628-2679-f5c4-175bffce41a1@emfend.at> Date: Sat, 10 Sep 2022 14:27:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Content-Language: de-DE To: ptxdist@pengutronix.de References: <20220908072918.406891-1-matthias.fend@emfend.at> <20220908072918.406891-2-matthias.fend@emfend.at> From: Matthias Fend In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.ext.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-4.2 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [ptxdist] [PATCH 1/1] libcamera: new package X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Michael Olbrich Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Hi Michael, Am 09.09.2022 um 11:46 schrieb Michael Olbrich: > On Thu, Sep 08, 2022 at 09:29:18AM +0200, Matthias Fend wrote: >> libcamera is an open source camera stack and framework for Linux, Android, >> and ChromeOS. >> >> Signed-off-by: Matthias Fend >> --- >> ...t-information-for-version-generation.patch | 29 ++++ >> .../series | 4 + >> rules/libcamera.in | 90 ++++++++++++ >> rules/libcamera.make | 137 ++++++++++++++++++ >> 4 files changed, 260 insertions(+) >> create mode 100644 patches/libcamera-68683d3811a803aa087c38a2063cf64c8d084d49/0001-do-not-use-git-information-for-version-generation.patch >> create mode 100644 patches/libcamera-68683d3811a803aa087c38a2063cf64c8d084d49/series >> create mode 100644 rules/libcamera.in >> create mode 100644 rules/libcamera.make >> >> diff --git a/patches/libcamera-68683d3811a803aa087c38a2063cf64c8d084d49/0001-do-not-use-git-information-for-version-generation.patch b/patches/libcamera-68683d3811a803aa087c38a2063cf64c8d084d49/0001-do-not-use-git-information-for-version-generation.patch >> new file mode 100644 >> index 000000000..3e5c5ce68 >> --- /dev/null >> +++ b/patches/libcamera-68683d3811a803aa087c38a2063cf64c8d084d49/0001-do-not-use-git-information-for-version-generation.patch >> @@ -0,0 +1,29 @@ >> +From: Matthias Fend >> +Date: Wed, 31 Aug 2022 16:54:20 +0200 >> +Subject: [PATCH] do not use git information for version generation >> + >> +Since libcamera is checked out without a git repo, git version reports the >> +version of the BSP. Since this is obviously wrong, just use the project >> +version. >> + >> +Signed-off-by: Matthias Fend >> +--- >> + meson.build | 5 ++--- >> + 1 file changed, 2 insertions(+), 3 deletions(-) >> + >> +diff --git a/meson.build b/meson.build >> +index 72919102ad55..e333df59388d 100644 >> +--- a/meson.build >> ++++ b/meson.build >> +@@ -20,9 +20,8 @@ libcamera_git_version = run_command('utils/gen-version.sh', >> + meson.project_build_root(), >> + meson.project_source_root(), >> + check: false).stdout().strip() >> +-if libcamera_git_version == '' >> +- libcamera_git_version = meson.project_version() >> +-endif >> ++ >> ++libcamera_git_version = meson.project_version() >> + >> + libcamera_version = libcamera_git_version.split('+')[0] >> + >> diff --git a/patches/libcamera-68683d3811a803aa087c38a2063cf64c8d084d49/series b/patches/libcamera-68683d3811a803aa087c38a2063cf64c8d084d49/series >> new file mode 100644 >> index 000000000..6ca42eafc >> --- /dev/null >> +++ b/patches/libcamera-68683d3811a803aa087c38a2063cf64c8d084d49/series >> @@ -0,0 +1,4 @@ >> +# generated by git-ptx-patches >> +#tag:base --start-number 1 >> +0001-do-not-use-git-information-for-version-generation.patch >> +# c3a57143ea9764ab95b84a7fb79896f4 - git-ptx-patches magic >> diff --git a/rules/libcamera.in b/rules/libcamera.in >> new file mode 100644 >> index 000000000..0a103fc51 >> --- /dev/null >> +++ b/rules/libcamera.in >> @@ -0,0 +1,90 @@ >> +## SECTION=multimedia_libs >> + >> +config LIBCAMERA >> + bool >> + prompt "libcamera" >> + select HOST_MESON >> + select HOST_SYSTEM_PYTHON3 >> + select HOST_SYSTEM_PYTHON3_JINJA2 >> + select HOST_SYSTEM_PYTHON3_PYYAML >> + select HOST_SYSTEM_PYTHON3_PLY >> + select GNUTLS >> + select UDEV_LIBUDEV >> + select LIBYAML >> + select LIBUNWIND if LIBCAMERA_BACKTRACE >> + select GSTREAMER1 if LIBCAMERA_GSTREAMER >> + select GST_PLUGINS_BASE1 if LIBCAMERA_GSTREAMER >> + select LIBEVENT if LIBCAMERA_CAM >> + select QT5 if LIBCAMERA_QCAM >> + select QT5_MODULE_QTBASE if LIBCAMERA_QCAM >> + select QT5_MODULE_QTBASE_GUI if LIBCAMERA_QCAM >> + select QT5_MODULE_QTBASE_WIDGETS if LIBCAMERA_QCAM >> + help >> + A complex camera support library for Linux, Android, and ChromeOS. >> + >> +if LIBCAMERA >> + >> +config LIBCAMERA_GSTREAMER >> + bool >> + prompt "install GStreamer plugin" >> + >> +config LIBCAMERA_CAM >> + bool >> + prompt "install cam test application" >> + >> +config LIBCAMERA_QCAM >> + bool >> + prompt "install qcam test application" >> + >> +config LIBCAMERA_BACKTRACE >> + bool >> + prompt "enable tracing support" >> + >> +endif >> + >> +menu "IPAs" >> + >> +config LIBCAMERA_IPA_IPU3 >> + bool >> + prompt "ipu3" >> + >> +config LIBCAMERA_IPA_RASPBERRYPI >> + bool >> + prompt "raspberrypi" >> + >> +config LIBCAMERA_IPA_RKISP1 >> + bool >> + prompt "rkisp1" >> + >> +config LIBCAMERA_IPA_VIMC >> + bool >> + prompt "vimc" >> +endmenu >> + >> +menu "Pipelines" >> + >> +config LIBCAMERA_PIPELINE_IPU3 >> + bool >> + prompt "ipu3" >> + >> +config LIBCAMERA_PIPELINE_RASPBERRYPI >> + bool >> + prompt "raspberrypi" >> + >> +config LIBCAMERA_PIPELINE_RKISP1 >> + bool >> + prompt "rkisp1" >> + >> +config LIBCAMERA_PIPELINE_SIMPLE >> + bool >> + prompt "simple" >> + >> +config LIBCAMERA_PIPELINE_UVCVIDEO >> + bool >> + prompt "uvcvideo" >> + >> +config LIBCAMERA_PIPELINE_VIMC >> + bool >> + prompt "vimc" >> + >> +endmenu >> diff --git a/rules/libcamera.make b/rules/libcamera.make >> new file mode 100644 >> index 000000000..3ed9e2a71 >> --- /dev/null >> +++ b/rules/libcamera.make >> @@ -0,0 +1,137 @@ >> +# -*-makefile-*- >> +# >> +# Copyright (C) 2022 by Matthias Fend >> +# >> +# For further information about the PTXdist project and license conditions >> +# see the README file. >> +# >> + >> +# >> +# We provide this package >> +# >> +PACKAGES-$(PTXCONF_LIBCAMERA) += libcamera >> + >> +# >> +# Paths and names >> +# >> +LIBCAMERA_VERSION := 68683d3811a803aa087c38a2063cf64c8d084d49 > > Please use a faked git-describe string: 2022-08-30-g68683d3811a8 > (-g). > >> +LIBCAMERA_MD5 := 0a1c0f6656dae9dc338b46aab50d83f9 >> +LIBCAMERA := libcamera-$(LIBCAMERA_VERSION) >> +LIBCAMERA_SUFFIX := tar.gz >> +LIBCAMERA_URL := https://git.libcamera.org/libcamera/libcamera.git;tag=$(LIBCAMERA_VERSION) >> +LIBCAMERA_SOURCE := $(SRCDIR)/$(LIBCAMERA).$(LIBCAMERA_SUFFIX) >> +LIBCAMERA_DIR := $(BUILDDIR)/$(LIBCAMERA) >> +LIBCAMERA_LICENSE := Apache-2.0 AND \ >> + BSD-2-Clause AND BSD-3-Clause AND \ >> + CC0-1.0 AND CC-BY-SA-4.0 AND \ >> + GPL-2.0-or-later AND GPL-2.0 WITH Linux-syscall-note AND \ >> + (GPL-2.0+ WITH Linux-syscall-note OR MIT) AND LGPL-2.1-or-later >> +LIBCAMERA_LICENSE_FILES := file://LICENSES/Apache-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \ >> + file://LICENSES/BSD-2-Clause.txt;md5=63d6ee386b8aaba70b1bf15a79ca50f2 \ >> + file://LICENSES/BSD-3-Clause.txt;md5=954f4d71a37096249f837652a7f586c0 \ >> + file://LICENSES/CC0-1.0.txt;md5=6fd064768b8d61c31ddd0540570fbd33 \ >> + file://LICENSES/CC-BY-SA-4.0.txt;md5=598a2bb2d212cf9bc240fb554efcb169 \ >> + file://LICENSES/GPL-2.0-or-later.txt;md5=fed54355545ffd980b814dab4a3b312c \ >> + file://LICENSES/GPL-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ >> + file://LICENSES/Linux-syscall-note.txt;md5=370f20aa0795bf47c9a50d8cee5a7cfb \ >> + file://LICENSES/GPL-2.0+.txt;md5=fed54355545ffd980b814dab4a3b312c \ >> + file://LICENSES/MIT.txt;md5=38aa75cf4c4c87f018227d5ec9638d75 \ >> + file://LICENSES/LGPL-2.1-or-later.txt;md5=2a4f4fd2128ea2f65047ee63fbca9f68 >> + >> +# ---------------------------------------------------------------------------- >> +# Prepare >> +# ---------------------------------------------------------------------------- >> + >> +LIBCAMERA_IPAS := >> +LIBCAMERA_IPAS += $(call ptx/ifdef,PTXCONF_LIBCAMERA_IPA_IPU3,ipu3) >> +LIBCAMERA_IPAS += $(call ptx/ifdef,PTXCONF_LIBCAMERA_IPA_RASPBERRYPI,raspberrypi) >> +LIBCAMERA_IPAS += $(call ptx/ifdef,PTXCONF_LIBCAMERA_IPA_RKISP1,rkisp1) >> +LIBCAMERA_IPAS += $(call ptx/ifdef,PTXCONF_LIBCAMERA_IPA_VIMC,vimc) > > For stuff like that I prefer: > > LIBCAMERA_IPAS-y := > LIBCAMERA_IPAS-$(PTXCONF_LIBCAMERA_IPA_IPU3) += ipu3 > ... > >> + >> +LIBCAMERA_IPAS := $(strip $(LIBCAMERA_IPAS)) >> +LIBCAMERA_IPAS := $(subst $(ptx/def/space),$(ptx/def/comma),$(LIBCAMERA_IPAS)) > > I'd do this as part of the LIBCAMERA_CONF_OPT. Then yoy can reuse the > variable below. > >> + >> +LIBCAMERA_PIPELINES := >> +LIBCAMERA_PIPELINES += $(call ptx/ifdef,PTXCONF_LIBCAMERA_PIPELINE_IPU3,ipu3) >> +LIBCAMERA_PIPELINES += $(call ptx/ifdef,PTXCONF_LIBCAMERA_PIPELINE_RASPBERRYPI,raspberrypi) >> +LIBCAMERA_PIPELINES += $(call ptx/ifdef,PTXCONF_LIBCAMERA_PIPELINE_RKISP1,rkisp1) >> +LIBCAMERA_PIPELINES += $(call ptx/ifdef,PTXCONF_LIBCAMERA_PIPELINE_SIMPLE,simple) >> +LIBCAMERA_PIPELINES += $(call ptx/ifdef,PTXCONF_LIBCAMERA_PIPELINE_UVCVIDEO,uvcvideo) >> +LIBCAMERA_PIPELINES += $(call ptx/ifdef,PTXCONF_LIBCAMERA_PIPELINE_VIMC,vimc) >> + >> +LIBCAMERA_PIPELINES := $(strip $(LIBCAMERA_PIPELINES)) >> +LIBCAMERA_PIPELINES := $(subst $(ptx/def/space),$(ptx/def/comma),$(LIBCAMERA_PIPELINES)) > > same here. > >> + >> +LIBCAMERA_CONF_TOOL := meson >> +LIBCAMERA_CONF_OPT := \ >> + $(CROSS_MESON_USR) \ >> + -Dandroid=disabled \ >> + -Dcam=$(call ptx/endis,PTXCONF_LIBCAMERA_CAM)d \ >> + -Ddocumentation=disabled \ >> + -Dgstreamer=$(call ptx/endis,PTXCONF_LIBCAMERA_GSTREAMER)d \ >> + -Dipas=$(LIBCAMERA_IPAS) \ >> + -Dlc-compliance=disabled \ >> + -Dpipelines=$(LIBCAMERA_PIPELINES) \ >> + -Dqcam=$(call ptx/endis,PTXCONF_LIBCAMERA_QCAM)d \ >> + -Dtest=false \ >> + -Dtracing=$(call ptx/endis,PTXCONF_LIBCAMERA_TRACING)d \ >> + -Dv4l2=false \ >> + -Dpycamera=disabled >> + >> +# ---------------------------------------------------------------------------- >> +# Target-Install >> +# ---------------------------------------------------------------------------- >> + >> +define install_ipa >> + @$(call install_copy, libcamera, 0, 0, 0644, -, /usr/lib/libcamera/ipa_$(strip $(1)).so, 0) > > Use 'n' as the last argument. And this should have a comment, why this > library is not stripped. > >> + @$(call install_copy, libcamera, 0, 0, 0644, -, /usr/lib/libcamera/ipa_$(strip $(1)).so.sign) >> + @$(call install_copy, libcamera, 0, 0, 0755, -, /usr/libexec/libcamera/$(strip $(2))_ipa_proxy) >> + @$(call install_alternative_tree, libcamera, 0, 0, /usr/share/libcamera/ipa/$(strip $(2))) > > Break all four lines before the filename. > >> +endef >> + >> +$(STATEDIR)/libcamera.targetinstall: >> + @$(call targetinfo) >> + >> + @$(call install_init, libcamera) >> + @$(call install_fixup, libcamera, PRIORITY, optional) >> + @$(call install_fixup, libcamera, SECTION, base) >> + @$(call install_fixup, libcamera, AUTHOR, "Matthias Fend ") >> + @$(call install_fixup, libcamera, DESCRIPTION, missing) >> + >> + @$(call install_lib, libcamera, 0, 0, 0644, libcamera) >> + @$(call install_lib, libcamera, 0, 0, 0644, libcamera-base) >> + >> +ifdef PTXCONF_LIBCAMERA_IPA_IPU3 >> + @$(call install_ipa, ipu3, ipu3) >> +endif >> + >> +ifdef PTXCONF_LIBCAMERA_IPA_RASPBERRYPI >> + @$(call install_ipa, rpi, raspberrypi) >> +endif >> + >> +ifdef PTXCONF_LIBCAMERA_IPA_RKISP1 >> + @$(call install_ipa, rkisp1, rkisp1) >> +endif >> + >> +ifdef PTXCONF_LIBCAMERA_IPA_VIMC >> + @$(call install_ipa, vimc, vimc) >> +endif >> + > > @$(foreach ipa,$(LIBCAMERA_IPAS-y), \ > $(call install_ipa, $(ipa), $(ipa))$(ptx/nl)) > > Untested, instead of the stuff above. This was actually my first attempt where I noticed that there is a slight inconsistency in the names of the RaspberryPI IPA. The build option and module proxy are named "raspberrypi", while the IPA module itself uses "rpi" :/ As an alternative to the current variant, one could of course also create a second list with the actual IPA module names. But I'm not sure if that's better. Any favors? Thank you for your comments and improvements. ~Matthias > > Michael > >> +ifdef PTXCONF_LIBCAMERA_GSTREAMER >> + @$(call install_lib, libcamera, 0, 0, 0644, gstreamer-1.0/libgstlibcamera) >> +endif >> + >> +ifdef PTXCONF_LIBCAMERA_CAM >> + @$(call install_copy, libcamera, 0, 0, 0755, -, /usr/bin/cam) >> +endif >> + >> +ifdef PTXCONF_LIBCAMERA_QCAM >> + @$(call install_copy, libcamera, 0, 0, 0755, -, /usr/bin/qcam) >> +endif >> + >> + @$(call install_finish, libcamera) >> + >> + @$(call touch) >> + >> +# vim: syntax=make >> -- >> 2.25.1 >> >> >> >