ラベル HomeBrew の投稿を表示しています。 すべての投稿を表示
ラベル HomeBrew の投稿を表示しています。 すべての投稿を表示

2021年8月13日金曜日

Upgrade GNU Emacs 27.1

 Emacsをbrew upgradeしたら状態がぐしゃぐしゃになった。
 前回brew-caskからinstallしたので、uninstallしたら、なぜか、brew-coreからinstallした、と勘違いしている。なので強引にreinstallした。

 が、Cocoaで立ち上がらない。

  過去の記事を読んで思い出した。そうだ。なぜか、知らないけれど、configureのオプションが「–without-ns」になっていたのだった。それでcaskを利用したのだけど。オプションをいくつかコントロールしたいこともあって自前でbuildするか、と。
 インテルチップはバイナリ提供をしていないようで、compileしなおしていた。それならどこかにsourceを展開しているはずなので、手動でbuildしなおそうか、と考えたのだ。
 ところがそれが見当たらない。

 brew installからオプションを渡す方法はあいかわらず、パージされたままだ。
 bottleを直接、いじってみたらbuildが途中で失敗する。
 どこかに代替手段がありそうなもんなんだがなぁ。
 man brewをつらつら読んでいて気づいた。

-i, --interactive
       Download  and  patch formula, then open a shell. This allows the
       user to run ./configure --help and otherwise  determine  how  to
       turn the software package into a Homebrew package.

 なるものがあるじゃないか。

brew reinstall -i emacs

 で、インタラクティブモードから手動でbuildできるようになっているらしい。

./configure --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs/27.1/share/info/emacs --prefix=/usr/local/Cellar/emacs/27.1 --with-ns

 exitしたら実際に反映されるらしいのだが。
 おかしい。
 あいかわらず、「without-ns」のままだ。Cocoaで立ち上がらない。
 ログを見るかぎりEmacs.appをつくっているようにも見える。しかし、そんなものどこにも見当たらないぞ。試行錯誤して調べてみると、exitした瞬間に消えてしまっている。

 なので、buildしてインタラクティブモードを抜ける前に~/Applications/にコピーした。
 そちらのEmacs.appはちゃんと、「–with-ns」になった。

system-configuration-options is a variable defined in ‘C source code’.
Its value is
"--enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs/27.1/share/info/emacs --prefix=/usr/local/Cellar/emacs/27.1 --with-ns"

Documentation:
String containing the configuration options Emacs was built with.

[back]

 /usr/local/Cellar/emacs/27.1/bin/emacsは

system-configuration-options is a variable defined in ‘C source code’.
Its value is
"--disable-silent-rules --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs/27.1/share/info/emacs --prefix=/usr/local/Cellar/emacs/27.1 --with-gnutls --without-x --with-xml2 --without-dbus --with-modules --without-ns --without-imagemagick"

Documentation:
String containing the configuration options Emacs was built with.

 なのだが。

2020年10月20日火曜日

brew upgrade

 imaximaが動かなくなっていたので、brewをupgradeした。

brew upgrade

 流れていくメッセージをぼんやりと眺めていたらcaskでインストールしたはずの、EmacsやGnuCashもアップグレードされている。
 ——えっ。それをやるつもりはなかったぞ。
 どうやらいつのまにか、caskとbrew本家が統合されていたらしい。知らんがな。
 まいったなぁ。別にいいけど。

GNU Emacs 27.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95)) of 2020-08-12

 OreModeの「Structure Templates」のキーアサインがかわっていて面喰う。
 バージョンは9.3になっていた。

 ちょこちょことEmacsを使ってみてisearchで時々にエラーになる。よく使うので辛いうえ、そもそもEmacsのカレント(default-directory)が「/」になっていて気持ち悪い。
 TimeMachineのバックアップからひとつ前のバージョンに戻す。
 

 ちなみにimaximaが動かなくなったのはmaximaやtexliveやgsの配置場所がかわっていたからだった。
 ああ、そういえば、 evinceをインストールしたとき、brewがupgradeされたな……。それでか。

2019年7月1日月曜日

brewでinstallしたらEmacsがうまく動かなくなった……。

 いろいろupgradeしたのでついでにEmacsもupgradeした。
 ——動かなくなった。
 あれ? なんで?
 コード系の文句をいわれている。
 しかもterminal onlyのようにも見える。
 コンパイルオプションはどうなっておるのだ。でも「brew info」では表示されなくなっている。すったもんだしていたらbottoleの中身を見る方法を見つけた。——「brew cat」

