Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Translating Debian packages to Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
erg_samowzbudnik
Apprentice
Apprentice


Joined: 09 Sep 2011
Posts: 223
Location: European sticks

PostPosted: Mon Oct 07, 2024 7:38 am    Post subject: Translating Debian packages to Gentoo Reply with quote

Hi All,

I have Oak-D Lite device I'd like to use on Gentoo:
https://docs.luxonis.com/hardware/products/OAK-D%20Lite

Link to dependencies:
https://raw.githubusercontent.com/luxonis/depthai-python/refs/heads/main/docs/install_dependencies.sh

I would like to write an ebuild once I get it to a working state manually but I think I might have not installed all dependencies yet.
Could use help translating those debian packages from the script above to Gentoo packages.

I've set up a python venv environment, installed depthai_viewer with pip but I'm getting an error:
(got to use python 3.12 as dependency apache-arrow is not 3.13 ready)

$ python3.12 -m depthai_viewer
[2024-10-07T07:19:00Z ERROR eframe::native::run] Exiting because of error: Wgpu(NoSuitableAdapterFound) on event Resumed
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/erg/Oak-D_Lite/lib/python3.12/site-packages/depthai_viewer/__main__.py", line 31, in <module>
main()
File "/home/erg/Oak-D_Lite/lib/python3.12/site-packages/depthai_viewer/__main__.py", line 27, in main
sys.exit(bindings.main(sys.argv, python_exe, site_packages_directory))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: WGPU error: Failed to create wgpu adapter, no suitable adapter found. -> Failed to create wgpu adapter, no suitable adapter found.


Any advice on how to approach this beyond translating packages to Gentoo ones would be super helpful.
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1747
Location: Germany

PostPosted: Mon Oct 07, 2024 8:29 am    Post subject: Reply with quote

I can give you only some hints to follow:
https://forums.gentoo.org/viewtopic-t-917816-start-0.html
https://wiki.gentoo.org/wiki/Basic_guide_to_write_Gentoo_Ebuilds
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1709
Location: South America

PostPosted: Tue Oct 08, 2024 2:07 am    Post subject: Re: Translating Debian packages to Gentoo Reply with quote

erg_samowzbudnik wrote:
Link to dependencies:
https://raw.githubusercontent.com/luxonis/depthai-python/refs/heads/main/docs/install_dependencies.sh

I would like to write an ebuild once I get it to a working state manually but I think I might have not installed all dependencies yet.
Could use help translating those debian packages from the script above to Gentoo packages.

Let's see. As far as I can tell from https://packages.debian.org:

Code:
    python3
    python3-dev

Those are dev-lang/python on Gentoo, which you will have because of Portage :)

Code:
    python3-pip
    udev
    cmake
    git
    python3-numpy
    pkg-config
    libjpeg-dev
    libpng-dev
    libtiff-dev
    libsm6
    libxext6
    qtchooser

Those are, in order, dev-python/pip, sys-apps/systemd-utils[udev] (i. e. installed with the udev USE flag set) on Gentoo with OpenRC or sys-apps/systemd on Gentoo with systemd, dev-build/cmake, dev-vcs/git, dev-python/numpy, dev-util/pkgconf (but ebuilds should specify virtual/pkg-config), media-libs/libjpeg-turbo, media-libs/libpng, media-libs/tiff, x11-libs/libSM, x11-libs/libXext and dev-qt/qtchooser.

Code:
    libgtk2.0-dev

That is x11-libs/gtk+:2, i. e. the slot 2 package.

Code:
    libavcodec-dev
    libavformat-dev
    libswscale-dev
    ffmpeg

Those are media-video/ffmpeg.

Code:
    libtbb-dev
    libtbbmalloc2

Those are dev-cpp/tbb.

Code:
    python3-pyqt5
    python3-pyqt5.qtquick

Those are dev-python/PyQt5[declarative], i. e. installed with the declarative USE flag set.

Code:
    qtdeclarative5-dev
    qml-module-qtquick2
    qml-module-qtquick-layouts
    qml-module-qtquick-window2

