fixup! WiP! Dhallify libretro, index generation

This commit is contained in:
Ehmry - 2019-07-17 15:34:45 +02:00
parent f0c402bf08
commit 777dc24736
5 changed files with 60 additions and 13 deletions

View File

@ -63,5 +63,5 @@ AWK_RUNTIME_PATH = awk -v RS=' ' -F '/' \
# Generate the depot index file
: index.dhall | $(DEPOT_DIR)/index/<entry> |> \
!dhall text < %f | xz > %o \
!dhall text < %f | xmllint --format - | xz > %o \
|> public/@(PUBLIC_USER)/index/@(SCULPT_VERSION).xz

View File

@ -77,7 +77,7 @@ RAW_DIR = $(DEPOT_RAW_DIR)/$(RAW_NAME)/current
BIN_DIR = $(DEPOT_BIN_DIR)/$(BIN_NAME)/current
# Destination for locally defined binary package
PKG_DIR = $(DEPOT_BIN_DIR)/$(BIN_NAME)/current
PKG_DIR = $(DEPOT_PKG_DIR)/$(PKG_NAME)/current
# Destination for locally defined runtime package
!raw = |> ^ generate raw metadata^ \
@ -204,13 +204,13 @@ DHALL_GENODE = $(TUP_CWD)/dhall/package.dhall
DHALL_GENODE_TYPES = $(TUP_CWD)/dhall/types.dhall
DHALL = DHALL_GENODE=$(DHALL_GENODE) DHALL_GENODE_TYPES=$(DHALL_GENODE_TYPES) dhall
!dhall = |> $(DHALL) |>
!dhall = |> ^b^ $(DHALL) |>
DEPOT_MANIFEST = $(PUBLIC_DIR)/manifest.dhall
!index_pkg = | $(PUBLIC_DIR)/<manifest> |> ^ Generate index.dhall^\
$(DHALL) <<< '{ info = (%f).indexInfo, name = "$(PKG_NAME)", version = ($(DEPOT_MANIFEST)).pkg.$(PKG_NAME).version }' > %o \
|> index.dhall $(DEPOT_DIR)/index/<entry>
|> $(PKG_DIR)/index.dhall $(DEPOT_DIR)/index/<entry>
!render_runtime = |> \
$(DHALL) text <<< '$(ERRATA_DIR)/renderRuntime.dhall (%f).runtime' > %o; \

View File

@ -47,23 +47,35 @@ let subIndex =
let emu =
subIndex
"Emulators and game engines"
[ ./libretro/cores/snes9x/upstream/libretro/index.dhall ]
[ ./depot/pkg/fceumm/current/index.dhall
, ./depot/pkg/gambatte/current/index.dhall
, ./depot/pkg/snes9x/current/index.dhall
, ./depot/pkg/mgba/current/index.dhall
]
let games =
subIndex
"Games"
[ ./libretro/cores/2048/upstream/index.dhall
, ./libretro/cores/tyrquake/upstream/index.dhall
[ ./depot/pkg/libretro-2048/current/index.dhall
, ./depot/pkg/tyrquake/current/index.dhall
]
let streams =
subIndex
"Streams"
[ ./depot/pkg/ifm1/current/index.dhall
, ./depot/pkg/ifm2/current/index.dhall
, ./depot/pkg/ifm3/current/index.dhall
]
let utilities =
subIndex
"Utilities"
[ ./runtimes/depot_9P/index.dhall
, ./src/show_input/index.dhall
, ./src/nic_bus/index.dhall
, ./runtimes/noux-system/index.dhall
, ./runtimes/backdrop/index.dhall
[ ./depot/pkg/depot_9P/current/index.dhall
, ./depot/pkg/show_input/current/index.dhall
, ./depot/pkg/nic_bus/current/index.dhall
, ./depot/pkg/noux-system/current/index.dhall
, ./depot/pkg/backdrop/current/index.dhall
]
let index =

View File

@ -15,5 +15,8 @@ DEFINES += -Wno-write-strings
: {core} |> !collect_bin |>
: |> !bin |>
: $(TUP_CWD)/runtime |> !collect_pkg_runtime |>
: $(TUP_CWD)/pkg.dhall |> !render_runtime |> {runtime}
: {runtime} |> !collect_pkg_runtime |>
: |> !pkg |>
: $(TUP_CWD)/pkg.dhall |> !index_pkg |>

View File

@ -0,0 +1,32 @@
let XML = (env:DHALL_GENODE).Prelude.XML
let defaults = ./../../pkgDefaults.dhall
in { indexInfo =
"NES emulator"
, runtime =
defaults.runtime
⫽ { config =
XML.text
''
<config>
<libc stdout="/dev/log" stderr="/dev/log"/>
<game/>
<vfs>
<fs/>
<dir name="dev"> <log label="core"/> </dir>
</vfs>
<default-controller port="0" device="1">
<map from="KEY_LEFT" to="LEFT"/>
<map from="KEY_RIGHT" to="RIGHT"/>
<map from="KEY_UP" to="UP"/>
<map from="KEY_DOWN" to="DOWN"/>
<map from="KEY_X" to="A"/>
<map from="KEY_Z" to="B"/>
<map from="KEY_ENTER" to="START"/>
<map from="KEY_RIGHTSHIFT" to="SELECT"/>
</default-controller>
</config>
''
}
}