texstudio icon indicating copy to clipboard operation
texstudio copied to clipboard

Unable to compile texstudio on macOS anymore

Open cilia opened this issue 1 year ago • 15 comments

Environment

  • TeXstudio: 4.3.1
  • Qt: 6.3.1
  • OS: macOS 10.15, 11.6
  • TeX distribution: MacTex 2021, 2022

Description

It seems now there is no way for users to compile texstudio on macOS, as a dependency change in the poppler package maintained by homebrew. More specially, poppler no longer depends on qt6, so poppler-qt6 a required dependency by texstudio is no longer available on macOS.

This causes problem for users of older macOS (<11) where the official texstudio dmg no longer support macOS 10.x and have to compile their own, as well as for users of newer M1 Macs (with macOS >11) where they want to compile texstudio natively for M1 (since the official dmg still does not support M1 Macs natively).

So I wonder what user friendly options are still available for Mac users who want to compile their own texstudio for the reasons above. Thanks.

cilia avatar Sep 03 '22 09:09 cilia

Based on this discussion, the homebrew crew doesn't seem supportive to create a separate poppler-qt6 (basically a poppler with qt6 included) for us, so is there a way the texstudio community can maintain our own poppler-qt6 tap?

cilia avatar Sep 03 '22 10:09 cilia

you can compile txs with qt5 though txs tries to use qt6 on all platform for official builds. As stated in the discussion, homebrew has no interest in providing a suitable base for compiling txs, so I have no further interest to interact here.

sunderme avatar Sep 03 '22 19:09 sunderme

That's a real shame. Yes, I just tried and can compile using qt5 but it may break at some point down the road and some features may not function properly. It seems this problem won't go away for some time, so can we organize a poppler-qt6 tap somewhere for the ease of installing/use by Mac users?

cilia avatar Sep 04 '22 03:09 cilia

I think I may have the same problem. I'm not an expert on homebrew so I followed the instructions here. After installing everything using these commands:

brew install qt
brew install poppler
brew install pkg-config

When I try to compile tex studio I get the following:

$ /usr/local/opt/qt6/bin/qmake texstudio.pro
Project MESSAGE: Building with Qt 6.3.1
Project MESSAGE: Static hunspell
Project MESSAGE: Static quazip5
Project MESSAGE: Creating release version
Project MESSAGE: tests are disabled
Project ERROR: poppler-qt6 development package not found

Is there any solution? (I also unwittingly tried to upgrade TexStudio on Mac OS X 10.15 and deleted the old app before realizing that the dmg of the latest version does not support it, in the middle of writing my thesis!!!)

billtubbs avatar Sep 23 '22 06:09 billtubbs

Homebrew no longer provides poppler-qt6 formula, see #2483. Currently texstudio holds its own poppler-qt6, but not as a homebrew formula, https://github.com/texstudio-org/texstudio/blob/641ed0ba8f16637cea34cf0fdfdad51da1b8484f/.github/workflows/cd.yml#L402-L403

muzimuzhi avatar Sep 23 '22 10:09 muzimuzhi

Using qt@5 and poppler-qt5 should work

sunderme avatar Sep 23 '22 18:09 sunderme

use qmake-qt5 (or .../qt5/bin/qmake) to generate the makefile.

sunderme avatar Sep 23 '22 18:09 sunderme

Sorry, I'm not experienced enough to understand what to do. I already tried brew install popper-qt5 and it says poppler-qt5 22.08.0 is already installed and up-to-date. What should I be doing exactly instead of:

/usr/local/opt/qt6/bin/qmake texstudio.pro

Or should I be installing an older version of TexStudio and if so which version?

billtubbs avatar Sep 23 '22 18:09 billtubbs

Okay I just tried

/usr/local/opt/qt5/bin/qmake texstudio.pro

as suggested and it says:

Project MESSAGE: Building with Qt 5.15.5
Project MESSAGE: Static hunspell
Project MESSAGE: Static quazip5
Project MESSAGE: Creating release version
Project MESSAGE: tests are disabled
Project ERROR: poppler-qt5 development package not found

billtubbs avatar Sep 23 '22 19:09 billtubbs

are you sure that poppler-qt5 is installed ? it used to be exclusive with poppler ...

sunderme avatar Sep 23 '22 19:09 sunderme

I don't know. All I know is that brew says "Warning: poppler-qt5 22.08.0 is already installed and up-to-date."

billtubbs avatar Sep 23 '22 19:09 billtubbs

try to uninstall poppler & qt and go for qt@5 and poppler-qt5 (or only poppler-qt5 which should trigger the qt@5 install)

sunderme avatar Sep 23 '22 19:09 sunderme

Thanks. I uninstalled poppler but when I do brew uninstall qt it says:

Error: Refusing to uninstall /usr/local/Cellar/qt/6.3.1_4
because it is required by pyqt, which is currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies qt

Should I go ahead and do brew uninstall --ignore-dependencies qt?

billtubbs avatar Sep 23 '22 19:09 billtubbs

