Skip to content

Commit

Permalink
Update Formula/{glibc-ja,nano*,mutt*,neomutt*}.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
z80oolong committed Oct 17, 2024
1 parent 8729fd8 commit ce55a6d
Show file tree
Hide file tree
Showing 13 changed files with 6,561 additions and 170 deletions.
3 changes: 0 additions & 3 deletions Formula/glibc-ja.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class GlibcJa < Formula
license all_of: ["GPL-2.0-or-later", "LGPL-2.1-or-later"]

depends_on "glibc"
depends_on "[email protected]"

def install
prefix.install buildpath/"README" => "README"
Expand All @@ -20,7 +19,5 @@ def post_install

system Formula["glibc"].opt_bin/"localedef", "-i", "ja_JP", "-f", "UTF-8", "ja_JP.UTF-8"
system Formula["glibc"].opt_bin/"localedef", "-i", "en_US", "-f", "UTF-8", "en_US.UTF-8"
system Formula["[email protected]"].opt_bin/"localedef", "-i", "ja_JP", "-f", "UTF-8", "ja_JP.UTF-8"
system Formula["[email protected]"].opt_bin/"localedef", "-i", "en_US", "-f", "UTF-8", "en_US.UTF-8"
end
end
188 changes: 94 additions & 94 deletions Formula/mutt.rb
Original file line number Diff line number Diff line change
@@ -1,118 +1,118 @@
class Mutt < Formula
desc "Mongrel of mail user agents (part elm, pine, mush, mh, etc.)"
homepage "http://www.mutt.org/"
license "GPL-2.0-or-later"
desc "Mongrel of mail user agents (part elm, pine, mush, mh, etc.)"
homepage "http://www.mutt.org/"
license "GPL-2.0-or-later"

stable do
url "https://bitbucket.org/mutt/mutt/downloads/mutt-2.2.12.tar.gz"
sha256 "043af312f64b8e56f7fd0bf77f84a205d4c498030bd9586457665c47bb18ce38"
patch :p1, Formula["z80oolong/eaw/[email protected].12"].diff_data
end
stable do
url "https://bitbucket.org/mutt/mutt/downloads/mutt-2.2.13.tar.gz"
sha256 "eb23faddc1cc97d867693f3a4a9f30949ad93765ad5b6fdae2797a4001c58efb"
patch :p1, Formula["z80oolong/eaw/[email protected].13"].diff_data
end

head do
url "https://gitlab.com/muttmua/mutt.git"
patch :p1, :DATA
head do
url "https://gitlab.com/muttmua/mutt.git"
patch :p1, :DATA

resource "html" do
url "https://muttmua.gitlab.io/mutt/manual-dev.html"
end
resource "html" do
url "https://muttmua.gitlab.io/mutt/manual-dev.html"
end
end

depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "glibc"
depends_on "gpgme"
depends_on "[email protected]"
depends_on "tokyo-cabinet"
depends_on "z80oolong/eaw/[email protected]"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "glibc"
depends_on "gpgme"
depends_on "[email protected]"
depends_on "tokyo-cabinet"
depends_on "z80oolong/eaw/[email protected]"

uses_from_macos "bzip2"
uses_from_macos "krb5"
uses_from_macos "zlib"
uses_from_macos "bzip2"
uses_from_macos "krb5"
uses_from_macos "zlib"

conflicts_with "tin",
because: "both install mmdf.5 and mbox.5 man pages"
conflicts_with "tin",
because: "both install mmdf.5 and mbox.5 man pages"

def install
ENV.append "CFLAGS", "-I#{Formula["z80oolong/eaw/[email protected]"].opt_include}"
ENV.append "CPPFLAGS", "-I#{Formula["z80oolong/eaw/[email protected]"].opt_include}"
ENV.append "LDFLAGS", "-L#{Formula["z80oolong/eaw/[email protected]"].opt_lib}"
def install
ENV.append "CFLAGS", "-I#{Formula["z80oolong/eaw/[email protected]"].opt_include}"
ENV.append "CPPFLAGS", "-I#{Formula["z80oolong/eaw/[email protected]"].opt_include}"
ENV.append "LDFLAGS", "-L#{Formula["z80oolong/eaw/[email protected]"].opt_lib}"

user_in_mail_group = Etc.getgrnam("mail").mem.include?(ENV["USER"])
effective_group = Etc.getgrgid(Process.egid).name
user_in_mail_group = Etc.getgrnam("mail").mem.include?(ENV["USER"])
effective_group = Etc.getgrgid(Process.egid).name

args = %W[
--disable-dependency-tracking
--disable-warnings
--prefix=#{prefix}
--enable-debug
--enable-hcache
--enable-imap
--enable-pop
--enable-sidebar
--enable-smtp
--with-gss
#{OS.mac? ? "--with-sasl" : "--with-sasl2"}
--with-ssl=#{Formula["[email protected]"].opt_prefix}
--with-tokyocabinet
--enable-gpgme
]
args = %W[
--disable-dependency-tracking
--disable-warnings
--prefix=#{prefix}
--enable-debug
--enable-hcache
--enable-imap
--enable-pop
--enable-sidebar
--enable-smtp
--with-gss
#{OS.mac? ? "--with-sasl" : "--with-sasl2"}
--with-ssl=#{Formula["[email protected]"].opt_prefix}
--with-tokyocabinet
--enable-gpgme
]

