aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/installers.scm
blob: c768a367aaa79113b789c5966a8d005a34d52244 (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
143
;;; 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 compression)
  #:use-module (gnu packages cross-base)
  #:use-module (gnu packages python-xyz)
  #: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.05")
      (source (origin
                (method url-fetch)
                (uri (string-append "http://prdownloads.sourceforge.net/nsis/nsis-"
                                    version "-src.tar.bz2"))
                (sha256
                 (base32
                  "1sbwx5vzpddharkb7nj4q5z3i5fbg4lan63ng738cw4hmc4v7qdn"))
                (patches (search-patches "nsis-env-passthru.patch"
                                         "nsis-source-date-epoch.patch"))))
      (build-system scons-build-system)
      (native-inputs `(("xgcc" ,xgcc)
                       ("xbinutils" ,xbinutils)
                       ("mingw-w64" ,xlibc)))
      (inputs `(("zlib" ,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_X86ANSI")
                                                         (string-append "m_target_type=" ,nsis-target-type))))))))
      (home-page "http://nsis.sourceforge.net/")
      (synopsis "A professional open source system to create Windows installers")
      (description
       "NSIS (Nullsoft Scriptable Install System) is a professional open source
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"))
m, gnu/packages/wm.scm, gnu/packages/wxwidgets.scm, gnu/packages/xdisorg.scm, gnu/packages/xorg.scm: In all snippets, report errors using exceptions, or else return #t. Mark H Weaver 2017-12-13gnu: mit-krb5: Update to 1.16....* gnu/packages/kerberos.scm (mit-krb5): Update to 1.16. [source](uri): Add kerberos.org mirror. Use HTTPS on web.mit.edu. Marius Bakke 2017-10-22gnu: mit-krb5: Remove graft for 1.15.2....* gnu/packages/kerberos.scm (mit-krb5): Update to 1.15.2. [replacement]: Remove field. (mit-krb5-1.15.2): Remove variable. Marius Bakke 2017-10-09gnu: mit-krb5: Replace with 1.15.2 [fixes CVE-2017-{11368,11462}]....* gnu/packages/kerberos.scm (mit-krb5)[replacement]: New field. (mit-krb5-1.15.2): New variable. Leo Famulari 2017-07-23Merge branch 'master' into core-updatesLeo Famulari 2017-07-20gnu: heimdal: Fix CVE-2017-{6594,11103}....* gnu/packages/patches/heimdal-CVE-2017-6594.patch, gnu/packages/patches/heimdal-CVE-2017-11103.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/kerberos.scm (heimdal)[source]: Use them. Alex Vong 2017-07-14gnu: mit-krb5: Add ‘cpe-name’....* gnu/packages/kerberos.scm (mit-krb5)[properties]: New field. Tobias Geerinckx-Rice 2017-06-30gnu: shishi: Build with latest libgcrypt....* gnu/packages/patches/shishi-fix-libgcrypt-detection.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/kerberos.scm (shishi)[source]: Use it. [inputs]: Use libgcrypt instead of libgcrypt-1.5. [arguments]: Set 'ac_cv_libgcrypt=yes' in #:configure-flags. * gnu/packages/gnupg.scm (libgcrypt-1.5): Remove variable. Leo Famulari 2017-05-24gnu: mit-krb5: Enable parallel build and tests....* gnu/packages/kerberos.scm (mit-krb5)[arguments]: Enable parallel building and parallel tests. Ricardo Wurmus 2017-05-24gnu: mit-krb5: Update to 1.15.1....* gnu/packages/kerberos.scm (mit-krb5): Update to 1.15.1. Ricardo Wurmus 2017-03-30Merge branch 'master' into core-updates...Most conflicts are from 6fd52309b8f52c9bb59fccffac53e029ce94b698. Marius Bakke 2017-03-30gnu: Use HTTPS for almost all gnu.org HOME-PAGEs....All HTTP gnu.org (and supported subdomain) HOME-PAGEs changed to HTTPS. Tobias Geerinckx-Rice 2017-01-23Merge branch 'master' into core-updatesLudovic Courtès 2017-01-19gnu: Add Heimdal....* gnu/packages/kerberos.scm (heimdal): New variable. Ludovic Courtès 2017-01-19gnu: Move Kerberos implemetations to (gnu packages kerberos)....* gnu/packages/mit-krb5.scm: Remove. * gnu/packages/shishi.scm: Remove. * gnu/packages/kerberos.scm: New file, from the concatenation of these two. * gnu/local.mk (GNU_SYSTEM_MODULES): Adjust accordingly. * gnu/packages/admin.scm, gnu/packages/cyrus-sasl.scm, gnu/packages/gnome.scm, gnu/packages/gnuzilla.scm, gnu/packages/gsasl.scm, gnu/packages/java.scm, gnu/packages/networking.scm, gnu/packages/nfs.scm, gnu/packages/onc-rpc.scm, gnu/packages/ssh.scm, gnu/packages/web.scm: Adjust accordingly. Ludovic Courtès