git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #24559 from georgewhewell/mtools-darwin

mtools: fix build on darwin

commit2aeafc16c851c499dbc250f0fde72e082875d1c2 authorDaiderd Jordan <daiderd@gmail.com> dateWed 5 Apr 2017, 00:40 (10 years ago) parentffea5e19b1a70f
2 files changed+19−1
pkgs/tools/filesystems/mtools/UNUSED-darwin.patch+11 pkgs/tools/filesystems/mtools/default.nix+8−1
pkgs/tools/filesystems/mtools/UNUSED-darwin.patchnew file+11
@@ -0,0 +1,11 @@
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
pkgs/tools/filesystems/mtools/default.nix+8−1
@@ -8,12 +8,19 @@ stdenv.mkDerivation rec {
88 sha256 = "119gdfnsxc6hzicnsf718k0fxgy2q14pxn7557rc96aki20czsar";
99 };
1010
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+
1118 doCheck = true;
1219
1320 meta = {
1421 homepage = http://www.gnu.org/software/mtools/;
1522 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;
1724 maintainers = [ ];
1825 };
1926}