xdg_utils: add mimi support

authored by Jan Malakhovski and committed by Luca Bruno a0f50dc6 c88e9def

+25 -8
+25 -8
pkgs/tools/X11/xdg-utils/default.nix
··· 1 - { stdenv, fetchzip, file, libxslt, docbook_xml_dtd_412, docbook_xsl, xmlto 2 - , w3m, which, gnugrep, gnused, coreutils }: 1 + { stdenv, fetchzip, fetchFromGitHub, file, libxslt, docbook_xml_dtd_412, docbook_xsl, xmlto 2 + , w3m, which, gnugrep, gnused, coreutils 3 + , mimiSupport ? false, gawk ? null }: 4 + 5 + assert mimiSupport -> gawk != null; 6 + 7 + let 8 + # A much better xdg-open 9 + mimisrc = fetchFromGitHub { 10 + owner = "march-linux"; 11 + repo = "mimi"; 12 + rev = "d85ea8256ed627e93b387cd42e4ab39bfab9504c"; 13 + sha256 = "1h9mb3glfvc6pa2f9g07xgmf8lrwxiyjxvl906xlysy4klybxvhg"; 14 + }; 15 + in 3 16 4 17 stdenv.mkDerivation rec { 5 18 name = "xdg-utils-1.1.0-rc3p7"; ··· 13 26 # just needed when built from git 14 27 buildInputs = [ libxslt docbook_xml_dtd_412 docbook_xsl xmlto w3m ]; 15 28 16 - postInstall = '' 29 + postInstall = stdenv.lib.optionalString mimiSupport '' 30 + cp ${mimisrc}/xdg-open $out/bin/xdg-open 31 + substituteInPlace $out/bin/xdg-open --replace "awk " "${gawk}/bin/awk " 32 + substituteInPlace $out/bin/xdg-open --replace "sort " "${coreutils}/bin/sort " 33 + substituteInPlace $out/bin/xdg-open --replace "(file " "(${file}/bin/file " 34 + '' + '' 17 35 for item in $out/bin/*; do 18 36 substituteInPlace $item --replace "cut " "${coreutils}/bin/cut " 19 37 substituteInPlace $item --replace "sed " "${gnused}/bin/sed " ··· 24 42 done 25 43 ''; 26 44 27 - meta = { 45 + meta = with stdenv.lib; { 28 46 homepage = http://portland.freedesktop.org/wiki/; 29 47 description = "A set of command line tools that assist applications with a variety of desktop integration tasks"; 30 - license = stdenv.lib.licenses.free; 31 - maintainers = [ stdenv.lib.maintainers.eelco ]; 32 - platforms = stdenv.lib.platforms.linux; 48 + license = if mimiSupport then licenses.gpl2 else licenses.free; 49 + maintainers = [ maintainers.eelco ]; 50 + platforms = platforms.linux; 33 51 }; 34 52 } 35 -