pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toxic: Import toxic-0.7.0 as wip/toxic.



Module Name:	pkgsrc-wip
Committed By:	Mateusz Poszwa <old4%o2.pl@localhost>
Pushed By:	f8l
Date:		Tue Dec 29 03:21:19 2015 +0100
Changeset:	035e9e269132165d890814d156a6807207533923

Modified Files:
	Makefile
Added Files:
	toxic/DESCR
	toxic/Makefile
	toxic/PLIST
	toxic/distinfo
	toxic/patches/patch-Makefile
	toxic/patches/patch-cfg_global__vars.mk
	toxic/patches/patch-src_name__lookup.c
	toxic/patches/patch-src_toxic.c
	toxic/patches/patch-src_video__device.c

Log Message:
toxic: Import toxic-0.7.0 as wip/toxic.

Toxic is a Tox-based instant messenging client which formerly resided
in the Tox core repository, and is now available as a standalone application.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=035e9e269132165d890814d156a6807207533923

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                |   1 +
 toxic/DESCR                             |   2 +
 toxic/Makefile                          |  31 ++++++
 toxic/PLIST                             |  16 +++
 toxic/distinfo                          |   7 ++
 toxic/patches/patch-Makefile            |  16 +++
 toxic/patches/patch-cfg_global__vars.mk |  15 +++
 toxic/patches/patch-src_name__lookup.c  |  14 +++
 toxic/patches/patch-src_toxic.c         |  14 +++
 toxic/patches/patch-src_video__device.c | 181 ++++++++++++++++++++++++++++++++
 10 files changed, 297 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 3fb06d9..47cb78f 100755
--- a/Makefile
+++ b/Makefile
@@ -3823,6 +3823,7 @@ SUBDIR+=	tor-dev
 SUBDIR+=	torcs
 SUBDIR+=	torsocks
 SUBDIR+=	tortunnel
+SUBDIR+=	toxic
 SUBDIR+=	toxcore
 SUBDIR+=	tpp
 SUBDIR+=	tqsllib
diff --git a/toxic/DESCR b/toxic/DESCR
new file mode 100644
index 0000000..7b950d3
--- /dev/null
+++ b/toxic/DESCR
@@ -0,0 +1,2 @@
+Toxic is a Tox-based instant messenging client which formerly resided
+in the Tox core repository, and is now available as a standalone application.
diff --git a/toxic/Makefile b/toxic/Makefile
new file mode 100644
index 0000000..412f37f
--- /dev/null
+++ b/toxic/Makefile
@@ -0,0 +1,31 @@
+# $NetBSD$
+
+DISTNAME=	toxic-0.7.0
+CATEGORIES=	chat
+MASTER_SITES=	${MASTER_SITE_GITHUB:=JFreegman/}
+
+GIT_REPOSITORIES=	toxic
+GIT_REPO.toxic=	https://github.com/JFreegman/toxic.git
+WRKSRC=	${WRKDIR}/toxic
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://wiki.tox.chat/clients/toxic
+COMMENT=	CLI Tox client
+LICENSE=	gnu-gpl-v3
+
+NO_CONFIGURE=	yes
+USE_TOOLS+=	gmake pkg-config
+USE_LANGUAGES+=	c
+
+.include "../../wip/toxcore/buildlink3.mk"
+
+.include "../../audio/openal/buildlink3.mk"
+.include "../../converters/qrencode/buildlink3.mk"
+.include "../../devel/libconfig/buildlink3.mk"
+.include "../../devel/ncursesw/buildlink3.mk"
+.include "../../www/curl/buildlink3.mk"
+.include "../../x11/xproto/buildlink3.mk"
+
+.include "../../sysutils/desktop-file-utils/desktopdb.mk"
+.include "../../wip/mk/git-package.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/toxic/PLIST b/toxic/PLIST
new file mode 100644
index 0000000..b6fd7eb
--- /dev/null
+++ b/toxic/PLIST
@@ -0,0 +1,16 @@
+@comment $NetBSD$
+bin/toxic
+man/man1/toxic.1
+man/man5/toxic.conf.5
+share/applications/toxic.desktop
+share/toxic/DHTnodes
+share/toxic/nameservers
+share/toxic/sounds/ToxicContactOffline.wav
+share/toxic/sounds/ToxicContactOnline.wav
+share/toxic/sounds/ToxicError.wav
+share/toxic/sounds/ToxicIncomingCall.wav
+share/toxic/sounds/ToxicOutgoingCall.wav
+share/toxic/sounds/ToxicRecvMessage.wav
+share/toxic/sounds/ToxicTransferComplete.wav
+share/toxic/sounds/ToxicTransferStart.wav
+share/toxic/toxic.conf.example
diff --git a/toxic/distinfo b/toxic/distinfo
new file mode 100644
index 0000000..b2555cd
--- /dev/null
+++ b/toxic/distinfo
@@ -0,0 +1,7 @@
+$NetBSD$
+
+SHA1 (patch-Makefile) = c996154317aedaaa4b3a1bac2a69e4fc1b89173b
+SHA1 (patch-cfg_global__vars.mk) = 5aad096f067f485c439135d3838b8912d1ad7d5e
+SHA1 (patch-src_name__lookup.c) = e8200c42ebc9bb2540278f60667b821ee383d079
+SHA1 (patch-src_toxic.c) = 0c466bb767a77f5bf25aeef934ca61e5dc550923
+SHA1 (patch-src_video__device.c) = 27ca66738b98cbcf7be002ccd9c768f29e221297
diff --git a/toxic/patches/patch-Makefile b/toxic/patches/patch-Makefile
new file mode 100644
index 0000000..3f9f784
--- /dev/null
+++ b/toxic/patches/patch-Makefile
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Base NetBSD build on FreeBSD build.
+
+--- Makefile.orig	2015-12-26 05:56:46.000000000 +0000
++++ Makefile
+@@ -30,6 +30,9 @@ endif
+ ifeq ($(UNAME_S), OpenBSD)
+     -include $(CFG_DIR)/systems/FreeBSD.mk
+ endif
++ifeq ($(UNAME_S), NetBSD)
++    -include $(CFG_DIR)/systems/FreeBSD.mk
++endif
+ ifeq ($(UNAME_S), Darwin)
+     -include $(CFG_DIR)/systems/Darwin.mk
+ endif
diff --git a/toxic/patches/patch-cfg_global__vars.mk b/toxic/patches/patch-cfg_global__vars.mk
new file mode 100644
index 0000000..de6973f
--- /dev/null
+++ b/toxic/patches/patch-cfg_global__vars.mk
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Allow overwriting PREFIX.
+
+--- cfg/global_vars.mk.orig	2015-12-26 05:56:46.000000000 +0000
++++ cfg/global_vars.mk
+@@ -23,7 +23,7 @@ SNDFILES += ToxicRecvMessage.wav ToxicOu
+ SNDFILES += ToxicTransferComplete.wav ToxicTransferStart.wav
+ 
+ # Install directories
+-PREFIX = /usr/local
++PREFIX ?= /usr/local
+ BINDIR = $(PREFIX)/bin
+ DATADIR = $(PREFIX)/share/toxic
+ MANDIR = $(PREFIX)/share/man
diff --git a/toxic/patches/patch-src_name__lookup.c b/toxic/patches/patch-src_name__lookup.c
new file mode 100644
index 0000000..6a99641
--- /dev/null
+++ b/toxic/patches/patch-src_name__lookup.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Include stdarg.h.
+
+--- src/name_lookup.c.orig	2015-12-26 05:56:46.000000000 +0000
++++ src/name_lookup.c
+@@ -21,6 +21,7 @@
+  */
+ 
+ #include <stdlib.h>
++#include <stdarg.h>
+ #include <string.h>
+ #include <sys/types.h> /* for u_char */
+ #include <curl/curl.h>
diff --git a/toxic/patches/patch-src_toxic.c b/toxic/patches/patch-src_toxic.c
new file mode 100644
index 0000000..3b571b1
--- /dev/null
+++ b/toxic/patches/patch-src_toxic.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Include stdarg.h.
+
+--- src/toxic.c.orig	2015-12-26 05:56:46.000000000 +0000
++++ src/toxic.c
+@@ -26,6 +26,7 @@
+ #include <stdlib.h>
+ #include <stdbool.h>
+ #include <stdint.h>
++#include <stdarg.h>
+ #include <signal.h>
+ #include <locale.h>
+ #include <string.h>
diff --git a/toxic/patches/patch-src_video__device.c b/toxic/patches/patch-src_video__device.c
new file mode 100644
index 0000000..58bb2fc
--- /dev/null
+++ b/toxic/patches/patch-src_video__device.c
@@ -0,0 +1,181 @@
+$NetBSD$
+
+Do not assume what is not Linux or FreeBSD is OSX.
+
+--- src/video_device.c.orig	2015-12-26 05:56:46.000000000 +0000
++++ src/video_device.c
+@@ -30,14 +30,18 @@
+ 
+ #include <vpx/vpx_image.h>
+ 
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__OSX__)
++#import "osx_video.h"
++#else
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/mman.h>
+ #include <fcntl.h>
++#ifdef __Linux__
+ #include <linux/videodev2.h>
+-#else /* __OSX__ */
+-#import "osx_video.h"
++#else
++#include <sys/videoio.h>
++#endif
+ #endif
+ 
+ #include "line_info.h"
+@@ -65,7 +69,7 @@ typedef struct VideoDevice {
+     void* cb_data;                          /* Data to be passed to callback */
+     int32_t friend_number;                  /* ToxAV friend number */
+ 
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
+     int fd;                                 /* File descriptor of video device selected/opened */
+     struct v4l2_format fmt;
+     struct VideoBuffer *buffers;
+@@ -131,7 +135,7 @@ static void yuv420tobgr(uint16_t width, 
+     }
+ }
+ 
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ static void yuv422to420(uint8_t *plane_y, uint8_t *plane_u, uint8_t *plane_v,
+                  uint8_t *input, uint16_t width, uint16_t height)
+ {
+@@ -177,7 +181,10 @@ VideoDeviceError init_video_devices()
+ {
+     size[vdt_input] = 0;
+ 
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__OSX__)
++    if( osx_video_init((char**)video_devices_names[vdt_input], &size[vdt_input]) != 0 )
++        return vde_InternalError;
++#else
+     for (; size[vdt_input] <= MAX_DEVICES; ++size[vdt_input]) {
+         int fd;
+         char device_address[] = "/dev/videoXX";
+@@ -208,10 +215,6 @@ VideoDeviceError init_video_devices()
+             close(fd);
+         }
+     }
+-
+-#else /* __OSX__ */
+-    if( osx_video_init((char**)video_devices_names[vdt_input], &size[vdt_input]) != 0 )
+-        return vde_InternalError;
+ #endif
+ 
+     size[vdt_output] = 1;
+@@ -257,12 +260,12 @@ VideoDeviceError terminate_video_devices
+ VideoDeviceError register_video_device_callback(int32_t friend_number, uint32_t device_idx,
+                                                 VideoDataHandleCallback callback, void* data)
+ {
+-#if defined(__linux__) || defined(__FreeBSD__)
+-    if ( size[vdt_input] <= device_idx || !video_devices_running[vdt_input][device_idx] || !video_devices_running[vdt_input][device_idx]->fd )
+-        return vde_InvalidSelection;
+-#else /* __OSX__ */
++#if defined(__OSX__)
+     if ( size[vdt_input] <= device_idx || !video_devices_running[vdt_input][device_idx] )
+         return vde_InvalidSelection;
++#else
++    if ( size[vdt_input] <= device_idx || !video_devices_running[vdt_input][device_idx] || !video_devices_running[vdt_input][device_idx]->fd )
++        return vde_InvalidSelection;
+ #endif
+ 
+     lock;
+@@ -336,7 +339,13 @@ VideoDeviceError open_video_device(Video
+     if ( type == vdt_input ) {
+         video_thread_paused = true;
+ 
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__OSX__)
++        if ( osx_video_open_device(selection, &device->video_width, &device->video_height) != 0 ) {
++            free(device);
++            unlock;
++            return vde_FailedStart;
++        }
++#else
+         /* Open selected device */
+         char device_address[] = "/dev/videoXX";
+         snprintf(device_address + 10 , sizeof(device_address) - 10, "%i", selection);
+@@ -455,13 +464,6 @@ VideoDeviceError open_video_device(Video
+             unlock;
+             return vde_FailedStart;
+         }
+-
+-#else /* __OSX__ */
+-        if ( osx_video_open_device(selection, &device->video_width, &device->video_height) != 0 ) {
+-            free(device);
+-            unlock;
+-            return vde_FailedStart;
+-        }
+ #endif
+ 
+         /* Create X11 window associated to device */
+@@ -632,7 +634,12 @@ void* video_thread_poll (void* arg) // T
+                     uint8_t *u = device->input.planes[1];
+                     uint8_t *v = device->input.planes[2];
+ 
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__OSX__)
++                    if ( osx_video_read_device(y, u, v, &video_width, &video_height) != 0 ) {
++                        unlock;
++                        continue;
++                    }
++#else
+                     struct v4l2_buffer buf;
+                     memset(&(buf), 0, sizeof(buf));
+ 
+@@ -648,12 +655,6 @@ void* video_thread_poll (void* arg) // T
+ 
+                     /* Convert frame image data to YUV420 for ToxAV */
+                     yuv422to420(y, u, v, data, video_width, video_height);
+-
+-#else /* __OSX__*/
+-                    if ( osx_video_read_device(y, u, v, &video_width, &video_height) != 0 ) {
+-                        unlock;
+-                        continue;
+-                    }
+ #endif
+ 
+                     /* Send frame data to friend through ToxAV */
+@@ -690,7 +691,7 @@ void* video_thread_poll (void* arg) // T
+                     XFlush(device->x_display);
+                     free(img_data);
+ 
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
+                     if ( -1 == xioctl(device->fd, VIDIOC_QBUF, &buf) ) {
+                         unlock;
+                         continue;
+@@ -725,7 +726,9 @@ VideoDeviceError close_video_device(Vide
+     if ( !device->ref_count ) {
+ 
+         if ( type == vdt_input ) {
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__OSX__)
++            osx_video_close_device(device_idx);
++#else
+             enum v4l2_buf_type buf_type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+             if( -1 == xioctl(device->fd, VIDIOC_STREAMOFF, &buf_type) ) {}
+ 
+@@ -735,9 +738,6 @@ VideoDeviceError close_video_device(Vide
+                 }
+             }
+             close(device->fd);
+-
+-#else /* __OSX__ */
+-            osx_video_close_device(device_idx);
+ #endif
+             vpx_img_free(&device->input);
+             XDestroyWindow(device->x_display, device->x_window);
+@@ -745,7 +745,7 @@ VideoDeviceError close_video_device(Vide
+             XCloseDisplay(device->x_display);
+             pthread_mutex_destroy(device->mutex);
+ 
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
+             free(device->buffers);
+ #endif /* __linux__ */
+ 


Home | Main Index | Thread Index | Old Index