Merge pull request #24559 from georgewhewell/mtools-darwin

mtools: fix build on darwin

authored by Daiderd Jordan and committed by GitHub 2aeafc16 ffea5e10

+19 -1
+11
pkgs/tools/filesystems/mtools/UNUSED-darwin.patch
··· 1 + --- mtools/sysincludes.h.orig 2017-04-01 20:59:46.083196540 +0100 2 + +++ mtools/sysincludes.h 2017-04-01 20:59:12.855030456 +0100 3 + @@ -103,7 +103,7 @@ 4 + # define PACKED __attribute__ ((packed)) 5 + # if __GNUC__ == 2 && __GNUC_MINOR__ > 6 || __GNUC__ >= 3 6 + /* gcc 2.6.3 doesn't have "unused" */ /* mool */ 7 + -# define UNUSED(x) x __attribute__ ((unused));x 8 + +# define UNUSED(x) x 9 + # define UNUSEDP __attribute__ ((unused)) 10 + # else 11 + # define UNUSED(x) x
+8 -1
pkgs/tools/filesystems/mtools/default.nix
··· 8 8 sha256 = "119gdfnsxc6hzicnsf718k0fxgy2q14pxn7557rc96aki20czsar"; 9 9 }; 10 10 11 + # Prevents errors such as "mainloop.c:89:15: error: expected ')'" 12 + # Upstream issue https://lists.gnu.org/archive/html/info-mtools/2014-02/msg00000.html 13 + patches = stdenv.lib.optional stdenv.isDarwin ./UNUSED-darwin.patch; 14 + 15 + # fails to find X on darwin 16 + configureFlags = stdenv.lib.optional stdenv.isDarwin "--without-x"; 17 + 11 18 doCheck = true; 12 19 13 20 meta = { 14 21 homepage = http://www.gnu.org/software/mtools/; 15 22 description = "Utilities to access MS-DOS disks"; 16 - platforms = stdenv.lib.platforms.gnu; # arbitrary choice 23 + platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.darwin; 17 24 maintainers = [ ]; 18 25 }; 19 26 }