profanity: refactor build to build from source

* fix osx build
* fix undefined macros in configure.ac
* activate the check phase to run the test suite

authored by

Hendrik Schaeidt and committed by
Robin Gloster
501b6d0e 2f7878ac

+78 -8
+27 -8
pkgs/applications/networking/instant-messengers/profanity/default.nix
··· 1 - { stdenv, fetchurl, pkgconfig, glib, openssl, expat, libmesode 2 - , ncurses, libotr, curl, readline, libuuid 1 + { stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, glib, openssl 2 + , glibcLocales, expect, ncurses, libotr, curl, readline, libuuid 3 + , cmocka, libmicrohttpd, stabber, expat, libmesode 3 4 4 5 , autoAwaySupport ? false, libXScrnSaver ? null, libX11 ? null 5 6 , notifySupport ? false, libnotify ? null, gdk_pixbuf ? null ··· 20 21 name = "profanity-${version}"; 21 22 version = "0.5.1"; 22 23 23 - src = fetchurl { 24 - url = "http://www.profanity.im/profanity-${version}.tar.gz"; 25 - sha256 = "1f7ylw3mhhnii52mmk40hyc4kqhpvjdr3hmsplzkdhsfww9kflg3"; 24 + src = fetchFromGitHub { 25 + owner = "boothj5"; 26 + repo = "profanity"; 27 + rev = "${version}"; 28 + sha256 = "1ppr02wivhlrqr62r901clnycna8zpn6kr7n5rw8y3zfw21ny17z"; 26 29 }; 30 + 31 + patches = [ ./patches/packages-osx.patch ./patches/undefined-macros.patch ]; 27 32 28 33 enableParallelBuilding = true; 29 34 30 - nativeBuildInputs = [ pkgconfig ]; 35 + nativeBuildInputs = [ autoreconfHook glibcLocales pkgconfig ]; 31 36 32 37 buildInputs = [ 33 - readline libuuid libmesode 34 - glib openssl expat ncurses libotr curl 38 + expect readline libuuid glib openssl expat ncurses libotr 39 + curl libmesode cmocka libmicrohttpd stabber 35 40 ] ++ optionals autoAwaySupport [ libXScrnSaver libX11 ] 36 41 ++ optionals notifySupport [ libnotify gdk_pixbuf ] 37 42 ++ optionals traySupport [ gnome2.gtk ] ··· 44 49 ++ optionals traySupport [ "--enable-icons" ] 45 50 ++ optionals pgpSupport [ "--enable-pgp" ] 46 51 ++ optionals pythonPluginSupport [ "--enable-python-plugins" ]; 52 + 53 + preAutoreconf = '' 54 + mkdir m4 55 + ''; 56 + 57 + doCheck = true; 58 + 59 + LC_ALL = "en_US.utf8"; 60 + 61 + NIX_CFLAGS_COMPILE = [ ] 62 + ++ optionals pythonPluginSupport [ "-I${python}/include/${python.libPrefix}" ]; 63 + 64 + LDFLAGS = [ ] 65 + ++ optionals pythonPluginSupport [ "-L${python}/lib" "-lpython${python.majorVersion}m" ]; 47 66 48 67 meta = { 49 68 description = "A console based XMPP client";
+11
pkgs/applications/networking/instant-messengers/profanity/patches/packages-osx.patch
··· 1 + diff --git a/configure.ac b/configure.ac 2 + index 1e55b1cc..0832a387 100644 3 + --- a/configure.ac 4 + +++ b/configure.ac 5 + @@ -22,7 +22,6 @@ AC_CANONICAL_HOST 6 + PLATFORM="unknown" 7 + AS_CASE([$host_os], 8 + [freebsd*], [PLATFORM="freebsd"], 9 + - [darwin*], [PLATFORM="osx"], 10 + [cygwin], [PLATFORM="cygwin"], 11 + [PLATFORM="nix"])
+40
pkgs/applications/networking/instant-messengers/profanity/patches/undefined-macros.patch
··· 1 + diff --git a/configure.ac b/configure.ac 2 + index 1e55b1cc..0832a387 100644 3 + --- a/configure.ac 4 + +++ b/configure.ac 5 + @@ -83,12 +81,12 @@ elif test "x$enable_python_plugins" != xno; then 6 + AM_CONDITIONAL([BUILD_PYTHON_API], [true]) 7 + AC_DEFINE([HAVE_PYTHON], [1], [Python support]) 8 + else 9 + - if test "x$enable_python_plugins" = xyes; then 10 + - AC_MSG_ERROR([Python not found, cannot enable Python plugins.]) 11 + - else 12 + - AM_CONDITIONAL([BUILD_PYTHON_API], [false]) 13 + - AC_MSG_NOTICE([Python development package not found, Python plugin support disabled.]) 14 + - fi 15 + + AS_IF( 16 + + [test "x$enable_python_plugins" = xyes], 17 + + [], 18 + + [AM_CONDITIONAL([BUILD_PYTHON_API], [false]) 19 + + AC_MSG_NOTICE([Python development package not found, Python plugin support disabled.])] 20 + + ) 21 + fi 22 + AS_IF([test "x$PLATFORM" = xosx], [rm -f Python.framework]) 23 + else 24 + @@ -107,7 +105,7 @@ else 25 + [AM_CONDITIONAL([BUILD_C_API], [true]) LIBS="$LIBS -ldl" AC_DEFINE([HAVE_C], [1], [C support])], 26 + [AS_IF( 27 + [test "x$enable_c_plugins" = xyes], 28 + - [AC_MSG_ERROR([dl library needed to run C plugins])], 29 + + [], 30 + [AM_CONDITIONAL([BUILD_C_API], [false])]) 31 + ]) 32 + else 33 + @@ -116,7 +114,6 @@ else 34 + fi 35 + 36 + # threading 37 + -ACX_PTHREAD([], [AC_MSG_ERROR([pthread is required])]) 38 + LIBS="$PTHREAD_LIBS $LIBS" 39 + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" 40 + AS_IF([test "x$PTHREAD_CC" != x], [ CC="$PTHREAD_CC" ])