From 5b268a1a6a39955799afdff46cadc9c0dcbd5e3e Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Wed, 25 Jun 2014 09:13:57 +0200 Subject: [PATCH 1/4] Try to fix autoconnect (Tox/toxic#158) --- README.md | 10 ++++++++-- build/Makefile | 26 +++++++++++++++++--------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 695c532..4a14851 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,20 @@ Toxic is an ncurses-based instant messaging client for [Tox](https://tox.im) whi ### Compiling 1. `cd build/` -2. `make` -3. `sudo make install DESTDIR="/where/to/install"` +2. `make PREFIX="/where/to/install"` +3. `sudo make install PREFIX="/where/to/install"` ### Compilation Notes * You can add specific flags to the Makefile with `USER_CFLAGS=""` and/or `USER_LDFLAGS=""` * You can pass your own flags to the Makefile with `CFLAGS=""` and/or `LDFLAGS=""` (this will supersede the default ones) * Audio call support is automatically enabled if all dependencies are found +### Packaging +* For packaging purpose, you can use `DESTDIR=""` to specify a temporary directory where store installed files +* `DESTDIR=""` can be used in addition to `PREFIX=""`: + * `DESTDIR=""` is meant to specify a temporary directory where store installed files (ex: "/tmp/build/pkg") + * `PREFIX=""` is meant to specify a prefix directory for binaries and data files (ex: "/usr/local") + ### Troubleshooting If your default prefix is "/usr/local" and you receive the following: ``` diff --git a/build/Makefile b/build/Makefile index b9a943e..cfc4f24 100644 --- a/build/Makefile +++ b/build/Makefile @@ -2,15 +2,21 @@ TOXIC_VERSION = 0.4.2 REV = $(shell git rev-list HEAD --count) VERSION = $(TOXIC_VERSION)_r$(REV) -LIBS = libtoxcore ncursesw - -CFLAGS = -std=gnu99 -pthread -Wimplicit-function-declaration -Wreturn-type -DTOXICVER="\"$(VERSION)\"" -CFLAGS += -DHAVE_WIDECHAR -D_XOPEN_SOURCE_EXTENDED -CFLAGS += $(USER_CFLAGS) -LDFLAGS = $(USER_LDFLAGS) CFG_DIR = ../cfg SRC_DIR = ../src -DESTDIR = /usr/local +MISC_DIR = ../misc +PREFIX = /usr/local +BINDIR = $(PREFIX)/bin +DATADIR = $(PREFIX)/share/toxic +DATAFILES = $(MISC_DIR)/DHTnodes $(MISC_DIR)/toxic.config + +LIBS = libtoxcore ncursesw + +CFLAGS = -std=gnu99 -pthread -Wimplicit-function-declaration -Wreturn-type +CFLAGS += -DTOXICVER="\"$(VERSION)\"" -DHAVE_WIDECHAR -D_XOPEN_SOURCE_EXTENDED +CFLAGS += -DPACKAGE_DATADIR="\"$(DATADIR)\"" +CFLAGS += $(USER_CFLAGS) +LDFLAGS = $(USER_LDFLAGS) OBJ = chat.o chat_commands.o configdir.o dns.o execute.o OBJ += file_senders.o friendlist.o global_commands.o groupchat.o line_info.o @@ -82,8 +88,10 @@ toxic: $(OBJ) $(CC) $(CFLAGS) -o toxic $(OBJ) $(LDFLAGS) install: toxic - mkdir -pv $(DESTDIR)/bin - install -m 0755 toxic $(DESTDIR)/bin + @mkdir -p $(DESTDIR)/$(BINDIR) + @mkdir -p $(DESTDIR)/$(DATADIR) + install -m 0755 toxic $(DESTDIR)/$(BINDIR) + install -m 0644 $(DATAFILES) $(PREFIX)/$(DATADIR) %.o: $(SRC_DIR)/%.c $(CC) $(CFLAGS) -o $*.o -c $(SRC_DIR)/$*.c From 7db3dcbdf6c531c6756d360157e9ff504a22a3d6 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Wed, 25 Jun 2014 09:53:05 +0200 Subject: [PATCH 2/4] Makefile: fix typo --- build/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Makefile b/build/Makefile index cfc4f24..b8328ad 100644 --- a/build/Makefile +++ b/build/Makefile @@ -91,7 +91,7 @@ install: toxic @mkdir -p $(DESTDIR)/$(BINDIR) @mkdir -p $(DESTDIR)/$(DATADIR) install -m 0755 toxic $(DESTDIR)/$(BINDIR) - install -m 0644 $(DATAFILES) $(PREFIX)/$(DATADIR) + install -m 0644 $(DATAFILES) $(DESTDIR)/$(DATADIR) %.o: $(SRC_DIR)/%.c $(CC) $(CFLAGS) -o $*.o -c $(SRC_DIR)/$*.c From dfd89f2b5c7e0c41ab94581af0f3f163acd2e00d Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Wed, 25 Jun 2014 09:56:31 +0200 Subject: [PATCH 3/4] Makefile: fix typo...again --- build/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Makefile b/build/Makefile index b8328ad..53947ba 100644 --- a/build/Makefile +++ b/build/Makefile @@ -8,7 +8,7 @@ MISC_DIR = ../misc PREFIX = /usr/local BINDIR = $(PREFIX)/bin DATADIR = $(PREFIX)/share/toxic -DATAFILES = $(MISC_DIR)/DHTnodes $(MISC_DIR)/toxic.config +DATAFILES = $(MISC_DIR)/DHTnodes $(MISC_DIR)/toxic.conf LIBS = libtoxcore ncursesw From 599c2119d51f7f0f7557feb0581eb1842db56b96 Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Wed, 25 Jun 2014 10:54:05 +0200 Subject: [PATCH 4/4] README.md: better wording --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4a14851..7b21218 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ Toxic is an ncurses-based instant messaging client for [Tox](https://tox.im) whi * Audio call support is automatically enabled if all dependencies are found ### Packaging -* For packaging purpose, you can use `DESTDIR=""` to specify a temporary directory where store installed files +* For packaging purpose, you can use `DESTDIR=""` to specify a directory where to store installed files * `DESTDIR=""` can be used in addition to `PREFIX=""`: - * `DESTDIR=""` is meant to specify a temporary directory where store installed files (ex: "/tmp/build/pkg") + * `DESTDIR=""` is meant to specify a directory where to store installed files (ex: "/tmp/build/pkg") * `PREFIX=""` is meant to specify a prefix directory for binaries and data files (ex: "/usr/local") ### Troubleshooting