uTox-git: Import uTox-0.5.0 as wip/uTox-git.
authorMateusz Poszwa <old4@o2.pl>
Wed, 30 Dec 2015 04:58:14 +0000 (05:58 +0100)
committerMateusz Poszwa <old4@o2.pl>
Wed, 30 Dec 2015 04:58:38 +0000 (05:58 +0100)
uTox is a free software lighweight X.org graphical Tox client.

uTox can be used for:
 * 1-to-1 text IM
 * group IM
 * audio calls
 * video calls
 * group audio calls
 * desktop sharing
 * file transfers

uTox-git/DESCR [new file with mode: 0644]
uTox-git/Makefile [new file with mode: 0644]
uTox-git/PLIST [new file with mode: 0644]
uTox-git/distinfo [new file with mode: 0644]
uTox-git/patches/patch-Makefile [new file with mode: 0644]
uTox-git/patches/patch-src_main.h [new file with mode: 0644]
uTox-git/patches/patch-src_xlib_main.c [new file with mode: 0644]
uTox-git/patches/patch-src_xlib_v4l.c [new file with mode: 0644]
uTox-git/patches/patch-src_xlib_video.c [new file with mode: 0644]

diff --git a/uTox-git/DESCR b/uTox-git/DESCR
new file mode 100644 (file)
index 0000000..6aaa7f0
--- /dev/null
@@ -0,0 +1,10 @@
+uTox is a free software lighweight X.org graphical Tox client.
+
+uTox can be used for:
+ * 1-to-1 text IM
+ * group IM
+ * audio calls
+ * video calls
+ * group audio calls
+ * desktop sharing
+ * file transfers
diff --git a/uTox-git/Makefile b/uTox-git/Makefile
new file mode 100644 (file)
index 0000000..22501da
--- /dev/null
@@ -0,0 +1,29 @@
+# $NetBSD$
+
+DISTNAME=      uTox-0.5.0
+CATEGORIES=    chat
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=GrayHatter/}
+
+GIT_REPOSITORIES=      uTox
+GIT_REPO.uTox= http://github.com/GrayHatter/uTox.git
+WRKSRC=        ${WRKDIR}/uTox
+
+MAINTAINER=    pkgsrc-users@NetBSD.org
+HOMEPAGE=      http://utox.org/
+COMMENT=       Lightweight Tox client for the desktop
+LICENSE=       gnu-gpl-v3
+
+NO_CONFIGURE=  yes
+USE_TOOLS+=    gmake pkg-config
+
+.include "../../wip/toxcore/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../wip/openal-soft/buildlink3.mk"
+.include "../../graphics/libv4l/buildlink3.mk"
+.include "../../sysutils/dbus/buildlink3.mk"
+
+.include "../../sysutils/desktop-file-utils/desktopdb.mk"
+.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
+
+.include "../../wip/mk/git-package.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/uTox-git/PLIST b/uTox-git/PLIST
new file mode 100644 (file)
index 0000000..a96d9b8
--- /dev/null
@@ -0,0 +1,19 @@
+@comment $NetBSD$
+bin/utox
+man/man1/utox.1
+share/applications/utox.desktop
+share/icons/hicolor/128x128/apps/utox.png
+share/icons/hicolor/14x14/apps/utox.png
+share/icons/hicolor/16x16/apps/utox.png
+share/icons/hicolor/192x192/apps/utox.png
+share/icons/hicolor/22x22/apps/utox.png
+share/icons/hicolor/24x24/apps/utox.png
+share/icons/hicolor/256x256/apps/utox.png
+share/icons/hicolor/32x32/apps/utox.png
+share/icons/hicolor/36x36/apps/utox.png
+share/icons/hicolor/48x48/apps/utox.png
+share/icons/hicolor/512x512/apps/utox.png
+share/icons/hicolor/64x64/apps/utox.png
+share/icons/hicolor/72x72/apps/utox.png
+share/icons/hicolor/96x96/apps/utox.png
+share/icons/hicolor/scalable/apps/utox.svg
diff --git a/uTox-git/distinfo b/uTox-git/distinfo
new file mode 100644 (file)
index 0000000..158281e
--- /dev/null
@@ -0,0 +1,7 @@
+$NetBSD$
+
+SHA1 (patch-Makefile) = 5d4be90089c550fe23269f82794714671149c900
+SHA1 (patch-src_main.h) = b4cfefec1f239d870403578bababef1a54889fe3
+SHA1 (patch-src_xlib_main.c) = ca58bd2868299e1ff4a1ea04e2459af89761d885
+SHA1 (patch-src_xlib_v4l.c) = 159ac6e676c0361262daeb3f5324e4916b09b16a
+SHA1 (patch-src_xlib_video.c) = b072978c84b5577b76ddb2f8085b2cc2f1df6290
diff --git a/uTox-git/patches/patch-Makefile b/uTox-git/patches/patch-Makefile
new file mode 100644 (file)
index 0000000..13a5497
--- /dev/null
@@ -0,0 +1,81 @@
+$NetBSD$
+
+Treat non-Cygwin platforms similarly.
+Use dl library only on Linux.
+
+--- Makefile.orig      2015-12-29 21:26:38.000000000 +0000
++++ Makefile
+@@ -18,7 +18,24 @@ ifeq ($(FILTER_AUDIO), 1)
+       CFLAGS += -DAUDIO_FILTERING
+ endif
+-ifeq ($(UNAME_S), Linux)
++ifeq ($(UNAME_O), Cygwin)
++      OUT_FILE = utox.exe
++
++      CFLAGS  += -static
++      LDFLAGS += /usr/x86_64-w64-mingw32/sys-root/mingw/lib/libwinpthread.a
++
++      CFLAGS  += $(shell x86_64-w64-mingw32-pkg-config --cflags $(DEPS))
++      LDFLAGS += $(shell x86_64-w64-mingw32-pkg-config --libs   $(DEPS))
++
++      LDFLAGS += -liphlpapi -lws2_32 -lgdi32 -lmsimg32 -ldnsapi -lcomdlg32
++      LDFLAGS += -Wl,-subsystem,windows -lwinmm -lole32 -loleaut32 -lstrmiids
++
++      OS_SRC = $(wildcard src/windows/*.c)
++      OS_OBJ = $(OS_SRC:.c=.o)
++
++      TRAY_OBJ = icons/icon.o
++      TRAY_GEN = x86_64-w64-mingw32-windres icons/icon.rc -O coff -o
++else
+       OUT_FILE = utox
+       DEPS += fontconfig freetype2 x11 xext xrender
+@@ -41,8 +58,10 @@ ifeq ($(UNAME_S), Linux)
+       endif
+       CFLAGS += $(shell pkg-config --cflags $(DEPS))
+-
+-      LDFLAGS += -lresolv -ldl
++      LDFLAGS += -lresolv
++      ifeq ($(UNAME_S), Linux)
++              LDFLAGS += -ldl
++      endif
+       LDFLAGS += $(shell pkg-config --libs $(DEPS))
+       OS_SRC = $(wildcard src/xlib/*.c)
+@@ -50,23 +69,6 @@ ifeq ($(UNAME_S), Linux)
+       TRAY_OBJ = icons/utox-128x128.o
+       TRAY_GEN = $(LD) -r -b binary icons/utox-128x128.png -o
+-else ifeq ($(UNAME_O), Cygwin)
+-      OUT_FILE = utox.exe
+-
+-      CFLAGS  += -static
+-      LDFLAGS += /usr/x86_64-w64-mingw32/sys-root/mingw/lib/libwinpthread.a
+-
+-      CFLAGS  += $(shell x86_64-w64-mingw32-pkg-config --cflags $(DEPS))
+-      LDFLAGS += $(shell x86_64-w64-mingw32-pkg-config --libs   $(DEPS))
+-
+-      LDFLAGS += -liphlpapi -lws2_32 -lgdi32 -lmsimg32 -ldnsapi -lcomdlg32
+-      LDFLAGS += -Wl,-subsystem,windows -lwinmm -lole32 -loleaut32 -lstrmiids
+-
+-      OS_SRC = $(wildcard src/windows/*.c)
+-      OS_OBJ = $(OS_SRC:.c=.o)
+-
+-      TRAY_OBJ = icons/icon.o
+-      TRAY_GEN = x86_64-w64-mingw32-windres icons/icon.rc -O coff -o
+ endif
+@@ -123,8 +125,8 @@ install: utox
+       install -m 644 src/utox.desktop $(DESTDIR)$(PREFIX)/share/applications/utox.desktop
+       if [ "$(UNITY)" -eq "1" ]; then echo "X-MessagingMenu-UsesChatSection=true" >> $(DESTDIR)$(PREFIX)/share/applications/utox.desktop; fi
+-      mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1
+-      install -m 644 src/utox.1 $(DESTDIR)$(PREFIX)/share/man/man1/utox.1
++      mkdir -p $(DESTDIR)$(PREFIX)/man/man1
++      install -m 644 src/utox.1 $(DESTDIR)$(PREFIX)/man/man1/utox.1
+ $(OBJ): %.o: %.c $(HEADERS)
+       @echo "  CC    $@"
diff --git a/uTox-git/patches/patch-src_main.h b/uTox-git/patches/patch-src_main.h
new file mode 100644 (file)
index 0000000..646ef59
--- /dev/null
@@ -0,0 +1,15 @@
+$NetBSD$
+
+The volatile macro is used in {amd64,i386,machine}/mcontext.h on NetBSD.
+
+--- src/main.h.orig    2015-12-29 21:26:38.000000000 +0000
++++ src/main.h
+@@ -30,7 +30,7 @@
+ #define countof(x) (sizeof(x)/sizeof(*(x)))
+ //  fixes compile with apple headers
+-#ifndef __OBJC__
++#if !defined(__OBJC__) && !defined(__NetBSD__)
+ #define volatile(x) (*((volatile typeof(x)*)&x))
+ #endif
diff --git a/uTox-git/patches/patch-src_xlib_main.c b/uTox-git/patches/patch-src_xlib_main.c
new file mode 100644 (file)
index 0000000..c05aae2
--- /dev/null
@@ -0,0 +1,33 @@
+$NetBSD$
+
+Avoid using Linux-specific headers when not compiling for Linux.
+
+--- src/xlib/main.c.orig       2015-12-29 21:26:38.000000000 +0000
++++ src/xlib/main.c
+@@ -73,8 +73,9 @@ void postmessage(uint32_t msg, uint16_t 
+     XFlush(display);
+ }
+-
++#ifdef __LINUX__
+ #include <linux/input.h>
++#endif
+ FILE *ptt_keyboard_handle;
+ Display *ptt_display;
+ void init_ptt(void){
+@@ -100,6 +101,7 @@ _Bool check_ptt_key(void){
+     int ptt_key;
+     /* First, we try for direct access to the keyboard. */
++#ifdef __LINUX__
+     ptt_key = KEY_LEFTCTRL;                                      // TODO allow user to change this...
+     if (ptt_keyboard_handle) {
+         /* Nice! we have direct access to the keyboard! */
+@@ -117,6 +119,7 @@ _Bool check_ptt_key(void){
+             return 0;
+         }
+     }
++#endif
+     /* Okay nope, lets' fallback to xinput... *pouts*
+      * Fall back to Querying the X for the current keymap. */
+     ptt_key = XKeysymToKeycode(display, XK_Control_L);
diff --git a/uTox-git/patches/patch-src_xlib_v4l.c b/uTox-git/patches/patch-src_xlib_v4l.c
new file mode 100644 (file)
index 0000000..5b4f17c
--- /dev/null
@@ -0,0 +1,20 @@
+$NetBSD$
+
+Use Linux headers when on Linux, not when not on OpenBSD.
+
+--- src/xlib/v4l.c.orig        2015-12-29 21:26:38.000000000 +0000
++++ src/xlib/v4l.c
+@@ -3,10 +3,10 @@
+ int utox_v4l_fd = -1;
+ #include <sys/mman.h>
+-#ifdef __OpenBSD__
+-#include <sys/videoio.h>
+-#else
++#ifdef __Linux__
+ #include <linux/videodev2.h>
++#else
++#include <sys/videoio.h>
+ #endif
+ #ifndef NO_V4LCONVERT
diff --git a/uTox-git/patches/patch-src_xlib_video.c b/uTox-git/patches/patch-src_xlib_video.c
new file mode 100644 (file)
index 0000000..df941eb
--- /dev/null
@@ -0,0 +1,17 @@
+$NetBSD$
+
+The volatile macro is used in {amd64,i386,machine}/mcontext.h on NetBSD.
+
+--- src/xlib/video.c.orig      2015-12-29 21:26:38.000000000 +0000
++++ src/xlib/video.c
+@@ -151,6 +151,10 @@ _Bool video_init(void *handle) {
+     if(isdesktop(handle)) {
+         utox_v4l_fd = -1;
++#ifndef volatile
++#define volatile(x) (*((volatile typeof(x)*)&x))
++#endif
++
+         video_x = volatile(grabx);
+         video_y = volatile(graby);
+         video_width = volatile(grabpx);