summary refs log tree commit diff
path: root/pkgs/tools/networking/mpack
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2018-05-16 21:16:04 +0800
committerPeter Hoeg <peter@hoeg.com>2018-05-16 21:16:04 +0800
commit99e61887844b20a1dae129322b1742796466b683 (patch)
treec1485afb5a1abf882de7c77b24557e1f481300cb /pkgs/tools/networking/mpack
parent6db7f92cc2af827e8b8b181bf5ed828a1d0f141d (diff)
downloadnixlib-99e61887844b20a1dae129322b1742796466b683.tar
nixlib-99e61887844b20a1dae129322b1742796466b683.tar.gz
nixlib-99e61887844b20a1dae129322b1742796466b683.tar.bz2
nixlib-99e61887844b20a1dae129322b1742796466b683.tar.lz
nixlib-99e61887844b20a1dae129322b1742796466b683.tar.xz
nixlib-99e61887844b20a1dae129322b1742796466b683.tar.zst
nixlib-99e61887844b20a1dae129322b1742796466b683.zip
mpack: fix up broken paths
Diffstat (limited to 'pkgs/tools/networking/mpack')
-rw-r--r--pkgs/tools/networking/mpack/default.nix29
1 files changed, 25 insertions, 4 deletions
diff --git a/pkgs/tools/networking/mpack/default.nix b/pkgs/tools/networking/mpack/default.nix
index 8c8b40bbd2e0..62cec7c41eef 100644
--- a/pkgs/tools/networking/mpack/default.nix
+++ b/pkgs/tools/networking/mpack/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib }:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "mpack-1.6";
@@ -10,10 +10,31 @@ stdenv.mkDerivation rec {
 
   patches = [ ./build-fix.patch ];
 
-  preConfigure = "configureFlags=--mandir=$out/share/man";
+  postPatch = ''
+    for f in *.{c,man,pl,unix} ; do
+      substituteInPlace $f --replace /usr/tmp /tmp
+    done
 
-  meta = {
+    for f in unixpk.c ; do
+      substituteInPlace $f \
+        --replace /usr/sbin /run/current-system/sw/bin
+    done
+
+    # this just shuts up some warnings
+    for f in {decode,encode,part,unixos,unixpk,unixunpk,xmalloc}.c ; do
+      sed -i 'i#include <stdlib.h>' $f
+    done
+  '';
+
+  postInstall = ''
+    install -Dm644 -t $out/share/doc/mpack INSTALL README.*
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
     description = "Utilities for encoding and decoding binary files in MIME";
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.free;
+    platforms = platforms.linux;
   };
 }