system "./prepare", *args
system "make"
system "./prepare", *args
system "make"

# This permits the `mutt_dotlock` file to be installed under a group
# that isn't `mail`.
# https://github.com/Homebrew/homebrew/issues/45400
inreplace "Makefile", /^DOTLOCK_GROUP =.*$/, "DOTLOCK_GROUP = #{effective_group}" unless user_in_mail_group
# This permits the `mutt_dotlock` file to be installed under a group
# that isn't `mail`.
# https://github.com/Homebrew/homebrew/issues/45400
inreplace "Makefile", /^DOTLOCK_GROUP =.*$/, "DOTLOCK_GROUP = #{effective_group}" unless user_in_mail_group

system "make", "install"
doc.install resource("html") if build.head?
system "make", "install"
doc.install resource("html") if build.head?

fix_rpath "#{bin}/mutt", ["z80oolong/eaw/[email protected]"], ["ncurses"]
end
fix_rpath "#{bin}/mutt", ["z80oolong/eaw/[email protected]"], ["ncurses"]
end

def fix_rpath(binname, append_list, delete_list)
return unless OS.linux?
def fix_rpath(binname, append_list, delete_list)
return unless OS.linux?

delete_list_hash = {}
rpath = %x{#{Formula["patchelf"].opt_bin}/patchelf --print-rpath #{binname}}.chomp.split(":")
delete_list_hash = {}
rpath = %x{#{Formula["patchelf"].opt_bin}/patchelf --print-rpath #{binname}}.chomp.split(":")

(append_list + delete_list).each {|name| delete_list_hash["#{Formula[name].opt_lib}"] = true}
rpath.delete_if {|path| delete_list_hash[path]}
append_list.each {|name| rpath.unshift("#{Formula[name].opt_lib}")}
(append_list + delete_list).each {|name| delete_list_hash["#{Formula[name].opt_lib}"] = true}
rpath.delete_if {|path| delete_list_hash[path]}
append_list.each {|name| rpath.unshift("#{Formula[name].opt_lib}")}

system "#{Formula["patchelf"].opt_bin}/patchelf", "--set-rpath", "#{rpath.join(":")}", "#{binname}"
end
system "#{Formula["patchelf"].opt_bin}/patchelf", "--set-rpath", "#{rpath.join(":")}", "#{binname}"
end

def caveats
<<~EOS
mutt_dotlock(1) has been installed, but does not have the permissions to lock
spool files in /var/mail. To grant the necessary permissions, run
def caveats
<<~EOS
mutt_dotlock(1) has been installed, but does not have the permissions to lock
spool files in /var/mail. To grant the necessary permissions, run
sudo chgrp mail #{bin}/mutt_dotlock
sudo chmod g+s #{bin}/mutt_dotlock
sudo chgrp mail #{bin}/mutt_dotlock
sudo chmod g+s #{bin}/mutt_dotlock
Alternatively, you may configure `spoolfile` in your .muttrc to a file inside
your home directory.
EOS
end
Alternatively, you may configure `spoolfile` in your .muttrc to a file inside
your home directory.
EOS
end

def diff_data
lines = self.path.each_line.inject([]) do |result, line|
result.push(line) if ((/^__END__/ === line) || result.first)
result
end
lines.shift
return lines.join("")
def diff_data
lines = self.path.each_line.inject([]) do |result, line|
result.push(line) if ((/^__END__/ === line) || result.first)
result
end
lines.shift
return lines.join("")
end

test do
system bin/"mutt", "-D"
touch "foo"
system bin/"mutt_dotlock", "foo"
system bin/"mutt_dotlock", "-u", "foo"
end
test do
system bin/"mutt", "-D"
touch "foo"
system bin/"mutt_dotlock", "foo"
system bin/"mutt_dotlock", "-u", "foo"
end
end

__END__
Expand Down Expand Up @@ -259,17 +259,17 @@ def diff_data
if (n > wid)
n = m;
diff --git a/init.h b/init.h
index 9ca57281..97f6bdcb 100644
index e3243d46..d070b430 100644
--- a/init.h
+++ b/init.h
@@ -4921,6 +4921,12 @@ struct option_t MuttVars[] = {
@@ -4938,6 +4938,12 @@ struct option_t MuttVars[] = {
{"xterm_set_titles", DT_SYN, R_NONE, {.p="ts_enabled"}, {.p=0} },
/*
*/
+#ifndef NO_USE_MKWCWIDTH
+ {"utf8_cjk", DT_BOOL, R_NONE, {.p=OPTUTF8CJK}, {.p=0} },
+ {"utf8_cjk", DT_BOOL, R_NONE, {.l=OPTUTF8CJK}, {.l=0} },
+#ifndef NO_USE_UTF8CJK_EMOJI
+ {"utf8_emoji", DT_BOOL, R_NONE, {.p=OPTUTF8CJKEMOJI}, {.p=0} },
+ {"utf8_emoji", DT_BOOL, R_NONE, {.l=OPTUTF8CJKEMOJI}, {.l=0} },
+#endif
+#endif
/*--*/
Expand Down
Loading

0 comments on commit ce55a6d

Please sign in to comment.