bash-3.2$ brew cat emacs
brew cat emacs
class Emacs < Formula
  desc "GNU Emacs text editor"
  homepage "https://www.gnu.org/software/emacs/"
  url "https://ftp.gnu.org/gnu/emacs/emacs-26.2.tar.xz"
  mirror "https://ftpmirror.gnu.org/emacs/emacs-26.2.tar.xz"
  sha256 "151ce69dbe5b809d4492ffae4a4b153b2778459de6deb26f35691e1281a9c58e"

  bottle do
    sha256 "dc49de7034346e692662d10ebacd75ea257d61ebba6f57699b855f158e4a7eda" => :mojave
    sha256 "de836e0766066201968c2dd0ef25ff4458ee532a61dc4ed9d7d8fb284b395b8d" => :high_sierra
    sha256 "6b07616447d66a8066c08591400dc8fed75d44bf51f81de2e1208635e03204c6" => :sierra
  end

  head do
    url "https://github.com/emacs-mirror/emacs.git"

    depends_on "autoconf" => :build
    depends_on "gnu-sed" => :build
    depends_on "texinfo" => :build
  end

  depends_on "pkg-config" => :build
  depends_on "gnutls"

  def install
    args = %W[
      --disable-dependency-tracking
      --disable-silent-rules
      --enable-locallisppath=#{HOMEBREW_PREFIX}/share/emacs/site-lisp
      --infodir=#{info}/emacs
      --prefix=#{prefix}
      --with-gnutls
      --without-x
      --with-xml2
      --without-dbus
      --with-modules
      --without-ns
      --without-imagemagick
    ]

    if build.head?
      ENV.prepend_path "PATH", Formula["gnu-sed"].opt_libexec/"gnubin"
      system "./autogen.sh"
    end

    system "./configure", *args
    system "make"
    system "make", "install"

    # Follow MacPorts and don't install ctags from Emacs. This allows Vim
    # and Emacs and ctags to play together without violence.
    (bin/"ctags").unlink
    (man1/"ctags.1.gz").unlink
  end

  plist_options :manual => "emacs"

  def plist; <<~EOS
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
      <key>KeepAlive</key>
      <true/>
      <key>Label</key>
      <string>#{plist_name}</string>
      <key>ProgramArguments</key>
      <array>
        <string>#{opt_bin}/emacs</string>
        <string>--fg-daemon</string>
      </array>
      <key>RunAtLoad</key>
      <true/>
    </dict>
    </plist>
  EOS
  end

  test do
    assert_equal "4", shell_output("#{bin}/emacs --batch --eval=\"(print (+ 2 2))\"").strip
  end
end
bash-3.2$ 

 ——で?
 なんでMacなのに「–without-ns」になっているんだろう?
 もうHomeBrewはMac用のパッケージ管理システムではないんだなぁ……。
 しかたないのでCASKからインストールした。

2019年6月27日木曜日

AquaTermが使えない……。

 gnuplotをupgradeしたらグラフが表示されなくなってしまった。
 調べてみると、AquaTermって何? っていっている。
 ああ、これはbrewでインストールしたバイナリが「–without-aquaterm」されているんだな。というわけで、brew installで「–with-aquaterm」オプションをつけようとしたら——あれ?
 できない。
 brew 2.0で仕様が変更されてできなくなってしまったらしい。
 なんてことだ。
 しかたないのでソースをもってきて——ライブラリがupgradeされてしまっていてgnuplotを元にもどしても動かなくなってしまったのだ——「–with-aquaterm」でconfigureしたのだけど……。
 有効にならない。
 どうやらAquaTermは未サポートになってしまったらしい。
 かわりにgnuplot_qtなるものが提供されるようになっていたのだけれど。
 ところがこれだと、線分の端が丸まってしまう。
 なんじゃあ?
 いろいろいじってなんとか、gnuplot_qtのターミナルの設定の中に線分の端を丸めるか、どうかのオプションを見つけた。

追記:いつのまにか、 --build-bottleというオプションができていた。これでコンパイルできるのかも。

2015年5月15日金曜日

Emacsをバージョンアップ、および、HomeBrew

 FreeBSDのpkgになれてしまったせいか、なんとなくMacでもパッケージ管理を導入したい気分だった。アプリケーションに関しては「/Applications」に集中しているので便利なのだけれど。
 昔、Macをもっていたとき、MacPortsを使った記憶はある。それともあれはFinkだったかな?
 で、ググってみると、HomeBrewというものがあることを知った。HomeBrewがらみばかりがヒットしたということは流行っているのかもしれない。
 EmacsはEmacs for Mac OS Xからもってきて入れたのだけれど、HomeBrewでもインストールできるそうなので入れなおした。

  1. 「brew search emacs」で対象アプリ(emacs)がないか検索
  2. 「brew home emacs」で対象アプリがどんなものか、確認(ホームページへ飛ぶ)。
  3. 「brew options emacs」でオプションを確認
  4. 「brew install –with-cocoa emacs」でオプション(–with-cocoa)を指定してインストール

 あとは「~/Applications」に「Emacs.app」のシンボリックリンクを張るとか。

 それにしても見ると、Emacsってcocoa対応も統合されているんだなぁ。