eggdrop icon indicating copy to clipboard operation
eggdrop copied to clipboard

Add language-path option to config

Open ismell opened this issue 8 years ago • 5 comments

Same thing as help-path and mod-path but for language files.

ismell avatar Nov 05 '17 16:11 ismell

To better evaluate this, can you help provide a use case for when/why language paths would be elsewhere? The more we can understand user intent, the (hopefully) better product we can churn out. Thanks!

vanosg avatar Nov 06 '17 01:11 vanosg

I have an eggdrop installed by a package manager. Without being able to set the help-path it requires that I either make a symlink to the help dir in my bots working directory to the system provided help path, or patch the headers with the system help path. See https://github.com/ismell/pkgsrc/blob/6aceea71d3e95aa947ba50282e8f0e60adb2b238/chat/eggdrop/patches/patch-langdir and https://github.com/ismell/pkgsrc/blob/6aceea71d3e95aa947ba50282e8f0e60adb2b238/chat/eggdrop/Makefile#L18

ismell avatar Nov 07 '17 14:11 ismell

see #176 netbsd doesn't want us to hardcode a relative LANGDIR: http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/chat/eggdrop/patches/patch-src_eggdrop.h see also: http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/chat/eggdrop/PLIST

i was also thinking, whether the netbsd packaging may be wrong here, but meanwhile i see other packagings are also patching it somehow, for example arch linux aur:

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=eggdrop

[...] Don't complain about language files on startup. sed -i "s|"./language"|"$_sharedir/$pkgname/language"|g" src/eggdrop.h [...] for d in language scripts help text; do mv "$eggtmp/${d}" "$pkgdir/$_sharedir/$pkgname" done [...]

so, currently eggdrop is meant to be installed into a single user directory like /home/user/eggdrop or single systemwide directory like /opt/eggdrop but its not friendly to package managers who want to install eggdrop into "normal" system directories to fit into the existing file system structure with /usr/share and the like.

so this issue is about package manager friendliness, and here is a real bug to fix.

there is more: in language.c there is: src/language.c: char *ldir = getenv("EGG_LANGDIR"); so besides the netbsd and arch linux solutions there would be a 3rd solution: via environment variable. but i its deep hidden in the source, and neither systems picked it up. so i would also like to get rid of that variable in favor of a more general solution as we use it already for other directory paths

btw: we have addlang config option. we should not need an alternative environment var EGG_LANG.

my first proposal was: new eggdrop.conf variable lang-path remove LANGDIR from eggdrop.h and set default lang-path in eggdrop.conf ( CFLAGS -DLANGDIR is not supported without netbsd patch, so we can remove it for 1.8, but we should drop the package maintainer of eggdrop pkgsrc a note about the change ) deprecate warning for EGG_LANG and EGG_LANGUAGE for 1.8, and removal for 1.9

but then i saw, this is NOT possible. eggdrop loads languages before loading its config file, so that new config variable wouldn't be available in time

i looked at the package install in netbsd and arch linux aur and i think netbsd does it right but arch linux aur is flawed, and it knows when it comments: "This is ugly.." in: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=eggdrop

so now proposal is, to set the language path, like you would set library path, with a config option for configure --languagedir=DIR user executables [EPREFIX/language] or utilize datarootdir (.../share/eggdrop/)

i think its time, to not install eggdrop to users home by default, but, like any other package out there, install to /usr... and let the user change this with ./configure --prefix

michaelortmann avatar Aug 23 '18 04:08 michaelortmann

irc discussion result:

change ./configure --prefix to install all parts off eggdrop into 'expected' directories, like prefix/bin and prefix/lib. will ease system wide installation, as long as you remember, you have to specify --prefix /usr explicitely because if you dont, then eggdrop will install in a backward compatible manner into the users home.

we can also change that backward compatible manner with eggdrop 2.0, i hope.

the new --prefix behaviour is fine even for multiple eggdrops per user, because we already have the -c option to start each eggdrop with.

the new --prefix behavior will also bring us better support for language directory, because then it can be specified at configure time. we could even add a --languagedir option to configure.

the test could preferably be done with package managers like dbrewery, because i see freebsd eggdrop ports are kind of... zombies... 1.6.21_1 and 1.8.0.20141008_2.

see also hier(7) to see which files should be put in which directories.

don't worry about telling the user to set LD_LIBRARY_PATH, if eggdrop is installed with ./configure/make... it will know where to find stuff and thus it will be able to load modules/etc there and could set whatever ENV it needs itself.

we also want this prefix change, because of #709

michaelortmann avatar Aug 27 '18 19:08 michaelortmann

I agree with this. Those paths should be in config.h defines then instead of in the config (at least their defaults).

To address compatibility (because we have 20 year old outstanding guides out there that aren't going to change), we could discuss still doing what we do now if prefix is not supplied, or bold messages.

See also https://www.gnu.org/software/make/manual/html_node/Directory-Variables.html for implementation details

thommey avatar Nov 24 '19 09:11 thommey