doctorfree / MusicPlayerPlus

Featureful ncurses based MPD client inspired by ncmpc with integration for Beets, spectrum visualization,Bandcamp/Soundcloud, asciimatics, cantata, and more
https://musicplayerplus.dev
MIT License
69 stars 1 forks source link

AUR arch package please #1

Closed se7en-x230 closed 1 year ago

se7en-x230 commented 1 year ago

Easy to install and try arch package available via AUR?

doctorfree commented 1 year ago

I plan to look into Arch Linux packaging soon. I do not currently have a system available on which I can install Arch Linux for build/test/packaging. Perhaps I will create a bootable USB with Arch. Feel free to bug me about it :)

se7en-x230 commented 1 year ago

I can test the build i you can cook up a PKGBUILD file with build.and dependency instructions.

doctorfree commented 1 year ago

@se7en-x230 I will take you up on that offer. One hurdle that must be cleared is identifying the dependencies. Each distribution seems to have its own package name and sometimes version for various packages. It's a pain to produce a software distribution for multiple platforms, even just Ubuntu and Fedora, as the package names differ so much. This is one of my pet peeves with Linux distros. But, I will figure it out. This dependency task for MusicPlayerPlus is particularly nasty as there are so many dependencies. I will let you know when I have something to test.

se7en-x230 commented 1 year ago

Looks like project AUR is on the way.

doctorfree commented 1 year ago

Yes, I am full steam ahead on project AUR. I'm able to build a package and install it. I'm using a bootable USB stick so everything is slowed down considerably but workable. Still in the learning phase but no roadblocks or showstoppers yet. I would say the makepkg/pacman/PKGBUILD system is pretty slick. I did get hit by the "bleeding edge" when I discovered that the current Arch repository has a newer version of ffmpeg (5.x) but some of the MusicPlayerPlus components only build with ffmpeg 4.x. It took me a bit to figure out how to specify ffmpeg4.4 as the package dependency.

Good progress. I should have something to test later this week or next week. I will attach the PKGBUILD files and test package in a comment on this issue when ready for testing.

se7en-x230 commented 1 year ago

Pulls in the dependencies but doesn't build

Why is gnome terminal a dependency? Any terminal would work or?

doctorfree commented 1 year ago

Pulls in the dependencies but doesn't build

I'm still working on the PKGBUILD scripting. I should have something for you to test later today. I will upload an attachment with the PKGBUILD files along with build instructions. Appreciate the help!

Why is gnome terminal a dependency? Any terminal would work or?

Yes, any terminal would work. I've been mulling over in the back of my mind how to remove the dependency on a specific terminal emulator and just use whatever the user normally runs. The problem is that the spectrum visualizer included in MusicPlayerPlus, mppcava, is a character based application and the display of the audio frequency spectrum looks better with a smaller font size. I chose gnome-terminal because I can programmatically create a gnome terminal profile with the font size I want. Some other terminal emulators support programmatic font size specification either with profiles or command line arguments.

The other issue with controlling which terminal emulator is used is the syntax of command line arguments used to tell the terminal emulator what command to run. It differs from terminal to terminal.

Anyway, I would like to eliminate the dependency on a specific terminal emulator so if you have any suggestions I will add those to my thinking.

doctorfree commented 1 year ago

Attached is a gzip'd tar archive of the current MusicPlayerPlus PKGBUILD files. Download the archive and execute the following:

tar xf MusicPlayerPlus-pkgbuild-2.0.1-2.tar.gz
cd musicplayerplus
makepkg --log

There may be some build dependencies still to add to PKGBUILD but it builds successfully on my test system.

@se7en-x230 thanks for motivating me to get this done. Let me know how it goes. If it fails to build and package on your system, the log files may be of some help. Upload them here if we need to debug.

MusicPlayerPlus-pkgbuild-2.0.1-2.tar.gz

doctorfree commented 1 year ago

I've found a problem with the installation of the package created with the above PKGBUILD. It may serve to test if you can build and package MusicPlayerPlus but it does not produce a package that installs correctly. I will try to get an updated PKGBUILD uploaded here as soon as I can.

doctorfree commented 1 year ago

The PKGBUILD was referencing a variable that was set in the packaging scripts for other platforms but not in PKGBUILD. The corrected PKGBUILD archive is attached here.

MusicPlayerPlus-pkgbuild-2.0.1-2.tar.gz

se7en-x230 commented 1 year ago

https://0x0.st/o9au.1-2-x86_ https://0x0.st/o9aS.1-2-x86_

image

And thanks that you work on a PKGBUILD It's a month full to build.

doctorfree commented 1 year ago

image

