@@ -1,4 +1,4 @@
1−{ stdenv, fetchurl, pkgconfig, glib }:
1+{ stdenv, fetchurl }:
22
33stdenv.mkDerivation rec {
44 name = "mpack-1.6";
@@ -10,10 +10,31 @@ stdenv.mkDerivation rec {
1010
1111 patches = [ ./build-fix.patch ];
1212
13− preConfigure = "configureFlags=--mandir=$out/share/man";
13+ postPatch = ''
14+ for f in *.{c,man,pl,unix} ; do
15+ substituteInPlace $f --replace /usr/tmp /tmp
16+ done
1417
15− meta = {
18+ for f in unixpk.c ; do
19+ substituteInPlace $f \
20+ --replace /usr/sbin /run/current-system/sw/bin
21+ done
22+
23+ # this just shuts up some warnings
24+ for f in {decode,encode,part,unixos,unixpk,unixunpk,xmalloc}.c ; do
25+ sed -i 'i#include <stdlib.h>' $f
26+ done
27+ '';
28+
29+ postInstall = ''
30+ install -Dm644 -t $out/share/doc/mpack INSTALL README.*
31+ '';
32+
33+ enableParallelBuilding = true;
34+
35+ meta = with stdenv.lib; {
1636 description = "Utilities for encoding and decoding binary files in MIME";
17− platforms = stdenv.lib.platforms.linux;
37+ license = licenses.free;
38+ platforms = platforms.linux;
1839 };
1940}