diff options
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/instant-messengers/profanity')
3 files changed, 127 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/profanity/default.nix b/nixpkgs/pkgs/applications/networking/instant-messengers/profanity/default.nix new file mode 100644 index 000000000000..e131e4c7a3ca --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/instant-messengers/profanity/default.nix @@ -0,0 +1,76 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, glib, openssl +, glibcLocales, expect, ncurses, libotr, curl, readline, libuuid +, cmocka, libmicrohttpd, stabber, expat, libmesode +, autoconf-archive + +, autoAwaySupport ? true, libXScrnSaver ? null, libX11 ? null +, notifySupport ? true, libnotify ? null, gdk_pixbuf ? null +, traySupport ? true, gnome2 ? null +, pgpSupport ? true, gpgme ? null +, pythonPluginSupport ? true, python ? null +}: + +assert autoAwaySupport -> libXScrnSaver != null && libX11 != null; +assert notifySupport -> libnotify != null && gdk_pixbuf != null; +assert traySupport -> gnome2 != null; +assert pgpSupport -> gpgme != null; +assert pythonPluginSupport -> python != null; + +with stdenv.lib; + +stdenv.mkDerivation rec { + name = "profanity-${version}"; + version = "0.5.1"; + + src = fetchFromGitHub { + owner = "boothj5"; + repo = "profanity"; + rev = "${version}"; + sha256 = "1ppr02wivhlrqr62r901clnycna8zpn6kr7n5rw8y3zfw21ny17z"; + }; + + patches = [ ./patches/packages-osx.patch ./patches/undefined-macros.patch ]; + + enableParallelBuilding = true; + + nativeBuildInputs = [ + autoreconfHook autoconf-archive glibcLocales pkgconfig + ]; + + buildInputs = [ + expect readline libuuid glib openssl expat ncurses libotr + curl libmesode cmocka libmicrohttpd stabber + ] ++ optionals autoAwaySupport [ libXScrnSaver libX11 ] + ++ optionals notifySupport [ libnotify gdk_pixbuf ] + ++ optionals traySupport [ gnome2.gtk ] + ++ optionals pgpSupport [ gpgme ] + ++ optionals pythonPluginSupport [ python ]; + + # Enable feature flags, so that build fail if libs are missing + configureFlags = [ "--enable-c-plugins" "--enable-otr" ] + ++ optionals notifySupport [ "--enable-notifications" ] + ++ optionals traySupport [ "--enable-icons" ] + ++ optionals pgpSupport [ "--enable-pgp" ] + ++ optionals pythonPluginSupport [ "--enable-python-plugins" ]; + + preAutoreconf = '' + mkdir m4 + ''; + + doCheck = true; + + LC_ALL = "en_US.utf8"; + + meta = { + description = "A console based XMPP client"; + longDescription = '' + Profanity is a console based XMPP client written in C using ncurses and + libstrophe, inspired by Irssi. + ''; + homepage = http://profanity.im/; + license = licenses.gpl3Plus; + platforms = platforms.unix; + maintainers = [ maintainers.devhell ]; + updateWalker = true; + }; +} diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/profanity/patches/packages-osx.patch b/nixpkgs/pkgs/applications/networking/instant-messengers/profanity/patches/packages-osx.patch new file mode 100644 index 000000000000..77bfc5e78bd0 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/instant-messengers/profanity/patches/packages-osx.patch @@ -0,0 +1,11 @@ +diff --git a/configure.ac b/configure.ac +index 1e55b1cc..0832a387 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -22,7 +22,6 @@ AC_CANONICAL_HOST + PLATFORM="unknown" + AS_CASE([$host_os], + [freebsd*], [PLATFORM="freebsd"], +- [darwin*], [PLATFORM="osx"], + [cygwin], [PLATFORM="cygwin"], + [PLATFORM="nix"]) diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/profanity/patches/undefined-macros.patch b/nixpkgs/pkgs/applications/networking/instant-messengers/profanity/patches/undefined-macros.patch new file mode 100644 index 000000000000..9ef4e7bebe54 --- /dev/null +++ b/nixpkgs/pkgs/applications/networking/instant-messengers/profanity/patches/undefined-macros.patch @@ -0,0 +1,40 @@ +diff --git a/configure.ac b/configure.ac +index 1e55b1cc..0832a387 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -83,12 +81,12 @@ elif test "x$enable_python_plugins" != xno; then + AM_CONDITIONAL([BUILD_PYTHON_API], [true]) + AC_DEFINE([HAVE_PYTHON], [1], [Python support]) + else +- if test "x$enable_python_plugins" = xyes; then +- AC_MSG_ERROR([Python not found, cannot enable Python plugins.]) +- else +- AM_CONDITIONAL([BUILD_PYTHON_API], [false]) +- AC_MSG_NOTICE([Python development package not found, Python plugin support disabled.]) +- fi ++ AS_IF( ++ [test "x$enable_python_plugins" = xyes], ++ [], ++ [AM_CONDITIONAL([BUILD_PYTHON_API], [false]) ++ AC_MSG_NOTICE([Python development package not found, Python plugin support disabled.])] ++ ) + fi + AS_IF([test "x$PLATFORM" = xosx], [rm -f Python.framework]) + else +@@ -107,7 +105,7 @@ else + [AM_CONDITIONAL([BUILD_C_API], [true]) LIBS="$LIBS -ldl" AC_DEFINE([HAVE_C], [1], [C support])], + [AS_IF( + [test "x$enable_c_plugins" = xyes], +- [AC_MSG_ERROR([dl library needed to run C plugins])], ++ [], + [AM_CONDITIONAL([BUILD_C_API], [false])]) + ]) + else +@@ -116,7 +114,6 @@ else + fi + + # threading +-ACX_PTHREAD([], [AC_MSG_ERROR([pthread is required])]) + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + AS_IF([test "x$PTHREAD_CC" != x], [ CC="$PTHREAD_CC" ]) |