qw3rtty / neix

neix - a RSS/Atom feed reader for your terminal.
GNU General Public License v3.0
200 stars 12 forks source link

[BUG] Packaging fails due to "$ENV{HOME}" #9

Closed g4jc closed 3 years ago

g4jc commented 3 years ago

The current CMake works when compiling locally, but when using most build scripts, the build user is not the same. This results in a hardcoded path runtime error in the final binary. e.g.:

[neix] Loading configuration files
[neix] Failed to load: /var/tmp/portage/net-news/neix-9999/homedir/.config/neix/neix.conf
[neix] Configuration file not found!

Expected behavior The program should detect the current users home folder and fall back to copying /usr/share/neix.conf.example to their home folder, as is common practice.

qw3rtty commented 3 years ago

Thanks for opening this issue! I did not tried yet a build script.

I will fix it.

qw3rtty commented 3 years ago

I fixed the hardcoded runtime path. It get's the home directory of the current user.

fall back to copying /usr/share/neix.conf.example to their home folder, as is common practice

I will fix this as next :)

Can I aks you for which package manager you will package it?

qw3rtty commented 3 years ago

fall back to copying /usr/share/neix.conf.example to their home folder, as is common practice

I fixed this.

qw3rtty commented 3 years ago

There is problem by copy the default files.

qw3rtty commented 3 years ago

I could fix it again :)

g4jc commented 3 years ago

Yes, it seems the copy function isn't working just yet. However it functions fine after manually copying.

Also it is installing into the root directory /neix rather than /usr/share/neix, however that can be resolved by passing include(GNUInstallDirs) into CMakeLists.txt.

I will send a PR for the /usr/share fix. I made an ebuild for Gentoo users as I am currently testing it on Gentoo.

The www-apps/neix-9999.ebuild is available here: http://paste.debian.net/plain/1162794

It could be included on the wiki here in github if it is useful to anyone.

Thanks!