From bba633a09a53cd45cf1ebd25d6bafaddf1a23f39 Mon Sep 17 00:00:00 2001 From: johnlockard <48885497+johnlockard@users.noreply.github.com> Date: Tue, 2 Apr 2019 17:29:55 -0400 Subject: [PATCH 1/6] Update minetest.rb to version 5.0.1 Updated source and resource to current version. Removed unnecessary X11 dependency. Added simple Test Block. To do: Figure out how to update the Bottle Block. To do: Figure out how to run unit tests in the Test Block. --- Formula/minetest.rb | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Formula/minetest.rb b/Formula/minetest.rb index 90811b091052c..6e11d1cb06041 100644 --- a/Formula/minetest.rb +++ b/Formula/minetest.rb @@ -3,12 +3,12 @@ class Minetest < Formula homepage "https://www.minetest.net/" stable do - url "https://github.com/minetest/minetest/archive/0.4.17.1.tar.gz" - sha256 "cd25d40c53f492325edabd2f6397250f40a61cb9fe4a1d4dd6eb030e0d1ceb59" + url "https://github.com/minetest/minetest/archive/5.0.1.tar.gz" + sha256 "aa771cf178ad1b436d5723e5d6dd24e42b5d56f1cfe9c930f6426b7f24bb1635" resource "minetest_game" do - url "https://github.com/minetest/minetest_game/archive/0.4.17.tar.gz" - sha256 "f0ab07cb47c1540b2016bf76a36e2eec28b0ea7827bf66fc5447e0c5e5d4495d" + url "https://github.com/minetest/minetest_game/archive/5.0.1.tar.gz" + sha256 "965d2cf3ac8c822bc9e60fb8f508182fb2f24dde46f46b000caf225ebe2ec519" end end @@ -35,7 +35,6 @@ class Minetest < Formula depends_on "libogg" depends_on "libvorbis" depends_on "luajit" - depends_on :x11 def install (buildpath/"games/minetest_game").install resource("minetest_game") @@ -65,4 +64,14 @@ def caveats "/Applications/minetest.app/Contents/MacOS/minetest --server". EOS end + + test do + # + # Commands --help, --version will produce a readable output without creating a file. + # + # Commands --info, --run-unittests, --speedtests, --trace, and + # --videomodes require creating user data directory for output. + # + system "#{prefix}/minetest.app/Contents/MacOS/minetest", "--version" + end end From fa3a9fd8990b8d693f7db223c15d81570022bc0c Mon Sep 17 00:00:00 2001 From: johnlockard <48885497+johnlockard@users.noreply.github.com> Date: Wed, 3 Apr 2019 10:29:19 -0400 Subject: [PATCH 2/6] Update minetest.rb to version 5.0.1 Patched whitespace problem. Apparently the github web based editor likes to put in spaces when hitting return. --- Formula/minetest.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/minetest.rb b/Formula/minetest.rb index 6e11d1cb06041..f5c433486778a 100644 --- a/Formula/minetest.rb +++ b/Formula/minetest.rb @@ -64,7 +64,7 @@ def caveats "/Applications/minetest.app/Contents/MacOS/minetest --server". EOS end - + test do # # Commands --help, --version will produce a readable output without creating a file. From 51962b16cb90834ffdb3cc007049015d2769588e Mon Sep 17 00:00:00 2001 From: johnlockard <48885497+johnlockard@users.noreply.github.com> Date: Sat, 6 Apr 2019 18:09:20 -0400 Subject: [PATCH 3/6] Update to Minetest version 5.0.1 Enable the Application Support for minetest which enables four more test modes in the program including live testing of the game. --- Formula/minetest.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Formula/minetest.rb b/Formula/minetest.rb index f5c433486778a..4ac33d1a03100 100644 --- a/Formula/minetest.rb +++ b/Formula/minetest.rb @@ -67,11 +67,11 @@ def caveats test do # - # Commands --help, --version will produce a readable output without creating a file. + # --help and --version produce output directly. + # --speedtests and --videomodes need user data directory in order to work. + # --info and --trace need user data directory and will actually run the game. # - # Commands --info, --run-unittests, --speedtests, --trace, and - # --videomodes require creating user data directory for output. - # - system "#{prefix}/minetest.app/Contents/MacOS/minetest", "--version" + (testpath/"Library/Application Support/minetest/debug.txt").write("") + system "#{prefix}/minetest.app/Contents/MacOS/minetest", "--speedtests" end end From 2cc95af70ae94c28dbe5e87bf5a5e9570a2fcb76 Mon Sep 17 00:00:00 2001 From: johnlockard <48885497+johnlockard@users.noreply.github.com> Date: Sun, 7 Apr 2019 15:55:48 -0400 Subject: [PATCH 4/6] Update minetest.rb to version 5.0.1 Having to force creation of files the program generates while doing the test. Works on this end, but it may not work elsewhere. I'm thinking of going back to --help and --version. --- Formula/minetest.rb | 66 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/Formula/minetest.rb b/Formula/minetest.rb index 4ac33d1a03100..34a99356dd8fa 100644 --- a/Formula/minetest.rb +++ b/Formula/minetest.rb @@ -68,10 +68,74 @@ def caveats test do # # --help and --version produce output directly. - # --speedtests and --videomodes need user data directory in order to work. + # --videomodes need user data directory in order to work. # --info and --trace need user data directory and will actually run the game. + # --run-unittests incomplete, further creation of support files needed. + # --speedtests forced creation of support files created by program automatically. + # + # Debug file, all test information should wind up in here. # (testpath/"Library/Application Support/minetest/debug.txt").write("") + # + # Meta map file, needed for map generation. + # + (testpath/"Library/Application Support/minetest/worlds/world/map_meta.txt").write("mg_biome_np_humidity_blend = { + octaves = 2 + lacunarity = 2 + persistence = 1 + spread = (8,8,8) + scale = 1.5 + seed = 90003 + flags = defaults + offset = 0 +} +mg_biome_np_heat_blend = { + octaves = 2 + lacunarity = 2 + persistence = 1 + spread = (8,8,8) + scale = 1.5 + seed = 13 + flags = defaults + offset = 0 +} +mg_biome_np_humidity = { + octaves = 3 + lacunarity = 2 + persistence = 0.5 + spread = (1000,1000,1000) + scale = 50 + seed = 842 + flags = defaults + offset = 50 +} +mg_biome_np_heat = { + octaves = 3 + lacunarity = 2 + persistence = 0.5 + spread = (1000,1000,1000) + scale = 50 + seed = 5349 + flags = defaults + offset = 50 +} +mg_flags = caves, dungeons, light, decorations, biomes +mapgen_limit = 31000 +seed = 15 +chunksize = 5 +water_level = 1 +mg_name = v7 +[end_of_params]") + # + # World configuration file. + # + (testpath/"Library/Application Support/minetest/worlds/world/world.mt").write("enable_damage = true +auth_backend = sqlite3 +player_backend = sqlite3 +backend = sqlite3 +creative_mode = false +gameid = minetest +") system "#{prefix}/minetest.app/Contents/MacOS/minetest", "--speedtests" end end From b33f3d517af7208df0fd8b6015f04d325a0d2be4 Mon Sep 17 00:00:00 2001 From: johnlockard <48885497+johnlockard@users.noreply.github.com> Date: Mon, 8 Apr 2019 22:44:03 -0400 Subject: [PATCH 5/6] Update minetest.rb to version 5.0.1 Another test. We'll see what happens. --- Formula/minetest.rb | 69 ++++----------------------------------------- 1 file changed, 5 insertions(+), 64 deletions(-) diff --git a/Formula/minetest.rb b/Formula/minetest.rb index 34a99356dd8fa..54ab4cbd767a0 100644 --- a/Formula/minetest.rb +++ b/Formula/minetest.rb @@ -70,72 +70,13 @@ def caveats # --help and --version produce output directly. # --videomodes need user data directory in order to work. # --info and --trace need user data directory and will actually run the game. - # --run-unittests incomplete, further creation of support files needed. - # --speedtests forced creation of support files created by program automatically. # - # Debug file, all test information should wind up in here. + # --run-unittests and --speedtests do not work for Homebrew + # with Irrlicht Engine reporting No doublebuffering available. # - (testpath/"Library/Application Support/minetest/debug.txt").write("") - # - # Meta map file, needed for map generation. - # - (testpath/"Library/Application Support/minetest/worlds/world/map_meta.txt").write("mg_biome_np_humidity_blend = { - octaves = 2 - lacunarity = 2 - persistence = 1 - spread = (8,8,8) - scale = 1.5 - seed = 90003 - flags = defaults - offset = 0 -} -mg_biome_np_heat_blend = { - octaves = 2 - lacunarity = 2 - persistence = 1 - spread = (8,8,8) - scale = 1.5 - seed = 13 - flags = defaults - offset = 0 -} -mg_biome_np_humidity = { - octaves = 3 - lacunarity = 2 - persistence = 0.5 - spread = (1000,1000,1000) - scale = 50 - seed = 842 - flags = defaults - offset = 50 -} -mg_biome_np_heat = { - octaves = 3 - lacunarity = 2 - persistence = 0.5 - spread = (1000,1000,1000) - scale = 50 - seed = 5349 - flags = defaults - offset = 50 -} -mg_flags = caves, dungeons, light, decorations, biomes -mapgen_limit = 31000 -seed = 15 -chunksize = 5 -water_level = 1 -mg_name = v7 -[end_of_params]") + # Debug File: all test information should wind up in here. # - # World configuration file. - # - (testpath/"Library/Application Support/minetest/worlds/world/world.mt").write("enable_damage = true -auth_backend = sqlite3 -player_backend = sqlite3 -backend = sqlite3 -creative_mode = false -gameid = minetest -") - system "#{prefix}/minetest.app/Contents/MacOS/minetest", "--speedtests" + (testpath/"Library/Application Support/minetest/debug.txt").write("") + system "#{prefix}/minetest.app/Contents/MacOS/minetest", "--videomodes" end end From 34cc97cab15c6968641e55475abc5f3f14aa5ea7 Mon Sep 17 00:00:00 2001 From: johnlockard <48885497+johnlockard@users.noreply.github.com> Date: Tue, 9 Apr 2019 23:05:22 -0400 Subject: [PATCH 6/6] Delete minetest.rb --- Formula/minetest.rb | 82 --------------------------------------------- 1 file changed, 82 deletions(-) delete mode 100644 Formula/minetest.rb diff --git a/Formula/minetest.rb b/Formula/minetest.rb deleted file mode 100644 index 54ab4cbd767a0..0000000000000 --- a/Formula/minetest.rb +++ /dev/null @@ -1,82 +0,0 @@ -class Minetest < Formula - desc "Free, open source voxel game engine and game" - homepage "https://www.minetest.net/" - - stable do - url "https://github.com/minetest/minetest/archive/5.0.1.tar.gz" - sha256 "aa771cf178ad1b436d5723e5d6dd24e42b5d56f1cfe9c930f6426b7f24bb1635" - - resource "minetest_game" do - url "https://github.com/minetest/minetest_game/archive/5.0.1.tar.gz" - sha256 "965d2cf3ac8c822bc9e60fb8f508182fb2f24dde46f46b000caf225ebe2ec519" - end - end - - bottle do - sha256 "4da5f8bebc6588cdf99b23cd2646e91425e15e2c625b8516728bd6970ed2e25b" => :mojave - sha256 "7aa7a7e5a509efeb89b1ab0a897c250950ba117cc658c70c0892a3a4d4b882d5" => :high_sierra - sha256 "7c76e9b683a0205f116403f6571c7e7c7cbd40f7bc16951ef0c350512cfc017e" => :sierra - sha256 "ed87de74a782d339eee51f30e2d183eefd25a37e595df5f42157883afbeec133" => :el_capitan - end - - head do - url "https://github.com/minetest/minetest.git" - - resource "minetest_game" do - url "https://github.com/minetest/minetest_game.git", :branch => "master" - end - end - - depends_on "cmake" => :build - depends_on "freetype" - depends_on "gettext" - depends_on "irrlicht" - depends_on "jpeg" - depends_on "libogg" - depends_on "libvorbis" - depends_on "luajit" - - def install - (buildpath/"games/minetest_game").install resource("minetest_game") - - args = std_cmake_args - %w[-DCMAKE_BUILD_TYPE=None] - args << "-DCMAKE_BUILD_TYPE=Release" << "-DBUILD_CLIENT=1" << "-DBUILD_SERVER=0" - args << "-DENABLE_FREETYPE=1" << "-DCMAKE_EXE_LINKER_FLAGS='-L#{Formula["freetype"].opt_lib}'" - args << "-DENABLE_GETTEXT=1" << "-DCUSTOM_GETTEXT_PATH=#{Formula["gettext"].opt_prefix}" - - # -ffast-math compiler flag is an issue on Mac - # https://github.com/minetest/minetest/issues/4274 - inreplace "src/CMakeLists.txt", "-ffast-math", "" - - system "cmake", ".", *args - system "make", "package" - system "unzip", "minetest-*-osx.zip" - prefix.install "minetest.app" - end - - def caveats - <<~EOS - Put additional subgames and mods into "games" and "mods" folders under - "~/Library/Application Support/minetest/", respectively (you may have - to create those folders first). - - If you would like to start the Minetest server from a terminal, run - "/Applications/minetest.app/Contents/MacOS/minetest --server". - EOS - end - - test do - # - # --help and --version produce output directly. - # --videomodes need user data directory in order to work. - # --info and --trace need user data directory and will actually run the game. - # - # --run-unittests and --speedtests do not work for Homebrew - # with Irrlicht Engine reporting No doublebuffering available. - # - # Debug File: all test information should wind up in here. - # - (testpath/"Library/Application Support/minetest/debug.txt").write("") - system "#{prefix}/minetest.app/Contents/MacOS/minetest", "--videomodes" - end -end