diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-12 19:09:37 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-12 19:09:37 -0500 |
| commit | b590c8d7572b727d565cc0b8ff660d43569845de (patch) | |
| tree | 06f7a4102ea4e845df8b66660f252920d52952f9 /dev-python/filebytes | |
| parent | 24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff) | |
| download | baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip | |
Diffstat (limited to 'dev-python/filebytes')
| -rw-r--r-- | dev-python/filebytes/Manifest | 1 | ||||
| -rw-r--r-- | dev-python/filebytes/filebytes-0.10.2.ebuild | 39 | ||||
| -rw-r--r-- | dev-python/filebytes/filebytes-9999.ebuild | 35 | ||||
| -rw-r--r-- | dev-python/filebytes/files/filebytes-0.10.2-py314.patch | 41 | ||||
| -rw-r--r-- | dev-python/filebytes/metadata.xml | 18 |
5 files changed, 134 insertions, 0 deletions
diff --git a/dev-python/filebytes/Manifest b/dev-python/filebytes/Manifest new file mode 100644 index 000000000000..4c0c9d138e15 --- /dev/null +++ b/dev-python/filebytes/Manifest @@ -0,0 +1 @@ +DIST filebytes-0.10.2.gh.tar.gz 1958114 BLAKE2B 6b7fb865d01cc9ea0f14b32f6e0326da21fa2fa2a36549b99ca88e9bf015162d3b0f82e350be1cca805294fd56ef47e2db4394db5ffb3061773f146eda1ba666 SHA512 12317d6b5063e710b4410e4dcc61b45c0ac1cbc80655212dacb0929a19e100849df39ba84a05cb96699abe7ec16758e0b9656b3d3ce044f3d122b8636106e564 diff --git a/dev-python/filebytes/filebytes-0.10.2.ebuild b/dev-python/filebytes/filebytes-0.10.2.ebuild new file mode 100644 index 000000000000..92e1d8e1c475 --- /dev/null +++ b/dev-python/filebytes/filebytes-0.10.2.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{13..14} ) + +inherit distutils-r1 + +DESCRIPTION="Classes/Types to read and edit executable files" +HOMEPAGE="https://github.com/sashs/filebytes" + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/sashs/filebytes" +else + SRC_URI="https://github.com/sashs/filebytes/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz" + KEYWORDS="amd64 ~arm ~arm64 ~ppc ~ppc64 x86" +fi + +LICENSE="BSD" +SLOT="0" + +PATCHES=( + "${FILESDIR}"/${PN}-0.10.2-py314.patch +) + +python_test() { + "${EPYTHON}" - <<-EOF || die "Tests failed with ${EPYTHON}" + from filebytes.elf import * + elf_file = ELF('test-binaries/ls-x86') + print("elf", elf_file.elfHeader, elf_file.sections, elf_file.segments) + + from filebytes.pe import * + pe_file = PE('test-binaries/cmd-x86.exe') + print("pe", pe_file.imageDosHeader, pe_file.sections) + EOF +} diff --git a/dev-python/filebytes/filebytes-9999.ebuild b/dev-python/filebytes/filebytes-9999.ebuild new file mode 100644 index 000000000000..d8469d179c04 --- /dev/null +++ b/dev-python/filebytes/filebytes-9999.ebuild @@ -0,0 +1,35 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{13..14} ) + +inherit distutils-r1 + +DESCRIPTION="Classes/Types to read and edit executable files" +HOMEPAGE="https://github.com/sashs/filebytes" + +if [[ ${PV} == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/sashs/filebytes" +else + SRC_URI="https://github.com/sashs/filebytes/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="BSD" +SLOT="0" + +python_test() { + "${EPYTHON}" - <<-EOF || die "Tests failed with ${EPYTHON}" + from filebytes.elf import * + elf_file = ELF('test-binaries/ls-x86') + print("elf", elf_file.elfHeader, elf_file.sections, elf_file.segments) + + from filebytes.pe import * + pe_file = PE('test-binaries/cmd-x86.exe') + print("pe", pe_file.imageDosHeader, pe_file.sections) + EOF +} diff --git a/dev-python/filebytes/files/filebytes-0.10.2-py314.patch b/dev-python/filebytes/files/filebytes-0.10.2-py314.patch new file mode 100644 index 000000000000..09f6b8f69f0e --- /dev/null +++ b/dev-python/filebytes/files/filebytes-0.10.2-py314.patch @@ -0,0 +1,41 @@ +https://github.com/sashs/filebytes/commit/469058d50d4b7ff8da54b623a0a1aa972cd78dc6 + +From 469058d50d4b7ff8da54b623a0a1aa972cd78dc6 Mon Sep 17 00:00:00 2001 +From: Seva Alekseyev <sevaa@nih.gov> +Date: Thu, 4 Dec 2025 11:24:19 -0500 +Subject: [PATCH] No more hand parsing __init__ for VERSION + +--- + setup.py | 22 ++-------------------- + 1 file changed, 2 insertions(+), 20 deletions(-) + +diff --git a/setup.py b/setup.py +index d2d7cdb..5890e5a 100644 +--- a/setup.py ++++ b/setup.py +@@ -1,22 +1,4 @@ + from setuptools import setup +-import ast +-import os +-currentDir = os.path.dirname(os.path.abspath(__file__)) +-#currentDir = Path(__file__).parent ++from filebytes.__init__ import VERSION + +-def extractMetaInfo(src): +- info = {} +- a=ast.parse(src) +- for e in a.body: +- if isinstance(e, ast.Assign) and isinstance(e.value, ast.Str): +- info[e.targets[0].id] = e.value.s +- return info +- +-text = '' +-with open(currentDir +os.path.sep+"filebytes"+ os.path.sep+"__init__.py") as f: +- text = f.read() +- +-version = extractMetaInfo(text)["VERSION"] +- +- +-setup(version=version) ++setup(version=VERSION) + diff --git a/dev-python/filebytes/metadata.xml b/dev-python/filebytes/metadata.xml new file mode 100644 index 000000000000..9e9162ff35ad --- /dev/null +++ b/dev-python/filebytes/metadata.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person" proxied="yes"> + <email>mario.haustein@hrz.tu-chemnitz.de</email> + <name>Mario Haustein</name> + </maintainer> + <maintainer type="person"> + <email>sam@gentoo.org</email> + <name>Sam James</name> + </maintainer> + <longdescription> + Python library to read and edit files in the following formats: + Executable and Linking Format (ELF), Portable Executable (PE), MachO + and OAT (Android Runtime) + </longdescription> + <origin>baldeagleos-repo</origin> +</pkgmetadata> |
