From 155772afcef768f9a6b04f78b2f2ea82887478db Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Wed, 27 Feb 2019 22:33:14 +0100 Subject: [PATCH] Unify depot output rules --- Tuprules.tup | 12 +++++++++--- libretro/cores/core.tup | 7 ++++--- nimble/binaries.tup | 6 ++---- nimble/package.tup | 4 ++-- runtimes/icy-streams/icy-stream.tup | 4 ++-- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Tuprules.tup b/Tuprules.tup index 0ea31435b..f94a6ab78 100644 --- a/Tuprules.tup +++ b/Tuprules.tup @@ -16,15 +16,21 @@ PUBLIC_DIR = $(TUP_CWD)/public/@(DEPOT_USER) DEPOT_BIN_DIR = $(DEPOT_DIR)/bin/x86_64 PUBLIC_BIN_DIR = $(PUBLIC_DIR)/bin/x86_64 +DEPOT_PKG_DIR = $(DEPOT_DIR)/pkg +PUBLIC_PKG_DIR = $(PUBLIC_DIR)/pkg + +!strip_to_depot = |> ^ strip bin/%d^ strip -o %o %f |> $(DEPOT_BIN_DIR)/%d/@(DEPOT_VERSION)/%b $(DEPOT_DIR)/ + ERRATA_DIR = $(TUP_CWD)/errata -!validate_runtime = |> ^ Validate runtime^ xmllint -schema $(ERRATA_DIR)/runtime.xsd %f > %o |> +!archives_to_depot = |> ^ varse %d archives^ tup varsed %f %o |> $(DEPOT_PKG_DIR)/%d/@(DEPOT_VERSION)/archives +!runtime_to_depot = |> ^ validate %d runtime^ xmllint -schema $(ERRATA_DIR)/runtime.xsd %f > %o |> $(DEPOT_PKG_DIR)/%d/@(DEPOT_VERSION)/runtime $(DEPOT_DIR)/ ifdef DEPOT_KEY -!depot_bin_tarball = |> ^ archive %d binary^ tar cfJ %o -C $(DEPOT_BIN_DIR)/%d . |> $(PUBLIC_BIN_DIR)/%d/@(DEPOT_VERSION).tar.xz +!depot_bin_tarball = |> ^o archive %d binary^ tar cfJ %o -C $(DEPOT_BIN_DIR)/%d . |> $(PUBLIC_BIN_DIR)/%d/@(DEPOT_VERSION).tar.xz -!depot_pkg_tarball = |> ^ archive %d package^ tar cfJ %o -C $(DEPOT_DIR)/pkg/%d . |> $(PUBLIC_DIR)/pkg/%d/@(DEPOT_VERSION).tar.xz +!depot_pkg_tarball = |> ^o archive %d package^ tar cfJ %o -C $(DEPOT_DIR)/pkg/%d . |> $(PUBLIC_DIR)/pkg/%d/@(DEPOT_VERSION).tar.xz !public_signature = |> ^ sign %b^ gpg --detach-sign --digest-algo SHA256 --no-tty --local-user @(DEPOT_KEY) - < %f > %o |> %f.sig diff --git a/libretro/cores/core.tup b/libretro/cores/core.tup index a37d5917f..3449d8970 100644 --- a/libretro/cores/core.tup +++ b/libretro/cores/core.tup @@ -11,15 +11,16 @@ CFLAGS += -D__LIBRETRO__ !libretro_cc = |> ^ CC %f^ $(CC) `pkg-config --cflags $(CORE_PKGS)` $(CFLAGS) -c %f -o %o |> %f.o !libretro_cxx = |> ^ CXX %f^ $(CXX) `pkg-config --cflags $(CORE_PKGS)` $(CFLAGS) $(CXXFLAGS) $(INCFLAGS) -c %f -o %o |> %f.o -!libretro_core_link = |> ^ Link %d^ $(LD) -shared --version-script=$(TUP_CWD)/link.T %f -o %o `pkg-config --libs $(CORE_PKGS)` $(LDFLAGS) |> $(DEPOT_BIN_DIR)/%d/@(DEPOT_VERSION)/libretro.so +!libretro_core_link = |> ^o LD %d^ $(LD) -shared --version-script=$(TUP_CWD)/link.T %f -o %o `pkg-config --libs $(CORE_PKGS)` $(LDFLAGS) |> libretro.so : foreach $(SOURCES_C) |> !libretro_cc |> {libretro_objs} : foreach $(SOURCES_CXX) |> !libretro_cxx |> {libretro_objs} : {libretro_objs} |> !libretro_core_link |> {binary} +: {binary} |> !strip_to_depot |> {depot_bin} -: archives | {binary} |> ^ varse %d %b^ tup varsed %f %o |> $(DEPOT_DIR)/pkg/%d/@(DEPOT_VERSION)/%b {package} -: runtime |> !validate_runtime |> $(DEPOT_DIR)/pkg/%d/@(DEPOT_VERSION)/%b {package} +: archives | {depot_bin} |> !archives_to_depot |> {package} +: runtime |> !runtime_to_depot |> {package} ifdef DEPOT_KEY : {binary} |> !depot_bin_tarball |> {tarballs} diff --git a/nimble/binaries.tup b/nimble/binaries.tup index 7e500c014..6370ef41f 100644 --- a/nimble/binaries.tup +++ b/nimble/binaries.tup @@ -1,12 +1,10 @@ # Drop the relase flag with the line "NIM_RELEASE_FLAG=" NIM_RELEASE_FLAG = -d:release -!nim_build = |> nimble cpp $(NIM_RELEASE_FLAG) --os:genode -d:posix -o:%B %f |> %B %B.json - -!nim_to_depot = |> cp %f %o |> $(DEPOT_BIN_DIR)/%d/@(DEPOT_VERSION)/%b +!nim_build = |> ^o Nimble %B^ nimble cpp $(NIM_RELEASE_FLAG) --os:genode -d:posix -o:%B %f |> %B | %B.json : foreach src/*.nim |> !nim_build |> {output} -: foreach {output} |> !nim_to_depot |> {binary} +: foreach {output} |> !strip_to_depot |> {binary} ifdef DEPOT_KEY : {binary} |> !depot_bin_tarball |> {tarballs} diff --git a/nimble/package.tup b/nimble/package.tup index 4af2527c3..cfd4efb08 100644 --- a/nimble/package.tup +++ b/nimble/package.tup @@ -1,7 +1,7 @@ include_rules -: archives |> tup varsed %f %o |> $(DEPOT_DIR)/pkg/%d/@(DEPOT_VERSION)/%b {package} -: runtime |> !validate_runtime |> $(DEPOT_DIR)/pkg/%d/@(DEPOT_VERSION)/%b {package} +: archives |> !archives_to_depot |> {package} +: runtime |> !runtime_to_depot |> {package} ifdef DEPOT_KEY : {package} |> !depot_pkg_tarball |> {tarball} diff --git a/runtimes/icy-streams/icy-stream.tup b/runtimes/icy-streams/icy-stream.tup index 9f5b62087..aa80b195e 100644 --- a/runtimes/icy-streams/icy-stream.tup +++ b/runtimes/icy-streams/icy-stream.tup @@ -1,9 +1,9 @@ include_rules : ../runtime.in |> sed 's|@STREAM_URL@|$(STREAM_URL)|' %f > %o |> runtime -: runtime |> !validate_runtime |> $(DEPOT_DIR)/pkg/%d/@(DEPOT_VERSION)/runtime {package} +: runtime |> !runtime_to_depot |> {package} -: $(TUP_CWD)/archives |> tup varsed %f %o |> $(DEPOT_DIR)/pkg/%d/@(DEPOT_VERSION)/archives {package} +: $(TUP_CWD)/archives |> !archives_to_depot |> {package} ifdef DEPOT_KEY : {package} |> !depot_pkg_tarball |> {tarball}