Those are dev-qt/qtdeclarative:5, i. e. the slot 5 package.

Code:
    qtbase5-dev
    qt5-qmake
    qtbase5-dev-tools

Those are dev-qt/qtcore.

Code:
    qml-module-qtquick-controls2
    qml-module-qt-labs-platform

Those are dev-qt/qtquickcontrols2.

Code:
    libdc1394-dev
    libgl1-mesa-dev

And those are, in order, media-libs/libdc1394 and media-libs/mesa.

This thread probably belongs in "Unsupported Software".
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)


Last edited by GDH-gentoo on Tue Oct 08, 2024 12:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1747
Location: Germany

PostPosted: Tue Oct 08, 2024 6:16 am    Post subject: Reply with quote

Moved from Portage & Programming to Unsupported Software.
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
erg_samowzbudnik
Apprentice
Apprentice


Joined: 09 Sep 2011
Posts: 223
Location: European sticks

PostPosted: Tue Oct 08, 2024 8:40 am    Post subject: Reply with quote

@GDH-gentoo: Who are you, really?!? I feel so small now :lol:
This is super helpful, thank you so much! Exactly what I needed to get me started.
This is going to be slow going due to life, I'll come back with more questions once I hit another wall.
Back to top
View user's profile Send private message
erg_samowzbudnik
Apprentice
Apprentice


Joined: 09 Sep 2011
Posts: 223
Location: European sticks

PostPosted: Wed Oct 09, 2024 8:01 am    Post subject: Reply with quote

This is how my ebuild looks right now:

Code:
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python{3_10,3_11,3_12} )
inherit distutils-r1
inherit pypi

DESCRIPTION="depthai machine vision python package."
HOMEPAGE="https://github.com/luxonis"
COMMIT="00ca3534d2e92af2b8e3aff9a8e5bc96b6bb1993"
WORKDIR="${PORTAGE_TMPDIR}/portage/${CATEGORY}/${PF}/work"
SRC_URI="https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/depthai/depthai-0.0.2.1+${COMMIT}.tar.gz"
S="${WORKDIR}/${PF}+${COMMIT}"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
RDEPEND="
    dev-build/cmake
    dev-cpp/tbb
    dev-lang/python
    dev-vcs/git
    dev-python/numpy
    dev-python/PyQt5[declarative,gui,network]
    dev-qt/qtchooser
    dev-qt/qtcore
    dev-qt/qtdeclarative:5
    dev-qt/qtquickcontrols2
    dev-util/pkgconf
    media-libs/libdc1394
    media-libs/libjpeg-turbo
    media-libs/libpng
    media-libs/mesa
    media-libs/tiff
    media-video/ffmpeg
    sys-apps/systemd-utils[udev]
    x11-libs/gtk+:2
    x11-libs/libSM
    x11-libs/libXext
"


emerge fails with:

[edited for brevity]
Code:


(...)
CMake Warning (dev) at /usr/share/cmake/Modules/ExternalProject/shared_internal_commands.cmake:1284 (message):
  The DOWNLOAD_EXTRACT_TIMESTAMP option was not given and policy CMP0135 is
  not set.  The policy's OLD behavior will be used.  When using a URL
  download, the timestamps of extracted files should preferably be that of
  the time of extraction, otherwise code that depends on the extracted
  contents might not be rebuilt if the URL changes.  The OLD behavior
  preserves the timestamps from the archive instead, but this is usually not
  what you want.  Update your project to the NEW behavior or specify the
  DOWNLOAD_EXTRACT_TIMESTAMP option with a value of true to avoid this
  robustness issue.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/ExternalProject.cmake:3035 (_ep_add_download_command)
  CMakeLists.txt:4 (ExternalProject_Add)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- [hunter] Initializing Hunter workspace (062a19ab13ce8dffa9a882b6ce3e43bdabdf75d3)
