From 8353b331840eed08c0b8ec65bee19837c33becc1 Mon Sep 17 00:00:00 2001 From: Mark Wu Date: Mon, 16 Nov 2020 01:41:11 +0800 Subject: [PATCH 1/9] Use pythin 3.9 --- Formula/macvim.rb | 4 ++-- Formula/vim.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Formula/macvim.rb b/Formula/macvim.rb index 25eba94..ae98d36 100644 --- a/Formula/macvim.rb +++ b/Formula/macvim.rb @@ -7,7 +7,7 @@ class Macvim < Formula depends_on :xcode => :build depends_on "cscope" depends_on "lua" - depends_on "python@3.8" + depends_on "python@3.9" depends_on "ruby" def install @@ -50,7 +50,7 @@ def install assert_match "+ruby", output # Simple test to check if MacVim was linked to Homebrew's Python 3 - py3_exec_prefix = Utils.popen_read(Formula["python@3.8"].opt_bin/"python3-config", "--exec-prefix") + py3_exec_prefix = Utils.popen_read(Formula["python@3.9"].opt_bin/"python3-config", "--exec-prefix") assert_match py3_exec_prefix.chomp, output (testpath/"commands.vim").write <<~EOS :python3 import vim; vim.current.buffer[0] = 'hello python3' diff --git a/Formula/vim.rb b/Formula/vim.rb index 8f4c246..a39a6b1 100644 --- a/Formula/vim.rb +++ b/Formula/vim.rb @@ -6,13 +6,13 @@ class Vim < Formula depends_on "gettext" depends_on "lua" depends_on "perl" - depends_on "python@3.8" + depends_on "python@3.9" depends_on "ruby" uses_from_macos "ncurses" def install - ENV.prepend_path "PATH", Formula["python@3.8"].opt_libexec/"bin" + ENV.prepend_path "PATH", Formula["python@3.9"].opt_libexec/"bin" # https://github.com/Homebrew/homebrew-core/pull/1046 ENV.delete("SDKROOT") From a1331653aa63440f20d501768846118219996721 Mon Sep 17 00:00:00 2001 From: Mark Wu Date: Tue, 17 Nov 2020 23:05:34 +0800 Subject: [PATCH 2/9] Add xcode project patch to make it compiled with xcode 12.2 --- Formula/macvim.rb | 56 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/Formula/macvim.rb b/Formula/macvim.rb index ae98d36..4bc7931 100644 --- a/Formula/macvim.rb +++ b/Formula/macvim.rb @@ -4,8 +4,12 @@ class Macvim < Formula homepage "https://github.com/macvim-dev/macvim" head "https://github.com/macvim-dev/macvim.git" - depends_on :xcode => :build + # patch xcode project + patch :DATA + + depends_on xcode: :build depends_on "cscope" + depends_on "gettext" depends_on "lua" depends_on "python@3.9" depends_on "ruby" @@ -48,9 +52,10 @@ def install test do output = shell_output("#{bin}/mvim --version") assert_match "+ruby", output + assert_match "+gettext", output # Simple test to check if MacVim was linked to Homebrew's Python 3 - py3_exec_prefix = Utils.popen_read(Formula["python@3.9"].opt_bin/"python3-config", "--exec-prefix") + py3_exec_prefix = shell_output(Formula["python@3.9"].opt_bin/"python3-config --exec-prefix") assert_match py3_exec_prefix.chomp, output (testpath/"commands.vim").write <<~EOS :python3 import vim; vim.current.buffer[0] = 'hello python3' @@ -60,3 +65,50 @@ def install assert_equal "hello python3", (testpath/"test.txt").read.chomp end end + +__END__ +diff --git a/src/MacVim/MacVim.xcodeproj/project.pbxproj b/src/MacVim/MacVim.xcodeproj/project.pbxproj +index 729c23009..9b66f5335 100644 +--- a/src/MacVim/MacVim.xcodeproj/project.pbxproj ++++ b/src/MacVim/MacVim.xcodeproj/project.pbxproj +@@ -3,7 +3,7 @@ + archiveVersion = 1; + classes = { + }; +- objectVersion = 47; ++ objectVersion = 54; + objects = { + + /* Begin PBXBuildFile section */ +@@ -1169,6 +1169,7 @@ + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; ++ EXCLUDED_ARCHS = arm64; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", +@@ -1202,6 +1203,7 @@ + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = YES; ++ EXCLUDED_ARCHS = arm64; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", +@@ -1233,6 +1235,7 @@ + buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + ENABLE_TESTABILITY = YES; ++ EXCLUDED_ARCHS = arm64; + GCC_VERSION = 4.2; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; +@@ -1246,6 +1249,7 @@ + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; ++ EXCLUDED_ARCHS = arm64; + GCC_VERSION = 4.2; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; From bef245a4af30eec75200fafcd59ab4c8407cb08b Mon Sep 17 00:00:00 2001 From: Mark Wu Date: Thu, 19 Nov 2020 21:05:54 +0800 Subject: [PATCH 3/9] Fix macOS Big Sur build problem --- Formula/macvim.rb | 78 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/Formula/macvim.rb b/Formula/macvim.rb index 4bc7931..c75c910 100644 --- a/Formula/macvim.rb +++ b/Formula/macvim.rb @@ -4,9 +4,6 @@ class Macvim < Formula homepage "https://github.com/macvim-dev/macvim" head "https://github.com/macvim-dev/macvim.git" - # patch xcode project - patch :DATA - depends_on xcode: :build depends_on "cscope" depends_on "gettext" @@ -14,6 +11,9 @@ class Macvim < Formula depends_on "python@3.9" depends_on "ruby" + # patch xcode project + patch :DATA + def install # Avoid issues finding Ruby headers ENV.delete("SDKROOT") @@ -112,3 +112,75 @@ def install GCC_VERSION = 4.2; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; +diff --git a/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj b/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj +index 21c3f7f56..6b7477acf 100644 +--- a/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj ++++ b/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj +@@ -456,13 +456,14 @@ + 0259C573FE90428111CA0C5A /* Project object */ = { + isa = PBXProject; + attributes = { +- LastUpgradeCheck = 0710; ++ LastUpgradeCheck = 1220; + }; + buildConfigurationList = C056398B08A954F8003078D8 /* Build configuration list for PBXProject "PSMTabBarControl" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( ++ English, + en, + ); + mainGroup = 0259C574FE90428111CA0C5A /* PSMTabBarControl */; +@@ -676,6 +677,7 @@ + isa = XCBuildConfiguration; + buildSettings = { + ENABLE_TESTABILITY = YES; ++ EXCLUDED_ARCHS = arm64; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; +@@ -687,6 +689,7 @@ + C056398D08A954F8003078D8 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { ++ EXCLUDED_ARCHS = arm64; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; +diff --git a/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj b/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj +index c7de7370d..030dbe89b 100644 +--- a/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj ++++ b/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj +@@ -134,13 +134,14 @@ + 089C1669FE841209C02AAC07 /* Project object */ = { + isa = PBXProject; + attributes = { +- LastUpgradeCheck = 0730; ++ LastUpgradeCheck = 1220; + }; + buildConfigurationList = 2CA326220896AD4900168862 /* Build configuration list for PBXProject "QuickLookStephen" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( ++ English, + en, + ); + mainGroup = 089C166AFE841209C02AAC07 /* QuickLookStephen */; +@@ -241,6 +242,7 @@ + isa = XCBuildConfiguration; + buildSettings = { + ENABLE_TESTABILITY = YES; ++ EXCLUDED_ARCHS = arm64; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_PREPROCESSOR_DEFINITIONS = "RKL_PREPEND_TO_METHODS=rkl_"; + GCC_WARN_ABOUT_RETURN_TYPE = YES; +@@ -259,6 +261,7 @@ + 2CA326240896AD4900168862 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { ++ EXCLUDED_ARCHS = arm64; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_PREPROCESSOR_DEFINITIONS = "RKL_PREPEND_TO_METHODS=rkl_"; + GCC_WARN_ABOUT_RETURN_TYPE = YES; From 33d2234ae5a615d6fe6125f80b9ddacb94776fc9 Mon Sep 17 00:00:00 2001 From: Mark Wu Date: Sat, 30 Jan 2021 23:17:23 +0800 Subject: [PATCH 4/9] macvim already fixed build script in Xcode 12 and Big Sur, I dont need patch for it --- Formula/macvim.rb | 125 +--------------------------------------------- 1 file changed, 2 insertions(+), 123 deletions(-) diff --git a/Formula/macvim.rb b/Formula/macvim.rb index c75c910..6a1a691 100644 --- a/Formula/macvim.rb +++ b/Formula/macvim.rb @@ -11,9 +11,6 @@ class Macvim < Formula depends_on "python@3.9" depends_on "ruby" - # patch xcode project - patch :DATA - def install # Avoid issues finding Ruby headers ENV.delete("SDKROOT") @@ -38,7 +35,8 @@ def install "--with-lua-prefix=#{Formula["lua"].opt_prefix}", "--enable-luainterp", "--enable-python3interp", - "--disable-sparkle" + "--disable-sparkle", + "--with-macarchs=#{Hardware::CPU.arch}" system "make" prefix.install "src/MacVim/build/Release/MacVim.app" @@ -65,122 +63,3 @@ def install assert_equal "hello python3", (testpath/"test.txt").read.chomp end end - -__END__ -diff --git a/src/MacVim/MacVim.xcodeproj/project.pbxproj b/src/MacVim/MacVim.xcodeproj/project.pbxproj -index 729c23009..9b66f5335 100644 ---- a/src/MacVim/MacVim.xcodeproj/project.pbxproj -+++ b/src/MacVim/MacVim.xcodeproj/project.pbxproj -@@ -3,7 +3,7 @@ - archiveVersion = 1; - classes = { - }; -- objectVersion = 47; -+ objectVersion = 54; - objects = { - - /* Begin PBXBuildFile section */ -@@ -1169,6 +1169,7 @@ - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = NO; -+ EXCLUDED_ARCHS = arm64; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", -@@ -1202,6 +1203,7 @@ - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = YES; -+ EXCLUDED_ARCHS = arm64; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", -@@ -1233,6 +1235,7 @@ - buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - ENABLE_TESTABILITY = YES; -+ EXCLUDED_ARCHS = arm64; - GCC_VERSION = 4.2; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; -@@ -1246,6 +1249,7 @@ - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; -+ EXCLUDED_ARCHS = arm64; - GCC_VERSION = 4.2; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; -diff --git a/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj b/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj -index 21c3f7f56..6b7477acf 100644 ---- a/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj -+++ b/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj -@@ -456,13 +456,14 @@ - 0259C573FE90428111CA0C5A /* Project object */ = { - isa = PBXProject; - attributes = { -- LastUpgradeCheck = 0710; -+ LastUpgradeCheck = 1220; - }; - buildConfigurationList = C056398B08A954F8003078D8 /* Build configuration list for PBXProject "PSMTabBarControl" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( -+ English, - en, - ); - mainGroup = 0259C574FE90428111CA0C5A /* PSMTabBarControl */; -@@ -676,6 +677,7 @@ - isa = XCBuildConfiguration; - buildSettings = { - ENABLE_TESTABILITY = YES; -+ EXCLUDED_ARCHS = arm64; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; -@@ -687,6 +689,7 @@ - C056398D08A954F8003078D8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { -+ EXCLUDED_ARCHS = arm64; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; -diff --git a/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj b/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj -index c7de7370d..030dbe89b 100644 ---- a/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj -+++ b/src/MacVim/qlstephen/QuickLookStephen.xcodeproj/project.pbxproj -@@ -134,13 +134,14 @@ - 089C1669FE841209C02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { -- LastUpgradeCheck = 0730; -+ LastUpgradeCheck = 1220; - }; - buildConfigurationList = 2CA326220896AD4900168862 /* Build configuration list for PBXProject "QuickLookStephen" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( -+ English, - en, - ); - mainGroup = 089C166AFE841209C02AAC07 /* QuickLookStephen */; -@@ -241,6 +242,7 @@ - isa = XCBuildConfiguration; - buildSettings = { - ENABLE_TESTABILITY = YES; -+ EXCLUDED_ARCHS = arm64; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = "RKL_PREPEND_TO_METHODS=rkl_"; - GCC_WARN_ABOUT_RETURN_TYPE = YES; -@@ -259,6 +261,7 @@ - 2CA326240896AD4900168862 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { -+ EXCLUDED_ARCHS = arm64; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_PREPROCESSOR_DEFINITIONS = "RKL_PREPEND_TO_METHODS=rkl_"; - GCC_WARN_ABOUT_RETURN_TYPE = YES; From a13b9772343e78a7530076684edb7ab55a0668dd Mon Sep 17 00:00:00 2001 From: Mark Wu Date: Sat, 30 Jan 2021 23:18:00 +0800 Subject: [PATCH 5/9] I need to get back all tags information to compile zeal with new build script --- Formula/zeal.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Formula/zeal.rb b/Formula/zeal.rb index 68078be..6babc4d 100644 --- a/Formula/zeal.rb +++ b/Formula/zeal.rb @@ -10,6 +10,8 @@ class Zeal < Formula depends_on "libarchive" def install + system "git fetch --tags" + system "git fetch --prune --unshallow" mkdir "build" do system "cmake", "..", *std_cmake_args system "make" From 0fc577ec4bf7072be298f52f41e459388398928f Mon Sep 17 00:00:00 2001 From: Mark Wu Date: Wed, 3 Mar 2021 17:11:40 +0800 Subject: [PATCH 6/9] I don't need glogg any more. --- Formula/glogg.rb | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 Formula/glogg.rb diff --git a/Formula/glogg.rb b/Formula/glogg.rb deleted file mode 100644 index a9d6e01..0000000 --- a/Formula/glogg.rb +++ /dev/null @@ -1,35 +0,0 @@ -require 'formula' - -class Glogg < Formula - desc 'glogg is a multi-platform GUI application to browse and search through long or complex log files.' - homepage "http://glogg.bonnefon.org/" - url 'http://glogg.bonnefon.org/files/glogg-1.1.4.tar.gz' - sha256 '0c1ddc72ebfc255bbb246446fb7be5b0fd1bb1594c70045c3e537cb6d274965b' - head "https://github.com/nickbnf/glogg.git" - version '1.1.4' - - depends_on "qt5" - depends_on "boost" - - patch :DATA - - def install - system "/usr/local/opt/qt5/bin/qmake" - system "/usr/bin/make" - prefix.install "release/glogg.app" - end -end -__END__ -diff --git a/glogg.pro b/glogg.pro -index 3b5eb5f..67e987b 100644 ---- a/glogg.pro -+++ b/glogg.pro -@@ -224,7 +224,7 @@ macx { - QMAKE_CXXFLAGS += -stdlib=libc++ - QMAKE_LFLAGS += -stdlib=libc++ - -- QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 -+ QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 - } - - # Official builds can be generated with `qmake VERSION="1.2.3"' From d91f5cde2168a52e34f021d2fabf03c20c644c64 Mon Sep 17 00:00:00 2001 From: Mark Wu Date: Wed, 3 Mar 2021 17:12:38 +0800 Subject: [PATCH 7/9] Change the qt formula name from qt to qt@5 --- Formula/zeal.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/zeal.rb b/Formula/zeal.rb index 6babc4d..c7f3e03 100644 --- a/Formula/zeal.rb +++ b/Formula/zeal.rb @@ -6,7 +6,7 @@ class Zeal < Formula head "https://github.com/zealdocs/zeal.git" depends_on "cmake" => :build - depends_on "qt" + depends_on "qt@5" depends_on "libarchive" def install From bec3d45f2d2afe8de0124c6f40f9aee2dfdf49d7 Mon Sep 17 00:00:00 2001 From: Mark Wu Date: Sat, 31 Jul 2021 12:09:59 +0800 Subject: [PATCH 8/9] Update vim & macvim according to homebrew core taps --- Formula/macvim.rb | 1 + Formula/vim.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Formula/macvim.rb b/Formula/macvim.rb index 6a1a691..7bda2dc 100644 --- a/Formula/macvim.rb +++ b/Formula/macvim.rb @@ -8,6 +8,7 @@ class Macvim < Formula depends_on "cscope" depends_on "gettext" depends_on "lua" + depends_on :macos depends_on "python@3.9" depends_on "ruby" diff --git a/Formula/vim.rb b/Formula/vim.rb index a39a6b1..6525d6a 100644 --- a/Formula/vim.rb +++ b/Formula/vim.rb @@ -5,11 +5,11 @@ class Vim < Formula depends_on "gettext" depends_on "lua" + depends_on "ncurses" depends_on "perl" depends_on "python@3.9" depends_on "ruby" - uses_from_macos "ncurses" def install ENV.prepend_path "PATH", Formula["python@3.9"].opt_libexec/"bin" From 791b1a38b14968376b35acd1b216ed706afa5f8c Mon Sep 17 00:00:00 2001 From: Mark Wu Date: Sat, 31 Jul 2021 12:11:05 +0800 Subject: [PATCH 9/9] Remove unshallow, it seems not working for some cases --- Formula/zeal.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Formula/zeal.rb b/Formula/zeal.rb index c7f3e03..c34e22b 100644 --- a/Formula/zeal.rb +++ b/Formula/zeal.rb @@ -10,8 +10,8 @@ class Zeal < Formula depends_on "libarchive" def install - system "git fetch --tags" - system "git fetch --prune --unshallow" + # system "git fetch --tags" + # system "git fetch --prune --unshallow" mkdir "build" do system "cmake", "..", *std_cmake_args system "make"