It looks like there is a bit to learn about PKGBUILD dependencies for projects that use Rust. I will try to sort this out, it doesn't look too bad. Thanks for finding this, I did not notice it because I already have Rustup and Cargo installed and configured.

https://wiki.archlinux.org/title/Rust_package_guidelines

se7en-x230 commented 1 year ago

I don't know which cargo package it refers to. There is no plain cargo package in arch.

doctorfree commented 1 year ago

I followed the Arch Rust package guidelines at https://wiki.archlinux.org/title/Rust_package_guidelines

After uninstalling Rustup on my Arch test system I am performing a test build with the revised PKGBUILD.

If all goes well I will upload it here. Rust is tricky for several reasons but also very cool for other reasons. It is commonly installed using curl rather than a package manager so specifying the build dependency can be problematic. The guidelines say to just use cargo as the build dependency but that means you could end up with two Rust installations, one from downloading with curl and the other from installing with a package manager. I guess it's buyer beware.

The actual package in Arch is rust rather than cargo but the rust package includes both cargo, the Rust dependency manager, and rustc, the compiler and toolchain. So, install the Arch rust package to meet the build dependency. Alternately, one could install the rustup package followed by installing the desired toolchain with rustup. But we don't need the flexibility of rustup and that's not what the guidelines indicate.

doctorfree commented 1 year ago

Here is the revised PKGBUILD with cargo build dependency and Cargo environment variables, etc according to the Arch Rust package guidelines. It's building successfully on my test system. Hopefully there are no more build dependencies I have overlooked.

On my system it takes an extremely long time for configure to check the Boost libraries. I know Boost can be slow to compile but this seems excessive. Perhaps it is due to my system being run off a USB stick. Anyway, it's irritating and somewhat concerning.

MusicPlayerPlus-pkgbuild-2.0.1-2.tar.gz

doctorfree commented 1 year ago

@se7en-x230 I am making some additional fixes to the PKGBUILD to address installation issues. If the package builds then hurrah for us but hold off on installing until I provide a clean installation on Arch.

Also, thanks for hanging in there with me. Maybe when you volunteered to help test you did not think it would be days of work. Hopefully we are getting close.

se7en-x230 commented 1 year ago

Yes boost is painful to build. I guess your best guess is to provide a musicplayerplus.bin file in AUR once the source build correctly. It builds VERY slow :) but ... image

after manually removing the man for yt-dpl it installs

image

I can't start the gnome-terminal alone as well. I will try to remove all. Install gnome-terminal up front and see if that works if the terminal is already present

Nope same with removing musicplayerplus, installing gnome-terminal and than installing musicplayerplus again.

doctorfree commented 1 year ago

@se7en-x230 thanks for the issue reports. The first error above, conflict with yt-dlp, can be resolved fairly easily. The second, terminal profiles not created correctly, will require more effort. But, the package built for you, right? So we are allowed to declare ourselves winners and do a short victory dance. Then, back to work :)

Currently, MusicPlayerPlus is installing yt-dlp from PyPi on all platforms. I could not make it a package dependency because some platforms do not yet have a package for yt-dlp. Also, PyPi gets us a more recent version than some platform packages. But on Arch, since there is already a Community package, perhaps it would be preferable to simply make it a dependency. That package really pulls in a lot of Python modules! Anyway, I can fix this pretty easily. It will require some testing to verify my yt-dlp front-end still works with the Arch community package.

The failure to create terminal profiles is probably the result of me trying to use dconf on Arch in a similar fashion to how it is done on other platforms. I will have to investigate. Coincidentally, yesterday I was working on reducing the MusicPlayerPlus dependency on terminal emulators. I would like to move away from hard-coded dependence on a specific terminal emulator and profiles. Perhaps I should take this opportunity to investigate other routes wrt the use of a terminal emulator. On Arch, is there a standard terminal emulator that is widely used? I chose gnome-terminal previously as my preferred terminal partly because of its inclusion by default in targeted platforms. I will have to think about the best approach. Feel free to suggest the best approach on Arch.

Good job testing. Progress!

se7en-x230 commented 1 year ago

Correct it builds but doesn't start due to the gnome-terminal.

yt-dlp is in arch and usually a very recent version. I don't know the inner workings of your mpp but I would keep the external build packages to a minimum. So if you can use the yt-dlp from the official sources I would do so.

The terminal emulator in linux first of all depend on the desktop/wm environment. Gnome ships default with gnome and kde with konsole... and many user have a preference an might change after install. I am using a wm DWM and st as my terminal and I would not use gnome-termial anyway ;) But I understand the problem that the end result depends heavily on fonts, color ....

You might consider just for the sake of testing to leave the terminal part out completely to see what happens.

doctorfree commented 1 year ago

