summaryrefslogtreecommitdiff
path: root/packages/komodo/vcpkg.scm
diff options
context:
space:
mode:
authorMarek Paśnikowski <marek@marekpasnikowski.pl>2024-03-20 12:37:34 +0100
committerMarek Paśnikowski <marek@marekpasnikowski.pl>2024-03-20 12:37:34 +0100
commitdfb72b837be8285612c303e056503e71ca5539ce (patch)
tree5e1b2e7ce5edddece190951a907c822e16aecd1b /packages/komodo/vcpkg.scm
parentdbc3b686a994969000218d6dc1836716b88aa303 (diff)
Rename the imported private directory as package directory
Diffstat (limited to 'packages/komodo/vcpkg.scm')
-rw-r--r--packages/komodo/vcpkg.scm168
1 files changed, 168 insertions, 0 deletions
diff --git a/packages/komodo/vcpkg.scm b/packages/komodo/vcpkg.scm
new file mode 100644
index 0000000..260ce19
--- /dev/null
+++ b/packages/komodo/vcpkg.scm
@@ -0,0 +1,168 @@
+(define-module (vcpkg)
+ ;; #:use-module (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"))))