Skip to content

Commit cdab1b2

Browse files
bors[bot]jcaesar
andauthored
Merge #2428
2428: Don't fail make install if WASMER_INSTALL_PREFIX isn't set r=Hywan a=jcaesar <!-- Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test: https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests --> # Description Fixes #2413, also improves PACKAGING.md Alternatively, I could make it so `make install` errors out with a nice and clean error message if that variable is not set (and tells people that they're not supposed to make install themselves?), or default WASMER_INSTALL_PREFIX to `/usr/local` (at the danger of being missed, resulting in incorrect installs). # Review - [ ] Add a short description of the change to the CHANGELOG.md file: Seems like an irrelevant fix - Necessary? Co-authored-by: Julius Michaelis <[email protected]>
2 parents 24f8fdb + d405de1 commit cdab1b2

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,13 @@ install-misc:
657657
install -Dm644 LICENSE "$(DESTDIR)"/share/licenses/wasmer/LICENSE
658658

659659
install-pkgconfig:
660-
unset WASMER_DIR # Make sure WASMER_INSTALL_PREFIX is set during build
661-
target/release/wasmer config --pkg-config | install -Dm644 /dev/stdin "$(DESTDIR)"/lib/pkgconfig/wasmer.pc
660+
# Make sure WASMER_INSTALL_PREFIX is set during build
661+
unset WASMER_DIR; \
662+
if pc="$$(target/release/wasmer config --pkg-config 1>/dev/null 2>/dev/null)"; then \
663+
echo "$$pc" | install -Dm644 /dev/stdin "$(DESTDIR)"/lib/pkgconfig/wasmer.pc; \
664+
else \
665+
echo 1>&2 "WASMER_INSTALL_PREFIX was not set during build, not installing wasmer.pc"; \
666+
fi
662667

663668
install-wasmer-headless-minimal:
664669
install -Dm755 target/release/wasmer-headless $(DESTDIR)/bin/wasmer-headless

PACKAGING.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
with `WASMER_INSTALL_PREFIX`, e.g.:
1717

1818
```sh
19-
$ WASMER_INSTALL_PREFIX=/usr make install
19+
export WASMER_INSTALL_PREFIX=/usr
20+
make
21+
DESTDIR=.../usr make install
2022
```
2123

2224
* In case you must build/install directly with `cargo`, make sure to

0 commit comments

Comments
 (0)