masayuki14 / worklog

Record working log by issues.
MIT License
0 stars 0 forks source link

rabbit うごかないから Poppler をなんとかする。 #2

Closed masayuki14 closed 6 years ago

masayuki14 commented 6 years ago

rabbit を実行するとエラー。 https://github.com/rabbit-shocker/rabbit/issues/111

なんとかしたい。

masayuki14 commented 6 years ago

検索してたらIssueみつけた。 https://github.com/rabbit-shocker/rabbit/issues/111 https://github.com/ruby-gnome2/ruby-gnome2/issues/1124#issuecomment-359323077

masayuki14 commented 6 years ago

は!!リンクつくられてしまった。ばれる。

masayuki14 commented 6 years ago

diff の通りに修正してbrew でインストールしなおしたら動くかもしれん。

masayuki14 commented 6 years ago

ローカルの brew のインストールされてるところをさがす。

masayuki14 commented 6 years ago

/usr/local/Cellar/poppler/0.62.0 にあるぽい。

masayuki14 commented 6 years ago
$ la
total 4440
drwxr-xr-x  13 masa  admin      416  1 30 21:04 .
drwxr-xr-x   3 masa  admin       96  1 30 16:48 ..
drwxr-xr-x   3 masa  admin       96 12  4 04:30 .brew
-rw-r--r--   1 masa  admin      145 12  4 04:30 AUTHORS
-rw-r--r--   1 masa  admin    17987 12  4 04:30 COPYING
-rw-r--r--   1 masa  admin  2132531  1 30 16:48 ChangeLog
-rw-r--r--   1 masa  admin     1458  1 30 16:48 INSTALL_RECEIPT.json
-rw-r--r--   1 masa  admin   106042 12  4 04:30 NEWS
-rw-r--r--   1 masa  admin     2053 12  4 04:30 README
drwxr-xr-x  13 masa  admin      416 12  4 04:30 bin
drwxr-xr-x   3 masa  admin       96 12  4 04:30 include
drwxr-xr-x  13 masa  admin      416 12  4 04:30 lib
drwxr-xr-x   6 masa  admin      192 12  4 04:30 share
masayuki14 commented 6 years ago

INSTALL_RECEIPT.json によると

  "source": {
    "path": "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/poppler.rb",
    "tap": "homebrew/core",
    "spec": "stable",
    "versions": {
      "stable": "0.62.0",
      "devel": null,
      "head": null,
      "version_scheme": 0
    }
  }

なので、ここを diff のとおりに変更したらいけるんかな。

masayuki14 commented 6 years ago

$vim /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/poppler.rb で修正する。

diff --git a/Formula/poppler.rb b/Formula/poppler.rb
index 1b446ea0fa..42b3cc53e0 100644
--- a/Formula/poppler.rb
+++ b/Formula/poppler.rb
@@ -68,6 +68,18 @@ class Poppler < Formula
     end

     system "cmake", ".", *args
+    system "make"
+    Dir.glob("glib/*.gir") do |gir_path|
+      gir_content = File.read(gir_path).gsub(/(shared-library=".+?")/) do
+        $1.gsub(/@rpath/) {lib}
+      end
+      File.open(gir_path, "w") do |gir_file|
+        gir_file.print(gir_content)
+      end
+    end
+    Dir.glob("glib/*.typelib") do |typelib_path|
+      rm_f(typelib_path)
+    end
     system "make", "install"
     resource("font-data").stage do
       system "make", "install", "prefix=#{prefix}"
masayuki14 commented 6 years ago
$ brew uninstall poppler
$ brew install poppler
==> Downloading https://homebrew.bintray.com/bottles/poppler-0.62.0.high_sierra.bottle.tar.gz
Already downloaded: /Users/masa/Library/Caches/Homebrew/poppler-0.62.0.high_sierra.bottle.tar.gz
==> Pouring poppler-0.62.0.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/poppler/0.62.0: 439 files, 18.3MB

でインストールしなおしても変わらない。インストールしてもビルドしてる様子はない。

masayuki14 commented 6 years ago

Ω\ζ°)チーン

masayuki14 commented 6 years ago

$ man brew を見てると

       install [--debug] [--env=(std|super)]  [--ignore-dependencies|--only-dependencies]  [--cc=compiler]  [--build-from-source|--force-bottle]  [--devel|--HEAD]
       [--keep-tmp] [--build-bottle] formula [options ...]

              If  --build-from-source  (or  -s)  is  passed,  compile  the  specified formula from source even if a bottle is provided. Dependencies will still be
              installed from bottles if they are available.

