summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorBodil Stokke <bodil@bodil.org>2013-08-10 01:21:25 +0200
committerBodil Stokke <bodil@bodil.org>2013-08-10 01:21:25 +0200
commit14c5f6bd746440b3dedbc778463f6d0c8260e0d4 (patch)
tree103fab2118b626b02fceb5628153ef66a26c8b4d /pkgs
parentf4681d8e08092353a58c36e6ae79509719b1e25c (diff)
downloadnixlib-14c5f6bd746440b3dedbc778463f6d0c8260e0d4.tar
nixlib-14c5f6bd746440b3dedbc778463f6d0c8260e0d4.tar.gz
nixlib-14c5f6bd746440b3dedbc778463f6d0c8260e0d4.tar.bz2
nixlib-14c5f6bd746440b3dedbc778463f6d0c8260e0d4.tar.lz
nixlib-14c5f6bd746440b3dedbc778463f6d0c8260e0d4.tar.xz
nixlib-14c5f6bd746440b3dedbc778463f6d0c8260e0d4.tar.zst
nixlib-14c5f6bd746440b3dedbc778463f6d0c8260e0d4.zip
Adding ponysay.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/misc/ponysay/default.nix30
-rw-r--r--pkgs/tools/misc/ponysay/pathfix.patch24
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/tools/misc/ponysay/default.nix b/pkgs/tools/misc/ponysay/default.nix
new file mode 100644
index 000000000000..1f281a713011
--- /dev/null
+++ b/pkgs/tools/misc/ponysay/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, python3, texinfo, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "ponysay-3.0.1";
+
+  src = fetchurl {
+    url = "https://github.com/erkin/ponysay/archive/3.0.1.tar.gz";
+    sha256 = "ab281f43510263b2f42a1b0a9097ee7831b3e33a9034778ecb12ccb51f6915ee";
+  };
+
+  buildInputs = [ python3 texinfo makeWrapper ];
+
+  phases = "unpackPhase patchPhase installPhase";
+
+  patches = [ ./pathfix.patch ];
+
+  installPhase = ''
+    python3 setup.py --prefix=$out --freedom=partial install --with-shared-cache=$out/share/ponysay
+    for i in $(cd $out/bin && ls); do
+        wrapProgram $out/bin/$i \
+            --prefix PYTHONPATH : "$(toPythonPath $out):$PYTHONPATH"
+    done
+  '';
+
+  meta = {
+    description = "cowsay reimplemention for ponies.";
+    homepage = http://terse.tk/ponysay/;
+    license = "GPLv3";
+  };
+}
diff --git a/pkgs/tools/misc/ponysay/pathfix.patch b/pkgs/tools/misc/ponysay/pathfix.patch
new file mode 100644
index 000000000000..ad50f6530247
--- /dev/null
+++ b/pkgs/tools/misc/ponysay/pathfix.patch
@@ -0,0 +1,24 @@
+diff -urN ponysay-3.0.1/setup.py ponysay.p/setup.py
+--- ponysay-3.0.1/setup.py	2013-04-05 14:28:18.000000000 +0200
++++ ponysay.p/setup.py	2013-08-10 01:09:30.181043877 +0200
+@@ -514,7 +514,7 @@
+                 for command in commands:
+                     sourceed = 'completion/ponysay.%s' % (command)
+                     generated = 'completion/%s-completion.%s' % (shell, command)
+-                    generatorcmd = './completion/auto-auto-complete.py %s --output %s --source %s' % (shell, generated, sourceed)
++                    generatorcmd = 'python3 completion/auto-auto-complete.py %s --output %s --source %s' % (shell, generated, sourceed)
+                     Popen(generatorcmd.split(' ')).communicate()
+                     if conf[command] is not None:
+                         dest = generated + '.install'
+@@ -559,9 +559,9 @@
+                 for toolcommand in ('--dimensions', '--metadata'):
+                     if not self.free:
+                         print('%s, %s, %s' % ('./src/ponysaytool.py', toolcommand, sharedir))
+-                        Popen(['./src/ponysaytool.py', toolcommand, sharedir], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate()
++                        Popen(['python3', './src/ponysaytool.py', toolcommand, sharedir], stdin=PIPE, stdout=PIPE, stderr=PIPE).communicate()
+                     else:
+-                        params = ['./src/ponysaytool.py', toolcommand, sharedir, '--']
++                        params = ['python3', './src/ponysaytool.py', toolcommand, sharedir, '--']
+                         for sharefile in os.listdir(sharedir):
+                             if sharefile.endswith('.pony') and (sharefile != '.pony'):
+                                 if not Setup.validateFreedom(sharedir + '/' + sharefile):
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 9c7470796705..249be7cb90d4 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1526,6 +1526,8 @@ let
 
   polkit_gnome = callPackage ../tools/security/polkit-gnome { };
 
+  ponysay = callPackage ../tools/misc/ponysay { };
+
   povray = callPackage ../tools/graphics/povray { };
 
   ppl = callPackage ../development/libraries/ppl { };