Skip to content

Commit 5443107

Browse files
committed
fix: resolve issues with dist builds
1 parent b4f961a commit 5443107

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

Makefile.am

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/dash.ico \
6565
OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_INSTALLER_ICONS) \
6666
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
6767

68+
CARGO_FILES = \
69+
$(top_srcdir)/.cargo/config.toml.offline \
70+
$(top_srcdir)/Cargo.lock \
71+
$(top_srcdir)/Cargo.toml
72+
6873
COVERAGE_INFO = $(COV_TOOL_WRAPPER) baseline.info \
6974
test_dash_filtered.info total_coverage.info \
7075
baseline_filtered.info functional_test.info functional_test_filtered.info \
@@ -249,7 +254,7 @@ endif
249254

250255
dist_noinst_SCRIPTS = autogen.sh
251256

252-
EXTRA_DIST = $(DIST_SHARE) $(DIST_CONTRIB) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
257+
EXTRA_DIST = $(DIST_SHARE) $(DIST_CONTRIB) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS) $(CARGO_FILES)
253258

254259
EXTRA_DIST += \
255260
test/functional \

rust/Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ endif # ENABLE_ONLINE_RUST
6363

6464
include $(top_srcdir)/rust/Makefile.libs.include
6565

66+
EXTRA_DIST = \
67+
$(LIBRUST_CHIRP_FILES)
68+
6669
all-local: $(CARGO_CONFIGURED) cargo-build-chirp cxxbridge-chirp
6770

6871
cargo-build: $(CARGO_CONFIGURED) cargo-build-chirp

rust/Makefile.chirp.include

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ LIBRUST_CHIRP = $(LIBRUST_CHIRP_TARGET_DIR)/$(RUST_TARGET)/$(CARGO_PROFILE)/libc
99
LIBRUST_CHIRP_CARGO_ENV = $(CARGO_ENV) CARGO_TARGET_DIR="$(LIBRUST_CHIRP_TARGET_DIR)"
1010
LIBRUST_CHIRP_CRATE_DIR = $(top_srcdir)/rust/chirp
1111
LIBRUST_CHIRP_GEN_DIR = $(abs_top_builddir)/rust/chirp/gen
12+
LIBRUST_CHIRP_GEN_SRCDIR = $(top_srcdir)/rust/chirp/gen
1213
LIBRUST_CHIRP_MANIFEST = $(LIBRUST_CHIRP_CRATE_DIR)/Cargo.toml
1314
LIBRUST_CHIRP_CARGO_BUILD_OPTS = $(CARGO_BUILD_OPTS) --manifest-path $(LIBRUST_CHIRP_MANIFEST)
1415

@@ -27,11 +28,28 @@ LIBRUST_CHIRP_H = \
2728
LIBRUST_CHIRP_INCLUDES = \
2829
-I$(LIBRUST_CHIRP_GEN_DIR)/include
2930

31+
LIBRUST_CHIRP_FILES = \
32+
$(LIBRUST_CHIRP_BUILD) \
33+
$(LIBRUST_CHIRP_MANIFEST) \
34+
$(LIBRUST_CHIRP_SRCS)
35+
3036
$(LIBRUST_CHIRP_SRCS): ;
3137

32-
$(LIBRUST_CHIRP_H) $(LIBRUST_CHIRP_CPP): $(LIBRUST_CHIRP_SRCS)
38+
$(LIBRUST_CHIRP_CPP): $(LIBRUST_CHIRP_SRCS)
39+
$(AM_V_at)$(MKDIR_P) $(@D)
40+
$(AM_V_GEN)if test -f $(LIBRUST_CHIRP_GEN_SRCDIR)/src/lib.cpp; then \
41+
cp $(LIBRUST_CHIRP_GEN_SRCDIR)/src/lib.cpp $@; \
42+
else \
43+
$(CXXBRIDGE) $< -o $@; \
44+
fi
45+
46+
$(LIBRUST_CHIRP_H): $(LIBRUST_CHIRP_SRCS)
3347
$(AM_V_at)$(MKDIR_P) $(@D)
34-
$(AM_V_GEN)$(CXXBRIDGE) $< $(if $(filter %.h,$@),--header) -o $@
48+
$(AM_V_GEN)if test -f $(LIBRUST_CHIRP_GEN_SRCDIR)/include/rust/chirp/lib.h; then \
49+
cp $(LIBRUST_CHIRP_GEN_SRCDIR)/include/rust/chirp/lib.h $@; \
50+
else \
51+
$(CXXBRIDGE) $< --header -o $@; \
52+
fi
3553

3654
$(LIBRUST_CHIRP): $(LIBRUST_CHIRP_SRCS) $(LIBRUST_CHIRP_BUILD) $(LIBRUST_CHIRP_MANIFEST)
3755
$(AM_V_GEN)$(LIBRUST_CHIRP_CARGO_ENV) $(CARGO) build $(LIBRUST_CHIRP_CARGO_BUILD_OPTS)
@@ -46,4 +64,10 @@ cxxbridge-clean-chirp:
4664

4765
cxxbridge-chirp: $(LIBRUST_CHIRP_CPP) $(LIBRUST_CHIRP_H)
4866

67+
dist-hook: cxxbridge-chirp
68+
$(MKDIR_P) $(distdir)/chirp/gen/src
69+
$(MKDIR_P) $(distdir)/chirp/gen/include/rust/chirp
70+
cp $(LIBRUST_CHIRP_CPP) $(distdir)/chirp/gen/src/
71+
cp $(LIBRUST_CHIRP_H) $(distdir)/chirp/gen/include/rust/chirp/
72+
4973
.PHONY: cargo-build-chirp cargo-clean-chirp cxxbridge-chirp cxxbridge-clean-chirp

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ endif
11981198
libcxxbridge_la_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(PIC_FLAGS)
11991199
libcxxbridge_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) $(PIC_FLAGS) -static
12001200
libcxxbridge_la_LDFLAGS = $(AM_LDFLAGS) -static
1201-
libcxxbridge_la_SOURCES = $(LIBRUSTDEPS_CPP)
1201+
nodist_libcxxbridge_la_SOURCES = $(LIBRUSTDEPS_CPP)
12021202

12031203
$(libcxxbridge_la_OBJECTS): $(LIBRUSTDEPS_H)
12041204
#

0 commit comments

Comments
 (0)