Install an old version of Pandoc (<2) using homebrew

I just reinstalled my macOS. Using brew install pandoc , I installed Pandoc and it installed v2, which caused some of my web application regression tests to fail.

When I run an older version on my server (1.16.0.2), I want to install this version on my computer.

But, unfortunately, I seem to be unable to do this with a homegrown, because there seems to be no available version of the obsolete version, only the most recent one? The brew search command does not show any versions:

 $ brew search pandoc ==> Searching local taps... pandoc βœ” pandoc-citeproc pandoc-crossref ==> Searching taps on GitHub... ==> Searching blacklisted, migrated and deleted formulae... 

I tried things like brew install [email protected] but didn't work.

+5
source share
1 answer

Option 1) Use old formulas

You can use the git story to get the formula for pandoc 1.16.0.2.

Go to the local directory where the formulas are stored:

 cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula 

Check out the pandoc story

 git log pandoc.rb 

It seems that the latest fixer of version 1.16.0.2 is commit 53d113c339280e6bc43325afd24333 .

1) To get all the dependencies in the correct version, you must check all the formulas in this commit (you can also check only the dependency graph).

 git checkout 53d113c339 

2) The cabal-install formula uses the old homebrew construct, removing it with:

 brew edit cabal-install 

and removing the bottle section.

3) By default, the house makes an update before installation, so you need to specify so as not to update before installation:

 HOMEBREW_NO_AUTO_UPDATE=1 brew install pandoc 

This will take a lot of time because you need to compile everything, there are no bottles for the latest macOS versions (Sierra and High Sierra). Depending on your version of macOS, you may run into some compilation issues ...

Option 2) Use old bottles

There are bottles available for OS X Mavericks (10.9), OS X Yosemite (10.10) and OS X El Capitan (10.11). You can install them manually, but you will also need to install the dependencies ( cabal-install 1.22.6.0 and ghc 7.10.3 ) with the correct versions. To install the old bottle box of the old formula, copy the old bottle to ~/Library/Caches/Homebrew/ and install it with:

 HOMEBREW_NO_AUTO_UPDATE=1 brew install bottle_name 

Option 3) Create your own retro formula

Another option is to rewrite the current pandoc formula for the desired version.

Conclusion

Each of these options is a possible way, but none of them is simple. There is no easy way to install an older version of Pandoc with Homebrew. You should use the Haskell version manager, such as Stack .

+4
source

Source: https://habr.com/ru/post/1274934/


All Articles