2015-08-15 21:01:46 +02:00
|
|
|
{ stdenv, fetchzip, fetchFromGitHub, file, libxslt, docbook_xml_dtd_412, docbook_xsl, xmlto
|
|
|
|
, w3m, which, gnugrep, gnused, coreutils
|
|
|
|
, mimiSupport ? false, gawk ? null }:
|
|
|
|
|
|
|
|
assert mimiSupport -> gawk != null;
|
|
|
|
|
|
|
|
let
|
|
|
|
# A much better xdg-open
|
|
|
|
mimisrc = fetchFromGitHub {
|
|
|
|
owner = "march-linux";
|
|
|
|
repo = "mimi";
|
|
|
|
rev = "d85ea8256ed627e93b387cd42e4ab39bfab9504c";
|
|
|
|
sha256 = "1h9mb3glfvc6pa2f9g07xgmf8lrwxiyjxvl906xlysy4klybxvhg";
|
|
|
|
};
|
|
|
|
in
|
2010-03-25 20:48:06 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2015-09-20 09:40:56 +02:00
|
|
|
name = "xdg-utils-1.1.0-rc3p46";
|
2014-11-06 01:44:33 +01:00
|
|
|
|
2015-05-13 15:32:32 +02:00
|
|
|
src = fetchzip {
|
2015-06-18 22:23:55 +02:00
|
|
|
name = "${name}.tar.gz";
|
2015-09-20 09:40:56 +02:00
|
|
|
url = "http://cgit.freedesktop.org/xdg/xdg-utils/snapshot/03577f987730.tar.gz";
|
|
|
|
sha256 = "1fs0kxalmpqv6x0rv4xg65w8r26sk464xisrbwp4p6a033y5x34l";
|
2010-03-25 20:48:06 +01:00
|
|
|
};
|
2012-10-04 13:38:26 +02:00
|
|
|
|
2015-02-07 07:30:05 +01:00
|
|
|
# just needed when built from git
|
|
|
|
buildInputs = [ libxslt docbook_xml_dtd_412 docbook_xsl xmlto w3m ];
|
2015-01-25 14:30:27 +01:00
|
|
|
|
2015-08-15 21:01:46 +02:00
|
|
|
postInstall = stdenv.lib.optionalString mimiSupport ''
|
|
|
|
cp ${mimisrc}/xdg-open $out/bin/xdg-open
|
|
|
|
substituteInPlace $out/bin/xdg-open --replace "awk " "${gawk}/bin/awk "
|
|
|
|
substituteInPlace $out/bin/xdg-open --replace "sort " "${coreutils}/bin/sort "
|
|
|
|
substituteInPlace $out/bin/xdg-open --replace "(file " "(${file}/bin/file "
|
|
|
|
'' + ''
|
2015-06-18 10:51:35 +02:00
|
|
|
for item in $out/bin/*; do
|
|
|
|
substituteInPlace $item --replace "cut " "${coreutils}/bin/cut "
|
|
|
|
substituteInPlace $item --replace "sed " "${gnused}/bin/sed "
|
|
|
|
substituteInPlace $item --replace "egrep " "${gnugrep}/bin/egrep "
|
2015-07-05 09:25:13 +02:00
|
|
|
sed -i $item -re "s#([^e])grep #\1${gnugrep}/bin/grep #g" # Don't replace 'egrep'
|
2015-07-26 13:01:11 +02:00
|
|
|
substituteInPlace $item --replace "which " "type -P "
|
2015-06-18 10:51:35 +02:00
|
|
|
substituteInPlace $item --replace "/usr/bin/file" "${file}/bin/file"
|
|
|
|
done
|
2012-10-04 13:38:26 +02:00
|
|
|
'';
|
2014-11-06 01:44:33 +01:00
|
|
|
|
2015-08-15 21:01:46 +02:00
|
|
|
meta = with stdenv.lib; {
|
2010-03-25 20:48:06 +01:00
|
|
|
homepage = http://portland.freedesktop.org/wiki/;
|
|
|
|
description = "A set of command line tools that assist applications with a variety of desktop integration tasks";
|
2015-08-15 21:01:46 +02:00
|
|
|
license = if mimiSupport then licenses.gpl2 else licenses.free;
|
|
|
|
maintainers = [ maintainers.eelco ];
|
2015-10-28 18:49:04 +01:00
|
|
|
platforms = platforms.all;
|
2010-03-25 20:48:06 +01:00
|
|
|
};
|
|
|
|
}
|