Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions pkgs/applications/networking/mailreaders/sup/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{ stdenv, fetchurl, ruby, rake, rubygems, makeWrapper, ncursesw_sup
, xapian_full_alaveteli, gpgme, libiconvOrEmpty }:

stdenv.mkDerivation {
name = "sup-d21f027afcd6a4031de9619acd8dacbd2f2f4fd4";

meta = {
homepage = http://supmua.org;
description = "A curses threads-with-tags style email client";
maintainers = with stdenv.lib.maintainers; [ lovek323 ];
license = stdenv.lib.licenses.gpl2;
platforms = stdenv.lib.platforms.unix;
};

dontStrip = true;

src = fetchurl {
url = "https://github.com/sup-heliotrope/sup/archive/d21f027afcd6a4031de9619acd8dacbd2f2f4fd4.tar.gz";
sha256 = "0syifva6pqrg3nyy7xx7nan9zswb4ls6bkk96vi9ki2ly1ymwcdp";
};

buildInputs =
[ ruby rake rubygems makeWrapper gpgme ncursesw_sup xapian_full_alaveteli
libiconvOrEmpty ];

buildPhase = "rake gem";

# TODO: Move gem dependencies out

installPhase = ''
export HOME=$TMP/home; mkdir -pv "$HOME"

GEM_PATH="$GEM_PATH:$out/${ruby.gemPath}"
GEM_PATH="$GEM_PATH:${ncursesw_sup}/${ruby.gemPath}"
GEM_PATH="$GEM_PATH:${xapian_full_alaveteli}/${ruby.gemPath}"
GEM_PATH="$GEM_PATH:${gpgme}/${ruby.gemPath}"

# Don't install some dependencies -- we have already installed
# ncursesw-sup, xapian-full-alaveteli and gpgme, but gem doesn't acknowledge
# this
gem install --no-verbose --install-dir "$out/${ruby.gemPath}" \
--bindir "$out/bin" --no-rdoc --no-ri pkg/sup-999.gem \
--ignore-dependencies

# Now install the dependencies that will work out of the box
gem install --no-verbose --install-dir "$out/${ruby.gemPath}" \
--bindir "$out/bin" --no-rdoc --no-ri rmail
gem install --no-verbose --install-dir "$out/${ruby.gemPath}" \
--bindir "$out/bin" --no-rdoc --no-ri trollop
gem install --no-verbose --install-dir "$out/${ruby.gemPath}" \
--bindir "$out/bin" --no-rdoc --no-ri lockfile
gem install --no-verbose --install-dir "$out/${ruby.gemPath}" \
--bindir "$out/bin" --no-rdoc --no-ri mime-types
gem install --no-verbose --install-dir "$out/${ruby.gemPath}" \
--bindir "$out/bin" --no-rdoc --no-ri gettext
gem install --no-verbose --install-dir "$out/${ruby.gemPath}" \
--bindir "$out/bin" --no-rdoc --no-ri chronic
gem install --no-verbose --install-dir "$out/${ruby.gemPath}" \
--bindir "$out/bin" --no-rdoc --no-ri iconv

for prog in $out/bin/*; do
wrapProgram "$prog" --prefix GEM_PATH : "$GEM_PATH"
done

for prog in $out/gems/*/bin/*; do
[[ -e "$out/bin/$(basename $prog)" ]]
done
'';
}

11 changes: 11 additions & 0 deletions pkgs/development/interpreters/ruby/generated.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ g: # Get dependencies from patched gems
uuid = g.uuid_2_3_7;
uuidtools = g.uuidtools_2_1_3;
websocket = g.websocket_1_0_7;
xapian_full_alaveteli = g.xapian_full_alaveteli_1_2_9_5;
xml_simple = g.xml_simple_1_1_1;
yajl_ruby = g.yajl_ruby_1_1_0;
};
Expand Down Expand Up @@ -1467,6 +1468,16 @@ interpreters.'';
requiredGems = [ ];
sha256 = ''1jrfz4295qbnjaxv37fw9jzxyxz61izp7c0683mnscacpx262zw0'';
};
xapian_full_alaveteli_1_2_9_5 = {
basename = ''xapian_full_alaveteli'';
meta = {
description = ''xapian-core + Ruby xapian-bindings'';
longDescription = ''Xapian bindings for Ruby without dependency on system Xapian library'';
};
name = ''xapian-full-alaveteli-1.2.9.5'';
requiredGems = [ ];
sha256 = ''0qg1jkx5lr4a5v7l3f9gq7f07al6qaxxzma230zrzs48bz3qnhxm'';
};
xml_simple_1_1_1 = {
basename = ''xml_simple'';
meta = {
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/interpreters/ruby/patches.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ in
gemFlags = "--no-rdoc --no-ri";
};

xapian_full_alaveteli = {
buildInputs = [ zlib libuuid ];
};

rjb = {
buildInputs = [ jdk ];
JAVA_HOME = jdk;
Expand Down
64 changes: 64 additions & 0 deletions pkgs/development/libraries/ruby_gpgme/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{ stdenv, fetchurl, gpgme, ruby, rubygems, hoe }:

stdenv.mkDerivation {
name = "ruby-gpgme-1.0.8";

src = fetchurl {
url = "https://github.com/ueno/ruby-gpgme/archive/1.0.8.tar.gz";
sha256 = "1j7jkl9s8iqcmxf3x6c9kljm19hw1jg6yvwbndmkw43qacdr9nxb";
};

meta = {
description = ''
Ruby-GPGME is a Ruby language binding of GPGME (GnuPG Made
Easy)
'';
homepage = "http://rubyforge.org/projects/ruby-gpgme/";
longDescription = ''
Ruby-GPGME is a Ruby language binding of GPGME (GnuPG Made Easy).

GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
easier for applications. It provides a High-Level Crypto API for
encryption, decryption, signing, signature verification and key
management.
'';
};

buildInputs = [ gpgme rubygems hoe ruby ];

buildPhase = ''
${ruby}/bin/ruby extconf.rb
rake gem
'';

installPhase = ''
export HOME=$TMP/home; mkdir -pv "$HOME"

# For some reason, the installation phase doesn't work with the default
# make install command run by gem (we'll fix it and do it ourselves later)
gem install --no-verbose --install-dir "$out/${ruby.gemPath}" \
--bindir "$out/bin" --no-rdoc --no-ri pkg/gpgme-1.0.8.gem || true

# Create a bare-bones gemspec file so that ruby will recognise the gem
cat <<EOF >"$out/${ruby.gemPath}/specifications/gpgme.gemspec"
Gem::Specification.new do |s|
s.name = 'gpgme'
s.version = '1.0.8'
s.files = Dir['{lib,examples}/**/*']
s.rubyforge_project = 'ruby-gpgme'
s.require_paths = ['lib']
end
EOF

cd "$out/${ruby.gemPath}/gems/gpgme-1.0.8"
mkdir src
mv lib src
sed -i "s/srcdir = ./srcdir = src/" Makefile
make install

mv lib lib.bak
mv src/lib lib
rmdir src
'';
}

