gnu: mingw-w64: Update to 5.0.4.
[jackhill/guix/guix.git] / gnu / packages / mingw.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
3 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages mingw)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages base)
24 #:use-module (gnu packages cross-base)
25 #:use-module (gnu packages gcc)
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages multiprecision)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix utils)
32 #:use-module (ice-9 match))
33
34 (define %mingw-triplet
35 "i686-w64-mingw32")
36
37 (define-public mingw-w64
38 (package
39 (name "mingw-w64")
40 (version "5.0.4")
41 (source (origin
42 (method url-fetch)
43 (uri (string-append
44 "https://sourceforge.net/projects/mingw-w64/files/mingw-w64/"
45 "mingw-w64-release/mingw-w64-v" version ".tar.bz2"))
46 (sha256
47 (base32 "00zq3z1hbzd5yzmskskjg79xrzwsqx7ihyprfaxy4hb897vf29sm"))
48 (patches (search-patches "mingw-w64-5.0rc2-gcc-4.9.3.patch"))))
49 (native-inputs `(("xgcc-core" ,(cross-gcc %mingw-triplet))
50 ("xbinutils" ,(cross-binutils %mingw-triplet))))
51 (build-system gnu-build-system)
52 (search-paths
53 (list (search-path-specification
54 (variable "CROSS_C_INCLUDE_PATH")
55 (files '("include" "i686-w64-mingw32/include")))
56 (search-path-specification
57 (variable "CROSS_LIBRARY_PATH")
58 (files
59 '("lib" "lib64" "i686-w64-mingw32/lib" "i686-w64-mingw32/lib64")))))
60 (arguments
61 `(#:configure-flags '("--host=i686-w64-mingw32")
62 #:phases
63 (modify-phases %standard-phases
64 (add-before 'configure 'setenv
65 (lambda* (#:key inputs #:allow-other-keys)
66 (let ((xgcc-core (assoc-ref inputs "xgcc-core"))
67 (mingw-headers (string-append (getcwd) "/mingw-w64-headers")))
68 (setenv "CPP"
69 (string-append xgcc-core "/bin/i686-w64-mingw32-cpp"))
70 (setenv "CROSS_C_INCLUDE_PATH"
71 (string-append
72 mingw-headers
73 ":" mingw-headers "/include"
74 ":" mingw-headers "/crt"
75 ":" mingw-headers "/defaults/include"
76 ":" mingw-headers "/direct-x/include"))))))
77 #:make-flags (list "DEFS=-DHAVE_CONFIG_H -D__MINGW_HAS_DXSDK=1")
78 #:tests? #f ; compiles and includes glibc headers
79 #:strip-binaries? #f))
80 (home-page "https://mingw-w64.org")
81 (synopsis "Minimalist GNU for Windows")
82 (description
83 "Minimalist GNU for Windows (@dfn{MinGW}) is a complete software
84 development environment for creating native Microsoft Windows applications.
85
86 It includes a set of Windows-specific header files and static import libraries
87 which enable the use of the Windows API. It does not rely on any third-party C
88 runtime dynamic-link libraries (@dfn{DLL}s).
89
90 Mingw-w64 is an advancement of the original mingw.org project and provides
91 several new APIs such as DirectX and DDK, and 64-bit support.")
92 (license license:fdl1.3+)))