From 1af4b8ad6540a7236a6e8db80cf6ce74b8d3af5f Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Fri, 19 Jun 2020 11:13:26 +0200 Subject: [PATCH 1/5] Add new BleachBit formula. --- Formula/bleachbit.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Formula/bleachbit.rb diff --git a/Formula/bleachbit.rb b/Formula/bleachbit.rb new file mode 100644 index 0000000000000..52169d5819b00 --- /dev/null +++ b/Formula/bleachbit.rb @@ -0,0 +1,23 @@ +class Bleachbit < Formula + include Language::Python::Virtualenv + + desc "Antiforensics and privacy system disk cleaner" + homepage "https://www.bleachbit.org" + url "https://github.com/bleachbit/bleachbit/archive/v4.0.0.tar.gz" + sha256 "5f7813b1ecda32647b1a31564b66f369fbd0d50d67924f256a0d414abc07501b" + + depends_on "pygobject3" + depends_on "python@3.8" + + def install + venv = virtualenv_create(libexec, "python3") + system "python3", "setup.py", "install", "--prefix=#{prefix}", + "--single-version-externally-managed", + "--record=installed.txt" + venv.pip_install_and_link buildpath + end + + test do + assert_match "BleachBit version ", shell_output("#{bin}/bleachbit --sysinfo") + end +end From 90c9e04a81b53c02f9ab238a57af56ccc7b3d7fd Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Fri, 19 Jun 2020 17:13:00 +0200 Subject: [PATCH 2/5] Generate launch script. --- Formula/bleachbit.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Formula/bleachbit.rb b/Formula/bleachbit.rb index 52169d5819b00..d85ec39dc8c41 100644 --- a/Formula/bleachbit.rb +++ b/Formula/bleachbit.rb @@ -14,6 +14,8 @@ def install system "python3", "setup.py", "install", "--prefix=#{prefix}", "--single-version-externally-managed", "--record=installed.txt" + (libexec/"bin").install "bleachbit.py" + (bin/"bleachbit").write_env_script libexec/"bin/bleachbit.py", :PYTHONHOME => libexec/"bin/python3.8", :PYTHONPATH => libexec/"lib/python3.8/site-packages" venv.pip_install_and_link buildpath end From 414580bd93b254b6e6acbe2297b17c89aa9b3546 Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Sun, 21 Jun 2020 12:04:22 +0200 Subject: [PATCH 3/5] Fix line too long error. --- Formula/bleachbit.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Formula/bleachbit.rb b/Formula/bleachbit.rb index d85ec39dc8c41..26b7c419ef7a6 100644 --- a/Formula/bleachbit.rb +++ b/Formula/bleachbit.rb @@ -15,7 +15,9 @@ def install "--single-version-externally-managed", "--record=installed.txt" (libexec/"bin").install "bleachbit.py" - (bin/"bleachbit").write_env_script libexec/"bin/bleachbit.py", :PYTHONHOME => libexec/"bin/python3.8", :PYTHONPATH => libexec/"lib/python3.8/site-packages" + (bin/"bleachbit").write_env_script libexec/"bin/bleachbit.py", + :PYTHONHOME => libexec, + :PYTHONPATH => libexec/"lib/python3.8/site-packages" venv.pip_install_and_link buildpath end From 214c77f5cf7fb85ea72baee8dfb6e9647deb9a99 Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Sun, 21 Jun 2020 16:41:17 +0200 Subject: [PATCH 4/5] No need to force python home. --- Formula/bleachbit.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/Formula/bleachbit.rb b/Formula/bleachbit.rb index 26b7c419ef7a6..3bcec0a53f536 100644 --- a/Formula/bleachbit.rb +++ b/Formula/bleachbit.rb @@ -16,7 +16,6 @@ def install "--record=installed.txt" (libexec/"bin").install "bleachbit.py" (bin/"bleachbit").write_env_script libexec/"bin/bleachbit.py", - :PYTHONHOME => libexec, :PYTHONPATH => libexec/"lib/python3.8/site-packages" venv.pip_install_and_link buildpath end From 691ad826879bcf3fa35f79d273ab87c74c23b478 Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Mon, 22 Jun 2020 13:33:49 +0200 Subject: [PATCH 5/5] Simplify setup stage. --- Formula/bleachbit.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Formula/bleachbit.rb b/Formula/bleachbit.rb index 3bcec0a53f536..ffdb4ccc72774 100644 --- a/Formula/bleachbit.rb +++ b/Formula/bleachbit.rb @@ -10,14 +10,10 @@ class Bleachbit < Formula depends_on "python@3.8" def install - venv = virtualenv_create(libexec, "python3") - system "python3", "setup.py", "install", "--prefix=#{prefix}", - "--single-version-externally-managed", - "--record=installed.txt" + virtualenv_install_with_resources (libexec/"bin").install "bleachbit.py" (bin/"bleachbit").write_env_script libexec/"bin/bleachbit.py", :PYTHONPATH => libexec/"lib/python3.8/site-packages" - venv.pip_install_and_link buildpath end test do