47 changes: 47 additions & 0 deletions pkgs/development/libraries/ruby_ncursesw_sup/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{ stdenv, fetchurl, ncurses, ruby, rubygems }:

stdenv.mkDerivation rec {
name = ''ncursesw-sup-afd962b9c06108ff0643e98593c5605314d76917'';

src = fetchurl {
url = "https://github.com/sup-heliotrope/ncursesw-ruby/archive/afd962b9c06108ff0643e98593c5605314d76917.tar.gz";
sha256 = "13i286p4bm8zqg9xh96a1dg7wkywj9m6975gbh3w43d3rmfc1h6a";
};

meta = {
description = ''
Hacked up version of ncurses gem that supports wide characters for
supmua.org
'';
homepage = ''https://github.com/sup-heliotrope/ncursesw-ruby'';
longDescription = ''
This wrapper provides access to the functions, macros, global variables
and constants of the ncurses library. These are mapped to a Ruby Module
named "Ncurses": Functions and external variables are implemented as
singleton functions of the Module Ncurses.
'';
};

buildInputs = [ ncurses rubygems ];

buildPhase = "gem build ncursesw.gemspec";

installPhase = ''
export HOME=$TMP/home; mkdir -pv "$HOME"

# For some reason, the installation phase doesn't work with the default
# make install command run by gem (we'll fix it and do it ourselves later)
gem install --no-verbose --install-dir "$out/${ruby.gemPath}" \
--bindir "$out/bin" --no-rdoc --no-ri ncursesw-sup-1.3.1.2.gem || true

# Needed for ruby to recognise the gem
cp ncursesw.gemspec "$out/${ruby.gemPath}/specifications"

cd "$out/${ruby.gemPath}/gems/ncursesw-sup-1.3.1.2"
mkdir src
mv lib src
sed -i "s/srcdir = ./srcdir = src/" Makefile
make install
'';
}

