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

Makefile: passes DESTDIR to CFLAGS when defining LOCALEDIR #264

Closed
pabs3 opened this issue Aug 30, 2019 · 3 comments

Comments

@pabs3
Copy link
Contributor

commented Aug 30, 2019

The Makefile passes DESTDIR to CFLAGS when defining LOCALEDIR, this means that I just run make install DESTDIR=... instead of running make and then make install DESTDIR=..., then the binary will get the wrong path to the locales and so no translations will work:

$ make install DESTDIR=debian/purple-discord
cc -fPIC -O2 -g -pipe -Wall -std=c99 -DDISCORD_PLUGIN_VERSION='"0.9.2019.08.30.git.df0d11a"' -DMARKDOWN_PIDGIN -DENABLE_NLS -DLOCALEDIR=\"debian/purple-discord/usr/share/locale\"  -shared -o libdiscord.so libdiscord.c markdown.c -Wl,-z,relro `pkg-config purple glib-2.0 json-glib-1.0 --libs --cflags`   -Ipurple2compat -g -ggdb

The usual way that Makefiles handle DESTDIR is to only use DESTDIR in the install targets.

For purple-discord I'd suggest moving the $(DESTDIR) variable usage out of LOCALEDIR and into a new LOCALE_DEST variable to use in the install targets, something like this should fix the problem:

LOCALEDIR = $(shell $(PKG_CONFIG) --variable=datadir purple-3)/locale
LOCALE_DEST = $(DESTDIR)$(LOCALEDIR)
...
CFLAGS += -DLOCALEDIR=\"$(LOCALEDIR)\"
...
%-locale-install: po/%.mo^M
        install -D -m $(FILE_PERM) -p po/$(*F).mo $(LOCALE_DEST)/$(*F)/LC_MESSAGES/purple-discord.mo
EionRobb added a commit that referenced this issue Aug 30, 2019
@EionRobb

This comment has been minimized.

Copy link
Owner

commented Aug 30, 2019

Can you give that commit a spin and see if it does the trick?

@pabs3

This comment has been minimized.

Copy link
Contributor Author

commented Aug 30, 2019

@EionRobb

This comment has been minimized.

Copy link
Owner

commented Aug 30, 2019

chur :)

@EionRobb EionRobb closed this Aug 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.