Skip to content

Commit

Permalink
fix(Makefile): install build-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau committed Dec 12, 2024
1 parent b1c7ae5 commit 8793739
Showing 1 changed file with 32 additions and 10 deletions.
42 changes: 32 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,39 @@ publish-pypi: clean package-pip lint-twine ##- Publish Python packages to pypi

# Used for installing build dependencies in CI.
.PHONY: install-build-deps
install-build-deps: install-lint-build-deps
ifeq ($(shell which apt-get),)
$(warning Cannot install build dependencies without apt.)
else ifeq ($(wildcard /usr/include/libxml2/libxml/xpath.h),)
sudo $(APT) install libxml2-dev libxslt1-dev python3-venv
else ifeq ($(wildcard /usr/include/libxslt/xslt.h),)
sudo $(APT) install libxslt1-dev python3-venv
else ifeq ($(wildcard /usr/share/doc/python3-venv/copyright),)
sudo $(APT) install python3-venv
endif
install-build-deps: install-lint-build-deps install-macos-build-deps install-linux-build-deps

# If additional build dependencies need installing in order to build the linting env.
.PHONY: install-lint-build-deps
install-lint-build-deps:

.PHONY: install-linux-build-deps
install-linux-build-deps:
ifneq ($(OS),Linux)
else ifeq ($(shell which apt-get),)
$(warning apt-get not found. Please install dependencies yourself.)
else
sudo $(APT) install skopeo
# Needed for integration testing.
sudo $(APT) install libyaml-dev python3-dev python3-pip python3-setuptools python3-venv python3-wheel
# Needed for python-apt.
sudo $(APT) install python-apt-dev libapt-pkg-dev clang
endif
ifneq ($(shell which snap),)
sudo snap install lxd
endif
ifneq ($(shell which lxd),)
sudo lxd init --auto
endif

.PHONY: install-macos-build-deps
install-macos-build-deps:
ifneq ($(OS),Darwin)
else ifeq ($(shell which brew),)
$(warning brew not installed. Please install dependencies yourself.)
else
brew install [email protected] # For building pygit2
sudo cp -R /usr/local/opt/[email protected]/* /usr/local
brew install multipass
brew install skopeo
endif

0 comments on commit 8793739

Please sign in to comment.