aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/installers.scm
blob: 79738598cbff95bac84e0c79610d7a8e08e0cb40 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019 Carl Dong <contact@carldong.me>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages installers)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (gnu packages)
  #:use-module (gnu packages build-tools)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages cross-base)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system scons)
  #:use-module (guix utils))

(define (make-nsis machine target-arch nsis-target-type)
  (let* ((triplet (string-append machine "-" "w64-mingw32"))
         (xbinutils (cross-binutils triplet))
         (xlibc (cross-libc triplet))
         (xgcc (cross-gcc triplet #:libc xlibc)))
    (package
      (name (string-append "nsis-" machine))
      (version "3.08")
      (source (origin
                (method url-fetch)
                (uri (string-append "http://prdownloads.sourceforge.net/nsis/nsis-"
                                    version "-src.tar.bz2"))
                (sha256
                 (base32
                  "11qy1n1qdcqwal9hn8cmzm7gxjdyx7by6w14rfz2l646afnp0lm8"))
                (patches (search-patches "nsis-env-passthru.patch"))))
      (build-system scons-build-system)
      (native-inputs `(("xgcc" ,xgcc)
                       ("xbinutils" ,xbinutils)
                       ("mingw-w64" ,xlibc)))
      (inputs (list zlib))
      (arguments
       `(#:scons ,scons-python2
         #:modules ((srfi srfi-1)
                    (srfi srfi-26)
                    (guix build utils)
                    (guix build scons-build-system))
         #:tests? #f
         #:scons-flags `("UNICODE=yes"
                         "SKIPUTILS=MakeLangId,Makensisw,NSIS Menu,SubStart,zip2exe"
                         "SKIPDOC=COPYING"
                         "STRIP_CP=no"
                         ,(string-append "PREFIX=" %output)
                         ,(string-append "TARGET_ARCH=" ,target-arch)
                         ,(string-append "XGCC_W32_PREFIX=" ,triplet "-")
                         ,(string-append "PREFIX_PLUGINAPI_INC=" (assoc-ref %build-inputs "mingw-w64") "/include/")
                         ,(string-append "PREFIX_PLUGINAPI_LIB=" (assoc-ref %build-inputs "mingw-w64") "/lib/"))
         #:build-targets '("makensis"
                           "stubs"
                           "plugins"
                           "utils")
         #:install-targets '("install-stubs"
                             "install-plugins"
                             "install-data"
                             "install-utils"
                             "install-compiler"
                             "install-conf")
         #:phases (modify-phases %standard-phases
                    (add-before 'build 'fix-env
                      (lambda _
                        (define* (filter-delimited-string delimited-string predicate #:optional (delimiter #\:))
                          ;; Given a DELIMITED-STRING delimited by DELIMITER,
                          ;; only keep items that satisfy PREDICATE
                          (string-join
                           (filter predicate (string-split delimited-string delimiter))
                           (string delimiter)))
                        (define (mingw-path? path)
                          (string-prefix? (assoc-ref %build-inputs "mingw-w64") path))
                        (for-each
                         (lambda (env-name)
                           (let ((env-val (getenv env-name)))
                             ;; Remove all mingw-w64 paths from env vars meant
                             ;; for native toolchain
                             (setenv env-name
                                     (filter-delimited-string env-val (negate mingw-path?)))
                             ;; Add the removed paths back into CROSS_-prefixed
                             ;; version of env vars
                             (setenv (string-append "CROSS_" env-name)
                                     (filter-delimited-string env-val mingw-path?))))
                         '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH" "LIBRARY_PATH"))
                        ;; Hack to place mingw-w64 path at the end of search
                        ;; paths.  Could probably use a specfile and dirafter
                        (setenv "CROSS_C_INCLUDE_PATH"
                                (string-join
                                 `(,@(map (cut string-append
                                               (assoc-ref %build-inputs "xgcc")
                                               "/lib/gcc/" ,triplet "/"
                                               ,(package-version xgcc) <>)
                                          '("/include"
                                            "/include-fixed"))
                                   ,(getenv "CROSS_C_INCLUDE_PATH"))
                                 ":"))
                        (setenv "CROSS_CPLUS_INCLUDE_PATH"
                                (string-join
                                 `(,@(map (cut string-append (assoc-ref %build-inputs "xgcc") <>)
                                          `("/include/c++"
                                            ,(string-append "/include/c++/" ,triplet)
                                            "/include/c++/backward"
                                            ,@(map (cut string-append "/lib/gcc/" ,triplet "/" ,(package-version xgcc) <>)
                                                   '("/include"
                                                     "/include-fixed"))))
                                   ,(getenv "CROSS_CPLUS_INCLUDE_PATH"))
                                 ":"))))
                    (add-before 'build 'fix-target-detection
                      (lambda _
                        ;; NSIS target detection is screwed up, manually change
                        ;; it ourselves
                        (substitute* "Source/build.cpp" (("m_target_type=TARGET_X86UNICODE")
                                                         (string-append "m_target_type=" ,nsis-target-type))))))))
      (home-page "https://nsis.sourceforge.io/Main_Page")
      (synopsis "System to create Windows installers")
      (description
       "NSIS (Nullsoft Scriptable Install System) is a system to create
Windows installers.  It is designed to be as small and flexible as possible
and is therefore very suitable for internet distribution.")
      (license (license:non-copyleft "file://COPYING"
                                     "See COPYING in the distribution.")))))

(define-public nsis-x86_64
  (make-nsis "x86_64" "amd64" "TARGET_AMD64"))

(define-public nsis-i686
  (make-nsis "i686" "x86" "TARGET_X86UNICODE"))
cc-5)[source]: Use gcc-5.5.0-libstdc++-xmlcatalog.patch, gcc-13.2.0-libstdc++-docbook-xsl-uri.patch and gcc-13.2.0-libstdc++-info-install-fix.patch. (gcc-9)[source]: Use gcc-13.2.0-libstdc++-docbook-xsl-uri.patch and gcc-13.2.0-libstdc++-info-install-fix.patch. (make-libstdc++-doc)[arguments]<#:phases>: Remove 'set-xsl-directory. Adjust 'build and 'install for info documentation and to respect make-flags. [native-inputs]: Add docbook2x. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Change-Id: Ie3b9de0328a10efadb28d211c3fe03f9b7aaf87f Bruno Victal 2024-08-31gnu: libstdc++-doc: Rewrite with G-Expressions....* gnu/packages/gcc.scm (make-libstdc++-doc): Rewrite arguments with G-Expressions. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Change-Id: Idc8da964b7d777e0459c731625296ccd96546fa7 Bruno Victal 2024-08-31gnu: %objc++-search-paths: Express using $LIBRARY_PATH....* gnu/packages/gcc.scm (%objc++-search-paths): Express using $LIBRARY_PATH. Maxim Cournoyer 2024-08-31gnu: gccgo-4.9: Express search paths via (guix search-paths) variables....* gnu/packages/gcc.scm (gccgo-4.9) [native-search-paths]: Express search paths via (guix search-paths) variables. Maxim Cournoyer 2024-08-31gnu: gcc-2.95: Express search paths via (guix search-paths) variables....* gnu/packages/gcc.scm (gcc-2.95) [native-search-paths]: Express search paths via (guix search-paths) variables. Maxim Cournoyer 2024-08-31gnu: gcc-4.7: Use %gcc-search-paths for native-search-paths....* gnu/packages/gcc.scm (gcc-4.7) [native-search-paths]: Use %gcc-search-paths. Change-Id: Ia9acc98c2f7c7bc101ac43a4288ee4368c2b3dfa Maxim Cournoyer 2024-08-31gnu: libgccjit: Track the default GCC version....* gnu/packages/gcc.scm (libgccjit): Rewrite to use the default gcc version. Efraim Flashner 2024-08-28gnu: Add gfortran 13....* gnu/packages/gcc.scm (gfortran-13): New variable. Change-Id: Idf9a35548a9a80251cc70154c7d70f5b3a316db9 Signed-off-by: Zheng Junjie <zhengjunjie@iscas.ac.cn> Romain GARBAGE 2024-08-19gnu: gcc@12: Update to 12.4.0....* gnu/packages/gcc.scm (gcc-12): Update to 12.4.0. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Change-Id: Ibdd003d5b61eb4b9e6a1b56428d01d51cca97b44 fanquake 2024-08-05gnu: gcc-14: Update to 14.2.0....* gnu/packages/gcc.scm (gcc-14): Update to 14.2.0. Signed-off-by: Zheng Junjie <zhengjunjie@iscas.ac.cn> Change-Id: I250bf04c04233aa449f70701a238bfb4d4d07933 Michael Ford 2024-07-02gnu: Add libgccjit-14....* gnu/packages/gcc.scm (libgccjit-14): New variable. Change-Id: I9c5be52e4e07ca48ae7191b6ff0c163541544700 Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Zheng Junjie 2024-07-02gnu: Add gccgo-14....* gnu/packages/gcc.scm (gccgo-14): New variable. Change-Id: I065373047eb186ac410813b7eea0af3b44d8aaa7 Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Zheng Junjie 2024-07-02gnu: Add gcc-14....* gnu/packages/gcc.scm (gcc-14): New variable. Change-Id: I7eca4e35e010a69c13489c10c72c29d6e628bb72 Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Zheng Junjie 2024-06-11gnu: gcc: Add tuning targets for powerpc64le-linux....* gnu/packages/gcc.scm (%gcc-10-ppc64le-micro-architectures): New variable. (gcc-10, gcc-11, gcc-12, gcc-13)[properties]: Add entry in compiler-cpu-architectures for powerpc64le. Change-Id: I3f5d0f5949eea7ac1b1914ac1db2867f5d14aee6 Efraim Flashner 2024-05-30gnu: gcc-13: Remove unneeded patch for i586-gnu....* gnu/packages/gcc.scm (gcc-13)[arguments]: When building for i586-gnu delete the inherited phase 'patch-hurd-libpthread as it exists upstream. Change-Id: I0837dcff325b15b6975b34dbd7268faaa223ecdd Efraim Flashner 2024-05-30gnu: gccgo-12: Fix building on riscv64-linux....* gnu/packages/gcc.scm (make-gccgo)[arguments]: When building gccgo-12 for riscv64-linux don't add a phase to adjust the order of libgo dependencies. Change-Id: I600c744ce33ad802a5c466c19df41dcbb29a2be0 Efraim Flashner 2024-05-22gnu: gcc-13: Update to 13.3.0....* gnu/packages/gcc.scm (gcc-13): Update to 13.3.0. Signed-off-by: Zheng Junjie <zhengjunjie@iscas.ac.cn> Change-Id: Ia2dc3185acbb6671b2719e2d88d55b7d2b8fb92e Michael Ford 2024-04-04gnu: libstdc++: Support cross-compilation to powerpc64le-linux-gnu....Previously the phase would fail when cross-compiling because the patch could not be found in ‘inputs’. * gnu/packages/gcc.scm (make-libstdc++): Add alternative ‘patch-powerpc’ phase for when (%current-target-system) is true. Change-Id: Ia503d761d34596d95cc9d33edd911cebcc2e0d9e Ludovic Courtès 2024-03-07cpu: Enable tuning for i686-linux....* gnu/packages/gcc.scm (gcc-7, gcc-10, gcc-11, gcc-12, gcc-13) [properties]: In compiler-cpu-architectures use the x86_64-micro-architectures list for i686. * guix/cpu.scm (cpu->gcc-architecture): Expand the x86_64 case to also support i686. Change-Id: I0b820ceb715960db5e702814fa278dc8c619a836 Efraim Flashner 2024-03-07cpu: Rename x86-64-v1 to x86-64....This is the actual micro-architecture designation used by compilers. * gnu/packages/gcc.scm (%gcc-11-x86_64-micro-architectures): Rename x86-64-v1 to x86-64. * gnu/packages/golang.scm (%go-1.18-x86_64-micro-architectures): Same. * guix/cpu.scm (cpu->micro-architecture-level): Same. (gcc-architecture->micro-architecture-level): Same. Change-Id: I19ed556a7e8deb4a77f4c63fca3b794f25092788 Efraim Flashner 2024-03-05gnu: gcc@11: fix 'compiler-cpu-architectures' property....* gnu/packages/gcc.scm (%gcc-11-x86_64-micro-architectures): fix typo `alterlake' to `alderlake'. Change-Id: Ia1a7af3f25040101f6995b6a4df5f298bfbbeb44 Signed-off-by: Efraim Flashner <efraim@flashner.co.il> Zheng Junjie 2024-02-13gnu: gcc-4.8: Fix building....* gnu/packages/gcc.scm (gcc-4.7)[arguments]: Adjust configure-flags to build gcc-4.8 using the C++03 standard. (gcc-4.8)[arguments]: Add a phase to remove the current gcc's C++ headers from the CPLUS_INCLUDE_PATH. (gcc-4.9)[arguments]: Inherit from gcc-4.8. (gcc-6)[arguments]: Inherit from gcc-4.7. Change-Id: Ibec0683e8385ae011e6a809c664cb679f1a35b80 Efraim Flashner 2024-01-26gnu: Add gdc alias....* gnu/packages/gcc.scm (gdc): New variable. Change-Id: I38447e46ffba44d3a9d3757d34fe9ff081803457 Reviewed-by: Ludovic Courtès <ludo@gnu.org> Maxim Cournoyer