Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: How package edl (Read 351 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How package edl

https://github.com/bkerler/edl
It installs some files that I'd like to keep tracked.

Code: [Select]
git clone https://github.com/bkerler/edl.git
cd edl
git submodule update --init --recursive
chmod +x ./install-linux-edl-drivers.sh
bash ./install-linux-edl-drivers.sh
python3 setup.py build
sudo python3 setup.py install

I made initial package with makedeps from requirements.txt no idea about the deps.
A script "install-linux-edl-drivers.sh" installs a bunch of udev rules.
I noticed that setup.py installs conflicting files with the one makedep from the AUR:

Code: [Select]
pacman -Ql python-exscript  | grep bin
python-exscript /usr/bin/
python-exscript /usr/bin/exscript
python-exscript /usr/bin/otp

Code: [Select]
pkgname=edl	
pkgver=3.52.1
pkgrel=1
pkgdesc="Qualcomm Sahara / Firehose Attack Client / Diag Tools"
url="https://github.com/bkerler/edl"
license=(GPLv3)
arch=(any)
depends=()
makedepends=(python-wheel python-pyusb python-pyserial python-docopt python-pycryptodome python-pycryptodomex python-lxml python-colorama python-capstone python-keystone python-qrcode python-requests python-passlib python-exscript)
source=("$pkgname-$pkgver.tar.gz::https://github.com/bkerler/edl/archive/refs/tags/$pkgver.tar.gz")

build() {
  cd ${pkgname}-${pkgver}
  git submodule update --init --recursive
  python3 setup.py build
}

package() {
  cd ${pkgname}-${pkgver}
  python3 setup.py build install
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
  install -Dm644 LICENSE Drivers/50-android.rules "$pkgdir"/etc/udev/rules.d/50-android.rules
  install -Dm644 LICENSE Drivers/51-edl.rules "$pkgdir"/etc/udev/rules.d/51-edl.rules
  install -Dm644 LICENSE Drivers/69-libmtp.rules "$pkgdir"/etc/udev/rules.d/69-libmtp.rules
  install -Dm644 LICENSE Drivers/blacklist-qcserial.conf "$pkgdir"/etc/modprobe.d/blacklist-qcserial.conf
}

I installed makedeps , and I cannot compile it I have this error with the head of the repo:
Code: [Select]
Searching for pylzma
Reading https://pypi.org/simple/pylzma/
Downloading https://files.pythonhosted.org/packages/03/d8/10ef072c3cd4301a65a1b762b09eefa02baf8da23b9ea77ebe9546499975/pylzma-0.5.0.tar.gz#sha256=b874172afbf37770e643bf2dc9d9b6b03eb95d8f8162e157145b3fe9e1b68a1c
Best match: pylzma 0.5.0
Processing pylzma-0.5.0.tar.gz
Writing /tmp/easy_install-i0wxkd6a/pylzma-0.5.0/setup.cfg
Running pylzma-0.5.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-i0wxkd6a/pylzma-0.5.0/egg-dist-tmp-ifbtgykb
/usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
/usr/lib/python3.12/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
  warnings.warn(msg)
no previously-included directories found matching 'src/sdk.orig'
/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
/tmp/easy_install-i0wxkd6a/pylzma-0.5.0/setup.py:105: UnsupportedPlatformWarning: Multithreading is not supported on the platform "linux",
please contact [email protected] for more informations.
  warn("""\
src/pylzma/pylzma.c: In function ‘PyInit_pylzma’:
src/pylzma/pylzma.c:296:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
  296 |     PyEval_InitThreads();
      |     ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.12/Python.h:95,
                 from src/pylzma/pylzma.c:26:
/usr/include/python3.12/ceval.h:132:37: note: declared here
  132 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
      |                                     ^~~~~~~~~~~~~~~~~~
src/pylzma/pylzma_aes.c:158:5: error: initialization of ‘long int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
  158 |     NULL,                                /* printfunc  tp_print;   */
      |     ^~~~
src/pylzma/pylzma_aes.c:158:5: note: (near initialization for ‘CAESDecrypt_Type.tp_vectorcall_offset’)
error: Setup script exited with error: command '/usr/bin/gcc' failed with exit code 1


Re: How package edl

Reply #1
From https://github.com/bkerler/edl/issues/550#issuecomment-2131498616:
Quote
instead of "sudo python setup.py install"

just do "sudo pip3 install edl"

(I had to 'sudo pip3 install timecode' before it worked, but probably only because im mixing sudo and venvs)
Using venv it worked.
I had to install timecode and setuptools.
Not sure to how you do in the package.

Edit: when I ran edl it was missing pylzma and when I tried to install it with pip I had the same error:
Code: [Select]
src/pylzma/pylzma_aes.c:158:5: error: initialization of ‘long int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]

Re: How package edl

Reply #2
I'm pretty sure venv's shouldn't be used in PKGBUILD's ?
Instead you should be creating extra packages, where dependencies cannot be met from current repo's (or the AUR).

There is a edl-git package on the AUR.

The dependencies on the AUR webpage state
Quote
python (python37AUR, python311AUR, python310AUR)
As the package is fairly up to date and claims a requirement for older python versions that suggest to me it's likely that it (or an AUR dep)  doesn't work with 3.12.
Which seems to be what you are encountering ?

 

Re: How package edl

Reply #3
The AUR package builds fine and works too.
The  PKGBUILD uses normal python.