someone working on OSX should walk you through. I can't test.

sunderme avatar Sep 23 '22 19:09 sunderme

Okay thanks. I didn't do the qt uninstall but I tried uninstalling and reinstalling poppler-qt and get this now, which might be useful information:

... $ brew uninstall poppler-qt5
Uninstalling /usr/local/Cellar/poppler-qt5/22.08.0... (477 files, 28.8MB)
... $ brew install poppler-qt5
==> Downloading https://ghcr.io/v2/homebrew/core/poppler-qt5/manifests/22.08.0-1
Already downloaded: /Users/billtubbs/Library/Caches/Homebrew/downloads/d81540772bf7d6e52012cfe178edd7f353f4a71d5a532f54d86d7a66e0db6b23--poppler-qt5-22.08.0-1.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/poppler-qt5/blobs/sha256:ffcbc6c557151fd0e9c9d7246569e2909aa97fa03fc
Already downloaded: /Users/billtubbs/Library/Caches/Homebrew/downloads/3aa1c18447e67d98825b3a18524795307b0cebb4d4a4742e992ea3e1be4dd7ef--poppler-qt5--22.08.0.catalina.bottle.1.tar.gz
==> Pouring poppler-qt5--22.08.0.catalina.bottle.1.tar.gz
==> Caveats
poppler-qt5 is keg-only, which means it was not symlinked into /usr/local,
because it conflicts with poppler.

If you need to have poppler-qt5 first in your PATH, run:
  echo 'export PATH="/usr/local/opt/poppler-qt5/bin:$PATH"' >> /Users/billtubbs/.bash_profile

For compilers to find poppler-qt5 you may need to set:
  export LDFLAGS="-L/usr/local/opt/poppler-qt5/lib"
  export CPPFLAGS="-I/usr/local/opt/poppler-qt5/include"

For pkg-config to find poppler-qt5 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/poppler-qt5/lib/pkgconfig"
  export PKG_CONFIG_PATH="/usr/local/opt/poppler-qt5/share/pkgconfig"

==> Summary
🍺  /usr/local/Cellar/poppler-qt5/22.08.0: 477 files, 28.8MB
==> Running `brew cleanup poppler-qt5`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

It says "it conflicts with poppler" but I already (successfully) uninstalled poppler so that's weird.

billtubbs avatar Sep 23 '22 19:09 billtubbs

Hi everyone! I've successfully compiled TeXstudio with poppler and described it here: https://github.com/halva-s-pivom/TeXstudio_M1 I haven't tested it much but it seems to work. I've also provided a link to google drive with .dmg Let me now whether it works for you or not

halva-s-pivom avatar Dec 06 '22 18:12 halva-s-pivom

the instructions seem incorrect.

  • qt6 needs to be installed before building poppler as otherwise poppler-qt6 is not build.
  • poppler has a number of dependencies which are probably not present on the system by default. I assume that you can install them with brew install ... , maybe there is a command to install poppler dependencies from poppler.rb .

The caveat is that poppler resides outside of the brew system, so just be aware of that.

sunderme avatar Dec 06 '22 18:12 sunderme

Thank you, changed the order. Anyway it seems impossible to track all the dependencies and provide complete step-by-step instructions telling in what order to build everything. You merely look what log says and install what's missing.

halva-s-pivom avatar Dec 06 '22 18:12 halva-s-pivom

I followed the instructions in https://github.com/texstudio-org/texstudio/issues/2568#issuecomment-1256020370, which allowed me to install all dependencies required to compile Texstudio with three commands:

wget https://github.com/sunderme/homebrew-poppler-build/releases/download/22.09.0/poppler-qt6--22.09.0.big_sur.bottle.tar.gz
brew install ./poppler-qt6--22.09.0.big_sur.bottle.tar.gz
brew install qt pkg-config

Iksas avatar Dec 06 '22 19:12 Iksas

That will work, but I don't maintain that package any more as I switched to a slightly different method for CD outside of brew.

sunderme avatar Dec 06 '22 19:12 sunderme

Following the official instructions with a few deviations: FIrst: install essential packages.

brew install qt
brew install cairo fontconfig freetype gettext jpeg libpng libtiff little-cms2 nspr nss openjpeg
brew install cmake pkg-config

Then: compile poppler with Qt6 as an example. Add the following line to CMakeList.txt before compilation. set(ENABLE_QT5, OFF) and execute export CMAKE_PREFIX_PATH=/opt/homebrew/opt/qt/lib/cmake:$CMAKE_PREFIX_PATH

mkdir build
cd build
cmake .. -DENABLE_UNSTABLE_API_ABI_HEADERS=ON
cmake --build . --parallel
cmake --build . -t install

Finally: compile TexStudio.

mkdir build
cd build
cmake ..
cmake --build . --parallel
cmake --build . -t install

tianyi21 avatar May 15 '24 03:05 tianyi21

https://github.com/texstudio-org/texstudio/wiki/Compiling

sunderme avatar May 15 '24 17:05 sunderme