<commit_before>OSX_ARCH=x64
BUILD_DIR=build
OSX_BUNDLE_BASE=$(BUILD_DIR)/Lektor-darwin-$(OSX_ARCH)
OSX_BUNDLE=$(OSX_BUNDLE_BASE)/Lektor.app
OSX_BUNDLE_RES=$(OSX_BUNDLE)/Contents/Resources

REBUILD_CMD=./node_modules/.bin/electron-rebuild -w runas

npm-install:
	npm install
	$(REBUILD_CMD)

run-only:
	./bin/run

run: npm-install run-only

$(BUILD_DIR)/Python.framework:
	./bin/compile-python-framework

build-wheels: $(BUILD_DIR)/Python.framework
	./bin/build-wheels

vendor/ImageMagick-x86_64-apple-darwin15.0.0.tar.gz:
	cd vendor; wget http://www.imagemagick.org/download/binaries/ImageMagick-x86_64-apple-darwin15.0.0.tar.gz
	cd vendor; tar xzf ImageMagick-x86_64-apple-darwin15.0.0.tar.gz

osx-bundle: vendor/ImageMagick-x86_64-apple-darwin15.0.0.tar.gz build-wheels
	npm install --production
	$(REBUILD_CMD)
	cd static; ../node_modules/.bin/webpack
	mkdir -p $(OSX_BUNDLE_BASE) && rm -rf $(OSX_BUNDLE)
	cp -RH node_modules/electron-prebuilt/dist/Electron.app $(OSX_BUNDLE)
	mv $(OSX_BUNDLE)/Contents/Frameworks/{Electron,Lektor}\ Helper\ EH.app
	mv $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper\ EH.app/Contents/MacOS/{Electron,Lektor}\ Helper\ EH
	sed -i '' s/Electron/Lektor/ $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper\ EH.app/Contents/Info.plist
	mv $(OSX_BUNDLE)/Contents/Frameworks/{Electron,Lektor}\ Helper\ NP.app
	mv $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper\ NP.app/Contents/MacOS/{Electron,Lektor}\ Helper\ NP
	sed -i '' s/Electron/Lektor/ $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper\ NP.app/Contents/Info.plist
	mv $(OSX_BUNDLE)/Contents/Frameworks/{Electron,Lektor}\ Helper.app
	mv $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper.app/Contents/MacOS/{Electron,Lektor}\ Helper
	sed -i '' s/Electron/Lektor/ $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper.app/Contents/Info.plist
	mkdir -p $(OSX_BUNDLE_RES)/node_modules
	mkdir -p $(OSX_BUNDLE_RES)/app/static
	cp -R package.json $(OSX_BUNDLE_RES)/app
	cp -R static/{images,gen,index.html} $(OSX_BUNDLE_RES)/app/static
	cp -R node_modules/runas $(OSX_BUNDLE_RES)/node_modules
	cp resources/Lektor-Info.plist $(OSX_BUNDLE)/Contents/Info.plist
	cp resources/Icon.icns $(OSX_BUNDLE_RES)
	mkdir $(OSX_BUNDLE_RES)/local
	cp -R vendor/ImageMagick-6.9.2/* $(OSX_BUNDLE_RES)/local
	cp resources/lektor-mac-proxy $(OSX_BUNDLE)/Contents/MacOS/lektor-proxy<commit_msg>Invoke npm for admin as well on gui build<commit_after>OSX_ARCH=x64
BUILD_DIR=build
OSX_BUNDLE_BASE=$(BUILD_DIR)/Lektor-darwin-$(OSX_ARCH)
OSX_BUNDLE=$(OSX_BUNDLE_BASE)/Lektor.app
OSX_BUNDLE_RES=$(OSX_BUNDLE)/Contents/Resources

REBUILD_CMD=./node_modules/.bin/electron-rebuild -w runas

npm-install:
	cd ../lektor/admin/; npm install
	npm install
	$(REBUILD_CMD)

run-only:
	./bin/run

run: npm-install run-only

$(BUILD_DIR)/Python.framework:
	./bin/compile-python-framework

build-wheels: $(BUILD_DIR)/Python.framework
	./bin/build-wheels

vendor/ImageMagick-x86_64-apple-darwin15.0.0.tar.gz:
	cd vendor; wget http://www.imagemagick.org/download/binaries/ImageMagick-x86_64-apple-darwin15.0.0.tar.gz
	cd vendor; tar xzf ImageMagick-x86_64-apple-darwin15.0.0.tar.gz

osx-bundle: vendor/ImageMagick-x86_64-apple-darwin15.0.0.tar.gz build-wheels
	cd ../lektor/admin; npm install
	npm install --production
	$(REBUILD_CMD)
	cd static; ../node_modules/.bin/webpack
	mkdir -p $(OSX_BUNDLE_BASE) && rm -rf $(OSX_BUNDLE)
	cp -RH node_modules/electron-prebuilt/dist/Electron.app $(OSX_BUNDLE)
	mv $(OSX_BUNDLE)/Contents/Frameworks/{Electron,Lektor}\ Helper\ EH.app
	mv $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper\ EH.app/Contents/MacOS/{Electron,Lektor}\ Helper\ EH
	sed -i '' s/Electron/Lektor/ $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper\ EH.app/Contents/Info.plist
	mv $(OSX_BUNDLE)/Contents/Frameworks/{Electron,Lektor}\ Helper\ NP.app
	mv $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper\ NP.app/Contents/MacOS/{Electron,Lektor}\ Helper\ NP
	sed -i '' s/Electron/Lektor/ $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper\ NP.app/Contents/Info.plist
	mv $(OSX_BUNDLE)/Contents/Frameworks/{Electron,Lektor}\ Helper.app
	mv $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper.app/Contents/MacOS/{Electron,Lektor}\ Helper
	sed -i '' s/Electron/Lektor/ $(OSX_BUNDLE)/Contents/Frameworks/Lektor\ Helper.app/Contents/Info.plist
	mkdir -p $(OSX_BUNDLE_RES)/node_modules
	mkdir -p $(OSX_BUNDLE_RES)/app/static
	cp -R package.json $(OSX_BUNDLE_RES)/app
	cp -R static/{images,gen,index.html} $(OSX_BUNDLE_RES)/app/static
	cp -R node_modules/runas $(OSX_BUNDLE_RES)/node_modules
	cp resources/Lektor-Info.plist $(OSX_BUNDLE)/Contents/Info.plist
	cp resources/Icon.icns $(OSX_BUNDLE_RES)
	mkdir $(OSX_BUNDLE_RES)/local
	cp -R vendor/ImageMagick-6.9.2/* $(OSX_BUNDLE_RES)/local
	cp resources/lektor-mac-proxy $(OSX_BUNDLE)/Contents/MacOS/lektor-proxy
{'fraction_non_alphanumeric': 0.15109717868338557, 'fraction_numerical': 0.015464994775339603, 'mean_word_length': 4.9825, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2426551', 'n_tokens_mistral': 2094, 'n_tokens_neox': 2056, 'n_words': 273}