Skip to content

Commit

Permalink
macos: Move vfkit.entitlements download to crc-embedder
Browse files Browse the repository at this point in the history
This helper already downloads everything that is needed to generate CRC
releases, so it makes sense to have vfkit.entitlements there too.
This also makes it possible to take advantage of the support
crc-embedder has for disconnected environments.
This commit also picks the vfkit.entitlements file corresponding to the
vfkit release used by CRC instead of always using the latest one.
This unlikely to make a difference, but is cleaner.
  • Loading branch information
cfergeau authored and praveenkumar committed Jan 9, 2023
1 parent 5ad77e4 commit 768e16c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -307,21 +307,19 @@ ifeq ($(CUSTOM_EMBED),false)
$(HOST_BUILD_DIR)/crc-embedder download $(EMBED_DOWNLOAD_DIR)
endif

packaging/vfkit.entitlements:
curl -sL https://raw.githubusercontent.com/crc-org/vfkit/main/vf.entitlements -o $@

macos-universal-binary: macos-release-binary $(TOOLS_BINDIR)/makefat
mkdir -p out/macos-universal
cd $(BUILD_DIR) && "$(TOOLS_BINDIR)"/makefat macos-universal/crc macos-amd64/crc macos-arm64/crc

packagedir: clean embed-download macos-universal-binary packaging/vfkit.entitlements
packagedir: clean embed-download macos-universal-binary
echo -n $(CRC_VERSION) > packaging/VERSION
sed -e 's/__VERSION__/'$(CRC_VERSION)'/g' -e 's@__INSTALL_PATH__@$(MACOS_INSTALL_PATH)@g' packaging/darwin/Distribution.in >packaging/darwin/Distribution
sed -e 's/__VERSION__/'$(CRC_VERSION)'/g' -e 's@__INSTALL_PATH__@$(MACOS_INSTALL_PATH)@g' packaging/darwin/welcome.html.in >packaging/darwin/Resources/welcome.html
sed -e 's/__VERSION__/'$(CRC_VERSION)'/g' -e 's@__INSTALL_PATH__@$(MACOS_INSTALL_PATH)@g' packaging/darwin/postinstall.in >packaging/darwin/scripts/postinstall
chmod 755 packaging/darwin/scripts/postinstall
mkdir -p packaging/tmp/
cp $(EMBED_DOWNLOAD_DIR)/* packaging/tmp/
cp $(EMBED_DOWNLOAD_DIR)/vf.entitlements packaging/vfkit.entitlements
mkdir -p packaging/root/Applications
tar -C packaging/root/Applications -xvzf $(TRAY_RELEASE)
rm $(TRAY_RELEASE)
Expand Down
1 change: 1 addition & 0 deletions cmd/crc-embedder/cmd/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ var (
dataFileUrls = map[string][]remoteFileInfo{
"darwin": {
{vfkit.VfkitDownloadURL, 0755},
{vfkit.VfkitEntitlementsURL, 0644},
{constants.GetCRCMacTrayDownloadURL(), 0644},
{constants.GetAdminHelperURLForOs("darwin"), 0755},
},
Expand Down
3 changes: 2 additions & 1 deletion pkg/crc/machine/vfkit/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ const (
)

var (
VfkitDownloadURL = fmt.Sprintf("https://github.com/crc-org/vfkit/releases/download/v%s/%s", VfkitVersion, VfkitCommand)
VfkitDownloadURL = fmt.Sprintf("https://github.com/crc-org/vfkit/releases/download/v%s/%s", VfkitVersion, VfkitCommand)
VfkitEntitlementsURL = fmt.Sprintf("https://raw.githubusercontent.com/crc-org/vfkit/v%s/vf.entitlements", VfkitVersion)
)

0 comments on commit 768e16c

Please sign in to comment.