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
|
(define-module (antara-gaming-sdk)
#:use-module (doom-meta)
#:use-module (gnu packages cpp)
#:use-module (gnu packages game-development)
#:use-module (gnu packages llvm)
#:use-module (gnu packages pretty-print)
#:use-module (guix build utils)
#:use-module (guix build-system cmake)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module ((guix licenses)
#:prefix license:)
#:use-module (guix packages))
;;; BOTTOM LAYER
(define antara-gaming-sdk-configure-flags
'(list "-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
"-Wno-dev"))
(define antara-gaming-sdk-github
"https://github.com/KomodoPlatform/antara-gaming-sdk")
(define antara-gaming-sdk-hash
(content-hash "12jqg0y92y86lm0516k06x81zrargfgvby10kxmhj1vaxkf71ig6"))
(define antara-gaming-sdk-native-inputs
(list doom-meta entt fmt range-v3))
(define antara-gaming-sdk-version "1.1.0-alpha")
(define build-path-prefix "../build/_deps/")
(define find-entt "find_package(EnTT)\n")
(define find-fmt "find_package(fmt)\n")
(define loguru-hash
(content-hash "1lig80s99kk5yjs7yn5nfm7jfz8982hink5ff7pzi4afkab2hbcd"))
(define loguru-src "loguru-src/")
;;; ABSTRACTION LAYER -5
(define build-path-loguru
(string-append build-path-prefix loguru-src))
(define loguru-origin
(origin (uri "https://github.com/emilk/loguru/archive/v2.1.0.zip")
(method url-fetch)
(hash loguru-hash)))
;;; ABSTRACTION LAYER -4
(define download-loguru
`(string-append "3.14)\n\n" "file(ARCHIVE_EXTRACT INPUT " ,loguru-origin " "
"DESTINATION " ,build-path-loguru ")\n"
"file(COPY " ,build-path-loguru "/loguru-2.1.0/ "
"DESTINATION " ,build-path-loguru ")\n"))
(define find-package-calls
(string-append "Dependancies\n" "\n" find-fmt find-entt "\n"))
;;; ABSTRACTION LAYER -3
(define get-loguru
`(substitute* "CMakeLists.txt"
(("3.14\\)") ,download-loguru)))
(define get-more-packages
`(substitute* "cmake/dependencies.cmake"
(("Dependancies") ,find-package-calls)))
(define rename-doom-targets
`(substitute* (list "modules/math/CMakeLists.txt"
"modules/event/CMakeLists.txt"
"modules/ecs/CMakeLists.txt")
(("doom::meta") "doom")))
;;; ABSTRACTION LAYER -2
(define supplement-libs
`(lambda _
,get-loguru
,get-more-packages
,rename-doom-targets))
;;; ABSTRACTION LAYER -1
(define antara-gaming-sdk-phases
#~ (modify-phases %standard-phases
(add-after 'unpack
'supplement-libs
#+ supplement-libs)))
(define antara-gaming-sdk-git-reference
(git-reference (url antara-gaming-sdk-github)
(commit antara-gaming-sdk-version)))
;;; ABSTRACTION LAYER 0
(define antara-gaming-sdk-arguments
`(#:phases ,antara-gaming-sdk-phases
#:configure-flags ,antara-gaming-sdk-configure-flags))
(define antara-gaming-sdk-origin
(origin (uri antara-gaming-sdk-git-reference)
(method git-fetch)
(hash antara-gaming-sdk-hash)))
;;; SURFACE LAYER
(define antara-gaming-sdk-blueprint
(package (name "antara-gaming-sdk-blueprint")
(version antara-gaming-sdk-version)
(source antara-gaming-sdk-origin)
(build-system cmake-build-system)
(arguments antara-gaming-sdk-arguments)
(native-inputs antara-gaming-sdk-native-inputs)
(synopsis "Komodo Gaming Software Development Kit")
(description "Komodo Gaming Software Development Kit")
(license license:cc-by-sa4.0)
(home-page antara-gaming-sdk-github)))
(define antara-gaming-sdk/clang-toolchain
(package-with-c-toolchain antara-gaming-sdk-blueprint
`(("clang-toolchain" ,clang-toolchain-17))))
(define-public antara-gaming-sdk
(package (inherit antara-gaming-sdk/clang-toolchain)
(name "antara-gaming-sdk")))
|