Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to package the application as an installable arch linux package #13

Open
adithyasunil04 opened this issue Oct 6, 2024 · 2 comments

Comments

@adithyasunil04
Copy link
Collaborator

I have struggled to find an effective way to package maneki application as an installable arch linux package, the program is written fully in python. The primary executable script is called main.py and this script sources files such as pngs and scripts to work from src directory, could any one suggest me a suitable method?

If you may need to reorganize the directory tree of this repo, instead of sending PR to master branch, pls do send PR to a test branch for building arch programs that i shall create shortly

@rajatkriplani
Copy link
Contributor

Did you try makepkg -si in the root directory where PKGBUILD is present?

@rajatkriplani
Copy link
Contributor

package maneki application as an installable arch linux package as follows:

  1. Organize application follow python standards as follow:
maneki/
├── maneki/
│   ├── __init__.py
│   ├── main.py
│   ├── src/ (UI, PNG, scripts)
├── setup.py
├── PKGBUILD
└── README.md
  1. Modify code for resource access by using pkg_resourcesf or importlib.resources to access bundled files:
ui_path = pkg_resources.resource_filename('maneki', 'src/ui/welcomeScreen.ui')
  1. setup.py for packaging:
setup(
    name='maneki',
    packages=find_packages(),
    include_package_data=True,
    entry_points={'gui_scripts': ['maneki = maneki.main:main']},
)
  1. MANIFEST.in
recursive-include maneki/src *
  1. PKGBUILD
depends=('python' 'python-pyqt5')
build() { python setup.py build; }
package() { python setup.py install --root="$pkgdir/"; }
  1. Building and testing package:
  • source tarball: python setup.py sdist
  • build package: makepkg
  • install: sudo pacman -U maneki-*.pkg.tar.zst
  • Adjust paths in code to use installed locations.
  • testing in a virtual environment to avoid conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants