From 1ad16cf16461e66f1c6f24c2402c8ebacb421c0c Mon Sep 17 00:00:00 2001 From: Prakhar Gurunani Date: Sat, 24 Feb 2024 23:02:34 +0530 Subject: [PATCH 01/10] brew pkg setup --- .github/workflows/test.yml | 7 +++++++ build.sh | 3 +++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84e3292..bb9323d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,6 +41,13 @@ jobs: - name: Build run: ./build.sh + - name: Save Distributable + uses: actions/upload-artifact@v2 + with: + name: metacall + path: metacall.pkg + retention-days: 1 + # Test Homebrew recipe - name: Test run: ./test.sh diff --git a/build.sh b/build.sh index 795fea6..3c85cb5 100755 --- a/build.sh +++ b/build.sh @@ -10,3 +10,6 @@ fi # Build metacall brew recipe export HOMEBREW_NO_AUTO_UPDATE=1 brew install ./metacall.rb --build-from-source --overwrite -v + +# Build distributable binary using brew pkg +brew pkg metacall \ No newline at end of file From 98c388203bb964441763e4cc23279999cda65547 Mon Sep 17 00:00:00 2001 From: Prakhar Gurunani Date: Sun, 25 Feb 2024 18:34:42 +0530 Subject: [PATCH 02/10] add regex path --- .github/workflows/test.yml | 3 ++- build.sh | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb9323d..bf9a565 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,11 +41,12 @@ jobs: - name: Build run: ./build.sh + # Save distributable as Artifact - name: Save Distributable uses: actions/upload-artifact@v2 with: name: metacall - path: metacall.pkg + path: metacall-(.*).pkg retention-days: 1 # Test Homebrew recipe diff --git a/build.sh b/build.sh index 3c85cb5..264f6eb 100755 --- a/build.sh +++ b/build.sh @@ -12,4 +12,6 @@ export HOMEBREW_NO_AUTO_UPDATE=1 brew install ./metacall.rb --build-from-source --overwrite -v # Build distributable binary using brew pkg -brew pkg metacall \ No newline at end of file +brew tap timsutton/formulae +brew install brew-pkg +brew pkg --with-deps --without-kegs metacall \ No newline at end of file From b90ee2a2aca295262b3a9a03d9c66d6ba0e18ddb Mon Sep 17 00:00:00 2001 From: Prakhar Gurunani Date: Sun, 25 Feb 2024 18:53:40 +0530 Subject: [PATCH 03/10] wip: symlink error --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 264f6eb..976c9b9 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,7 @@ fi # Build metacall brew recipe export HOMEBREW_NO_AUTO_UPDATE=1 -brew install ./metacall.rb --build-from-source --overwrite -v +brew install --build-from-source --overwrite -v metacall.rb # Build distributable binary using brew pkg brew tap timsutton/formulae From 9a7ecf73a68ea81f5eb68d487e1bd359340e71b6 Mon Sep 17 00:00:00 2001 From: Prakhar Gurunani Date: Mon, 26 Feb 2024 02:05:46 +0530 Subject: [PATCH 04/10] wip: symlink error --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 976c9b9..4c500ba 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,7 @@ fi # Build metacall brew recipe export HOMEBREW_NO_AUTO_UPDATE=1 -brew install --build-from-source --overwrite -v metacall.rb +brew install --build-from-source --overwrite --force -v metacall.rb # Build distributable binary using brew pkg brew tap timsutton/formulae From d4deaa3fc73c6e04dfba5912b83e30714b23ee6c Mon Sep 17 00:00:00 2001 From: Prakhar Gurunani Date: Mon, 26 Feb 2024 22:08:04 +0530 Subject: [PATCH 05/10] wip: symlink error --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 4c500ba..572c6f2 100755 --- a/build.sh +++ b/build.sh @@ -8,8 +8,9 @@ if [[ $(command -v brew) == "" ]]; then fi # Build metacall brew recipe +rm /usr/local/bin/2to3 || true export HOMEBREW_NO_AUTO_UPDATE=1 -brew install --build-from-source --overwrite --force -v metacall.rb +brew install --build-from-source --overwrite -v metacall.rb # Build distributable binary using brew pkg brew tap timsutton/formulae From d7c02d5d489158d6b3f4319b25a016dcd374cf8b Mon Sep 17 00:00:00 2001 From: Prakhar Gurunani Date: Wed, 28 Feb 2024 11:41:02 +0530 Subject: [PATCH 06/10] complete symlink fix --- .github/workflows/test.yml | 21 ++++++++++++++++++--- build.sh | 3 +-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf9a565..8409955 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,14 +24,29 @@ jobs: brew uninstall --force --ignore-dependencies node brew cleanup -s node brew cleanup --prune-prefix - brew uninstall --force --ignore-dependencies python@3.12 - brew cleanup -s python@3.12 - brew cleanup --prune-prefix brew uninstall --force --ignore-dependencies python@3.11 brew cleanup -s python@3.11 brew cleanup --prune-prefix + brew uninstall --force --ignore-dependencies python@3.12 + brew cleanup -s python@3.12 + brew cleanup --prune-prefix sudo rm -rf /System/Library/Frameworks/Python.framework/ brew cleanup --prune-prefix + sudo rm -rf /usr/local/bin/2to3 + sudo rm -rf /usr/local/bin/2to3-3.11 + sudo rm -rf /usr/local/bin/2to3-3.12 + sudo rm -rf /usr/local/bin/idle3 + sudo rm -rf /usr/local/bin/idle3.11 + sudo rm -rf /usr/local/bin/idle3.12 + sudo rm -rf /usr/local/bin/pydoc3 + sudo rm -rf /usr/local/bin/pydoc3.11 + sudo rm -rf /usr/local/bin/pydoc3.12 + sudo rm -rf /usr/local/bin/python3 + sudo rm -rf /usr/local/bin/python3-config + sudo rm -rf /usr/local/bin/python3.11 + sudo rm -rf /usr/local/bin/python3.12 + sudo rm -rf /usr/local/bin/python3.11-config + sudo rm -rf /usr/local/bin/python3.12-config brew uninstall --force --ignore-dependencies ruby brew cleanup -s ruby brew cleanup --prune-prefix diff --git a/build.sh b/build.sh index 572c6f2..264f6eb 100755 --- a/build.sh +++ b/build.sh @@ -8,9 +8,8 @@ if [[ $(command -v brew) == "" ]]; then fi # Build metacall brew recipe -rm /usr/local/bin/2to3 || true export HOMEBREW_NO_AUTO_UPDATE=1 -brew install --build-from-source --overwrite -v metacall.rb +brew install ./metacall.rb --build-from-source --overwrite -v # Build distributable binary using brew pkg brew tap timsutton/formulae From dfaaea3308ae58631ee2fde7834509a854ab3283 Mon Sep 17 00:00:00 2001 From: Prakhar Gurunani Date: Sat, 2 Mar 2024 20:25:18 +0530 Subject: [PATCH 07/10] fix artifact upload --- .github/workflows/test.yml | 3 ++- build.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8409955..3cdc1c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,8 +61,9 @@ jobs: uses: actions/upload-artifact@v2 with: name: metacall - path: metacall-(.*).pkg + path: pkg/*.pkg retention-days: 1 + if-no-files-found: error # Test Homebrew recipe - name: Test diff --git a/build.sh b/build.sh index 264f6eb..5a0e31e 100755 --- a/build.sh +++ b/build.sh @@ -12,6 +12,7 @@ export HOMEBREW_NO_AUTO_UPDATE=1 brew install ./metacall.rb --build-from-source --overwrite -v # Build distributable binary using brew pkg +mkdir pkg && cd pkg brew tap timsutton/formulae brew install brew-pkg brew pkg --with-deps --without-kegs metacall \ No newline at end of file From 374f25418134bc1dae23cdf00f8b44a6e3c7ec15 Mon Sep 17 00:00:00 2001 From: Prakhar Gurunani Date: Sat, 2 Mar 2024 20:48:06 +0530 Subject: [PATCH 08/10] wip: fix brew prefix --- metacall.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/metacall.rb b/metacall.rb index 09a24d2..5f75516 100644 --- a/metacall.rb +++ b/metacall.rb @@ -12,6 +12,10 @@ class Metacall < Formula depends_on "ruby@2.7" depends_on "openjdk" + def brew_prefix + `brew --cellar` + end + def python deps.map(&:to_formula) .find { |f| f.name.match?(/^python@\d\.\d+$/) } @@ -44,7 +48,7 @@ def install -DOPTION_BUILD_EXAMPLES=OFF -DOPTION_BUILD_LOADERS_PY=ON -DOPTION_BUILD_LOADERS_NODE=ON - -DNodeJS_INSTALL_PREFIX=/usr/local/Cellar/metacall/#{version} + -DNodeJS_INSTALL_PREFIX=#{brew_prefix}/metacall/#{version} -DOPTION_BUILD_LOADERS_JAVA=ON -DOPTION_BUILD_LOADERS_JS=OFF -DOPTION_BUILD_LOADERS_C=OFF @@ -70,7 +74,7 @@ def install # debug = "set -euxo pipefail\n" metacall_extra = [ - "PREFIX=/usr/local/Cellar/metacall/#{version}\n", + "PREFIX=#{brew_prefix}/metacall/#{version}\n", "export LOADER_LIBRARY=\"${PREFIX}/lib\"\n", "export SERIAL_LIBRARY_PATH=\"${PREFIX}/lib\"\n", "export DETOUR_LIBRARY_PATH=\"${PREFIX}/lib\"\n", From e5b9f75e77872a3b32d1787f87db22af3b0be9dc Mon Sep 17 00:00:00 2001 From: Prakhar Gurunani Date: Sat, 2 Mar 2024 20:58:24 +0530 Subject: [PATCH 09/10] wip: fix brew prefix --- metacall.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/metacall.rb b/metacall.rb index 5f75516..d99c9cb 100644 --- a/metacall.rb +++ b/metacall.rb @@ -12,10 +12,6 @@ class Metacall < Formula depends_on "ruby@2.7" depends_on "openjdk" - def brew_prefix - `brew --cellar` - end - def python deps.map(&:to_formula) .find { |f| f.name.match?(/^python@\d\.\d+$/) } @@ -48,7 +44,7 @@ def install -DOPTION_BUILD_EXAMPLES=OFF -DOPTION_BUILD_LOADERS_PY=ON -DOPTION_BUILD_LOADERS_NODE=ON - -DNodeJS_INSTALL_PREFIX=#{brew_prefix}/metacall/#{version} + -DNodeJS_INSTALL_PREFIX=#{prefix}/metacall/#{version} -DOPTION_BUILD_LOADERS_JAVA=ON -DOPTION_BUILD_LOADERS_JS=OFF -DOPTION_BUILD_LOADERS_C=OFF @@ -74,7 +70,7 @@ def install # debug = "set -euxo pipefail\n" metacall_extra = [ - "PREFIX=#{brew_prefix}/metacall/#{version}\n", + "PREFIX=#{prefix}/metacall/#{version}\n", "export LOADER_LIBRARY=\"${PREFIX}/lib\"\n", "export SERIAL_LIBRARY_PATH=\"${PREFIX}/lib\"\n", "export DETOUR_LIBRARY_PATH=\"${PREFIX}/lib\"\n", From e9ea6dff8d2d76ce0d19748ae304d43572d6fbcc Mon Sep 17 00:00:00 2001 From: Prakhar Gurunani Date: Sat, 2 Mar 2024 21:42:34 +0530 Subject: [PATCH 10/10] wip: fix brew prefix --- metacall.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metacall.rb b/metacall.rb index d99c9cb..fa97046 100644 --- a/metacall.rb +++ b/metacall.rb @@ -44,7 +44,7 @@ def install -DOPTION_BUILD_EXAMPLES=OFF -DOPTION_BUILD_LOADERS_PY=ON -DOPTION_BUILD_LOADERS_NODE=ON - -DNodeJS_INSTALL_PREFIX=#{prefix}/metacall/#{version} + -DNodeJS_INSTALL_PREFIX=#{prefix} -DOPTION_BUILD_LOADERS_JAVA=ON -DOPTION_BUILD_LOADERS_JS=OFF -DOPTION_BUILD_LOADERS_C=OFF @@ -70,7 +70,7 @@ def install # debug = "set -euxo pipefail\n" metacall_extra = [ - "PREFIX=#{prefix}/metacall/#{version}\n", + "PREFIX=#{prefix}\n", "export LOADER_LIBRARY=\"${PREFIX}/lib\"\n", "export SERIAL_LIBRARY_PATH=\"${PREFIX}/lib\"\n", "export DETOUR_LIBRARY_PATH=\"${PREFIX}/lib\"\n",