--build-from-sorce でインストールしてみる。

$ brew install --build-from-sorce poppler

Warning: poppler: this formula has no --build-from-sorce option so it will be ignored!
==> Downloading https://homebrew.bintray.com/bottles/poppler-0.62.0.high_sierra.bottle.tar.gz
Already downloaded: /Users/masa/Library/Caches/Homebrew/poppler-0.62.0.high_sierra.bottle.tar.gz
==> Pouring poppler-0.62.0.high_sierra.bottle.tar.gz
🍺  /usr/local/Cellar/poppler/0.62.0: 439 files, 18.3MB

へんかなし。うまくいかない。

masayuki14 commented 6 years ago

formula [options...]optionpoppler.rb

  option "with-qt", "Build Qt5 backend"
  option "with-little-cms2", "Use color management system"
  option "with-nss", "Use NSS library for PDF signature validation"

なのか?

masayuki14 commented 6 years ago

$brew info poppler したら poppler.rb の内容がでてる。

$ brew info poppler
poppler: stable 0.62.0 (bottled)
PDF rendering library (based on the xpdf-3.0 code base)
https://poppler.freedesktop.org/
Conflicts with:
  pdf2image (because poppler, pdftohtml, pdf2image, and xpdf install conflicting executables)
  pdftohtml (because poppler, pdftohtml, pdf2image, and xpdf install conflicting executables)
  xpdf (because poppler, pdftohtml, pdf2image, and xpdf install conflicting executables)
/usr/local/Cellar/poppler/0.62.0 (439 files, 18.3MB) *
  Poured from bottle on 2018-01-30 at 21:55:50
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/poppler.rb
==> Dependencies
Build: cmake ✘, pkg-config ✔
Required: cairo ✔, fontconfig ✔, freetype ✔, gettext ✔, glib ✔, gobject-introspection ✔, jpeg ✔, libpng ✔, libtiff ✔, openjpeg ✔
Optional: qt ✘, little-cms2 ✔, nss ✘
==> Options
--with-little-cms2
    Use color management system
--with-nss
    Use NSS library for PDF signature validation
--with-qt
    Build Qt5 backend
masayuki14 commented 6 years ago

cmake ✘, になってないからビルドできないのか?

masayuki14 commented 6 years ago

$ brew install cmake でインストールする。

masayuki14 commented 6 years ago

cmake ✔ になった。

$ brew uninstall poppler
$ brew install poppler

するもこれまでと変わらず。

masayuki14 commented 6 years ago

なんとか build させたい。

masayuki14 commented 6 years ago

オプションつけたら build されるかなぁ。

masayuki14 commented 6 years ago

$ brew install poppler --with-qt してみよう。

masayuki14 commented 6 years ago
$ brew install poppler --with-qt
==> Installing dependencies for poppler: qt
==> Installing poppler dependency: qt
==> Downloading https://homebrew.bintray.com/bottles/qt-5.10.0_1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring qt-5.10.0_1.high_sierra.bottle.tar.gz
==> Caveats
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.

This formula is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.zshrc

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/qt/lib
    CPPFLAGS: -I/usr/local/opt/qt/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/qt/lib/pkgconfig

==> Summary
🍺  /usr/local/Cellar/qt/5.10.0_1: 9,351 files, 291.9MB
==> Installing poppler --with-qt
==> Downloading https://poppler.freedesktop.org/poppler-0.62.0.tar.xz
######################################################################## 100.0%
==> cmake . -DCMAKE_C_FLAGS_RELEASE=-DNDEBUG -DCMAKE_CXX_FLAGS_RELEASE=-DNDEBUG -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/poppler/0.62.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAME
==> make
==> make install
==> Downloading https://poppler.freedesktop.org/poppler-data-0.4.8.tar.gz
######################################################################## 100.0%
==> make install prefix=/usr/local/Cellar/poppler/0.62.0
🍺  /usr/local/Cellar/poppler/0.62.0: 451 files, 19MB, built in 3 minutes 25 seconds

build されたっぽい。

masayuki14 commented 6 years ago

rabbit うごいたーーー!!!!!!!!

masayuki14 commented 6 years ago

Qt ってこれ? https://www.qt.io/ よくわからないけど、 rabbit 動かすっていう目的は達したのでとりあえずOK.

これフィードバックしたいけど、どうやったらいいんだろ。

masayuki14 commented 6 years ago

目的は達したので Close