1 change: 1 addition & 0 deletions pkgs/lib/maintainers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
goibhniu = "Cillian de Róiste <cillian.deroiste@gmail.com>";
guibert = "David Guibert <david.guibert@gmail.com>";
iElectric = "Domen Kozar <domen@dev.si>";
lovek323 = "Jason O'Conal <jason@oconal.id.au>";
jcumming = "Jack Cummings <jack@mudshark.org>";
kkallio = "Karn Kallio <tierpluspluslists@gmail.com>";
ludo = "Ludovic Courtès <ludo@gnu.org>";
Expand Down
11 changes: 7 additions & 4 deletions pkgs/tools/security/gnupg/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# 'echo "pinentry-program `which pinentry-gtk-2`" >> ~/.gnupg/gpg-agent.conf'.

{ fetchurl, stdenv, readline, zlib, libgpgerror, pth, libgcrypt, libassuan
, libksba, coreutils, useLdap ? true, openldap ? null
, useBzip2 ? true, bzip2 ? null, useUsb ? true, libusb ? null
, useCurl ? true, curl ? null
, libksba, coreutils, libiconvOrEmpty
, useLdap ? true, openldap ? null, useBzip2 ? true, bzip2 ? null
, useUsb ? true, libusb ? null, useCurl ? true, curl ? null
}:

assert useLdap -> (openldap != null);
Expand All @@ -20,14 +20,17 @@ stdenv.mkDerivation rec {
sha256 = "16mp0j5inrcqcb3fxbn0b3aamascy3n923wiy0y8marc0rzrp53f";
};

buildInputs = [ readline zlib libgpgerror libgcrypt libassuan libksba pth ]
buildInputs
= [ readline zlib libgpgerror libgcrypt libassuan libksba pth ]
++ libiconvOrEmpty
++ stdenv.lib.optional useLdap openldap
++ stdenv.lib.optional useBzip2 bzip2
++ stdenv.lib.optional useUsb libusb
++ stdenv.lib.optional useCurl curl;

patchPhase = ''
find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i
find . -name pcsc-wrapper.c | xargs sed -i 's/typedef unsinged int pcsc_dword_t/typedef unsigned int pcsc_dword_t/'
'';

checkPhase="GNUPGHOME=`pwd` ./agent/gpg-agent --daemon make check";
Expand Down
21 changes: 20 additions & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4636,7 +4636,11 @@ let

libunique = callPackage ../development/libraries/libunique/default.nix { };

libusb = callPackage ../development/libraries/libusb { };
libusb = callPackage ../development/libraries/libusb {
stdenv = if stdenv.isDarwin
then overrideGCC stdenv gccApple
else stdenv;
};

libusb1 = callPackage ../development/libraries/libusb1 { };

Expand Down Expand Up @@ -7772,6 +7776,21 @@ let

mutt = callPackage ../applications/networking/mailreaders/mutt { };

ruby_gpgme = callPackage ../development/libraries/ruby_gpgme {
ruby = ruby19;
hoe = rubyLibs.hoe;
};

ruby_ncursesw_sup = callPackage ../development/libraries/ruby_ncursesw_sup { };

sup = callPackage ../applications/networking/mailreaders/sup {
rake = rubyLibs.rake_10_0_4;
ruby = ruby19;
xapian_full_alaveteli = rubyLibs.xapian_full_alaveteli_1_2_9_5;
gpgme = ruby_gpgme;
ncursesw_sup = ruby_ncursesw_sup;
};

msmtp = callPackage ../applications/networking/msmtp { };

imapfilter = callPackage ../applications/networking/mailreaders/imapfilter.nix {
Expand Down