summaryrefslogtreecommitdiff
path: root/packages/komodo/vcpkg.scm
blob: c49c1eb9ed3eb040a452723a52ff8ffdce931f90 (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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
(define-module (packages komodo vcpkg)
  ;; #:use-module (packages komodo cmake)
  ;; #:use-module (gnu packages commencement)
  ;; #:use-module (gnu packages compression)
  ;; #:use-module (gnu packages cpp)
  ;; #:use-module (gnu packages curl)
  ;; #:use-module (gnu packages ncurses)
  ;; #:use-module (gnu packages ninja)
  ;; #:use-module (guix build utils)
  #:use-module (guix build-system copy)
  #:use-module (guix build-system cmake)
  ;; #:use-module (guix build-system qt)
  #:use-module (guix download)
  ;; #:use-module (guix gexp)
  ;; #:use-module (guix git-download)
  #:use-module ((guix licenses)
		#:prefix license:)
  #:use-module (guix packages)
  ;; #:use-module (nonguix build-system binary)
  )


;;; ABSTRACTION -2

(define-public vcpkg-tool-cmrc
  (let ((version "2.0.1"))
    (package
     (name "vcpkg-cmrc")
     (version version)
     (source
      (origin
       (uri
	(string-append
	 "https://github.com/vector-of-bool/cmrc/archive/refs/tags/"
	 version
	 ".tar.gz"))
       (method url-fetch)
       (hash
	(content-hash
	 "06xpnnwbqv3r8v0vblzcrjp2zgddy05v132y9c9dz8dyl2m5zbgd"))))
     (build-system copy-build-system)
     (arguments
      '(#:install-plan '(("CMakeRC.cmake" "CMakeRCConfig.cmake"))))
     (synopsis "A Resource Compiler in a Single CMake Script")
     (description
      (string-append
       "CMakeRC is a resource compiler provided in a single CMake "
       "script that can easily be included in another project."))
     (license license:expat)
     (home-page "https://github.com/vector-of-bool/cmrc/"))))

(define-public vcpkg-tool-fmt
  (let ((version "10.1.0"))
    (package
     (name "vcpkg-fmt")
     (version version)
     (source
      (origin
       (uri
	(string-append
	 "https://github.com/fmtlib/fmt/archive/refs/tags/"
	 version ".tar.gz"))
       (method url-fetch)
       (hash
	(content-hash
	 "02na80r7yrkda89s7mz35llqh904dbsppb7g5s7na9ji5yns7c6y"))))
     (build-system cmake-build-system)
     (synopsis "A modern formatting library")
     (description
      (string-append
       "{fmt} is an open-source formatting library providing a fast "
       "and safe alternative to C stdio and C++ iostreams."))
     (license license:expat)
     (home-page "https://fmt.dev/"))))

;;; ABSTRACTION -1

(define vcpkg
  (let ((version "2024.02.14"))
    (package
     (name "vcpkg")
     (version version)
     (source 
      (origin
       (uri
	(string-append
	 "https://github.com/microsoft/vcpkg/archive/refs/tags/"
	 version
	 ".tar.gz"))
       (method url-fetch)
       (hash
	(content-hash
	 "1wbhxfbi964bc93f69rsr1h6z82ypc9lyz2rb0kp3sfwp0m9jhhf"))))
     (build-system copy-build-system)
     (arguments
      (list
       #:install-plan '(list (list "vcpkg" "vcpkg"))
       #:phases
       #~ (modify-phases
	   %standard-phases
	   (add-after
	    'unpack
	    'unpack-vcpkg-tool
	    (lambda _
	      (invoke "mkdir" "downloads")
	      (copy-recursively
	       #+ (origin
		   (uri
		    (string-append
		     "https://github.com/microsoft/vcpkg-tool/archive/"
		     "2024-02-07"
		     ".tar.gz"))
		   (method url-fetch)
		   (hash
		    (content-hash
		     "1j08vw8l8zf6pv6n1kvyjwvj0h7y667shs72sf69hg7p8zj5k9p4")))
	       "downloads/2024-02-07.tar.gz")))
	   (add-after
	    'unpack-vcpkg-tool
	    'patch-vcpkg-tool
	    (lambda* _
	      (invoke "chmod" "+w" "downloads/2024-02-07.tar.gz")
	      (invoke "gunzip" "downloads/2024-02-07.tar.gz")
	      (invoke
	       "tar" "-xf" "downloads/2024-02-07.tar" "-C" "downloads"
	       "vcpkg-tool-2024-02-07/cmake/Findfmt.cmake"
	       "vcpkg-tool-2024-02-07/cmake/FindCMakeRC.cmake")
	      (invoke
	       "tar" "--delete" "-f" "downloads/2024-02-07.tar"
	       "vcpkg-tool-2024-02-07/cmake/Findfmt.cmake"
	       "vcpkg-tool-2024-02-07/cmake/FindCMakeRC.cmake")
	      (substitute*
	       "downloads/vcpkg-tool-2024-02-07/cmake/Findfmt.cmake"
	       (("the fmt library\" OFF")
		"the fmt library\" ON"))
	      (substitute*
	       "downloads/vcpkg-tool-2024-02-07/cmake/FindCMakeRC.cmake"
	       (("resource compiler\" OFF")
		"resource compiler\" ON"))
	      (invoke
	       "tar" "-rf" "downloads/2024-02-07.tar"
	       "downloads/vcpkg-tool-2024-02-07/cmake/Findfmt.cmake"
	       "downloads/vcpkg-tool-2024-02-07/cmake/FindCMakeRC.cmake")
	      (invoke "gzip" "downloads/2024-02-07.tar")))
	   (add-after
	    'patch-generated-file-shebangs
	    'bootstrap-vcpkg
	    (lambda* _
	      (substitute*
	       "scripts/bootstrap.sh"
	       (("vcpkgDownloadTool=\"ON\"")
		"vcpkgDownloadTool=\"OFF\"")
	       (("\\$actualHash")
		"$expectedHash"))
	      (invoke "./bootstrap-vcpkg.sh" "--disableMetrics")))
	   (delete 'configure)
	   (delete 'build)
	   (delete 'check))))
     (native-inputs
      (list cmake curl ninja unzip vcpkg-tool-cmrc vcpkg-tool-fmt zip))
     (synopsis "C++ Library Manager for Windows, Linux, and MacOS")
     (description
      (string-append
       "Vcpkg helps you manage C and C++ libraries on Windows, Linux "
       "and MacOS. This tool and ecosystem are constantly evolving, "
       "and we always appreciate contributions!"))
     (license license:expat)
     (home-page "https://vcpkg.io"))))