-- [hunter]   https://github.com/cpp-pm/hunter/archive/v0.23.258.tar.gz
-- [hunter]   -> /var/tmp/portage/dev-python/depthai-0.0.2.1/homedir/.hunter/_Base/Download/Hunter/0.23.258/062a19a
CMake Error at Build/Hunter-prefix/src/Hunter-stamp/download-Hunter.cmake:163 (message):
  Each download failed!

    error: downloading 'https://github.com/cpp-pm/hunter/archive/v0.23.258.tar.gz' failed
          status_code: 6
          status_string: "Could not resolve hostname"
          log:
          --- LOG BEGIN ---
          Could not resolve host: github.com

  Could not resolve host: github.com

  closing connection #0



          --- LOG END ---
          error: downloading 'https://github.com/cpp-pm/hunter/archive/v0.23.258.tar.gz' failed
          status_code: 6
          status_string: "Could not resolve hostname"
          log:
          --- LOG BEGIN ---
          Could not resolve host: github.com

  Could not resolve host: github.com

  closing connection #0

(...)


I can download file manually.
Tried unpacking it in /var/tmp/portage/dev-python/depthai-0.0.2.1/homedir/.hunter/_Base/Download/Hunter/0.23.258/062a19a/Unpacked
Didn't help.
Back to top
View user's profile Send private message
nicop
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2014
Posts: 97

PostPosted: Wed Oct 09, 2024 10:55 am    Post subject: Reply with quote

For fail with github.com, try this solution : disable adns USE on net-misc/curl

EDIT : I think I have solved this with a change in nsswitch.conf but I don’t remember what ...
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 2730
Location: Here and Away Again

PostPosted: Wed Oct 09, 2024 11:12 am    Post subject: Reply with quote

From a quick look, since the message is from CMake, it seems like the build is trying to download things from the internet (not good).

Such attempts will fail due to the sandbox the ebuild functions are being run in.

Usually this is a problem with tests, since there are many that require network access, but sometimes there are these "fun" things people do with build systems...

All the things required should be downloaded when fetching the sources.
_________________
Kindest of regardses.
Back to top
View user's profile Send private message
erg_samowzbudnik
Apprentice
Apprentice


Joined: 09 Sep 2011
Posts: 223
Location: European sticks

PostPosted: Wed Oct 09, 2024 12:13 pm    Post subject: Reply with quote

@nicop: gave it a shot, no luck

@Chiitoo: I see, this seems like that road ends here then as I do not think I can convince maintainers to change their packaging.

Unless there's a way I do not see here, back to running a docker image it is. Sad.
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1709
Location: South America

PostPosted: Wed Oct 09, 2024 1:11 pm    Post subject: Reply with quote

Have you tried a manual build first before going the ebuild route? Not a manual installation, just a manual build. This exercise should give you an idea about the way this build system works.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
erg_samowzbudnik
Apprentice
Apprentice


Joined: 09 Sep 2011
Posts: 223
Location: European sticks

PostPosted: Wed Oct 09, 2024 1:47 pm    Post subject: Reply with quote

@GDH-gentoo: I have tried that now. It happily downloads a ton of stuff from github and luxonis website and proceeds a lot further before crashing with:

Code:
-- Found PythonInterp: /usr/bin/python (found version "3.13")
CMake Error at tools/FindPythonLibsNew.cmake:133 (message):
  Python config failure:

  Traceback (most recent call last):

    File "<string>", line 1, in <module>
      from distutils import sysconfig as s;import sys;import struct;
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  ModuleNotFoundError: No module named 'distutils'


(I do have dev-python/distutils installed, thought this provides distutils now.)

Looks like there are a lot of bodies buried here :/
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22694

PostPosted: Thu Oct 10, 2024 7:39 pm    Post subject: Reply with quote

As Chiitoo said, build systems should not do this.

For your distutils failure, I do not see dev-python/distutils in the main tree. Is this an overlay package?
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1709
Location: South America

PostPosted: Thu Oct 10, 2024 9:38 pm    Post subject: Reply with quote

The distutils module has been deprecated since Python 3.10, and removed fron Python 3.12. The recommended replacement for module distutils.sysconfig, which is what this code is trying to import, is the sysconfig module, so it looks like patching is going to be needed for working with recent versions of Python.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum