about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/instant-messengers/blink
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/instant-messengers/blink')
-rw-r--r--nixpkgs/pkgs/applications/networking/instant-messengers/blink/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/networking/instant-messengers/blink/pythonpath.patch49
2 files changed, 98 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/blink/default.nix b/nixpkgs/pkgs/applications/networking/instant-messengers/blink/default.nix
new file mode 100644
index 000000000000..001eadbb01d8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/instant-messengers/blink/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchdarcs, pythonPackages, libvncserver, zlib
+, gnutls, libvpx, makeDesktopItem }:
+
+pythonPackages.buildPythonApplication rec {
+  pname = "blink";
+  version = "3.0.3";
+
+  src = fetchdarcs {
+    url = http://devel.ag-projects.com/repositories/blink-qt;
+    rev = "release-${version}";
+    sha256 = "1vj6zzfvxygz0fzr8bhymcw6j4v8xmr0kba53d6qg285j7hj1bdi";
+  };
+
+  patches = [ ./pythonpath.patch ];
+  postPatch = ''
+    sed -i 's|@out@|'"''${out}"'|g' blink/resources.py
+  '';
+
+  propagatedBuildInputs = with pythonPackages; [ pyqt5_with_qtwebkit cjson sipsimple twisted google_api_python_client ];
+
+  buildInputs = [ pythonPackages.cython zlib libvncserver libvpx ];
+
+  desktopItem = makeDesktopItem {
+    name = "Blink";
+    exec = "blink";
+    comment = meta.description;
+    desktopName = "Blink";
+    icon = "blink";
+    genericName = "Instant Messaging";
+    categories = "Application;Internet;";
+  };
+
+  postInstall = ''
+    wrapProgram $out/bin/blink \
+      --prefix LD_LIBRARY_PATH ":" ${gnutls.out}/lib
+    mkdir -p "$out/share/applications"
+    mkdir -p "$out/share/pixmaps"
+    cp "$desktopItem"/share/applications/* "$out/share/applications"
+    cp "$out"/share/blink/icons/blink.* "$out/share/pixmaps"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://icanblink.com/;
+    description = "A state of the art, easy to use SIP client for Voice, Video and IM";
+    platforms = platforms.linux;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/blink/pythonpath.patch b/nixpkgs/pkgs/applications/networking/instant-messengers/blink/pythonpath.patch
new file mode 100644
index 000000000000..0df8bc84ff30
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/instant-messengers/blink/pythonpath.patch
@@ -0,0 +1,49 @@
+--- blink-2.0.0/blink/resources.py	2016-03-09 14:39:07.000000000 +0100
++++ blink-2.0.0/blink/resources-patched.py	2016-03-12 21:34:14.965476623 +0100
+@@ -1,7 +1,10 @@
++# Copyright (C) 2010-2013 AG Projects. See LICENSE for details.
++#
+ 
+ """Provide access to Blink's resources"""
+ 
+-import __main__
++__all__ = ['ApplicationData', 'Resources', 'IconManager']
++
+ import imghdr
+ import os
+ import platform
+@@ -19,14 +22,10 @@
+ from blink.util import run_in_gui_thread
+ 
+ 
+-__all__ = ['ApplicationData', 'Resources', 'IconManager']
+-
+-
+ class DirectoryContextManager(unicode):
+     def __enter__(self):
+         self.directory = os.getcwdu()
+         os.chdir(self)
+-
+     def __exit__(self, type, value, traceback):
+         os.chdir(self.directory)
+ 
+@@ -61,18 +60,7 @@
+     @classproperty
+     def directory(cls):
+         if cls._cached_directory is None:
+-            try:
+-                binary_directory = os.path.dirname(os.path.realpath(__main__.__file__))
+-            except AttributeError:
+-                if hasattr(sys, 'frozen'):
+-                    application_directory = os.path.dirname(os.path.realpath(sys.executable))
+-                else:
+-                    application_directory = os.path.realpath('')  # executed in interactive interpreter
+-            else:
+-                if os.path.basename(binary_directory) == 'bin':
+-                    application_directory = os.path.dirname(binary_directory)
+-                else:
+-                    application_directory = binary_directory
++            application_directory = '@out@'
+             if os.path.exists(os.path.join(application_directory, 'resources', 'blink.ui')):
+                 cls._cached_directory = os.path.join(application_directory, 'resources').decode(sys.getfilesystemencoding())
+             else: