mini-eq icon indicating copy to clipboard operation
mini-eq copied to clipboard

How to make a zip app

Open pkzc opened this issue 1 month ago • 2 comments

In case anyone is interested, I managed to create a mini-eq zip app, it went surprisingly smoothly. (Now I see I should have used a tag like [Info]: in the title, but I don't know how to add it afterwards.)

I am on Fedora Linux 44, and used the latest mini-eq 0.8.9. Here is what I did:


Prerequisites for compilation:

sudo dnf install \
  python3-pip cmake glib2-devel pipewire-devel gobject-introspection-devel

Compile and install:

python -m pip install mini-eq
rm ~/.local/bin/mini-eq            # this is created by install for some reason

Can be removed:

- ~/.local/lib/python3.14/site-packages/.pipewire_gobject.mesonpy.libs/pkgconfig
- ~/.local/lib/python3.14/site-packages/mini_eq-0.8.9.dist-info
- ~/.local/lib/python3.14/site-packages/pipewire_gobject-0.3.10.dist-info
- ~/.local/lib/python3.14/site-packages/pipewire_gobject/gir
- ~/.local/lib/python3.14/site-packages/mini_eq/__pycache__
- ~/.local/lib/python3.14/site-packages/pipewire_gobject/__pycache__
- ~/.local/lib/python3.14/site-packages/mini_eq/assets

Modifications for the python zip app:

mv ~/.local/lib/python3.14/site-packages/mini_eq/__main__.py \
   ~/.local/lib/python3.14/site-packages/mini_eq/main.py
mv -f pipewire_gobject/__init__.py \
      ~/.local/lib/python3.14/site-packages/pipewire_gobject/__init__.py
mv -f __main__.py \
      ~/.local/lib/python3.14/site-packages/

The pipewire_gobject/__init__.py and __main__.py files in the last two steps are here: init.py main.py

Create python zip app:

cd ~/.local/lib/python3.14/site-packages
strip --strip-unneeded .pipewire_gobject.mesonpy.libs/libpwg-0.1.so.0.3.10
rm -f mini-eq; python -m zipapp -c -p '/bin/python3' -o mini-eq .

Clean up:

  • move zipapp to its place (I use -rwxr-xr-x 1 root root 244249 Oct 25 08:57 /usr/local/bin/mini-eq)
  • delete mini-eq site-packages
  • (remove devel packages)

I have quite a minimal Fedora system with MATE desktop, still I had all mini-eq python prerequisite packages already present, such as pygobject, pycairo, numpy, libebur128 so I got a clean deps list:

$ mini-eq --check-deps
Mini EQ dependency check

Required:
  [OK] Python 3.11+: running Python 3.14.8
  [OK] PyGObject: imported from /usr/lib64/python3.14/site-packages/gi/__init__.py
  [OK] pycairo: imported from /usr/lib64/python3.14/site-packages/cairo/__init__.py
  [OK] GTK 4 GI namespace: Gtk.Button.set_can_shrink is available
  [OK] GDK 4 GI namespace: GI namespace Gdk 4.0
  [OK] GSK 4 GI namespace: GI namespace Gsk 4.0
  [OK] Graphene GI namespace: GI namespace Graphene 1.0
  [OK] Libadwaita 1.7+ GI namespace: Adw.WrapBox is available
  [OK] pipewire-gobject: imported from /usr/local/bin/mini-eq/pipewire_gobject/__init__.py; GI namespace Pwg 0.1; Pwg library 0.3.10
  [OK] PipeWire session: wpctl is available and responsive
  [OK] PipeWire filter-chain module: module found at /usr/lib64/pipewire-0.3/libpipewire-module-filter-chain.so
  [OK] PipeWire loopback module: module found at /usr/lib64/pipewire-0.3/libpipewire-module-loopback.so
  [OK] PipeWire SPA builtin filter graph plugin: SPA plugin found at /usr/lib64/spa-0.2/filter-graph/libspa-filter-graph-plugin-builtin.so

Optional features:
  [OK] NumPy FFT analyzer: imported from /usr/lib64/python3.14/site-packages/numpy/__init__.py
  [OK] libebur128 loudness meter: libebur128 1.2.6

All required dependencies are available.

pkzc avatar Oct 25 '26 08:10 pkzc

In __main__._extract_bundled() with resources.path('__main__') as zad: may be used, it's nicer.

pkzc avatar Oct 25 '26 11:10 pkzc

Thanks for sharing your zipapp experiment and the Fedora/MATE details. This is a useful community example. Mini EQ does not currently provide or test an official zipapp. Native libraries and application assets need particular care, and system Python packages should not be removed as part of a general installation recipe. We’ll consider whether a supported portable distribution is practical.

bhack avatar Oct 28 '26 22:10 bhack