I moved yt-dlp to a dependency in the Arch PKGBUILD. Maybe I should make it an optional dependency. I am leaving it as a PyPi pip install on other platforms as they are farther behind and there has been a lot of work on yt-dlp lately. Note, installing from PyPi is just installing a Python wheel. The wheel is provided by the project, same as the releases in other formats. I agree, use the repos where possible and appropriate. I believe I've committed all the changes needed to address the yt-dlp issue you surfaced.

On the terminal emulator side of things, I spent a chunk of the day learning Kitty and replaced the dependency on gnome-terminal with a dependency on kitty. I'm pretty impressed with Kitty. It does everything I need plus tons more for me to explore. I really do not like using the Gnome and KDE terminal emulators as they are so entangled with the infrastructure of those desktop environments. Kitty is much faster, lighter, more features, highly configurable, and integrates well with many other components. I thought about using alacritty as it is similar but kitty has tabs and lots more alacritty does not.

Right now I am on a course to make Kitty the default terminal emulator in MusicPlayerPlus. I am leaving in support for Gnome terminal and Tilix along with Cool Retro Term but those terminals are not dependencies, they are only available if the user installs them and then uses the appropriate command line arguments to specify an alternate terminal.

Maybe I left cool-retro-term as a dependency, I forget.

It is possible to simply use the current terminal, whatever that may be, but potentially not looking/behaving as nice. I could remove all terminal dependencies and just use whatever is available. I thought about this too. But first I wanted to get Kitty working. I could eventually go with a set of supported terminals, check for them by priority on startup, if none are found then prompt the user to either select and install one or just use current terminal. It's a hassle to support more terminals though. I am leaning toward just Kitty and maybe one or two others.

doctorfree commented 1 year ago

I've opened a new issue to discuss terminal emulator support in MusicPlayerPlus in order to focus discussion here back on PKGBUILD. I'm currently working on both PKGBUILD and terminal emulator support. Comments welcome on both. See the MusicPlayerPlus terminal emulators issue 2 to comment on terminal emulators.

doctorfree commented 1 year ago

Here is the latest MusicPlayerPlus PKGBUILD for Arch. Dependencies on terminal emulators have been removed with cool-retro-term an optional dependency. Kitty is installed during mppinit and used as the default terminal emulator when not in console mode. I prefer Kitty's session management over tmux but still need tmux in console mode or if I want to support whatever terminal is currently in use. I'm going to look at st today. I'm also installing a proxmox virtual eenvironment for Arch/CentOS/Others.

Mopidy and Navidrome are pretty sweet.

MusicPlayerPlus-pkgbuild-2.0.1-2.tar.gz

doctorfree commented 1 year ago

Package submitted for inclusion in the AUR at https://aur.archlinux.org/packages/musicplayerplus

se7en-x230 commented 1 year ago

Thanks for all the work you put into the AUR package.

AUR install is running without problems.

Running mppinit stuck at installing kitty ... image

I ctrl+c out of it after 6 min. paru -S kitty installing it manually

image

I usually start mpd via a .xprofile entry mpd & which works fine in ncmpcpp

EDIT: this problem was fixed with the newest AUR version

se7en-x230 commented 1 year ago

v2.0.1r2-1 fixed the mppinit problem.

image

lauching mpplus spawns 2 terminal (my default st) closes the second terminal window right away and I am stuck at the spectrum visualizer window. EDIT: CORRECTION. Launching in kitty NOT st

image

doctorfree commented 1 year ago

@se7en-x230 thanks for the continued testing and problem reports. This last one looks like it may be an issue with how the mpplus windows are positioned. The mpplus command with no arguments just launches a couple of terminal windows, the first running the MPD client mpcplus and the second running the spectrum visualizer mppcava. Why does it encounter a problem launching the mpcplus window but not the mppcava window? I think where it is probably failing is when it tries to identify the window id so it can position it. It does something like wmctrl -l -G -x | grep kitty.kitty | ...

If you have time, you can help me debug this issue. I will try to replicate it here. To get started, can you:

I'll do the same here if I can reproduce it.

doctorfree commented 1 year ago

@se7en-x230 the problem you encountered earlier with Kitty installation hanging would not have been encountered later after manually installing Kitty. The mppinit command only tries to install Kitty if it is not already present. It does the following:

curl --silent --location https://sw.kovidgoyal.net/kitty/installer.sh > /tmp/kitty-$$.sh

then runs that Kitty installation script. You might try curl --location https://sw.kovidgoyal.net/kitty/installer.sh > /tmp/kitty-$$.sh on your system and see if it hangs. Leave the --silent argument out and maybe that will give us a clue.

Probably I should check if any of the supported terminal emulators are present and only install Kitty if none are found.