Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Highlight in the bundle #73

Merged
merged 1 commit into from
Dec 15, 2020
Merged

Include Highlight in the bundle #73

merged 1 commit into from
Dec 15, 2020

Conversation

Tatsh
Copy link

@Tatsh Tatsh commented Dec 6, 2020

This will fix #72.

I don't know if you want to keep your own forks of Lua and highlight because their build systems are not so fun. Especially Lua because it wants users to modify makefile as they need to. They do not want to use something more configurable like autoconf or CMake (or Xcode).

image

This should work like so:

git clone --recurse-submodules -b bigsur 'git@github.com:Tatsh/QLColorCode'
cd QLColorCode
xcodebuild -target Package
qlmanage -r cache

Then preview a supported file in Finder.

@ralphrmartin
Copy link

Can't try it out as I get
git@gitlab.com: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.
...
fatal: clone of 'git@gitlab.com:saalen/highlight.git' into submodule path ...failed

Perhaps it means I need a gitlab account?

@Tatsh
Copy link
Author

Tatsh commented Dec 6, 2020

I switched the module URIs to be https which allows anonymous cloning. Should fix the issue.

@ralphrmartin
Copy link

Unfortunately the xcodebuild step failed:

 $ xcodebuild -target Package
Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -target Package
...
In file included from ./core/texgenerator.cpp:32:
In file included from ./include/texgenerator.h:33:
In file included from ./include/codegenerator.h:37:
./include/syntaxreader.h:39:10: fatal error: 'boost/xpressive/xpressive_dynamic.hpp' file not found
#include <boost/xpressive/xpressive_dynamic.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I already have boost 1.74.0 installed via homebrew.

@Tatsh
Copy link
Author

Tatsh commented Dec 6, 2020

Can you tell me the path to Boost include? I assume it's under /usr/local/Cellar or something but I don't know the full path.

I use MacPorts and /opt/local/include is in my patch. This should be the directory where boost/unordered_map.hpp should exist (example). That is, subtracting /boost* from /opt/local/include/boost/unordered_map.hpp. In my case this results in /opt/local/include. It's possible Homebrew does this differently.

You can try modifiying hl/highlight/src/makefile and editing line 78 to add -I ${other include path} after the other -I arguments.

@ralphrmartin
Copy link

ralphrmartin commented Dec 6, 2020

That particular include file is at

/usr/local/include/boost/unordered_map.hpp

@ralphrmartin
Copy link

OK, edited the makefile to replace /opt/local... with /usr/local... and QLColorCode built successfully, and seems to run OK.

@Tatsh
Copy link
Author

Tatsh commented Dec 6, 2020

I can make the patch script add the Boost path dynamically but maybe it's better to include Boost as a submodule.

@Tatsh
Copy link
Author

Tatsh commented Dec 6, 2020

OK, edited the makefile to replace /opt/local... with /usr/local... and QLColorCode built successfully, and seems to run OK.

Could you post a screenshot similar to mine? With About Mac open.

@ralphrmartin
Copy link

ralphrmartin commented Dec 6, 2020

Screenshot 2020-12-06 at 19 38 35

@Tatsh
Copy link
Author

Tatsh commented Dec 6, 2020

I gave up on trying to add Boost as a submodule. I tried to only add the submodules necessary but this has become a crazy headache. If I add the main project it will add a huge number of submodules and then the set up for making the highlight source see these headers takes forever.

I added the /usr/local/include path to the patch for Highlight and added a note in the readme.

Please try the commands in the first post again and see if it works out of the box.

@ralphrmartin
Copy link

Yes, builds without modification now.

I did note this, I don't know if it's harmless:

    /bin/sh -c /Users/ralph/junk/QLColorCode/build/QLColorCode.build/Release/Package.build/Script-0E0E34E80D0097020086C1E6.sh
+/Users/ralph/junk/QLColorCode/build/QLColorCode.build/Release/Package.build/Script-0E0E34E80D0097020086C1E6.sh:3> [ '!=' Release ']'
/Users/ralph/junk/QLColorCode/build/QLColorCode.build/Release/Package.build/Script-0E0E34E80D0097020086C1E6.sh:3: parse error: condition expected: !=

@Tatsh
Copy link
Author

Tatsh commented Dec 6, 2020

Harmless for this but it needs to be looked at.

@Tatsh Tatsh changed the title Package highlight with the bundle Include Highlight in the bundle Dec 7, 2020
* Should build on systems with either MacPorts or Homebrew
* colorize.sh: specify resource directory as data path to highlight
* Common: only use highlight in the bundle
* Add highlight and lua submodules
* Apply patches target (runs before building Lua)
* Add note about building
* Fix CI
* Remove check for BUILD_STYLE
* readme: add note about installation from MacPorts
@dnicolson
Copy link

I had to run brew install boost but otherwise it works well.

@Tatsh
Copy link
Author

Tatsh commented Dec 7, 2020

I had to run brew install boost but otherwise it works well.

Yes this is required for building but not runtime. The readme has been updated to state this.

@ElfSundae
Copy link

Great job 👍 build succeeded after brew install boost, on macOS 11.0.1

@BrianGilbert
Copy link

Also worked for me after installing boost via homebrew 👍

@fffzzy
Copy link

fffzzy commented Dec 13, 2020

Thanks for the fix and hope this change can be released in Homebrew later so I can update with ease. Thanks a lot.

@anthonygelibert
Copy link
Owner

THANKS A LOT TO EVERYBODY!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not working on Big Sur
7 participants