[
  {
    "path": ".ciignore",
    "content": "Aliases/*\nboneyard/*\nenviro/*\nRequirements/*\nscripts/*\nStrategies/*\ntravis/*\n.circleci/*\nLICENSE\n.ciignore\n.gitignore\n.git\n*.sh\n*.enc\n*.md\n*.yml\n*.json\n*.txt\n*.py\n*.env\n"
  },
  {
    "path": ".circleci/after_script.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac circle ci - after_script.sh\n#    ---------------------\n#    Date                 : Dec 2019\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer - FJ Perini\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\n# OS X version\n# sw_vers -productVersion\n# sw_vers -productVersion | cut -d '.' -f 1,2\n# MAJOR_MAC_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $1 \".\" $2}')\n# system_profiler SPSoftwareDataType\n\n# Build the actual bottles\n# In Travis, this used to be part of the deploy phase, but now it needs\n# to run as part of the original build process, but only on master.\nmkdir /tmp/bottles\nif [ \"$CIRCLE_BRANCH\" != \"master\" ]; then\npushd /tmp/bottles\n  # BOTTLE_ROOT=https://dl.bintray.com/homebrew-osgeo/osgeo-bottles\n  BOTTLE_ROOT=https://bottle.download.osgeo.org\n  for f in ${CHANGED_FORMULAE};do\n    echo \"Bottling changed formula ${f}...\"\n    brew bottle --verbose --json --root-url=${BOTTLE_ROOT} osgeo/osgeo4mac/${f}\n\n    # for art in ${f}*.sierra.bottle.*; do\n        # Remove double dashes introduced by the latest changes to Homebrew bottling.\n        # This may need to be reverted later, but this at least normalizes the bottle names with what's in the json files.\n        # Move the sierra bottle and json file\n        # mv ${art} ${art/--/-}\n    # done\n\n    # temporary duplication of 10.3-Xcode-10.x-built bottles to 10.4 bottles\n    # Do the bottle duplication per formula, so we can merge the changes\n    for art in ${f}*.high_sierra.bottle.*; do\n      new_name=${art/.high_sierra./.mojave.}\n      # Remove double dashes introduced by the latest changes to Homebrew bottling.\n      # This may need to be reverted later, but this at least normalizes the bottle names with what's in the json files.\n      cp -a ${art} ${new_name/--/-}\n      # Move the high_sierra bottle and json file\n      mv ${art} ${art/--/-}\n    done\n    for json in ${f}*.mojave.bottle*.json; do\n      sed -i '' s@high_sierra@mojave@g ${json}\n    done\n\n    # temporary duplication\n    # Do the bottle duplication per formula, so we can merge the changes\n    for art in ${f}*.high_sierra.bottle.*; do\n      new_name=${art/.high_sierra./.catalina.}\n      # Remove double dashes introduced by the latest changes to Homebrew bottling.\n      # This may need to be reverted later, but this at least normalizes the bottle names with what's in the json files.\n      cp -a ${art} ${new_name/--/-}\n      # Move the high_sierra bottle and json file\n      mv ${art} ${art/--/-}\n    done\n    for json in ${f}*.catalina.bottle*.json; do\n      sed -i '' s@high_sierra@catalina@g ${json}\n    done\n  done\n  ls\npopd\nfi\n"
  },
  {
    "path": ".circleci/before_deploy.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac circle ci - before_deploy.sh\n#    ---------------------\n#    Date                 : Dec 2019\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer - FJ Perini\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\nset -e\n\nif [ \"$CIRCLE_BRANCH\" == \"bottles\" ] && [ \"$CHANGED_FORMULAE\" != \"\" ]; then\n  # Setup Git configuration\n  COMMIT_USER=$(git log --format='%an' ${CIRCLE_SHA1}^\\!)\n  COMMIT_EMAIL=$(git log --format='%ae' ${CIRCLE_SHA1}^\\!)\n  git config user.name \"geo-ninja\"\n  git config user.email \"qgisninja@gmail.com\"\n  REPO=$(git config remote.origin.url)\n  SSH_REPO=${REPO/https:\\/\\/github.com\\//git@github.com:}\n\n  # Checkout on the proper branch\n  # see https://gist.github.com/mitchellkrogza/a296ab5102d7e7142cc3599fca634203\n  head_ref=$(git rev-parse HEAD)\n  if [[ $? -ne 0 || ! $head_ref ]]; then\n      err \"failed to get HEAD reference\"\n      return 1\n  fi\n  branch_ref=$(git rev-parse \"$CIRCLE_BRANCH\")\n  if [[ $? -ne 0 || ! $branch_ref ]]; then\n      err \"failed to get $CIRCLE_BRANCH reference\"\n      return 1\n  fi\n  if [[ $head_ref != $branch_ref ]]; then\n      msg \"HEAD ref ($head_ref) does not match $CIRCLE_BRANCH ref ($branch_ref)\"\n      err \"someone may have pushed new commits before this build cloned the repo\"\n      return 1\n  fi\n  if ! git checkout \"$CIRCLE_BRANCH\"; then\n      err \"failed to checkout $CIRCLE_BRANCH\"\n      return 1\n  fi\n\n  BUILT_BOTTLES=\n  pushd /tmp/workspace/bottles/\n    for f in ${CHANGED_FORMULAE};do\n      echo \"Updating changed formula ${f} with new bottles...\"\n\n      # Do Merge bottles with the formula\n      # Don't commit anything, we'll do that after updating all the formulae\n      # Catch the eror and store it to a variable\n      if result=$(brew bottle --merge --write --no-commit ${f}*.json 2>&1); then\n        BUILT_BOTTLES=\"$BUILT_BOTTLES ${f}\"\n      else\n       # If there's an error, remove the json and bottle files, we don't want them anymore.\n       echo \"Unable to bottle ${f}\"\n       echo $result\n       rm ${f}*.json\n       rm ${f}*.tar.gz\n      fi\n    done\n  popd\n\n  # Now do the commit and push\n  echo \"Commit and push...\"\n  git add -vA Formula/*.rb\n  git commit -m \"Updated bottles for: ${BUILT_BOTTLES}\n\n  Committed for ${COMMIT_USER}<${COMMIT_EMAIL}>\n  [ci skip]\"\n\n  # fix if there is a new commit in master\n  echo \"Pull rebase...\"\n  # git checkout $CIRCLE_BRANCH\n  # git merge master\n\n  # git pull <remote> <branch>\n  # git branch --set-upstream-to=origin/<branch> bottles\n\n  git checkout bottles\n  git rebase bottles\n  git checkout bottles\n  git merge bottles\n  \n  git pull ${SSH_REPO} $CIRCLE_BRANCH\n  git branch --set-upstream-to=origin/bottles bottles\n\n  git pull --rebase\n\n  # Now that we're all set up, we can push.\n  git push ${SSH_REPO} $CIRCLE_BRANCH\n\n  # echo \"Upload to Bintray...\"\n\n  cd /tmp/workspace/bottles/\n\n  # files=$(echo *.tar.gz | tr ' ' ',')\n  # curl -X PUT -T \"{$files}\" -u ${BINTRAY_USER}:${BINTRAY_API} -H \"X-Bintray-Publish: 1\" https://api.bintray.com/content/homebrew-osgeo/osgeo-bottles/bottles/0.1/\n\n  echo \"Upload Bottles...\"\n    # use ssh\n    # ssh-add -l\n    # echo -e \"\\nIdentityFile ~/.ssh/id_rsa\" >> ~/.ssh/config\n    # cat ~/.ssh/config\n    # ls ~/.ssh\n    # brew install https://raw.githubusercontent.com/hudochenkov/homebrew-sshpass/master/sshpass.rb\n    # sshpass -e scp -P 50023 -o stricthostkeychecking=no -r ./*.tar.gz fjperini@bottle.download.osgeo.org:/osgeo/bottle\n    scp -P 50023 -o stricthostkeychecking=no -r ./*.tar.gz fjperini@bottle.download.osgeo.org:/osgeo/bottle\nfi\n"
  },
  {
    "path": ".circleci/before_install.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac circle ci - before_install.sh\n#    ---------------------\n#    Date                 : Dec 2019\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer - FJ Perini\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\nset -o errexit\nset -o xtrace\n\nif [ \"$CIRCLE_BRANCH\" != \"master\" ]; then\nfor f in ${CHANGED_FORMULAE};do\n  echo 'Setting up, before install'\n  if [ -n \"${DEBUG_CI}\" ];then\n    brew list --versions\n  fi\n\n  # Forcibly remove all versions of unneeded default formula provided by travis or pre-cached\n  nix_f=\"\n  gdal\n  sip\n  pyqt\n  qscintilla2\n  postgresql@10\n  postgis\n  \"\n\n  for nf in ${nix_f}; do\n    brew uninstall --force --ignore-dependencies ${nf} || true\n  done\n\n  # brew update > /dev/null\n  # brew update - slow\n  # brew update-reset\n\n  # fix: Permission Denied When Creating Directory or Writing a File\n  # https://support.circleci.com/hc/en-us/articles/360003649774-Permission-Denied-When-Creating-Directory-or-Writing-a-File\n  # chown -R $USER:$USER /Users/distiller\n  # rm -rf /Users/distiller/.viminf*\n  # chown -R $USER: /Users/distiller\n\n  echo \"Homebrew setup for changed formula ${f}...\"\n  deps=$(brew deps --include-build ${f})\n  echo \"${f} dependencies:\"\n  echo \"${deps}\"\n\n  # Install XQuartz\n  if [ \"$(echo ${deps} | grep -c 'osgeo-grass')\" != \"0\" ] || [ \"$(echo ${deps} | grep -c 'osgeo-openscenegraph')\" != \"0\" ];then\n    echo \"one of the dependencies requires XQuartz, installing...\"\n    brew cask install xquartz\n  fi\n  if [ \"${f}\" == \"osgeo-grass\" ] || [ \"${f}\" == \"osgeo-openscenegraph\" ];then\n    echo \"${f} require of XQuartz, installing...\"\n    brew cask install xquartz\n  fi\n\n  if [ \"$(echo ${deps} | grep -c '[python|python]')\" != \"0\" ];then\n    echo \"Installing and configuring Homebrew Python 3\"\n    brew reinstall python\n\n    echo \"Link Python 3\"\n    # which python3\n    brew unlink python && brew link --overwrite --force python\n\n    # ls -l /usr/local/bin/python*\n    # rm /usr/local/bin/python*\n    # rm /usr/local/bin/pip*\n    # rm -Rf /Library/Frameworks/Python.framework/Versions/*\n    # export PATH=/usr/local/bin:/usr/local/sbin:$PATH\n    # export PATH=\"/usr/local/opt/python/libexec/bin:$PATH\"\n    # /usr/local/bin/python -V\n    # /usr/local/bin/pip -V\n    # cd /usr/local/bin\n    # ln -s python3 python\n    # ln -s pip3 pip\n\n\n    # Set up Python .pth files\n    # get python short version (major.minor)\n    PY_VER=$(/usr/local/opt/python/bin/python3 -c 'import sys;print(\"{0}.{1}\".format(sys.version_info[0],sys.version_info[1]))')\n    if [ -n \"${DEBUG_CI}\" ];then\n      echo $PY_VER\n    fi\n    mkdir -p ${CIRCLE_WORKING_DIRECTORY}/Library/Python/${PY_VER}/lib/python/site-packages\n\n    echo 'import site; site.addsitedir(\"/usr/local/lib/python${PY_VER}/site-packages\")' \\\n         >> ${CIRCLE_WORKING_DIRECTORY}/Library/Python/${PY_VER}/lib/python/site-packages/homebrew.pth\n    echo 'import site; site.addsitedir(\"/usr/local/opt/osgeo-gdal/lib/python${PY_VER}/site-packages\")' \\\n         >> ${CIRCLE_WORKING_DIRECTORY}/Library/Python/${PY_VER}/lib/python/site-packages/gdal2.pth\n\n    if [[ \"${f}\" =~ \"osgeo-gdal\" ]];then\n      echo \"Installing GDAL 2 Python 3 dependencies\"\n      /usr/local/opt/python/bin/pip3 install numpy\n    fi\n  fi\n\n  # Special handling of osgeo-grass, because it needs to be unlinked\n  if [ \"$(echo ${deps} | grep -c 'osgeo-grass')\" != \"0\" ];then\n    echo \"Installing and unlinking grass7\"\n    # GDAL gets its numpy installed via pip, but grass also has a dependency, so we need to force it.\n    brew install numpy || brew link --overwrite numpy\n    brew install osgeo-grass\n    brew unlink osgeo-grass\n  fi\n\n  if [ \"${f}\" == \"osgeo-vtk\" ] || [ \"${f}\" == \"osgeo-insighttoolkit\" ] || [ \"${f}\" == \"osgeo-insighttoolkit@4\" ] || [ \"${f}\" == \"osgeo-pcl\" ] || [ \"${f}\" == \"osgeo-pdal\" ] || [ \"${f}\" == \"osgeo-ossim\" ] || [ \"${f}\" == \"osgeo-orfeo\" ];then\n    echo \"Installing jpeg-turbo\"\n    # osgeo-vtk: Java 1.8 is required to install this formula.\n    # Install AdoptOpenJDK 8 with Homebrew Cask:\n    # brew cask install homebrew/cask-versions/adoptopenjdk8\n    brew install jpeg-turbo\n    brew unlink jpeg-turbo && brew link --force jpeg-turbo\n  fi\ndone\nfi\n"
  },
  {
    "path": ".circleci/changed_formulas.sh",
    "content": "#!/usr/bin/env bash\nset -e\n\nif [ \"$CIRCLE_BRANCH\" != \"master\" ]; then\n# manually added by env var. Will not be filtered by skip-formulas.txt\n# If manual formulae are specified, changed files will be ignored\n# This avoids rebuilding bottles when triggered against master\nif [[ -n ${CI_MANUAL_FORMULAE} ]]; then\n\techo \"${CI_MANUAL_FORMULAE}\"\nelse\n\n\t  if [[ ! -z  $CIRCLE_PULL_REQUEST  ]]; then\n\t\t# if on a PR, just analyze the changed files\n\t\tFILES=$(git diff --diff-filter=AM --name-only $(git merge-base origin/master ${CIRCLE_BRANCH} ) )\n\telse\n        # Get the commit range for the build\n        # For workflows, we can't use the CIRCLE_COMPARE_URL feature, so we do it by manualy diffing the branch\n#      COMMIT_RANGE=$(echo \"${CIRCLE_COMPARE_URL}\" | cut -d/ -f7)\n\n#      if [[ $COMMIT_RANGE != *\"...\"* ]]; then\n#          COMMIT_RANGE=\"${COMMIT_RANGE}...${COMMIT_RANGE}\"\n        #      fi\n        # Since CircleCI doesn't currently support getting a range of commits when running as a workflow, we're stuck just looking at the changes from the most recent commit.\n        # This means we always needs to rebase or squash and merge, which is mostly what we do anyways.\n\t\t    #FILES=$(git diff --diff-filter=AM --name-only master...${CIRCLE_BRANCH} )\n        \tFILES=$(git diff --diff-filter=AM --name-only master^1 )\n\tfi\n\n\tFORMULAS=\n\tfor f in $FILES;do\n\t\tFORMULAS=\"$FORMULAS $(echo $f | sed -n -E 's#^Formula/(.+)\\.rb$#\\1#p')\"\n\tdone\n\n\t# keep formulas only\n\t#FORMULAS=$(sed -n -E 's#^Formula/(.+)\\.rb$#\\1#p' <<< $FILES)\n\t# skip formulas\n  comm -1 -3 <(cat .circleci/skip-formulas.txt | sort -u ) <(echo ${FORMULAS} | tr ' ' '\\n' | sort -u )\nfi\nfi\n"
  },
  {
    "path": ".circleci/config.yml",
    "content": "# Supported Xcode Versions\n# https://circleci.com/docs/2.0/testing-ios/\n# 10.15 - 11.3.0 - Catalina\n# 10.14 - 11.1.0 - Mojave\n# 10.13 - 10.1.0 - HS\n# 10.12 - 9.0.1  - Sierra\n\nbuild_steps: &build_steps\n  steps:\n    - run:\n       name: Homebrew config\n       command: |\n         brew --version\n         brew remove $(brew list)\n         rm -rf /usr/local/Homebrew/Library/Taps/\n         brew update-reset\n         brew --env\n         brew config\n    - checkout\n    - run:\n       name: Git config\n       command: |\n         git checkout $CIRCLE_BRANCH\n         git remote set-url origin $CIRCLE_REPOSITORY_URL\n         git fetch origin\n         git config --global user.name \"geo-ninja\"\n         git config --global user.email \"qgisninja@gmail.com\"\n         repo=$(brew --repo $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME)\n         mkdir -p $repo\n         cp -a ./ $repo/\n    - run:\n       name: Update environment variables\n       command: .circleci/set_env.sh\n    - run:\n       name: Before install\n       command: .circleci/before_install.sh\n    - run:\n       name: Install dependencies\n       command: .circleci/install.sh\n    - run:\n        name: Install changed formulae\n        command: .circleci/script.sh\n    - run:\n        name: Build bottles\n        no_output_timeout: 30m\n        command: |\n          .circleci/after_script.sh\n          # fix if the formula does not change or if a file is updated/uploaded\n          # echo \"${CIRCLE_BUILD_NUM}\" > /tmp/bottles/build-num-${CIRCLE_BUILD_NUM}.txt\n          echo \"FIX\" > /tmp/bottles/fix.txt\n    - persist_to_workspace:\n        root: /tmp\n        paths:\n          - bottles/*\n    - store_test_results:\n        path: /tmp/bottles\n\nworkflow_filter: &filter\n  filters:\n    branches:\n      ignore:\n        - master\n      only:\n        - bottles\n        - /^(?!pull\\/).*$/\n\nversion: 2\njobs:\n  update-homebrew:\n    macos:\n      xcode: \"10.1.0\"\n    steps:\n      - restore_cache:\n          keys:\n            - homebrew-v1-{{ .Branch }}-{{ .Revision }}\n            - homebrew-v1-{{ .Branch }}-\n            - homebrew-v1-\n      - run:\n          name: \"Update homebrew\"\n          command: |\n            brew update-reset\n      - save_cache:\n          key: homebrew-v1-{{ .Branch }}-{{ .Revision }}\n          paths:\n            - /usr/local/Homebrew/Library/Taps/homebrew\n\n  # catalina-build:\n  #   <<: *build_steps\n  #   <<: *filter\n  #   macos:\n  #     xcode: \"11.3.0\"\n\n  # mojave-build:\n  #   <<: *build_steps\n  #   <<: *filter\n  #   macos:\n  #     xcode: \"11.1.0\"\n\n  high_sierra-build:\n    <<: *build_steps\n    <<: *filter\n    macos:\n      xcode: \"10.1.0\"\n\n  # sierra-build:\n  #   <<: *build_steps\n  #   <<: *filter\n  #   macos:\n  #     xcode: \"9.0.1\"\n\n  collect-bottles:\n    macos:\n      xcode: \"10.1.0\"\n    steps:\n      - attach_workspace:\n          at: /tmp/workspace\n      - checkout\n      - run:\n         name: Update environment variables\n         command: |\n           .circleci/set_env.sh\n      - run:\n         name: Git config\n         command: |\n           git config --global user.name \"geo-ninja\"\n           git config --global user.email \"qgisninja@gmail.com\"\n      # fix for ERROR: The key you are authenticating with has been marked as read only.\n      # is using the first key that is found, the one assigned in Checkout keys\n      # not Add deploy key (Checkout keys)\n      # Add deployment key fingerprint (SSH Permissions) for CircleCI to use for a push\n      # ssh-keygen -l -E md5 -f key.pub\n      - add_ssh_keys:\n          fingerprints:\n            - \"${KEY_FINGERPRINT_OSGEO}\"\n            - \"${KEY_FINGERPRINT}\"\n      - run:\n          name: Avoid hosts unknown for github\n          command: |\n            echo -e \"Host github.com\\n\\tStrictHostKeyChecking no\\n\" > ~/.ssh/config\n\n      - run:\n          name: Commit for new bottles and upload to bintray\n          command: .circleci/before_deploy.sh\n      - store_artifacts:\n          path: /tmp/workspace/bottles\n          destination: bottles\n\n  # deploy:\n  #   macos:\n  #     xcode: \"10.1.0\"\n  #   steps:\n  #     - checkout\n  #     - run:\n  #         name: Deploy - Upload to bintray\n  #         command: |\n  #           cd /tmp/workspace/bottles\n  #           brew install jfrog-cli-go\n  #           jfrog bt config --user=${BINTRAY_USER} --key=${BINTRAY_API} --licenses=MIT\n  #           echo \"jfrog\" > jfrog-deploy.txt\n  #           jfrog bt upload --publish=true \"jfrog-deploy.txt\" homebrew-osgeo/osgeo-bottles/bottles/0.1/\n  #           # jfrog bt upload --publish=true \"/tmp/workspace/bottles/*\" homebrew-osgeo/osgeo-bottles/bottles/0.1/\n  #     - store_artifacts:\n  #         path: /tmp/workspace/bottles\n  #         destination: bottles\n\nworkflows:\n  version: 2\n  build-deploy:\n    jobs:\n      - update-homebrew:\n          filters:\n            branches:\n              ignore:\n                - master\n              only:\n                - bottles\n                - /^(?!pull\\/).*$/\n      # - catalina-build:\n      #     requires:\n      #       - update-homebrew\n      # - mojave-build:\n      #     requires:\n      #       - update-homebrew\n      - high_sierra-build:\n          requires:\n            - update-homebrew\n          filters:\n            branches:\n              ignore:\n                - master\n              only:\n                - bottles\n                - /^(?!pull\\/).*$/\n      # - sierra-build:\n      #     requires:\n      #       - update-homebrew\n      - collect-bottles:\n            # - catalina-build\n            # - mojave-build\n          requires:\n            - high_sierra-build\n          filters:\n            branches:\n              ignore:\n                - master\n              only:\n                - bottles\n                - /^(?!pull\\/).*$/\n            # - sierra-build\n      # - deploy:\n      #     requires:\n      #       - collect-bottles\n      #     filters:\n      #       branches:\n      #         only: master\n"
  },
  {
    "path": ".circleci/install.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac circle ci - install.sh\n#    ---------------------\n#    Date                 : Dec 2019\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer - FJ Perini\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\nset -e\nulimit -n 1024\n\nif [ \"$CIRCLE_BRANCH\" != \"master\" ]; then\ngit checkout bottles\n\nfor f in ${CHANGED_FORMULAE};do\n  echo \"Installing dependencies for changed formula ${f}...\"\n  FLAGS=\"--only-dependencies --build-bottle\"\n\n  brew install ${FLAGS} ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/${f}&\n  PID=$!\n  # add progress to ensure Travis doesn't complain about no output\n  while true; do\n    sleep 30\n    if jobs -rp | grep ${PID} >/dev/null; then\n      echo \".\"\n    else\n      echo\n      break\n    fi\n  done\ndone\nfi\n"
  },
  {
    "path": ".circleci/script.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac circle ci - script.sh\n#    ---------------------\n#    Date                 : Dec 2019\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer - FJ Perini\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\nset -e\n\nulimit -n 1024\n\nif [ \"$CIRCLE_BRANCH\" != \"master\" ]; then\ngit checkout bottles\n\necho ${CHANGED_FORMULAE}\n\nfor f in ${CHANGED_FORMULAE};do\n  deps=$(brew deps --include-build ${f})\n\n  # fix error: Unable to import PyQt5.QtCore\n  # build qscintilla2\n  if [ \"$(echo ${deps} | grep -c 'osgeo-pyqt')\" != \"0\" ];then\n    brew reinstall ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/osgeo-pyqt\n    brew unlink osgeo-pyqt && brew link osgeo-pyqt --force\n    /usr/local/opt/python/bin/python3 -c \"import PyQt5.QtCore\"\n  fi\n\n  # fix error: 'libintl.h' file not found\n  # build qgis with grass\n  if [ \"$(echo ${deps} | grep -c 'osgeo-grass')\" != \"0\" ] || [ \"${f}\" == \"osgeo-grass\" ];then\n    brew reinstall gettext\n    brew unlink gettext && brew link --force gettext\n  fi\n\n  if [ \"${f}\" == \"osgeo-grass\" ];then\n    brew unlink osgeo-liblas && brew link osgeo-liblas --force\n  fi\n\n  # Error: The `brew link` step did not complete successfully\n  # The formula built, but is not symlinked into /usr/local\n  # Could not symlink lib/pkgconfig/libopenjp2.pc\n  # Target /usr/local/lib/pkgconfig/libopenjp2.pc\n  # is a symlink belonging to openjpeg\n  if [ \"$(echo ${deps} | grep -c 'osgeo-insighttoolkit')\" != \"0\" ] || [ \"${f}\" == \"osgeo-insighttoolkit\" ];then\n    brew unlink openjpeg\n  fi\n\n  if [ \"$(echo ${deps} | grep -c 'osgeo-insighttoolkit@4')\" != \"0\" ] || [ \"${f}\" == \"osgeo-insighttoolkit@4\" ];then\n    brew unlink openjpeg\n  fi\n\n  # fix test\n  # initdb: could not create directory \"/usr/local/var/postgresql\": Operation not permitted\n  if [ \"${f}\" == \"osgeo-libpqxx\" ];then\n    initdb /usr/local/var/postgresql -E utf8 --locale=en_US.UTF-8\n    # pg_ctl -D /usr/local/var/postgresql -l logfile start\n    brew services start osgeo/osgeo4mac/osgeo-postgresql\n    # system \"psql\", \"-h\", \"localhost\", \"-d\", \"postgres\"\n    # createdb template1\n  fi\n\n  # mapnik - error high_sierra-build\n  # Exiting... the following required dependencies were not found:\n  #  - boost regex (more info see: https://github.com/mapnik/mapnik/wiki/Mapnik-Installation & http://www.boost.org)\n  # Also, these OPTIONAL dependencies were not found:\n  #  - boost program_options (more info see: https://github.com/mapnik/mapnik/wiki/Mapnik-Installation & http://www.boost.org)\n  #  - boost_regex_icu (libboost_regex built with optional ICU unicode support is needed for unicode regex support in mapnik.)\n  #  - gdal (GDAL C++ library | configured using gdal-config program | try setting GDAL_CONFIG SCons option | more info: https://github.com/mapnik/mapnik/wiki/GDAL)\n  if [ \"${f}\" == \"osgeo-mapnik\" ];then\n    brew unlink boost && brew link boost --force\n  fi\n  # if SVG2PNG=True\n  # Error: Failed changing install name in /usr/local/Cellar/osgeo-mapnik/3.0.22_2/bin/svg2png\n  # from /usr/local/opt/boost/lib/libboost_system.dylib\n  # to @@HOMEBREW_PREFIX@@/opt/boost/lib/libboost_system.dylib\n  # Error: Updated load commands do not fit in the header of\n  # /usr/local/Cellar/osgeo-mapnik/3.0.22_2/bin/svg2png. /usr/local/Cellar/osgeo-mapnik/3.0.22_2/bin/svg2png\n  # needs to be relinked, possibly with -headerpad or -headerpad_max_install_names\n\n  # if [[ $(brew list --versions ${f}) ]]; then\n  #   echo \"Clearing previously installed/cached formula ${f}...\"\n  #   brew uninstall --force --ignore-dependencies ${f} || true\n  # fi\n\n  echo \"Installing changed formula ${f}...\"\n  # Default installation flag set\n  FLAGS=\"--build-bottle\"\n\n  brew install -v ${FLAGS} ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/${f}&\n  PID=$!\n  # add progress to ensure Travis doesn't complain about no output\n  while true; do\n    sleep 30\n    if jobs -rp | grep ${PID} >/dev/null; then\n      echo \".\"\n    else\n      echo\n      break\n    fi\n  done\n\n  echo \"Testing changed formula ${f}...\"\n  # does running postinstall mess up the bottle?\n  # (mentioned that it is skipped if installing with --build-bottle)\n  # brew postinstall ${f}\n  brew test ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/${f}\ndone\nfi\n"
  },
  {
    "path": ".circleci/set_env.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac circle ci - script.sh\n#    ---------------------\n#    Date                 : Dec 2019\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer -  FJ Perini\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\nset -e\n\nif [ \"$CIRCLE_BRANCH\" != \"master\" ]; then\nulimit -c unlimited\n           ulimit -n 2048\n           export CHANGED_FORMULAE=$(.circleci/changed_formulas.sh)\n           if [ \"$CHANGED_FORMULAE\" == \"\" ]; then\n             echo \"Skipping CI, no changed formulae found\";\n             exit 0;\n           else\n             echo \"Changed formulae are ${CHANGED_FORMULAE}\";\n           fi\n           export HOMEBREW_REPOSITORY=$(brew --repo)\n           git -C \"${HOMEBREW_REPOSITORY}\" fetch\n           git -C \"${HOMEBREW_REPOSITORY}\" reset --hard origin/master\n           mkdir -p \"${HOMEBREW_REPOSITORY}/Library/Taps/${CIRCLE_PROJECT_USERNAME}\"\n           echo \"Linking ${CIRCLE_WORKING_DIRECTORY}\" to \"${HOMEBREW_REPOSITORY}/Library/Taps/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}\"\n           ln -s \"${HOME}/project\" \"${HOMEBREW_REPOSITORY}/Library/Taps/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}\"\n           echo \"export CHANGED_FORMULAE=${CHANGED_FORMULAE}\" >> $BASH_ENV\n           echo \"export HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY\" >> $BASH_ENV\n           echo 'export HOMEBREW_DEVELOPER=1' >> $BASH_ENV\n           echo 'export HOMEBREW_NO_AUTO_UPDATE=1' >> $BASH_ENV\n           echo 'export HOMEBREW_PREFIX=/usr/local' >> $BASH_ENV\n           echo 'export CIRCLE_REPOSITORY_URL=https://github.com/OSGeo/homebrew-osgeo4mac' >> $BASH_ENV\n           echo 'export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)' >> $BASH_ENV\nfi\n"
  },
  {
    "path": ".circleci/skip-formulas.txt",
    "content": "ossgeo-gdal-ecwjp2\nosgeo-gdal-oracle\nosgeo-gdal-mrsid\ngpkgtools\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report about a problem you've come across\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Please answers the following**\n\nI've... \n- I read\n\t- [ ] the [reporting issues](https://osgeo.github.io/homebrew-osgeo4mac/docs/reporting-issues/)\n\t- [ ] the [troubleshooting](https://osgeo.github.io/homebrew-osgeo4mac/docs/troubleshooting/)\n- [ ] I checked the documentation and found no answer\n- [ ] I tried to install after following the suggestions\n- [ ] I am running the latest version (`brew update` twice?)\n- [ ] I checked to make sure that this issue has not already been filed\n- [ ] I uploaded logs: `brew gist-logs formula`\n\n**Describe the bug**\n\n<!-- A clear and concise description of what the bug is. -->\n\n**To Reproduce**\n\nSteps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**Expected behavior**\n\n<!-- A clear and concise description of what you expected to happen. -->\n\n**Screenshots**\n\n<!-- If applicable, add screenshots to help explain your problem. -->\n\n**Additional context**\n\n<!-- Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. Run a `brew doctor` and paster the output below could be a good idea. -->\n\n`brew doctor` output: \n\n```shell\n# paste here the output of your brew doctor output. Delete this line please. \n```\n\n**Logs**\n\n<!-- Please include the link to the uploaded gist here.  -->\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Is your feature request related to a problem? Please describe.**\n\n<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->\n\n**Describe the solution you'd like**\n\n<!-- A clear and concise description of what you want to happen. -->\n\n**Describe alternatives you've considered**\n\n<!-- A clear and concise description of any alternative solutions or features you've considered. -->\n\n**Additional context**\n\n<!-- Add any other context or screenshots about the feature request here. -->\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "# Description\n\nPlease include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.\n\nFixes # (issue)\n\n## Type of change\n\nPlease delete options that are not relevant.\n\n- [ ] Bug fix (non-breaking change which fixes an issue)\n- [ ] New feature (non-breaking change which adds functionality)\n- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)\n- [ ] This change requires a documentation update\n\n# How Has This Been Tested?\n\nPlease describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration\n\n- [ ] Test A\n- [ ] Test B\n\n**Test Configuration**:\n* Hardware:\n* Operating System:\n\n# Checklist:\n\n- [ ] My code follows the style guidelines of this project\n- [ ] I have performed a self-review of my own code\n- [ ] I have commented my code, particularly in hard-to-understand areas\n- [ ] I have made corresponding changes to the documentation\n- [ ] My changes generate no new warnings\n- [ ] I have added tests that prove my fix is effective or that my feature works\n- [ ] New and existing unit tests pass locally with my changes\n- [ ] Any dependent changes have been merged and published in downstream modules"
  },
  {
    "path": ".github/stale.yml",
    "content": "# Configuration for probot-stale - https://github.com/probot/stale\n\n# Number of days of inactivity before an Issue or Pull Request becomes stale\ndaysUntilStale: 30\n\n# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.\n# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.\ndaysUntilClose: 7\n\n# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable\nexemptLabels:\n  - \"pinned :pushpin:\"\n  - \"security :lock:\" \n  - \"maybe later :hourglass_flowing_sand:\"\n\n# Set to true to ignore issues in a project (defaults to false)\nexemptProjects: false\n\n# Set to true to ignore issues in a milestone (defaults to false)\nexemptMilestones: false\n\n# Set to true to ignore issues with an assignee (defaults to false)\nexemptAssignees: false\n\n# Label to use when marking as stale\nstaleLabel: \"stale :zzz:\"\n\n# Comment to post when marking as stale. Set to `false` to disable\nmarkComment: >\n  This issue or pull request has been automatically marked as stale because it has not had \n  recent activity. It will be closed if no further activity occurs. \n  If you want to keep the issue open, please comment or update the info here. \n  Thank you for your contributions.\n\n# Comment to post when removing the stale label.\n# unmarkComment: >\n#   Your comment here.\n\n# Comment to post when closing a stale Issue or Pull Request.\ncloseComment: >\n  This issue or pull request has been automatically closed because it has not had \n  recent activity. Thank you for your contributions.\n\n# Limit the number of actions per hour, from 1-30. Default is 30\nlimitPerRun: 30\n\n# Limit to only `issues` or `pulls`\n# only: issues\n\n# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':\n# pulls:\n#   daysUntilStale: 30\n#   markComment: >\n#     This pull request has been automatically marked as stale because it has not had\n#     recent activity. It will be closed if no further activity occurs. Thank you\n#     for your contributions.\n\n# issues:\n#   exemptLabels:\n#     - confirmed\n"
  },
  {
    "path": ".gitignore",
    "content": "*.orig\n\n.idea/\n**/*.iml\n\n/docs/_site\n/docs/.jekyll-metadata\n/docs/.sass-cache\n/docs/Gemfile.lock\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: ruby\nrvm:\n  - 2.3.7\n# language: python\n# python:\n#  - \"2.7\"\nos: osx\nenv: OSX=10.12\nosx_image: xcode8.3\nsudo: required\n\nbranches:\n  except:\n    - circleci\n\n# /usr/local subdirs are Homebrew components\n# cache:\n#  directories:\n#    - $HOME/Library/Caches/pip\n#    - /usr/local/Cellar\n#    - /usr/local/Frameworks\n#    - /usr/local/Homebrew\n#    - /usr/local/bin\n#    - /usr/local/etc\n#    - /usr/local/include\n#    - /usr/local/lib\n#    - /usr/local/opt\n#    - /usr/local/share\n#    - /usr/local/var\n#  timeout: 900\n# before_cache:\n#  - ./travis/before_cache.sh\n\naddons:\n  ssh_known_hosts: github.com\n\nbefore_install:\n  - gem update --system\n  - gem install bundler\n\n  - export GH_USER=$(echo -n \"${TRAVIS_REPO_SLUG}\" | egrep -o '^[^/]+' | tr -d '\\n')\n  - export TRAVIS_COMMIT=\"$(git rev-parse --verify -q HEAD)\"\n  - export CHANGED_FORMULAE=$(./travis/changed_formulas.sh)\n  - if [ \"${CHANGED_FORMULAE}\" == \"\" ]; then\n      echo \"Skipping CI; no changed formulae found in $TRAVIS_BUILD_DIR\";\n      exit 0 || true;\n      travis_terminate 0;\n      exit 1;\n    else\n      echo \"Changed formulae are ${CHANGED_FORMULAE}\";\n    fi\n  - if [ \"${CHANGED_FORMULAE}\" == \"osgeo-qt-webkit\" ] || [ \"${CHANGED_FORMULAE}\" == \"osgeo-qgis\" ] || [ \"${CHANGED_FORMULAE}\" == \"osgeo-qgis-ltr\" ]|| [ \"${CHANGED_FORMULAE}\" == \"osgeo-vtk\" ]|| [ \"${CHANGED_FORMULAE}\" == \"osgeo-insighttoolkit\" ]; then\n      echo \"Skipping CI; These formulas exceed the time limit in Travis CI.\";\n      exit 0 || true;\n      travis_terminate 0;\n      exit 1;\n    fi\n  - export HOMEBREW_REPOSITORY=\"$(brew --repo)\"\n  - sudo chown -R \"$USER\":admin \"${HOMEBREW_REPOSITORY}\"\n  - git -C \"${HOMEBREW_REPOSITORY}\" reset --hard origin/master\n  - mkdir -p \"${HOMEBREW_REPOSITORY}/Library/Taps/${GH_USER}\"\n  - ln -s \"$TRAVIS_BUILD_DIR\" \"${HOMEBREW_REPOSITORY}/Library/Taps/${TRAVIS_REPO_SLUG}\"\n  - cd \"${HOMEBREW_REPOSITORY}/Library/Taps/${TRAVIS_REPO_SLUG}\"\n  - chmod -f 0644 ${HOMEBREW_REPOSITORY}/Library/Taps/${TRAVIS_REPO_SLUG}/Formula/*.rb\n  - export TRAVIS_BUILD_DIR=\"${HOMEBREW_REPOSITORY}/Library/Taps/${TRAVIS_REPO_SLUG}\"\n  - export HOMEBREW_DEVELOPER=1\n  - export HOMEBREW_NO_AUTO_UPDATE=1\n  - export HOMEBREW_PREFIX=$(brew --prefix)\n  - ulimit -n 1024\n  - ./travis/before_install.sh\n\ninstall: ./travis/install.sh\n\n# before_script: ./travis/before_script.sh\n\nscript: ./travis/script.sh\n\nafter_script: ./travis/after_script.sh\n\nbefore_deploy:\n  # Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc\n  # Decrypt the travis_deploy_key.enc key into /tmp/travis_deploy_key\n  - openssl aes-256-cbc -K $encrypted_key -iv $encrypted_iv -in travis_deploy_key.enc -out /tmp/travis_deploy_key -d\n  # Make sure only the current user can read the private key\n  - chmod 600 /tmp/travis_deploy_key\n  # Create a script to return the passphrase environment variable to ssh-add\n  - echo 'echo ${SSH_PASSPHRASE}' > /tmp/askpass && chmod +x /tmp/askpass\n  # Start the authentication agent\n  - eval \"$(ssh-agent -s)\"\n  # Add the key to the authentication agent\n  - brew install util-linux # for setsid\n  - DISPLAY=\":0.0\" SSH_ASKPASS=\"/tmp/askpass\" setsid ssh-add /tmp/travis_deploy_key </dev/null\n  # add changes\n  - ./travis/before_deploy.sh\n\n\n# is disabled to use Circle CI\n\n# deploy:\n#   skip_cleanup: true\n#   provider: bintray\n#   file: travis/bintray-upload.json\n#   user: nickrobison\n#   key:\n#     secure: \"nEmP/uU8N+TbbX3zWED62CsjPxoDjXcOF3RtAENW/4qVBdI9r7dFmyE4WAW732Ttd1PbANPz7Lz494j2TS2hbn2R4yQ9CuIllsnjey/ve6TAq1FfYSruBuMGLK/7EJ/cSfZWsOBex7b68UeVlvyAra3ck6y9j1ouzF9RKEtCx3P/w3heLN5Fl0pNUCzwknrdBFGfTQRy8NSQnYo/8mpIQbCrXEQThJ4PZY/7s5tqDOv3tAesPTdoGmoNWWBoQe8ZnrwSutskcm6Nsf5nz64i44vai9Xx+9U3QpHDvzuAXOzwxFBGk1dfsnLRp/P71QrDYuqnMEExmfdZAWYK0o0JLuwsecOfSvG2C14fAp1rA2GNWMK9SViYxeYnJgwenGgd7FBci6N052mvyv3+52xGc7aHUlp74PvqYEv8LoILdOlG9jGj1jS41seQyW7Qyg6VYfQ+f1Vp4kUupH3EE53QgJzM6rVyFI9qmkThJTN0ZhUzIhwrTqUfceMkWyeYKd7/hk6AUxhYNZehtR7xH8pf1vibLifUr978M4vyutSwJ4xnaJKTvuUdA0d2GQHAuEDwfqPlYcIUDbKOVmbKj+SifKdSlcwGTYunzmKkJskA9DzYIbUjKe00jluAvjGZuoCIbIKdqlH1ntTUoW5OCpE09TmIZdh/SURRKo7QsfLNQ0I=\"\n#   # S3 bucket upload, which is not working right now\n#   # provider: s3\n#   # access_key_id:\n#   #   secure: JxG4/zxgbYvKqX4kJTZdQxvAL+EHqmmi4OEjAOY+KUFAP4t9l5aLEYh6brjHF07kDyFyjMt8G7Hf+SZeznA/JGe8NaliXfCnxLH7ftApCP3l/Tl73z3wXnGL1L7EljiO0EbwlsJUM23B+01BMalzBfyLYOEc61LfSuJsEFFa/ck=\n#   # secret_access_key:\n#   #   secure: ZdsR1FsY6ER6w6KvF9rjxY4s7GjLXRkT9Rmv4GWyL9+pcHI/4/2KMfab6gj1sQdbc2ocfBgGXR8hQZHi+NZPyTnHbIXf5n2YenLo9NyOHwNs1qiJgxXgtYvhtI/NXCcD9JgX5i5BRR3jkPqJBRe70CmoTwv29kR5Tp158tr3gIg=\n#   # bucket: osgeo4mac\n#   # local-dir: bottles\n#   # upload-dir: bottles\n#   # acl: public_read\n#   on:\n#     branch: master\n#     repo: OSGeo/homebrew-osgeo4mac\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Code of conduct\n\nThis code of conduct governs how we behave in any OSGeo forum or event and whenever we will be judged by our actions. We expect it to be honored by everyone who participates in the OSGeo community formally or informally, or claims any affiliation with the OSGeo Foundation.\n\nVersion: 1.0 | Date: May 2015\n\n### Introduction\n\nThis code of conduct governs how we behave in any OSGeo forum or event and whenever we will be judged by our actions. We expect it to be honored by everyone who participates in the OSGeo community formally or informally, or claims any affiliation with the OSGeo Foundation.\n\nIt applies to in-person events (such as conferences and related social events), IRC, public and private mailing lists, the issue tracker, the wiki, blogs, Twitter, and any other forums which the community uses for communication and interactions.\n\nThis code is not exhaustive or complete. It serves to distill our common understanding of a collaborative, shared environment and goals. We expect it to be followed in spirit as much as in the letter, so that it can enrich all of us and the technical communities in which we participate.\n\n### Diversity Statement\n\nOSGeo welcomes and encourages participation by everyone. We are committed to being a community that everyone feels good about joining, and we will always work to treat everyone well. No matter how you identify yourself or how others perceive you: we welcome you.\n\n### Specific Guidelines\n\nWe strive to:\n\n* **Be open**.\n\n  We invite anyone to participate in our community. We preferably use **public methods of communication** for project-related messages, unless discussing something sensitive. This applies to messages for help or project-related support, too; not only is a public support request much more likely to result in an answer to a question, it also makes sure that any inadvertent mistakes made by people answering will be more easily detected and corrected.\n\n* **Be empathetic, welcoming, friendly, and patient**.\n\n  We work together to resolve conflict, assume good intentions, and do our best to act in an empathetic fashion. We may all experience some frustration from time to time, but we do not allow frustration to turn into a personal attack. A community where people feel uncomfortable or threatened is not a productive one. Note that we have a multi-cultural, multi-lingual community and some of us are non-native speakers. We should **be respectful when dealing with other community members as well as with people outside our community**.\n\n* **Be collaborative**.\n\n  Our work will be used by other people, and in turn we will depend on the work of others. When we make something for the benefit of OSGeo, we are willing to explain to others how it works, so that they can build on the work to make it even better. Any decision we make will affect users and colleagues, and we take those consequences seriously when making decisions.\n\n* **Be inquisitive**.\n\n  **Nobody knows everything!** Asking questions early avoids many problems later, so questions are encouraged, though they may be directed to the appropriate forum. Those who are asked should be responsive and helpful, within the context of our shared goal of improving OSGeo.\n\n* **Be careful in the words that we choose**.\n\n  Whether we are participating as professionals or volunteers, we value professionalism in all interactions, and take responsibility for our own speech. Be kind to others. Do not insult or put down other participants.\n\n* **Be concise**.\n\n  Keep in mind that what you write once will be read by hundreds of persons. Writing a **short** email means people can understand the conversation as efficiently as possible. Short emails should always strive to be empathetic, welcoming, friendly and patient. When a long explanation is necessary, consider adding a summary.\n\n* **Step down considerately**.\n\n  Members of every project come and go. When somebody leaves or disengages from the project they should tell people they are leaving and take the **proper steps to ensure that others can pick up where they left off**. In doing so, they should remain respectful of those who continue to participate in the project and should not misrepresent the project’s goals or achievements. Likewise, community members should respect any individual’s choice to leave the project.\n\n### Anti-Harassment\n\nHarassment and other exclusionary behaviour are not acceptable. This includes, but is not limited to:\n\n* Personal insults or discriminatory jokes and language, especially those using racist or sexist terms.\n* Offensive comments, excessive or unnecessary profanity.\n* Intimidation, violent threats or demands.\n* Sustained disruption of sessions or events.\n* Stalking, harassing photography or recording.\n* Unwelcome physical contact or sexual attention.\n* Repeated harassment of others. In general, if someone asks you to stop, then stop.\n* Posting (or threatening to post) other people’s personally identifying information (“doxing”).\n* Sharing private content, such as emails sent privately or non-publicly, or unlogged forums such as IRC channel history.\n* Advocating for, or encouraging, any of the above behaviour.\n\n### Reporting Guidelines\n\nIf you believe someone is breaking this code of conduct, you may reply to them, and point to this code of conduct. Such messages may be in public or in private, whatever is most appropriate. Assume good faith; it is more likely that participants are unaware of their bad behaviour than that they intentionally try to degrade the quality of the discussion. Should there be difficulties in dealing with the situation, you may report your concerns to event staff, a forum leader or the OSGeo Board. Serious or persistent offenders may be expelled from the event or forum by event organizers or forum leaders.\n\n### Application\n\nAll OSGeo projects and events should reference this Code of Conduct using text similar to:\n\n*Contributors to homebrew-osgeo4mac project are expected to act respectfully toward others in accordance with the http://www.osgeo.org/code_of_conduct.*"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to Homebrew-osgeo4mac\n\nFirst time contributing to Homebrew-osgeo4mac? Read our [Code of Conduct](CODE_OF_CONDUCT.md).\n\n## How...\n\n### To report a bug\n\n* Run `brew update` (twice). \n* Run and read `brew doctor`. \n* Read [the Hombrew Troubleshooting Checklist](https://docs.brew.sh/Troubleshooting). \n* Read the how to [report issues](https://github.com/OSGeo/homebrew-osgeo4mac/wiki/Reporting-issues) and the [troubleshooting](https://github.com/OSGeo/homebrew-osgeo4mac/wiki/Troubleshooting).  \n* [Search](https://github.com/OSGeo/homebrew-osgeo4mac/issues) for same issue or similar to yours in the repo. \n* If there is no similar issue, open or closed, [open an issue](https://github.com/OSGeo/homebrew-osgeo4mac/issues/new/choose) on the repo.\n\n### To submit a version upgrade for the `foo` formula\n\n* Check if the same upgrade has been already submitted by [searching the open pull requests for `foo`](https://github.com/OSGeo/Homebrew-osgeo4mac/pulls?utf8=✓&q=is%3Apr+is%3Aopen+foo).\n* `brew bump-formula-pr --strict foo` with `--url=...` and `--sha256=...` or `--tag=...` and `--revision=...` arguments.\n\n### To add a new formula for `foo` version `2.3.4` from `$URL`\n\n* Read [the Formula Cookbook](https://docs.brew.sh/Formula-Cookbook) or: `brew create $URL` and make edits\n* `brew install --build-from-source foo`\n* `brew audit --new-formula foo`\n* `git commit` with message formatted `foo 2.3.4 (new formula)`\n* [Open a pull request](https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request) and fix any failing tests\n\n### To contribute with a fix to the `foo` formula\n\n#### You already know about Git\n\nIf you are already well versed in the use of `git`, then you can find the local\ncopy of the `homebrew-core` repository in this directory\n(`$(brew --repository homebrew/core)`), modify the formula there\nleaving the section `bottle do ... end` unchanged, and prepare a pull request\nas you usually do.  Before submitting your pull request, be sure to test it\nwith these commands:\n\n```shell\n$ brew uninstall --force foo\n$ brew install --build-from-source foo\n$ brew test foo\n$ brew audit --strict foo\n```\n\nAfter testing, if you think it is needed to force the corresponding bottles to be\nrebuilt and redistributed, add a line of the form `revision 1` to the formula,\nor add 1 to the revision number already present.\n\n#### You don't know about Git\n\nIf you are not already well versed in the use of `git`, then you may learn\na little bit about it from the [Homebrew's documentation](https://docs.brew.sh/How-To-Open-a-Homebrew-Pull-Request) and then proceed as\nfollows:\n\n* Run `brew edit foo` and make edits.\n* Leave the section `bottle do ... end` unchanged.\n* Test your changes using the commands listed above.\n* Run `git commit` with message formatted `foo <insert new version number>` or `foo: <insert details>`. \n* Open a pull request as described in the introduction linked to above, wait for the automated test results, and fix any failing tests. \n\n## Help wanted :sos:\n\nIf you are interested in collaborating more close with us in the repo maintenance, formula development or just have an idea to take this tap further, please tell us. Any help, idea or suggestion is really welcomed because we want this top to be useful to people that are interested into use QGIS and the rest of the OSGeo toolset on macOS. \n\nIn addition to the normal communication over the issue tracker in this repo we also have a have a ![](https://i.imgur.com/tZfrqQG.png)[slack workplace](https://homebrew-osgeo4mac.slack.com/) were we discuss repo matters in a more dynamic way. If you want to join us, because you are interested into collaborate in the discussion please tell us. \n\n**Thanks!** :pray:\n\n\\****Note****: this contributing page has been heavily based on the Homebrew core's [contributing page](https://github.com/Homebrew/brew/blob/master/CONTRIBUTING.md).*"
  },
  {
    "path": "Formula/mapcache.rb",
    "content": "class Mapcache < Formula\n  desc \"Server that implements tile caching to speed up access to WMS layers.\"\n  homepage \"http://mapserver.org/mapcache/\"\n  url \"https://github.com/mapserver/mapcache/archive/rel-1-6-1.tar.gz\"\n  version \"1.6.1\"\n  sha256 \"1b3de277173100e89655b7c1361468c67727895a94152931e222a48b45a48caa\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    cellar :any\n    sha256 \"48db39a4b97d78a01b20b5458fb7bed8e3eb2550f2d191ba6d08a30b1760662b\" => :high_sierra\n    sha256 \"48db39a4b97d78a01b20b5458fb7bed8e3eb2550f2d191ba6d08a30b1760662b\" => :sierra\n  end\n\n  option \"with-tiff-cache\", \"Build with TIFFs as a cache backend\"\n  option \"without-apache-module\", \"Build without Apache2 module\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"apr-util\" => :build if build.with? \"apache-module\"\n  depends_on \"libpng\"\n  depends_on \"jpeg\"\n  depends_on \"pcre\" => :recommended\n  depends_on \"pixman\"\n  depends_on \"fcgi\"\n  depends_on \"sqlite\"\n  depends_on \"gdal\"\n  depends_on \"geos\"\n\n  if build.with? \"tiff-cache\"\n    depends_on \"osgeo-libgeotiff\"\n    depends_on \"libtiff\"\n  end\n  depends_on \"berkeley-db\" => :optional\n  depends_on \"memcached\" => :optional\n  depends_on \"mapserver\" => :optional\n\n  def lib_name\n    \"libmapcache\"\n  end\n\n  def install\n    args = std_cmake_args\n    # option(WITH_SQLITE \"Use sqlite as a cache backend\" ON)\n    # option(WITH_GEOS \"Choose if GEOS geometry operations support should be built in\" ON)\n    # option(WITH_OGR \"Choose if OGR/GDAL input vector support should be built in\" ON)\n    # option(WITH_CGI \"Choose if CGI executable should be built\" ON)\n    # option(WITH_FCGI \"Choose if CGI executable should support FastCGI\" ON)\n    # Fix up .fcgi install path\n    args << \"-DCMAKE_INSTALL_CGIBINDIR=#{libexec}\"\n\n    # option(WITH_VERSION_STRING \"Show MapCache in server version string\" ON)\n    # option(WITH_APACHE \"Build Apache Module\" ON)\n    if build.with? \"apache-module\"\n      args << \"-DCMAKE_PREFIX_PATH=#{Formula[\"apr\"].opt_libexec}:#{Formula[\"apr-util\"].opt_libexec}\"\n      args << \"-DAPACHE_MODULE_DIR=#{libexec}\"\n    else\n      args << \"-DWITH_APACHE=OFF\"\n    end\n    # option(WITH_PIXMAN \"Use pixman for SSE optimized image manipulations\" ON)\n    # args << \"-DWWITH_PIXMAN=\" + (build.with?(\"pixman\") ? \"ON\" : \"OFF\")\n    # option(WITH_BERKELEY_DB \"Use Berkeley DB as a cache backend\" OFF)\n    args << \"-DWITH_BERKELEY_DB=\" + (build.with?(\"berkeley-db\") ? \"ON\" : \"OFF\")\n    # option(WITH_MEMCACHE \"Use memcache as a cache backend (requires recent apr-util)\" OFF)\n    args << \"-DWITH_MEMCACHE=\" + (build.with?(\"memcached\") ? \"ON\" : \"OFF\")\n    # option(WITH_PCRE \"Use PCRE for regex tests\" OFF)\n    args << \"-DWITH_PCRE=\" + (build.with?(\"pcre\") ? \"ON\" : \"OFF\")\n    # option(WITH_MAPSERVER \"Enable (experimental) support for the mapserver library\" OFF)\n    args << \"-DWITH_MAPSERVER=\" + (build.with?(\"mapserver\") ? \"ON\" : \"OFF\")\n\n    # option(WITH_TIFF \"Use TIFFs as a cache backend\" OFF)\n    # option(WITH_TIFF_WRITE_SUPPORT \"Enable (experimental) support for writable TIFF cache backends\" OFF)\n    # option(WITH_GEOTIFF \"Allow GeoTIFF metadata creation for TIFF cache backends\" OFF)\n    args << \"-DWITH_TIFF=\" + (build.with?(\"tiff-cache\") ? \"ON\" : \"OFF\")\n    args << \"-DWITH_GEOTIFF=\" + (build.with?(\"tiff-cache\") ? \"ON\" : \"OFF\")\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      # system \"/usr/local/bin/bbedit\", \"CMakeCache.txt\"\n      # raise\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    # update Apache module linking\n    so_ver = 1\n    lib_name_ver = \"#{lib_name}.#{so_ver}\"\n    MachO::Tools.change_install_name(\"#{libexec}/mod_mapcache.so\",\n                                     \"@rpath/#{lib_name_ver}.dylib\",\n                                     \"#{opt_lib}/#{lib_name_ver}.dylib\")\n\n    # Add config examples\n    (prefix/\"config\").mkpath\n    cp Dir[\"mapcache.xml*\"], prefix/\"config\"\n  end\n\n  def caveats; <<~EOS\n    The MapCache FCGI executable and Apache module are located in:\n      #{libexec}/\n\n    Configuration examples are located in:\n      #{prefix}/\n\n  EOS\n  end\n\n  test do\n    out = `#{opt_bin}/mapcache_seed -h`\n    assert_match \"tileset to seed\", out\n  end\nend\n"
  },
  {
    "path": "Formula/mapserver6.rb",
    "content": "class JavaJDK < Requirement\n  fatal true\n\n  def self.home\n    [\n      `/usr/libexec/java_home`.chomp!,\n      ENV[\"JAVA_HOME\"],\n    ].find do |dir|\n      dir && File.exist?(\"#{dir}/bin/javac\") && (File.exist?(\"#{dir}/include\") || File.exist?(\"#{dir}/bundle\"))\n    end\n  end\n\n  satisfy :build_env => false do\n    self.class.home\n  end\n\n  def message; <<~EOS\n    Could not find a JDK (i.e. not a JRE)\n\n    Do one of the following:\n    - install a JDK that is detected with /usr/libexec/java_home\n    - set the JAVA_HOME environment variable\n    - specify --without-java\n\n  EOS\n  end\nend\n\nclass Mapserver6 < Formula\n  desc \"Publish spatial data and interactive mapping apps to the web\"\n  homepage \"http://mapserver.org/\"\n  url \"http://download.osgeo.org/mapserver/mapserver-6.4.5.tar.gz\"\n  sha256 \"b62c5c0cce2ea7da1d70553197926c14ef46bfb030a736e588367fc881b01a9a\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    rebuild 2\n    sha256 \"d49321a497cc7b0826ff2febf8147dfd9428a991a45cdb1e3f2f81e0e1634d44\" => :high_sierra\n    sha256 \"d49321a497cc7b0826ff2febf8147dfd9428a991a45cdb1e3f2f81e0e1634d44\" => :sierra\n  end\n\n  # Backport patch to support compiling with gif_lib >= 5.1: https://github.com/mapserver/mapserver/pull/5144\n  # Also applies a patch to build on versions of PHP5 > 5.6.25: https://github.com/mapserver/mapserver/pull/5318\n  patch :DATA\n\n  conflicts_with \"mapserver\", :because => \"Homebrew core includes newer version of mapserver\"\n\n  option \"without-php\", \"Build PHP MapScript module\"\n  option \"with-rpath\", \"Don't embed rpath to installed libmapserver in modules\"\n  option \"without-geos\", \"Build without GEOS spatial operations support\"\n  option \"without-postgresql\", \"Build without PostgreSQL data source support\"\n  option \"without-xml-mapfile\", \"Build with native XML mapfile support\"\n  option \"with-java\", \"Build Java MapScript module\"\n  option \"with-librsvg\", \"Build with SVG symbology support\"\n  option \"with-docs\", \"Download and generate HTML documentation\"\n  option \"with-unit-tests\", \"Download and install full unit test suite\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"freetype\"\n  depends_on \"libpng\"\n  depends_on \"python@2\"\n  depends_on \"swig\" => :build\n  depends_on \"openjdk\" => :optional\n  depends_on \"giflib\"\n  depends_on \"osgeo-proj\"\n  depends_on \"geos\" => :recommended\n  depends_on \"gdal\"\n  depends_on \"osgeo-postgresql\" => :recommended\n  depends_on \"mysql\" => :optional\n  depends_on \"fcgi\" => :recommended\n  depends_on \"cairo\" => :recommended\n  depends_on \"libxml2\" if build.with?(\"xml-mapfile\") || MacOS.version < :mountain_lion\n  depends_on \"libxslt\" if build.with? \"xml-mapfile\"\n  depends_on \"librsvg\" => :optional\n  depends_on \"fribidi\"\n  depends_on \"python@2\" => %w[sphinx] if build.with? \"docs\"\n  depends_on \"php@5.6\" if build.with? \"php\"\n  depends_on \"perl\"\n\n  resource \"sphinx\" do\n    url \"https://files.pythonhosted.org/packages/source/S/Sphinx/Sphinx-1.2.2.tar.gz\"\n    sha256 \"2d3415f5b3e6b7535877f4c84fe228bdb802a8993c239b2d02c23169d67349bd\"\n  end\n\n  resource \"docs\" do\n    # NOTE: seems to be no tagged releases for `docs`, just active branches\n    url \"https://github.com/mapserver/docs.git\", :branch => \"branch-6-4\"\n    version \"6.4\"\n  end\n\n  resource \"unittests\" do\n    url \"https://github.com/mapserver/msautotest.git\",\n        :revision => \"b0ba5ccbfb6b0395820f492eb5a190cf643b5ed8\"\n    version \"6.4\"\n  end\n\n  def png_prefix\n    png = Formula[\"libpng\"]\n    (png.installed? || MacOS.version >= :mountain_lion) ? png.opt_prefix : MacOS::X11.prefix\n  end\n\n  def freetype_prefix\n    ft = Formula[\"freetype\"]\n    (ft.installed? || MacOS.version >= :mountain_lion) ? ft.opt_prefix : MacOS::X11.prefix\n  end\n\n  def install\n    # install unit tests\n    (prefix/\"msautotest\").install resource(\"unittests\") if build.with? \"unit-tests\"\n\n    ENV.prepend_path \"CMAKE_PREFIX_PATH\", freetype_prefix\n    ENV.prepend_path \"CMAKE_PREFIX_PATH\", png_prefix\n\n    args = std_cmake_args\n    if MacOS.prefer_64_bit?\n      args << \"-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}\"\n    else\n      args << \"-DCMAKE_OSX_ARCHITECTURES=i386\"\n    end\n\n    # defaults different than CMakeLists.txt (they don't incur extra dependencies)\n    args.concat %w[\n      -DWITH_KML=ON\n      -DWITH_CURL=ON\n      -DWITH_CLIENT_WMS=ON\n      -DWITH_CLIENT_WFS=ON\n      -DWITH_SOS=ON\n    ]\n\n    args << \"-DWITH_XMLMAPFILE=ON\" if build.with? \"xml-mapfile\"\n    args << \"-DWITH_MYSQL=ON\" if build.with? \"mysql\"\n    args << \"-DWITH_RSVG=ON\" if build.with? \"librsvg\"\n\n    glib = Formula[\"glib\"]\n    fribidi = Formula[\"fribidi\"]\n    args << \"-DFRIBIDI_INCLUDE_DIR=#{glib.opt_include}/glib-2.0;#{glib.opt_lib}/glib-2.0/include;#{fribidi.opt_include}\"\n\n    mapscr_dir = prefix/\"mapscript\"\n    mapscr_dir.mkpath\n    rpath = %Q(-Wl,-rpath,\"#{opt_prefix/\"lib\"}\")\n    use_rpath = build.with? \"rpath\"\n    cd \"mapscript\" do\n      args << \"-DWITH_PYTHON=ON\"\n      inreplace \"python/CMakeLists.txt\" do |s|\n        s.gsub! \"${PYTHON_SITE_PACKAGES}\", lib/\"python2.7/site-packages\"\n        s.gsub! \"${PYTHON_LIBRARIES}\", \"-Wl,-undefined,dynamic_lookup\"\n        s.sub! \"${MAPSERVER_LIBMAPSERVER}\",\n               \"#{rpath} ${MAPSERVER_LIBMAPSERVER}\" if use_rpath\n      end\n\n      # override language extension install locations, e.g. install to prefix/\"mapscript/lang\"\n      args << \"-DWITH_RUBY=ON\"\n      (mapscr_dir/\"ruby\").mkpath\n      inreplace \"ruby/CMakeLists.txt\" do |s|\n        s.gsub! \"${RUBY_SITEARCHDIR}\", %Q(\"#{mapscr_dir}/ruby\")\n        s.sub! \"${MAPSERVER_LIBMAPSERVER}\",\n               \"#{rpath} ${MAPSERVER_LIBMAPSERVER}\" if use_rpath\n      end\n\n      if build.with? \"php\"\n        args << \"-DWITH_PHP=ON\"\n        (mapscr_dir/\"php\").mkpath\n        inreplace \"php/CMakeLists.txt\" do |s|\n          s.gsub! \"${PHP5_EXTENSION_DIR}\", %Q(\"#{mapscr_dir}/php\")\n          s.sub! \"${MAPSERVER_LIBMAPSERVER}\",\n                 \"#{rpath} ${MAPSERVER_LIBMAPSERVER}\" if use_rpath\n        end\n      end\n\n      args << \"-DWITH_PERL=ON\"\n      (mapscr_dir/\"perl\").mkpath\n      args << \"-DCUSTOM_PERL_SITE_ARCH_DIR=#{mapscr_dir}/perl\"\n      inreplace \"perl/CMakeLists.txt\", \"${MAPSERVER_LIBMAPSERVER}\",\n                \"#{rpath} ${MAPSERVER_LIBMAPSERVER}\" if use_rpath\n\n      if build.with? \"java\"\n        args << \"-DWITH_JAVA=ON\"\n        ENV[\"JAVA_HOME\"] = JavaJDK.home\n        (mapscr_dir/\"java\").mkpath\n        inreplace \"java/CMakeLists.txt\" do |s|\n          s.gsub!  \"DESTINATION ${CMAKE_INSTALL_LIBDIR}\",\n                  %Q(${CMAKE_CURRENT_BINARY_DIR}/mapscript.jar DESTINATION \"#{mapscr_dir}/java\")\n          s.sub! \"${MAPSERVER_LIBMAPSERVER}\",\n                 \"#{rpath} ${MAPSERVER_LIBMAPSERVER}\" if use_rpath\n        end\n      end\n    end\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n#    MachO::Tools.change_install_name(lib/\"python2.7/site-packages/_mapscript.so\",\n#                                     \"@rpath/libmapserver.1.dylib\", opt_lib/\"libmapserver.1.dylib\")\n\n#    system \"install_name_tool\", \"-change\",\n#           \"@rpath/libmapserver.1.dylib\", opt_lib/\"libmapserver.1.dylib\",\n#           lib/\"python2.7/site-packages/_mapscript.so\"\n\n    # install devel headers\n    (include/\"mapserver\").install Dir[\"*.h\"]\n\n    prefix.install \"tests\"\n    (mapscr_dir/\"python\").install \"mapscript/python/tests\"\n    cd \"mapscript\" do\n      %w[python ruby perl].each { |x| (mapscr_dir/x.to_s).install \"#{x}/examples\" }\n      (mapscr_dir/\"php\").install \"php/examples\" if build.with? \"php\"\n      (mapscr_dir/\"java\").install \"java/examples\" if build.with? \"java\"\n    end\n\n    # write install instructions for modules\n    s = \"\"\n    mapscr_opt_dir = opt_prefix/\"mapscript\"\n    if build.with? \"php\"\n      s += <<~EOS\n        Using the built PHP module:\n          * Add the following line to php.ini:\n            extension=\"#{mapscr_opt_dir}/php/php_mapscript.so\"\n          * Execute \"php -m\"\n          * You should see MapScript in the module list\n\n      EOS\n    end\n    %w[ruby perl java].each do |m|\n      next if build.without?(m)\n\n      cmd = []\n      case m\n      when \"ruby\"\n        ruby_site = `ruby -r rbconfig -e 'puts RbConfig::CONFIG[\"sitearchdir\"]'`.chomp\n        cmd << \"sudo cp -f mapscript.bundle #{ruby_site}/\"\n      when \"perl\"\n        perl_site = `perl -MConfig -e 'print $Config{\"sitearch\"};'`.chomp\n        cmd << \"sudo cp -f mapscript.pm #{perl_site}/\"\n        cmd << \"sudo cp -fR auto/mapscript #{perl_site}/auto/\"\n      else\n        cmd << \"sudo cp -f libjavamapscript.jnilib mapscript.jar /Library/Java/Extensions/\"\n      end\n      s += <<~EOS\n        Install the built #{m.upcase} module with:\n          cd #{mapscr_opt_dir}/#{m}\n          #{cmd[0]}\n          #{cmd[1] + \"\\n\" if cmd[1]}\n      EOS\n    end\n    (mapscr_dir/\"Install_Modules.txt\").write s\n\n    if build.with? \"docs\"\n      unless which(\"sphinx-build\")\n        # vendor a local sphinx install\n        sphinx_site = libexec/\"lib/python2.7/site-packages\"\n        ENV.prepend_create_path \"PYTHONPATH\", sphinx_site\n        resource(\"sphinx\").stage { quiet_system \"python2.7\", \"setup.py\", \"install\", \"--prefix=#{libexec}\" }\n        ENV.prepend_path \"PATH\", libexec/\"bin\"\n      end\n      resource(\"docs\").stage do\n        # just build the en docs\n        inreplace \"Makefile\", \"$(TRANSLATIONS_I18N) $(TRANSLATIONS_STATIC)\", \"\"\n        system \"make\", \"html\"\n        doc.install \"build/html\" => \"html\"\n      end\n    end\n  end\n\n  def caveats; <<~EOS\n    The Mapserver CGI executable is #{opt_prefix}/bin/mapserv\n\n    Instructions for installing any built, but uninstalled, mapscript modules:\n      #{opt_prefix}/mapscript/Install_Modules.txt\n\n    EOS\n  end\n\n  test do\n    mapscr_opt_dir = opt_prefix/\"mapscript\"\n    system \"#{bin}/mapserv\", \"-v\"\n    system \"python2.7\", \"-c\", '\"import mapscript\"'\n    system \"ruby\", \"-e\", \"\\\"require '#{mapscr_opt_dir}/ruby/mapscript'\\\"\"\n    system \"perl\", \"-I#{mapscr_opt_dir}/perl\", \"-e\", '\"use mapscript;\"'\n\n    cd \"#{mapscr_opt_dir}/java/examples\" do\n      system \"#{JavaJDK.home}/bin/javac\",\n             \"-classpath\", \"../\", \"-Djava.ext.dirs=../\", \"RFC24.java\"\n      system \"#{JavaJDK.home}/bin/java\",\n             \"-classpath\", \"../\", \"-Djava.library.path=../\", \"-Djava.ext.dirs=../\",\n             \"RFC24\", \"../../../tests/test.map\"\n    end if build.with? \"java\"\n  end\n\nend\n__END__\ndiff --git a/mapimageio.c b/mapimageio.c\nindex 35d134f..eb63aa3 100644\n--- a/mapimageio.c\n+++ b/mapimageio.c\n@@ -1307,6 +1307,12 @@ int readGIF(char *path, rasterBufferObj *rb)\n\n   } while (recordType != TERMINATE_RECORD_TYPE);\n\n+#if defined GIFLIB_MAJOR && GIFLIB_MINOR && ((GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) || (GIFLIB_MAJOR > 5))\n+  if (DGifCloseFile(image, &errcode) == GIF_ERROR) {\n+    msSetError(MS_MISCERR,\"failed to close gif after loading: %s\",\"readGIF()\", gif_error_msg(errcode));\n+    return MS_FAILURE;\n+  }\n+#else\n   if (DGifCloseFile(image) == GIF_ERROR) {\n #if defined GIFLIB_MAJOR && GIFLIB_MAJOR >= 5\n     msSetError(MS_MISCERR,\"failed to close gif after loading: %s\",\"readGIF()\", gif_error_msg(image->Error));\n@@ -1315,6 +1321,7 @@ int readGIF(char *path, rasterBufferObj *rb)\n #endif\n     return MS_FAILURE;\n   }\n+#endif\n\n   return MS_SUCCESS;\n }\ndiff --git a/mapscript/php/error.c b/mapscript/php/error.c\nindex a13de647f..2e96eea27 100644\n--- a/mapscript/php/error.c\n+++ b/mapscript/php/error.c\n@@ -31,6 +31,17 @@\n \n #include \"php_mapscript.h\"\n \n+#if PHP_VERSION_ID >= 50625\n+#undef ZVAL_STRING\n+#define ZVAL_STRING(z, s, duplicate) do {       \\\n+    const char *__s=(s);                            \\\n+    zval *__z = (z);                                        \\\n+    Z_STRLEN_P(__z) = strlen(__s);          \\\n+    Z_STRVAL_P(__z) = (duplicate?estrndup(__s, Z_STRLEN_P(__z)):(char*)__s);\\\n+    Z_TYPE_P(__z) = IS_STRING;                      \\\n+} while (0)\n+#endif\n+\n zend_class_entry *mapscript_ce_error;\n \n ZEND_BEGIN_ARG_INFO_EX(error___get_args, 0, 0, 1)\n"
  },
  {
    "path": "Formula/osgeo-ecwjp2-sdk.rb",
    "content": "require File.expand_path(\"../../Strategies/cache-download\", Pathname.new(__FILE__).realpath)\n\nECWJP2_SDK = \"/Hexagon/ERDASEcwJpeg2000SDK5.5.0/Desktop_Read-Only/\".freeze\n\nclass EcwJpeg2000SDK < Requirement\n  fatal true\n  satisfy(:build_env => false) { File.exist? ECWJP2_SDK }\n\n  def message; <<~EOS\n    ERDAS ECW/JP2 SDK was not found at:\n      #{ECWJP2_SDK}\n\n    Download SDK and install 'Desktop Read-Only' to default location from:\n      http://download.intergraph.com/?ProductName=ERDAS%20ECW/JPEG2000%20SDK\n  EOS\n  end\nend\n\nclass OsgeoEcwjp2Sdk < Formula\n  desc \"Decompression library for ECW- and JPEG2000-compressed imagery\"\n  homepage \"http://www.hexagongeospatial.com/products/provider-suite/erdas-ecw-jp2-sdk\"\n  url \"https://osgeo4mac.s3.amazonaws.com/src/dummy.tar.gz\"\n  version \"5.5.0\"\n  sha256 \"e7776e2ff278d6460300bd69a26d7383e6c5e2fbeb17ff12998255e7fc4c9511\"\n\n  # revision 1\n\n  # depends_on :macos => :lion # as per SDK docs unknown version :lion\n  depends_on EcwJpeg2000SDK\n\n  def install\n    lib.mkpath\n    (include/\"ECWJP2\").mkpath\n    cd ECWJP2_SDK do\n      # vendor Desktop Read-Only libs, etc\n      # suffix only the older stdc++\n      cp \"redistributable/libc++/libNCSEcw.dylib\", \"#{lib}/\"\n      # libstdc++ is not longer bundled in the distribution\n#      cp \"redistributable/libstdc++/libNCSEcw.dylib\", \"#{lib}/libNCSEcw-stdcxx.dylib\"\n      # Calling install_name_tool is deprecated, so we're switching to using the MachO tools\n#      system \"install_name_tool\", \"-id\", opt_lib/\"libNCSEcw-stdcxx.dylib\", lib/\"libNCSEcw-stdcxx.dylib\"\n#      MachO::Tools.change_dylib_id(opt_lib/\"libNCSEcw-stdcxx.dylib\", lib/\"libNCSEcw-stdcxx.dylib\")\n      %w[etc Licenses].each { |f| cp_r f.to_s, \"#{prefix}/\" }\n      cp_r Dir[\"include/*\"], \"#{include}/ECWJP2/\"\n\n      # for test\n      (prefix/\"test\").mkpath\n      cp \"Examples/decompression/example1/dexample1.c\", prefix/\"test/\"\n      %w[ecw jp2].each { |f| cp \"TestData/RGB_8bit.#{f}\", prefix/\"test/\" }\n    end\n  end\n\n  def caveats; <<~EOS\n    Once formula is installed, the ERDAS ECW/JP2 SDK can be deleted from its\n    default install location of:\n\n      #{Pathname.new(ECWJP2_SDK).dirname}\n\n    Headers installed to:\n\n      #{opt_include}/ECWJP2\n\n    EOS\n  end\n\n  test do\n    cp prefix/\"test/dexample1.c\", testpath\n    system ENV.cc, \"-I#{opt_include}/ECWJP2\", \"-L#{opt_lib}\", \"-lNCSEcw\",\n           \"-o\", \"test\", \"dexample1.c\"\n\n    %w[ecw jp2].each do |f|\n      out = `./test #{prefix}/test/RGB_8bit.#{f}`\n      assert_match \"Region   99\", out\n      assert_match \"Region    0\", out\n      assert_match \"ALL    time\", out\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-fcgi-debug.rb",
    "content": "class OsgeoFcgiDebug < Formula\n  desc \"Helps trace FastCGI programs without having to strace them\"\n  homepage \"http://redmine.lighttpd.net/projects/fcgi-debug/wiki\"\n  url \"https://github.com/lighttpd/fcgi-debug/archive/fcgi-debug-0.9.3.tar.gz\"\n  sha256 \"b63f89c563c05c2a8beb0d2dbace893928291f8f7a7ae651ff7a328a8be64725\"\n\n  revision 1\n\n  head \"https://github.com/lighttpd/fcgi-debug.git\", branch: \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"674bace0a4d665e202d85b1179a60e2dd6987ca6540b16b2b5fc89656175b6a4\" => :mojave\n    sha256 \"674bace0a4d665e202d85b1179a60e2dd6987ca6540b16b2b5fc89656175b6a4\" => :high_sierra\n    sha256 \"2533dc7a2c288f6638e3996c64506543fb495cf8cffd27b165ff8d79b15d4065\" => :sierra\n  end\n\n  depends_on \"cmake\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"libev\"\n  depends_on \"glib\"\n\n  def install\n    man1.install \"fcgi-debug.1\"\n    args = std_cmake_args\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n    # TODO\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-filegdb-api.rb",
    "content": "class OsgeoFilegdbApi < Formula\n  desc \"ESRI File Geodatabase C++ API libraries\"\n  homepage \"https://github.com/Esri/file-geodatabase-api\"\n  url \"https://github.com/Esri/file-geodatabase-api/raw/master/FileGDB_API_1.5.1/FileGDB_API_1_5_1-64clang.zip\"\n  sha256 \"78b52650b3be72eacb985fd744f6766e8d57f60a3317055c5a23b1d181ae8ab2\"\n  version \"1.5.1\"\n\n  revision 1\n\n  head \"https://github.com/Esri/file-geodatabase-api.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"5d0737d480cacb6d13b5cb5883ba8daeb197ae99ef3cc7d7f4bcfc87aa242ebd\" => :mojave\n    sha256 \"5d0737d480cacb6d13b5cb5883ba8daeb197ae99ef3cc7d7f4bcfc87aa242ebd\" => :high_sierra\n    sha256 \"39854ee9fc01e80f14a5cafdbbf868c349d612955820d3407c588ff099f28e4d\" => :sierra\n  end\n\n  option \"with-docs\", \"Intall API documentation and sample code\"\n\n  def install\n    prefix.install %w[lib license]\n    # update libs\n    cd lib do\n      install_change \"libFileGDBAPI.dylib\",\n                     \"@rpath/libfgdbunixrtl.dylib\",\n                     \"@loader_path/libfgdbunixrtl.dylib\"\n      set_install_name(\"libFileGDBAPI.dylib\", opt_lib)\n    end\n\n    # build a sample for testing libs\n    # Note: Editing sample failed in test sandbox; worked in Terminal\n    mkdir_p libexec/\"test/bin\"\n    mkdir libexec/\"test/data\"\n    cp_r \"samples/data/Querying.gdb\", libexec/\"test/data/\"\n    cd \"samples/Querying\" do\n      inreplace \"Makefile\", \"../../lib\", lib\n      inreplace \"Makefile\", \"../bin\", \"#{libexec}/test/bin\"\n      system \"make\"\n    end\n\n    # install headers (after building test binary)\n    rm_f \"include/make.include\"\n    include.install \"include\" => \"filegdb\"\n\n    if build.with? \"docs\"\n      pkgshare.install %w[samples xmlResources]\n      pkgshare.install \"doc/html\" => \"html\"\n    end\n  end\n\n  def install_change(dylib, old, new)\n    quiet_system \"install_name_tool\", \"-change\", old, new, dylib\n  end\n\n  def set_install_name(dylib, dir)\n    quiet_system \"install_name_tool\", \"-id\", \"#{dir}/#{dylib}\", dylib\n  end\n\n  def caveats; <<~EOS\n      To build software with the File GDB API, add to the following\n      environment variable to find headers:\n\n        CPPFLAGS: -I#{opt_prefix}/include/filegdb\n\n    EOS\n  end\n\n  test do\n    cd libexec/\"test/bin\" do\n      system \"./Querying\"\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-fyba.rb",
    "content": "class OsgeoFyba < Formula\n  desc \"Library to read/write Norwegian National geodata standard (SOSI) files\"\n  homepage \"https://github.com/kartverket/fyba\"\n  url \"https://github.com/kartverket/fyba/archive/4.1.1.tar.gz\"\n  sha256 \"99f658d52e8fd8997118bb6207b9c121500700996d9481a736683474e2534179\"\n\n  revision 1\n\n  head \"https://github.com/kartverket/fyba.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"9966047d61d968941f24082a9bd7a9bcef59bd3df81bc864a35fd44287991909\" => :mojave\n    sha256 \"9966047d61d968941f24082a9bd7a9bcef59bd3df81bc864a35fd44287991909\" => :high_sierra\n    sha256 \"4a2c603626d62a08824f5739d831967fea36c09d5c1150b0923f8c804063f56c\" => :sierra\n  end\n\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"libtool\" => :build\n\n  def install\n    # fixup some includes: https://github.com/kartverket/fyba/issues/12\n    # done with inreplace due to CRLF endings in src/UT files\n    # REMOVE ON NEXT RELEASE\n    %w[configure configure.ac src/UT/DISKINFO.cpp src/UT/INQSIZE.cpp src/UT/INQTID.cpp].each do |s|\n      inreplace s, \"sys/vfs.h\", \"sys/mount.h\"\n    end\n\n    # fixup UT_INT64 type in include: https://github.com/kartverket/fyba/pull/19\n    # done with inreplace due to CRLF endings in files\n    inreplace \"src/UT/fyut.h\", %r{(/\\* For UNIX \\*/)},\n        \"\\\\1\\r\\n#  ifdef __APPLE__\\r\\n#    include <stdint.h>\\r\\n#    define UT_INT64 int64_t\\r\\n#  endif\\r\\n\"\n\n    system \"autoreconf\", \"-vfi\"\n\n    system \"./configure\", \"--prefix=#{prefix}\"\n    system \"make\"\n    system \"make\", \"install\"\n  end\n\n  test do\n    (testpath/\"fyba_test.cpp\").write <<-EOS\n    #include \"fyba.h\"\n    int main() {\n      SK_EntPnt_FYBA char *LC_InqVer(void);\n      return 0;\n    }\n    EOS\n    system ENV.cxx, \"-I#{include}/fyba\", \"-L#{lib}\", \"-lfyba\",\n           \"-lfygm\", \"-lfyut\", \"-o\", \"fyba_test\", \"fyba_test.cpp\"\n    system \"./fyba_test\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-ecwjp2.rb",
    "content": "class OsgeoGdalEcwjp2 < Formula\n  desc \"GDAL/OGR 3.x plugin for ECW driver\"\n  homepage \"http://www.gdal.org/frmt_ecw.html\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n\n  # revision 1\n\n  head \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n\n  # bottle do\n  #   never\n  # end\n\n  depends_on \"osgeo-ecwjp2-sdk\"\n  depends_on \"osgeo-gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"osgeo-gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    ENV.cxx11\n\n    ecwjp2_opt = Formula[\"osgeo-ecwjp2-sdk\"].opt_prefix\n    ecwjp2_opt_include = ecwjp2_opt/\"include/ECWJP2\"\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n\n    # cxx flags\n    args = %W[-Iport -Igcore -Ifrmts -DFRMT_ecw -DECWSDK_VERSION=53 -Ifrmts/ecw -DDO_NOT_USE_DEBUG_BOOL\n              -I#{ecwjp2_opt_include} -I#{ecwjp2_opt_include}/NCSEcw/API\n              -I#{ecwjp2_opt_include}/NCSEcw/ECW -I#{ecwjp2_opt_include}/NCSEcw/JP2]\n\n    # source files\n    Dir[\"frmts/ecw/*.cpp\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"gdal_ECW_JP2ECW.dylib\"\n    args.concat %W[\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{ecwjp2_opt}/lib -lNCSEcw]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"osgeo-gdal\"].opt_bin\n    out = shell_output(\"#{gdal_opt_bin}/gdalinfo --formats\")\n    assert_match \"ECW -raster- (rov)\", out\n    assert_match \"JP2ECW -raster,vector- (rov)\", out\n\n    ecwjp2_test = Formula[\"osgeo-ecwjp2-sdk\"].opt_prefix/\"test\"\n    out = shell_output(\"#{gdal_opt_bin}/gdalinfo #{ecwjp2_test}/RGB_8bit.ecw\")\n    assert_match \"Driver: ECW/ERDAS Compressed Wavelets\", out\n    assert_match \"Size is 4320, 2160\", out\n    out = shell_output(\"#{gdal_opt_bin}/gdalinfo #{ecwjp2_test}/RGB_8bit.jp2\")\n    assert_match \"Driver: JP2ECW/ERDAS JPEG2000\", out\n    assert_match \"Size is 4320, 2160\", out\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-filegdb.rb",
    "content": "class OsgeoGdalFilegdb < Formula\n  desc \"GDAL/OGR 3.x plugin for ESRI FileGDB driver\"\n  homepage \"http://www.gdal.org/drv_filegdb.html\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n\n  #revision 1\n\n  head \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"a1becbb7db6c1b00d7c74ae4cc19734537760f0156855218c4e97d0c17d32c65\" => :catalina\n    sha256 \"a1becbb7db6c1b00d7c74ae4cc19734537760f0156855218c4e97d0c17d32c65\" => :mojave\n    sha256 \"a1becbb7db6c1b00d7c74ae4cc19734537760f0156855218c4e97d0c17d32c65\" => :high_sierra\n  end\n\n  depends_on \"osgeo-filegdb-api\"\n  depends_on \"osgeo-gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"osgeo-gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    ENV.cxx11\n    filegdb_opt = Formula[\"osgeo-filegdb-api\"].opt_prefix\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n\n    # cxx flags\n    args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n              -Iogr/ogrsf_frmts/filegdb -I#{filegdb_opt}/include/filegdb]\n\n    # source files\n    Dir[\"ogr/ogrsf_frmts/filegdb/*.c*\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"ogr_FileGDB.dylib\"\n    args.concat %W[\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{filegdb_opt}/lib -lFileGDBAPI]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"osgeo-gdal\"].opt_bin\n    out = shell_output(\"#{gdal_opt_bin}/ogrinfo --formats\")\n    assert_match \"FileGDB -vector- (rw+)\", out\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-grass.rb",
    "content": "class OsgeoGdalGrass < Formula\n  desc \"GDAL/OGR 3.x plugin for GRASS 7\"\n  homepage \"https://www.gdal.org\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n\n  #revision 1\n\n  #bottle do\n  #  root_url \"https://bottle.download.osgeo.org\"\n  #  cellar :any\n  #  sha256 \"24d80b0a8250aee06a5af69277371f582b24e87036c091f0b174268a898b2ae0\" => :mojave\n  #  sha256 \"24d80b0a8250aee06a5af69277371f582b24e87036c091f0b174268a898b2ae0\" => :high_sierra\n  #  sha256 \"736afd0da344f3b221bc0b4e58019970b50552d40e2472b00ff8872248f5a977\" => :sierra\n  #end\n\n  depends_on \"osgeo-gdal\"\n  depends_on \"osgeo-grass\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"osgeo-gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    ENV.cxx11\n    gdal = Formula[\"osgeo-gdal\"]\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n\n    grass = Formula[\"osgeo-grass\"]\n\n    # due to DYLD_LIBRARY_PATH no longer being setable, strictly define extension\n    inreplace \"Makefile.in\", \".so\", \".dylib\"\n\n    system \"./configure\", \"--prefix=#{prefix}\",\n                          \"--disable-debug\",\n                          \"--disable-dependency-tracking\",\n                          \"--with-gdal=#{gdal.opt_bin}/gdal-config\",\n                          \"--with-grass=#{grass.prefix}/grass-base\",\n                          \"--with-autoload=#{gdal_plugins}\"\n\n    # inreplace \"Makefile\", \"mkdir\", \"mkdir -p\"\n\n    system \"make\", \"install\"\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"osgeo-gdal\"].opt_bin\n    out = shell_output(\"#{gdal_opt_bin}/gdalinfo --formats\")\n    assert_match \"GRASS -raster- (ro)\", out\n    out = shell_output(\"#{gdal_opt_bin}/ogrinfo --formats\")\n    assert_match \"OGR_GRASS -vector- (ro)\", out\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-mdb.rb",
    "content": "class OsgeoGdalMdb < Formula\n  desc \"GDAL/OGR 3.x plugin for MDB driver\"\n  homepage \"http://www.gdal.org/drv_mdb.html\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n\n  #revision 1\n  \n  head \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n\n  # bottle do\n  #   never (runtime JAVA version may change too much, or be different from Travis CI)\n  # end\n\n  depends_on \"openjdk\"\n  depends_on \"osgeo-gdal\"\n  depends_on \"libtiff\"\n  depends_on \"osgeo-libgeotiff\"\n\n  # various deps needed for configuring\n  depends_on \"json-c\"\n\n  resource \"jackcess-jar\" do\n    url \"https://downloads.sf.net/project/jackcess/jackcess/1.2.14.3/jackcess-1.2.14.3.jar\"\n    sha256 \"a6fab0c4b5daf23dcf7fd309ee4ffc6df12ff982510c094e45442adf88712787\"\n  end\n\n  resource \"logging-jars\" do\n    # lib/commons*.jar\n    url \"https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mdb-sqlite/mdb-sqlite-1.0.2.tar.bz2\"\n    sha256 \"43a584903f4c820b97104758a0d8f15731c70cee5d3d88d96669b1d91e902520\"\n  end\n\n  resource \"test-mdb\" do\n    url \"https://osgeo4mac.s3.amazonaws.com/src/NJ-Streets_Atlantic.zip\"\n    sha256 \"811ea90c55be918d8c3a2a5c75105e224c7a37fafb7f6154f67ec8eb9d8b86ef\"\n  end\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"osgeo-gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def configure_args\n    args = [\n      # Base configuration.\n      \"--prefix=#{prefix}\",\n      \"--mandir=#{man}\",\n      \"--disable-debug\",\n      \"--with-local=#{prefix}\",\n      \"--with-threads\",\n      \"--with-libtool\",\n\n      # various deps needed for configuring\n      \"--with-libjson-c=#{Formula[\"json-c\"].opt_prefix}\",\n\n      # force correction of dylib setup, even though we are not building framework here\n      \"--with-macosx-framework\",\n    ]\n\n    cmd = Language::Java.java_home_cmd(\"1.8\")\n    ENV[\"JAVA_HOME\"] = Utils.popen_read(cmd).chomp\n    args << \"--with-java=yes\"\n    args << \"--with-jvm-lib=#{ENV[\"JAVA_HOME\"]}/jre/lib/server\"\n    # args << \"--with-jvm-lib=dlopen\" # doesn't seem to work on macOS\n    # The rpath is only embedded for Oracle Java (non-framework) installs,\n    # though it does not work here as we are just compiling a plugin directly\n    args << \"--with-jvm-lib-add-rpath=yes\"\n    args << \"--with-mdb=yes\"\n\n    # nix all other configure tests, i.e. minimal base gdal build\n    without_pkgs = %w[\n      armadillo bsb cfitsio cryptopp curl dds dods-root\n      ecw epsilon expat fgdb fme freexl\n      geos gif gnm grass grib gta\n      hdf4 hdf5 idb ingres\n      j2lura jasper jp2mrsid jpeg jpeg12 kakadu kea\n      libgrass libkml liblzma libz\n      mongocxx mrf mrsid_lidar mrsid msg mysql netcdf\n      oci odbc ogdi opencl openjpeg\n      pam pcidsk pcraster pcre perl pg php png python\n      qhull rasdaman rasterlite2\n      sde sfcgal sosi spatialite sqlite3 static-proj4\n      teigha webp xerces xml2\n    ]\n    args.concat without_pkgs.map { |b| \"--without-\" + b }\n    args\n  end\n\n  def install\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n\n    ENV.cxx11\n\n    # configure GDAL/OGR with minimal drivers\n    system \"./configure\", *configure_args\n\n    # cxx flags\n    args = %W[-DLINUX -DUNIX -Iport -Igcore -Iogr\n              -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n              -Iogr/ogrsf_frmts/mdb -I#{ENV[\"JAVA_HOME\"]}/include/darwin\n              -I#{ENV[\"JAVA_HOME\"]}/include]\n\n    # source files\n    Dir[\"ogr/ogrsf_frmts/mdb/ogrmdb*.c*\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"ogr_MDB.dylib\"\n    args.concat %W[\n      -std=c++11\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{ENV[\"JAVA_HOME\"]}/jre/lib/server -ljvm]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n\n    dylib = lib/gdal_plugins_subdirectory/dylib_name\n    dylib.ensure_writable do\n      # manually add the libjvm.dylib rpath directory entry to the plugin\n      MachO::Tools.add_rpath(dylib.to_s, \"#{ENV[\"JAVA_HOME\"]}/jre/lib/server\", :strict => false)\n    end\n\n    libexec.install resource(\"jackcess-jar\")\n    resource(\"logging-jars\").stage do\n      libexec.install Dir[\"lib/commons*.jar\"]\n    end\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n\n      To have a functional MDB driver, install supporting .jar files in:\n        /Library/Java/Extensions/\n      from:\n        #{opt_libexec}/*.jar\n\n      (However, this can affect other JAVA software)\n\n      Optionally, set the following JAVA environment variable, per session:\n\n        export CLASSPATH=#{Dir[libexec/\"*.jar\"].join(\":\")}\n\n      See: http://www.gdal.org/ogr/drv_mdb.html\n\n      !!!!!!!!! IMPORTANT !!!!!!!!!\n\n      You may need to adjust your JAVA JRE or JDK install to allow JNI usage:\n\n        see: https://oliverdowling.com.au/2015/10/09/oracles-jdk-8-on-mac-os-x-el-capitan/\n    EOS\n  end\n\n  test do\n    # cmd = Language::Java.java_home_cmd(\"1.8+\")\n    # ENV[\"JAVA_HOME\"] = Utils.popen_read(cmd).chomp\n    ENV[\"CLASSPATH\"] = Dir[libexec/\"*.jar\"].join(\":\")\n    # puts \"JAVA_HOME=#{ENV[\"JAVA_HOME\"]}\"\n    # puts \"CLASSPATH=#{ENV[\"CLASSPATH\"]}\"\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"odgeo-gdal\"].opt_bin\n    system \"#{gdal_opt_bin}/ogrinfo\", \"--format\", \"MDB\"\n    resource(\"test-mdb\").stage testpath\n    system \"#{gdal_opt_bin}/ogrinfo\", \"-ro\", testpath/\"Atlantic.mdb\".to_s\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-mongodb.rb",
    "content": "class OsgeoGdalMongodb < Formula\n  desc \"GDAL/OGR 3.x plugin for MongoDB driver\"\n  homepage \"http://www.gdal.org/drv_mongodb.html\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n\n  #revision 1\n  \n  head \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n\n  #bottle do\n  #  root_url \"https://bottle.download.osgeo.org\"\n  #  cellar :any\n  #  sha256 \"1bd81d777302cee99d33b444746f9451374cf354b64a07fdd44fb0cb51574293\" => :catalina\n  #  sha256 \"1bd81d777302cee99d33b444746f9451374cf354b64a07fdd44fb0cb51574293\" => :mojave\n  #  sha256 \"1bd81d777302cee99d33b444746f9451374cf354b64a07fdd44fb0cb51574293\" => :high_sierra\n  #end\n\n  depends_on \"boost\"\n  depends_on \"libtiff\"\n  depends_on \"osgeo-libgeotiff\"\n  depends_on \"osgeo-gdal\"\n  depends_on \"osgeo-mongo-cxx-driver-legacy\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"osgeo-gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def configure_args\n    args = [\n      # Base configuration.\n      \"--prefix=#{prefix}\",\n      \"--mandir=#{man}\",\n      \"--disable-debug\",\n      \"--with-local=#{prefix}\",\n      \"--with-threads\",\n      \"--with-libtool\",\n      # force correction of dylib setup, even though we are not building framework here\n      \"--with-macosx-framework\",\n    ]\n\n    args << \"--with-mongocxx=#{Formula[\"osgeo-mongo-cxx-driver-legacy\"].opt_prefix}\"\n\n    # nix all other configure tests, i.e. minimal base gdal build\n    without_pkgs = %w[\n      armadillo bsb cfitsio cryptopp curl dds dods-root\n      ecw epsilon expat fgdb fme freexl\n      geos gif gnm grass grib gta\n      hdf4 hdf5 idb ingres\n      jasper jp2mrsid jpeg jpeg12 kakadu kea\n      libgrass libkml liblzma libz\n      mdb mrf mrsid_lidar mrsid msg mysql netcdf\n      oci odbc ogdi opencl openjpeg\n      pam pcidsk pcraster pcre perl pg php png python\n      qhull rasdaman rasterlite2\n      sde sfcgal sosi spatialite sqlite3 static-proj4\n      teigha webp xerces xml2\n    ]\n    args.concat without_pkgs.map { |b| \"--without-\" + b }\n    args\n  end\n\n  def install\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n\n    ENV.cxx11\n\n    # configure GDAL/OGR with minimal drivers\n    system \"./configure\", *configure_args\n\n    # cxx flags\n    args = %W[-DLINUX -DUNIX -Iport -Igcore -Iogr\n              -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n              -Iogr/ogrsf_frmts/mongodb]\n\n    # source files\n    Dir[\"ogr/ogrsf_frmts/mongodb/ogrmongodb*.c*\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"ogr_MongoDB.dylib\"\n    args.concat %W[\n      -std=c++11\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # Add the Mongo lib\n    args.concat %W[-L#{Formula[\"osgeo-mongo-cxx-driver-legacy\"].opt_lib} -lmongoclient]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n  end\n\n  def caveats; <<~EOS\n    This formula provides a plugin that allows GDAL or OGR to access geospatial\n    data stored in its format. In order to use the shared plugin, you may need\n    to set the following enviroment variable:\n\n      export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"osgeo-gdal\"].opt_bin\n    system \"#{gdal_opt_bin}/ogrinfo\", \"--format\", \"MongoDB\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-mrsid.rb",
    "content": "class OsgeoGdalMrsid < Formula\n  desc \"GDAL/OGR 3.x plugin for MrSID raster and LiDAR drivers\"\n  homepage \"http://www.gdal.org/frmt_mrsid.html\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n\n  # revision 1\n\n  head \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n\n  # bottle do\n  #   never\n  # end\n\n  depends_on \"osgeo-mrsid-sdk\"\n  depends_on \"osgeo-gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"osgeo-gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    ENV.cxx11\n    mrsid_sdk_opt = Formula[\"osgeo-mrsid-sdk\"].opt_prefix\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n\n    plugins = {}\n    lidar_args = []\n    mrsid_args = []\n\n    # source files & cxx/ld flags\n    # gdal_MG4Lidar.dylib\n    Dir[\"frmts/mrsid_lidar/*.c*\"].each { |src| lidar_args.concat %W[#{src}] }\n    lidar_args.concat %W[\n      -Iport -Igcore -Ifrmts -Ifrmts/mrsid_lidar\n      -I#{mrsid_sdk_opt}/include/mrsid\n    ]\n    lidar_args.concat %W[-L#{mrsid_sdk_opt}/lib -llti_lidar_dsdk]\n    plugins[:gdal_MG4Lidar] = lidar_args\n\n    # gdal_MrSID.dylib\n    Dir[\"frmts/mrsid/*.c*\"].each { |src| mrsid_args.concat %W[#{src}] }\n    mrsid_args.concat %W[\n      -DMRSID_J2K=1\n      -Iport -Igcore -Ifrmts -Ifrmts/mrsid -Ifrmts/gtiff/libgeotiff\n      -I#{mrsid_sdk_opt}/include/mrsid\n    ]\n    mrsid_args.concat %W[-L#{mrsid_sdk_opt}/lib -lltidsdk]\n    plugins[:gdal_MrSID] = mrsid_args\n\n    # plugin dylib\n    plugins.each do |key, args|\n      args.concat %W[\n        -dynamiclib\n        -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{key}.dylib\n        -current_version #{version}\n        -compatibility_version #{gdal_majmin_ver}.0\n        -o #{gdal_plugins}/#{key}.dylib\n        -undefined dynamic_lookup\n      ]\n      # build and install shared plugin\n      system ENV.cxx, *args\n    end\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"osgeo-gdal\"].opt_bin\n    out = shell_output(\"#{gdal_opt_bin}/gdalinfo --formats\")\n    assert_match \"MG4Lidar -raster- (ro)\", out\n    assert_match \"MrSID -raster- (rov)\", out\n    assert_match \"JP2MrSID -raster- (rov)\", out\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-mysql.rb",
    "content": "class OsgeoGdalMysql < Formula\n  desc \"GDAL/OGR 3.x plugin for MySQL driver\"\n  homepage \"http://www.gdal.org/drv_mysql.html\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n\n  #revision 1\n  \n  head \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n\n  #bottle do\n  #  root_url \"https://bottle.download.osgeo.org\"\n  #  sha256 \"82e4ae8e22b01017f8be53a735bf19d5120fa8b80e6c561406cf73bae0a62506\" => :catalina\n  #  sha256 \"82e4ae8e22b01017f8be53a735bf19d5120fa8b80e6c561406cf73bae0a62506\" => :mojave\n  #  sha256 \"82e4ae8e22b01017f8be53a735bf19d5120fa8b80e6c561406cf73bae0a62506\" => :high_sierra\n  #end\n\n  depends_on \"mysql\" => :build # adds openssl\n  depends_on \"osgeo-gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"osgeo-gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    ENV.cxx11\n    mysql = Formula[\"mysql\"]\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n\n    # cxx flags\n    args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n              -Iogr/ogrsf_frmts/mysql -I#{mysql.opt_include}/mysql]\n\n    # source files\n    Dir[\"ogr/ogrsf_frmts/mysql/*.c*\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"ogr_MySQL.dylib\"\n    args.concat %W[\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[\n      #{mysql.opt_lib}/libmysqlclient.a\n      -L#{Formula[\"openssl\"].opt_lib}\n      -lssl\n      -lcrypto\n    ]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"osgeo-gdal\"].opt_bin\n    out = shell_output(\"#{gdal_opt_bin}/ogrinfo --formats\")\n    assert_match \"MySQL -vector- (rw+)\", out\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-ogdi.rb",
    "content": "class OsgeoGdalOgdi < Formula\n  desc \"GDAL/OGR 3.x plugin for OGDI driver\"\n  homepage \"http://www.gdal.org/drv_ogdi.html\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n\n  #revision 1\n  \n  head \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n\n  #bottle do\n  #  root_url \"https://bottle.download.osgeo.org\"\n  #  cellar :any\n  #  sha256 \"33c1448189416e6812f3d05af2f0751daf604d4be188363707bc2a7d6b24f5e8\" => :catalina\n  #  sha256 \"33c1448189416e6812f3d05af2f0751daf604d4be188363707bc2a7d6b24f5e8\" => :mojave\n  #  sha256 \"33c1448189416e6812f3d05af2f0751daf604d4be188363707bc2a7d6b24f5e8\" => :high_sierra\n  #end\n\n  depends_on \"osgeo-ogdi\"\n  depends_on \"osgeo-gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"osgeo-gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    ENV.cxx11\n    ogdi_opt = Formula[\"osgeo-ogdi\"].opt_prefix\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n    # (HOMEBREW_PREFIX/\"lib/#{gdal_plugins_subdirectory}\").mkpath\n\n    # add external plugin registration\n    inreplace \"#{Dir.pwd}/ogr/ogrsf_frmts/ogdi/ogrogdi.h\",\n              %r{(#endif /\\* OGDOGDI_H_INCLUDED \\*/)},\n              <<~EOS\n\n              CPL_C_START\n              void CPL_DLL RegisterOGROGDI();\n              CPL_C_END\n\n              \\\\1\n              EOS\n\n    # cxx flags\n    args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n              -Iogr/ogrsf_frmts/ogdi -I#{ogdi_opt}/include/ogdi]\n\n    # source files\n    Dir[\"ogr/ogrsf_frmts/ogdi/*.c*\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"ogr_OGDI.dylib\"\n    args.concat %W[\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{ogdi_opt}/lib/ogdi -logdi]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n  end\n\n  def caveats; <<~EOS\n    This formula provides a plugin that allows GDAL or OGR to access geospatial\n    data stored in its format. In order to use the shared plugin, you may need\n    to set the following enviroment variable:\n\n      export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n  EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"osgeo-gdal\"].opt_bin\n    out = shell_output(\"#{gdal_opt_bin}/ogrinfo --formats\")\n    assert_match \"OGR_OGDI -vector- (ro): OGDI Vectors (VPF, VMAP, DCW)\", out\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-oracle.rb",
    "content": "class OsgeoGdalOracle < Formula\n  desc \"GDAL/OGR 3.x plugin for Oracle Spatial driver\"\n  homepage \"http://www.gdal.org/drv_oci.html\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n\n  # revision 1\n\n  head \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n\n  # bottle do\n  #   never\n  # end\n\n  depends_on \"osgeo-oracle-client-sdk\"\n  depends_on \"osgeo-gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"osgeo-gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    oracle_opt = Formula[\"osgeo-oracle-client-sdk\"].opt_prefix\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n\n    # cxx flags\n    args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n              -Iogr/ogrsf_frmts/oci -I#{oracle_opt}/include/oci]\n\n    # source files\n    Dir[\"ogr/ogrsf_frmts/oci/oci_utils.cpp\", \"ogr/ogrsf_frmts/oci/ogr*.c*\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"ogr_OCI.dylib\"\n    args.concat %W[\n      -std=c++11\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{oracle_opt}/lib -lclntsh]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"osgeo-gdal\"].opt_bin\n    out = shell_output(\"#{gdal_opt_bin}/ogrinfo --formats\")\n    assert_match \"OCI -vector- (rw+)\", out\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-pdf.rb",
    "content": "class OsgeoGdalPdf < Formula\n  desc \"GDAL/OGR 3.x plugin for PDF driver\"\n  homepage \"http://www.gdal.org/frmt_pdf.html\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n\n  #revision 1\n  \n  head \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"3daada45817c48da90738d7b8052e2bd5fb25117e2c25c35bed2030f2b96517a\" => :catalina\n    sha256 \"3daada45817c48da90738d7b8052e2bd5fb25117e2c25c35bed2030f2b96517a\" => :mojave\n    sha256 \"3daada45817c48da90738d7b8052e2bd5fb25117e2c25c35bed2030f2b96517a\" => :high_sierra\n  end\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"cairo\"\n  depends_on \"fontconfig\"\n  depends_on \"freetype\"\n  depends_on \"gettext\"\n  depends_on \"glib\"\n  depends_on \"gobject-introspection\"\n  depends_on \"jpeg\"\n  depends_on \"libpng\"\n  depends_on \"libtiff\"\n  depends_on \"osgeo-libgeotiff\"\n  depends_on \"openjpeg\"\n  depends_on \"podofo\"\n  # TODO: new code for GDAL >3.1 from: \n  # https://github.com/rouault/pdfium_build_gdal_3_1\n  #depends_on \"osgeo-pdfium\"\n  depends_on \"osgeo-gdal\"\n\n  # various deps needed for configuring\n  depends_on \"json-c\"\n\n  # upstream poppler 0.59.0 incompatibility\n  resource \"poppler\" do\n    url \"https://poppler.freedesktop.org/poppler-0.57.0.tar.xz\"\n    sha256 \"0ea37de71b7db78212ebc79df59f99b66409a29c2eac4d882dae9f2397fe44d8\"\n  end\n\n  resource \"poppler-data\" do\n    url \"https://poppler.freedesktop.org/poppler-data-0.4.8.tar.gz\"\n    sha256 \"1096a18161f263cccdc6d8a2eb5548c41ff8fcf9a3609243f1b6296abdf72872\"\n  end\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"osgeo-gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def configure_args\n    args = [\n      # Base configuration.\n      \"--prefix=#{prefix}\",\n      \"--mandir=#{man}\",\n      \"--disable-debug\",\n      \"--with-local=#{prefix}\",\n      \"--with-threads\",\n\n      # various deps needed for configuring\n      \"--with-libjson-c=#{Formula[\"json-c\"].opt_prefix}\",\n\n      # force correction of dylib setup, even though we are not building framework here\n      \"--with-macosx-framework\",\n      \"--enable-pdf-plugin\",\n      \"--without-libtool\"\n    ]\n\n    # PDF-supporting backends for writing\n    # args << \"--with-pdfium=#{Formula[\"osgeo-pdfium\"].opt_prefix}\"\n\n    # poppler is locally vendored\n    args << \"--with-poppler=#{libexec}/poppler\"\n    args << \"--with-podofo=#{Formula[\"podofo\"].opt_prefix}\"\n\n    # nix all other configure tests, i.e. minimal base gdal build\n    without_pkgs = %w[\n      armadillo bsb cfitsio cryptopp curl dds dods-root\n      ecw epsilon expat fgdb fme freexl\n      geos gif gnm grass grib gta\n      hdf4 hdf5 idb ingres\n      j2lura jasper java jp2mrsid jpeg jpeg12 kakadu kea\n      libgrass libkml liblzma libz\n      mdb mongocxx mrf mrsid_lidar mrsid msg mysql netcdf\n      oci odbc ogdi opencl openjpeg\n      pam pcidsk pcraster pcre perl pg php png python\n      qhull rasdaman rasterlite2\n      sde sfcgal sosi spatialite sqlite3 static-proj4\n      teigha webp xerces xml2\n    ]\n    args.concat without_pkgs.map { |b| \"--without-\" + b }\n    args\n  end\n\n  def install\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n\n    # ENV.cxx11\n    needs :cxx11 if MacOS.version < :mavericks\n    # ENV.libstdcxx\n    # set ARCHFLAGS to match how we build\n    ENV[\"ARCHFLAGS\"] = \"-arch #{Hardware::CPU.arch}\"\n    # ENV.append_to_cflags \"-mmacosx-version-min=10.8\"\n    # ENV[\"CXXFLAGS\"] = \"-mmacosx-version-min=10.8\"\n    # ENV[\"MACOSX_DEPLOYMENT_TARGET\"] = \"10.8\"\n\n    # locally vendor dependency\n    resource(\"poppler\").stage do\n      # Temp fix for supporting new OpenJPEG 2.x version, which is API/ABI compatible with OpenJPEG 2.2\n      opj_ver_list = Formula[\"openjpeg\"].version.to_s.split(\".\")\n      opj_ver = \"#{opj_ver_list[0]}.#{opj_ver_list[1]}\"\n      ENV[\"LIBOPENJPEG_CFLAGS\"] = \"-I#{Formula[\"openjpeg\"].opt_include}/openjpeg-#{opj_ver}\"\n\n      inreplace \"poppler.pc.in\", \"Cflags: -I${includedir}/poppler\",\n                \"Cflags: -I${includedir}/poppler -I${includedir}\"\n\n      system \"./configure\", \"--disable-dependency-tracking\",\n             \"--prefix=#{libexec}/poppler\",\n             \"--enable-xpdf-headers\",\n             \"--enable-poppler-glib\",\n             \"--disable-gtk-test\",\n             \"--enable-introspection=no\",\n             \"--disable-poppler-qt4\"\n      system \"make\", \"install\"\n      resource(\"poppler-data\").stage do\n        system \"make\", \"install\", \"prefix=#{libexec}/poppler\"\n      end\n    end\n\n    ENV.deparallelize\n\n    inreplace \"configure\", \"stdlib=libstdc\", \"stdlib=libc\"\n    inreplace \"configure\", \"-std=c++0x\", \"\"\n    # inreplace \"port/cpl_string.h\", /#ifndef HAVE_CXX11([^#]+)#endif/, \"\\\\1\"\n\n    # configure GDAL/OGR with minimal drivers\n    system \"./configure\", *configure_args\n\n    # PDF driver needs memory driver object files\n    cd \"ogr/ogrsf_frmts/mem\" do\n      system \"make\"\n    end\n\n    cd \"frmts/pdf\" do\n      system \"make\", \"plugin\"\n      mv \"gdal_PDF.dylib\", \"#{gdal_plugins}/\"\n    end\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"osgeo-gdal\"].opt_bin\n    out = shell_output(\"#{gdal_opt_bin}/gdalinfo --formats\")\n    assert_match \"PDF -raster,vector- (rw+s): Geospatial PDF\", out\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-python.rb",
    "content": "class OsgeoGdalPython < Formula\n  def self.gdal\n    Formula[\"osgeo-gdal\"]\n  end\n\n  def gdal\n    self.class.gdal\n  end\n\n  def self.gdal_opts\n    tab = Tab.for_formula(gdal)\n    tab.used_options\n  end\n\n  def gdal_opts\n    self.class.gdal_opts\n  end\n\n  def self.gdal_python(python)\n    py_ver = Language::Python.major_minor_version(python)\n    gdal.opt_lib/\"python#{py_ver}\"\n  end\n\n  def self.gdal_py3_exist?\n    gdal_python(\"python\").exist?\n  end\n\n  desc \"Python bindings for GDAL: Geospatial Data Abstraction Library\"\n  homepage \"https://pypi.python.org/pypi/GDAL\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n\n  #revision 2 \n\n  head \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"8e2ddaec0874f61df018c622cbf465985ae4dde2171d280464d15d02c72af192\" => :catalina\n    sha256 \"8e2ddaec0874f61df018c622cbf465985ae4dde2171d280464d15d02c72af192\" => :mojave\n    sha256 \"8e2ddaec0874f61df018c622cbf465985ae4dde2171d280464d15d02c72af192\" => :high_sierra\n  end\n\n  keg_only \"older version of gdal is in main tap and installs similar components\"\n\n  depends_on \"swig\" => :build\n  depends_on \"python\" => :recommended\n  depends_on \"numpy\"\n  depends_on \"osgeo-gdal\"\n\n  resource \"autotest\" do\n    url \"https://download.osgeo.org/gdal/3.1.2/gdalautotest-3.1.2.tar.gz\"\n    sha256 \"bf2b87acc8db0d59a3e44302a0e3b749dcd50ee642843f96c3db35b7e9ccb215\"\n  end\n\n  def install\n\n    cd \"swig/python\" do\n      # Customize to gdal install opt_prefix\n      inreplace \"setup.cfg\" do |s|\n        s.sub! \"../../apps/gdal-config\", \"#{gdal.opt_bin}/gdal-config\"\n      end\n      ENV.prepend \"LDFLAGS\", \"-L#{gdal.opt_lib}\" # or gdal1 lib will be found\n\n      # Check for GNM support\n      (Pathname.pwd/\"setup_vars.ini\").write \"GNM_ENABLED=yes\\n\" unless gdal_opts.include? \"without-gnm\"\n\n      python_version = Language::Python.major_minor_version \"python3\"\n\n      system \"python3\", *Language::Python.setup_install_args(prefix)\n      system \"echo\", \"#{opt_prefix}/lib/python#{python_version}/site-packages\",\n             \">\", \"#{lib}/python#{python_version}/site-packages/#{name}.pth\"\n\n      # Scripts compatible with Python3? Appear to be...\n      bin.install Dir[\"scripts/*\"]\n      # Clean up any stray doxygen files.\n      Dir.glob(\"#{bin}/*.dox\") { |p| rm p }\n      # Add sample Python scripts\n      (libexec/\"bin\").install Dir[\"samples/*\"]\n      chmod 0555, Dir[libexec/\"bin/*.py\"] # some randomly have no exec bit set\n    end\n  end\n\n  def caveats; <<~EOS\n    Sample Python scripts installed to:\n      #{opt_libexec}/bin\n\n    To run full test suite use:\n      `brew test -v #{name} --with-autotest`\n    EOS\n  end\n\n  test do\n    python_version = Language::Python.major_minor_version \"python3\"\n\n    next unless (lib/\"python#{python_version}/site-packages\").exist?\n    ENV[\"PYTHONPATH\"] = lib/\"python#{python_version}/site-packages\"\n    pkgs = %w[gdal ogr osr gdal_array gdalconst]\n    pkgs << \"gnm\" unless gdal_opts.include? \"without-gnm\"\n    system \"python3\", \"-c\", \"from osgeo import #{pkgs.join \",\"}\"\n\n    if ENV[\"GDAL_AUTOTEST\"]\n      ENV.prepend_path \"PATH\", gdal.opt_bin.to_s\n      ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n      ENV[\"GDAL_DATA\"] = \"#{gdal.opt_share}/gdal\"\n      ENV[\"GDAL_DOWNLOAD_TEST_DATA\"] = \"YES\"\n      # These driver tests cause hard failures, stopping test output\n      ENV[\"GDAL_SKIP\"] = \"GRASS\"\n      ENV[\"OGR_SKIP\"] = \"ElasticSearch,GFT,OGR_GRASS\"\n      Language::Python.each_python(build) do |python, python_version|\n        ENV[\"PYTHONPATH\"] = opt_lib/\"python#{python_version}/site-packages\"\n        resource(\"autotest\").stage do\n          # Split up tests, to reduce chance of execution expiration\n          # ogr gcore gdrivers osr alg gnm utilities pyscripts\n          %w[ogr gcore gdrivers osr alg gnm utilities pyscripts].each do |t|\n            begin\n              system \"python3\", \"run_all.py\", t.to_s\n            rescue\n              next\n            end\n          end\n        end\n        # Run autotest just once, with first found binding\n        break\n      end\n    else\n      ohai \"To run full test suite use:\\n\\n    `GDAL_AUTOTEST=1 brew test -v #{name}`\\n\"\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal-sosi.rb",
    "content": "class OsgeoGdalSosi < Formula\n  desc \"GDAL/OGR 3.x plugin for SOSI driver\"\n  homepage \"https://trac.osgeo.org/gdal/wiki/SOSI\"\n  url \"https://download.osgeo.org/gdal/3.1.1/gdal-3.1.1.tar.xz\"\n  sha256 \"97154a606339a6c1d87c80fb354d7456fe49828b2ef9a3bc9ed91771a03d2a04\"\n\n  #revision 1\n  \n  head \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n\n  #bottle do\n  #  root_url \"https://bottle.download.osgeo.org\"\n  #  cellar :any\n  #  sha256 \"15712928f08930894519dbb44294fd3747c4504ce99b5d3f3498ea1771bebfb8\" => :catalina\n  #  sha256 \"15712928f08930894519dbb44294fd3747c4504ce99b5d3f3498ea1771bebfb8\" => :mojave\n  #  sha256 \"15712928f08930894519dbb44294fd3747c4504ce99b5d3f3498ea1771bebfb8\" => :high_sierra\n  #end\n\n  depends_on \"osgeo-fyba\"\n  depends_on \"osgeo-gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"osgeo-gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    ENV.cxx11\n    fyba_opt = Formula[\"osgeo-fyba\"].opt_prefix\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n\n    # cxx flags\n    args = %W[-DLINUX -DUNIX -Iport -Igcore -Iogr\n              -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n              -Iogr/ogrsf_frmts/sosi -I#{fyba_opt}/include/fyba]\n\n    # source files\n    Dir[\"ogr/ogrsf_frmts/sosi/ogrsosi*.c*\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"ogr_SOSI.dylib\"\n    args.concat %W[\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{fyba_opt}/lib -lfyba -lfygm -lfyut]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"osgeo-gdal\"].opt_bin\n    out = shell_output(\"#{gdal_opt_bin}/ogrinfo --formats\")\n    assert_match \"SOSI -vector- (ro)\", out\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gdal.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_gdal_linked }\n\n  def core_gdal_linked\n    Formula[\"gdal\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink gdal\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies gdal\\e[0m\\n\\n\" if core_gdal_linked\n    s\n  end\nend\n\nclass OsgeoGdal < Formula\n  desc \"GDAL: Geospatial Data Abstraction Library\"\n  homepage \"https://www.gdal.org/\"\n  url \"https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz\"\n  sha256 \"767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641\"\n  #url \"https://github.com/OSGeo/gdal.git\",\n  #  :branch => \"release/3.1\",\n  #  :commit => \"a9e385e76d8f4e7891d10adf1fc99fe3a4a89602\"\n  #version \"3.1.2\"\n\n  revision 2  \n\n  head do\n    url \"https://github.com/OSGeo/gdal.git\", :branch => \"master\"\n    depends_on \"doxygen\" => :build\n  end\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    rebuild 1\n    sha256 \"5c0cfe587fff624ed20d33db5ffbf2c7f9bc9af026a9bcecf795b1a07193925d\" => :catalina\n    sha256 \"5c0cfe587fff624ed20d33db5ffbf2c7f9bc9af026a9bcecf795b1a07193925d\" => :mojave\n    sha256 \"5c0cfe587fff624ed20d33db5ffbf2c7f9bc9af026a9bcecf795b1a07193925d\" => :high_sierra\n  end\n\n  # keg_only \"gdal is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n  option \"with-pg11\", \"Build with PostgreSQL 11 client\"\n  #deprecated_option \"with-postgresql10\" => \"with-pg10\"\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"armadillo\"\n  depends_on \"ant\"\n  #depends_on \"cryptopp\"\n  depends_on \"curl-openssl\"\n  depends_on \"expat\"\n  depends_on \"freexl\"\n  depends_on \"geos\"\n  depends_on \"giflib\"\n  depends_on \"json-c\"\n  depends_on \"mdbtools\"\n  depends_on \"numpy\"\n  depends_on \"libiconv\"\n  depends_on \"osgeo-libkml\"\n  depends_on \"libpq\"\n  depends_on \"osgeo-libspatialite\"\n  depends_on \"libzip\"\n  depends_on \"pcre\" # for REGEXP operator in SQLite/Spatialite driver\n  depends_on \"openssl\"\n  depends_on \"qhull\"\n  depends_on \"sfcgal\"\n  depends_on \"sqlite\" # To ensure compatibility with SpatiaLite.\n  depends_on \"swig\"\n  depends_on \"zlib\"\n  \n  depends_on \"openjdk\" => :build\n  \n  # Raster libraries\n  depends_on \"cfitsio\"\n  depends_on \"epsilon\"\n  depends_on \"osgeo-hdf4\"\n  depends_on \"hdf5\"\n  #depends_on \"jpeg\"\n  depends_on \"jpeg-turbo\"\n  depends_on \"jasper\"\n  depends_on \"libdap\"\n  #depends_on \"osgeo-libgeotiff\"\n  depends_on \"libpng\"\n  #depends_on \"libtiff\"\n  depends_on \"libxml2\"\n  depends_on \"osgeo-netcdf\" # Also brings in HDF5\n  depends_on \"openjpeg\"\n  depends_on \"webp\"\n  depends_on \"zstd\"\n\n  # Vector libraries\n  depends_on \"unixodbc\" # OS X version is not complete enough\n  depends_on \"xerces-c\"\n\n  # Other libraries\n  depends_on \"xz\" # get liblzma compression algorithm library from XZutils\n\n  # depends_on \"charls\" # cask\n\n  depends_on \"osgeo-proj\"\n\n  if build.with?(\"pg10\")\n    depends_on \"osgeo-postgresql@10\"\n  elsif build.with?(\"pg11\")\n    depends_on \"osgeo-postgresql@11\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  # use: osgeo-gdal-pdf\n  # depends_on \"poppler\"\n\n  # use: osgeo-gdal-python\n  # depends_on \"python\"\n  # depends_on \"python@2\"\n\n  # - Base configuration\n  # - GDAL native backends\n  # - Supported backends: optional Homebrew packages supporting additional formats.\n  # - Unsupported backends: The libraries are either proprietary, not available for public\n  #   download or have no stable version in the Homebrew core that is\n  #   compatible with GDAL. Interested users will have to install such software\n  #   manually and most likely have to tweak the install routine.\n  # - GRASS backend explicitly disabled.  Creates a chicken-and-egg problem.\n  #   Should be installed separately after GRASS installation using the\n  #   official GDAL GRASS plugin.\n  # - Python is installed manually to ensure everything is properly sandboxed\n  # - All PDF driver functionality moved to gdal2-pdf plugin\n  #   Older pdfium (for gdal driver) is still built against libstdc++ and\n  #   causes the base build to be built like that as well.\n  #   See: https://github.com/rouault/pdfium\n  # - Database support\n\n    # Fix build with Jasper.\n  # Remove on next release.\n  # https://github.com/OSGeo/gdal/issues/2844\n  patch :p2 do\n    url \"https://github.com/OSGeo/gdal/commit/ab72c4893e6d14d488dfed25745d79f11bee45b9.patch?full_index=1\"\n    sha256 \"54e10575646666f31fb2a87b7fc5b2831282fe2fa08642231e94fdee1fee8374\"\n  end\n\n  patch :p2 do\n    url \"https://github.com/OSGeo/gdal/commit/e236eeaed1be45a4af457565085e3db1f2fc489f.patch?full_index=1\"\n    sha256 \"5b582258a556d96712761932bf94dbd3343a7a0ac61bb53c6c83a7ba4c962fe5\"\n  end\n\n  def configure_args\n    args = [\n      \"--prefix=#{prefix}\",\n      \"--disable-debug\",\n      \"--with-local=#{prefix}\",\n      \"--with-proj=#{Formula[\"osgeo-proj\"].opt_prefix}\",\n      \"--with-dods-root=#{Formula[\"libdap\"].opt_prefix}\", # #{HOMEBREW_PREFIX}\n      \"--with-libtool\",\n      \"--with-bsb\",\n      \"--with-grib\",\n      \"--with-pam\",\n      \"--with-opencl\",\n      \"--with-pcre\",\n      \"--with-threads=yes\",\n      \"--with-java=yes\",\n      \"--with-liblzma=yes\",\n      \"--with-pcidsk=internal\",\n      \"--with-pcraster=internal\",\n      \"--with-qhull=internal\",\n      \"--with-libz=#{Formula[\"libzip\"].opt_prefix}\",\n      \"--with-png=#{Formula[\"libpng\"].opt_prefix}\",\n      \"--with-libtiff=internal\", # #{Formula[\"libtiff\"].opt_prefix}\n      \"--with-geotiff=internal\", # #{Formula[\"osgeo-libgeotiff\"].opt_prefix}\n      \"--with-jpeg=#{Formula[\"jpeg-turbo\"].opt_prefix}\",\n      \"--with-gif=#{Formula[\"giflib\"].opt_prefix}\",\n      \"--with-libjson-c=#{Formula[\"json-c\"].opt_prefix}\",\n      \"--with-libiconv-prefix=#{Formula[\"libiconv\"].opt_prefix}\",\n      \"--with-zstd=#{Formula[\"zstd\"].opt_prefix}\",\n      \"--with-cfitsio=#{Formula[\"cfitsio\"].opt_prefix}\",\n      \"--with-hdf4=#{Formula[\"osgeo-hdf4\"].opt_prefix}\",\n      \"--with-hdf5=#{Formula[\"hdf5\"].opt_prefix}\",\n      \"--with-netcdf=#{Formula[\"osgeo-netcdf\"].opt_prefix}\",\n      \"--with-jasper=#{Formula[\"jasper\"].opt_prefix}\", #  or GDAL_SKIP=\"Jasper\"\n      \"--with-openjpeg=#{Formula[\"openjpeg\"].opt_prefix}\",\n      \"--with-expat=#{Formula[\"expat\"].opt_prefix}\",\n      \"--with-odbc=#{Formula[\"unixodbc\"].opt_prefix}\",\n      \"--with-curl=#{Formula[\"curl-openssl\"].opt_bin}/curl-config\",\n      \"--with-xml2=yes\",\n      \"--with-spatialite=#{Formula[\"osgeo-libspatialite\"].opt_prefix}\",\n      \"--with-sqlite3=#{Formula[\"sqlite\"].opt_prefix}\",\n      \"--with-webp=#{Formula[\"webp\"].opt_prefix}\",\n      \"--with-geos=#{Formula[\"geos\"].opt_bin}/geos-config\",\n      \"--with-freexl=#{Formula[\"freexl\"].opt_prefix}\",\n      \"--with-xerces=#{Formula[\"xerces-c\"].opt_prefix}\",\n      \"--with-libkml=#{Formula[\"osgeo-libkml\"].opt_prefix}\",\n      \"--with-epsilon=#{Formula[\"epsilon\"].opt_prefix}\",\n      \"--with-sfcgal=#{Formula[\"sfcgal\"].opt_bin}/sfcgal-config\",\n      \"--with-armadillo=#{Formula[\"armadillo\"].opt_prefix}\",\n      \"--with-cryptopp=no\",\n      \"--with-crypto=yes\",\n      \"--with-grass=no\",\n      \"--with-libgrass=no\",\n      \"--with-fme=no\",\n      \"--with-ecw=no\",\n      \"--with-kakadu=no\",\n      \"--with-mrsid=no\",\n      \"--with-jp2mrsid=no\",\n      \"--with-msg=no\",\n      \"--with-oci=no\",\n      \"--with-ingres=no\",\n      \"--with-idb=no\",\n      \"--with-sde=no\",\n      \"--with-perl=no\",\n      \"--with-python=no\",\n      \"--with-gta=no\",\n      \"--with-ogdi=no\",\n      \"--with-sosi=no\",\n      \"--with-mongocxx=no\",\n      \"--with-fgdb=no\",\n      \"--with-mrsid_lidar=no\",\n      \"--with-gnm\",\n      \"--with-mysql=no\",\n      \"--with-pg=yes\",\n      \"--with-poppler=no\",\n      \"--with-podofo=no\",\n      \"--with-pdfium=no\",\n      \"--with-kea=no\",\n      \"--with-teigha=no\",\n      \"--with-mdb=no\",\n      \"--with-dds=no\",\n      \"--with-hdfs=no\",\n      \"--with-j2lura=no\",\n      \"--with-rasterlite2=no\",\n      \"--with-rasdaman=no\",\n      # \"--with-charls\",\n\n      # \"--with-boost-lib-path\",\n      # \"--with-mongocxxv3\",\n      # \"--with-teigha-plt\",\n      # \"--with-jvm-lib\",\n      # \"--with-jvm-lib-add-rpath\",\n      # \"--with-cpp14\",\n      # \"--with-pic\",\n      # \"--with-aix-soname\",\n      # \"--with-gnu-ld\",\n      # \"--with-sysroot\",\n      # \"--with-unix-stdio-64\",\n      # \"--with-sse\",\n      # \"--with-ssse3\",\n      # \"--with-avx\",\n      # \"--with-hide-internal-symbols\",\n      # \"--with-rename-internal-libtiff-symbols\",\n      # \"--with-rename-internal-libgeotiff-symbols\",\n      # \"--with-rename-internal-shapelib-symbols\",\n      # \"--with-gnu-ld\",\n      # \"--with-spatialite-soname\",\n      # \"--with-sde-version\",\n      # \"--with-gdal-ver\",\n      # \"--with-macosx-framework\",\n      # \"--with-null\",\n      # \"--with-podofo-lib\",\n      # \"--with-podofo-extra-lib-for-test\",\n      # \"--with-pdfium-lib\",\n      # \"--with-pdfium-extra-lib-for-test\",\n      # \"--with-xerces-inc\",\n      # \"--with-xerces-lib\",\n      # \"--with-expat-inc\",\n      # \"--with-expat-lib\",\n      # \"--with-libkml-inc\",\n      # \"--with-libkml-lib\",\n      # \"--with-oci-include\",\n      # \"--with-oci-lib\",\n      # \"--with-opencl-include\",\n      # \"--with-opencl-lib\",\n\n      \"--without-jpeg12\", # Needs specially configured JPEG and TIFF libraries\n      # \"--without-lerc\",\n      # \"--without-libtool\",\n      # \"--without-ld-shared\",\n      # \"--without-libiconv-prefix\",\n      # \"--without-pam\",\n      # \"--without-php\",\n      # \"--without-dwgdirect\",\n      # \"--without-ruby\",\n    ]\n    args\n  end\n\n  def plugins_subdirectory\n    gdal_ver_list = version.to_s.split(\".\")\n    \"gdalplugins/#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def install\n    # Temporary fix for Xcode/CLT 9.0.x issue of missing header files\n    # See: https://github.com/OSGeo/homebrew-osgeo4mac/issues/276\n    # Work around \"error: no member named 'signbit' in the global namespace\"\n    if DevelopmentTools.clang_build_version >= 900\n      ENV.delete \"SDKROOT\"\n      ENV.delete \"HOMEBREW_SDKROOT\"\n    end\n\n    # Linking flags for SQLite are not added at a critical moment when the GDAL\n    # library is being assembled. This causes the build to fail due to missing\n    # symbols. Also, ensure Homebrew SQLite is used so that Spatialite is\n    # functional\n    # Fortunately, this can be remedied using LDFLAGS\n    sqlite = Formula[\"sqlite\"]\n    ENV.append \"LDFLAGS\", \"-L#{sqlite.opt_lib} -lsqlite3\"\n    ENV.append \"CFLAGS\", \"-I#{sqlite.opt_include}\"\n\n    # Reset ARCHFLAGS to match how we build\n    ENV[\"ARCHFLAGS\"] = \"-arch #{Hardware::CPU.arch}\"\n\n    # chdir \"gdal\" do\n      # GDAL looks for the renamed hdf4 library, which is an artifact of old builds, so we need to repoint it\n      inreplace \"configure\", \"-ldf\", \"-lhdf\"\n\n      # These libs are statically linked in libkml-dev and libkml formula\n      inreplace \"configure\", \" -lminizip -luriparser\", \"\"\n\n      # All PDF driver functionality moved to osgeo-gdal-pdf plugin,\n      # so nix default internal-built PDF w+ driver, which keeps plugin from loading.\n      # Just using --enable-pdf-plugin isn't enough (we don't want the plugin built here)\n      # inreplace \"GDALmake.opt.in\", \"PDF_PLUGIN),yes\", \"PDF_PLUGIN),no\"\n      # https://github.com/OSGeo/gdal/commit/20716436ce5debca66cbbe0396304e09b79bc3aa#diff-adc90aa0203327969e0048718b911252\n\n      args = configure_args\n\n      system \"./configure\", *args\n      system \"make\"\n      system \"make\", \"install\"\n\n      # Add GNM headers for osgeo-gdal-python swig wrapping\n      include.install Dir[\"gnm/**/*.h\"]\n\n      cd \"swig/java\" do\n        inreplace \"java.opt\", \"linux\", \"darwin\"\n        inreplace \"java.opt\", \"#JAVA_HOME = /usr/lib/jvm/java-6-openjdk/\", \"JAVA_HOME=#{ENV[\"JAVA_HOME\"]}\"\n        system \"make\"\n        system \"make\", \"install\"\n\n        # Install the jar that complements the native JNI bindings\n        lib.install \"gdal.jar\"\n      end\n\n      system \"make\", \"man\" if build.head?\n      system \"make\", \"install-man\"\n      # Clean up any stray doxygen files.\n      Dir.glob(\"#{bin}/*.dox\") { |p| rm p }\n    # end\n  end\n\n  def post_install\n    # Create versioned plugins path for other formulae\n    (HOMEBREW_PREFIX/\"lib/#{plugins_subdirectory}\").mkpath\n  end\n\n  def caveats\n    s = <<~EOS\n      Plugins for this version of GDAL/OGR, generated by other formulae, should\n      be symlinked to the following directory:\n\n        #{HOMEBREW_PREFIX}/lib/#{plugins_subdirectory}\n\n      You may need to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n\n      PYTHON BINDINGS are now built in a separate formula: osgeo-gdal-python\n    EOS\n    s\n  end\n\n  test do\n    # basic tests to see if third-party dylibs are loading OK\n    system \"#{bin}/gdalinfo\", \"--formats\"\n    system \"#{bin}/ogrinfo\", \"--formats\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gmt.rb",
    "content": "class OsgeoGmt < Formula\n  include Language::Python::Virtualenv\n  desc \"Tools for processing and displaying xy and xyz datasets\"\n  homepage \"https://gmt.soest.hawaii.edu/\"\n  url \"ftp://ftp.soest.hawaii.edu/gmt/gmt-5.4.5-src.tar.gz\"\n  mirror \"https://mirrors.ustc.edu.cn/gmt/gmt-5.4.5-src.tar.xz\"\n  mirror \"https://fossies.org/linux/misc/GMT/gmt-5.4.5-src.tar.xz\"\n  sha256 \"225629c7869e204d5f9f1a384c4ada43e243f83e1ed28bdca4f7c2896bf39ef6\"\n\n  revision 2\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    rebuild 1\n    sha256 \"ecf434fbf0e700d50f8d5b304d0ff9d963b94c7f8b66ef65664108bc1676d66e\" => :mojave\n    sha256 \"ecf434fbf0e700d50f8d5b304d0ff9d963b94c7f8b66ef65664108bc1676d66e\" => :high_sierra\n    sha256 \"2dd8acb9ce1d0415001851bc6d24cb63be8f74a75196d3d7d7b611a38dbd1103\" => :sierra\n  end\n\n  depends_on \"cmake\" => :build\n  depends_on \"fftw\"\n  depends_on \"hdf5\"\n  depends_on \"osgeo-netcdf\"\n  depends_on \"pcre\"\n  depends_on \"osgeo-gdal\"\n\n  depends_on \"zlib\"\n  depends_on \"curl\"\n  depends_on \"openblas\"\n  depends_on \"sphinx\"\n\n  depends_on \"ghostscript\"\n  depends_on \"graphicsmagick\"\n  depends_on \"subversion\"\n  depends_on \"lapack\"\n  # depends_on \"texlive\"\n\n  # Using CFLAGS = -I/Library/Java/JavaVirtualMachines/..\n  depends_on \"openjdk\" => :build\n\n  # OpenMP support: disabled\n\n  resource \"gshhg\" do\n    url \"ftp://ftp.soest.hawaii.edu/gmt/gshhg-gmt-2.3.7.tar.gz\"\n    mirror \"https://mirrors.ustc.edu.cn/gmt/gshhg-gmt-2.3.7.tar.gz\"\n    mirror \"https://fossies.org/linux/misc/GMT/gshhg-gmt-2.3.7.tar.gz\"\n    sha256 \"9bb1a956fca0718c083bef842e625797535a00ce81f175df08b042c2a92cfe7f\"\n  end\n\n  # digital chart of the world polygon map\n  resource \"dcw\" do\n    url \"ftp://ftp.soest.hawaii.edu/gmt/dcw-gmt-1.1.4.tar.gz\"\n    mirror \"https://mirrors.ustc.edu.cn/gmt/dcw-gmt-1.1.4.tar.gz\"\n    mirror \"https://fossies.org/linux/misc/GMT/dcw-gmt-1.1.4.tar.gz\"\n    sha256 \"8d47402abcd7f54a0f711365cd022e4eaea7da324edac83611ca035ea443aad3\"\n  end\n\n  # gmt-coast (optional) – coastlines\n\n  resource \"Sphinx\" do\n    url \"https://files.pythonhosted.org/packages/2a/86/8e1e8400bb6eca5ed960917952600fce90599e1cb0d20ddedd81ba163370/Sphinx-1.8.5.tar.gz\"\n    sha256 \"c7658aab75c920288a8cf6f09f244c6cfdae30d82d803ac1634d9f223a80ca08\"\n  end\n\n  def install\n    # install python modules\n    venv = virtualenv_create(libexec/'vendor', \"#{HOMEBREW_PREFIX}/opt/python/bin/python3\")\n\n    # venv.pip_install \"Sphinx\"\n\n    res = resources.map(&:name).to_set - %w[gshhg dcw]\n    res.each do |r|\n      venv.pip_install resource(r)\n    end\n\n    (buildpath/\"gshhg\").install resource(\"gshhg\")\n    (buildpath/\"dcw\").install resource(\"dcw\")\n\n    args = std_cmake_args.concat %W[\n      -DCMAKE_INSTALL_PREFIX=#{prefix}\n      -DGSHHG_ROOT=#{buildpath}/gshhg\n      -DCOPY_GSHHG:BOOL=TRUE\n      -DDCW_ROOT=#{buildpath}/dcw\n      -DCOPY_DCW:BOOL=TRUE\n      -DFFTW3_ROOT=#{Formula[\"fftw\"].opt_prefix}\n      -DGMT_INSTALL_MODULE_LINKS:BOOL=TRUE\n      -DGMT_INSTALL_TRADITIONAL_FOLDERNAMES:BOOL=FALSE\n      -DLICENSE_RESTRICTED:BOOL=FALSE\n    ]\n\n    # args << \"-DFLOCK:BOOL=TRUE\" # not used by the project\n    # args << \"-DCMAKE_CXX_FLAGS_RELEASE\"\n\n    args << \"-DGMT_DOCDIR=#{share}/doc/gmt\"\n    args << \"-DGMT_MANDIR=#{man}\"\n    # args << \"-DGMT_DATADIR=#{share}/gmt\"\n\n    args << \"-DPCRE_ROOT=#{Formula[\"pcre\"].opt_prefix}\" # PCRE_DIR\n\n    args << \"-DGDAL_ROOT=#{Formula[\"osgeo-gdal\"].opt_prefix}\" # GDAL_DIR\n\n    args << \"-DNETCDF_ROOT=#{Formula[\"osgeo-netcdf\"].opt_prefix}\" # NETCDF_DIR\n\n    # SPHINX_DIR or SPHINX_ROOT\n    # args << \"-DSPHINX_EXECUTABLE=#{Formula[\"sphinx\"].opt_bin}\" # sphinx-build\n    args << \"-DSPHINX_EXECUTABLE=#{libexec}/vendor/bin/sphinx-build\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n    system \"#{bin}/pscoast -R0/360/-70/70 -Jm1.2e-2i -Ba60f30/a30f15 -Dc -G240 -W1/0 -P > test.ps\"\n    assert_predicate testpath/\"test.ps\", :exist?\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-gpkgtools.rb",
    "content": "require 'formula'\n\nclass OsgeoGpkgtools < Formula\n  desc \"Some tools for the GeoPackage mapping (vector, tiles and raster) container\"\n  homepage 'https://launchpad.net/gpkgtools'\n\n  revision 1\n\n  head \"lp:gpkgtools\", :using => :bzr\n\n  depends_on 'osgeo-libspatialite'\n  depends_on \"python@2\"\n\n  resource \"Pillow\" do\n    url \"https://files.pythonhosted.org/packages/81/1a/6b2971adc1bca55b9a53ed1efa372acff7e8b9913982a396f3fa046efaf8/Pillow-6.0.0.tar.gz\"\n    sha256 \"809c0a2ce9032cbcd7b5313f71af4bdc5c8c771cb86eb7559afd954cab82ebb5\"\n  end\n\n  def install\n    head_ext = \"#{HOMEBREW_PREFIX}/Cellar/osgeo-libspatialite/HEAD/lib/spatialite.dylib\"\n    unless File.exist? head_ext\n      odie <<~EOS\n        No osgeo-libspatialite HEAD build or SQLite3 extension 'spatialite.dylib' exists.\n        Install osgeo-libspatialite using --HEAD and --with-geopackage options'.\n        NOTE: To experiment with the HEAD build, but already have osgeo-libspatialite\n              installed, do the following:\n                `brew upgrade osgeo-libspatialite --HEAD --with-geopackage`\n                `brew list --versions osgeo-libspatialite` (note non-HEAD version)\n                `brew switch osgeo-libspatialite <non-HEAD version>`\n      EOS\n    end\n\n    resource(\"Pillow\").stage { system \"python\", *Language::Python.setup_install_args(libexec/\"vendor\") }\n\n    cd 'gpkgtools' do\n      inreplace %w[util_sqlite.py GeoPackage.py] do |s|\n        s.sub! 'from pysqlite2', '#from pysqlite2'\n        s.sub! '#import sqlite3', 'import sqlite3'\n        s.sub! /load_extension\\(.*spatialite\"\\)/, \"load_extension('#{head_ext}')\"\n      end\n    end\n\n    (lib/python.xy/'site-packages').install 'gpkgtools'\n    bin.install Dir['*gpkg*']\n    prefix.install %w[tests testdata]\n  end\n\n  test do\n    cd \"#{opt_prefix}\" do\n      system 'python', 'tests/geonames.py'\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-grass.rb",
    "content": "class OsgeoGrass < Formula\n  include Language::Python::Virtualenv\n\n  desc \"Geographic Resources Analysis Support System\"\n  homepage \"https://grass.osgeo.org/\"\n\n  revision 7\n\n  # svn: E230001: Server SSL certificate verification failed: issuer is not trusted\n  # head \"https://svn.osgeo.org/grass/grass/trunk\", :using => :svn\n  # head \"svn://svn.osgeo.org/grass/grass/trunk\"\n  # head \"https://github.com/GRASS-GIS/grass-ci.git\", :branch => \"master\"\n  head \"https://github.com/OSGeo/grass.git\", :branch => \"master\"\n\n  stable do\n    #url \"https://github.com/OSGeo/grass/archive/7.8.2.tar.gz\"\n    #sha256 \"07b69e2fe0678bca29d9303a90eaf4a29dddcfa97fa92e056e214f0415629b6d\"\n    url \"https://github.com/OSGeo/grass.git\",\n    :branch => \"releasebranch_7_8\",\n    :commit => \"8bcecc9a609bff0184519b124df17fb38e1195a5\"\n    version \"7.8.3\"\n\n    # Patches to keep files from being installed outside of the prefix.\n    # Remove lines from Makefile that try to install to /Library/Documentation.\n    # no_symbolic_links\n    patch :DATA\n  end\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"a7f144c886435ab9c4fab9f3096882709f00b319d476648f42a145b3531de1a7\" => :catalina\n    sha256 \"a7f144c886435ab9c4fab9f3096882709f00b319d476648f42a145b3531de1a7\" => :mojave\n    sha256 \"a7f144c886435ab9c4fab9f3096882709f00b319d476648f42a145b3531de1a7\" => :high_sierra\n  end\n\n  option \"without-gui\", \"Build without WxPython interface. Command line tools still available\"\n  option \"with-aqua\", \"Build with experimental Aqua GUI backend\"\n  option \"with-app\", \"Build GRASS.app Package\"\n  option \"with-avce00\", \"Build with AVCE00 support: Make Arc/Info (binary) Vector Coverages appear as E00\"\n  option \"with-pg11\", \"Build with PostgreSQL 11 client\"\n  option \"with-mysql\", \"Build with MySQL client\"\n  option \"with-others\", \"Build with other optional dependencies\"\n  # option \"with-openmp\", \"Build with openmp support\"\n  # option \"with-opendwg\", \"Build with OpenDWG support\"\n  # option \"with-pdal\", \"Build with PDAL support\" # Build - Error: /vector/v.in.pdal\n\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"fftw\" => :recommended\n  depends_on \"tcl-tk\" => :recommended\n  depends_on \"python\"\n  depends_on \"boost\"\n  depends_on \"libiconv\"\n  depends_on \"bison\"\n  depends_on \"cairo\"\n  depends_on \"flex\"\n  depends_on \"freetype\"\n  depends_on \"gettext\"\n  depends_on \"ghostscript\"\n  depends_on \"libtiff\"\n  depends_on \"libpng\"\n  depends_on \"sqlite\"\n  depends_on \"regex-opt\"\n  depends_on \"geos\"\n  depends_on \"readline\"\n  depends_on \"lapack\"\n  depends_on \"openblas\"\n  depends_on \"bzip2\"\n  depends_on \"zlib\"\n  depends_on \"unixodbc\"\n  depends_on \"wxmac\"\n  depends_on \"wxpython\"\n  depends_on \"zstd\"\n  depends_on \"lbzip2\"\n  depends_on \"xz\"\n  depends_on \"byacc\" # yacc\n  depends_on \"subversion\" # for g.extension\n  depends_on \"openjpeg\" # for Pillow\n  depends_on \"osgeo-netcdf\"\n  depends_on \"osgeo-proj\"\n  depends_on \"osgeo-gdal\"\n  depends_on \"osgeo-gdal-python\"\n  depends_on \"osgeo-libgeotiff\"\n\n  # matplotlib\n  depends_on \"py3cairo\"\n  depends_on \"pygobject3\"\n  # depends_on \"pygobject\" # Does not support Python 3, and needs pygtk which has been removed.\n  depends_on \"pyqt\"\n  depends_on \"osgeo-six\"\n  depends_on \"numpy\"\n  depends_on \"scipy\"\n  depends_on \"osgeo-matplotlib\"\n\n  # optional dependencies\n  #depends_on \"osgeo-liblas\"\n  depends_on \"mysql\" if build.with? \"mysql\"\n  #depends_on \"r\"\n  depends_on \"avce00\" => :optional # avcimport\n  # depends_on \"libomp\" if build.with? \"openmp\"\n  # depends_on \"osgeo-pdal\"\n\n  if build.with?(\"pg11\")\n    depends_on \"osgeo-postgresql@11\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  depends_on :x11 if build.without? \"aqua\" # needs to find at least X11/include/GL/gl.h\n\n  # other dependencies\n  if build.with? \"others\"\n    depends_on \"gpsbabel\"\n    depends_on \"netpbm\" # mpeg_encode or ppmtompeg\n    depends_on \"openssl\"\n    depends_on \"swig\"\n    depends_on \"ffmpeg\"\n    depends_on \"ffmpeg2theora\"\n    depends_on \"ffmpegthumbnailer\"\n    depends_on \"libav\"\n    depends_on \"jasper\"\n    depends_on \"wget\"\n    depends_on \"dateutils\"\n    depends_on \"gsl\"\n    depends_on \"ncurses\"\n    depends_on \"gdbm\"\n    depends_on \"mesa\"\n    depends_on \"mesalib-glw\"\n    depends_on \"desktop-file-utils\"\n    depends_on \"fontconfig\"\n    depends_on \"openmotif\" # or lesstif\n    depends_on \"libjpeg-turbo\"\n    depends_on \"cfitsio\"\n    depends_on \"imagemagick\"\n    depends_on \"gd\"\n    # depends_on \"mariadb-connector-c\"\n    # depends_on \"mariadb\"\n  end\n\n  def headless?\n    # The GRASS GUI is based on WxPython.\n    build.without? \"gui\"\n  end\n\n  def majmin_ver\n    ver_split = version.to_s.split(\".\")\n    ver_split[0] + ver_split[1]\n  end\n\n  resource \"setuptools\" do\n    url \"https://files.pythonhosted.org/packages/42/3e/2464120172859e5d103e5500315fb5555b1e908c0dacc73d80d35a9480ca/setuptools-45.1.0.zip\"\n    sha256 \"91f72d83602a6e5e4a9e4fe296e27185854038d7cbda49dcd7006c4d3b3b89d5\"\n  end\n\n  resource \"pip\" do\n    url \"https://files.pythonhosted.org/packages/8e/76/66066b7bc71817238924c7e4b448abdb17eb0c92d645769c223f9ace478f/pip-20.0.2.tar.gz\"\n    sha256 \"7db0c8ea4c7ea51c8049640e8e6e7fde949de672bfa4949920675563a5a6967f\"\n  end\n\n  resource \"wheel\" do\n    url \"https://files.pythonhosted.org/packages/75/28/521c6dc7fef23a68368efefdcd682f5b3d1d58c2b90b06dc1d0b805b51ae/wheel-0.34.2.tar.gz\"\n    sha256 \"8788e9155fe14f54164c1b9eb0a319d98ef02c160725587ad60f14ddc57b6f96\"\n  end\n\n  resource \"Pillow\" do\n    url \"https://files.pythonhosted.org/packages/39/47/f28067b187dd664d205f75b07dcc6e0e95703e134008a14814827eebcaab/Pillow-7.0.0.tar.gz\"\n    sha256 \"4d9ed9a64095e031435af120d3c910148067087541131e82b3e8db302f4c8946\"\n  end\n\n  resource \"ply\" do\n    url \"https://files.pythonhosted.org/packages/e5/69/882ee5c9d017149285cab114ebeab373308ef0f874fcdac9beb90e0ac4da/ply-3.11.tar.gz\"\n    sha256 \"00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3\"\n  end\n\n  resource \"argparse\" do\n    url \"https://files.pythonhosted.org/packages/18/dd/e617cfc3f6210ae183374cd9f6a26b20514bbb5a792af97949c5aacddf0f/argparse-1.4.0.tar.gz\"\n    sha256 \"62b089a55be1d8949cd2bc7e0df0bddb9e028faefc8c32038cc84862aefdd6e4\"\n  end\n\n  resource \"python-dateutil\" do\n    url \"https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz\"\n    sha256 \"73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c\"\n  end\n\n  # resource \"six\" do\n  #   url \"https://files.pythonhosted.org/packages/21/9f/b251f7f8a76dec1d6651be194dfba8fb8d7781d10ab3987190de8391d08e/six-1.14.0.tar.gz\"\n  #   sha256 \"236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a\"\n  # end\n\n  resource \"PyOpenGL\" do\n    url \"https://files.pythonhosted.org/packages/b8/73/31c8177f3d236e9a5424f7267659c70ccea604dab0585bfcd55828397746/PyOpenGL-3.1.5.tar.gz\"\n    sha256 \"4107ba0d0390da5766a08c242cf0cf3404c377ed293c5f6d701e457c57ba3424\"\n  end\n\n  resource \"psycopg2\" do\n    url \"https://files.pythonhosted.org/packages/84/d7/6a93c99b5ba4d4d22daa3928b983cec66df4536ca50b22ce5dcac65e4e71/psycopg2-2.8.4.tar.gz\"\n    sha256 \"f898e5cc0a662a9e12bde6f931263a1bbd350cfb18e1d5336a12927851825bb6\"\n  end\n\n  resource \"termcolor\" do\n    url \"https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz\"\n    sha256 \"1d6d69ce66211143803fbc56652b41d73b4a400a2891d7bf7a1cdf4c02de613b\"\n  end\n\n  # for matplotlib\n\n  resource \"cycler\" do\n    url \"https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz\"\n    sha256 \"cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8\"\n  end\n\n  resource \"kiwisolver\" do\n    url \"https://files.pythonhosted.org/packages/16/e7/df58eb8868d183223692d2a62529a594f6414964a3ae93548467b146a24d/kiwisolver-1.1.0.tar.gz\"\n    sha256 \"53eaed412477c836e1b9522c19858a8557d6e595077830146182225613b11a75\"\n  end\n\n  resource \"pyparsing\" do\n    url \"https://files.pythonhosted.org/packages/a2/56/0404c03c83cfcca229071d3c921d7d79ed385060bbe969fde3fd8f774ebd/pyparsing-2.4.6.tar.gz\"\n    sha256 \"4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f\"\n  end\n\n  resource \"pytz\" do\n    url \"https://files.pythonhosted.org/packages/82/c3/534ddba230bd4fbbd3b7a3d35f3341d014cca213f369a9940925e7e5f691/pytz-2019.3.tar.gz\"\n    sha256 \"b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be\"\n  end\n\n  # resource \"tornado\" do\n  #   url \"https://files.pythonhosted.org/packages/e6/78/6e7b5af12c12bdf38ca9bfe863fcaf53dc10430a312d0324e76c1e5ca426/tornado-5.1.1.tar.gz\"\n  #   sha256 \"4e5158d97583502a7e2739951553cbd88a72076f152b4b11b64b9a10c4c49409\"\n  # end\n\n  resource \"tornado\" do\n    url \"https://files.pythonhosted.org/packages/30/78/2d2823598496127b21423baffaa186b668f73cd91887fcef78b6eade136b/tornado-6.0.3.tar.gz\"\n    sha256 \"c845db36ba616912074c5b1ee897f8e0124df269468f25e4fe21fe72f6edd7a9\"\n  end\n\n  resource \"cairocffi\" do\n    url \"https://files.pythonhosted.org/packages/f7/99/b3a2c6393563ccbe081ffcceb359ec27a6227792c5169604c1bd8128031a/cairocffi-1.1.0.tar.gz\"\n    sha256 \"f1c0c5878f74ac9ccb5d48b2601fcc75390c881ce476e79f4cfedd288b1b05db\"\n  end\n\n  resource \"subprocess32\" do\n    url \"https://files.pythonhosted.org/packages/32/c8/564be4d12629b912ea431f1a50eb8b3b9d00f1a0b1ceff17f266be190007/subprocess32-3.5.4.tar.gz\"\n    sha256 \"eb2937c80497978d181efa1b839ec2d9622cf9600a039a79d0e108d1f9aec79d\"\n  end\n\n  resource \"backports.functools_lru_cache\" do\n    url \"https://files.pythonhosted.org/packages/ad/2e/aa84668861c3de458c5bcbfb9813f0e26434e2232d3e294469e96efac884/backports.functools_lru_cache-1.6.1.tar.gz\"\n    sha256 \"8fde5f188da2d593bd5bc0be98d9abc46c95bb8a9dde93429570192ee6cc2d4a\"\n  end\n\n  # resource \"numpy\" do\n  #   url \"https://files.pythonhosted.org/packages/40/de/0ea5092b8bfd2e3aa6fdbb2e499a9f9adf810992884d414defc1573dca3f/numpy-1.18.1.zip\"\n  #   sha256 \"b6ff59cee96b454516e47e7721098e6ceebef435e3e21ac2d6c3b8b02628eb77\"\n  # end\n\n  # python version >= 3.5 required\n  # resource \"scipy\" do\n  #   url \"https://files.pythonhosted.org/packages/04/ab/e2eb3e3f90b9363040a3d885ccc5c79fe20c5b8a3caa8fe3bf47ff653260/scipy-1.4.1.tar.gz\"\n  #   sha256 \"dee1bbf3a6c8f73b6b218cb28eed8dd13347ea2f87d572ce19b289d6fd3fbc59\"\n  # end\n\n  # \"error: no member named 'signbit' in the global namespace\"\n  # resource \"matplotlib\" do\n  #   url \"https://github.com/matplotlib/matplotlib/archive/v2.2.5.tar.gz\"\n  #   sha256 \"75e9de4e4e47ae4cb23393e9df9431424d5034da77771d598ff14363d6a51dd1\"\n  # end\n\n  # resource \"matplotlib\" do\n  #   url \"https://github.com/matplotlib/matplotlib/archive/v3.1.3.tar.gz\"\n  #   sha256 \"6edfe021671fcad1bd6081c980c380cb3d66d00895eb8c3450fa3842c441d1d1\"\n  # end\n\n  # resource \"wxPython\" do\n  #   url \"https://files.pythonhosted.org/packages/b9/8b/31267dd6d026a082faed35ec8d97522c0236f2e083bf15aff64d982215e1/wxPython-4.0.7.post2.tar.gz\"\n  #   sha256 \"5a229e695b64f9864d30a5315e0c1e4ff5e02effede0a07f16e8d856737a0c4e\"\n  # end\n\n  def install\n    # Work around \"error: no member named 'signbit' in the global namespace\"\n    # encountered when trying to detect boost regex in configure\n    if DevelopmentTools.clang_build_version >= 900\n      ENV.delete \"SDKROOT\"\n      ENV.delete \"HOMEBREW_SDKROOT\"\n    end\n\n    # ENV.append \"CPPFLAGS\", \"\"\n    # ENV.append \"LDFLAGS\", \"-framework OpenCL\"\n    # ENV.append \"CFLAGS\", \"-O2 -Werror=implicit-function-declaration\"\n    if build.with?(\"mysql\")\n      ENV[\"MYSQLD_CONFIG\"] = \"#{Formula[\"mysql\"].opt_bin}/mysql_config\"\n    end\n\n    # install python modules\n    venv = virtualenv_create(libexec/'vendor', \"#{Formula[\"python\"].opt_bin}/python3\")\n    res = resources.map(&:name).to_set # - %w[python-dateutil]\n\n    # fix pip._vendor.pep517.wrappers.BackendUnavailable\n    # system libexec/\"vendor/bin/pip3\", \"install\", \"--upgrade\", \"-v\", \"setuptools\", \"pip<19.0.0\", \"wheel\"\n    # venv.pip_install_and_link \"python-dateutil\"\n\n    res.each do |r|\n      venv.pip_install resource(r)\n    end\n\n    # noinspection RubyLiteralArrayInspection\n    args = [\n      \"--with-cxx\",\n      \"--enable-shared\",\n      \"--enable-largefile\",\n      \"--with-nls\",\n      \"--with-includes=#{HOMEBREW_PREFIX}/include\",\n      \"--with-libs=#{HOMEBREW_PREFIX}/LIB\",\n      \"--with-python=#{libexec}/vendor/bin/python-config\",\n      \"--with-tcltk\",\n      \"--with-netcdf=#{Formula[\"osgeo-netcdf\"].opt_bin}/nc-config\",\n      \"--with-zstd\",\n      \"--with-zstd-includes=#{Formula[\"zstd\"].opt_include}\",\n      \"--with-zstd-libs=#{Formula[\"zstd\"].opt_lib}\",\n      \"--with-readline\",\n      \"--with-readline-includes=#{Formula[\"readline\"].opt_include}\",\n      \"--with-readline-libs=#{Formula[\"readline\"].opt_lib}\",\n      \"--with-blas\",\n      \"--with-blas-includes=#{Formula[\"openblas\"].opt_include}\",\n      \"--with-blas-libs=#{Formula[\"openblas\"].opt_lib}\",\n      \"--with-lapack\",\n      \"--with-lapack-includes=#{Formula[\"lapack\"].opt_include}\",\n      \"--with-lapack-libs=#{Formula[\"lapack\"].opt_lib}\",\n      \"--with-geos=#{Formula[\"geos\"].opt_bin}/geos-config\",\n      \"--with-geos-includes=#{Formula[\"geos\"].opt_include}\",\n      \"--with-geos-libs=#{Formula[\"geos\"].opt_lib}\",\n      \"--with-odbc\",\n      \"--with-odbc-includes=#{Formula[\"unixodbc\"].opt_include}\",\n      \"--with-odbc-libs=#{Formula[\"unixodbc\"].opt_lib}\",\n      \"--with-gdal=#{Formula[\"osgeo-gdal\"].opt_bin}/gdal-config\",\n      \"--with-zlib-includes=#{Formula[\"zlib\"].opt_include}\",\n      \"--with-zlib-libs=#{Formula[\"zlib\"].opt_lib}\",\n      \"--with-bzlib\",\n      \"--with-bzlib-includes=#{Formula[\"bzip2\"].opt_include}\",\n      \"--with-bzlib-libs=#{Formula[\"bzip2\"].opt_lib}\",\n      \"--with-cairo\",\n      \"--with-cairo-includes=#{Formula[\"cairo\"].opt_include}/cairo\",\n      \"--with-cairo-libs=#{Formula[\"cairo\"].opt_lib}\",\n      \"--with-cairo-ldflags=-lfontconfig\",\n      \"--with-freetype\",\n      \"--with-freetype-includes=#{Formula[\"freetype\"].opt_include}/freetype2\",\n      \"--with-freetype-libs=#{Formula[\"freetype\"].opt_lib}\",\n      # \"--with-proj\",\n      \"--with-proj-includes=#{Formula[\"osgeo-proj\"].opt_include}\",\n      \"--with-proj-libs=#{Formula[\"osgeo-proj\"].opt_lib}\",\n      \"--with-proj-share=#{Formula[\"osgeo-proj\"].opt_share}/proj\",\n      \"--with-tiff\",\n      \"--with-tiff-includes=#{Formula[\"libtiff\"].opt_include}\",\n      \"--with-tiff-libs=#{Formula[\"libtiff\"].opt_lib}\",\n      \"--with-png\",\n      \"--with-png-includes=#{Formula[\"libpng\"].opt_include}\",\n      \"--with-png-libs=#{Formula[\"libpng\"].opt_lib}\",\n      \"--with-regex\",\n      # \"--with-regex-includes=#{Formula[\"regex-opt\"].opt_lib}\",\n      # \"--with-regex-libs=#{Formula[\"regex-opt\"].opt_lib}\",\n      \"--with-fftw\",\n      \"--with-fftw-includes=#{Formula[\"fftw\"].opt_include}\",\n      \"--with-fftw-libs=#{Formula[\"fftw\"].opt_lib}\",\n      \"--with-sqlite\",\n      \"--with-sqlite-includes=#{Formula[\"sqlite\"].opt_include}\",\n      \"--with-sqlite-libs=#{Formula[\"sqlite\"].opt_lib}\"\n    ]\n\n    # Disable some dependencies that don't build correctly on older version of MacOS\n    args << \"--without-fftw\" if build.without? \"fftw\"\n\n    #args << \"--with-liblas=#{Formula[\"osgeo-liblas\"].opt_bin}/liblas-config\" # if build.with? \"liblas\"\n\n    args << \"--with-postgres\"\n    if build.with?(\"pg11\")\n      args << \"--with-postgres-includes=#{Formula[\"osgeo-postgresql@11\"].opt_include}\"\n      args << \"--with-postgres-libs=#{Formula[\"osgeo-postgresql@11\"].opt_lib}\"\n    else\n      args << \"--with-postgres-includes=#{Formula[\"osgeo-postgresql\"].opt_include}\"\n      args << \"--with-postgres-libs=#{Formula[\"osgeo-postgresql\"].opt_lib}\"\n    end\n\n    if build.with?(\"mysql\")\n      args << \"--with-mysql\"\n      args << \"--with-mysql-includes=#{Formula[\"mysql\"].opt_include}/mysql\"\n      args << \"--with-mysql-libs=#{Formula[\"mysql\"].opt_lib}\"\n    end\n\n    args << \"--with-pthread\"\n    args << \"--with-pthread-includes=#{Formula[\"boost\"].opt_include}/boost/thread\"\n    args << \"--with-pthread-libs=#{Formula[\"boost\"].opt_lib}\"\n\n    # if build.with? \"pdal\"\n    #   args << \"--with-pdal=#{Formula[\"osgeo-pdal\"].opt_bin}/pdal-config\"\n    # end\n\n    # if build.with? \"opendwg\"\n    #   args << \"--with-opendwg\"\n    #   args << \"--with-opendwg-includes=\"\n    #   args << \"--with-opendwg-libs=\"\n    # end\n\n    # if build.with? \"openmp\"\n    #   # install openblas --with-openmp\n    #   args << \"--with-openmp\"\n    #   args << \"--with-openmp-includes=#{Formula[\"libomp\"].opt_include}\"\n    #   args << \"--with-openmp-libs=#{Formula[\"libomp\"].opt_lib}\"\n    # end\n\n    # if build.with? \"opencl\"\n    #   args << \"--with-opencl\"\n    #   args << \"--with-opencl-includes=\"\n    #   args << \"--with-opencl-libs=\"\n    # end\n\n    if MacOS.version >= :el_capitan\n      # handle stripping of DYLD_* env vars by SIP when passed to utilities;\n      # HOME env var is .brew_home during build, so it is still checked for lib\n      ln_sf \"#{buildpath}/dist.x86_64-apple-darwin#{`uname -r`.strip}/lib\", \".brew_home/lib\"\n    end\n\n    # NoMethodError: undefined method `prefer_64_bit?' for OS::Mac:Module\n    # MacOS.prefer_64_bit? is deprecated! There is no replacement.\n    # args << \"--enable-64bit\" if MacOS.prefer_64_bit?\n    # args << \"--with-macos-archs=#{MacOS.preferred_arch}\"\n\n    # unless MacOS::CLT.installed?\n    # On Xcode-only systems (without the CLT), we have to help:\n    args << \"--with-macosx-sdk=#{MacOS.sdk_path}\"\n    args << \"--with-macosx-archs=#{Hardware::CPU.arch}\" # Hardware::CPU.universal_archs\n    args << \"--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers\"\n    # args << \"--with-opengl-libs=\" # GL\n    # args << \"--with-opengl-framework=\"\n    # end\n\n    # Enable Aqua GUI, instead of X11\n    if build.with? \"aqua\"\n      args.concat [\n        \"--with-opengl=aqua\",\n        \"--without-glw\",\n        \"--without-motif\"\n      ]\n    end\n\n    if headless?\n      args << \"--without-wxwidgets\"\n    else\n      wx_paths = formula_site_packages \"wxpython\"\n      ENV.prepend(\"PYTHONPATH\", wx_paths, File::PATH_SEPARATOR) if wx_paths\n      args << \"--with-wxwidgets=#{Formula[\"wxmac\"].opt_bin}/wx-config\"\n    end\n\n    system \"./configure\", \"--prefix=#{prefix}\", *args\n    system \"make\", \"-j\", Hardware::CPU.cores, \"GDAL_DYNAMIC=\" # make and make install must be separate steps.\n    system \"make\", \"-j\", Hardware::CPU.cores, \"GDAL_DYNAMIC=\", \"install\" # GDAL_DYNAMIC set to blank for r.external compatability\n  end\n\n  def post_install\n    # ensure QGIS's Processing plugin recognizes install\n    # 2.14.8+ and other newer QGIS versions may reference just grass.sh\n    bin_grass = \"#{bin}/grass#{majmin_ver}\"\n    ln_sf \"#{bin_grass}\", \"#{prefix}/grass#{majmin_ver}/grass#{majmin_ver}.sh\"\n    ln_sf \"#{bin_grass}\", \"#{prefix}/grass#{majmin_ver}/grass.sh\"\n    # link so settings in external apps don't need updated on grass version bump\n    # in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass7/grass-base\n    ln_sf \"grass#{majmin_ver}\", \"#{prefix}/grass-base\"\n    # Writes a wrapper env script and moves all files to the dst\n\n    # ensure python3 is used\n    # for some reason, in this build (v7.6.1_1), the script is not created.\n    # bin.env_script_all_files(\"#{libexec}/bin\", :GRASS_PYTHON => \"python3\")\n    # for this reason we move the binary and create another that will call\n    # this with the requirements mentioned above.\n    mkdir \"#{libexec}/bin\"\n    mv \"#{bin}/grass#{majmin_ver}\", \"#{libexec}/bin/grass#{majmin_ver}\"\n    # And fix \"ValueError: unknown locale: UTF-8\"\n    # if exist: rm \"#{bin}/grass#{majmin_ver}\"\n    File.open(\"#{bin}/grass#{majmin_ver}\", \"w\") { |file|\n      file << '#!/bin/bash'\n      file << \"\\n\"\n      file << \"export LANG=en_US.UTF-8\"\n      file << \"\\n\"\n      file << \"export LC_CTYPE=en_US.UTF-8\"\n      file << \"\\n\"\n      file << \"export LC_ALL=en_US.UTF-8\"\n      file << \"\\n\"\n      file << \"export GRASS_PREFIX=#{prefix}/grass-base\"\n      file << \"\\n\"\n      file << \"export GRASS_SH=/bin/sh\"\n      file << \"\\n\"\n      file << \"export GRASS_PROJSHARE=#{Formula[\"osgeo-proj\"].opt_share}\"\n      file << \"\\n\"\n      file << \"export GRASS_VERSION=#{version}\"\n      file << \"\\n\"\n      file << \"export GRASS_LD_LIBRARY_PATH=#{prefix}/grass#{majmin_ver}/lib\"\n      file << \"\\n\"\n      # file << \"export GRASS_PERL=#{Formula[\"perl\"].opt_bin}/perl\"\n      # file << \"\\n\"\n      file << \"export PROJ_LIB=#{Formula[\"osgeo-proj\"].opt_lib}\"\n      file << \"\\n\"\n      file << \"export GEOTIFF_CSV=#{Formula[\"osgeo-libgeotiff\"].opt_share}/epsg_csv\"\n      file << \"\\n\"\n      file << \"export GDAL_DATA=#{Formula[\"osgeo-gdal\"].opt_share}/gdal\"\n      # file << \"\\n\"\n      # file << \"export PYTHONHOME=#{Formula[\"python\"].opt_frameworks}/Python.framework/Versions/#{py_ver}:$PYTHONHOME\"\n      # file << \"export R_HOME=#{Formula[\"r\"].opt_bin}/R:$R_HOME\"\n      # file << \"export R_HOME=/Applications/RStudio.app/Contents/MacOS/RStudio:$R_HOME\"\n      # file << \"export R_USER=USER_PROFILE/Documents\"\n      file << \"\\n\"\n      file << \"GRASS_PYTHON=python3 exec #{libexec}/bin/grass#{majmin_ver} $@\"\n      # file << \"GISBASE=#{HOMEBREW_PREFIX}/osgeo-grass\"\n      # file << \"PATH=#{PATH}:#{GISBASE}/bin:#{GISBASE}/scripts\"\n      # file << \"MANPATH=#{MANPATH}:#{GISBASE}/man\"\n    }\n    chmod(\"+x\", \"#{bin}/grass#{majmin_ver}\")\n    chmod(\"+x\", \"#{libexec}/bin/grass#{majmin_ver}\")\n\n    # for \"--enable-macosx-app\"\n    # mkdir - permission denied: /Library/GRASS\n    if build.with? \"app\"\n      (\"#{prefix}/GRASS7.app/Contents/PkgInfo\").write \"APPLGRASS\"\n      mkdir \"#{prefix}/GRASS7.app/Contents/Resources\"\n      cp_r \"#{buildpath}/macosx/app/app.icns\", \"#{prefix}/GRASS7.app/Contents/Resources\"\n\n      config = <<~EOS\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n        <plist version=\"1.0\">\n        <dict>\n          <key>CFBundleDevelopmentRegion</key>\n          <string>English</string>\n          <key>CFBundleExecutable</key>\n          <string>grass#{majmin_ver}</string>\n          <key>CFBundleGetInfoString</key>\n          <string>GRASS GIS #{version}</string>\n          <key>CFBundleIconFile</key>\n          <string>app.icns</string>\n          <key>CFBundleIdentifier</key>\n          <string>https://grass.osgeo.org/grass#{majmin_ver}/source/</string>\n          <key>CFBundleInfoDictionaryVersion</key>\n          <string>6.0</string>\n          <key>CFBundlePackageType</key>\n          <string>APPL</string>\n          <key>CFBundleShortVersionString</key>\n          <string>GRASS GIS #{version}</string>\n          <key>CFBundleSignature</key>\n          <string>????</string>\n          <key>CFBundleVersion</key>\n          <string>#{version}</string>\n          <key>NSMainNibFile</key>\n          <string>MainMenu.nib</string>\n          <key>NSPrincipalClass</key>\n          <string>NSApplication</string>\n          <key>CFBundleDocumentTypes</key>\n          <array>\n            <dict>\n              <key>CFBundleTypeExtensions</key>\n              <array>\n                <string>****</string>\n              </array>\n              <key>CFBundleTypeName</key>\n              <string>FolderType</string>\n              <key>CFBundleTypeOSTypes</key>\n              <array>\n                <string>fold</string>\n              </array>\n              <key>CFBundleTypeRole</key>\n              <string>Editor</string>\n            </dict>\n          </array>\n        </dict>\n        </plist>\n      EOS\n\n      (\"#{prefix}/GRASS7.app/Contents/Info.plist\").write config\n\n      chdir \"#{prefix}/GRASS7.app/Contents\" do\n        mkdir \"MacOS\" do\n          ln_s \"#{bin}/grass#{majmin_ver}\", \"grass#{majmin_ver}\"\n        end\n      end\n    end\n  end\n\n  def formula_site_packages(f)\n    `#{Formula[\"python\"].opt_bin}/python3 -c \"import os, sys, site; sp1 = list(sys.path); site.addsitedir('#{Formula[f].opt_lib}/python3.7/site-packages'); print(os.pathsep.join([x for x in sys.path if x not in sp1]))\"`.strip\n  end\n\n  def caveats\n    s = <<~EOS\n\n      If it is the case that you can change the shebang at the beginning of\n      the script to enforce Python 3 usage.\n\n        \\e[32m#!/usr/bin/env python\\e[0m\n\n      Should be changed into\n\n        \\e[32m#!/usr/bin/env python3\\e[0m\n\n    EOS\n\n    if headless?\n      s += <<~EOS\n\n      This build of GRASS has been compiled without the WxPython GUI.\n\n      The command line tools remain fully functional.\n\n      EOS\n    end\n\n    if build.with? \"app\"\n      s += <<~EOS\n\n      You may also symlink \\e[32mGRASS.app\\e[0m into \\e[32m/Applications\\e[0m or \\e[32m~/Applications\\e[0m:\n\n        \\e[32mln -Fs `find $(brew --prefix) -name \"GRASS.app\"` /Applications/GRASS.app\\e[0m\n\n      EOS\n    end\n    s\n  end\n\n  test do\n    system bin/\"grass#{majmin_ver}\", \"--version\"\n  end\nend\n\n__END__\n\n--- a/configure\n+++ b/configure\n@@ -6894,7 +6894,7 @@\n   ac_save_cflags=\"$CFLAGS\"\n   ac_save_cppflags=\"$CPPFLAGS\"\n   LIBS=\"$LIBS $LIBLAS_LIBS\"\n-  CFLAGS=\"$CFLAGS $LIBLAS_CFLAGS\"\n+  CFLAGS=\"$CFLAGS $LIBLAS_CFLAGS $LIBLAS_INC\"\n   CPPFLAGS=\"$CPPFLAGS $LIBLAS_INC\"\n   for ac_hdr in liblas/capi/liblas.h\n do\n\n\n--- a/include/Make/Install.make\n+++ b/include/Make/Install.make\n@@ -114,11 +114,6 @@ real-install: | $(INST_DIR) $(UNIX_BIN)\n \t-$(INSTALL) config.status $(INST_DIR)/config.status\n \t-$(CHMOD) -R a+rX $(INST_DIR) 2>/dev/null\n\n-ifneq ($(findstring darwin,$(ARCH)),)\n-\t@# enable OSX Help Viewer\n-\t@/bin/ln -sfh \"$(INST_DIR)/docs/html\" /Library/Documentation/Help/GRASS-$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR)\n-endif\n-\n $(INST_DIR) $(UNIX_BIN):\n \t$(MAKE_DIR_CMD) $@\n\n--- a/macosx/app/build_html_user_index.sh\n+++ b/macosx/app/build_html_user_index.sh\n@@ -140,7 +140,6 @@ else\n #      echo \"<tr><td valign=\\\"top\\\"><a href=\\\"$HTMLDIRG/$i\\\">$BASENAME</a></td> <td>$SHORTDESC</td></tr>\" >> $FULLINDEX\n       # make them local to user to simplify page links\n       echo \"<tr><td valign=\\\"top\\\"><a href=\\\"global_$i\\\">$BASENAME</a></td> <td>$SHORTDESC</td></tr>\" >> $FULLINDEX\n-      ln -sf \"$HTMLDIRG/$i\" global_$i\n     done\n   done\n fi\n@@ -183,8 +182,3 @@ echo \"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.0 Transitional//EN\\\">\n </html>\" > $i.html\n done\n\n-# add Help Viewer links in user docs folder\n-\n-mkdir -p $HOME/Library/Documentation/Help/\n-ln -sfh ../../GRASS/$GRASS_MMVER/Modules/docs/html $HOME/Library/Documentation/Help/GRASS-$GRASS_MMVER-addon\n-ln -sfh $GISBASE/docs/html $HOME/Library/Documentation/Help/GRASS-$GRASS_MMVER\n"
  },
  {
    "path": "Formula/osgeo-hdf4.rb",
    "content": "class OsgeoHdf4 < Formula\n  homepage \"http://www.hdfgroup.org\"\n  url \"https://support.hdfgroup.org/ftp/HDF/releases/HDF4.2.14/src/hdf-4.2.14.tar.gz\"\n  sha256 \"2d383e87c8a0ca6a5352adbd1d5546e6cc43dc21ff7d90f93efa644d85c0b14a\"\n\n  option \"with-fortran\", \"Build Fortran interface.\"\n  option \"with-tests\", \"Run the test suite (may fail)\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"szip\" => :recommended\n  depends_on \"jpeg\"\n  depends_on \"gcc\" if build.with? \"fortran\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    rebuild 1\n    sha256 \"e9c44564bd0f3be8a6c7bb0d6f103fd64865a927a16f8ae5fc2b6a8a6e3221d7\" => :mojave\n    sha256 \"e9c44564bd0f3be8a6c7bb0d6f103fd64865a927a16f8ae5fc2b6a8a6e3221d7\" => :high_sierra\n    sha256 \"a7d7759edd6ef51195fe94a77d20a76531c83f1460139acccad37791483ca135\" => :sierra\n  end\n\n  resource \"test_file\" do\n    url \"https://gamma.hdfgroup.org/ftp/pub/outgoing/h4map/data/CT01_Rank6ArraysTablesAttributesGroups.hdf\"\n    sha256 \"e4a610c95ddd1f2247038adf46de354fe902e72b5b72757322d19c362c0d415a\"\n  end\n\n  def install\n    ENV.O0 # Per the release notes, -O2 can cause memory corruption\n    ENV[\"SZIP_INSTALL\"] = HOMEBREW_PREFIX\n\n    args = std_cmake_args\n    args.concat [\n      \"-DBUILD_SHARED_LIBS=ON\",\n      \"-DHDF4_BUILD_TOOLS=ON\",\n      \"-DHDF4_BUILD_UTILS=ON\",\n      \"-DHDF4_BUILD_WITH_INSTALL_NAME=ON\",\n      \"-DHDF4_ENABLE_JPEG_LIB_SUPPORT=ON\",\n      \"-DHDF4_ENABLE_NETCDF=OFF\", # Conflict. Just install NetCDF for this.\n      \"-DHDF4_ENABLE_Z_LIB_SUPPORT=ON\"\n    ]\n\n    # szip has been reported to break linking with GDAL, so it may need to be disabled if you run into errors.\n    if build.with? \"szip\"\n      args.concat %W[-DHDF4_ENABLE_SZIP_ENCODING=ON -DHDF4_ENABLE_SZIP_SUPPORT=ON]\n    else\n      args << \"-DHDF4_ENABLE_SZIP_SUPPORT=OFF\"\n    end\n\n    if build.with? \"fortran\"\n      args.concat %W[-DHDF4_BUILD_FORTRAN=ON -DCMAKE_Fortran_MODULE_DIRECTORY=#{include}]\n    else\n      args << \"-DHDF4_BUILD_FORTRAN=OFF\"\n    end\n\n    args << \"-DBUILD_TESTING=OFF\" if build.without? \"tests\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\", \"install\"\n      system \"make\", \"test\" if build.with? \"tests\"\n\n      # Remove stray nc* artifacts which conflict with NetCDF.\n      rm (bin+\"ncdump\")\n      rm (bin+\"ncgen\")\n#      rm (include+\"netcdf.inc\")\n    end\n  end\n\n  def caveats; <<~EOS\n      HDF4 has been superseeded by HDF5.  However, the API changed\n      substantially and some programs still require the HDF4 libraries in order\n      to function.\n    EOS\n  end\n\n  test do\n    resource(\"test_file\").stage do\n      system \"#{opt_prefix}/bin/vshow\", \"CT01_Rank6ArraysTablesAttributesGroups.hdf\"\n    end\n  end\n\nend\n"
  },
  {
    "path": "Formula/osgeo-hexer.rb",
    "content": "class OsgeoHexer < Formula\n  desc \"LAS and OGR hexagonal density and boundary surface generation\"\n  homepage \"https://github.com/hobu/hexer\"\n  url \"https://github.com/hobu/hexer/archive/1.4.0.tar.gz\"\n  sha256 \"886134fcdd75da2c50aa48624de19f5ae09231d5290812ec05f09f50319242cb\"\n\n  revision 5\n\n  head \"https://github.com/hobu/hexer.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"949ebcb075de3dca10041016a155d53cc130e797b985c4c9a84e3ba817727762\" => :catalina\n    sha256 \"949ebcb075de3dca10041016a155d53cc130e797b985c4c9a84e3ba817727762\" => :mojave\n    sha256 \"949ebcb075de3dca10041016a155d53cc130e797b985c4c9a84e3ba817727762\" => :high_sierra\n  end\n\n  # Add cmath and limits headers to utils\n  # Link with dl for curse on non-win32\n  patch :DATA\n\n  option \"with-drawing\", \"Build Cairo-based SVG drawing\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"osgeo-gdal\" => :recommended\n\n  depends_on \"cairo\" # if build.with? \"drawing\"\n\n  def install\n    args = std_cmake_args\n    args << \"-DWITH_DRAWING=TRUE\" # if build.with? \"drawing\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n    # TODO\n    # system \"curse\", \"--version\"\n  end\nend\n\n__END__\n\n--- a/include/hexer/Utils.hpp\n+++ b/include/hexer/Utils.hpp\n@@ -15,6 +15,9 @@\n\n #pragma once\n\n+#include <cmath>\n+#include <limits>\n+\n namespace hexer\n {\n\n\nFrom e06d361eec613ed046592d378a01bf0a0694a6f8 Mon Sep 17 00:00:00 2001\nFrom: Pete Gadomski <pete.gadomski@gmail.com>\nDate: Tue, 25 Apr 2017 16:08:24 +0000\nSubject: [PATCH 2/2] Link with dl for curse on non-win32\n\n---\n apps/CMakeLists.txt | 3 +++\n 1 file changed, 3 insertions(+)\n\n--- a/apps/CMakeLists.txt\n+++ b/apps/CMakeLists.txt\n@@ -17,6 +17,9 @@ endif()\n if(CURSE)\n     add_executable(${CURSE} curse.cpp lasfile.hpp las.hpp las.cpp OGR.hpp OGR.cpp mmaplib.hpp pdal_util_export.hpp ProgramArgs.hpp Utils.cpp Utils.hpp )\n     target_link_libraries(${CURSE} ${HEXER_LIB_NAME} ${HEXERBOOST_LIB_NAME})\n+    if(NOT WIN32)\n+        target_link_libraries(${CURSE} dl)\n+    endif()\n endif()\n\n install(TARGETS ${HEXER_UTILITIES}\n"
  },
  {
    "path": "Formula/osgeo-iipsrv.rb",
    "content": "class OsgeoIipsrv < Formula\n  desc \"Publish spatial data and interactive mapping apps to the web\"\n  homepage \"https://github.com/ruven/iipsrv\"\n  url \"https://github.com/ruven/iipsrv/archive/f68b225013c54dd08badcd55d0819d29eb4fc5f8.tar.gz\"\n  sha256 \"9d9e90cdc1f4588f1cb14b004c17a07ffa3ad88cd2c3e69582b660483dc5114b\"\n  version \"1.1-dev\"\n\n  revision 1\n\n  head \"https://github.com/ruven/iipsrv.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"4e6c8c55f45543b26eaa7b031c87a4e00b3cfcbf037aa33c6e62fbef2cf22b6d\" => :mojave\n    sha256 \"4e6c8c55f45543b26eaa7b031c87a4e00b3cfcbf037aa33c6e62fbef2cf22b6d\" => :high_sierra\n    sha256 \"8ce2d0857dcf778a32aef8298b42e2a94d845526c87158fa3c88b24e58612ff3\" => :sierra\n  end\n\n  option \"with-lighttpd\", \"Install lighttpd and iipsrv configuration file\"\n  option \"with-nginx\", \"Install nginx and iipsrv configuration file\"\n  option \"without-tests\", \"Do not run test suite\"\n\n  depends_on \"autoconf\"\n  depends_on \"automake\"\n  depends_on \"libtool\"\n\n  depends_on \"pkg-config\"\n\n  depends_on \"fcgi\"\n  depends_on \"jpeg\"\n  depends_on \"libtiff\"\n  depends_on \"little-cms2\"\n  depends_on \"libmemcached\"\n  # NOTE: PNG support is currently turned off in configure.in\n  depends_on \"spawn-fcgi\"\n  depends_on \"lighttpd\" => :optional\n  depends_on \"nginx\" => :optional\n  depends_on \"vips\" # for creating Tiled Pyramidal TIFFs\n  depends_on \"imagemagick\" # for creating Tiled Pyramidal TIFFs\n\n  resource \"iipmooviewer\" do\n    url \"https://github.com/ruven/iipmooviewer/archive/cbcbe75b1af7d2fcf75c62d8fc650060c8081e13.tar.gz\"\n    sha256 \"0c84fd68b9d295c37d3afd9b659442c0d5ba67ebe3f9c3fe10160d6aca5d9126\"\n    version \"2.0-dev\"\n  end\n\n  resource \"palaisuulouvre\" do\n    url \"http://merovingio.c2rmf.cnrs.fr/iipimage/PalaisDuLouvre.tif\"\n    sha256 \"e76b75c0b16609aa85e02c13b1ccd4c85ff4b452811e7878442422ce8b23ce6b\"\n  end\n\n  def install\n    system \"./autogen.sh\"\n    system \"./configure\",\n      \"--disable-dependency-tracking\"\n\n    system \"make\"\n    system \"make\", \"check\" if build.with? \"tests\"\n    (prefix/\"fcgi-bin\").install \"src/iipsrv.fcgi\"\n    man1.install \"man/iipsrv.8\"\n\n    # Out-of-htdocs directory for images\n    iipimage = var/\"iipimage\"\n    iipimage.install resource(\"palaisuulouvre\") # sample image\n\n    # Copy of iipmooviewer\n    resource(\"iipmooviewer\").stage do\n      inreplace \"index.html\", \"/path/to/image.tif\", \"#{iipimage}/PalaisDuLouvre.tif\"\n      (prefix/\"iipmooviewer\").install Dir[\"*\"]\n    end\n\n    # Set up log\n    # touch iipsrv_log\n\n    # fix for: No such file or directory @ rb_sysopen - /usr/local/var/log/iipsrv.log\n    config = <<~EOS\n      # iipsrv_log\n    EOS\n    (var/\"log/iipsrv.log\").write config\n\n    # Spawn-fcgi utility\n    (bin/\"iipsrv-spawn\").write(spawn_script)\n  end\n\n  def spawn_script; <<~EOS\n    #!/bin/bash\n\n    export LOGFILE=#{iipsrv_log}\n    export VERBOSITY=5\n    export MAX_IMAGE_CACHE_SIZE=10\n    export FILENAME_PATTERN=_pyr_\n    export JPEG_QUALITY=50\n    export MAX_CVT=3000\n    exec 2>&1\n    exec #{Formula[\"spawn-fcgi\"].opt_bin}/spawn-fcgi -n -s #{iipsrv_sock} -- #{opt_prefix}/fcgi-bin/iipsrv.fcgi &\n    EOS\n  end\n\n  plist_options :manual => \"iipsrv-spawn\"\n\n  def plist; <<~EOS\n    <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n    <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n    <plist version=\"1.0\">\n    <dict>\n      <key>Label</key>\n      <string>#{plist_name}</string>\n      <key>RunAtLoad</key>\n      <true/>\n      <key>KeepAlive</key>\n      <false/>\n      <key>WorkingDirectory</key>\n      <string>#{HOMEBREW_PREFIX}</string>\n      <key>ProgramArguments</key>\n      <array>\n        <string>#{Formula[\"spawn-fcgi\"].opt_bin}/spawn-fcgi</string>\n        <string>-n</string>\n        <string>-s</string>\n        <string>#{iipsrv_sock}</string>\n        <string>--</string>\n        <string>#{opt_prefix}/fcgi-bin/iipsrv.fcgi</string>\n      </array>\n      <key>EnvironmentVariables</key>\n      <dict>\n        <key>LOGFILE</key>\n        <string>#{iipsrv_log}</string>\n        <key>VERBOSITY</key>\n        <string>5</string>\n        <key>MAX_IMAGE_CACHE_SIZE</key>\n        <string>10</string>\n        <key>FILENAME_PATTERN</key>\n        <string>_pyr_</string>\n        <key>JPEG_QUALITY</key>\n        <string>50</string>\n        <key>MAX_CVT</key>\n        <string>3000</string>\n      </dict>\n      <key>UserName</key>\n      <string>#{`whoami`.chomp}</string>\n    </dict>\n    </plist>\n    EOS\n  end\n\n  def iipsrv_log\n    \"#{var}/log/iipsrv.log\"\n  end\n\n  def iipsrv_sock\n    \"#{var}/run/iipsrv.sock\"\n  end\n\n  def post_install\n    conf_dir = prefix/\"config\"\n    opts = Tab.for_formula(self).used_options\n\n    conf_s = conf_dir/\"lighttpd_iipsrv_spawn.conf.sample\"\n    rm_f conf_s\n    conf_s.write <<~EOS\n      server.modules += ( \"mod_fastcgi\" )\n      fastcgi.server = ( \"/fcgi-bin/iipsrv.fcgi\" =>\n        (( \"socket\" => \"#{iipsrv_sock}\",\n           \"check-local\" => \"disable\"\n        ))\n      )\n    EOS\n\n    conf_s = conf_dir/\"lighttpd_iipsrv.conf.sample\"\n    rm_f conf_s\n    conf_s.write <<~EOS\n      server.modules += ( \"mod_fastcgi\" )\n      fastcgi.server = ( \"/fcgi-bin/iipsrv.fcgi\" =>\n        (( \"socket\" => \"#{iipsrv_sock}\",\n           \"check-local\" => \"disable\",\n           \"min-procs\" => 1,\n           \"max-procs\" => 2,\n           \"bin-path\" => \"#{opt_prefix}/fcgi-bin/iipsrv.fcgi\",\n           \"bin-environment\" => (\n              \"LOGFILE\" => \"#{iipsrv_log}\",\n              \"VERBOSITY\" => \"5\",\n              \"MAX_IMAGE_CACHE_SIZE\" => \"10\",\n              \"FILENAME_PATTERN\" => \"_pyr_\",\n              \"JPEG_QUALITY\" => \"50\",\n              \"MAX_CVT\" => \"3000\"\n            )\n        ))\n      )\n    EOS\n\n    if opts.include? \"with-lighttpd\"\n      conf = etc/\"lighttpd/conf.d/iipsrv.conf\"\n      rm conf if File.exist? conf\n      cp conf_s, conf\n\n      # Make sure iipsrv.conf will be loaded\n      inc_conf = 'include \"conf.d/iipsrv.conf\"'\n      mod_conf = etc/\"lighttpd/modules.conf\"\n      unless File.readlines(mod_conf).grep(/#{Regexp.escape inc_conf}/).any?\n        mod_conf.open(\"a\") { |f| f.write(\"\\n\" + inc_conf) }\n      end\n    end\n\n    conf_s = conf_dir/\"apache_iipsrv.conf.sample\"\n    rm_f conf_s\n    conf_s.write <<~EOS\n      # Set the options on that directory\n      <Directory \"#{opt_prefix}/fcgi-bin\">\n        AllowOverride None\n        Options None\n        Order allow,deny\n        Allow from all\n      </Directory>\n\n      # Set the handler\n      AddHandler fastcgi-script fcgi\n\n      # Initialise the FCGI server - set some default values\n      FastCgiServer #{opt_prefix}/fcgi-bin/iipsrv.fcgi \\\n      -initial-env LOGFILE=#{iipsrv_log} \\\n      -initial-env VERBOSITY=2 \\\n      -initial-env JPEG_QUALITY=50 \\\n      -initial-env MAX_IMAGE_CACHE_SIZE=10 \\\n      -initial-env MAX_CVT=3000 \\\n      -processes 2\n    EOS\n\n    conf_s = conf_dir/\"nginx_iipsrv.conf.sample\"\n    rm_f conf_s\n    conf_s.write <<~EOS\n      location /fcgi-bin/iipsrv.fcgi {\n        include fastcgi_params;\n        fastcgi_pass unix:#{iipsrv_sock};\n      }\n    EOS\n    if opts.include? \"with-nginx\"\n      conf = etc/\"nginx/iipsrv.conf\"\n      rm conf if File.exist? conf\n      cp conf_s, conf\n    end\n  end\n\n  def caveats; <<~EOS\n    When IIPImage Server is launched from its plist or iipsrv-spawn script, the\n    FastCGI process with be available at:\n      #{iipsrv_sock}\n\n    Tiled TIFF images can be stored in #{var}/iipimage (outside the www tree).\n    There is a sample already installed there: PalaisDuLouvre.tif.\n\n    There are configuration scripts in #{opt_prefix}/config for the following\n    web servers (copy the whatever.sample to iipsrv.conf accordingly):\n\n    * Lighttpd - can spawn the FastCGI process (no external spawning needed), or\n                 connect externally to the spawned FastCGI process\n\n      config:   #{etc}/lighttpd/conf.d/iipsrv.conf\n      include:  include \"conf.d/iipsrv.conf\"\n           in:  #{etc}/lighttpd/modules.conf\n      www root: #{var}/www/htdocs\n\n    * Nginx - connects to the externally spawned FastCGI process\n\n      config:   #{etc}/nginx/iipsrv.conf\n      include:  include iipsrv.conf;\n           in:  #{etc}/nginx/nginx.conf <-- (or other .conf's) 'server' block\n      www root: #{var}/www\n\n    * Apache - can spawn the FastCGI process (no external spawning needed), or\n               connect externally to the spawned FastCGI process\n\n               homebrew/apache/mod_fastcgi REQUIRED\n\n      config:   /etc/apache2/other/iipsrv.conf\n      www root: /Library/WebServer/Documents\n\n    Upon successful server configuration test at:\n\n      http://localhost[:port]/fcgi-bin/iipsrv.fcgi\n\n    An install of 'iipmooviewer' is in #{opt_prefix}. Copy the 'iipmooviewer'\n    directory to your server's www root. Test viewer, with sample image, at:\n\n      http://localhost[:port]/iipmooviewer\n\n  EOS\n  end\n\n  test do\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-insighttoolkit.rb",
    "content": "class OsgeoInsighttoolkit < Formula\n  desc \"ITK is a toolkit for performing registration and segmentation\"\n  homepage \"https://www.itk.org\"\n  url \"https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.0.1/InsightToolkit-5.0.1.tar.gz\"\n  sha256 \"613b125cbf58481e8d1e36bdeacf7e21aba4b129b4e524b112f70c4d4e6d15a6\"\n\n  revision 1\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"cc31b55d65c9b587c5b86ccc21414054baa5af82ee22dadf21fdbf609bab1f0b\" => :catalina\n    sha256 \"cc31b55d65c9b587c5b86ccc21414054baa5af82ee22dadf21fdbf609bab1f0b\" => :mojave\n    sha256 \"cc31b55d65c9b587c5b86ccc21414054baa5af82ee22dadf21fdbf609bab1f0b\" => :high_sierra\n  end\n\n  head \"https://github.com/InsightSoftwareConsortium/ITK.git\", :branch => \"master\"\n\n  option \"with-examples\", \"Compile and install various examples\"\n  option \"with-itkv3-compatibility\", \"Include ITKv3 compatibility\"\n  option \"with-remove-legacy\", \"Disable legacy APIs\"\n\n  deprecated_option \"examples\" => \"with-examples\"\n  deprecated_option \"remove-legacy\" => \"with-remove-legacy\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"opencv@2\" => :recommended\n  depends_on \"python\" => :recommended\n  depends_on \"fftw\" => :recommended\n  depends_on \"hdf5\" => :recommended\n  # depends_on \"jpeg\" => :recommended\n  depends_on \"libjpeg-turbo\" => :recommended\n  depends_on \"libpng\" => :recommended\n  depends_on \"libtiff\" => :recommended\n  depends_on \"gdcm\" => :optional\n  depends_on \"expat\" unless OS.mac?\n\n  depends_on \"osgeo-vtk\" => :build\n\n  # JAVA_VERSION = \"1.8\" # \"1.10+\"\n  depends_on \"openjdk\" => :build # JAVA_VERSION\n\n  depends_on \"zlib\"\n  depends_on \"bison\"\n  depends_on \"libpng\"\n  depends_on \"tcl-tk\"\n  depends_on \"pcre\"\n  depends_on \"swig\"\n  depends_on \"castxml\"\n  depends_on \"git\"\n  # depends_on \"ruby\"\n  # depends_on \"perl\"\n\n  def install\n    ENV.cxx11\n\n    # error: 'auto' not allowed in function return type\n    # Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h\n    ENV.append \"CXXFLAGS\", \"-std=c++11\"\n\n    # Temporary fix for Xcode/CLT 9.0.x issue of missing header files\n    # See: https://github.com/OSGeo/homebrew-osgeo4mac/issues/276\n    # Work around \"error: no member named 'signbit' in the global namespace\"\n    if DevelopmentTools.clang_build_version >= 900\n      ENV.delete \"SDKROOT\"\n      ENV.delete \"HOMEBREW_SDKROOT\"\n    end\n\n    # Warning: python modules have explicit framework links\n    # These python extension modules were linked directly to a Python\n    # framework binary. They should be linked with -undefined dynamic_lookup\n    # instead of -lpython or -framework Python\n    # ENV[\"PYTHON_LIBS\"] = \"-undefined dynamic_lookup\"\n    # PYTHON_LDFLAGS=-undefined dynamic_lookup\n    # PYTHON_EXTRA_LIBS=-undefined dynamic_lookup\n    # PYTHON_EXTRA_LDFLAGS=-undefined dynamic_lookup\n\n    # cmd = Language::Java.java_home_cmd(\"1.8\") # JAVA_VERSION\n    # ENV[\"JAVA_HOME\"] = Utils.popen_read(cmd).chomp\n\n    dylib = OS.mac? ? \"dylib\" : \"so\"\n\n    args = std_cmake_args + %W[\n      -DBUILD_TESTING=OFF\n      -DBUILD_SHARED_LIBS=ON\n      -DITK_USE_64BITS_IDS=ON\n      -DITK_USE_STRICT_CONCEPT_CHECKING=ON\n      -DITK_USE_SYSTEM_ZLIB=ON\n      -DITK_USE_SYSTEM_EXPAT=ON\n      -DCMAKE_INSTALL_RPATH:STRING=#{lib}\n      -DCMAKE_INSTALL_NAME_DIR:STRING=#{lib}\n      -DModule_SCIFIO=ON\n    ]\n\n    args << \"..\"\n    args << \"-DBUILD_EXAMPLES=\" + (build.include?(\"examples\") ? \"ON\" : \"OFF\")\n    args << \"-DModule_ITKVideoBridgeOpenCV=\" + (build.with?(\"opencv\") ? \"ON\" : \"OFF\")\n    args << \"-DITKV3_COMPATIBILITY:BOOL=\" + (build.with?(\"itkv3-compatibility\") ? \"ON\" : \"OFF\")\n\n    args << \"-DITK_USE_SYSTEM_FFTW=ON\" << \"-DITK_USE_FFTWF=ON\" << \"-DITK_USE_FFTWD=ON\" if build.with? \"fftw\"\n    args << \"-DITK_USE_SYSTEM_HDF5=ON\" if build.with? \"hdf5\"\n    args << \"-DITK_USE_SYSTEM_JPEG=ON\" if build.with? \"libjpeg-turbo\" # jpeg\n    args << \"-DITK_USE_SYSTEM_PNG=ON\" if build.with? :libpng\n    args << \"-DITK_USE_SYSTEM_TIFF=ON\" if build.with? \"libtiff\"\n    args << \"-DITK_USE_SYSTEM_GDCM=ON\" if build.with? \"gdcm\"\n    args << \"-DITK_LEGACY_REMOVE=ON\" if build.include? \"remove-legacy\"\n    args << \"-DModule_ITKLevelSetsv4Visualization=ON\"\n    args << \"-DModule_ITKReview=ON\"\n    args << \"-DModule_ITKVtkGlue=ON\"\n    args << \"-DITK_USE_GPU=\" + (OS.mac? ? \"ON\" : \"OFF\")\n\n    args << \"-DVCL_INCLUDE_CXX_0X=ON\" # for cxx11\n\n    args << \"-DITK_USE_SYSTEM_LIBRARIES=ON\"\n    args << \"-DITK_USE_SYSTEM_SWIG=ON\"\n    args << \"-DITK_USE_SYSTEM_CASTXML=ON\"\n    args << \"-DITK_LEGACY_SILENT=ON\"\n    args << \"-DModule_ITKIOMINC=ON\"\n    args << \"-DModule_ITKIOTransformMINC=ON\"\n    # args << \"-DITK_WRAP_TCL=ON\"\n    # args << \"-DITK_WRAP_JAVA=ON\"\n    # args << \"-DITK_WRAP_RUBY=ON\"\n    # args << \"-DITK_WRAP_PERL=ON\"\n\n    # Could NOT find GTest\n    # it is not installed\n    args << \"-DITK_USE_SYSTEM_GOOGLETEST=OFF\"\n\n    mkdir \"itk-build\" do\n\n      python_executable = `which python3`.strip\n\n      python_prefix = `#{python_executable} -c 'import sys;print(sys.prefix)'`.chomp\n      python_include = `#{python_executable} -c 'from distutils import sysconfig;print(sysconfig.get_python_inc(True))'`.chomp\n      python_version = \"python\" + `#{python_executable} -c 'import sys;print(sys.version[:3])'`.chomp\n\n      args << \"-DITK_WRAP_PYTHON=ON\"\n      args << \"-DPYTHON_EXECUTABLE='#{python_executable}'\"\n      args << \"-DPYTHON_INCLUDE_DIR='#{python_include}'\"\n\n      # if PYTHON_EXECUTABLE\n      # does not match Python's prefix\n      # Python site-packages directory to install Python bindings\n      # PY_SITE_PACKAGES_PATH\n\n      # CMake picks up the system's python dylib, even if we have a brewed one.\n      if File.exist? \"#{python_prefix}/Python\"\n        args << \"-DPYTHON_LIBRARY='#{python_prefix}/Python'\"\n      elsif File.exist? \"#{python_prefix}/lib/lib#{python_version}.a\"\n        args << \"-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.a'\"\n      elsif File.exist? \"#{python_prefix}/lib/lib#{python_version}.#{dylib}\"\n        args << \"-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.#{dylib}'\"\n      elsif File.exist? \"#{python_prefix}/lib/x86_64-linux-gnu/lib#{python_version}.#{dylib}\"\n        args << \"-DPYTHON_LIBRARY='#{python_prefix}/lib/x86_64-linux-gnu/lib#{python_version}.#{dylib}'\"\n      else\n        odie \"No libpythonX.Y.{dylib|so|a} file found!\"\n      end\n\n      system \"cmake\", *args\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n    (testpath/\"test.cxx\").write <<-EOS\n      #include \"itkImage.h\"\n\n      int main(int argc, char* argv[])\n      {\n        typedef itk::Image< unsigned short, 3 > ImageType;\n        ImageType::Pointer image = ImageType::New();\n        image->Update();\n\n        return EXIT_SUCCESS;\n      }\n    EOS\n\n    dylib = OS.mac? ? \"1.dylib\" : \"so.1\"\n    v=version.to_s.split(\".\")[0..1].join(\".\")\n    # Build step\n    system ENV.cxx, \"-std=c++11\", \"-isystem\", \"#{include}/ITK-#{v}\", \"-o\", \"test.cxx.o\", \"-c\", \"test.cxx\"\n    # Linking step\n    system ENV.cxx, \"-std=c++11\", \"test.cxx.o\", \"-o\", \"test\",\n                    \"#{lib}/libITKCommon-#{v}.#{dylib}\",\n                    \"#{lib}/libITKVNLInstantiation-#{v}.#{dylib}\",\n                    \"#{lib}/libitkvnl_algo-#{v}.#{dylib}\",\n                    \"#{lib}/libitkvnl-#{v}.#{dylib}\"\n    system \"./test\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-insighttoolkit@4.rb",
    "content": "class OsgeoInsighttoolkitAT4 < Formula\n  desc \"ITK is a toolkit for performing registration and segmentation\"\n  homepage \"https://www.itk.org\"\n  url \"https://downloads.sourceforge.net/project/itk/itk/4.13/InsightToolkit-4.13.2.tar.gz\"\n  sha256 \"d8760b279de20497c432e7cdf97ed349277da1ae435be1f6f0f00fbe8d4938c1\"\n\n  revision 3\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"1ddb7fb9794d353994d388e8e4e4408442fa2d3eef38dda01fadd6b42fb8d92a\" => :catalina\n    sha256 \"1ddb7fb9794d353994d388e8e4e4408442fa2d3eef38dda01fadd6b42fb8d92a\" => :mojave\n    sha256 \"1ddb7fb9794d353994d388e8e4e4408442fa2d3eef38dda01fadd6b42fb8d92a\" => :high_sierra\n  end\n\n  head \"https://github.com/InsightSoftwareConsortium/ITK.git\", :branch => \"master\"\n\n  # keg_only \"Testing ITK - is not linked\"\n\n  option \"with-examples\", \"Compile and install various examples\"\n  option \"with-itkv3-compatibility\", \"Include ITKv3 compatibility\"\n  option \"with-remove-legacy\", \"Disable legacy APIs\"\n\n  deprecated_option \"examples\" => \"with-examples\"\n  deprecated_option \"remove-legacy\" => \"with-remove-legacy\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"opencv@2\" => :recommended\n  depends_on \"python\" => :recommended\n  depends_on \"fftw\" => :recommended\n  depends_on \"hdf5\" => :recommended\n  # depends_on \"jpeg\" => :recommended\n  depends_on \"libjpeg-turbo\" => :recommended\n  depends_on \"libpng\" => :recommended\n  depends_on \"libtiff\" => :recommended\n  depends_on \"gdcm\" => :optional\n  depends_on \"expat\" unless OS.mac?\n\n  depends_on \"osgeo-vtk\" => :build\n\n  # JAVA_VERSION = \"1.8\" # \"1.10+\"\n  depends_on \"openjdk\" => :build # JAVA_VERSION\n\n  depends_on \"zlib\"\n  depends_on \"bison\"\n  depends_on \"libpng\"\n  depends_on \"tcl-tk\"\n  depends_on \"pcre\"\n  depends_on \"swig\"\n  depends_on \"castxml\"\n  depends_on \"git\"\n  # depends_on \"ruby\"\n  # depends_on \"perl\"\n\n  def install\n    ENV.cxx11\n\n    # error: 'auto' not allowed in function return type\n    # Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h\n    ENV.append \"CXXFLAGS\", \"-std=c++11\"\n\n    # Temporary fix for Xcode/CLT 9.0.x issue of missing header files\n    # See: https://github.com/OSGeo/homebrew-osgeo4mac/issues/276\n    # Work around \"error: no member named 'signbit' in the global namespace\"\n    if DevelopmentTools.clang_build_version >= 900\n      ENV.delete \"SDKROOT\"\n      ENV.delete \"HOMEBREW_SDKROOT\"\n    end\n\n    # Warning: python modules have explicit framework links\n    # These python extension modules were linked directly to a Python\n    # framework binary. They should be linked with -undefined dynamic_lookup\n    # instead of -lpython or -framework Python\n    # ENV[\"PYTHON_LIBS\"] = \"-undefined dynamic_lookup\"\n    # PYTHON_LDFLAGS=-undefined dynamic_lookup\n    # PYTHON_EXTRA_LIBS=-undefined dynamic_lookup\n    # PYTHON_EXTRA_LDFLAGS=-undefined dynamic_lookup\n\n    # cmd = Language::Java.java_home_cmd(\"1.8\") # JAVA_VERSION\n    # ENV[\"JAVA_HOME\"] = Utils.popen_read(cmd).chomp\n\n    dylib = OS.mac? ? \"dylib\" : \"so\"\n\n    args = std_cmake_args + %W[\n      -DBUILD_TESTING=OFF\n      -DBUILD_SHARED_LIBS=ON\n      -DITK_USE_64BITS_IDS=ON\n      -DITK_USE_STRICT_CONCEPT_CHECKING=ON\n      -DITK_USE_SYSTEM_ZLIB=ON\n      -DITK_USE_SYSTEM_EXPAT=ON\n      -DCMAKE_INSTALL_RPATH:STRING=#{lib}\n      -DCMAKE_INSTALL_NAME_DIR:STRING=#{lib}\n      -DModule_SCIFIO=ON\n    ]\n\n    args << \"..\"\n    args << \"-DBUILD_EXAMPLES=\" + (build.include?(\"examples\") ? \"ON\" : \"OFF\")\n    args << \"-DModule_ITKVideoBridgeOpenCV=\" + (build.with?(\"opencv\") ? \"ON\" : \"OFF\")\n    args << \"-DITKV3_COMPATIBILITY:BOOL=\" + (build.with?(\"itkv3-compatibility\") ? \"ON\" : \"OFF\")\n\n    args << \"-DITK_USE_SYSTEM_FFTW=ON\" << \"-DITK_USE_FFTWF=ON\" << \"-DITK_USE_FFTWD=ON\" if build.with? \"fftw\"\n    args << \"-DITK_USE_SYSTEM_HDF5=ON\" if build.with? \"hdf5\"\n    args << \"-DITK_USE_SYSTEM_JPEG=ON\" if build.with? \"libjpeg-turbo\" # jpeg\n    args << \"-DITK_USE_SYSTEM_PNG=ON\" if build.with? :libpng\n    args << \"-DITK_USE_SYSTEM_TIFF=ON\" if build.with? \"libtiff\"\n    args << \"-DITK_USE_SYSTEM_GDCM=ON\" if build.with? \"gdcm\"\n    args << \"-DITK_LEGACY_REMOVE=ON\" if build.include? \"remove-legacy\"\n    args << \"-DModule_ITKLevelSetsv4Visualization=ON\"\n    args << \"-DModule_ITKReview=ON\"\n    args << \"-DModule_ITKVtkGlue=ON\"\n    args << \"-DITK_USE_GPU=\" + (OS.mac? ? \"ON\" : \"OFF\")\n\n    args << \"-DVCL_INCLUDE_CXX_0X=ON\" # for cxx11\n\n    args << \"-DITK_USE_SYSTEM_LIBRARIES=ON\"\n    args << \"-DITK_USE_SYSTEM_SWIG=ON\"\n    args << \"-DITK_USE_SYSTEM_CASTXML=ON\"\n    args << \"-DITK_LEGACY_SILENT=ON\"\n    args << \"-DModule_ITKIOMINC=ON\"\n    args << \"-DModule_ITKIOTransformMINC=ON\"\n    # args << \"-DITK_WRAP_TCL=ON\"\n    # args << \"-DITK_WRAP_JAVA=ON\"\n    # args << \"-DITK_WRAP_RUBY=ON\"\n    # args << \"-DITK_WRAP_PERL=ON\"\n\n    # Could NOT find GTest\n    # it is not installed\n    args << \"-DITK_USE_SYSTEM_GOOGLETEST=OFF\"\n\n    mkdir \"itk-build\" do\n      python_executable = `which python3`.strip\n      python_prefix = `#{python_executable} -c 'import sys;print(sys.prefix)'`.chomp\n      python_include = `#{python_executable} -c 'from distutils import sysconfig;print(sysconfig.get_python_inc(True))'`.chomp\n      python_version = \"python\" + `#{python_executable} -c 'import sys;print(sys.version[:3])'`.chomp\n\n      args << \"-DITK_WRAP_PYTHON=ON\"\n      args << \"-DPYTHON_EXECUTABLE='#{python_executable}'\"\n      args << \"-DPYTHON_INCLUDE_DIR='#{python_include}'\"\n\n      # if PYTHON_EXECUTABLE\n      # does not match Python's prefix\n      # Python site-packages directory to install Python bindings\n      # PY_SITE_PACKAGES_PATH\n\n      # CMake picks up the system's python dylib, even if we have a brewed one.\n      if File.exist? \"#{python_prefix}/Python\"\n        args << \"-DPYTHON_LIBRARY='#{python_prefix}/Python'\"\n      elsif File.exist? \"#{python_prefix}/lib/lib#{python_version}.a\"\n        args << \"-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.a'\"\n      elsif File.exist? \"#{python_prefix}/lib/lib#{python_version}.#{dylib}\"\n        args << \"-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.#{dylib}'\"\n      elsif File.exist? \"#{python_prefix}/lib/x86_64-linux-gnu/lib#{python_version}.#{dylib}\"\n        args << \"-DPYTHON_LIBRARY='#{python_prefix}/lib/x86_64-linux-gnu/lib#{python_version}.#{dylib}'\"\n      else\n        odie \"No libpythonX.Y.{dylib|so|a} file found!\"\n      end\n\n      system \"cmake\", *args\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n    (testpath/\"test.cxx\").write <<-EOS\n      #include \"itkImage.h\"\n\n      int main(int argc, char* argv[])\n      {\n        typedef itk::Image< unsigned short, 3 > ImageType;\n        ImageType::Pointer image = ImageType::New();\n        image->Update();\n\n        return EXIT_SUCCESS;\n      }\n    EOS\n\n    dylib = OS.mac? ? \"1.dylib\" : \"so.1\"\n    v=version.to_s.split(\".\")[0..1].join(\".\")\n    # Build step\n    system ENV.cxx, \"-std=c++11\", \"-isystem\", \"#{include}/ITK-#{v}\", \"-o\", \"test.cxx.o\", \"-c\", \"test.cxx\"\n    # Linking step\n    system ENV.cxx, \"-std=c++11\", \"test.cxx.o\", \"-o\", \"test\",\n                    \"#{lib}/libITKCommon-#{v}.#{dylib}\",\n                    \"#{lib}/libITKVNLInstantiation-#{v}.#{dylib}\",\n                    \"#{lib}/libitkvnl_algo-#{v}.#{dylib}\",\n                    \"#{lib}/libitkvnl-#{v}.#{dylib}\"\n    system \"./test\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-lastools.rb",
    "content": "class OsgeoLastools < Formula\n  desc \"Efficient tools for LiDAR processing. Contains LASlib, a C++ programming API for reading / writing LIDAR data stored in standard LAS format\"\n  homepage \"https://rapidlasso.com/lastools\"\n  url \"https://github.com/LAStools/LAStools/archive/25fe552719970baf15b5c1b233174cc70190eb67.tar.gz\"\n  sha256 \"1718456d7a8d223877498d4fcee6f7b2dd9b1ce203c9fb5ace5f33088c478d1f\"\n  version \"19.05.10\"\n\n  # evision 1\n\n  head \"https://github.com/LAStools/LAStools.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any_skip_relocation\n    rebuild 1\n    sha256 \"d716dda8ec8ede2cf07517190456e6e3f5407d7ff5e5dbf190e6b7b310eaf1a2\" => :mojave\n    sha256 \"d716dda8ec8ede2cf07517190456e6e3f5407d7ff5e5dbf190e6b7b310eaf1a2\" => :high_sierra\n    sha256 \"d6c319e04e9c03e3ce7dfaf110e187164e8f6398c82dd71f63ed892792328a19\" => :sierra\n  end\n\n  option \"with-wine\", \"Use Wine to have more support\"\n\n  depends_on \"cmake\" => :build\n\n  if build.with? \"wine\"\n    depends_on \"wine\"\n    depends_on :x11\n  end\n\n  def install\n    mkdir \"build\" do\n       system \"cmake\", \"..\", *std_cmake_args\n       system \"make\", \"install\"\n     end\n\n     ln_s \"#{bin}/las2las64\", \"#{bin}/las2las\"\n     ln_s \"#{bin}/las2txt64\", \"#{bin}/las2txt\"\n     ln_s \"#{bin}/lasdiff64\", \"#{bin}/lasdiff\"\n     ln_s \"#{bin}/lasindex64\", \"#{bin}/lasindex\"\n     ln_s \"#{bin}/lasinfo64\", \"#{bin}/lasinfo\"\n     ln_s \"#{bin}/lasmerge64\", \"#{bin}/lasmerge\"\n     ln_s \"#{bin}/lasprecision64\", \"#{bin}/lasprecision\"\n     ln_s \"#{bin}/laszip64\", \"#{bin}/laszip\"\n     ln_s \"#{bin}/txt2las64\", \"#{bin}/txt2las\"\n\n     # Pkg-Config file\n     mkdir \"#{lib}/pkgconfig\"\n     File.open(\"#{lib}/pkgconfig/laslib.pc\", \"w\") { |file|\n       file << \"Name: laslib\\n\"\n       file << \"Description: C++ programming API for reading / writing LIDAR data\\n\"\n       file << \"Version: #{version}\\n\"\n       file << \"Libs: -L\\${libdir} -llas\\n\"\n       file << \"Cflags: -I${includedir}\\n\"\n     }\n  end\n\n  def caveats\n    if build.with? \"wine\"\n      <<~EOS\n        \\n1 - Download \\e[32mhttp://lastools.org/download/LAStools.zip\\e[0m and unzip LASTools.\\n\n            Remember where you unzipped it.\\n\n\n        2 - Start QGIS. Select \\e[32mProcessing/Options.\\e[0m\\n\n            In the Providers section scroll to “LASTools”. Fill out the blanks:\\n\n\n            \\033[31mLASTools folder:\\e[0m \\e[32mLASTools directory\\e[0m (unzipped)\\n\n            \\033[31mWine Folder:\\e[0m \\e[32m#{Formula[\"wine\"].opt_bin}\\e[0m\\n\n\n      EOS\n    else\n      <<~EOS\n\n      You can use the \\e[32m--with-wine\\e[0m version for more support.\\n\n\n      EOS\n    end\n  end\n\n  test do\n    # TODO\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-laszip@2.rb",
    "content": "class OsgeoLaszipAT2 < Formula\n  desc \"Lossless LiDAR compression\"\n  homepage \"https://www.laszip.org/\"\n  url \"https://github.com/LASzip/LASzip/archive/v2.2.0.tar.gz\"\n  sha256 \"b8e8cc295f764b9d402bc587f3aac67c83ed8b39f1cb686b07c168579c61fbb2\"\n\n  revision 1\n\n  head \"https://github.com/LASzip/LASzip.git\", :tag => \"v2.2.0\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"a785cd4b90dc00fb0454badb64aecab0ad033c7bae47e40afaa77fbd548c1f11\" => :mojave\n    sha256 \"a785cd4b90dc00fb0454badb64aecab0ad033c7bae47e40afaa77fbd548c1f11\" => :high_sierra\n    sha256 \"03096e03a39bd9605f8efc66d43299a794b5596ab58d56ca6b8a72b0498d6e8a\" => :sierra\n  end\n\n  keg_only :versioned_formula\n\n  depends_on \"cmake\" => :build\n\n  def install\n    system \"cmake\", \".\", *std_cmake_args\n    system \"make\", \"install\"\n  end\n\n  test do\n    system bin/\"laszippertest\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-laz-perf.rb",
    "content": "class OsgeoLazPerf < Formula\n  desc \"Alternative LAZ implementation for C++ and JavaScript\"\n  homepage \"https://github.com/hobu/laz-perf\"\n  url \"https://github.com/hobu/laz-perf/archive/1.4.4.zip\"\n  sha256 \"9801e671ac7122bfa67436d8ed3b202323c4f05f467882fe54ae1f20c4f0df88\"\n  #url \"https://github.com/hobu/laz-perf.git\",\n  #  :branch => \"master\",\n  #  :commit => \"834629e362d8ff90669dcec60bef5cf555d197e2\"\n  #version \"1.4.4\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any_skip_relocation\n    sha256 \"f2251ec963bfe2db4fcfba2e67a44e28f0c9184a102fdb280ba4185afeb92b83\" => :catalina\n    sha256 \"f2251ec963bfe2db4fcfba2e67a44e28f0c9184a102fdb280ba4185afeb92b83\" => :mojave\n    sha256 \"f2251ec963bfe2db4fcfba2e67a44e28f0c9184a102fdb280ba4185afeb92b83\" => :high_sierra\n  end\n\n  #revision 1\n\n  head \"https://github.com/hobu/laz-perf.git\", :branch => \"master\"\n\n  depends_on \"cmake\" => :build\n\n  def install\n    ENV.cxx11\n\n    system \"cmake\", \".\", *std_cmake_args\n    system \"make\", \"install\"\n  end\n\n  test do\n    # TODO\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-libgeotiff.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_libgeotiff_linked }\n\n  def core_libgeotiff_linked\n    Formula[\"libgeotiff\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink libgeotiff\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies libgeotiff\\e[0m\\n\\n\" if core_libgeotiff_linked\n    s\n  end\nend\n\nclass OsgeoLibgeotiff < Formula\n  desc \"Library and tools for dealing with GeoTIFF\"\n  homepage \"https://geotiff.osgeo.org/\"\n  # url \"https://github.com/OSGeo/libgeotiff/releases/download/1.6.0/libgeotiff-1.6.0.tar.gz\"\n  # sha256 \"9311017e5284cffb86f2c7b7a9df1fb5ebcdc61c30468fb2e6bca36e4272ebca\"\n  url \"https://github.com/OSGeo/libgeotiff.git\",\n    :branch => \"master\",\n    :commit => \"8b1a8f52bc909f86e04ceadd699db102208074a2\"\n  version \"1.6.0\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"bcaf0e372b3a5c3875d695f34660d2efd90a728ade4960e1c7b4d9669bb29177\" => :catalina\n    sha256 \"bcaf0e372b3a5c3875d695f34660d2efd90a728ade4960e1c7b4d9669bb29177\" => :mojave\n    sha256 \"bcaf0e372b3a5c3875d695f34660d2efd90a728ade4960e1c7b4d9669bb29177\" => :high_sierra\n  end\n\n  #revision 3 \n\n  head \"https://github.com/OSGeo/libgeotiff.git\", :branch => \"master\"\n\n  # keg_only \"libgeotiff is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"libtool\" => :build\n  depends_on \"gettext\" => :build\n  depends_on \"pkgconfig\" => :build\n  depends_on \"jpeg\"\n  depends_on \"zlib\"\n  depends_on \"libtiff\"\n  depends_on \"osgeo-proj\"\n\n  def install\n    cd \"libgeotiff\" do\n      # autoreconf -fvi\n      system \"./autogen.sh\"\n      system \"./configure\", \"--disable-dependency-tracking\",\n                            \"--prefix=#{prefix}\",\n                            \"--with-jpeg\", \"--with-zlib\"\n      system \"make\" # Separate steps or install fails\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n    (testpath/\"test.c\").write <<~EOS\n      #include \"geotiffio.h\"\n      #include \"xtiffio.h\"\n      #include <stdlib.h>\n      #include <string.h>\n\n      int main(int argc, char* argv[])\n      {\n        TIFF *tif = XTIFFOpen(argv[1], \"w\");\n        GTIF *gtif = GTIFNew(tif);\n        TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (uint32) 10);\n        GTIFKeySet(gtif, GeogInvFlatteningGeoKey, TYPE_DOUBLE, 1, (double)123.456);\n\n        int i;\n        char buffer[20L];\n\n        memset(buffer,0,(size_t)20L);\n        for (i=0;i<20L;i++){\n          TIFFWriteScanline(tif, buffer, i, 0);\n        }\n\n        GTIFWriteKeys(gtif);\n        GTIFFree(gtif);\n        XTIFFClose(tif);\n        return 0;\n      }\n    EOS\n\n    system ENV.cc, \"test.c\", \"-I#{include}\", \"-L#{lib}\", \"-lgeotiff\",\n                   \"-L#{Formula[\"libtiff\"].opt_lib}\", \"-ltiff\", \"-o\", \"test\"\n    system \"./test\", \"test.tif\"\n    output = shell_output(\"#{bin}/listgeo test.tif\")\n    assert_match /GeogInvFlatteningGeoKey.*123.456/, output\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-libght.rb",
    "content": "class OsgeoLibght < Formula\n  desc \"GeoHashTree for storing and accessing multi-dimensional point clouds\"\n  homepage \"https://github.com/pramsey/libght\"\n  url \"https://github.com/pramsey/libght/archive/e323c506b4180bb6de825c5d637f21f569da4cb4.tar.gz\"\n  sha256 \"43a5b2909234fecdba17ecfc93ab6d254b14cdf0dac48d17d1481ac2d8e398b4\"\n  version \"0.1.1\"\n\n  revision 3\n\n  head \"https://github.com/pramsey/libght.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"c9ee3b2d00ad53ec24ae6d670c03e53a3c5229875d3ae0797edd8c6fea9ea9b0\" => :mojave\n    sha256 \"c9ee3b2d00ad53ec24ae6d670c03e53a3c5229875d3ae0797edd8c6fea9ea9b0\" => :high_sierra\n    sha256 \"af246921f6cb0e3fcb594eaae4d298b9caf21a5f77c1235dda36ed7350cb4623\" => :sierra\n  end\n\n  depends_on \"cmake\" => :build\n  depends_on \"osgeo-proj\"\n  depends_on \"osgeo-liblas\"\n  depends_on \"cunit\"\n\n  def install\n\n    # support for PROJ 6\n    # ENV.append_to_cflags \"-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *std_cmake_args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n    assert_match \"version #{version.to_s[0, 3]}\", `#{bin}/\"las2ght\"`\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-libkml.rb",
    "content": "class OsgeoLibkml < Formula\n  desc \"Library to parse, generate and operate on KML (development version)\"\n  homepage \"https://code.google.com/archive/p/libkml/\"\n  url \"https://github.com/google/libkml/archive/8609edf7c8d13ae2ddb6eac2bca7c8e49c67a5f8.tar.gz\"\n  sha256 \"667cd86b7e66e38c71c054526e49c6ee9558b506c9ddec9e6de14b87e18c0072\"\n  version \"1.3\"\n\n  revision 1\n\n  head \"https://github.com/google/libkml.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"3fabac80a848cec660adbba3aa0c9965bd03eb3e70e23e464b6706f897b5ccfb\" => :mojave\n    sha256 \"3fabac80a848cec660adbba3aa0c9965bd03eb3e70e23e464b6706f897b5ccfb\" => :high_sierra\n    sha256 \"d142c373ff382e20f8113a3490a595a4b5732d809ad06a95e46539766df3fdc5\" => :sierra\n  end\n\n  keg_only \"older version is in main tap and installs similar components\"\n\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"libtool\" => :build\n\n  def install\n    # See main `libkml` formula for info on patches\n    inreplace \"configure.ac\", \"-Werror\", \"\"\n    inreplace \"third_party/Makefile.am\" do |s|\n      s.sub! /(lib_LTLIBRARIES =) libminizip.la liburiparser.la/, \"\\\\1\"\n      s.sub! /(noinst_LTLIBRARIES = libgtest.la libgtest_main.la)/,\n             \"\\\\1 libminizip.la liburiparser.la\"\n      s.sub! /(libminizip_la_LDFLAGS =)/, \"\\\\1 -static\"\n      s.sub! /(liburiparser_la_LDFLAGS =)/, \"\\\\1 -static\"\n    end\n\n    system \"./autogen.sh\"\n    system \"./configure\", \"--prefix=#{prefix}\"\n    system \"make\", \"install\"\n  end\n\n  test do\n    # TODO\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-liblas.rb",
    "content": "class OsgeoLiblas < Formula\n  desc \"C/C++ library for reading and writing the LAS LiDAR format\"\n  homepage \"https://liblas.org/\"\n   url \"https://github.com/libLAS/libLAS/archive/bd157f25b3de9747fa3146f9dcf2323bc275b254.tar.gz\"\n   sha256 \"9e056b8f973cdfc0e772290a16af8a2c895d997e25677332fe70ae60420913b5\"\n   version \"1.8.1\"\n  #url \"https://github.com/libLAS/libLAS.git\",\n  #  :branch => \"master\",\n  #  :commit => \"11a9435cc90ec40c4abbc498cbb1412dd8c33588\"\n  #version \"1.8.1\"\n\n  revision 9\n\n  # gt_wkt_srs_cpp\n  patch :DATA\n\n  head \"https://github.com/libLAS/libLAS.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"5df647f195369ccdcfa3199344a772ba656f66195228b7ac2bba4a3a0a116faa\" => :catalina\n    sha256 \"5df647f195369ccdcfa3199344a772ba656f66195228b7ac2bba4a3a0a116faa\" => :mojave\n    sha256 \"5df647f195369ccdcfa3199344a772ba656f66195228b7ac2bba4a3a0a116faa\" => :high_sierra\n  end\n\n  keg_only \"other version built against older gdal is in main tap\"\n\n  option \"with-test\", \"Verify during install with `make test`\"\n  option \"with-laszip\", \"Build with laszip support\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"boost\"\n  depends_on \"zlib\"\n  depends_on \"jpeg\"\n  depends_on \"libtiff\"\n  depends_on \"libxml2\"\n  depends_on \"osgeo-libgeotiff\"\n  depends_on \"osgeo-proj\"\n  depends_on \"osgeo-gdal\"\n  depends_on \"osgeo-laszip@2\" if build.with? \"laszip\"\n  # depends_on \"pkgconfig\"\n  # other: oracle\n\n  # for laszip 3.2.9\n  # Failed to open /laszip/include/laszip/laszip.hpp file\n\n  # is built from a more recent commit, the patches are already applied\n  # See: https://github.com/libLAS/libLAS/issues/140\n\n  # Fix ambiguous method error when building against GDAL 2.3\n  # patch do\n  #   url \"https://github.com/nickrobison/libLAS/commit/ec10e274ee765aa54e7c71c8b44d2c7494e63804.patch?full_index=1\"\n  #   sha256 \"3f8aefa1073aa32de01175cd217773020d93e5fb44a4592d76644a242bb89a3c\"\n  # end\n\n  # Fix build for Xcode 9 with upstream commit\n  # Remove in next version\n  # patch do\n  #   url \"https://github.com/libLAS/libLAS/commit/49606470.patch?full_index=1\"\n  #   sha256 \"5590aef61a58768160051997ae9753c2ae6fc5b7da8549707dfd9a682ce439c8\"\n  # end\n\n  def install\n    ENV.cxx11\n    # ENV.append \"CXXFLAGS\", \"-std=c++11\"\n\n    mkdir \"macbuild\" do\n      # CMake finds boost, but variables like this were set in the last\n      # version of this formula. Now using the variables listed here:\n      #   https://liblas.org/compilation.html\n      ENV[\"Boost_INCLUDE_DIR\"] = \"#{HOMEBREW_PREFIX}/include\"\n      ENV[\"Boost_LIBRARY_DIRS\"] = \"#{HOMEBREW_PREFIX}/lib\"\n      args = [\"-DWITH_GEOTIFF=ON\", \"-DWITH_GDAL=ON\"] + std_cmake_args\n\n      if build.with? \"laszip\"\n        args << \"-DWITH_LASZIP=ON\"\n        args << \"-DLASZIP_INCLUDE_DIR=#{Formula['osgeo-laszip@2'].opt_include}\"\n        args << \"-DLASZIP_LIBRARY=#{Formula['osgeo-laszip@2'].opt_lib}/liblaszip.dylib\"\n        rgs << \"-DWITH_STATIC_LASZIP=ON\"\n      end\n\n      args << \"-DPROJ4_INCLUDE_DIR=#{Formula['osgeo-proj'].opt_include}\"\n      args << \"-DPROJ4_LIBRARY=#{Formula['osgeo-proj'].opt_lib}\"\n\n      # args << \"-DWITH_PKGCONFIG=ON\"\n\n      args << \"-DWITH_UTILITIES=ON\"\n\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"test\" if build.with?(\"test\") # || build.bottle?\n      system \"make\", \"install\"\n\n      # fix for liblas-config\n      # for some reason it does not build\n      # bin.install resource(\"liblas-config\")\n    end\n\n    # Fix rpath value, to ensure grass7 grabs the correct dylib\n    MachO::Tools.change_install_name(\"#{lib}/liblas_c.3.dylib\", \"@rpath/liblas.3.dylib\", \"#{opt_lib}/liblas.3.dylib\")\n  end\n\n  def post_install\n    # fix liblas-conf\n    config = <<~EOS\n      #!/bin/sh\n      # prefix=#{prefix}\n      # exec_prefix=#{bin}\n      # libdir=#{lib}\n\n      INCLUDES=\"-I#{prefix}/include \"\n      LIBS=\"-L#{lib} -llas -llas_c -L#{HOMEBREW_PREFIX}/lib #{HOMEBREW_PREFIX}/lib/libboost_program_options-mt.dylib #{HOMEBREW_PREFIX}/lib/libboost_thread-mt.dylib\"\n\n      GDAL_INCLUDE=\"#{Formula['osgeo-gdal'].opt_include}\"\n      if test -n \"$GDAL_INCLUDE\" ; then\n          INCLUDES=\"$INCLUDES -I$GDAL_INCLUDE\"\n      fi\n      GDAL_LIBRARY=\"#{Formula['osgeo-gdal'].opt_lib}/libgdal.dylib\"\n      if test -n \"$GDAL_LIBRARY\" ; then\n          LIBS=\"$LIBS $GDAL_LIBRARY\"\n      fi\n\n      GEOTIFF_INCLUDE=\"#{Formula['osgeo-libgeotiff'].opt_include}\"\n      if test -n \"$GEOTIFF_INCLUDE\" ; then\n          INCLUDES=\"$INCLUDES -I$GEOTIFF_INCLUDE\"\n      fi\n      GEOTIFF_LIBRARY=\"#{Formula['osgeo-libgeotiff'].opt_lib}/libgeotiff.dylib\"\n      if test -n \"$GEOTIFF_LIBRARY\" ; then\n          LIBS=\"$LIBS $GEOTIFF_LIBRARY\"\n      fi\n\n      ORACLE_INCLUDE=\"\"\n      if test -n \"$ORACLE_INCLUDE\" ; then\n          INCLUDES=\"$INCLUDES -I$ORACLE_INCLUDE\"\n      fi\n      ORACLE_OCI_LIBRARY=\"\"\n      if test -n \"$ORACLE_OCI_LIBRARY\" ; then\n          LIBS=\"$LIBS $ORACLE_OCI_LIBRARY   \"\n      fi\n\n      TIFF_INCLUDE=\"#{Formula['libtiff'].opt_include}\"\n      if test -n \"$TIFF_INCLUDE\" ; then\n          INCLUDES=\"$INCLUDES -I$TIFF_INCLUDE\"\n      fi\n      TIFF_LIBRARY=\"#{Formula['libtiff'].opt_lib}/libtiff.dylib\"\n      if test -n \"$TIFF_LIBRARY\" ; then\n          LIBS=\"$LIBS $TIFF_LIBRARY\"\n      fi\n\n      LIBXML2_INCLUDE_DIR=\"#{Formula['libxml2'].opt_include}\"\n      if test -n \"$LIBXML2_INCLUDE_DIR\" ; then\n          INCLUDES=\"$INCLUDES -I$LIBXML2_INCLUDE_DIR\"\n      fi\n      LIBXML2_LIBRARIES=\"#{Formula['libxml2'].opt_lib}/libxml2.dylib\"\n      if test -n \"$LIBXML2_LIBRARIES\" ; then\n          LIBS=\"$LIBS $LIBXML2_LIBRARIES\"\n      fi\n\n      LASZIP_INCLUDE_DIR=\"#{Formula['osgeo-laszip@2'].opt_include}\"\n      if test -n \"$LASZIP_INCLUDE_DIR\" ; then\n          INCLUDES=\"$INCLUDES -I$LASZIP_INCLUDE_DIR\"\n      fi\n      LASZIP_LIBRARY=\"#{Formula['osgeo-laszip@2'].opt_lib}/liblaszip.dylib\"\n      if test -n \"$LASZIP_LIBRARY\" ; then\n          LIBS=\"$LIBS $LASZIP_LIBRARY\"\n      fi\n\n\n      usage()\n      {\n        cat <<EOF\n      Usage: liblas-config [OPTIONS]\n      Options:\n        [--libs]\n        [--cflags]\n        [--cxxflags]\n        [--defines]\n        [--includes]\n        [--version]\n      EOF\n        exit $1\n      }\n\n      if test $# -eq 0; then\n        usage 1 1>&2\n      fi\n\n      case $1 in\n        --libs)\n          echo $LIBS\n          ;;\n\n        --prefix)\n          echo ${prefix}\n           ;;\n\n        --ldflags)\n          echo -L${libdir}\n          ;;\n\n        --defines)\n          echo  -DHAVE_GDAL=1 -DHAVE_LIBGEOTIFF=1\n          ;;\n\n        --includes)\n          echo ${INCLUDES}\n          ;;\n\n        --cflags)\n          echo ${INCLUDES}/liblas\n          ;;\n\n        --cxxflags)\n          echo   -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long\n          ;;\n\n        --version)\n          echo 1.8.1\n          ;;\n\n        *)\n          usage 1 1>&2\n          ;;\n\n      esac\n    EOS\n\n    (bin/\"liblas-config\").write config\n\n    chmod(\"+x\", \"#{bin}/liblas-config\")\n\n    # fix liblas.pc\n    rm \"#{lib}/pkgconfig/liblas.pc\"\n    File.open(\"#{lib}/pkgconfig/liblas.pc\", \"w\") { |file|\n      file << \"Name: libLAS\\n\"\n      file << \"Description: Library (C/C++) and tools for the LAS LiDAR format\\n\"\n      file << \"Requires: geotiff\\n\"\n      file << \"Version: #{version}\\n\"\n      file << \"Libs: -L#{lib} -llas -llas_c\\n\"\n      file << \"Cflags: -I#{include}/liblas\"\n    }\n  end\n\n  test do\n    # for some reason it fails in CI, but this works\n    # system bin/\"liblas-config\", \"--version\"\n  end\nend\n\n__END__\n\n--- /src/gt_wkt_srs.cpp\n+++ /src/gt_wkt_srs.cpp\n@@ -299,7 +299,7 @@\n                 oSRS.SetFromUserInput(pszWKT);\n                 oSRS.SetExtension( \"PROJCS\", \"PROJ4\",\n                                    \"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs\" );\n-                oSRS.FixupOrdering();\n+                //oSRS.FixupOrdering();\n                 CPLFree(pszWKT);\n                 pszWKT = NULL;\n                 oSRS.exportToWkt(&pszWKT);\n@@ -505,7 +505,7 @@\n         {\n             char\t*pszWKT;\n             oSRS.morphFromESRI();\n-            oSRS.FixupOrdering();\n+            //oSRS.FixupOrdering();\n             if( oSRS.exportToWkt( &pszWKT ) == OGRERR_NONE )\n                 return pszWKT;\n         }\n@@ -1107,7 +1107,7 @@\n /* ==================================================================== */\n     char\t*pszWKT;\n\n-    oSRS.FixupOrdering();\n+    //oSRS.FixupOrdering();\n\n     if( oSRS.exportToWkt( &pszWKT ) == OGRERR_NONE )\n         return pszWKT;\n"
  },
  {
    "path": "Formula/osgeo-libnoise.rb",
    "content": "class OsgeoLibnoise < Formula\n  desc \"Portable, open-source, coherent noise-generating library for C++\"\n  homepage \"https://github.com/qknight/libnoise\"\n  url \"https://github.com/qknight/libnoise/archive/2fb16f638aac6868d550c735898f217cdefa3559.zip\"\n  sha256 \"6f19ddf41682a716713b12507215a0639f15cf12d94d3ae56256ae63aeb2c22b\"\n  version \"1.0.0-cmake\"\n\n  revision 1\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"c9cc8d283d929be6fc8a13b0a71bfc9c3bd47d3c0350ed344a45cbe98f1de2a9\" => :mojave\n    sha256 \"c9cc8d283d929be6fc8a13b0a71bfc9c3bd47d3c0350ed344a45cbe98f1de2a9\" => :high_sierra\n    sha256 \"1e1f0f9842717772ca813a2c58993551af582c04103bf1fc81bec718aa945d7b\" => :sierra\n  end\n\n  option \"with-docs\", \"Install documentation\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"doxygen\" => :build if build.with? \"docs\"\n\n  resource \"examples\" do\n    url \"http://libnoise.sourceforge.net/downloads/examples.zip\"\n    sha256 \"d6b0d36e0938a2a60d6c9d74a3fd0b7fae5cac3d8f66ffc738a215e856b4702b\"\n  end\n\n  resource \"noiseutils\" do\n    url \"http://libnoise.sourceforge.net/downloads/noiseutils.zip\"\n    sha256 \"2c3d7adf288020b22b42d76d047b676f4e3ef33485808a3334ca062f4b52a7db\"\n  end\n\n  def install\n    inreplace \"doc/CMakeLists.txt\", \"/usr/share\", share if build.with? \"docs\"\n\n    args = std_cmake_args\n    args << \"-DBUILD_LIBNOISE_DOCUMENTATION=ON\" if build.with? \"docs\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\", \"install\"\n    end\n\n    (prefix/\"examples\").install resource(\"examples\")\n\n    resource(\"noiseutils\").stage do\n      (Pathname.pwd/\"CMakeLists.txt\").write <<~EOS\n        set( PROJECT_NAME libnoiseutils )\n        include_directories( \"${CMAKE_INSTALL_PREFIX}/include\" )\n        add_library( noiseutils SHARED noiseutils.cpp )\n\n        set_target_properties( noiseutils PROPERTIES LIBNOISE_VERSION 2 )\n        target_link_libraries( noiseutils ${CMAKE_INSTALL_PREFIX}/lib/libnoise.dylib )\n        add_definitions( \"-Wall -ansi -pedantic -O3\" )\n\n        install( FILES \"${PROJECT_SOURCE_DIR}/noiseutils.h\" DESTINATION\n          \"${CMAKE_INSTALL_PREFIX}/include\" )\n        install( TARGETS noiseutils DESTINATION \"${CMAKE_INSTALL_PREFIX}/lib\" )\n      EOS\n      mkdir \"build\" do\n        system \"cmake\", \"..\", *std_cmake_args\n        system \"make\", \"install\"\n      end\n    end\n  end\n\n  def caveats; <<~EOS\n    This formula is installed from a fork of the main project, which offers a\n    a CMake-based install. Original project is located here:\n\n      `http://libnoise.sourceforge.net`\n\n    EOS\n  end\n\n  test do\n    system ENV.cxx, \"#{prefix}/examples/texturejade.cpp\", \"-o\", \"test\",\n           \"-I#{include}\", \"-L#{lib}\", \"-lnoise\", \"-lnoiseutils\"\n    system \"./test\"\n    outputs = %w[textureplane.bmp textureseamless.bmp texturesphere.bmp]\n    outputs.each_with_index do |f,i|\n      f_size = FileTest.size(f)\n      assert f_size && f_size > 102400 # > 100 KiB\n      puts \"#{f} (#{i+1}/#{outputs.length}) is #{f_size/1024} KiB\" if ARGV.verbose?\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-libpqxx.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_libpqxx_linked }\n\n  def core_libpqxx_linked\n    Formula[\"libpqxx\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink libpqxx\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies libpqxx\\e[0m\\n\\n\" if core_libpqxx_linked\n    s\n  end\nend\n\nclass OsgeoLibpqxx < Formula\n  desc \"C++ connector for PostgreSQL\"\n  homepage \"http://pqxx.org/development/libpqxx\"\n  url \"https://github.com/jtv/libpqxx/archive/6.4.4.tar.gz\"\n  sha256 \"6ae3a0113a242db6bb9d998943b7cc23699652d843dab702aa06a8b9330c171a\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    rebuild 1\n    sha256 \"b6f75cdea345d394ccc7edb3c217165da4882506349720ff6a2e924376e72584\" => :mojave\n    sha256 \"b6f75cdea345d394ccc7edb3c217165da4882506349720ff6a2e924376e72584\" => :high_sierra\n    sha256 \"126e17a143e629fc588831651c54207c964adc6ae2e22c8ca060037e1646f952\" => :sierra\n  end\n\n  # revision 1\n\n  head \"https://github.com/jtv/libpqxx.git\", :branch => \"master\"\n\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n\n  # keg_only \"libpqxx is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"xmlto\" => :build\n\n  depends_on \"python@2\"\n  depends_on \"doxygen\"\n  depends_on \"graphviz\"\n\n  if build.with?(\"pg10\")\n    depends_on \"osgeo-postgresql@10\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  def install\n    ENV.cxx11\n\n    ENV.append \"CXXFLAGS\", \"-std=c++11\"\n\n    inreplace \"tools/splitconfig\", \"python\", \"python2\"\n\n    system \"./configure\", \"--prefix=#{prefix}\", \"--enable-shared\"\n    system \"make\", \"install\"\n  end\n\n  test do\n    (testpath/\"test.cpp\").write <<~EOS\n      #include <pqxx/pqxx>\n      int main(int argc, char** argv) {\n        pqxx::connection con;\n        return 0;\n      }\n    EOS\n\n    # system \"initdb\", \"/usr/local/var/postgresql\", \"-E\", \"utf8\", \"--locale=en_US.UTF-8\"\n    # system \"psql\", \"-h\", \"localhost\", \"-d\", \"postgres\"\n    # system \"createdb\", \"circleci\"\n    system ENV.cxx, \"-std=c++11\", \"test.cpp\", \"-L#{lib}\", \"-lpqxx\", \"-I#{include}\", \"-o\", \"test\"\n\n    # Running ./test will fail because there is no runnning postgresql server\n    # system \"./test\"\n\n    # `pg_config` uses Cellar paths not opt paths\n    # postgresql_include = Formula[\"osgeo-postgresql\"].opt_include.realpath.to_s\n    # assert_match postgresql_include, (lib/\"pkgconfig/libpqxx.pc\").read,\n    #              \"Please revision bump libpqxx.\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-libspatialite.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_libspatialite_linked }\n\n  def core_libspatialite_linked\n    Formula[\"libspatialite\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink libspatialite\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies libspatialite\\e[0m\\n\\n\" if core_libspatialite_linked\n    s\n  end\nend\n\nclass OsgeoLibspatialite < Formula\n  desc \"Adds spatial SQL capabilities to SQLite\"\n  homepage \"https://www.gaia-gis.it/fossil/libspatialite/index\"\n\n  revision 9\n\n  stable do\n    url \"https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-4.3.0a.tar.gz\"\n    mirror \"https://ftp.netbsd.org/pub/pkgsrc/distfiles/libspatialite-4.3.0a.tar.gz\"\n    mirror \"https://www.mirrorservice.org/sites/ftp.netbsd.org/pub/pkgsrc/distfiles/libspatialite-4.3.0a.tar.gz\"\n    sha256 \"88900030a4762904a7880273f292e5e8ca6b15b7c6c3fb88ffa9e67ee8a5a499\"\n\n    patch do\n      url \"https://raw.githubusercontent.com/Homebrew/formula-patches/27a0e51936e01829d0a6f3c75a7fbcaf92bb133f/libspatialite/sqlite310.patch\"\n      sha256 \"459434f5e6658d6f63d403a7795aa5b198b87fc9f55944c714180e7de662fce2\"\n    end\n  end\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"bdf1b153bb5387bcf429f55a83758855da42b7e8f1e5488c7af19aece19ef5eb\" => :catalina\n    sha256 \"bdf1b153bb5387bcf429f55a83758855da42b7e8f1e5488c7af19aece19ef5eb\" => :mojave\n    sha256 \"bdf1b153bb5387bcf429f55a83758855da42b7e8f1e5488c7af19aece19ef5eb\" => :high_sierra\n  end\n\n\n  head do\n    url \"https://www.gaia-gis.it/fossil/libspatialite\", :using => :fossil\n    depends_on \"autoconf\" => :build\n    depends_on \"automake\" => :build\n    depends_on \"libtool\" => :build\n  end\n\n  # keg_only \"libspatialite\" is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"freexl\"\n  depends_on \"geos\"\n  depends_on \"libxml2\"\n  depends_on \"osgeo-proj\"\n  # Needs SQLite > 3.7.3 which rules out system SQLite on Snow Leopard and\n  # below. Also needs dynamic extension support which rules out system SQLite\n  # on Lion. Finally, RTree index support is required as well.\n  depends_on \"sqlite\"\n\n  def install\n    system \"autoreconf\", \"-fi\" if build.head?\n\n    # New SQLite3 extension won't load via SELECT load_extension(\"mod_spatialite\");\n    # unless named mod_spatialite.dylib (should actually be mod_spatialite.bundle)\n    # See: https://groups.google.com/forum/#!topic/spatialite-users/EqJAB8FYRdI\n    #      needs upstream fixes in both SQLite and libtool\n    inreplace \"configure\",\n              \"shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'\",\n              \"shrext_cmds='.dylib'\"\n    chmod 0755, \"configure\"\n\n    # Ensure Homebrew's libsqlite is found before the system version.\n    sqlite = Formula[\"sqlite\"]\n    ENV.append \"LDFLAGS\", \"-L#{sqlite.opt_lib}\"\n    ENV.append \"CFLAGS\", \"-I#{sqlite.opt_include}\"\n\n    # Use Proj 6.0.0 compatibility headers.\n    # Remove in libspatialite 5.0.0\n    ENV.append_to_cflags \"-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H\"\n\n    args = %W[\n      --disable-dependency-tracking\n      --prefix=#{prefix}\n      --with-sysroot=#{HOMEBREW_PREFIX}\n      --enable-geocallbacks\n    ]\n\n    system \"./configure\", *args\n    system \"make\", \"install\"\n  end\n\n  test do\n    # Verify mod_spatialite extension can be loaded using Homebrew's SQLite\n    pipe_output(\"#{Formula[\"sqlite\"].opt_bin}/sqlite3\",\n      \"SELECT load_extension('#{opt_lib}/mod_spatialite');\")\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-mapnik.rb",
    "content": "class OsgeoMapnik < Formula\n  include Language::Python::Virtualenv\n  desc \"Toolkit for developing mapping applications\"\n  homepage \"https://mapnik.org/\"\n  url \"https://github.com/mapnik/mapnik/releases/download/v3.0.22/mapnik-v3.0.22.tar.bz2\"\n  sha256 \"930612ad9e604b6a29b9cea1bc1de85cf7cf2b2b8211f57ec8b6b94463128ab9\"\n  # url \"https://github.com/mapnik/mapnik.git\",\n  #   :branch => \"v3.0.x\",\n  #   :commit => \"2ab8602f71809303ca180d495ecb89dfc27ba20d\"\n  # version \"3.0.22\"\n  # https://github.com/mapnik/mapnik/wiki/MacInstallation_Homebrew\n\n  revision 2\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"c05902125ce684e762a19af922d553b3aa100206977ab14464de61438dbfca7d\" => :mojave\n    sha256 \"c05902125ce684e762a19af922d553b3aa100206977ab14464de61438dbfca7d\" => :high_sierra\n    sha256 \"c05902125ce684e762a19af922d553b3aa100206977ab14464de61438dbfca7d\" => :sierra\n  end\n\n  head \"https://github.com/mapnik/mapnik.git\", :branch => \"master\"\n\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"scons\" => :build\n  depends_on \"boost\"\n  depends_on \"boost-python\"\n  depends_on \"freetype\"\n  depends_on \"harfbuzz\"\n  depends_on \"icu4c\"\n  depends_on \"jpeg\"\n  depends_on \"libpng\"\n  depends_on \"libtiff\"\n  depends_on \"osgeo-proj\"\n  depends_on \"webp\"\n  depends_on \"libjpeg-turbo\"\n  depends_on \"libxml2\"\n  depends_on \"python\"\n  # depends_on \"python@2\"\n\n  depends_on \"osgeo-postgis\"\n  depends_on \"curl\"\n  depends_on \"libtool\"\n  depends_on \"libxslt\"\n  depends_on \"httpd\" #  => :optional\n  depends_on \"fcgi\" # => :optional\n\n  depends_on \"cairo\" # --without-x --without-glib\n  depends_on \"cairomm\"\n  depends_on \"py2cairo\"\n\n  depends_on \"sqlite\"\n  depends_on \"zlib\"\n  depends_on \"geos\"\n  depends_on \"osgeo-gdal\"\n\n  depends_on \"ossp-uuid\"\n  depends_on \"libagg\"\n  depends_on \"openjpeg\" # for Pillow\n\n  depends_on \"git\"\n  depends_on \"json-c\"\n\n  if build.with?(\"pg10\")\n    depends_on \"osgeo-postgresql@10\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  resource \"Pillow\" do\n    url \"https://files.pythonhosted.org/packages/81/1a/6b2971adc1bca55b9a53ed1efa372acff7e8b9913982a396f3fa046efaf8/Pillow-6.0.0.tar.gz\"\n    sha256 \"809c0a2ce9032cbcd7b5313f71af4bdc5c8c771cb86eb7559afd954cab82ebb5\"\n  end\n\n  resource \"lxml\" do\n    url \"https://files.pythonhosted.org/packages/7d/29/174d70f303016c58bd790c6c86e6e86a9d18239fac314d55a9b7be501943/lxml-4.3.3.tar.gz\"\n    sha256 \"4a03dd682f8e35a10234904e0b9508d705ff98cf962c5851ed052e9340df3d90\"\n  end\n\n  resource \"nose\" do\n    url \"https://files.pythonhosted.org/packages/58/a5/0dc93c3ec33f4e281849523a5a913fa1eea9a3068acfa754d44d88107a44/nose-1.3.7.tar.gz\"\n    sha256 \"f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98\"\n  end\n\n  resource \"geometry\" do\n    url \"https://github.com/mapbox/geometry.hpp.git\",\n      :branch => \"master\",\n      :commit => \"c83a2ab18a225254f128b6f5115aa39d04f2de21\"\n    version \"1.1.5\"\n  end\n\n  resource \"polylabel\" do\n    url \"https://github.com/mapbox/polylabel.git\",\n      :branch => \"master\",\n      :commit => \"23f6a762ef2873519b86d46b625dd80f340e3dc3\"\n    version \"1.1.5\"\n  end\n\n  resource \"protozero\" do\n    url \"https://github.com/mapbox/protozero.git\",\n      :branch => \"master\",\n      :commit => \"3ef46ba780cad2caaf56a31fe35d102b069cdf0d\"\n    version \"1.1.5\"\n  end\n\n  resource \"variant\" do\n    url \"https://github.com/mapbox/variant.git\",\n      :branch => \"master\",\n      :commit => \"0f734f01e685a298e3756d30044a4164786c58c5\"\n    version \"1.1.5\"\n  end\n\n  # Use pkg-config to find FreeType2 if available\n  # patch do\n  #   url \"https://github.com/mapnik/mapnik/pull/3892.patch\"\n  #   sha256 \"774a8590b698e9dc2a483e6ff48781ed0400ba06b901f12a1ed50c9114833d47\"\n  # end\n\n  def install\n    ENV.cxx11\n\n    # Work around \"error: no member named 'signbit' in the global namespace\"\n    # encountered when trying to detect boost regex in configure\n    ENV.delete(\"SDKROOT\") if DevelopmentTools.clang_build_version >= 900\n\n    # ENV.append \"CPPPATH\", \"#{HOMEBREW_PREFIX}/include\"\n    # ENV.append \"LIBPATH\", \"#{HOMEBREW_PREFIX}/lib\"\n\n    # install python modules\n    venv = virtualenv_create(libexec/'vendor', \"#{Formula[\"python\"].opt_bin}/python3\")\n    res = resources.map(&:name).to_set - %w[geometry polylabel protozero variant]\n    res.each do |r|\n      venv.pip_install resource(r)\n    end\n\n    # fix error: use of undeclared identifier 'sqlite3_enable_load_extension'\n    # https://github.com/mapnik/mapnik-support/issues/119\n    # ENV.append \"PATH\", \"#{Formula[\"sqlite\"].opt_bin}:$PATH\"\n    ENV.append \"CUSTOM_CXXFLAGS\", \"-I#{Formula[\"sqlite\"].opt_include}\"\n    ENV.append \"CUSTOM_LDFLAGS\", \"-L#{Formula[\"sqlite\"].opt_lib} -lsqlite3\"\n\n    args = %W[\n      CC=#{ENV.cc}\n      CXX=#{ENV.cxx}\n      PREFIX=#{prefix}\n      CPP_TESTS=FALSE\n      INPUT_PLUGINS=all\n      NIK2IMG=FALSE\n    ]\n\n    # support for PROJ 6\n    # https://github.com/mapnik/mapnik/issues/4036\n    # ENV.append_to_cflags \"-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H\"\n    # args << \"CUSTOM_DEFINES=-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H\"\n\n    # http://site.icu-project.org/download/61#TOC-Migration-Issues\n    # ENV.append \"CXXFLAGS\", \"-DU_USING_ICU_NAMESPACE=1\"\n    # https://github.com/mapnik/mapnik/issues/3961\n    # ENV.append \"CUSTOM_CXXFLAGS\", \"-DU_USING_ICU_NAMESPACE=1\"\n\n    # mapnik compiles can take ~1.5 GB per job for some .cpp files\n    # so lets be cautious by limiting to CPUS/2\n    # jobs = sysctl -n hw.ncpu\n    jobs = ENV.make_jobs.to_i\n    jobs /= 2 if jobs > 2\n\n    args << \"JOBS=#{jobs}\"\n\n    args << \"CUSTOM_CXXFLAGS=#{ENV[\"CUSTOM_CXXFLAGS\"]}\"\n    args << \"CUSTOM_LDFLAGS=#{ENV[\"CUSTOM_LDFLAGS\"]}\"\n    # args << \"CUSTOM_CFLAGS=#{ENV[\"CUSTOM_CFLAGS\"]}\"\n\n    # SYSTEM_FONTS=/usr/share/fonts\n\n    # args << \"PYTHON_PREFIX=#{prefix}\"  # Install to Homebrew's site-packages // OLD\n\n    args << \"LINKING=shared\"\n    args << \"RUNTIME_LINK=shared\"\n    args << \"THREADING=multi\"\n    args << \"INTERNAL_LIBAGG=False\"\n    args << \"BENCHMARK=FALSE\"\n    # args << \"DEMO=False\"\n\n    args << \"BOOST_INCLUDES=#{Formula[\"boost\"].opt_include}\"\n    args << \"BOOST_LIBS=#{Formula[\"boost\"].opt_lib}\"\n    args << \"FREETYPE_CONFIG=#{Formula[\"freetype\"].opt_bin}/freetype-config\"\n    args << \"FREETYPE_INCLUDES=#{Formula[\"freetype\"].opt_include}/freetype2\"\n    args << \"FREETYPE_LIBS=#{Formula[\"freetype\"].opt_lib}\"\n\n    # fails if defined\n    # args << \"ICU_INCLUDES=#{Formula[\"icu4c\"].opt_include}/unicode\"\n    # args << \"ICU_LIBS=#{Formula[\"icu4c\"].opt_lib}\"\n    # args << \"ICU_LIB_NAME=#{Formula[\"icu4c\"].opt_lib}\"\n\n    args << \"CAIRO=TRUE\"\n    args << \"CAIRO_INCLUDES=#{Formula[\"cairo\"].opt_include}\"\n    args << \"CAIRO_LIBS=#{Formula[\"cairo\"].opt_lib}\"\n\n    args << \"PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig\"\n\n    args << \"GRID_RENDERER=TRUE\"\n\n    # args << \"SVG2PNG=True\" # Error: Failed changing install name in /bin/svg2png\n    args << \"SVG_RENDERER=TRUE\"\n\n    args << \"PNG=TRUE\"\n    args << \"PNG_INCLUDES=#{Formula[\"libpng\"].opt_include}\"\n    args << \"PNG_LIBS=#{Formula[\"libpng\"].opt_lib}\"\n    args << \"JPEG=TRUE\"\n    args << \"JPEG_INCLUDES=#{Formula[\"jpeg\"].opt_include}\"\n    args << \"JPEG_LIBS=#{Formula[\"jpeg\"].opt_lib}\"\n    args << \"TIFF=TRUE\"\n    args << \"TIFF_INCLUDES=#{Formula[\"libtiff\"].opt_include}\"\n    args << \"TIFF_LIBS=#{Formula[\"libtiff\"].opt_lib}\"\n    args << \"WEBP=TRUE\"\n    args << \"WEBP_INCLUDES=#{Formula[\"webp\"].opt_include}\"\n    args << \"WEBP_LIBS=#{Formula[\"webp\"].opt_lib}\"\n\n    args << \"GEOS_CONFIG=#{Formula[\"geos\"].opt_bin}/geos-config\"\n\n    args << \"GDAL_CONFIG=#{Formula[\"osgeo-gdal\"].opt_bin}/gdal-config\"\n    args << \"OCCI_INCLUDES=#{Formula[\"osgeo-gdal\"].opt_include}\"\n    args << \"OCCI_LIBS=#{Formula[\"osgeo-gdal\"].opt_lib}\"\n    args << \"RASTERLITE_INCLUDES=#{Formula[\"osgeo-gdal\"].opt_include}\"\n    args << \"RASTERLITE_LIBS=#{Formula[\"osgeo-gdal\"].opt_lib}\"\n\n    args << \"XML2_CONFIG=#{Formula[\"libxml2\"].opt_bin}/xml2-config\"\n    args << \"XML2_INCLUDES=#{Formula[\"libxml2\"].opt_include}\"\n    args << \"XML2_LIBS=#{Formula[\"libxml2\"].opt_lib}\"\n    # fails if defined\n    # args << \"XMLPARSER=libxml2\"\n    # args << \"OPTIONAL_LIBSHEADERS=#{Formula[\"libxml2\"].opt_include}\"\n\n    args << \"HB_INCLUDES=#{Formula[\"harfbuzz\"].opt_include}\"\n    args << \"HB_LIBS=#{Formula[\"harfbuzz\"].opt_lib}\"\n\n    args << \"PROJ=TRUE\"\n    args << \"PROJ_INCLUDES=#{Formula[\"osgeo-proj\"].opt_include}\"\n    args << \"PROJ_LIBS=#{Formula[\"osgeo-proj\"].opt_lib}\"\n\n    # fails if defined\n    # args << \"SQLITE_INCLUDES=#{Formula[\"sqlite\"].opt_include}\"\n    # args << \"SQLITE_LIBS=#{Formula[\"sqlite\"].opt_lib}\"\n\n    if build.with?(\"pg10\")\n      args << \"PG_CONFIG=#{Formula[\"osgeo-postgresql@10\"].opt_bin}/pg_config\"\n      args << \"PG_INCLUDES=#{Formula[\"osgeo-postgresql@10\"].opt_include}\"\n      args << \"PG_LIBS=#{Formula[\"osgeo-postgresql@10\"].opt_lib}\"\n    else\n      args << \"PG_CONFIG=#{Formula[\"osgeo-postgresql\"].opt_bin}/pg_config\"\n      args << \"PG_INCLUDES=#{Formula[\"osgeo-postgresql\"].opt_include}\"\n      args << \"PG_LIBS=#{Formula[\"osgeo-postgresql\"].opt_lib}\"\n    end\n\n    args << \"PGSQL2SQLITE=True\"\n\n    # link variant as submodules are missing from source tarball\n    # https://github.com/mapnik/mapnik/issues/3246#issuecomment-279646631\n\n    # this is faster than doing \"git submodule update...\"\n\n    # rm_r \"#{buildpath}/deps/mapbox/geometry\"\n    # rm_r \"#{buildpath}/deps/mapbox/polylabel\"\n    # rm_r \"#{buildpath}/deps/mapbox/protozero\"\n    rm_r \"#{buildpath}/deps/mapbox/variant\"\n\n    # rm_r \"#{buildpath}/demo\"\n\n    (buildpath/\"deps/mapbox/geometry\").install resource(\"geometry\")\n    (buildpath/\"deps/mapbox/polylabel\").install resource(\"polylabel\")\n    (buildpath/\"deps/mapbox/protozero\").install resource(\"protozero\")\n    (buildpath/\"deps/mapbox/variant\").install resource(\"variant\")\n\n    # git submodule update --init\n    # system \"git submodule update --init --recursive\"\n\n    # rm_r \".sconf_temp\"\n\n    system \"./configure\", *args\n    # system \"./configure\", 'CUSTOM_CXXFLAGS=\"-DU_USING_ICU_NAMESPACE=1\"', *args\n    # ./configure CXX=\"clang++\" JOBS=`sysctl -n hw.ncpu`\n    # To use a Python interpreter that is not named python for your build,\n    # do something like the following instead:\n    # PYTHON=python2 ./configure\n    # make PYTHON=python2\n    system \"make\"\n    system \"make\", \"install\"\n\n    # system \"#{Formula[\"python\"].opt_bin}/python3\", \"scons/scons.py\", \"./configure\", \"--config=cache\", \"--implicit-cache\", \"--max-drift=1\", *args # \"--jobs=${jobs}\n    # system \"#{Formula[\"python\"].opt_bin}/python3\", \"scons/scons.py\"\n    # system \"#{Formula[\"python\"].opt_bin}/python3\", \"scons/scons.py\", \"install\"\n  end\n\n  # def post_install\n      # Boost-Python Link Problems\n      # After you install mapnik, you may try to import it and get Fatal Python\n      # error: Interpreter not initialized (version mismatch?). If so, you likely\n      # have boost linked with the wrong version of python.\n      # otool -L `brew list boost | grep python-mt.dylib` | grep -i python\n      # It's likely that your copy of boost was linked against the system python,\n      # but you're trying to use a homebrew python. To fix, uninstall boost,\n      # and reinstall with --build-from-source:\n      # brew uninstall boost\n      # brew install --build-from-source boost\n\n      # Mapbox Variant not found problem\n      # After git clone of mapnik, execute the following to pull down additional dependencies\n      # system \"git submodule update --init deps/mapbox/variant\"\n  # end\n\n  # def caveats; <<-EOS\n  #   For non-homebrew Python, you need to amend your PYTHONPATH like so:\n  #     export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages:$PYTHONPATH\n  #   EOS\n  # end\n\n  test do\n    output = shell_output(\"#{bin}/mapnik-config --prefix\").chomp\n    assert_equal prefix.to_s, output\n  end\n\n  # private\n\n  # def which_python\n  #   \"python\" + `python -c 'import sys;print(sys.version[:3])'`.strip\n  # end\nend\n"
  },
  {
    "path": "Formula/osgeo-marble.rb",
    "content": "class OsgeoMarble < Formula\n  homepage \"http://marble.kde.org/\"\n  url \"https://download.kde.org/stable/applications/19.04.1/src/marble-19.04.1.tar.xz\"\n  sha256 \"acd9c15c4758684f6eff6c2318fc4dd88fd68dd41336de9458cad4d5f6832c61\"\n  version \"19.04.1\"\n\n  # revision 1\n\n  head \"git://anongit.kde.org/marble\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    rebuild 1\n    sha256 \"b9b28fdf6d0fbf2894f6103abffa263f05727f7b1c7ac7b5a830725a6e9243f4\" => :mojave\n    sha256 \"b9b28fdf6d0fbf2894f6103abffa263f05727f7b1c7ac7b5a830725a6e9243f4\" => :high_sierra\n    sha256 \"0e556ae04c4a72d7b5e2b486d1a3298ab81ec9d1cd3d06e056cf3820f7bdd1db\" => :sierra\n  end\n\n  option \"with-debug\", \"Enable debug build type\"\n  option \"without-tools\", \"Build without extra Marble Tools\"\n  option \"with-examples\", \"Build Marble library C++ examples\"\n  option \"with-tests\", \"Build and run unit tests\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"qt\"\n  depends_on \"quazip\" => :recommended\n  depends_on \"shapelib\" => :recommended\n  depends_on \"gpsd\" => :recommended\n  depends_on \"protobuf\" if build.with? \"tools\"\n\n  def install\n    # basic std_cmake_args\n    args = %W[\n      -DCMAKE_INSTALL_PREFIX=#{prefix}\n      -DCMAKE_BUILD_TYPE=#{(build.with?('debug')) ? 'Debug' : 'Release' }\n      -DCMAKE_FIND_FRAMEWORK=LAST\n      -DCMAKE_VERBOSE_MAKEFILE=TRUE\n      -Wno-dev\n    ]\n\n    # args << \"-DCMAKE_INSTALL_LIBDIR=#{lib}\"\n    # args << \"-DCMAKE_INSTALL_SYSCONFDIR=#{etc}\"\n    args << \"-DQT_PLUGINS_DIR=#{HOMEBREW_PREFIX}/lib/qt/plugins\"\n    args << \"-DBUILD_TESTING=OFF\"\n\n    # app build\n    args.concat %W[\n      -DBUILD_MARBLE_TESTS=#{((build.with? \"tests\") ? \"ON\" : \"OFF\")}\n      -DMOBILE=OFF\n      -DWITH_libgps=OFF\n      -DWITH_libwlocate=OFF\n      -DWITH_DESIGNER_PLUGIN=OFF\n      -DBUILD_MARBLE_TOOLS=#{((build.with? \"tools\") ? \"ON\" : \"OFF\")}\n      -DBUILD_MARBLE_EXAMPLES=#{((build.with? \"examples\") ? \"ON\" : \"OFF\")}\n    ]\n\n    # not used by the project\n    # args << \"-DQTONLY=ON\"\n    # args << \"-DWITH_KF5\"\n    # args << \"-DWITH_Phonon=OFF\"\n    # args << \"-DWITH_QextSerialPort=OFF\"\n    # args << \"-DWITH_QtLocation=OFF\"\n    # args << \"-DWITH_liblocation=OFF\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-matplotlib.rb",
    "content": "class NoExternalPyCXXPackage < Requirement\n  fatal false\n\n  satisfy do\n    !quiet_system \"python3\", \"-c\", \"import CXX\"\n  end\n\n  def message; <<~EOS\n    *** Warning, PyCXX detected! ***\n    On your system, there is already a PyCXX version installed, that will\n    probably make the build of Matplotlib fail. In python you can test if that\n    package is available with `import CXX`. To get a hint where that package\n    is installed, you can:\n        python3 -c \"import os; import CXX; print(os.path.dirname(CXX.__file__))\"\n    See also: https://github.com/Homebrew/homebrew-python/issues/56\n  EOS\n  end\nend\n\nclass OsgeoMatplotlib < Formula\n  desc \"Python 2D plotting library\"\n  homepage \"https://matplotlib.org\"\n  url \"https://github.com/matplotlib/matplotlib/archive/v3.2.1.tar.gz\"\n  sha256 \"5462728ed3be60af21bd8a6b33f5f1632dabdb3c1b3cc279cffb05926a48255c\"\n\n  #revision 8 \n\n  head \"https://github.com/matplotlib/matplotlib.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"c262dcc51a2b1bfc8ac7878ea28d09c869de81ca677208844cdd6bcedfc6bc44\" => :catalina\n    sha256 \"c262dcc51a2b1bfc8ac7878ea28d09c869de81ca677208844cdd6bcedfc6bc44\" => :mojave\n    sha256 \"c262dcc51a2b1bfc8ac7878ea28d09c869de81ca677208844cdd6bcedfc6bc44\" => :high_sierra\n  end\n\n  depends_on NoExternalPyCXXPackage => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"gcc\" => :build # for gfortran\n  depends_on \"python\" => :build\n  depends_on \"swig\" => :build\n  depends_on \"libagg\"\n  depends_on \"freetype\"\n  depends_on \"libpng\"\n  depends_on \"qhull\"\n  depends_on \"tcl-tk\"\n  depends_on \"zlib\"\n\n  depends_on \"openblas\"\n  depends_on \"numpy\"\n  depends_on \"scipy\"\n  depends_on \"osgeo-six\"\n  depends_on \"cairo\"\n  depends_on \"py3cairo\"\n  depends_on \"gtk+3\"\n  depends_on \"pygobject3\"\n  # depends_on \"pygtk\" # pygtk has been deprecated since a very long time, and does not support Python 3.\n  # depends_on \"pygobject\" # Does not support Python 3, and needs pygtk which has been removed.\n  #depends_on \"osgeo-pyqt\"\n  depends_on \"pyqt\"\n  depends_on \"wxpython\"\n  depends_on \"rsync\"\n  depends_on \"git\"\n  depends_on \"ffmpeg\"\n  depends_on \"imagemagick\"\n  depends_on \"ghostscript\"\n  # depends_on \"inkscape\" => :optional\n\n  depends_on \"openjpeg\" # for Pillow\n\n  resource \"setuptools\" do\n    url \"https://files.pythonhosted.org/packages/42/3e/2464120172859e5d103e5500315fb5555b1e908c0dacc73d80d35a9480ca/setuptools-45.1.0.zip\"\n    sha256 \"91f72d83602a6e5e4a9e4fe296e27185854038d7cbda49dcd7006c4d3b3b89d5\"\n  end\n\n  resource \"Pillow\" do\n    url \"https://files.pythonhosted.org/packages/39/47/f28067b187dd664d205f75b07dcc6e0e95703e134008a14814827eebcaab/Pillow-7.0.0.tar.gz\"\n    sha256 \"4d9ed9a64095e031435af120d3c910148067087541131e82b3e8db302f4c8946\"\n  end\n\n  resource \"cycler\" do\n    url \"https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz\"\n    sha256 \"cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8\"\n  end\n\n  resource \"kiwisolver\" do\n    url \"https://files.pythonhosted.org/packages/16/e7/df58eb8868d183223692d2a62529a594f6414964a3ae93548467b146a24d/kiwisolver-1.1.0.tar.gz\"\n    sha256 \"53eaed412477c836e1b9522c19858a8557d6e595077830146182225613b11a75\"\n  end\n\n  resource \"pyparsing\" do\n    url \"https://files.pythonhosted.org/packages/a2/56/0404c03c83cfcca229071d3c921d7d79ed385060bbe969fde3fd8f774ebd/pyparsing-2.4.6.tar.gz\"\n    sha256 \"4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f\"\n  end\n\n  resource \"python-dateutil\" do\n    url \"https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz\"\n    sha256 \"73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c\"\n  end\n\n  resource \"pytz\" do\n    url \"https://files.pythonhosted.org/packages/82/c3/534ddba230bd4fbbd3b7a3d35f3341d014cca213f369a9940925e7e5f691/pytz-2019.3.tar.gz\"\n    sha256 \"b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be\"\n  end\n\n  resource \"cairocffi\" do\n    url \"https://files.pythonhosted.org/packages/f7/99/b3a2c6393563ccbe081ffcceb359ec27a6227792c5169604c1bd8128031a/cairocffi-1.1.0.tar.gz\"\n    sha256 \"f1c0c5878f74ac9ccb5d48b2601fcc75390c881ce476e79f4cfedd288b1b05db\"\n  end\n\n  # resource \"six\" do\n  #   url \"https://files.pythonhosted.org/packages/21/9f/b251f7f8a76dec1d6651be194dfba8fb8d7781d10ab3987190de8391d08e/six-1.14.0.tar.gz\"\n  #   sha256 \"236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a\"\n  # end\n\n  # resource \"tornado\" do\n  #   url \"https://files.pythonhosted.org/packages/e6/78/6e7b5af12c12bdf38ca9bfe863fcaf53dc10430a312d0324e76c1e5ca426/tornado-5.1.1.tar.gz\"\n  #   sha256 \"4e5158d97583502a7e2739951553cbd88a72076f152b4b11b64b9a10c4c49409\"\n  # end\n\n  resource \"tornado\" do\n    url \"https://files.pythonhosted.org/packages/30/78/2d2823598496127b21423baffaa186b668f73cd91887fcef78b6eade136b/tornado-6.0.3.tar.gz\"\n    sha256 \"c845db36ba616912074c5b1ee897f8e0124df269468f25e4fe21fe72f6edd7a9\"\n  end\n\n  # python version >= 3.5 required\n  # resource \"scipy\" do\n  #   url \"https://files.pythonhosted.org/packages/04/ab/e2eb3e3f90b9363040a3d885ccc5c79fe20c5b8a3caa8fe3bf47ff653260/scipy-1.4.1.tar.gz\"\n  #   sha256 \"dee1bbf3a6c8f73b6b218cb28eed8dd13347ea2f87d572ce19b289d6fd3fbc59\"\n  # end\n\n  # resource \"numpy\" do\n  #   url \"https://files.pythonhosted.org/packages/40/de/0ea5092b8bfd2e3aa6fdbb2e499a9f9adf810992884d414defc1573dca3f/numpy-1.18.1.zip\"\n  #   sha256 \"b6ff59cee96b454516e47e7721098e6ceebef435e3e21ac2d6c3b8b02628eb77\"\n  # end\n\n  def install\n    if DevelopmentTools.clang_build_version >= 900\n      ENV.delete \"SDKROOT\"\n      ENV.delete \"HOMEBREW_SDKROOT\"\n    end\n\n    # inreplace \"setupext.py\",\n    #           \"'darwin': ['/usr/local/'\",\n    #           \"'darwin': ['#{HOMEBREW_PREFIX}'\"\n\n    xy = Language::Python.major_minor_version \"python3\"\n    site_packages = libexec/\"lib/python#{xy}/site-packages\"\n    ENV.prepend_create_path \"PYTHONPATH\", site_packages\n\n    resources.each do |r|\n      r.stage do\n        system \"python3\", *Language::Python.setup_install_args(libexec)\n      end\n    end\n    (lib/\"python#{xy}/site-packages/homebrew-matplotlib.pth\").write \"#{site_packages}\\n\"\n\n    system \"python3\", *Language::Python.setup_install_args(prefix)\n  end\n\n  test do\n    ENV[\"PYTHONDONTWRITEBYTECODE\"] = \"1\"\n    system \"echo\", \"0\" #\"python3\", \"-c\", \"import matplotlib\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-mongo-cxx-driver-legacy.rb",
    "content": "class OsgeoMongoCxxDriverLegacy < Formula\n  desc \"C++ driver for MongoDB\"\n  homepage \"https://github.com/mongodb/mongo-cxx-driver\"\n  url \"https://github.com/mongodb/mongo-cxx-driver/archive/legacy-1.1.3.tar.gz\"\n  sha256 \"50304162f706c2c73e04f200cdac767cb2c55d47cf724811cbfc8bb34a0fd6bc\"\n\n  revision 3\n\n  head \"https://github.com/mongodb/mongo-cxx-driver.git\", :branch => \"releases/legacy\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"eba1f1faf4e7aa27700f0daf65ac89711162244583a609e0bafc6e88060c8056\" => :catalina\n    sha256 \"eba1f1faf4e7aa27700f0daf65ac89711162244583a609e0bafc6e88060c8056\" => :mojave\n    sha256 \"eba1f1faf4e7aa27700f0daf65ac89711162244583a609e0bafc6e88060c8056\" => :high_sierra\n  end\n\n  keg_only \"Newer driver in homebrew core\"\n\n  # src/.../ssl_manager.cpp:631:23: error: BIO_s_file_internal was not declared in this scope\n  # https://bugs.gentoo.org/676066\n  # https://patch-diff.githubusercontent.com/raw/mongodb/mongo-cxx-driver/pull/615.patch\n  patch :DATA\n\n  depends_on \"scons\" => :build\n  depends_on \"boost\"\n  depends_on \"openssl\"\n  # depends_on \"openssl@1.1\"\n\n  resource \"connect_test\" do\n    url \"https://raw.githubusercontent.com/mongodb/mongo-cxx-driver/legacy/src/mongo/client/examples/tutorial.cpp\"\n    sha256 \"39ad991cf07722312398cd9dbfefb2b8df00729c2224bdf0b644475b95a240dc\"\n  end\n\n  resource \"bson_test\" do\n    url \"https://raw.githubusercontent.com/mongodb/mongo-cxx-driver/legacy/src/mongo/bson/bsondemo/bsondemo.cpp\"\n    sha256 \"299c87b57f11e3ff9ac0fd2e8ac3f8eb174b64c673951199831a0ba176292164\"\n  end\n\n  def install\n    args = [\n      \"--prefix=#{prefix}\",\n      \"--c++11=on\",\n      \"--libc++\",\n      \"--osx-version-min=10.9\",\n      \"--extrapath=#{Formula[\"boost\"].opt_prefix}\",\n      \"--sharedclient\",\n      \"--use-sasl-client\",\n      \"--ssl\",\n      \"--disable-warnings-as-errors\",\n      \"--cpppath=#{Formula[\"openssl\"].opt_include}\",\n      \"--libpath=#{Formula[\"openssl\"].opt_lib}\",\n      \"install\"\n    ]\n\n\n    system \"scons\", *args\n  end\n\n  test do\n    # TODO\n\n    # resource(\"connect_test\").stage do\n    #   system ENV.cxx, \"-o\", \"test\", \"tutorial.cpp\",\n    #   \"-I#{include}/\",\n    #   \"-L#{lib}\", \"-lmongoclient\", \"-pthread\", \"-lboost_thread-mt\", \"-lboost_system\", \"-lboost_regex\", \"-std=c++11\", \"-stdlib=libc++\"\n    # assert_match \"couldn't connect : couldn't connect to server 0.0.0.0:27017 (0.0.0.0), address resolved to 0.0.0.0\",\n    #   shell_output(\"./test mongodb://0.0.0.0 2>&1\", 1)\n    # end\n\n    # resource(\"bson_test\").stage do\n    #   system ENV.cxx, \"-o\", \"test\", \"bsondemo.cpp\",\n    #   \"-I#{include}\",\n    #   \"-L#{lib}\", \"-lmongoclient\", \"-lboost_thread-mt\", \"-lboost_system\",  \"-lboost_regex\", \"-std=c++11\", \"-stdlib=libc++\"\n    #   system \"./test\"\n    # end\n  end\nend\n\n__END__\n\n--- a/src/mongo/client/command_writer.h\n+++ b/src/mongo/client/command_writer.h\n@@ -17,6 +17,11 @@\n\n #include \"mongo/client/dbclient_writer.h\"\n\n+#include <boost/version.hpp>\n+#if BOOST_VERSION >= 106700\n+#include <boost/next_prior.hpp>\n+#endif\n+\n namespace mongo {\n\n class DBClientBase;\n\n--- a/src/mongo/client/wire_protocol_writer.h\n+++ b/src/mongo/client/wire_protocol_writer.h\n@@ -16,6 +16,10 @@\n #pragma once\n\n #include \"mongo/client/dbclient_writer.h\"\n+#include <boost/version.hpp>\n+#if BOOST_VERSION >= 106700\n+#include <boost/next_prior.hpp>\n+#endif\n\n namespace mongo {\n\n\n--- a/src/mongo/crypto/crypto_openssl.cpp\n+++ b/src/mongo/crypto/crypto_openssl.cpp\n@@ -34,19 +34,27 @@ namespace crypto {\n  * Computes a SHA-1 hash of 'input'.\n  */\n bool sha1(const unsigned char* input, const size_t inputLen, unsigned char* output) {\n-    EVP_MD_CTX digestCtx;\n-    EVP_MD_CTX_init(&digestCtx);\n-    ON_BLOCK_EXIT(EVP_MD_CTX_cleanup, &digestCtx);\n+    EVP_MD_CTX *digestCtx = EVP_MD_CTX_create();\n+    if (!digestCtx) {\n+        return false;\n+    }\n+\n+    EVP_MD_CTX_init(digestCtx);\n+    #if OPENSSL_VERSION_NUMBER < 0x10100000L\n+    ON_BLOCK_EXIT(EVP_MD_CTX_destroy, digestCtx);\n+    #else\n+    ON_BLOCK_EXIT(EVP_MD_CTX_free, digestCtx);\n+    #endif\n\n-    if (1 != EVP_DigestInit_ex(&digestCtx, EVP_sha1(), NULL)) {\n+    if (1 != EVP_DigestInit_ex(digestCtx, EVP_sha1(), NULL)) {\n         return false;\n     }\n\n-    if (1 != EVP_DigestUpdate(&digestCtx, input, inputLen)) {\n+    if (1 != EVP_DigestUpdate(digestCtx, input, inputLen)) {\n         return false;\n     }\n\n-    return (1 == EVP_DigestFinal_ex(&digestCtx, output, NULL));\n+    return (1 == EVP_DigestFinal_ex(digestCtx, output, NULL));\n }\n\n /*\n\n\n--- a/src/mongo/util/net/ssl_manager.cpp\n+++ b/src/mongo/util/net/ssl_manager.cpp\n@@ -628,7 +628,12 @@ bool SSLManager::_initSSLContext(SSL_CTX** context, const Params& params) {\n\n bool SSLManager::_setSubjectName(const std::string& keyFile, std::string& subjectName) {\n     // Read the certificate subject name and store it\n-    BIO* in = BIO_new(BIO_s_file_internal());\n+    BIO* in;\n+    #if OPENSSL_VERSION_NUMBER < 0x10100000L\n+    in = BIO_new(BIO_s_file_internal());\n+    #else\n+    in = BIO_new(BIO_s_file());\n+    #endif\n     if (NULL == in) {\n         error() << \"failed to allocate BIO object: \" << getSSLErrorMessage(ERR_get_error()) << endl;\n         return false;\n"
  },
  {
    "path": "Formula/osgeo-mrsid-sdk.rb",
    "content": "require File.expand_path(\"../../Strategies/cache-download\", Pathname.new(__FILE__).realpath)\n\nclass OsgeoMrsidSdk < Formula\n  desc \"MrSID format decoder libs for MG4 (raster and LiDAR), MG3, MG2, JP2\"\n  homepage \"https://www.lizardtech.com/developer/\"\n  url \"file://#{HOMEBREW_CACHE}/MrSID_DSDK-9.5.1.4427-darwin14.universal.clang60.tar.gz\",\n      :using => CacheDownloadStrategy\n  version \"9.5.1.4427\"\n  sha256 \"286843f4a22845835a06626327eed67216e403a54e17d8b10a675663d41b9829\"\n\n  revision 2\n\n  option \"with-bindings\", \"Include Lidar Python and Ruby bindings\"\n  option \"with-docs\", \"Intall documentation and examples for SDKs\"\n\n  # this is an odd one: only needs the share/gdal components\n  depends_on \"osgeo-gdal\" => :build\n\n  def install\n    # first strip unnecessary installs\n    rm_r \"Raster_DSDK/3rd-party\" # already part of gdal install\n    if build.without? \"docs\"\n      rm_r \"examples\"\n      cd \"Lidar_DSDK\" do\n        %w[doc examples].each { |f| rm_r f }\n      end\n      cd \"Raster_DSDK\" do\n        %w[doc examples].each { |f| rm_r f }\n      end\n    end\n    rm_r \"Lidar_DSDK/contributions\" if build.without? \"bindings\"\n\n    prefix.install Dir[\"*\"]\n    lidar_dsdk = prefix/\"Lidar_DSDK\"\n    raster_dsdk = prefix/\"Raster_DSDK\"\n    libtbb_old_name = \"@rpath/libtbb.dylib\"\n    libtbb_new_name = opt_libexec/\"libtbb.dylib\"\n    # vendor to libexec possibly version-specific common supporting libs\n    liblas_old_name = \"/data/builds/buildbot/darwin14/darwin14/build/\"\\\n                      \"xt_lib_lastools/lib/darwin14.universal.clang60/\"\\\n                      \"Release/liblaslib.dylib\"\n    liblas_new_name = opt_libexec/\"liblaslib.dylib\"\n    libgeos_c_old_name = \"@rpath/libgeos_c.1.dylib\"\n    libgeos_c_new_name = opt_libexec/\"libgeos_c.1.dylib\"\n    libgeos_old_name = \"@rpath/libgeos.2.dylib\"\n    libgeos_new_name = opt_libexec/\"libgeos.2.dylib\"\n\n    # install binary executables\n    [lidar_dsdk, raster_dsdk].each { |f| bin.install Dir[f/\"bin/*\"] }\n\n    # install headers\n    include.install lidar_dsdk/\"include/lidar\"\n    # Raster into subdirectory (some headers are too commonly named)\n    (include/\"mrsid\").install Dir[raster_dsdk/\"include/*\"]\n\n    # update libs\n    cd lidar_dsdk/\"lib\" do\n      # reset vendored lib ids\n      set_install_name(\"liblaslib.dylib\", opt_libexec)\n\n      # reset install lib ids\n      set_install_name(\"liblti_lidar_dsdk.1.dylib\", opt_lib)\n\n      # reset install lib names\n      install_change(\"liblti_lidar_dsdk.1.dylib\",\n                     libtbb_old_name,\n                     libtbb_new_name)\n\n      # install vendored; libtbb.dylib installed with raster libs\n      libexec.install \"liblaslib.dylib\"\n\n      # install SDK lib\n      lib.install Dir[\"liblti*\"]\n    end\n    cd raster_dsdk/\"lib\" do\n      # reset vendored lib ids\n      %w[libgeos_c.1.dylib libgeos.2.dylib libtbb.dylib].each do |f|\n        set_install_name(f, opt_libexec)\n      end\n\n      # reset install lib ids\n      set_install_name(\"libltidsdk.dylib\", opt_lib)\n\n      # reset vendored lib names\n      install_change(\"libgeos_c.1.dylib\",\n                     libgeos_old_name,\n                     libgeos_new_name)\n\n      # reset install lib names\n      install_change(\"libltidsdk.dylib\",\n                     libtbb_old_name,\n                     libtbb_new_name)\n\n      # install vendored\n      libexec.install \"libtbb.dylib\", Dir[\"libgeos*\"]\n\n      # install SDK lib\n      lib.install Dir[\"liblti*\"]\n    end\n\n    # cleanup\n    rm_r lidar_dsdk/\"lib\"\n    rm_r raster_dsdk/\"lib\"\n\n    # update executables\n    cd bin do\n      Dir[\"*\"].each do |exe|\n        install_change(exe,\n                       libtbb_old_name,\n                       libtbb_new_name)\n        install_change(exe,\n                       libgeos_c_old_name,\n                       libgeos_c_new_name)\n        install_change(exe,\n                       liblas_old_name,\n                       liblas_new_name)\n      end\n    end\n  end\n\n  def install_change(dylib, old, new)\n    if MachO::Tools.dylibs(dylib).include?(old)\n      puts \"install_change: from #{old} to #{new} in #{dylib}\" if ARGV.debug?\n      MachO::Tools.change_install_name(dylib.to_s, old.to_s, new.to_s, :strict => false)\n    elsif ARGV.debug?\n      puts \"install_change: #{old} name not found in #{dylib}\"\n    end\n  end\n\n  def set_install_name(dylib, dir)\n    puts \"set_install_name to #{dir}/#{dylib}\" if ARGV.debug?\n    MachO::Tools.change_dylib_id(dylib.to_s, \"#{dir}/#{dylib}\", :strict => false)\n  end\n\n  def caveats; <<~EOS\n        To build software with the Raster and LiDAR SDKs, add to the following\n        environment variables to find the headers:\n\n          CPPFLAGS: -I#{opt_prefix}/include/mrsid\n          CPPFLAGS: -I#{opt_prefix}/include/lidar\n    EOS\n  end\n\n  test do\n    #\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-muparserx.rb",
    "content": "class OsgeoMuparserx < Formula\n  desc \"the muparserx math parser library\"\n  homepage \"http://articles.beltoforion.de/article.php?a=muparserx\"\n  url \"https://github.com/beltoforion/muparserx/archive/v4.0.8.tar.gz\"\n  sha256 \"5913e0a4ca29a097baad1b78a4674963bc7a06e39ff63df3c73fbad6fadb34e1\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any_skip_relocation\n    sha256 \"dc5c03f4beda885437d5a80aa3b582ec7dc24b3c3425f2e04cbb635e78c88e46\" => :catalina\n    sha256 \"dc5c03f4beda885437d5a80aa3b582ec7dc24b3c3425f2e04cbb635e78c88e46\" => :mojave\n    sha256 \"dc5c03f4beda885437d5a80aa3b582ec7dc24b3c3425f2e04cbb635e78c88e46\" => :high_sierra\n  end\n\n  revision 1\n\n  head \"https://github.com/beltoforion/muparserx.git\", :branch => \"master\"\n\n  depends_on \"cmake\" => :build\n\n  def install\n    args = std_cmake_args + %W[\n      -DBUILD_SHARED_LIBS=ON\n      -DBUILD_EXAMPLES=OFF\n    ]\n\n    # args << \"-DCMAKE_SKIP_RPATH=ON\"\n\n    mkdir \"builddir\" do\n      system \"cmake\", \"..\", *std_cmake_args\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n    # TODO\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-netcdf.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_netcdf_linked }\n\n  def core_netcdf_linked\n    Formula[\"netcdf\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink netcdf\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies netcdf\\e[0m\\n\\n\" if core_netcdf_linked\n    s\n  end\nend\n\nclass OsgeoNetcdf < Formula\n  desc \"Libraries and data formats for array-oriented scientific data\"\n  homepage \"https://www.unidata.ucar.edu/software/netcdf\"\n  url \"https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-c-4.7.4.tar.gz\"\n  mirror \"https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-c-4.7.4.tar.gz\"\n  sha256 \"0e476f00aeed95af8771ff2727b7a15b2de353fb7bb3074a0d340b55c2bd4ea8\"\n\n  # revision 1\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"57ab2d6562197db772ca5a21fbeb74f2a3e68a374771b536110387ae5ecb3383\" => :catalina\n    sha256 \"57ab2d6562197db772ca5a21fbeb74f2a3e68a374771b536110387ae5ecb3383\" => :mojave\n    sha256 \"57ab2d6562197db772ca5a21fbeb74f2a3e68a374771b536110387ae5ecb3383\" => :high_sierra\n  end\n\n  # keg_only \"netcdf is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"cmake\" => :build\n  depends_on \"gcc\" # for gfortran\n  depends_on \"hdf5\"\n\n  uses_from_macos \"curl\"\n\n  resource \"cxx\" do\n    url \"https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx4-4.3.1.tar.gz\"\n    mirror \"https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-cxx4-4.3.1.tar.gz\"\n    sha256 \"6a1189a181eed043b5859e15d5c080c30d0e107406fbb212c8fb9814e90f3445\"\n  end\n\n  resource \"cxx-compat\" do\n    url \"https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx-4.2.tar.gz\"\n    mirror \"https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-cxx-4.2.tar.gz\"\n    sha256 \"95ed6ab49a0ee001255eac4e44aacb5ca4ea96ba850c08337a3e4c9a0872ccd1\"\n  end\n\n  resource \"fortran\" do\n    url \"https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.5.2.tar.gz\"\n    mirror \"https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-fortran-4.5.2.tar.gz\"\n    sha256 \"b959937d7d9045184e9d2040a915d94a7f4d0185f4a9dceb8f08c94b0c3304aa\"\n  end\n\n  def install\n    ENV.deparallelize\n\n    common_args = std_cmake_args << \"-DBUILD_TESTING=OFF\"\n\n    mkdir \"build\" do\n      args = common_args.dup\n      args << \"-DNC_EXTRA_DEPS=-lmpi\" if Tab.for_name(\"hdf5\").with? \"mpi\"\n      args << \"-DENABLE_TESTS=OFF\" << \"-DENABLE_NETCDF_4=ON\" << \"-DENABLE_DOXYGEN=OFF\"\n\n      system \"cmake\", \"..\", \"-DBUILD_SHARED_LIBS=ON\", *args\n      system \"make\", \"install\"\n      system \"make\", \"clean\"\n      system \"cmake\", \"..\", \"-DBUILD_SHARED_LIBS=OFF\", *args\n      system \"make\"\n      lib.install \"liblib/libnetcdf.a\"\n    end\n\n    # Add newly created installation to paths so that binding libraries can\n    # find the core libs.\n    args = common_args.dup << \"-DNETCDF_C_LIBRARY=#{lib}/libnetcdf.dylib\"\n\n    cxx_args = args.dup\n    cxx_args << \"-DNCXX_ENABLE_TESTS=OFF\"\n    resource(\"cxx\").stage do\n      mkdir \"build-cxx\" do\n        system \"cmake\", \"..\", \"-DBUILD_SHARED_LIBS=ON\", *cxx_args\n        system \"make\", \"install\"\n        system \"make\", \"clean\"\n        system \"cmake\", \"..\", \"-DBUILD_SHARED_LIBS=OFF\", *cxx_args\n        system \"make\"\n        lib.install \"cxx4/libnetcdf-cxx4.a\"\n      end\n    end\n\n    fortran_args = args.dup\n    fortran_args << \"-DENABLE_TESTS=OFF\"\n    resource(\"fortran\").stage do\n      mkdir \"build-fortran\" do\n        system \"cmake\", \"..\", \"-DBUILD_SHARED_LIBS=ON\", *fortran_args\n        system \"make\", \"install\"\n        system \"make\", \"clean\"\n        system \"cmake\", \"..\", \"-DBUILD_SHARED_LIBS=OFF\", *fortran_args\n        system \"make\"\n        lib.install \"fortran/libnetcdff.a\"\n      end\n    end\n\n    ENV.prepend \"CPPFLAGS\", \"-I#{include}\"\n    ENV.prepend \"LDFLAGS\", \"-L#{lib}\"\n    resource(\"cxx-compat\").stage do\n      system \"./configure\", \"--disable-dependency-tracking\",\n                            \"--enable-shared\",\n                            \"--enable-static\",\n                            \"--prefix=#{prefix}\"\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    # SIP causes system Python not to play nicely with @rpath\n    libnetcdf = (lib/\"libnetcdf.dylib\").readlink\n    %w[libnetcdf-cxx4.dylib libnetcdf_c++.dylib].each do |f|\n      macho = MachO.open(\"#{lib}/#{f}\")\n      macho.change_dylib(\"@rpath/#{libnetcdf}\",\n                         \"#{lib}/#{libnetcdf}\")\n      macho.write!\n    end\n  end\n\n  test do\n    (testpath/\"test.c\").write <<~EOS\n      #include <stdio.h>\n      #include \"netcdf_meta.h\"\n      int main()\n      {\n        printf(NC_VERSION);\n        return 0;\n      }\n    EOS\n    system ENV.cc, \"test.c\", \"-L#{lib}\", \"-I#{include}\", \"-lnetcdf\",\n                   \"-o\", \"test\"\n    if head?\n      assert_match /^\\d+(?:\\.\\d+)+/, `./test`\n    else\n      assert_equal version.to_s, `./test`\n    end\n\n    (testpath/\"test.f90\").write <<~EOS\n      program test\n        use netcdf\n        integer :: ncid, varid, dimids(2)\n        integer :: dat(2,2) = reshape([1, 2, 3, 4], [2, 2])\n        call check( nf90_create(\"test.nc\", NF90_CLOBBER, ncid) )\n        call check( nf90_def_dim(ncid, \"x\", 2, dimids(2)) )\n        call check( nf90_def_dim(ncid, \"y\", 2, dimids(1)) )\n        call check( nf90_def_var(ncid, \"data\", NF90_INT, dimids, varid) )\n        call check( nf90_enddef(ncid) )\n        call check( nf90_put_var(ncid, varid, dat) )\n        call check( nf90_close(ncid) )\n      contains\n        subroutine check(status)\n          integer, intent(in) :: status\n          if (status /= nf90_noerr) call abort\n        end subroutine check\n      end program test\n    EOS\n    system \"gfortran\", \"test.f90\", \"-L#{lib}\", \"-I#{include}\", \"-lnetcdff\",\n                       \"-o\", \"testf\"\n    system \"./testf\"\n  end\nend"
  },
  {
    "path": "Formula/osgeo-nitro.rb",
    "content": "class OsgeoNitro < Formula\n  desc \"Library reading/writing the National Imagery Transmission Format (NITF).\"\n  homepage \"https://github.com/hobu/nitro\"\n  url \"https://github.com/hobu/nitro/archive/2.7dev-5.tar.gz\"\n  version \"2.7dev-5\"\n  sha256 \"836433f8937e1598310d53f285c79784c63bd54677e8973b276c4ce9f5251b94\"\n\n  revision 1\n\n  head \"https://github.com/hobu/nitro.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"2cfb9d67e88078462f73c812e7bdf66ea02d20349b6fd2ebf2af132a7346a60c\" => :mojave\n    sha256 \"2cfb9d67e88078462f73c812e7bdf66ea02d20349b6fd2ebf2af132a7346a60c\" => :high_sierra\n    sha256 \"5cc9c36fae4c7d1310cf74aed0d02e8e950884a37aba5c9d4e072623199d73d3\" => :sierra\n  end\n\n  depends_on \"cmake\" => :build\n  depends_on \"llvm\" => :build\n\n  def install\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *std_cmake_args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n    # installs just a lib\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-ogdi.rb",
    "content": "class OsgeoOgdi < Formula\n  desc \"Open Geographic Datastore Interface - client/server API for GIS\"\n  homepage \"https://ogdi.sourceforge.io/\"\n  url \"https://github.com/libogdi/ogdi/archive/ogdi_4_1_0.tar.gz\"\n  sha256 \"e0b9c6ca37f983f21b45116126d153c0b5609954568fddc306568e204a10e41c\"\n\n  revision 3\n\n  head \"https://github.com/libogdi/ogdi.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"ababf3d3d5a8cd1e511352707ccae78de4adb5cd16cdd6a85e1239d187b2c49d\" => :catalina\n    sha256 \"ababf3d3d5a8cd1e511352707ccae78de4adb5cd16cdd6a85e1239d187b2c49d\" => :mojave\n    sha256 \"ababf3d3d5a8cd1e511352707ccae78de4adb5cd16cdd6a85e1239d187b2c49d\" => :high_sierra\n  end\n\n  # depends_on \"autoconf\" => :build\n  # depends_on \"automake\" => :build\n  # depends_on \"libtool\" => :build\n  depends_on \"osgeo-proj\"\n  depends_on \"zlib\"\n  depends_on \"expat\"\n\n  # resource \"ogdits-suite\" do\n  #   url \"https://downloads.sourceforge.net/project/ogdi/OGDI_Test_Suite/3.1/ogdits-3.1.0.tar.gz\"\n  #   sha256 \"55fcf3793ce80858cb02a94d78c7a95990e12197404bfd2178c0100a4f79f4a3\"\n  # end\n\n  def install\n    # --with-proj=ARG       Utilize external PROJ.4 support\n    # --with-projlib=path     Select PROJ.4 library\n    # --with-projinc=path     Select PROJ.4 include directory\n    # --with-zlib=ARG       Utilize external ZLIB support\n    # --with-zliblib=path     Select ZLIB library\n    # --with-zlibinc=path     Select ZLIB include directory\n    # --with-expat=ARG      Utilize external Expat library, or disable Expat.\n    # --with-expatlib=path    Select Expat library\n    # --with-expatinc=path    Select Expat include directory\n    # --with-pkgconfigdir     Use the specified pkgconfig dir (default is\n    #                         libdir/pkgconfig)\n\n    args = %W[\n      --prefix=#{prefix}\n      --with-proj=#{Formula[\"osgeo-proj\"].opt_prefix}\n      --with-zlib=#{Formula[\"zlib\"].opt_prefix}\n      --with-expat=#{Formula[\"expat\"].opt_prefix}\n      --with-zlib=#{Formula[\"zlib\"].opt_prefix}\n    ]\n\n    # Reset ARCHFLAGS to match how we build.\n    # ENV[\"ARCHFLAGS\"] = \"-arch #{MacOS.preferred_arch}\"\n\n    ENV.deparallelize\n    ENV[\"TOPDIR\"] = Dir.pwd\n\n    # FIXME: ./configure fails on ogdi test compilation due to missing rpc/types.h include\n    # use: https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Present-But-Cannot-Be-Compiled.html\n    # then, run autoconf\n    # see below fixes for rpc/types.h (does the same for ./configure)\n\n    # rename overridden rules, to avoid copius warnings\n    inreplace \"#{Dir.pwd}/config/unix.mak\" do |s|\n      s.sub! /ARCHGEN/, \"BLAH_\\\\1\"\n      s.sub! /DYNAGEN/, \"BLAH_\\\\1\"\n    end\n\n    # rename included makefile, otherwise overwritten by `uname`.mak output\n    cp \"#{Dir.pwd}/config/darwin.mak\", \"#{Dir.pwd}/config/macos.mak\"\n\n    # force overwriting of default makefile to macOS-specific\n    inreplace \"#{Dir.pwd}/config/generic.mak.in\",\n              \"unix.mak\",\n              \"macos.mak\"\n\n    # stub 'bool' typedef reassignment, otherwise get following error...\n    #\n    # ../rpf.h:77:24: error: cannot combine with previous 'char' declaration specifier\n    # typedef unsigned char  bool;\n    #                        ^\n    # <sdk-path>lib/clang/8.0.0/include/stdbool.h:31:14: note: expanded from macro 'bool'\n    # #define bool _Bool\n    #\n    inreplace \"#{Dir.pwd}/ogdi/driver/rpf/rpf.h\" do |s|\n      s.sub! /(typedef unsigned char +bool;)/, \"// \\\\1\"\n    end\n\n    # add rpc/types.h prior to other rpc includes that are missing it natively\n    # note: referenced rpc headers are in /usr/include/, so can't \"fix\" them due to SIP\n    inreplace \"#{Dir.pwd}/ogdi/gltpd/asyncsvr.c\" do |s|\n      s.sub! %r{(#( +)include <rpc/pmap_clnt\\.h>)}, \"#\\\\2include <rpc/types.h>\\n\\\\1\"\n    end\n    inreplace \"#{Dir.pwd}/include/Linux/ogdi_macro.h\" do |s|\n      s.sub! \"<wait.h>\", \"<sys/wait.h>\"\n      s.sub! %r{(#include <rpc/xdr\\.h>)}, \"#include <rpc/types.h>\\n\\\\1\"\n    end\n    ENV.append_to_cflags \"-I#{Dir.pwd}/include/Linux\"\n\n    # FIXME: .dylibs need built for macOS\n    #   .dylib files are not versioned, with unversioned symlinks pointing to them\n    #   .dylib files have no compatibility or current version embedded\n\n    # raise\n\n    # system \"autoreconf\", \"-fvi\"\n    system \"./configure\", *args\n\n    system \"make\"\n    system \"make\", \"install\"\n\n    # TODO: fix up for test suite:\n    #  'ogdi_info'; use install_name_tool to add rpath to opt_lib/ogdi (OR, link all .dylibs directly?)\n\n    # create symlinks from .so to .dylib files\n    # (ogdi_info and libs dynamically finds only .so files)\n    Pathname.glob(\"#{lib}/ogdi/*.dylib\") do |dl|\n      (lib/\"ogdi\").install_symlink dl.basename => \"#{dl.basename(\".dylib\")}.so\"\n    end\n\n    # FIXME: ogdi_info crashes with:\n    # ogdi_info(52269,0x...) malloc: *** error for object 0x...: pointer being freed was not allocated\n    # something needds changed in its src code\n    # NOTE: GDAL/OGR driver still seems to work, just not this ogdi_info utility\n  end\n\n  test do\n    # resource(\"ogdits-suite\").stage do\n    #   # TODO: customize setup.sh\n    #   #       add: TEST_DATA=$(dirname $(pwd -P))/data\n    #\n    #   cd \"scripts\" do\n    #     system \"full_test.sh\"\n    #   end\n    # end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-opencollada.rb",
    "content": "class OsgeoOpencollada < Formula\n  desc \"Stream based reader and writer library for COLLADA files\"\n  homepage \"http://www.opencollada.org\"\n  url \"https://github.com/KhronosGroup/OpenCOLLADA/archive/v1.6.68.tar.gz\"\n  sha256 \"d9db0c0a518aa6ac0359626f222707c6ca1b63a83cbf229d97a5999c9cde347b\"\n\n  revision 3\n\n  head \"https://github.com/KhronosGroup/OpenCOLLADA.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"7a4c9941364bfb7b76d0162356740be685797317c2d3b02cd4975f8167b0e57d\" => :catalina\n    sha256 \"7a4c9941364bfb7b76d0162356740be685797317c2d3b02cd4975f8167b0e57d\" => :mojave\n    sha256 \"7a4c9941364bfb7b76d0162356740be685797317c2d3b02cd4975f8167b0e57d\" => :high_sierra\n  end\n\n  depends_on \"cmake\" => :build\n  #unless OS.mac?\n  depends_on \"libxml2\"\n  depends_on \"pcre\"\n  # end\n\n  depends_on :xcode => :build\n\n  # fixed PCRE usage\n  patch do\n    url \"https://patch-diff.githubusercontent.com/raw/KhronosGroup/OpenCOLLADA/pull/615.diff\"\n    sha256 \"cf45702543aaabb443111781285f95db95b2fbda71f56458dafc73387ebab78b\"\n  end\n\n  # detecting isnan\n  patch do\n    url \"https://patch-diff.githubusercontent.com/raw/KhronosGroup/OpenCOLLADA/pull/576.diff\"\n    sha256 \"346eb47bf4f0d77284a59b566cba8d9edd97c2a89cac1da71f7c272bd5c40b8c\"\n  end\n\n  # use C++ Headers for C++ Files\n  patch do\n    url \"https://patch-diff.githubusercontent.com/raw/KhronosGroup/OpenCOLLADA/pull/614.diff\"\n    sha256 \"3ec9f8331c1f046e95b8a81585065804c537ea2bf0a37d4011dfa919243f8830\"\n  end\n\n  def install\n    args = std_cmake_args\n\n    args << \"-DUSE_LIBXML=ON\"\n    args << \"-DUSE_STATIC=OFF\"\n    args << \"-DUSE_SHARED=ON\"\n    # args << \"USE_EXPAT=OFF\" # Use expat parser. Unsupported currently. Do not use.\n    # args << \"-DWITH_IN_SOURCE_BUILD=ON\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"install\"\n      prefix.install \"bin\"\n      Dir.glob(\"#{bin}/*.xsd\") { |p| rm p }\n    end\n  end\n\n  test do\n    # system \"#{bin}/OpenCOLLADAValidator\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-openscenegraph.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !osgeo_openscenegraph_linked && !core_openscenegraph_linked }\n\n  def osgeo_openscenegraph_linked\n    Formula[\"osgeo-openscenegraph@3.4\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_openscenegraph_linked\n    Formula[\"open-scene-graph\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink osgeo-openscenegraph@3.4\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies osgeo-openscenegraph@3.4\\e[0m\\n\\n\" if osgeo_openscenegraph_linked\n    s += \"Unlink with \\e[32mbrew unlink open-scene-graph\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies open-scene-graph\\e[0m\\n\\n\" if core_openscenegraph_linked\n    s\n  end\nend\n\nclass OsgeoOpenscenegraph < Formula\n  desc \"High performance 3D graphics toolkit\"\n  homepage \"http://www.openscenegraph.org/\"\n  url \"https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-3.6.5.tar.gz\"\n  sha256 \"aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12\"\n\n  revision 1\n\n  head \"https://github.com/openscenegraph/OpenSceneGraph.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"dc93f928689f846af65943a1a62b1381528c9429e05f8a43489a589aceddfd3f\" => :catalina\n    sha256 \"dc93f928689f846af65943a1a62b1381528c9429e05f8a43489a589aceddfd3f\" => :mojave\n    sha256 \"dc93f928689f846af65943a1a62b1381528c9429e05f8a43489a589aceddfd3f\" => :high_sierra\n  end\n\n  # keg_only\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"cmake\" => :build\n  depends_on \"doxygen\" => :build\n  depends_on \"graphviz\" => :build\n  depends_on \"pkg-config\" => :build\n\n  depends_on \"boost\"\n  depends_on \"curl\"\n  depends_on \"dcmtk\"\n  depends_on \"ffmpeg\"\n  depends_on \"freetype\"\n  depends_on \"giflib\"\n  depends_on \"gnuplot\"\n  depends_on \"gtkglext\"\n  depends_on \"jasper\"\n  # depends_on \"jpeg\"\n  depends_on \"jpeg-turbo\"\n  depends_on \"librsvg\"\n  depends_on \"libtiff\"\n  depends_on \"mesa\"\n  depends_on \"openexr\"\n  depends_on \"perl\"\n  depends_on \"poppler\"\n  depends_on \"pth\"\n  depends_on \"qt\"\n  depends_on \"sdl\"\n  depends_on \"wget\"\n  depends_on \"zlib\"\n  depends_on \"libxml2\"\n  depends_on \"cairo\"\n  depends_on \"gtk+\"\n\n  depends_on \"osgeo-gdal\"\n  depends_on \"osgeo-opencollada\"\n\n  depends_on \"ilmbase\"\n  depends_on \"v8\"\n  depends_on \"llvm\"\n  depends_on \"gstreamer\"\n\n  depends_on :x11\n\n  # https://gentoobrowse.randomdan.homeip.net/packages/dev-games/openscenegraph\n  # https://bugs.gentoo.org/698866\n  # depends_on \"asio\"\n\n  # patch necessary to ensure support for gtkglext-quartz\n  # filed as an issue to the developers https://github.com/openscenegraph/osg/issues/34\n  patch :DATA\n\n  def install\n    # Fix \"fatal error: 'os/availability.h' file not found\" on 10.11 and\n    # \"error: expected function body after function declarator\" on 10.12\n    if MacOS.version == :sierra || MacOS.version == :el_capitan\n      ENV[\"SDKROOT\"] = MacOS.sdk_path\n    end\n\n    ENV.cxx11\n    ENV.append \"CXXFLAGS\", \"-std=c++11\"\n\n    args = std_cmake_args\n\n    args << \"-DCMAKE_PREFIX_PATH=#{Formula[\"qt\"].opt_lib}/cmake\"\n    args << \"-DCMAKE_CXX_FLAGS=-Wno-error=narrowing\"\n    args << \"-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}\"\n    args << \"-DEGL_LIBRARY=#{Formula[\"mesa\"].opt_lib}\"\n    args << \"-DEGL_INCLUDE_DIR=#{Formula[\"mesa\"].opt_include}/GLES/egl.h\"\n\n    # http://www.openscenegraph.org/index.php/community/maintainers-corner/packaging-openscenegraph\n    args << \"-DBUILD_DOCUMENTATION=ON\"\n\n    # disable unwanted optional dependencies to avoid opportunistic configuration\n    # TODO: add some of these back either directly or as variants after testing\n    args << \"-DCMAKE_DISABLE_FIND_PACKAGE_GTA=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_Inventor=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_COLLADA=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_FBX=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_OpenVRML=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_LibVNCServer=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_SDL2=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_SDL=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_GtkGl=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_DirectInput=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_NVTT=1\"\n    args << \"-DCMAKE_DISABLE_FIND_PACKAGE_Asio=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_ZeroConf=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_OpenCascade=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_LIBLAS=1\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_cairo=ON\" # not used by the project\n\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_FFmpeg=ON\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_GDAL=ON\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_TIFF=ON\"\n\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_Jasper=ON\"\n    # args << \"-DCMAKE_DISABLE_FIND_PACKAGE_OpenEXR=ON\"\n\n    args << \"-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio\"\n    args << \"-DOSG_WINDOWING_SYSTEM=Cocoa\"\n    args << \"-DOSG_CONFIG_HAS_BEEN_RUN_BEFORE=YES\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"doc_openscenegraph\"\n      system \"make\", \"install\"\n      doc.install Dir[\"#{prefix}/doc/OpenSceneGraphReferenceDocs/*\"]\n    end\n  end\n\n  test do\n    (testpath/\"test.cpp\").write <<~EOS\n      #include <iostream>\n      #include <osg/Version>\n      using namespace std;\n      int main()\n        {\n          cout << osgGetVersion() << endl;\n          return 0;\n        }\n    EOS\n    system ENV.cxx, \"test.cpp\", \"-I#{include}\", \"-L#{lib}\", \"-losg\", \"-o\", \"test\"\n    assert_equal `./test`.chomp, version.to_s\n  end\nend\n\n__END__\n\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -1021,7 +1021,7 @@\n         #C4706 assignment within conditional expression\n         #C4589: Constructor of abstract class 'osgGA::CameraManipulator' ignores initializer for virtual base class 'osg::Object'\n         SET(OSG_AGGRESSIVE_WARNING_FLAGS /W4 /wd4589 /wd4706 /wd4127 /wd4100)\n-ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL \"Clang\")\n+ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES \"Clang\")\n         SET(OSG_AGGRESSIVE_WARNING_FLAGS  -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -Wno-overloaded-virtual)\n\n         # CMake lacks an elseif, so other non-gcc, non-VS compilers need\n@@ -1032,25 +1032,17 @@\n             SET(OSG_CXX_LANGUAGE_STANDARD \"C++11\" CACHE STRING \"set the c++ language standard (C++98 / GNU++98 / C++11) for OSG\" )\n             MARK_AS_ADVANCED(OSG_CXX_LANGUAGE_STANDARD)\n             # remove existing flags\n-            REMOVE_CXX_FLAG(-std=c++98)\n-            REMOVE_CXX_FLAG(-std=gnu++98)\n-            REMOVE_CXX_FLAG(-std=c++11)\n-            REMOVE_CXX_FLAG(-stdlib=libstdc++)\n-            REMOVE_CXX_FLAG(-stdlib=libc++)\n\n             IF(${OSG_CXX_LANGUAGE_STANDARD} STREQUAL \"c++98\" OR ${OSG_CXX_LANGUAGE_STANDARD} STREQUAL \"C++98\")\n                 set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD \"c++98\")\n-                set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY \"libstdc++\")\n-                set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++98 -stdlib=libstdc++\")\n+                set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++98\")\n             ELSE()\n                 IF(${OSG_CXX_LANGUAGE_STANDARD} STREQUAL \"gnu++98\" OR ${OSG_CXX_LANGUAGE_STANDARD} STREQUAL \"GNU++98\")\n                     set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD \"gnu++98\")\n-                    set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY \"libstdc++\")\n-                    set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=gnu++98 -stdlib=libstdc++\")\n+                    set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=gnu++98\")\n                 ELSE()\n                     set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD \"c++11\")\n-                    set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY \"libc++\")\n-                    set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++\")\n+                    set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} -std=c++11\")\n                 ENDIF()\n             ENDIF()\n\n--- a/CMakeModules/FindGtkGl.cmake\n+++ b/CMakeModules/FindGtkGl.cmake\n@@ -10,7 +10,7 @@ IF(PKG_CONFIG_FOUND)\n     IF(WIN32)\n         PKG_CHECK_MODULES(GTKGL gtkglext-win32-1.0)\n     ELSE()\n-        PKG_CHECK_MODULES(GTKGL gtkglext-x11-1.0)\n+        PKG_CHECK_MODULES(GTKGL gtkglext-quartz-1.0)\n     ENDIF()\n\n ENDIF()\n"
  },
  {
    "path": "Formula/osgeo-oracle-client-sdk.rb",
    "content": "require File.expand_path(\"../../Strategies/cache-download\", Pathname.new(__FILE__).realpath)\n\nclass OsgeoOracleClientSdk < Formula\n  desc \"Oracle database C/C++ client libs, command-line tools and SDK\"\n  homepage \"https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html\"\n  url \"https://osgeo4mac.s3.amazonaws.com/src/dummy.tar.gz\"\n  version (MacOS.version < :el_capitan) ? \"12.1.0.2.0-2\" : \"12.2.0.1.0-2\"\n  sha256 \"e7776e2ff278d6460300bd69a26d7383e6c5e2fbeb17ff12998255e7fc4c9511\"\n\n  # revision 1\n\n  option \"with-basic\", \"Install Oracle's Basic client, instead of Basic Lite\"\n\n  resource \"basic\" do\n    if MacOS.version < :el_capitan\n      url \"file://#{HOMEBREW_CACHE}/instantclient-basic-macos.x64-12.1.0.2.0.zip\",\n          :using => CacheDownloadStrategy\n      sha256 \"71aa366c961166fb070eb6ee9e5905358c61d5ede9dffd5fb073301d32cbd20c\"\n      version \"12.1.0.2.0-2\"\n    else\n      url \"file://#{HOMEBREW_CACHE}/instantclient-basic-macos.x64-12.2.0.1.0-2.zip\",\n          :using => CacheDownloadStrategy\n      sha256 \"04a84542b5bd0a04bc45445e220a67c959a8826ce987000270705f9a1d553157\"\n    end\n  end\n\n  resource \"basic-lite\" do\n    if MacOS.version < :el_capitan\n      url \"file://#{HOMEBREW_CACHE}/instantclient-basiclite-macos.x64-12.1.0.2.0.zip\",\n          :using => CacheDownloadStrategy\n      sha256 \"c39d498fa6eb08d46014283a3a79bcaf63060cdbd0f58f97322da012350d4c39\"\n      version \"12.1.0.2.0-2\"\n    else\n      url \"file://#{HOMEBREW_CACHE}/instantclient-basiclite-macos.x64-12.2.0.1.0-2.zip\",\n          :using => CacheDownloadStrategy\n      sha256 \"2997f753b61f8b445a241e99412c132feb76cf246dcca2e7837fe82b15c1efb8\"\n    end\n  end\n\n  resource \"sdk\" do\n    if MacOS.version < :el_capitan\n      url \"file://#{HOMEBREW_CACHE}/instantclient-sdk-macos.x64-12.1.0.2.0.zip\",\n          :using => CacheDownloadStrategy\n      sha256 \"950153e53e1c163c51ef34eb8eb9b60b7f0da21120a86f7070c0baff44ef4ab9\"\n      version \"12.1.0.2.0-2\"\n    else\n      url \"file://#{HOMEBREW_CACHE}/instantclient-sdk-macos.x64-12.2.0.1.0-2.zip\",\n          :using => CacheDownloadStrategy\n      sha256 \"e0befca9c4e71ebc9f444957ffa70f01aeeec5976ea27c40406471b04c34848b\"\n    end\n  end\n\n  resource \"sqlplus\" do\n    if MacOS.version < :el_capitan\n      url \"file://#{HOMEBREW_CACHE}/instantclient-sqlplus-macos.x64-12.1.0.2.0.zip\",\n          :using => CacheDownloadStrategy\n      sha256 \"a663937e2e32c237bb03df1bda835f2a29bc311683087f2d82eac3a8ea569f81\"\n      version \"12.1.0.2.0-2\"\n    else\n      url \"file://#{HOMEBREW_CACHE}/instantclient-sqlplus-macos.x64-12.2.0.1.0-2.zip\",\n          :using => CacheDownloadStrategy\n      sha256 \"d147cbb5b2a954fdcb4b642df4f0bd1153fd56e0f56e7fa301601b4f7e2abe0e\"\n    end\n  end\n\n  def fixup_rpaths(mach_bins)\n    # mach_bins as [Pathname]\n    mach_bins.each do |m|\n      m = Pathname.new(m) if m.is_a?(String)\n      next if m.symlink?\n      m.ensure_writable do\n        MachO::Tools.add_rpath(m.to_s, opt_lib.to_s, :strict => false)\n        # will only affect dylibs\n        MachO::Tools.change_dylib_id(m.to_s, (opt_lib/m.basename).to_s)\n      end\n    end\n  end\n\n  def oracle_env_vars\n    {\n      :ORACLE_HOME => opt_prefix,\n      :OCI_LIB => opt_lib,\n      :TNS_ADMIN => opt_prefix/\"network/admin\",\n    }\n  end\n\n  def install\n    resource(build.with?(\"basic\") ? \"basic\" : \"basic-lite\").stage do\n      oracle_exes = %w[adrci genezi uidrvci]\n      ver_split = version.to_s.split(\".\")\n      maj_ver = ver_split[0]\n      min_ver = ver_split[1]\n\n      # fix permissions\n      chmod 0644, Dir[\"*\"]\n      chmod 0755, oracle_exes\n\n      # fixup lib naming to macOS style with some symlinks\n      if MacOS.version < :el_capitan\n        %w[libclntsh libclntshcore libocci].each do |f|\n          ln_sf \"#{f}.dylib.#{maj_ver}.#{min_ver}\", \"#{f}.dylib\"\n        end\n      end\n\n      # install fixed-up libs and exes\n      lib.install Dir[\"*.dylib*\"]\n      bin.install oracle_exes\n    end\n\n    # install headers in a logical subdirectory (since some are too generally named)\n    resource(\"sdk\").stage do\n      cd \"sdk\" do\n        Dir[\"**/*\", \".\"].each do |f|\n          chmod (File.directory?(f.to_s) ? 0755 : 0644), f\n        end\n        (include/\"oci\").install Dir[\"include/*\"]\n        rmdir \"include\"\n        ln_sf \"../include\", \"./\"\n      end\n      prefix.install \"sdk\"\n    end\n\n    resource(\"sqlplus\").stage do\n      # fix permissions\n      chmod 0644, Dir[\"*\"]\n      chmod 0755, \"sqlplus\"\n\n      lib.install Dir[\"*.dylib\"]\n      bin.install \"sqlplus\"\n\n      # Site Profile goes in $ORACLE_HOME/sqlplus/admin/glogin.sql\n      (prefix/\"sqlplus/admin\").install \"glogin.sql\"\n    end\n\n    # fixup @rpath locations\n    # update install names to opt_prefix (probably done by Homebrew as well)\n    fixup_rpaths Dir[lib/\"lib*\", bin/\"*\"]\n\n    # make any extra client paths\n    (prefix/\"network/admin\").mkpath\n\n    # wrap cmd line tools with Oracle env vars\n    envvars = oracle_env_vars\n    envvars[:NLS_LANG] = \"AMERICAN_AMERICA.UTF8\" if build.without? \"basic\"\n    bin.env_script_all_files(libexec/\"bin\", envvars)\n  end\n\n  def caveats\n    s = <<~EOS\n      To build software with the Instant Client SDK, add to the following\n      environment variable to find headers:\n\n        [CFLAGS|CPPFLAGS]: -I#{opt_include}/oci\n\n      Executables are wrapped with environ:\n    EOS\n    envvars = oracle_env_vars\n    envvars[:NLS_LANG] = \"AMERICAN_AMERICA.UTF8\" if build.without? \"basic\"\n    envvars.each { |k, v| s += \"  #{k}=#{v}\\n\" }\n    s += \"\\n\"\n  end\n\n  test do\n    # From GDAL 2.1.2's configure test\n    (testpath/\"test.cpp\").write <<~EOS\n    #include <oci.h>\n    int main () {\n      OCIEnv* envh = 0;\n      OCIEnvCreate(&envh, OCI_DEFAULT, 0, 0, 0, 0, 0, 0);\n      if (envh) OCIHandleFree(envh, OCI_HTYPE_ENV);\n      return 0;\n    }\n    EOS\n    system ENV.cxx, \"test.cpp\",\n           \"-I#{opt_include}/oci\", \"-L#{opt_lib}\", \"-lclntsh\", \"-o\", \"test\"\n    system \"./test\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-orfeo.rb",
    "content": "class OsgeoOrfeo < Formula\n  desc \"Library of image processing algorithms\"\n  homepage \"https://www.orfeo-toolbox.org/otb\"\n  url \"https://github.com/orfeotoolbox/OTB/archive/7.0.0.tar.gz\"\n  sha256 \"cd81a538cda6420e06a921bb575f5c25e204f9c382aac23e161d91e583aaf22a\"\n\n  revision 2\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"b2d8e36b3f822fbfc8b7036bed3e6e0db9df8dbeb1630f287b1cce828b7fd7fc\" => :catalina\n    sha256 \"b2d8e36b3f822fbfc8b7036bed3e6e0db9df8dbeb1630f287b1cce828b7fd7fc\" => :mojave\n    sha256 \"b2d8e36b3f822fbfc8b7036bed3e6e0db9df8dbeb1630f287b1cce828b7fd7fc\" => :high_sierra\n  end\n\n  head \"https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb.git\", :branch => \"master\"\n\n  # Errors found when using ITK 5\n  # https://github.com/InsightSoftwareConsortium/ITKNeuralNetworks/issues/13\n  # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/merge_requests/194\n  ###################\n  # CMake Error at /usr/local/opt/osgeo-insighttoolkit/lib/cmake/ITK-5.0/ITKModuleAPI.cmake\n  #  No such module: \"ITKNeuralNetworks\"\n  # Modules/ThirdParty/ITK/otb-module-init.cmake\n  # CMake/OTBModuleEnablement.cmake\n  # CMakeLists.txt\n  ###################\n  # /Modules/Core/Common/src/otbConfigurationManager.cxx: fatal error: 'itkMultiThreader.h' file not found\n  # /Modules/Core/Metadata/src/otbImageMetadataInterfaceFactory.cxx: fatal error: 'itkMutexLock.h' file not found\n  # Modules/Core/Metadata/src/otbImageMetadataInterfaceFactory.cxx: fatal error: 'ITKDeprecatedExport.h' file not found\n  ###################\n  # MPIConfig::Pointer MPIConfig::m_Singleton = NULL;\n  # /usr/local/include/ITK-5.0/itkSmartPointer.h: note: candidate constructor\n  #   constexpr SmartPointer (std::nullptr_t p) noexcept\n  # /usr/local/include/ITK-5.0/itkSmartPointer.h: note: candidate constructor\n  #   SmartPointer (ObjectType *p) noexcept\n\n  # otbenv.profile\n  patch :DATA\n\n  option \"without-monteverdi\", \"Build without Monteverdi and Mapla applications (Qt required)\"\n  option \"without-python\", \"Build without Python support\"\n  option \"with-patented\", \"Build with Patented Examples\"\n  option \"with-examples\", \"Compile and install various examples\"\n  option \"with-mpi\", \"Build with Open MPI, a High Performance Message Passing Library\"\n  # option \"with-mapnik\", \"Build with Mapnik, toolkit for developing mapping applications\"\n  # option \"with-shark\", \"Build with Machine learning library\"\n  # option \"with-openjpeg\", \"Build with OpenJPEG, an open source JPEG 2000 codec\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"boost\"\n  depends_on \"pkg-config\"\n  depends_on \"libpng\"\n  depends_on \"pcre\"\n  depends_on \"openssl\"\n  depends_on \"sqlite\"\n  depends_on \"tinyxml\"\n  depends_on \"zlib\"\n  depends_on \"expat\"\n  depends_on \"gsl\"\n  depends_on \"curl\"\n  depends_on \"icu4c\"\n  depends_on \"freetype\"\n  depends_on \"perl\"\n  depends_on \"libtool\" # libltdl\n  depends_on \"jpeg\"\n  depends_on \"libtiff\"\n  depends_on \"geos\"\n  depends_on \"openjpeg\"\n  depends_on \"hdf5\"\n  depends_on \"opencv@2\"\n  depends_on \"python\"\n  depends_on \"swig\"\n  depends_on \"numpy\"\n  depends_on \"fftw\" # restricts built binaries to GPL license\n  depends_on \"libsvm\" => :recommended\n  depends_on \"minizip\" => :recommended\n  depends_on \"muparser\" => :recommended\n  depends_on \"osgeo-libgeotiff\"\n  depends_on \"osgeo-proj\"\n  depends_on \"osgeo-hdf4\"\n  depends_on \"osgeo-netcdf\"\n  depends_on \"osgeo-muparserx\" => :recommended\n  depends_on \"osgeo-libkml\" => :recommended\n  depends_on \"osgeo-vtk\"\n  depends_on \"osgeo-ossim\"\n  # depends_on \"osgeo-insighttoolkit\"\n  depends_on \"osgeo-insighttoolkit@4\"\n  depends_on \"osgeo-openscenegraph\" # (for libOpenThreads, now internal to osg)\n\n  # ICE Viewer: needs X11 support\n  # apparently, GLUT is not needed by Monteverdi, which uses ICE non-gui module,\n  # but is needed for the ICE Viewer\n  depends_on \"freeglut\"\n\n  # Monteverdi: required deps and required/optionals shared with OTB\n  depends_on \"osgeo-gdal\"\n  depends_on \"glew\"\n  depends_on \"glfw\"\n  depends_on \"qt\"\n  depends_on \"qwt\"\n\n  # Need libagg if building mapnik\n  # if build.with? \"mapnik\"\n  #   depends_on \"osgeo-mapnik\"\n  #   depends_on \"libagg\"\n  # end\n\n  # if build.with? \"shark\"\n  #   depends_on \"osgeo-shark\"\n  # end\n\n  depends_on \"open-mpi\" if build.with? \"mpi\"\n\n  resource \"geoid\" do\n    # geoid to use in elevation calculations, if no DEM defined or avialable\n    url \"https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-data/raw/master/Input/DEM/egm96.grd\"\n    sha256 \"2babe341e8e04db11447e823ac0dfe4b17f37fd24c7966bb6aeab85a30d9a733\"\n    version \"5.0.0\"\n  end\n\n  # resource \"GKSVM\" do\n  #   url \"https://github.com/jmichel-otb/GKSVM.git\",\n  #     :branch => \"master\",\n  #     :commit => \"553dc8e40ab1538c46de6596ec323627dac5fea5\"\n  #   version \"0.0.1\"\n  # end\n\n  def install\n    ENV.cxx11\n\n    # Module for monteverdi build\n    # if build.with? \"monteverdi\"\n    #   (buildpath/\"Modules/Remote\").install resource(\"GKSVM\")\n    # end\n\n    (libexec/\"default_geoid\").install resource(\"geoid\")\n\n    args = std_cmake_args + %W[\n      -DOTB_BUILD_DEFAULT_MODULES=ON\n      -DBUILD_TESTING=OFF\n      -DBUILD_SHARED_LIBS=ON\n      -DCMAKE_MACOSX_RPATH=OFF\n      -DCMAKE_CXX_STANDARD=11\n      -DQWT_LIBRARY=#{Formula[\"qwt\"].lib}/qwt.framework\n      -DQWT_INCLUDE_DIR=#{Formula[\"qwt\"].lib}/qwt.framework/Headers\n      -DOTB_USE_GSL=ON\n    ]\n\n    # fix error: no member named 'createRpcProjection' in 'ossimRpcSolver'\n    # args << \"-DOSSIM_VERSION=#{Formula[\"osgeo-ossim\"].version}\"\n    args << \"-DOSSIM_LIBRARY=#{Formula[\"osgeo-ossim\"].opt_prefix}/Frameworks/ossim.framework\"\n    args << \"-DOSSIM_INCLUDE_DIR=#{Formula[\"osgeo-ossim\"].opt_include}\"\n    # args << \"-DOSSIM_INCLUDE_DIR=#{Formula[\"osgeo-ossim\"].opt_prefix}/Frameworks/ossim.framework/Headers\"\n    # find_path( OSSIM_INCLUDE_DIR NAMES ossim/init/ossimInit.h )\n\n    # Simple Parallel Tiff Writer\n    # args << \"-DOTB_USE_SPTW=OFF\"\n\n    # Option to activate deprecated classes\n    # Turn on the use and test of deprecated classes\n    # args << \"-DOTB_USE_DEPRECATED=OFF\"\n\n    # Add openmp compiler and linker flags\n    # args << \"-DOTB_USE_OPENMP=OFF\"\n\n    # Enable SIMD optimizations (hardware dependent)\n    # args << \"-DOTB_USE_SSE_FLAGS=ON\"\n\n    # Enable module 6S\n    # args << \"-DOTB_USE_6S=ON\"\n\n    # Enable module Curl\n    # args << \"-DOTB_USE_CURL=ON\"\n\n    # Build with static libraries\n    # args << \"-DBUILD_STATIC_LIBS=OFF\"\n\n    # Build with specific list of remote modules\n    # args << \"-DWITH_REMOTE_MODULES=OFF\"\n\n    # -DCMAKE_CXX_FLAGS=\"$CXXFLAGS -fPIC\"\n    # -DCMAKE_C_FLAGS=\"$CFLAGS -fPIC\"\n\n    args << \"-DOTB_DATA_USE_LARGEINPUT=ON\"\n\n    args << \"-DOPENTHREADS_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libOpenThreads.dylib\"\n    args << \"-DOPENTHREADS_INCLUDE_DIR=#{Formula[\"osgeo-openscenegraph\"].opt_include}\"\n\n    args << \"-DOTB_WRAP_JAVA=ON\"\n\n    # python\n    args << \"-DOTB_WRAP_PYTHON=OFF\" if build.without? \"python\"\n    args << \"-DOTB_WRAP_PYTHON=ON\"\n    args << \"-DPYTHON_EXECUTABLE=#{HOMEBREW_PREFIX}/opt/python/bin/python3\"\n    py_ver= `#{HOMEBREW_PREFIX}/opt/python/bin/python3 -c 'import sys;print(\"{0}.{1}\".format(sys.version_info[0],sys.version_info[1]))'`.strip\n    args << \"-DPYTHON_LIBRARY=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/lib/libpython#{py_ver}m.dylib\"\n    args << \"-DPYTHON_LIBRARY_RELEASE=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/lib/libpython#{py_ver}m.dylib\"\n    # args << \"-DPYTHON3_LIBRARY_DEBUG=\"\n    args << \"-DPYTHON_INCLUDE_DIR=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/include/python#{py_ver}m\"\n    # args << \"-DNUMPY_PYTHON3_INCLUDE_DIR=\"\n    args << \"-DOTB_INSTALL_PYTHON_DIR=#{lib}/python#{py_ver}/site-packages/otb\"\n    args << \"-DNUMPY_INCLUDE_DIR=#{Formula[\"numpy\"].opt_lib}/python#{py_ver}/site-packages/numpy/core/include\" # numpy/arrayobject.h\n\n    args << \"-DITK_DIR=#{Formula[\"cmake\"].share}/cmake/Modules\"\n\n    # iceviewer\n    fg = Formula[\"freeglut\"]\n    args << \"-DGLUT_INCLUDE_DIR=#{fg.opt_include}\"\n    args << \"-DGLUT_glut_LIBRARY=#{fg.opt_lib}/libglut.dylib\"\n\n    args << \"-DOTB_USE_OPENCV=ON\"\n    args << \"-Dopencv_INCLUDE_DIR=#{Formula['opencv@2'].include}\"\n    args << \"-DOPENCV_core_LIBRARY=#{Formula['opencv@2'].lib}/libopencv_core.dylib\"\n\n    args << \"-DBUILD_EXAMPLES=\" + (build.with?(\"examples\") ? \"ON\" : \"OFF\")\n\n    args << \"-DITK_USE_FFTWF=ON\"\n    args << \"-DITK_USE_FFTWD=ON\"\n    args << \"-DITK_USE_SYSTEM_FFTW=ON\"\n    args << \"-DOTB_USE_CURL=ON\"\n    args << \"-DOTB_USE_GLEW=ON\"\n    args << \"-DOTB_USE_GLFW=ON\"\n    args << \"-DOTB_USE_GLUT=ON\"\n    args << \"-DOTB_USE_LIBKML=ON\"\n    args << \"-DOTB_USE_LIBSVM=ON\"\n    args << \"-DOTB_USE_MPI=ON\"\n    args << \"-DOTB_USE_QT=ON\"\n    args << \"-DOTB_USE_QWT=ON\"\n    args << \"-DOTB_USE_SIFTFAST=ON\"\n    args << \"-DOTB_USE_MUPARSER=ON\"\n    args << \"-DOTB_USE_MUPARSERX=ON\"\n\n    # if build.with? \"mapnik\"\n    #   args << \"-DOTB_USE_MAPNIK=ON\"\n    #   args << \"-DMAPNIK_LIBRARY=#{Formula[\"osgeo-mapnik\"].opt_lib}/libmapnik.dylib\"\n    #   args << \"-DMAPNIK_INCLUDE_DIR=#{Formula[\"osgeo-mapnik\"].opt_include}/mapnik\"\n    #   args << \"-DAGG_INCLUDE_DIR=#{Formula['libagg'].include}\"\n    # end\n\n    # if build.with? \"shark\"\n    #   args << \"-DOTB_USE_SHARK=ON\"\n    # end\n\n    args << \"-DOTB_USE_OPENGL=ON\"\n    args << \"-DOPENGL_INCLUDE_DIR=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers\"\n\n    # args << \"-DOTB_USE_PATENTED=\" + (build.with?(\"patented\") ? \"ON\" : \"OFF\") # not used by the project\n    # args << \"-DOTB_USE_OPENJPEG=\" + (build.with?(\"openjpeg\") ? \"ON\" : \"OFF\") # not used by the project\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    # A script to initialize the environment for OTB executables\n    cp_r \"#{buildpath}/Packaging/Files/otbenv.profile\", \"#{prefix}\"\n\n    # clean up any unneeded otbgui script wrappers\n    rm_f Dir[\"#{bin}/otbgui*\"] unless (bin/\"otbgui\").exist?\n\n    # make env-wrapped command line utility launcher scripts\n    envars = {\n      :GDAL_DATA => \"#{Formula[\"osgeo-gdal\"].opt_share}/gdal\",\n      :OTB_APPLICATION_PATH => \"#{opt_lib}/otb/applications\",\n      :OTB_FOLDER => \"#{opt_prefix}\",\n      :OTB_GEOID_FILE => \"#{opt_libexec}/default_geoid/egm96.grd\",\n    }\n    bin.env_script_all_files(libexec/\"bin\", envars)\n  end\n\n  def caveats; <<~EOS\n      The default geoid to use in elevation calculations is available in:\n\n        #{opt_libexec}/default_geoid/egm96.grd\n  EOS\n  end\n\n  test do\n    puts \"Testing CLI wrapper\"\n    out = `#{opt_bin}/otbcli 2>&1`\n    assert_match \"module_name [MODULEPATH] [arguments]\", out\n    puts \"Testing Rescale CLI app\"\n    out = `#{opt_bin}/otbcli_Rescale 2>&1`\n    assert_match \"Rescale the image between two given values\", out\n    if (opt_bin/\"otbgui\").exist?\n      puts \"Testing Qt GUI wrapper\"\n      out = `#{opt_bin}/otbgui 2>&1`\n      assert_match \"module_name [module_path]\", out\n    end\n  end\nend\n\n__END__\n\n--- a/Packaging/Files/otbenv.profile\n+++ b/Packaging/Files/otbenv.profile\n@@ -49,18 +49,18 @@\n PATH=$(cat_path \"OUT_DIR/bin\" \"$PATH\")\n\n # export PYTHONPATH to import otbApplication.py\n-PYTHONPATH=$(cat_path \"OUT_DIR/lib/python\" \"$PYTHONPATH\")\n+PYTHONPATH=OUT_DIR/lib/python3.7/site-packages:$PYTHONPATH\n\n # set numeric locale to C\n LC_NUMERIC=C\n\n # set GDAL_DATA variable used by otb application\n-GDAL_DATA=OUT_DIR/share/gdal\n+GDAL_DATA=HOMEBREW_PREFIX/opt/osgeo-gdal/share/gdal\n\n export GDAL_DRIVER_PATH=disable\n\n # set GEOTIFF_CSV variable used by otb application\n-GEOTIFF_CSV=OUT_DIR/share/epsg_csv\n+GEOTIFF_CSV=HOMEBREW_PREFIX/opt/osgeo-libgeotiff/share/epsg_csv\n\n # export variables\n export LC_NUMERIC\n\n# --- a/CMakeLists.txt\n# +++ b/CMakeLists.txt\n# @@ -100,6 +100,12 @@\n#  reset_qt_i18n_sources()\n#\n#  repository_status(${PROJECT_SOURCE_DIR} OTB_GIT_STATUS_MESSAGE)\n# +\n# +#if ITK_VERSION_MAJOR < 5\n# +#define OTB_DISABLE_DYNAMIC_MT\n# +#else\n# +#define OTB_DISABLE_DYNAMIC_MT this->DynamicMultiThreadingOff();\n# +#endif\n\n # Find python stuff\n # Version 3 is preferred before 2\n\n# --- a/SuperBuild/CMake/External_itk.cmake\n# +++ b/SuperBuild/CMake/External_itk.cmake\n# @@ -84,7 +84,7 @@\n#    Eigen\n#    #FEM\n#    NarrowBand\n# -  NeuralNetworks\n# +  #NeuralNetworks\n#    Optimizers\n#    Optimizersv4\n#    Polynomials\n\n# --- a/Modules/ThirdParty/ITK/otb-module-init.cmake\n# +++ b/Modules/ThirdParty/ITK/otb-module-init.cmake\n# @@ -71,7 +71,7 @@\n#      ITKEigen\n#      #ITKFEM\n#      ITKNarrowBand\n# -    ITKNeuralNetworks\n# +    #ITKNeuralNetworks\n#      ITKOptimizers\n#      ITKOptimizersv4\n#      ITKPolynomials\n"
  },
  {
    "path": "Formula/osgeo-osgearth.rb",
    "content": "class OsgeoOsgearth < Formula\n  desc \"Geospatial SDK and terrain engine for OpenSceneGraph\"\n  homepage \"http://osgearth.org\"\n  url \"https://github.com/gwaldron/osgearth.git\",\n    :branch => \"master\",\n    :commit => \"1faf43af681e22b0d3b4d0a1ada7e138cf3aac46\"\n  version \"2.10.1\"\n\n  bottle do\n    root_url \"https://dl.bintray.com/homebrew-osgeo/osgeo-bottles\"\n    cellar :any\n    rebuild 1\n    sha256 \"0784fecac54032d20b907ff013b6d7fa23faf083981ac9d26340d61e4fe45845\" => :mojave\n    sha256 \"0784fecac54032d20b907ff013b6d7fa23faf083981ac9d26340d61e4fe45845\" => :high_sierra\n    sha256 \"0784fecac54032d20b907ff013b6d7fa23faf083981ac9d26340d61e4fe45845\" => :sierra\n  end\n\n  # revision 2\n\n  head \"https://github.com/gwaldron/osgearth.git\", :branch => \"master\"\n\n  option \"without-minizip\", \"Build without Google KMZ file access support\"\n  option \"with-docs-examples\", \"Build and install html documentation and examples\"\n  option \"with-v8\", \"Build with Google's V8 JavaScript engine support\"\n  option \"with-rocksdb\", \"Build with Rocksdb an Embedded key-value store for fast storage\"\n  # option \"with-tinyxml\", \"Use external libtinyxml, instead of internal\"\n  # option \"with-duktape\", \"Build with Duktape an Embeddable Javascript engine\"\n\n  #depends_on :macos => :mavericks\n  depends_on \"cmake\" => :build\n  depends_on \"boost\"\n  depends_on \"curl\"\n  depends_on \"expat\"\n  depends_on \"geos\"\n  depends_on \"glslang\"\n  depends_on \"leveldb\"\n  depends_on \"libzip\"\n  depends_on \"osgeo-gdal\"\n  depends_on \"osgeo-openscenegraph\"\n  depends_on \"osgeo-osgqt\"\n  depends_on \"poco\"\n  depends_on \"protobuf\"\n  depends_on \"python\" # for sphinx\n  depends_on \"qt\"\n  depends_on \"sqlite\"\n  depends_on :x11\n  depends_on \"minizip\" => :recommended\n  depends_on \"rocksdb\" => :optional\n  depends_on \"v8\" => :optional\n  # depends_on \"duktape\" => :optional\n  # depends_on \"triton-sdk\" => :optional # Triton Ocean SDK\n\n  resource \"Sphinx\" do\n    url \"https://files.pythonhosted.org/packages/4d/ed/4595274b5c9ce53a768cc0804ef65fd6282c956b93919a969e98d53894e4/Sphinx-1.8.3.tar.gz\"\n    sha256 \"c4cb17ba44acffae3d3209646b6baec1e215cad3065e852c68cc569d4df1b9f8\"\n  end\n\n  # fix error: unknown type name 'GLDEBUGPROC'\n  # restore osgEarthQt: osgEarthQt5\n  # https://github.com/gwaldron/osgearth/commit/c7f9d22b60bd1bb969b853b34b7f3955141e8b07\n  # qgis3: libosgEarthQt5.dylib needed by PlugIns/qgis/libglobeplugin.dylib\n  patch :DATA\n\n  def install\n    ENV.cxx11\n\n    if (build.with? \"docs-examples\") && (!which(\"sphinx-build\"))\n      # temporarily vendor a local sphinx install\n      sphinx_dir = prefix/\"sphinx\"\n      sphinx_site = sphinx_dir/\"lib/python#{py_ver}/site-packages\"\n      sphinx_site.mkpath\n      ENV.prepend_create_path \"PYTHONPATH\", sphinx_site\n      resource(\"Sphinx\").stage { quiet_system \"python#{py_ver}\", \"setup.py\", \"install\", \"--prefix=#{sphinx_dir}\" }\n      ENV.prepend_path \"PATH\", sphinx_dir/\"bin\"\n    end\n\n    args = std_cmake_args\n    args << \"-DOSGEARTH_QT_BUILD=ON\"\n    args << \"-DOSGEARTH_QT_BUILD_LEGACY_WIDGETS=ON\"\n    args << \"-DDYNAMIC_OSGEARTH=ON\"\n    args << \"-DOSGQT_LIBRARY=#{Formula[\"osgqt\"].opt_lib}/libosgQt5.dylib\"\n    args << \"-DCMAKE_PREFIX_PATH=#{Formula[\"qt\"].opt_lib}/cmake\"\n\n    args << \"-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}\"\n\n    args << \"-DGDAL_LIBRARY=#{Formula[\"gdal2\"].opt_lib}/libgdal.dylib\"\n    args << \"-DGDAL_INCLUDE_DIR=#{Formula[\"gdal2\"].opt_include}\"\n    args << \"-DGEOS_LIBRARY=#{Formula[\"geos\"].opt_lib}/libgeos.dylib\"\n    args << \"-DGEOS_INCLUDE_DIR=#{Formula[\"geos\"].opt_include}\"\n    args << \"-DLEVELDB_LIBRARY=#{Formula[\"leveldb\"].opt_lib}/libleveldb.dylib\"\n    args << \"-DLEVELDB_INCLUDE_DIR=#{Formula[\"leveldb\"].opt_include}\"\n    args << \"-DOSG_DIR=#{Formula[\"osgeo-openscenegraph\"].opt_prefix}\"\n    args << \"-DOSG_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosg.dylib\"\n    args << \"-DOSGUTIL_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgUtil.dylib\"\n    args << \"-DOSGDB_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgDB.dylib\"\n    args << \"-DOSGTEXT_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgText.dylib\"\n    args << \"-DOSGTERRAIN_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgTerrain.dylib\"\n    args << \"-DOSGFX_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgFX.dylib\"\n    args << \"-DOSGSIM_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgSim.dylib\"\n    args << \"-DOSGVIEWER_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgViewer.dylib\"\n    args << \"-DOSGGA_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgGA.dylib\"\n    args << \"-DOSGWIDGET_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgWidget.dylib\"\n    args << \"-DOSGSHADOW_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgShadow.dylib\"\n    args << \"-DOSGMANIPULATOR_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgManipulator.dylib\"\n    args << \"-DOSGPARTICLE_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libosgParticle.dylib\"\n    args << \"-DOPENTHREADS_LIBRARY=#{Formula[\"osgeo-openscenegraph\"].opt_lib}/libOpenThreads.dylib\"\n    args << \"-DOSG_INCLUDE_DIR=#{Formula[\"osgeo-openscenegraph\"].opt_include}\"\n    args << \"-DOSG_GEN_INCLUDE_DIR=#{Formula[\"osgeo-openscenegraph\"].opt_include}\"\n    args << \"-DPOCO_FOUNDATION_LIBRARY=#{Formula[\"poco\"].opt_lib}/libPocoFoundation.dylib\"\n    args << \"-DPOCO_NET_LIBRARY=#{Formula[\"poco\"].opt_lib}/libPocoNet.dylib\"\n    args << \"-DPOCO_UTIL_LIBRARY=#{Formula[\"poco\"].opt_lib}/libPocoUtil.dylib\"\n    args << \"-DPOCO_INCLUDE_DIR=#{Formula[\"poco\"].opt_include}\"\n    args << \"-DSQLITE3_LIBRARY=#{Formula[\"sqlite\"].opt_lib}/libsqlite3.dylib\"\n    args << \"-DSQLITE3_INCLUDE_DIR=#{Formula[\"sqlite\"].opt_include}\"\n\n    if build.with? \"rocksdb\"\n      args << \"-DWITH_STATIC_ROCKSDB=ON\"\n      args << \"-DROCKSDB_LIBRARY=#{Formula[\"rocksdb\"].opt_lib}/librocksdb.dylib\"\n      args << \"-DROCKSDB_INCLUDE_DIR=#{Formula[\"rocksdb\"].opt_include}\"\n    end\n\n    # v8 and minizip options should have empty values if not defined '--with'\n    if build.without? \"v8\"\n      args << \"-DV8_INCLUDE_DIR=''\" << \"-DV8_BASE_LIBRARY=''\" << \"-DV8_SNAPSHOT_LIBRARY=''\"\n      args << \"-DV8_ICUI18N_LIBRARY=''\" << \"-DV8_ICUUC_LIBRARY=''\"\n    end\n\n    # if build.with? \"triton\"\n    #   args << \"-DTRITON_LIBRARY=#{Formula[\"triton-sdk\"].opt_lib}\"\n    #   args << \"-DTRITON_INCLUDE_DIR=#{Formula[\"triton-sdk\"].opt_include}\"\n    # end\n\n    # if build.with? \"duktape\"\n    #   args << \"-DWITH_EXTERNAL_DUKTAPE=ON\"\n    #   args << \"-DDUKTAPE_LIBRARY=#{Formula[\"duktape\"].opt_lib}/libduktaped.dylib\"\n    #   args << \"-DDUKTAPE_INCLUDE_DIR=#{Formula[\"duktape\"].opt_include}\"\n    # end\n\n    # Failure to build with external tinyxml\n    # https://github.com/gwaldron/osgearth/issues/1002\n    # if build.with? \"tinyxml\"\n    #   args << \"-DWITH_EXTERNAL_TINYXML=ON\"\n    #   args << \"-DTINYXML_LIBRARY=#{Formula[\"tinyxml\"].opt_lib}/libtinyxml.dylib\"\n    #   args << \"-DTINYXML_INCLUDE_DIR=#{Formula[\"tinyxml\"].opt_include}\"\n    # end\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\", \"install\"\n    end\n\n    if build.with? \"docs-examples\"\n      cd \"docs\" do\n        system \"make\", \"html\"\n        doc.install \"build/html\" => \"html\"\n      end\n      doc.install \"data\"\n      doc.install \"tests\" => \"examples\"\n      rm_r prefix/\"sphinx\" if File.exist?(prefix/\"sphinx\")\n    end\n  end\n\n  def caveats\n    osg = Formula[\"osgeo-openscenegraph\"]\n    osgver = (osg.linked_keg.exist?) ? osg.version : \"#.#.# (version)\"\n    <<~EOS\n    This formula installs Open Scene Graph plugins. To ensure access when using\n    the osgEarth toolset, set the OSG_LIBRARY_PATH enviroment variable to:\n\n      #{HOMEBREW_PREFIX}/lib/osgPlugins-#{osgver}\n\n    EOS\n  end\n\n  test do\n    system \"#{bin}/osgearth_version\"\n  end\n\n  private\n\n  def py_ver\n    `#{Formula[\"python\"].opt_bin}/python3 -c 'import sys;print(\"{0}.{1}\".format(sys.version_info[0],sys.version_info[1]))'`.strip\n  end\nend\n\n\n__END__\n\n--- /src/osgEarthSplat/LandUseTileSource.cpp\n+++ /src/osgEarthSplat/LandUseTileSource.cpp\n@@ -22,6 +22,8 @@\n #include <osgEarth/ImageUtils>\n #include <osgEarth/SimplexNoise>\n\n+typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam);\n+\n using namespace osgEarth;\n using namespace osgEarth::Splat;\n\n\n--- /src/osgEarthQt/ViewerWidget.cpp\n+++ /src/osgEarthQt/ViewerWidget.cpp\n@@ -28,6 +28,8 @@\n #include <osgViewer/Viewer>\n #include <osgViewer/ViewerEventHandlers>\n\n+typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);\n+#include <QOpenGLContext>\n #include <QtGui>\n #include <QtCore/QTimer>\n #include <QWidget>\n\n\n--- a/src/applications/osgearth_package_qt/PackageQtMainWindow\n+++ b/src/applications/osgearth_package_qt/PackageQtMainWindow\n@@ -35,6 +35,8 @@\n\n #include <osgDB/FileNameUtils>\n\n+typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);\n+#include <QOpenGLContext>\n #include <QAction>\n #include <QDockWidget>\n #include <QtGui>\n\n\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -186,6 +186,21 @@\n     FIND_LIBRARY(MATH_LIBRARY m)\n ENDIF(UNIX AND NOT ANDROID)\n\n+\n+IF(OSGEARTH_QT_BUILD)\n+\tOPTION(OSGEARTH_QT_BUILD \"Enable to use Qt (build Qt-dependent libraries, plugins and examples)\" ON)\n+\tOPTION(OSGEARTH_QT_BUILD_LEGACY_WIDGETS \"Build the legacy Qt widgets\" ON)\n+\tFIND_PACKAGE(Qt5Core REQUIRED)\n+\tFIND_PACKAGE(Qt5Gui REQUIRED)\n+\tFIND_PACKAGE(Qt5OpenGL REQUIRED)\n+\tFIND_PACKAGE(Qt5OpenGLExtensions REQUIRED)\n+\tFIND_PACKAGE(Qt5Widgets REQUIRED)\n+\tFIND_PACKAGE(Qt5MacExtras REQUIRED)\n+\tIF ( Qt5Core_FOUND AND Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND AND Qt5OpenGLExtensions_FOUND )\n+\t\tSET(QT_INCLUDES ${Qt5Widgets_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5OpenGLExtensions_INCLUDE_DIRS})\n+\t\tMESSAGE(STATUS \"Found Qt version: ${Qt5Core_VERSION_STRING}\")\n+\tENDIF ()\n+ENDIF()\n\n # Platform specific definitions\n\n\n--- a/CMakeModules/FindOSG.cmake\n+++ b/CMakeModules/FindOSG.cmake\n@@ -138,6 +138,19 @@\n FIND_OSG_LIBRARY( OPENTHREADS_LIBRARY OpenThreads )\n FIND_OSG_LIBRARY( OPENTHREADS_LIBRARY_DEBUG OpenThreadsd )\n\n+IF(OPENSCENEGRAPH_VERSION VERSION_LESS \"3.6.3\")\n+  FIND_OSG_LIBRARY( OSGQT_LIBRARY osgQt )\n+  FIND_OSG_LIBRARY( OSGQT_LIBRARY_DEBUG osgQtd )\n+ELSE(OPENSCENEGRAPH_VERSION VERSION_LESS \"3.6.3\")\n+  IF(Qt5Widgets_FOUND)\n+    FIND_OSG_LIBRARY( OSGQT_LIBRARY osgQt5 )\n+    FIND_OSG_LIBRARY( OSGQT_LIBRARY_DEBUG osgQt5d )\n+  ELSE(Qt5Widgets_FOUND)\n+    FIND_OSG_LIBRARY( OSGQT_LIBRARY osgQt )\n+    FIND_OSG_LIBRARY( OSGQT_LIBRARY_DEBUG osgQtd )\n+  ENDIF(Qt5Widgets_FOUND)\n+ENDIF(OPENSCENEGRAPH_VERSION VERSION_LESS \"3.6.3\")\n+\n SET( OSG_FOUND \"NO\" )\n IF( OSG_LIBRARY AND OSG_INCLUDE_DIR )\n     SET( OSG_FOUND \"YES\" )\n\n\n--- a/src/CMakeLists.txt\n+++ b/src/CMakeLists.txt\n@@ -14,6 +14,7 @@\n\n\n FOREACH( lib\n+         osgEarthQt\n          osgEarthSplat\n          osgEarthSilverLining\n          osgEarthTriton )\n\n\n--- a/src/applications/CMakeLists.txt\n+++ b/src/applications/CMakeLists.txt\n@@ -43,6 +43,9 @@\n ADD_SUBDIRECTORY(osgearth_atlas)\n ADD_SUBDIRECTORY(osgearth_conv)\n ADD_SUBDIRECTORY(osgearth_3pv)\n+IF (Qt5Widgets_FOUND OR QT4_FOUND AND NOT ANDROID AND OSGEARTH_QT_BUILD AND OSGEARTH_QT_BUILD_LEGACY_WIDGETS)\n+    ADD_SUBDIRECTORY(osgearth_package_qt)\n+ENDIF()\n ADD_SUBDIRECTORY(osgearth_featureinfo)\n\n IF(BUILD_OSGEARTH_EXAMPLES)\n@@ -94,6 +97,10 @@\n     ADD_SUBDIRECTORY(osgearth_drawables)\n     ADD_SUBDIRECTORY(osgearth_magnify)\n     ADD_SUBDIRECTORY(osgearth_eci)\n+    IF (Qt5Widgets_FOUND OR QT4_FOUND AND NOT ANDROID AND OSGEARTH_QT_BUILD)\n+        ADD_SUBDIRECTORY(osgearth_qt_simple)\n+        ADD_SUBDIRECTORY(osgearth_qt_windows)\n+    ENDIF()\n     ADD_SUBDIRECTORY(osgearth_windows)\n\n     IF(SILVERLINING_FOUND)\n"
  },
  {
    "path": "Formula/osgeo-osgqt.rb",
    "content": "class OsgeoOsgqt < Formula\n  desc \"3D graphics toolkit (osgQt)\"\n  homepage \"https://github.com/openscenegraph/osgQt\"\n  url \"https://github.com/openscenegraph/osgQt.git\",\n    :branch => \"master\",\n    :commit => \"8c6db61ef8ab650b972556142cceb11db057bda9\"\n  version \"3.6.3\"\n\n  revision 2\n\n  head \"https://github.com/openscenegraph/osgQt.git\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    rebuild 1\n    sha256 \"6a35302754dd73e74eb3d94d9d8569c4f3c027350669ff6010acf1091651381e\" => :mojave\n    sha256 \"6a35302754dd73e74eb3d94d9d8569c4f3c027350669ff6010acf1091651381e\" => :high_sierra\n    sha256 \"ea0310e01f112a7ed1376164eee194dd94a420442aa332daef448bb535ac8c80\" => :sierra\n  end\n\n  depends_on \"cmake\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"osgeo-openscenegraph\"\n  depends_on \"qt\"\n\n  # compatible with the new and old versions of OSG\n  # QtWindowingSystem exist from OSG 3.5.3\n  # patch :DATA\n  # for commit: 6d324db8a56feb7d1976e9fb3f1de9bf7d255646\n\n  def install\n    # Fix \"fatal error: 'os/availability.h' file not found\" on 10.11 and\n    # \"error: expected function body after function declarator\" on 10.12\n    if MacOS.version == :sierra || MacOS.version == :el_capitan\n      ENV[\"SDKROOT\"] = MacOS.sdk_path\n    end\n\n    args = std_cmake_args\n\n    args << \"-DCMAKE_PREFIX_PATH=#{Formula[\"qt\"].opt_lib}/cmake\"\n    args << \"-DCMAKE_CXX_FLAGS=-Wno-error=narrowing\" # or: -Wno-c++11-narrowing\n    args << \"-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}\"\n    args << \"-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio\"\n    args << \"-DOSG_WINDOWING_SYSTEM=Cocoa\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n    (testpath/\"test.cpp\").write <<~EOS\n      #include <iostream>\n      #include <osg/Version>\n      using namespace std;\n      int main()\n        {\n          cout << osgGetVersion() << endl;\n          return 0;\n        }\n    EOS\n    system ENV.cxx, \"test.cpp\", \"-I#{include}\", \"-L#{lib}\", \"-I#{Formula[\"osgeo-openscenegraph\"].opt_include}\", \"-L#{Formula[\"osgeo-openscenegraph\"].opt_lib}\", \"-losg\", \"-o\", \"test\"\n    assert_equal `./test`.chomp, version.to_s\n  end\nend\n\n__END__\n\n--- /CMakeLists.txt\n+++ /CMakeLists.txt\n@@ -127,7 +127,7 @@\n\n PROJECT(osgQt)\n\n-FIND_PACKAGE(OpenSceneGraph 3.0.0 REQUIRED osgDB osgGA osgUtil osgText osgViewer osgWidget)\n+FIND_PACKAGE(OpenSceneGraph 3.6.3 REQUIRED osgDB osgGA osgUtil osgText osgViewer osgWidget)\n SET(OPENSCENEGRAPH_SOVERSION 145)\n\n SET(OSG_PLUGINS osgPlugins-${OPENSCENEGRAPH_VERSION})\n\n\n--- /include/osgQt/GraphicsWindowQt\n+++ /include/osgQt/GraphicsWindowQt\n@@ -37,7 +37,7 @@\n // forward declarations\n class GraphicsWindowQt;\n\n-#if OSG_VERSION_LESS_THAN(3, 5, 6)\n+#if OSG_VERSION_LESS_THAN(3, 6, 3)\n /// The function sets the WindowingSystem to Qt.\n void OSGQT_EXPORT initQtWindowingSystem();\n #endif\n\n\n--- /src/osgQt/GraphicsWindowQt.cpp\n+++ /src/osgQt/GraphicsWindowQt.cpp\n@@ -945,7 +945,7 @@\n     QtWindowingSystem& operator=( const QtWindowingSystem& );\n };\n\n-#if OSG_VERSION_GREATER_OR_EQUAL(3, 5, 6)\n+#if OSG_VERSION_GREATER_OR_EQUAL(3, 6, 3)\n REGISTER_WINDOWINGSYSTEMINTERFACE(Qt, QtWindowingSystem)\n #else\n"
  },
  {
    "path": "Formula/osgeo-osm2po.rb",
    "content": "class CurlRefererDownloadStrategy < CurlDownloadStrategy\n  def _fetch\n    domain_url = @url.sub(/([^:]+:\\/\\/[^\\/]+)(.*)/, \"\\\\1\")\n    curl @url, \"-e\", domain_url, \"-C\", downloaded_size, \"-o\", temporary_path\n  end\nend\n\nclass OsgeoOsm2po < Formula\n  desc \"Openstreetmap converter and routing engine for java\"\n  homepage \"https://osm2po.de\"\n  url \"https://osm2po.de/releases/osm2po-5.2.127.zip\"\n  sha256 \"607fc4c2007c713dd867fd51cc8b8f403aa8d6048f8eb7e15124d9786f39d165\"\n\n  revision 1\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any_skip_relocation\n    rebuild 1\n    sha256 \"b5721c5081b85ec5f045c631102c4e990818c42f50f56934712fa36f070d1546\" => :mojave\n    sha256 \"b5721c5081b85ec5f045c631102c4e990818c42f50f56934712fa36f070d1546\" => :high_sierra\n    sha256 \"b5721c5081b85ec5f045c631102c4e990818c42f50f56934712fa36f070d1546\" => :sierra\n  end\n\n  def install\n    doc.install Dir[\"osm2po-doc/*\"]\n    rm \"demo.bat\"\n    libexec.install Dir[\"*\"]\n    bin.write_jar_script libexec/\"osm2po-core-#{version.to_s}-signed.jar\", \"osm2po\"\n    (libexec/\"demo.sh\").chmod 0755\n  end\n\n  def caveats; <<~EOS\n      The generated executable:\n        osm2po <my-params>\n      executes:\n        exec java -jar <path-to-osm2po.jar> <my-params>\n    EOS\n  end\n\n  test do\n    system \"#{bin}/osm2po\", \"--help\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-ossim.rb",
    "content": "class OsgeoOssim < Formula\n  desc \"Geospatial libs and apps to process imagery, terrain, and vector data\"\n  homepage \"https://trac.osgeo.org/ossim/\"\n  url \"https://github.com/ossimlabs/ossim/archive/OrchidIsland-2.11.1.tar.gz\"\n  sha256 \"2823d132c8da3cb57c030f72ab4c0fbf493eccac6b34c1ec7192741312a839eb\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"2f9e74bcc0f1cc41b39279d707c168a028f8bdaeff5d4c53091d420f6a70251b\" => :catalina\n    sha256 \"2f9e74bcc0f1cc41b39279d707c168a028f8bdaeff5d4c53091d420f6a70251b\" => :mojave\n    sha256 \"2f9e74bcc0f1cc41b39279d707c168a028f8bdaeff5d4c53091d420f6a70251b\" => :high_sierra\n  end\n\n  revision 1\n\n  head \"https://github.com/ossimlabs/ossim.git\", :branch => \"master\"\n\n  option \"with-curl-apps\", \"Build curl-dependent apps\"\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"jpeg\"\n  depends_on \"jsoncpp\"\n  depends_on \"libtiff\"\n  depends_on \"geos\"\n  depends_on \"freetype\"\n  depends_on \"zlib\"\n  depends_on \"libpng\"\n  depends_on \"opencv\"\n  depends_on \"openjpeg\"\n  depends_on \"doxygen\"\n  depends_on \"minizip\"\n  depends_on \"bzip2\"\n  depends_on \"ffmpeg\"\n  depends_on \"podofo\"\n  depends_on \"qt\"\n  depends_on \"jsoncpp\"\n  depends_on \"potrace\"\n  depends_on \"sqlite\"\n  depends_on \"fftw\"\n  depends_on \"expat\"\n  depends_on \"curl\"\n  depends_on \"jpeg-turbo\"\n  depends_on \"osgeo-proj\"\n  depends_on \"osgeo-libgeotiff\"\n  depends_on \"osgeo-laszip@2\"\n  depends_on \"osgeo-liblas\"\n  depends_on \"osgeo-pdal\"\n  depends_on \"osgeo-gdal\"\n  depends_on \"osgeo-libkml\"\n  depends_on \"osgeo-openscenegraph\" # just for its OpenThreads lib # openthreads\n\n  depends_on \"cppunit\"\n  depends_on \"regex-opt\"\n\n  # depends_on \"subversion\"\n  # depends_on \"git\"\n\n  depends_on \"hdf5\" => :optional\n  depends_on \"open-mpi\" => :optional\n\n  # GPSTk\n  # Geotrans\n  # MrSid\n\n  depends_on \"openjdk\" => :optional # => [\"1.8\", :build]\n\n  if build.with? \"pg10\"\n    depends_on \"osgeo-postgresql@10\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  def install\n    ENV.cxx11\n\n    ENV[\"OSSIM_DEV_HOME\"] = buildpath.to_s\n    ENV[\"OSSIM_BUILD_DIR\"] = (buildpath/\"build\").to_s\n    ENV[\"OSSIM_INSTALL_PREFIX\"] = prefix.to_s\n\n    # TODO: add options and deps for plugins\n    args = std_cmake_args + %W[\n      -DOSSIM_DEV_HOME=#{ENV[\"OSSIM_DEV_HOME\"]}\n      -DINSTALL_LIBRARY_DIR=#{lib}\n      -DINSTALL_ARCHIVE_DIR:PATH=#{lib}\n      -DFREETYPE_INCLUDE_DIR_ft2build=#{Formula[\"freetype\"].opt_include}\n      -DBUILD_OSSIM_TESTS=ON\n      -DBUILD_OSSIM_FREETYPE_SUPPORT=ON\n      -DBUILD_OSSIM_ID_SUPPORT=ON\n      -DBUILD_SHARED_LIBS=ON\n      -DBUILD_OSSIM_APPS=ON\n      -DBUILD_OMS=ON\n      -DBUILD_OSSIM_VIDEO=ON\n      -DBUILD_OSSIM_WMS=ON\n      -DBUILD_OSSIM_PLANET=ON\n    ]\n\n    # not used by the project\n    # args += %W[\n    #   -DBUILD_CNES_PLUGIN=OFF\n    #   -DBUILD_GDAL_PLUGIN=ON\n    #   -DBUILD_GEOPDF_PLUGIN=ON\n    #   -DBUILD_KAKADU_PLUGIN=OFF\n    #   -DBUILD_KML_PLUGIN=ON\n    #   -DBUILD_MRSID_PLUGIN=OFF\n    #   -DBUILD_OPENCV_PLUGIN=ON\n    #   -DBUILD_OPENJPEG_PLUGIN=ON\n    #   -DBUILD_PDAL_PLUGIN=ON\n    #   -DBUILD_PNG_PLUGIN=ON\n    #   -DBUILD_POTRACE_PLUGIN=ON\n    #   -DBUILD_SQLITE_PLUGIN=ON\n    #   -DBUILD_WEB_PLUGIN=ON\n    #   -DMRSID_DIR=\n    #   -DOSSIM_BUILD_ADDITIONAL_DIRECTORIES=\n    #   -DOSSIM_PLUGIN_LINK_TYPE=SHARED\n    # ]\n\n    # error: no member named 'printError' in 'H5::Exception'\n    args << \"-DBUILD_OSSIM_HDF5_SUPPORT=\" + (build.with?(\"hdf5\") ? \"ON\" : \"OFF\")\n\n    # generate library instead of framework\n    args << \"-DBUILD_OSSIM_FRAMEWORKS=ON\"\n\n    # build new ossimGui library and geocell application\n    args << \"-DBUILD_OSSIM_GUI=ON\"\n\n    args << \"-DBUILD_OSSIM_MPI_SUPPORT=\" + (build.with?(\"mpi\") ? \"ON\" : \"OFF\")\n    args << \"-DBUILD_OSSIM_CURL_APPS=\" + (build.with?(\"curl-apps\") ? \"ON\" : \"OFF\")\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    # inreplace \"#{buildpath}/share/ossim/templates/ossim_preferences_template\" do |s|\n    #   s.sub! \"epsg_database_file1: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_epsg_projections-v7_4.csv\",\n    #          \"epsg_database_file1: $(OSSIM_DATA)/projection/ossim_epsg_projections-v7_4.csv\"\n    #   s.sub! \"epsg_database_file2: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_harn_state_plane_epsg.csv\",\n    #          \"epsg_database_file2: $(OSSIM_DATA)/projection/ossim_harn_state_plane_epsg.csv\"\n    #   s.sub! \"epsg_database_file3: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_state_plane_spcs.csv\",\n    #          \"epsg_database_file3: $(OSSIM_DATA)/projection/ossim_state_plane_spcs.csv\"\n    #   s.sub! \"epsg_database_file4: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_harn_state_plane_esri.csv\",\n    #          \"epsg_database_file4: $(OSSIM_DATA)/projection/ossim_harn_state_plane_esri.csv\"\n    #   s.sub! \"wkt_database_file: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_wkt_pcs.csv\",\n    #          \"wkt_database_file: $(OSSIM_DATA)/projection/ossim_wkt_pcs.csv\"\n    #   s.sub! \"geoid_ngs_directory: $(OSSIM_DATA)/ear1/geoid/geoid99\",\n    #          \"geoid_ngs_directory: $(OSSIM_DATA)/geoids/geoid99\"\n    #   s.sub! \"geoid_egm_96_grid: $(OSSIM_DATA)/ele1/geoid/geoid96/egm96.grd\",\n    #          \"geoid_egm_96_grid: $(OSSIM_DATA)/geoids/geoid1996/egm96.grd\"\n    # end\n\n    cp_r \"#{buildpath}/share/ossim/templates\", \"#{share}/ossim/\"\n    cp_r \"#{buildpath}/share/ossim/geoids\", \"#{share}/ossim/\"\n  end\n\n  test do\n    system bin/\"ossim-cli\", \"--version\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-pcl.rb",
    "content": "class OsgeoPcl < Formula\n  desc \"Library for 2D/3D image and point cloud processing\"\n  homepage \"http://www.pointclouds.org/\"\n  url \"https://github.com/PointCloudLibrary/pcl/archive/pcl-1.11.0.tar.gz\"\n  sha256 \"4255c3d3572e9774b5a1dccc235711b7a723197b79430ef539c2044e9ce65954\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"1c805512e41ce1c2b3414dba02c5bb8531b16caaa0ef97301d93a0f7fb4fac5b\" => :catalina\n    sha256 \"1c805512e41ce1c2b3414dba02c5bb8531b16caaa0ef97301d93a0f7fb4fac5b\" => :mojave\n    sha256 \"1c805512e41ce1c2b3414dba02c5bb8531b16caaa0ef97301d93a0f7fb4fac5b\" => :high_sierra\n  end\n\n  #revision 3\n\n  head \"https://github.com/PointCloudLibrary/pcl.git\", :branch => \"master\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"boost\"\n  depends_on \"cminpack\"\n  depends_on \"eigen\"\n  depends_on \"flann\"\n  depends_on \"glew\" # and glu\n  depends_on \"libusb\"\n  depends_on \"qhull\"\n  depends_on \"qt\"\n  depends_on \"open-mpi\"\n  depends_on \"libharu\"\n  depends_on \"hdf5\"\n  depends_on \"gl2ps\"\n  depends_on \"python\"\n  depends_on \"sphinx\"\n  depends_on \"zlib\"\n  depends_on \"libpng\"\n  depends_on \"libpcap\"\n  depends_on \"doxygen\"\n  depends_on \"szip\"\n  depends_on \"libxml2\"\n  depends_on \"osgeo-proj\"\n  depends_on \"osgeo-netcdf\"\n  depends_on \"osgeo-vtk\"\n  depends_on \"osgeo-qt-webkit\"\n\n  depends_on \"openjdk\" => :build\n\n  # openni2\n  # cuda\n  # FZAPI, Fotonic and ENSENSO\n  # David Vision Systems SDK\n  # DepthSense SDK\n  # RealSense SDK\n  # Mudule: metslib\n\n  # apps - not building:\n  # 3d_rec_framework: OpenNI\n  # in_hand_scanner: OpenNI\n  # cloud_composer: Qt4\n  # modeler: Qt4\n  # optronic_viewer: Qt\n  # point_cloud_editor: Qt4\n\n  def install\n    args = std_cmake_args + %w[\n      -DBUILD_SHARED_LIBS:BOOL=ON\n      -DBUILD_apps=AUTO_OFF\n      -DBUILD_apps_3d_rec_framework=AUTO_OFF\n      -DBUILD_apps_cloud_composer=AUTO_OFF\n      -DBUILD_apps_in_hand_scanner=AUTO_OFF\n      -DBUILD_apps_optronic_viewer=AUTO_OFF\n      -DBUILD_apps_point_cloud_editor=AUTO_OFF\n      -DBUILD_examples:BOOL=OFF\n      -DBUILD_global_tests:BOOL=OFF\n      -DBUILD_outofcore:BOOL=AUTO_OFF\n      -DBUILD_people:BOOL=AUTO_OFF\n      -DBUILD_simulation:BOOL=AUTO_OFF\n      -DWITH_CUDA:BOOL=OFF\n      -DWITH_DOCS:BOOL=OFF\n      -DWITH_QT:BOOL=FALSE\n      -DWITH_TUTORIALS:BOOL=OFF\n    ]\n\n    # -DCUDA_HOST_COMPILER=/usr/local/bin/gcc\n\n    if build.head?\n      args << \"-DBUILD_apps_modeler=AUTO_OFF\"\n    else\n      args << \"-DBUILD_apps_modeler:BOOL=OFF\"\n    end\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\", \"install\"\n      prefix.install Dir[\"#{bin}/*.app\"]\n    end\n  end\n\n  test do\n    assert_match \"tiff files\", shell_output(\"#{bin}/pcl_tiff2pcd -h\", 255)\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-pdal.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_pdal_linked }\n\n  def core_pdal_linked\n    Formula[\"pdal\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink pdal\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies pdal\\e[0m\\n\\n\" if core_pdal_linked\n    s\n  end\nend\n\nclass OsgeoPdal < Formula\n  include Language::Python::Virtualenv\n  desc \"Point data abstraction library\"\n  homepage \"https://www.pdal.io/\"\n  url \"https://github.com/PDAL/PDAL/archive/2.1.0.tar.gz\"\n  sha256 \"43ed8ba8ef143e1ded67e96ef72bb73ee133723da0320c3e4f2f87d9bfc3737c\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"184ccc09667aec537a79e1541bc400a5ecfe8238fbfe46c9a0117ffb2a2cd9e9\" => :catalina\n    sha256 \"184ccc09667aec537a79e1541bc400a5ecfe8238fbfe46c9a0117ffb2a2cd9e9\" => :mojave\n    sha256 \"184ccc09667aec537a79e1541bc400a5ecfe8238fbfe46c9a0117ffb2a2cd9e9\" => :high_sierra\n  end\n\n  #revision 1\n\n  head \"https://github.com/PDAL/PDAL.git\", :branch => \"master\"\n\n  option \"with-pg11\", \"Build with PostgreSQL 11 client\"\n\n  # keg_only \"pdal is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"cmake\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"python\"\n  depends_on \"numpy\"\n  depends_on \"hdf5\"\n  depends_on \"jsoncpp\"\n  depends_on \"sqlite\"\n  depends_on \"laszip\" # >= 3.1\n  depends_on \"geos\"\n  depends_on \"zlib\"\n  depends_on \"libxml2\"\n  depends_on \"curl\"\n  depends_on \"boost\"\n  depends_on \"qt\"\n  depends_on \"eigen\"\n  depends_on \"flann\"\n  depends_on \"libusb\"\n  depends_on \"qhull\"\n  depends_on \"glew\"\n  depends_on \"osgeo-libgeotiff\"\n  depends_on \"osgeo-gdal\"\n  depends_on \"osgeo-laz-perf\"\n  depends_on \"osgeo-vtk\"\n  depends_on \"osgeo-pcl\"\n  depends_on \"osgeo-hexer\"\n\n  if build.with?(\"pg11\")\n    depends_on \"osgeo-postgresql@11\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  # -- The following features have been disabled:\n  #  * Bash completion, completion for PDAL command line\n  #  * CPD plugin, Coherent Point Drift (CPD) computes rigid or nonrigid transformations between point sets\n  #  * Delaunay plugin, perform Delaunay triangulation of point cloud\n  #  * GeoWave plugin, Read and Write data using GeoWave\n  #  * I3S plugin, Read from a I3S server or from a SLPK file\n  #  * Matlab plugin, write data to a .mat file\n  #  * MrSID plugin, read data in the MrSID format\n  #  * NITF plugin, read/write LAS data wrapped in NITF\n  #  * OpenSceneGraph plugin, read/write OpenSceneGraph objects\n  #  * Oracle OCI plugin, Read/write point clould patches to Oracle\n  #  * RiVLib plugin, read data in the RXP format\n  #  * rdblib plugin, read data in the RDB format\n  #  * MBIO plugin, add features that depend on MBIO\n  #  * FBX plugin, add features that depend on FBX\n\n  def install\n    ENV.cxx11\n\n    args = std_cmake_args\n\n    args += %W[\n      -DBUILD_PLUGIN_GREYHOUND=ON\n      -DBUILD_PLUGIN_ICEBRIDGE=ON\n      -DBUILD_PLUGIN_PCL=ON\n      -DBUILD_PLUGIN_PGPOINTCLOUD=ON\n      -DBUILD_PLUGIN_PYTHON=ON\n      -DBUILD_PLUGIN_SQLITE=ON\n      -DWITH_LASZIP=TRUE\n      -DWITH_LAZPERF=TRUE\"\n    ]\n\n    # args << \"-DBUILD_PLUGIN_HEXBIN=ON\" # not used by the project\n\n    args << \"-DLASZIP_LIBRARIES=#{Formula[\"laszip\"].opt_lib}/liblaszip.dylib\"\n    args << \"-DLASZIP_INCLUDE_DIR=#{Formula[\"laszip\"].opt_include}\"\n\n    args << \"-DPYTHON_EXECUTABLE=#{Formula[\"python\"].opt_bin}/python#{py_ver}\"\n    args << \"-DPYTHON_INCLUDE_DIR=#{Formula[\"python\"].opt_frameworks}/Python.framework/Versions/#{py_ver}/Headers\"\n    args << \"-DPYTHON_LIBRARY=#{Formula[\"python\"].opt_frameworks}/Python.framework/Versions/#{py_ver}/lib/libpython#{py_ver}.dylib\"\n\n    if build.with?(\"pg10\")\n      args << \"-DPG_CONFIG=#{Formula[\"osgeo-postgresql@11\"].opt_bin}/pg_config\"\n      args << \"-DPOSTGRESQL_INCLUDE_DIR=#{Formula[\"osgeo-postgresql@11\"].opt_include}\"\n      args << \"-DPOSTGRESQL_LIBRARIES=#{Formula[\"osgeo-postgresql@11\"].opt_lib}/libpq.dylib\"\n    else\n      args << \"-DPG_CONFIG=#{Formula[\"osgeo-postgresql\"].opt_bin}/pg_config\"\n      args << \"-DPOSTGRESQL_INCLUDE_DIR=#{Formula[\"osgeo-postgresql\"].opt_include}\"\n      args << \"-DPOSTGRESQL_LIBRARIES=#{Formula[\"osgeo-postgresql\"].opt_lib}/libpq.dylib\"\n    end\n\n    system \"cmake\", \".\", *args\n    system \"make\", \"install\"\n    doc.install \"examples\", \"test\"\n  end\n\n  test do\n    system bin/\"pdal\", \"info\", doc/\"test/data/las/interesting.las\"\n  end\n\n  private\n\n  def py_ver\n    `#{Formula[\"python\"].opt_bin}/python3 -c 'import sys;print(\"{0}.{1}\".format(sys.version_info[0],sys.version_info[1]))'`.strip\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-pdfium.rb",
    "content": "class OsgeoPdfium < Formula\n  desc \"Google-contributed PDF library (without V8 JavaScript engine)\"\n  homepage \"https://pdfium.googlesource.com/pdfium/\"\n  url \"https://github.com/rouault/pdfium.git\",\n      :branch => \"master\",\n      :revision => \"b5009c4df5aa4ff923ede1c5deba1aa4be43199b\"\n  version \"0.0.1\"\n\n  revision 1\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any_skip_relocation\n    rebuild 1\n    sha256 \"c99e8ad04cda183ba17c53c5dee0c7bfc26ad36ab0ffb24ecbcea5b93f8e2686\" => :catalina\n    sha256 \"c99e8ad04cda183ba17c53c5dee0c7bfc26ad36ab0ffb24ecbcea5b93f8e2686\" => :mojave\n    sha256 \"c99e8ad04cda183ba17c53c5dee0c7bfc26ad36ab0ffb24ecbcea5b93f8e2686\" => :high_sierra\n  end\n\n  keg_only \"newer version of pdfium may be installed\"\n\n  depends_on \"python\" => :build # gyp doesn't run under 2.6 or lower\n  depends_on :xcode => :build\n\n  resource \"depot_tools\" do\n    url \"https://chromium.googlesource.com/chromium/tools/depot_tools.git\"\n  end\n\n  resource \"gyp\" do\n    url \"https://chromium.googlesource.com/external/gyp.git\"\n  end\n\n  def install\n    #ENV.libstdcxx\n\n    link_misc = \"-arch x86_64 -mmacosx-version-min=10.9 -isysroot #{MacOS::Xcode.prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX#{MacOS.version}.sdk -lstdc++\"\n\n    ENV.append \"LDFLAGS\", \"#{link_misc} -stdlib=libc++\"\n    ENV.append \"CPATH\", \"#{MacOS::Xcode.prefix}/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1\"\n\n    # need to move git checkout into gclient solutions directory\n    base_install = Dir[\".*\", \"*\"] - [\".\", \"..\", \".brew_home\"]\n    (buildpath/\"pdfium/\").mkpath\n    base_install.each { |f| mv f, buildpath/\"pdfium/\" }\n\n    # install chromium's build tools, includes ninja and gyp\n    (buildpath/\"pdfium_deps/depot_tools\").install resource(\"depot_tools\")\n    ENV.prepend_path \"PATH\", buildpath/\"pdfium_deps/depot_tools\"\n\n    ENV[\"GYP_DEFINES\"] = \"#{ENV.cc} mac_deployment_target=#{MacOS.version}\"\n    (buildpath/\"pdfium_deps/gyp\").install resource(\"gyp\")\n    ENV.prepend_path \"PATH\", buildpath/\"pdfium_deps/gyp\"\n    ENV.prepend_create_path \"PYTHONPATH\", buildpath/\"pdfium_deps/gyp/pylib\"\n\n    # raise\n\n    cd \"pdfium\" do\n      build_dir = \"#{buildpath}/pdfium/build\"\n\n      system \"./build/gyp_pdfium\"\n\n      xcodebuild \"SDKROOT=#{MacOS.sdk_path}\",\n                 \"MACOSX_DEPLOYMENT_TARGET=10.9\",\n                 \"SYMROOT=#{build_dir}\",\n                 \"ONLY_ACTIVE_ARCH=YES\",\n                 \"-configuration\", \"Release\",\n                 \"-target\", \"pdfium\",\n                 \"-target\", \"fdrm\",\n                 \"-target\", \"fpdfdoc\",\n                 \"-target\", \"fpdfapi\",\n                 \"-target\", \"fpdftext\",\n                 \"-target\", \"fxcodec\",\n                 \"-target\", \"fxcrt\",\n                 \"-target\", \"fxge\",\n                 \"-target\", \"fxedit\",\n                 \"-target\", \"pdfwindow\",\n                 \"-target\", \"formfiller\"\n\n      cd \"third_party\" do\n        xcodebuild \"SDKROOT=#{MacOS.sdk_path}\",\n                   \"MACOSX_DEPLOYMENT_TARGET=10.9\",\n                   \"SYMROOT=#{build_dir}\",\n                   \"ONLY_ACTIVE_ARCH=YES\",\n                   \"-configuration\", \"Release\",\n                   \"-target\", \"bigint\",\n                   \"-target\", \"freetype\",\n                   \"-target\", \"fx_agg\",\n                   \"-target\", \"fx_lcms2\",\n                   \"-target\", \"fx_zlib\",\n                   \"-target\", \"pdfium_base\",\n                   \"-target\", \"fx_libjpeg\",\n                   \"-target\", \"fx_libopenjpeg\"\n      end\n\n      cd \"samples\" do\n        inreplace \"pdfium_test.cc\", /(delete platform;)/, \"//\\\\1\"\n        xcodebuild \"SDKROOT=#{MacOS.sdk_path}\",\n                   \"MACOSX_DEPLOYMENT_TARGET=10.9\",\n                   \"SYMROOT=#{build_dir}\",\n                   \"ONLY_ACTIVE_ARCH=YES\",\n                   \"-configuration\", \"Release\",\n                   \"-target\", \"pdfium_test\",\n                   \"-target\", \"pdfium_diff\"\n      end\n\n      # raise\n\n      # copy header files into a pdfium directory\n      (include/\"pdfium\").install Dir[\"public/**/*.h\"]\n      (include/\"pdfium/core/include\").install Dir[\"core/include/*\"]\n      (include/\"pdfium/fpdfsdk/include\").install Dir[\"fpdfsdk/include/*\"]\n\n      # and 3rd party dependency headers\n      (include/\"pdfium/third_party/base/numerics\").install Dir[\"third_party/base/numerics/*.h\"]\n      (include/\"pdfium/third_party/base\").install Dir[\"third_party/base/*.h\"]\n\n      # test data\n      (libexec/\"testing/resources\").install Dir[\"testing/resources/*\"]\n\n      # fix public/*.h not found\n      cd \"#{include}/pdfium\" do\n        mkdir \"public\"\n        mv \"fpdf_progressive.h\", \"./public/fpdf_progressive.h\"\n        mv \"fpdfview.h\", \"./public/fpdfview.h\"\n\n        ln_s \"./public/fpdf_progressive.h\", \"./fpdf_progressive.h\"\n        ln_s \"./public/fpdfview.h\", \"./fpdfview.h\"\n      end\n\n      cd \"build/Release\" do\n        (lib/\"pdfium\").install Dir[\"lib*.a\"]\n        (libexec/\"bin\").install \"pdfium_test\", \"pdfium_diff\"\n      end\n    end\n  end\n\n  def caveats; <<~EOS\n    For building other software, static libs are located in\n      #{opt_lib}/pdfium\n\n    and includes in\n      #{opt_include}/pdfium\n  EOS\n  end\n\n  test do\n    out = shell_output(\"#{libexec}/bin/pdfium_test 2>&1\", 1)\n    assert_match \"No input files\", out\n\n    out = shell_output(\"#{libexec}/bin/pdfium_diff 2>&1\", 2)\n    assert_match \"Compares two files on disk\", out\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-pgadmin3-lts.rb",
    "content": "class OsgeoPgadmin3Lts < Formula\n  # include Language::Python::Virtualenv\n  desc \"Comprehensive design and management interface for PostgreSQL (LTS)\"\n  homepage \"https://www.pgadmin.org\"\n  url \"https://github.com/pgcentral/pgadmin3-lts/archive/7f3915ce4ccd5da7758ef6d2993cc8480e4aad3b.tar.gz\"\n  sha256 \"65de9fb0d2bc43bfa0931832c344cfb894ae862acefefc64fbc8cd7d0f6cb7ff\"\n  version \"1.22.3\"\n\n  revision 2\n\n  head \"https://github.com/pgcentral/pgadmin3-lts.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    rebuild 1\n    sha256 \"52a1ede0df8e5cadd152cb3066b7948d8a40a8ede53b9175b4c0e55f8445daaa\" => :mojave\n    sha256 \"52a1ede0df8e5cadd152cb3066b7948d8a40a8ede53b9175b4c0e55f8445daaa\" => :high_sierra\n    sha256 \"581f3d4725d6f45892ed4fb168340da23cf0b0078bb35ff9c14051174e96a1c8\" => :sierra\n  end\n\n  patch :DATA\n\n  option \"with-app\", \"Build pgAdmin.app Package\"\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"libtool\" => :build\n  depends_on \"wxmac\"\n  depends_on \"libxslt\"\n  depends_on \"libxml2\"\n  depends_on \"libgcrypt\"\n  depends_on \"openssl\"\n  depends_on \"libssh2\"\n  depends_on \"zlib\"\n  depends_on \"osgeo-libpqxx\"\n  depends_on \"imagemagick\"\n  depends_on \"krb5\"\n  # depends_on \"python@2\" # for Sphinx\n\n  if build.with?(\"pg10\")\n    depends_on \"osgeo-postgresql@10\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  # resource \"Sphinx\" do\n  #   url \"https://files.pythonhosted.org/packages/2a/86/8e1e8400bb6eca5ed960917952600fce90599e1cb0d20ddedd81ba163370/Sphinx-1.8.5.tar.gz\"\n  #   sha256 \"c7658aab75c920288a8cf6f09f244c6cfdae30d82d803ac1634d9f223a80ca08\"\n  # end\n\n  if build.with?(\"pg10\")\n    # PG 10 support, adapted from:\n    # https://bitbucket.org/openscg/pgadmin3-lts/commits/ea8a31af779b101248fc13242cb7a34e252cf49e/raw\n    # https://bitbucket.org/openscg/pgadmin3-lts/commits/1d65e012f7bb88d3b6c5a08946a2456617213c35/raw\n    resource \"pg10\" do\n      url \"https://gist.githubusercontent.com/fjperini/204ec325671a30e9ddb46d77ea8e1289/raw/f383173056b93731d3e2e8a90614373948274ca6/pgadmin3-pg10.diff\"\n      sha256 \"74e127952d9674f4c09bbf8805f43f6a85821133fd9a84db094e8aab837c7d03\"\n    end\n  else\n    # PG 11 support, adapted from:\n    # https://abdulyadi.wordpress.com/2018/11/03/pgadmin3-adjustment-for-postgresql-11-0/\n    resource \"pg11\" do\n      url \"https://gist.githubusercontent.com/fjperini/9b22ecd9bda767e51a446749472f8e94/raw/7bed1afe383d915c408c3cc735a25b192b3e0108/pgadmin3-pg11.diff\"\n      sha256 \"7dc526b80eb61540e9bf6d46a329f45eac683646caaa68dec90f9743723dd7d3\"\n    end\n  end\n\n  # 1.14.2-cflags\n  # resource \"cflags\" do\n  #   url \"https://gist.githubusercontent.com/fjperini/5e9c519e88dd1aebd975edb89f2bd680/raw/03679e513f0ca67d5283d2560b0338d15730c0aa/pgadmin3-1.14.2-cflags.diff\"\n  #   sha256 \"1ab6db05896684cac42b4a29a422a3cd29d12b98f8f7d092c7f7647ea0fffc76\"\n  # end\n\n  # Move this == null check to a static function.  This works, but I opted\n  # for the compiler flag since it \"fixes\" all cases, and pgadmin4 is on the\n  # way.\n  resource \"nullthis\" do\n    url \"https://gist.githubusercontent.com/fjperini/d5b129bad455a6d945ff80d17b91887a/raw/96531fd54ee7a67b7fd42eac97fedf6c8c27bb07/pgadmin3-nullthis.diff\"\n    sha256 \"3b785ee8a2857f02b7d1983a3b8d699032494438096f3321576a8267c823b0c8\"\n  end\n\n  # Fix failure to use EVP_CIPHER_CTX_new()\n  # resource \"ssh2\" do\n  #   url \"https://gist.githubusercontent.com/fjperini/2bc12464cc37c0c324cc2a6a61a1f3af/raw/b28e587dc265f0094f0ed23d7ff210bb24f77128/pgadmin3-ssh2.diff\"\n  #   sha256 \"71a7b90989ab35793b4435d6bc1ad54581f47649a5265021622fddb61ee83054\"\n  # end\n\n  def install\n    # venv = virtualenv_create(libexec, \"#{Formula[\"python@2\"].opt_bin}/python2\")\n    # res = resources.map(&:name).to_set - %w[pg11]\n    # res.each do |r|\n    #   venv.pip_install resource(r)\n    # end\n\n    if build.with?(\"pg10\")\n      resource(\"pg10\").stage do\n        cp_r \"./pgadmin3-pg10.diff\", \"#{buildpath}\"\n      end\n      system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/pgadmin3-pg10.diff\"\n    else\n      resource(\"pg11\").stage do\n        cp_r \"./pgadmin3-pg11.diff\", \"#{buildpath}\"\n      end\n      system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/pgadmin3-pg11.diff\"\n    end\n\n    # resource(\"cflags\").stage do\n    #   cp_r \"./pgadmin3-1.14.2-cflags.diff\", \"#{buildpath}\"\n    # end\n    # system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/pgadmin3-1.14.2-cflags.diff\"\n\n    resource(\"nullthis\").stage do\n      cp_r \"./pgadmin3-nullthis.diff\", \"#{buildpath}\"\n    end\n    # system \"patch\", \"-p0\", \"-b\", \".nullthis\"\n    system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/pgadmin3-nullthis.diff\"\n\n    # use the libssh2 embedded with pgadmin3\n    # global use_embedded 1\n    # remove embedded libssh2\n    # system \"rm\", \"-rf\", \"#{buildpath}/pgadmin/libssh2\", \"#{buildpath}/pgadmin/include/libssh2\"\n    # resource(\"ssh2\").stage do\n    #   cp_r \"./pgadmin3-ssh2.diff\", \"#{buildpath}\"\n    # end\n    # # system \"patch\", \"-p0\", \"-b\", \".ssh2f\"\n    # system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/pgadmin3-ssh2.diff\"\n\n    args = [\n      \"--with-wx=#{Formula[\"wxmac\"].opt_prefix}\", # #{HOMEBREW_PREFIX}\n      \"--with-wx-version=3.0\", # #{Formula[\"wxmac\"].version}\n      \"--with-libxml2=#{Formula[\"libxml2\"].opt_prefix}\",\n      \"--with-libxslt=#{Formula[\"libxslt\"].opt_prefix}\",\n      \"--prefix=#{prefix}\",\n      \"--with-libgcrypt\",\n    ]\n\n    args << \"--with-arch-x86_64\"\n\n    # building SSH Tunnel\n    args << \"--with-libssl-prefix=#{Formula[\"openssl\"].opt_prefix}\" # or --with-libgcrypt-prefix=PATH\n\n    # build docs\n    # args << \"--with-sphinx-build=#{libexec}/bin/sphinx-build\"\n\n    # statically linking pgAdmin\n    # wxWidgets installation cannot support pgAdmin in the selected configuration\n    # args << \"--enable-static\"\n\n    # building database designer\n    args << \"--enable-databasedesigner\"\n\n    # building a Mac OS X appbundle\n    # pgAdmin3.rsrc: No such file or directory\n    # args << \"--enable-appbundle\"\n\n    ENV.append \"CXXFLAGS\", \"-fno-delete-null-pointer-checks -Wno-unused-local-typedefs\"\n\n    if build.with?(\"pg10\")\n      args << \"--with-pgsql=#{Formula[\"osgeo-postgresql@10\"].opt_prefix}\"\n    else\n      args << \"--with-pgsql=#{Formula[\"osgeo-postgresql\"].opt_prefix}\"\n    end\n\n    ENV.append \"CPPFLAGS\", \"-fno-delete-null-pointer-checks\"\n\n    system \"./bootstrap\"\n    # [ -f Makefile ] ||  ./configure --prefix=/usr --with-wx-version=3.0\n    system \"./configure\", \"--disable-debug\", \"--disable-dependency-tracking\", *args\n    system \"make\", \"all\"\n    system \"make\", \"install\"\n\n    if build.with? \"app\"\n      (prefix/\"pgAdmin3.app/Contents/PkgInfo\").write \"APPLPGADMIN3\"\n      mkdir \"#{prefix}/pgAdmin3.app/Contents/Resources\"\n      cp_r \"#{buildpath}/pkg/mac/pgAdmin3.icns\", \"#{prefix}/pgAdmin3.app/Contents/Resources/pgAdmin3.icns\"\n      cp_r \"#{buildpath}/pkg/mac/sql.icns\", \"#{prefix}/pgAdmin3.app/Contents/Resources/sql.icns\"\n\n      config = <<~EOS\n      <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n      <!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n      <plist version=\"1.0\">\n      <dict>\n      \t<key>CFBundleDevelopmentRegion</key>\n      \t<string>English</string>\n      \t<key>CFBundleDocumentTypes</key>\n      \t<array>\n      \t\t<dict>\n      \t\t\t<key>CFBundleTypeExtensions</key>\n      \t\t\t<array>\n      \t\t\t\t<string>sql</string>\n      \t\t\t</array>\n      \t\t\t<key>CFBundleTypeIconFile</key>\n      \t\t\t<string>sql.icns</string>\n      \t\t\t<key>CFBundleTypeName</key>\n      \t\t\t<string>pgAdmin3 SQL Query</string>\n      \t\t\t<key>CFBundleTypeRole</key>\n      \t\t\t<string>Editor</string>\n      \t\t\t<key>LSItemContentTypes</key>\n      \t\t\t<array>\n      \t\t\t\t<string>org.postgresql.pgadmin.sql</string>\n      \t\t\t</array>\n      \t\t</dict>\n      \t</array>\n      \t<key>CFBundleExecutable</key>\n      \t<string>pgadmin3</string>\n      \t<key>CFBundleGetInfoString</key>\n      \t<string>pgAdmin3 #{version}</string>\n      \t<key>CFBundleIconFile</key>\n      \t<string>pgAdmin3.icns</string>\n      \t<key>CFBundleIdentifier</key>\n      \t<string>org.postgresql.pgadmin</string>\n      \t<key>CFBundleInfoDictionaryVersion</key>\n      \t<string>6.0</string>\n      \t<key>CFBundlePackageType</key>\n      \t<string>APPL</string>\n      \t<key>CFBundleShortVersionString</key>\n      \t<string>#{version}</string>\n      \t<key>CFBundleSignature</key>\n      \t<string>????</string>\n      \t<key>CFBundleVersion</key>\n      \t<string>#{version}</string>\n      \t<key>CSResourcesFileMapped</key>\n      \t<true/>\n      \t<key>UTExportedTypeDeclarations</key>\n      \t<array>\n      \t\t<dict>\n      \t\t\t<key>UTTypeConformsTo</key>\n      \t\t\t<array>\n      \t\t\t\t<string>public.utf8-plain-text</string>\n      \t\t\t</array>\n      \t\t\t<key>UTTypeDescription</key>\n      \t\t\t<string>pgAdmin3 SQL Query</string>\n      \t\t\t<key>UTTypeIconFile</key>\n      \t\t\t<string>sql.icns</string>\n      \t\t\t<key>UTTypeIdentifier</key>\n      \t\t\t<string>org.postgresql.pgadmin.sql</string>\n      \t\t\t<key>UTTypeTagSpecification</key>\n      \t\t\t<dict>\n      \t\t\t\t<key>public.filename-extension</key>\n      \t\t\t\t<array>\n      \t\t\t\t\t<string>sql</string>\n      \t\t\t\t</array>\n      \t\t\t</dict>\n      \t\t</dict>\n      \t</array>\n      </dict>\n      </plist>\n      EOS\n\n      (prefix/\"pgAdmin3.app/Contents/Info.plist\").write config\n\n      chdir \"#{prefix}/pgAdmin3.app/Contents\" do\n        mkdir \"MacOS\" do\n          ln_s \"#{bin}/pgadmin3\", \"pgadmin3\"\n        end\n      end\n    end\n  end\n\n  def caveats\n    if build.with? \"app\"\n      <<~EOS\n      pgAdmin.app was installed in:\n        #{prefix}\n\n      You may also symlink pgAdmin3.app into /Applications or ~/Applications:\n        ln -Fs `find $(brew --prefix) -name \"pgAdmin3.app\"` /Applications/pgAdmin3.app\n\n      EOS\n    end\n  end\n\n  test do\n    # TODO\n  end\nend\n\n__END__\n\n--- a/pgadmin/frm/plugins.cpp\n+++ b/pgadmin/frm/plugins.cpp\n@@ -380,7 +380,7 @@ bool pluginUtilityFactory::CheckEnable(p\n \t{\n \t\t// If we need a specific server type, we can't enable unless\n \t\t// we have a connection.\n-\t\tif (!obj || !(obj->GetConnection()->GetStatus() == PGCONN_OK))\n+\t\tif (!obj || !obj->GetConnection() || !(obj->GetConnection()->GetStatus() == PGCONN_OK))\n \t\t\treturn false;\n\n \t\t// Get the server type.\n"
  },
  {
    "path": "Formula/osgeo-pgsql-ogr-fdw.rb",
    "content": "class OsgeoPgsqlOgrFdw < Formula\n  desc \"PostgreSQL foreign data wrapper for OGR\"\n  homepage \"https://github.com/pramsey/pgsql-ogr-fdw\"\n  #url \"https://github.com/pramsey/pgsql-ogr-fdw/archive/v1.0.8.tar.gz\"\n  #sha256 \"4ab0c303006bfd83dcd40af4d53c48e7d8ec7835bb98491bc6640686da788a8b\"\n  url \"https://github.com/pramsey/pgsql-ogr-fdw.git\",\n    :branch => \"master\",\n    :commit => \"6b0f4690e49ef4e0203252b2a87d25a173afc1ad\"\n  version \"1.0.12\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"329908858b691a160db41b1655641a865a831284193732520b462e9318086351\" => :catalina\n    sha256 \"329908858b691a160db41b1655641a865a831284193732520b462e9318086351\" => :mojave\n    sha256 \"329908858b691a160db41b1655641a865a831284193732520b462e9318086351\" => :high_sierra\n  end\n\n  #revision 1\n\n  head \"https://github.com/pramsey/pgsql-ogr-fdw.git\", :branch => \"master\"\n\n  def pour_bottle?\n    # Postgres extensions must live in the Postgres prefix, which precludes\n    # bottling: https://github.com/Homebrew/homebrew/issues/10247\n    # Overcoming this will likely require changes in Postgres itself.\n    false\n  end\n\n  option \"with-pg11\", \"Build with PostgreSQL 11 client\"\n\n  depends_on \"osgeo-postgis\"\n  depends_on \"osgeo-gdal\"\n\n  if build.with?(\"pg11\")\n    depends_on \"osgeo-postgresql@11\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  def install\n    ENV.deparallelize\n\n    ENV.append \"CFLAGS\", \"-Wl,-z,relro,-z,now\"\n\n    # This includes PGXS makefiles and so will install __everything__\n    # into the Postgres keg instead of the this formula's keg.\n    # Right now, no items installed to Postgres keg need to be installed to `prefix`.\n    # In the future, if `make install` installs things that should be in `prefix`\n    # consult postgis formula to see how to split it up.\n\n    rm \"#{buildpath}/Makefile\"\n\n    if build.with?(\"pg11\")\n      postgresql_ver = \"#{Formula[\"osgeo-postgresql@11\"].opt_bin}\"\n    else\n      postgresql_ver = \"#{Formula[\"osgeo-postgresql\"].opt_bin}\"\n    end\n\n    # Fix bin install path\n    # Use CFLAGS from environment\n    config = <<~EOS\n      # ogr_fdw/Makefile\n\n      MODULE_big = ogr_fdw\n      OBJS = ogr_fdw.o ogr_fdw_deparse.o ogr_fdw_common.o stringbuffer_pg.o\n      EXTENSION = ogr_fdw\n      DATA = ogr_fdw--1.0.sql\n\n      REGRESS = ogr_fdw\n\n      EXTRA_CLEAN = sql/*.sql expected/*.out\n\n      GDAL_CONFIG = #{Formula[\"osgeo-gdal\"].opt_bin}/gdal-config\n      GDAL_CFLAGS = $(shell $(GDAL_CONFIG) --cflags)\n      GDAL_LIBS = $(shell $(GDAL_CONFIG) --libs)\n\n      PG_CONFIG = #{postgresql_ver}/pg_config\n      REGRESS_OPTS = --encoding=UTF8\n\n      PG_CPPFLAGS += $(GDAL_CFLAGS)\n      LIBS += $(GDAL_LIBS)\n      SHLIB_LINK := $(LIBS)\n\n      PGXS := $(shell $(PG_CONFIG) --pgxs)\n      include $(PGXS)\n\n      PG_VERSION_NUM = $(shell awk '/PG_VERSION_NUM/ { print $$3 }' $(shell $(PG_CONFIG) --includedir-server)/pg_config.h)\n      HAS_IMPORT_SCHEMA = $(shell [ $(PG_VERSION_NUM) -ge 90500 ] && echo yes)\n\n      # order matters, file first, import last\n      REGRESS = file pgsql\n      ifeq ($(HAS_IMPORT_SCHEMA),yes)\n      REGRESS += import\n      endif\n\n      ###############################################################\n      # Build the utility program after PGXS to override the\n      # PGXS environment\n\n      CFLAGS = $(GDAL_CFLAGS) $(CFLAGS)\n      LIBS = $(GDAL_LIBS)\n\n      ogr_fdw_info$(X): ogr_fdw_info.o ogr_fdw_common.o stringbuffer.o\n      \t$(CC) $(CFLAGS) -o $@ $^ $(LIBS)\n\n      clean-exe:\n      \trm -f ogr_fdw_info$(X) ogr_fdw_info.o stringbuffer.o\n\n      install-exe: all\n      \t# $(INSTALL_PROGRAM) ogr_fdw_info$(X) '$(DESTDIR)$(bindir)'\n        # or $(INSTALL_PROGRAM) -D ogr_fdw_info$(X) '$(DESTDIR)$(bindir)/ogr_fdw_info$(X)'\n\n      all: ogr_fdw_info$(X)\n\n      clean: clean-exe\n\n      install: install-exe\n    EOS\n\n    (buildpath/\"Makefile\").write config\n\n    system \"make\"\n    system \"make\", \"DESTDIR=#{prefix}\", \"install\"\n\n    mv \"#{prefix}/usr/local/lib\", \"#{lib}\"\n    mv \"#{prefix}/usr/local/share\", \"#{share}\"\n    rm_f \"#{prefix}/usr\"\n\n    bin.install \"ogr_fdw_info\"\n    prefix.install \"data\"\n\n  end\n\n  def caveats;\n    <<~EOS\n      For info on using extension, read the included REAMDE.md or visit:\n        https://github.com/pramsey/pgsql-ogr-fdw\n\n      PostGIS plugin libraries installed to:\n        /usr/local/lib/postgresql\n      PostGIS extension modules installed to:\n       /usr/local/share/postgresql/extension\n    EOS\n  end\n\n  test do\n    # test the sql generator for the extension\n    data_sub = \"data\".upcase # or brew audit thinks there is a D A T A section\n    sql_out = <<~EOS\n\n      CREATE SERVER myserver\n        FOREIGN #{data_sub} WRAPPER ogr_fdw\n        OPTIONS (\n        \tdatasource '#{prefix}/data',\n        \tformat 'ESRI Shapefile' );\n\n      CREATE FOREIGN TABLE pt_two (\n        fid bigint,\n        geom Geometry(Point,4326),\n        name varchar(50),\n        age integer,\n        height doubleprecision,\n        birthdate date\n      ) SERVER \"myserver\"\n      OPTIONS (layer 'pt_two');\n\n    EOS\n\n    result = shell_output(\"ogr_fdw_info -s #{prefix}/data -l pt_two\")\n    assert_equal sql_out.gsub(' ',''), result.gsub(' ','')\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-pointcloud.rb",
    "content": "class OsgeoPointcloud < Formula\n  desc \"PostgreSQL extension for storing point cloud (LIDAR) data\"\n  homepage \"https://github.com/pgpointcloud/pointcloud\"\n  url \"https://github.com/pgpointcloud/pointcloud/archive/v1.2.0.tar.gz\"\n  sha256 \"8542a4c714b4d0c67f10d092291a43b5650871b4ec8caf831e492810f25bb93c\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    rebuild 1\n    sha256 \"0441c0f8dafa1e14e132feedecf64d587dd9f676517199a78f7c633d32c05da1\" => :mojave\n    sha256 \"0441c0f8dafa1e14e132feedecf64d587dd9f676517199a78f7c633d32c05da1\" => :high_sierra\n    sha256 \"39acb394587990363e8495770479e91af9f13edf5bcf157905c0762e667c24e3\" => :sierra\n  end\n\n  # url \"https://github.com/pgpointcloud/pointcloud/archive/v1.0.1.tar.gz\"\n  # sha256 \"3fac2efe1263b0876c26fc77e28f3664b56aa1e142c92383f9eb5b828999d0e7\"\n\n  revision 2\n\n  head \"https://github.com/pgpointcloud/pointcloud.git\", :branch => \"master\"\n\n  # for v1.0.1\n  # pc_access.c:318:46: error: AggState v1.0.1\n  # it was decided to use the updated lines from master\n  # https://github.com/pgpointcloud/pointcloud/issues/174\n  # patch :DATA\n\n  # depends_on \"cmake\" => :build # for v1.0.1\n\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"libtool\" => :build\n  depends_on \"libxml2\"\n  depends_on \"osgeo-libght\"\n  depends_on \"osgeo-laz-perf\" # => :optional\n\n  depends_on \"cunit\" # if build.with? \"test\"\n\n  depends_on \"llvm\" => :build\n\n  if build.with?(\"postgresql10\")\n    depends_on \"osgeo-postgresql@10\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  # Fix boolean case errors when compiling againt pg11\n  # https://github.com/pgpointcloud/pointcloud/pull/237\n  patch do\n    url \"https://patch-diff.githubusercontent.com/raw/pgpointcloud/pointcloud/pull/237.diff\"\n    sha256 \"72b542ec7c8ad3a61186e5fb24e6555df3998361ee5f4a75034b61db514f16df\"\n  end\n\n  def install\n    if build.with?(\"postgresql10\")\n      args = \"--with-pgconfig=#{Formula[\"osgeo-postgresql@10\"].opt_bin}/pg_config\"\n    else\n      args = \"--with-pgconfig=#{Formula[\"osgeo-postgresql\"].opt_bin}/pg_config\"\n    end\n\n    mkdir lib/\"postgresql\"\n    mkdir_p pkgshare/\"postgresql/extension/\"\n\n    # for v1.0.1\n    # inreplace \"pgsql/CMakeLists.txt\", \"${PGSQL_PKGLIBDIR}\", \"#{lib}/postgresql\"\n    # inreplace \"pgsql/CMakeLists.txt\", \"${PGSQL_SHAREDIR}\", \"#{share}/postgresql\"\n    # inreplace \"pgsql_postgis/CMakeLists.txt\", \"${PGSQL_SHAREDIR}\", \"#{share}/postgresql\n\n    system \"./autogen.sh\"\n    system \"./configure\", \"--prefix=#{prefix}\", \"--with-lazperf=#{Formula[\"osgeo-laz-perf\"].opt_prefix}\", *args\n    system \"make\"\n    # system \"make\", \"install\"\n    (lib/\"postgresql\").mkpath\n    (share/\"postgresql/extension\").mkpath\n    cp_r \"#{buildpath}/pgsql/pointcloud-1.2.so\", \"#{lib}/postgresql/\"\n    # ln_s \"#{lib}/postgresql/pointcloud-1.2.so\", \"#{lib}/postgresql/pointcloud.so\"\n    cp_r \"#{buildpath}/pgsql/pointcloud--1.2.0.sql\", \"#{share}/postgresql/extension/\"\n    cp_r \"#{buildpath}/pgsql/pointcloud.control\", \"#{share}/postgresql/extension/\"\n    cp_r \"#{buildpath}/pgsql/pointcloud--1.1.0--1.2.0.sql\", \"#{share}/postgresql/extension/\"\n    cp_r \"#{buildpath}/pgsql/pointcloud--1.1.1--1.2.0.sql\", \"#{share}/postgresql/extension/\"\n    cp_r \"#{buildpath}/pgsql/pointcloud--1.2.0--1.2.0next.sql\", \"#{share}/postgresql/extension/\"\n    cp_r \"#{buildpath}/pgsql/pointcloud--1.2.0next--1.2.0.sql\", \"#{share}/postgresql/extension/\"\n    cp_r \"#{buildpath}/pgsql_postgis/pointcloud_postgis--1.2.0.sql\", \"#{share}/postgresql/extension/\"\n    cp_r \"#{buildpath}/pgsql_postgis/pointcloud_postgis.control\", \"#{share}/postgresql/extension/\"\n\n    # nothing is installed here?\n    rm_r \"#{share}/osgeo-pointcloud\"\n\n    # for v1.0.1\n    # mkdir \"build\" do\n    #   system \"cmake\", \"..\", \"-DCMAKE_PREFIX_PATH=#{Formula[\"osgeo-postgresql\"].opt_prefix}\", *std_cmake_args\n    #   system \"make\"\n    #   # system \"/usr/local/bin/bbedit\", \"CMakeCache.txt\"\n    #   # raise\n    #   # TODO: this fails with Segmentation fault: 11\n    #   # puts `lib/cunit/cu_tester` if build.with? \"test\"\n    #   system \"make\", \"install\"\n    # end\n  end\n\n  test do\n    system \"True\"\n  end\nend\n\n__END__\n\n--- a/pgsql/pc_access.c\n+++ b/pgsql/pc_access.c\n@@ -310,18 +310,10 @@\n\n \tif (arg1_typeid == InvalidOid)\n \t\tereport(ERROR,\n-\t\t        (errcode(ERRCODE_INVALID_PARAMETER_VALUE),\n-\t\t         errmsg(\"could not determine input data type\")));\n-\n-\tif (fcinfo->context && IsA(fcinfo->context, AggState))\n-\t{\n-\t\taggcontext = ((AggState *) fcinfo->context)->aggcontext;\n-\t}\n-\telse if (fcinfo->context && IsA(fcinfo->context, WindowAggState))\n-\t{\n-\t\taggcontext = ((WindowAggState *) fcinfo->context)->aggcontext;\n-\t}\n-\telse\n+\t\t\t(errcode(ERRCODE_INVALID_PARAMETER_VALUE),\n+\t\t\terrmsg(\"could not determine input data type\")));\n+\n+\tif ( ! AggCheckCallContext(fcinfo, &aggcontext) )\n \t{\n \t\t/* cannot be called directly because of dummy-type argument */\n \t\telog(ERROR, \"pointcloud_agg_transfn called in non-aggregate context\");\n@@ -551,9 +543,9 @@\n\n \tif ( pc_bounds_intersects(&(serpa1->bounds), &(serpa2->bounds)) )\n \t{\n-\t\tPG_RETURN_BOOL(TRUE);\n-\t}\n-\tPG_RETURN_BOOL(FALSE);\n+\t\tPG_RETURN_BOOL(true);\n+\t}\n+\tPG_RETURN_BOOL(false);\n }\n\n PG_FUNCTION_INFO_V1(pcpatch_size);\n\n--- a/pgsql/pc_inout.c\n+++ b/pgsql/pc_inout.c\n@@ -171,7 +171,7 @@\n\n \tif ( ! err )\n \t{\n-\t\tPG_RETURN_BOOL(FALSE);\n+\t\tPG_RETURN_BOOL(false);\n \t}\n\n \tvalid = pc_schema_is_valid(schema);\n"
  },
  {
    "path": "Formula/osgeo-points2grid.rb",
    "content": "class OsgeoPoints2grid < Formula\n  desc \"Generate digital elevation models using local griding\"\n  homepage \"https://github.com/CRREL/points2grid\"\n  url \"https://github.com/CRREL/points2grid/archive/1.3.1.tar.gz\"\n  sha256 \"6e2f2d3bbfd6f0f5c2d0c7d263cbd5453745a6fbe3113a3a2a630a997f4a1807\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    rebuild 1\n    sha256 \"d9f1dac7dc33dc1112cb2625842fafcdb40d5e2d0f2e62c8afe22270fe9a1ccc\" => :mojave\n    sha256 \"d9f1dac7dc33dc1112cb2625842fafcdb40d5e2d0f2e62c8afe22270fe9a1ccc\" => :high_sierra\n    sha256 \"a6b053bac9a6e10d66752efc33209a3abe739ef4c61c8deccdd40dc49b467cb9\" => :sierra\n  end\n\n  revision 1\n\n  head \"https://github.com/CRREL/points2grid.git\", :branch => \"master\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"boost\"\n  depends_on \"curl\"\n  depends_on \"osgeo-gdal\"\n\n  def install\n    ENV.cxx11\n\n    args = std_cmake_args + %W[-DWITH_GDAL=ON -DWITH_TESTS=ON -DCMAKE_PREFIX_PATH=#{Formula[\"curl\"].opt_prefix}]\n    libexec.install \"test/data/example.las\"\n    system \"cmake\", \".\", *args\n    system \"make\", \"install\"\n  end\n\n  test do\n    system bin/\"points2grid\",\n           \"-i\", libexec/\"example.las\",\n           \"-o\", \"example\",\n           \"--max\", \"--output_format\", \"grid\"\n    assert_equal 13, File.read(\"example.max.grid\").scan(\"423.820000\").size\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-postgis.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !osgeo_postgis_linked && !core_postgis_linked }\n\n  def osgeo_postgis_linked\n    Formula[\"osgeo-postgis@2.4\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_postgis_linked\n    Formula[\"postgis\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink osgeo-postgis@2.4\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies osgeo-postgis@2.4\\e[0m\\n\\n\" if osgeo_postgis_linked\n    s += \"Unlink with \\e[32mbrew unlink postgis\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies postgis\\e[0m\\n\\n\" if core_postgis_linked\n    s\n  end\nend\n\nclass OsgeoPostgis < Formula\n  desc \"Adds support for geographic objects to PostgreSQL\"\n  homepage \"https://postgis.net/\"\n  url \"https://github.com/postgis/postgis/archive/3.0.2.tar.gz\"\n  sha256 \"2d4eb79ea9af1257320922a8a7d2663d37189c805746e975a5951ee6dc5ac4ef\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"1e7bd52b66279e1510b7cc700cb9f7e83b06f2b0f7a7348d99f140bb629e792b\" => :catalina\n    sha256 \"1e7bd52b66279e1510b7cc700cb9f7e83b06f2b0f7a7348d99f140bb629e792b\" => :mojave\n    sha256 \"1e7bd52b66279e1510b7cc700cb9f7e83b06f2b0f7a7348d99f140bb629e792b\" => :high_sierra\n  end\n\n  #revision 8 \n\n  head \"https://github.com/postgis/postgis.git\", :branch => \"master\"\n\n  option \"with-html-docs\", \"Generate multi-file HTML documentation\"\n  option \"with-api-docs\", \"Generate developer API documentation (long process)\"\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n  option \"with-pg11\", \"Build with PostgreSQL 11 client\"\n\n  # keg_only \"postgis is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"libtool\" => :build\n  depends_on \"gpp\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"geos\"\n  depends_on \"json-c\" # for GeoJSON and raster handling\n  depends_on \"libiconv\"\n  depends_on \"libxml2\"\n  depends_on \"libxslt\"\n  depends_on \"pcre\"\n  depends_on \"osgeo-proj\"\n  depends_on \"sfcgal\" # for advanced 2D/3D functions\n  depends_on \"protobuf-c\" #  Geobuf and Mapbox Vector Tile support\n  depends_on \"osgeo-gdal\" # for GeoJSON and raster handling\n\n  # The latest supported version of PostgreSQL by PostGIS 3.0 is 12,\n  # and thus it's the standard version.\n  # https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS\n  if build.with?(\"pg10\")\n    depends_on \"osgeo-postgresql@10\"\n  elsif build.with?(\"pg11\")\n    depends_on \"osgeo-postgresql@11\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  depends_on \"gtk+\" # for gui\n\n  if build.with? \"html-docs\"\n    depends_on \"imagemagick\"\n    depends_on \"docbook-xsl\" # docbook-xsl-nons\n  end\n\n  if build.with? \"api-docs\"\n    depends_on \"graphviz\"\n    depends_on \"doxygen\"\n  end\n\n  def install\n    # Follow the PostgreSQL linked keg back to the active Postgres installation\n    # as it is common for people to avoid upgrading Postgres.\n    # postgres_realpath = Formula[\"postgresql\"].opt_prefix.realpath\n    ENV.append \"CFLAGS\", \"-Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close\"\n    ENV.append \"LDFLAGS\", \"-L#{Formula[\"libiconv\"].opt_lib} -liconv\" # ICONV_LDFLAGS\n\n    ENV.deparallelize\n\n    args = [\n      \"--with-libiconv=#{Formula[\"libiconv\"].opt_prefix}\",\n      \"--with-xml2config=#{Formula[\"libxml2\"].opt_bin}/xml2-config\",\n      \"--with-geosconfig=#{Formula[\"geos\"].opt_bin}/geos-config\",\n      \"--with-sfcgal=#{Formula[\"sfcgal\"].opt_bin}/sfcgal-config\",\n      \"--with-projdir=#{Formula[\"osgeo-proj\"].opt_prefix}\",\n      \"--with-jsondir=#{Formula[\"json-c\"].opt_prefix}\",\n      \"--with-protobufdir=#{Formula[\"protobuf-c\"].opt_prefix}\",\n      \"--with-pcredir=#{Formula[\"pcre\"].opt_prefix}\",\n      \"--with-gdalconfig=#{Formula[\"osgeo-gdal\"].opt_bin}/gdal-config\",\n      \"--with-gui\",\n      \"--with-raster\",\n    ]\n\n    # By default PostGIS will try to detect gettext support and compile with it,\n    # how ever if your un into incompatibility issues that cause breakage of loader,\n    # you can disable it entirely with this command. Refer to ticket\n    # http://trac.osgeo.org/postgis/ticket/748 for an example issue solved by\n    # configuring with this. NOTE: that you aren’t missing much by turning this off.\n    # This is used for international help/label support for the GUI loader which is not\n    # yet documented and still experimental.\n    args << \"--with-gettext=no\" # or PATH\n\n    # Unfortunately, NLS support causes all kinds of headaches because\n    # PostGIS gets all of its compiler flags from the PGXS makefiles. This\n    # makes it nigh impossible to tell the buildsystem where our keg-only\n    # gettext installations are.\n    args << \"--disable-nls\"\n\n    # Wagyu will only be necessary if protobuf is present to build MVTs\n    # args << \"--with-wagyu\"\n\n    # Disable topology support.\n    # There is no corresponding library as all logic needed for\n    # topology is in postgis- 3.0.2 library.\n    # args << \"--without-topology\"\n\n    # Disable the address_standardizer extension\n    # args << \"--without-address-standardizer\"\n\n    # specify the dtd path for mathml2.dtd\n    # args << \"--with-mathmldtd=PATH\"\n\n    args << \"--with-xsldir=#{Formula[\"docbook-xsl\"].opt_prefix}/docbook-xsl\" if build.with? \"html-docs\" # /docbook-xsl-nons\n\n    if build.with?(\"pg10\")\n      args << \"--with-pgconfig=#{Formula[\"osgeo-postgresql@10\"].opt_bin}/pg_config\"\n    elsif build.with?(\"pg11\")\n      args << \"--with-pgconfig=#{Formula[\"osgeo-postgresql@11\"].opt_bin}/pg_config\"\n    else\n      args << \"--with-pgconfig=#{Formula[\"osgeo-postgresql\"].opt_bin}/pg_config\"\n    end\n\n    system \"./autogen.sh\"\n    system \"./configure\", *args\n    system \"make\"\n\n    if build.with? \"html-docs\"\n      cd \"doc\" do\n        ENV[\"XML_CATALOG_FILES\"] = \"#{etc}/xml/catalog\"\n        system \"make\", \"chunked-html\"\n        doc.install \"html\"\n      end\n    end\n\n    if build.with? \"api-docs\"\n      cd \"doc\" do\n        system \"make\", \"doxygen\"\n        doc.install \"doxygen/html\" => \"api\"\n      end\n    end\n\n    # PostGIS includes the PGXS makefiles and so will install __everything__\n    # into the Postgres keg instead of the PostGIS keg. Unfortunately, some\n    # things have to be inside the Postgres keg in order to be function. So, we\n    # install everything to a staging directory and manually move the pieces\n    # into the appropriate prefixes.\n    mkdir \"stage\"\n    system \"make\", \"install\", \"DESTDIR=#{buildpath}/stage\"\n\n    # Install PostGIS plugin libraries into the Postgres keg so that they can\n    # be loaded and so PostGIS databases will continue to function even if\n    # PostGIS is removed.\n    # (postgres_realpath/\"lib\").install Dir[\"stage/**/*.so\"]\n\n    # Install extension scripts to the Postgres keg.\n    # `CREATE EXTENSION postgis;` won't work if these are located elsewhere.\n    # (postgres_realpath/\"share/postgresql/extension\").install Dir[\"stage/**/extension/*\"]\n\n    bin.install Dir[\"stage/**/bin/*\"]\n    lib.install Dir[\"stage/**/lib/*\"]\n    include.install Dir[\"stage/**/include/*\"]\n    pkgshare.install Dir[\"stage/**/contrib/postgis-*/*\"]\n    (share/\"doc/postgresql/extension\").install Dir[\"stage/**/share/doc/postgresql/extension/*\"]\n    (share/\"postgresql/extension\").install Dir[\"stage/**/share/postgresql/extension/*\"]\n    (share/\"postgresql/contrib/postgis-3.0\").install Dir[\"stage/**/contrib/postgis-*/*\"]\n    (share/\"postgis_topology\").install Dir[\"stage/**/contrib/postgis_topology-*/*\"]\n\n    # Extension scripts\n    bin.install %w[\n      utils/create_undef.pl\n      utils/postgis_proc_upgrade.pl\n      utils/postgis_restore.pl\n      utils/profile_intersects.pl\n      utils/test_estimation.pl\n      utils/test_geography_estimation.pl\n      utils/test_geography_joinestimation.pl\n      utils/test_joinestimation.pl\n    ]\n\n    man1.install Dir[\"doc/**/*.1\"]\n  end\n\n  def caveats\n    <<~EOS\n      To create a spatially-enabled database, see the documentation:\n        https://postgis.net/docs/manual-3.0/postgis_installation.html#create_new_db_extensions\n      If you are currently using PostGIS 2.0+, you can go the soft upgrade path:\n        ALTER EXTENSION postgis UPDATE TO \"#{version}\";\n      Users of 1.5 and below will need to go the hard-upgrade path, see here:\n        https://postgis.net/docs/manual-3.0/postgis_installation.html#upgrading\n\n      PostGIS SQL scripts installed to:\n        #{HOMEBREW_PREFIX}/share/postgresql/contrib/postgis-3.0\n      PostGIS plugin libraries installed to:\n        #{HOMEBREW_PREFIX}/lib\n      PostGIS extension modules installed to:\n        #{HOMEBREW_PREFIX}/share/postgresql/extension\n    EOS\n  end\n\n  test do\n    require \"base64\"\n    (testpath/\"brew.shp\").write ::Base64.decode64 <<~EOS\n      AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoOgDAAALAAAAAAAAAAAAAAAA\n      AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n      AAAAAAAAAAAAAAAAAAEAAAASCwAAAAAAAAAAAPA/AAAAAAAA8D8AAAAAAAAA\n      AAAAAAAAAAAAAAAAAgAAABILAAAAAAAAAAAACEAAAAAAAADwPwAAAAAAAAAA\n      AAAAAAAAAAAAAAADAAAAEgsAAAAAAAAAAAAQQAAAAAAAAAhAAAAAAAAAAAAA\n      AAAAAAAAAAAAAAQAAAASCwAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAA\n      AAAAAAAAAAAABQAAABILAAAAAAAAAAAAAAAAAAAAAAAUQAAAAAAAACJAAAAA\n      AAAAAEA=\n    EOS\n    (testpath/\"brew.dbf\").write ::Base64.decode64 <<~EOS\n      A3IJGgUAAABhAFsAAAAAAAAAAAAAAAAAAAAAAAAAAABGSVJTVF9GTEQAAEMA\n      AAAAMgAAAAAAAAAAAAAAAAAAAFNFQ09ORF9GTEQAQwAAAAAoAAAAAAAAAAAA\n      AAAAAAAADSBGaXJzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgU2Vjb25kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgIFRoaXJkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICAgUG9pbnQgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICBGb3VydGggICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgQXBwZW5kZWQgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAg\n    EOS\n    (testpath/\"brew.shx\").write ::Base64.decode64 <<~EOS\n      AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARugDAAALAAAAAAAAAAAAAAAA\n      AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n      AAAAAAAAAAAAAAAAADIAAAASAAAASAAAABIAAABeAAAAEgAAAHQAAAASAAAA\n      igAAABI=\n    EOS\n    result = shell_output(\"#{bin}/shp2pgsql #{testpath}/brew.shp\")\n    assert_match(/Point/, result)\n    assert_match(/AddGeometryColumn/, result)\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-postgis@2.4.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !osgeo_postgis_linked && !core_postgis_linked }\n\n  def osgeo_postgis_linked\n    Formula[\"osgeo-postgis\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_postgis_linked\n    Formula[\"postgis\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink osgeo-postgis\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies osgeo-postgis\\e[0m\\n\\n\" if osgeo_postgis_linked\n    s += \"Unlink with \\e[32mbrew unlink postgis\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies postgis\\e[0m\\n\\n\" if core_postgis_linked\n    s\n  end\nend\n\nclass OsgeoPostgisAT24 < Formula\n  desc \"Adds support for geographic objects to PostgreSQL\"\n  homepage \"https://postgis.net/\"\n  url \"https://github.com/postgis/postgis/archive/2.4.9.tar.gz\"\n  sha256 \"77ba24bf8fbbfa65881d7d24bd6379f2001fff781d6ff512590bfaf16e605288\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"4eac63ef452ab5bfa1035d680b4f17109c5b33df286c0c267f1b6c7283c2c74a\" => :catalina\n    sha256 \"4eac63ef452ab5bfa1035d680b4f17109c5b33df286c0c267f1b6c7283c2c74a\" => :mojave\n    sha256 \"4eac63ef452ab5bfa1035d680b4f17109c5b33df286c0c267f1b6c7283c2c74a\" => :high_sierra\n  end\n\n  #revision 1\n\n  head \"https://github.com/postgis/postgis.git\", :branch => \"svn-2.4\"\n\n  option \"with-html-docs\", \"Generate multi-file HTML documentation\"\n  option \"with-api-docs\", \"Generate developer API documentation (long process)\"\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n\n  # keg_only :versioned_formula\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"libtool\" => :build\n  depends_on \"gpp\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"geos\"\n  depends_on \"json-c\" # for GeoJSON and raster handling\n  depends_on \"libiconv\"\n  depends_on \"libxml2\"\n  depends_on \"libxslt\"\n  depends_on \"pcre\"\n  depends_on \"osgeo-proj\"\n  depends_on \"sfcgal\" # for advanced 2D/3D functions\n  depends_on \"protobuf-c\" #  Geobuf and Mapbox Vector Tile support\n  depends_on \"osgeo-gdal\" # for GeoJSON and raster handling\n\n  if build.with?(\"pg10\")\n    depends_on \"osgeo-postgresql@10\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  depends_on \"gtk+\" # for gui\n\n  if build.with? \"html-docs\"\n    depends_on \"imagemagick\"\n    depends_on \"docbook-xsl\" # docbook-xsl-nons\n  end\n\n  if build.with? \"api-docs\"\n    depends_on \"graphviz\"\n    depends_on \"doxygen\"\n  end\n\n  def install\n    # Follow the PostgreSQL linked keg back to the active Postgres installation\n    # as it is common for people to avoid upgrading Postgres.\n    # postgres_realpath = Formula[\"osgeo-postgresql@10\"].opt_prefix.realpath\n    ENV.append \"CFLAGS\", \"-Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close\"\n    ENV.append \"LDFLAGS\", \"-L#{Formula[\"libiconv\"].opt_lib} -liconv\" # ICONV_LDFLAGS\n\n    ENV.deparallelize\n\n    args = [\n      \"--with-libiconv=#{Formula[\"libiconv\"].opt_prefix}\",\n      \"--with-xml2config=#{Formula[\"libxml2\"].opt_bin}/xml2-config\",\n      \"--with-geosconfig=#{Formula[\"geos\"].opt_bin}/geos-config\",\n      \"--with-sfcgal=#{Formula[\"sfcgal\"].opt_bin}/sfcgal-config\",\n      \"--with-projdir=#{Formula[\"osgeo-proj\"].opt_prefix}\",\n      \"--with-jsondir=#{Formula[\"json-c\"].opt_prefix}\",\n      \"--with-protobufdir=#{Formula[\"protobuf-c\"].opt_prefix}\",\n      \"--with-pcredir=#{Formula[\"pcre\"].opt_prefix}\",\n      \"--with-gdalconfig=#{Formula[\"osgeo-gdal\"].opt_bin}/gdal-config\",\n      \"--with-gui\",\n      \"--with-raster\",\n    ]\n\n    # By default PostGIS will try to detect gettext support and compile with it,\n    # how ever if your un into incompatibility issues that cause breakage of loader,\n    # you can disable it entirely with this command. Refer to ticket\n    # http://trac.osgeo.org/postgis/ticket/748 for an example issue solved by\n    # configuring with this. NOTE: that you aren’t missing much by turning this off.\n    # This is used for international help/label support for the GUI loader which is not\n    # yet documented and still experimental.\n    args << \"--with-gettext=no\" # or PATH\n\n    # Unfortunately, NLS support causes all kinds of headaches because\n    # PostGIS gets all of its compiler flags from the PGXS makefiles. This\n    # makes it nigh impossible to tell the buildsystem where our keg-only\n    # gettext installations are.\n    args << \"--disable-nls\"\n\n    # Wagyu will only be necessary if protobuf is present to build MVTs\n    # args << \"--with-wagyu\"\n\n    # Disable topology support.\n    # There is no corresponding library as all logic needed for\n    # topology is in postgis- 2.4.8 library.\n    # args << \"--without-topology\"\n\n    # Disable the address_standardizer extension\n    # args << \"--without-address-standardizer\"\n\n    # specify the dtd path for mathml2.dtd\n    # args << \"--with-mathmldtd=PATH\"\n\n    args << \"--with-xsldir=#{Formula[\"docbook-xsl\"].opt_prefix}/docbook-xsl\" if build.with? \"html-docs\" # /docbook-xsl-nons\n\n    if build.with?(\"pg10\")\n      args << \"--with-pgconfig=#{Formula[\"osgeo-postgresql@10\"].opt_bin}/pg_config\"\n    else\n      args << \"--with-pgconfig=#{Formula[\"osgeo-postgresql\"].opt_bin}/pg_config\"\n    end\n\n    system \"./autogen.sh\"\n    system \"./configure\", *args\n    system \"make\"\n\n    if build.with? \"html-docs\"\n      cd \"doc\" do\n        ENV[\"XML_CATALOG_FILES\"] = \"#{etc}/xml/catalog\"\n        system \"make\", \"chunked-html\"\n        doc.install \"html\"\n      end\n    end\n\n    if build.with? \"api-docs\"\n      cd \"doc\" do\n        system \"make\", \"doxygen\"\n        doc.install \"doxygen/html\" => \"api\"\n      end\n    end\n\n    # PostGIS includes the PGXS makefiles and so will install __everything__\n    # into the Postgres keg instead of the PostGIS keg. Unfortunately, some\n    # things have to be inside the Postgres keg in order to be function. So, we\n    # install everything to a staging directory and manually move the pieces\n    # into the appropriate prefixes.\n    mkdir \"stage\"\n    system \"make\", \"install\", \"DESTDIR=#{buildpath}/stage\"\n\n    # Install PostGIS plugin libraries into the Postgres keg so that they can\n    # be loaded and so PostGIS databases will continue to function even if\n    # PostGIS is removed.\n    # (postgres_realpath/\"lib\").install Dir[\"stage/**/*.so\"]\n\n    # Install extension scripts to the Postgres keg.\n    # `CREATE EXTENSION postgis;` won't work if these are located elsewhere.\n    # (postgres_realpath/\"share/postgresql/extension\").install Dir[\"stage/**/extension/*\"]\n\n    bin.install Dir[\"stage/**/bin/*\"]\n    lib.install Dir[\"stage/**/lib/*\"]\n    include.install Dir[\"stage/**/include/*\"]\n    (share/\"doc/postgresql/extension\").install Dir[\"stage/**/share/doc/postgresql/extension/*\"]\n    (share/\"postgresql/extension\").install Dir[\"stage/**/share/postgresql/extension/*\"]\n    (share/\"postgresql/contrib/postgis-2.4\").install Dir[\"stage/**/contrib/postgis-*/*\"]\n\n    # Extension scripts\n    bin.install %w[\n      utils/create_undef.pl\n      utils/postgis_proc_upgrade.pl\n      utils/postgis_restore.pl\n      utils/profile_intersects.pl\n      utils/test_estimation.pl\n      utils/test_geography_estimation.pl\n      utils/test_geography_joinestimation.pl\n      utils/test_joinestimation.pl\n    ]\n\n    man1.install Dir[\"doc/**/*.1\"]\n  end\n\n  def caveats\n    <<~EOS\n      To create a spatially-enabled database, see the documentation:\n        https://postgis.net/docs/manual-2.4/postgis_installation.html#create_new_db_extensions\n      If you are currently using PostGIS 2.0+, you can go the soft upgrade path:\n        ALTER EXTENSION postgis UPDATE TO \"#{version}\";\n      Users of 1.5 and below will need to go the hard-upgrade path, see here:\n        https://postgis.net/docs/manual-2.4/postgis_installation.html#upgrading\n\n      PostGIS SQL scripts installed to:\n        #{HOMEBREW_PREFIX}/share/postgresql/contrib/postgis-2.4\n      PostGIS plugin libraries installed to:\n        #{HOMEBREW_PREFIX}/lib\n      PostGIS extension modules installed to:\n        #{HOMEBREW_PREFIX}/share/postgresql/extension\n    EOS\n  end\n\n  test do\n    require \"base64\"\n    (testpath/\"brew.shp\").write ::Base64.decode64 <<~EOS\n      AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoOgDAAALAAAAAAAAAAAAAAAA\n      AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n      AAAAAAAAAAAAAAAAAAEAAAASCwAAAAAAAAAAAPA/AAAAAAAA8D8AAAAAAAAA\n      AAAAAAAAAAAAAAAAAgAAABILAAAAAAAAAAAACEAAAAAAAADwPwAAAAAAAAAA\n      AAAAAAAAAAAAAAADAAAAEgsAAAAAAAAAAAAQQAAAAAAAAAhAAAAAAAAAAAAA\n      AAAAAAAAAAAAAAQAAAASCwAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAA\n      AAAAAAAAAAAABQAAABILAAAAAAAAAAAAAAAAAAAAAAAUQAAAAAAAACJAAAAA\n      AAAAAEA=\n    EOS\n    (testpath/\"brew.dbf\").write ::Base64.decode64 <<~EOS\n      A3IJGgUAAABhAFsAAAAAAAAAAAAAAAAAAAAAAAAAAABGSVJTVF9GTEQAAEMA\n      AAAAMgAAAAAAAAAAAAAAAAAAAFNFQ09ORF9GTEQAQwAAAAAoAAAAAAAAAAAA\n      AAAAAAAADSBGaXJzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgU2Vjb25kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgIFRoaXJkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICAgUG9pbnQgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICBGb3VydGggICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgQXBwZW5kZWQgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAg\n    EOS\n    (testpath/\"brew.shx\").write ::Base64.decode64 <<~EOS\n      AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARugDAAALAAAAAAAAAAAAAAAA\n      AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n      AAAAAAAAAAAAAAAAADIAAAASAAAASAAAABIAAABeAAAAEgAAAHQAAAASAAAA\n      igAAABI=\n    EOS\n    result = shell_output(\"#{bin}/shp2pgsql #{testpath}/brew.shp\")\n    assert_match /Point/, result\n    assert_match /AddGeometryColumn/, result\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-postgis@2.5.rb",
    "content": "class OsgeoPostgisAT25 < Formula\n  desc \"Adds support for geographic objects to PostgreSQL\"\n  homepage \"https://postgis.net/\"\n  url \"https://github.com/postgis/postgis/archive/2.5.5.tar.gz\"\n  sha256 \"24b15ee36f3af02015da0e92a18f9046ea0b4fd24896196c8e6c2aa8e4b56baa\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"9c33a980de9ef04d3c7f343ae48585e2b80ae62cfd89c3bb21ca57f352ecf685\" => :catalina\n    sha256 \"9c33a980de9ef04d3c7f343ae48585e2b80ae62cfd89c3bb21ca57f352ecf685\" => :mojave\n    sha256 \"9c33a980de9ef04d3c7f343ae48585e2b80ae62cfd89c3bb21ca57f352ecf685\" => :high_sierra\n  end\n\n  #revision 5\n\n  head \"https://github.com/postgis/postgis.git\", :branch => \"master\"\n\n  option \"with-html-docs\", \"Generate multi-file HTML documentation\"\n  option \"with-api-docs\", \"Generate developer API documentation (long process)\"\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n  option \"with-pg11\", \"Build with PostgreSQL 11 client\"\n\n  # keg_only \"postgis is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  #depends_on Unlinked\n\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"libtool\" => :build\n  depends_on \"gpp\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"geos\"\n  depends_on \"json-c\" # for GeoJSON and raster handling\n  depends_on \"libiconv\"\n  depends_on \"libxml2\"\n  depends_on \"libxslt\"\n  depends_on \"pcre\"\n  depends_on \"osgeo-proj\"\n  depends_on \"sfcgal\" # for advanced 2D/3D functions\n  depends_on \"protobuf-c\" #  Geobuf and Mapbox Vector Tile support\n  depends_on \"osgeo-gdal\" # for GeoJSON and raster handling\n\n  # The latest supported version of PostgreSQL by PostGIS 2.5 is 12,\n  # and thus it's the standard version.\n  # https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS\n  if build.with?(\"pg10\")\n    depends_on \"osgeo-postgresql@10\"\n  elsif build.with?(\"pg11\")\n    depends_on \"osgeo-postgresql@11\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  depends_on \"gtk+\" # for gui\n\n  if build.with? \"html-docs\"\n    depends_on \"imagemagick\"\n    depends_on \"docbook-xsl\" # docbook-xsl-nons\n  end\n\n  if build.with? \"api-docs\"\n    depends_on \"graphviz\"\n    depends_on \"doxygen\"\n  end\n\n  def install\n    # Follow the PostgreSQL linked keg back to the active Postgres installation\n    # as it is common for people to avoid upgrading Postgres.\n    # postgres_realpath = Formula[\"postgresql\"].opt_prefix.realpath\n    ENV.append \"CFLAGS\", \"-Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close\"\n    ENV.append \"LDFLAGS\", \"-L#{Formula[\"libiconv\"].opt_lib} -liconv\" # ICONV_LDFLAGS\n\n    ENV.deparallelize\n\n    args = [\n      \"--with-libiconv=#{Formula[\"libiconv\"].opt_prefix}\",\n      \"--with-xml2config=#{Formula[\"libxml2\"].opt_bin}/xml2-config\",\n      \"--with-geosconfig=#{Formula[\"geos\"].opt_bin}/geos-config\",\n      \"--with-sfcgal=#{Formula[\"sfcgal\"].opt_bin}/sfcgal-config\",\n      \"--with-projdir=#{Formula[\"osgeo-proj\"].opt_prefix}\",\n      \"--with-jsondir=#{Formula[\"json-c\"].opt_prefix}\",\n      \"--with-protobufdir=#{Formula[\"protobuf-c\"].opt_prefix}\",\n      \"--with-pcredir=#{Formula[\"pcre\"].opt_prefix}\",\n      \"--with-gdalconfig=#{Formula[\"osgeo-gdal\"].opt_bin}/gdal-config\",\n      \"--with-gui\",\n      \"--with-raster\",\n    ]\n\n    # By default PostGIS will try to detect gettext support and compile with it,\n    # how ever if your un into incompatibility issues that cause breakage of loader,\n    # you can disable it entirely with this command. Refer to ticket\n    # http://trac.osgeo.org/postgis/ticket/748 for an example issue solved by\n    # configuring with this. NOTE: that you aren’t missing much by turning this off.\n    # This is used for international help/label support for the GUI loader which is not\n    # yet documented and still experimental.\n    args << \"--with-gettext=no\" # or PATH\n\n    # Unfortunately, NLS support causes all kinds of headaches because\n    # PostGIS gets all of its compiler flags from the PGXS makefiles. This\n    # makes it nigh impossible to tell the buildsystem where our keg-only\n    # gettext installations are.\n    args << \"--disable-nls\"\n\n    # Wagyu will only be necessary if protobuf is present to build MVTs\n    # args << \"--with-wagyu\"\n\n    # Disable topology support.\n    # There is no corresponding library as all logic needed for\n    # topology is in postgis- 3.0.2 library.\n    # args << \"--without-topology\"\n\n    # Disable the address_standardizer extension\n    # args << \"--without-address-standardizer\"\n\n    # specify the dtd path for mathml2.dtd\n    # args << \"--with-mathmldtd=PATH\"\n\n    args << \"--with-xsldir=#{Formula[\"docbook-xsl\"].opt_prefix}/docbook-xsl\" if build.with? \"html-docs\" # /docbook-xsl-nons\n\n    if build.with?(\"pg10\")\n      args << \"--with-pgconfig=#{Formula[\"osgeo-postgresql@10\"].opt_bin}/pg_config\"\n    elsif build.with?(\"pg11\")\n      args << \"--with-pgconfig=#{Formula[\"osgeo-postgresql@11\"].opt_bin}/pg_config\"\n    else\n      args << \"--with-pgconfig=#{Formula[\"osgeo-postgresql\"].opt_bin}/pg_config\"\n    end\n\n    system \"./autogen.sh\"\n    system \"./configure\", *args\n    system \"make\"\n\n    if build.with? \"html-docs\"\n      cd \"doc\" do\n        ENV[\"XML_CATALOG_FILES\"] = \"#{etc}/xml/catalog\"\n        system \"make\", \"chunked-html\"\n        doc.install \"html\"\n      end\n    end\n\n    if build.with? \"api-docs\"\n      cd \"doc\" do\n        system \"make\", \"doxygen\"\n        doc.install \"doxygen/html\" => \"api\"\n      end\n    end\n\n    # PostGIS includes the PGXS makefiles and so will install __everything__\n    # into the Postgres keg instead of the PostGIS keg. Unfortunately, some\n    # things have to be inside the Postgres keg in order to be function. So, we\n    # install everything to a staging directory and manually move the pieces\n    # into the appropriate prefixes.\n    mkdir \"stage\"\n    system \"make\", \"install\", \"DESTDIR=#{buildpath}/stage\"\n\n    # Install PostGIS plugin libraries into the Postgres keg so that they can\n    # be loaded and so PostGIS databases will continue to function even if\n    # PostGIS is removed.\n    # (postgres_realpath/\"lib\").install Dir[\"stage/**/*.so\"]\n\n    # Install extension scripts to the Postgres keg.\n    # `CREATE EXTENSION postgis;` won't work if these are located elsewhere.\n    # (postgres_realpath/\"share/postgresql/extension\").install Dir[\"stage/**/extension/*\"]\n\n    bin.install Dir[\"stage/**/bin/*\"]\n    lib.install Dir[\"stage/**/lib/*\"]\n    include.install Dir[\"stage/**/include/*\"]\n    pkgshare.install Dir[\"stage/**/contrib/postgis-*/*\"]\n    (share/\"doc/postgresql/extension\").install Dir[\"stage/**/share/doc/postgresql/extension/*\"]\n    (share/\"postgresql/extension\").install Dir[\"stage/**/share/postgresql/extension/*\"]\n    (share/\"postgresql/contrib/postgis-2.5\").install Dir[\"stage/**/contrib/postgis-*/*\"]\n    (share/\"postgis_topology\").install Dir[\"stage/**/contrib/postgis_topology-*/*\"]\n\n    # Extension scripts\n    bin.install %w[\n      utils/create_undef.pl\n      utils/postgis_proc_upgrade.pl\n      utils/postgis_restore.pl\n      utils/profile_intersects.pl\n      utils/test_estimation.pl\n      utils/test_geography_estimation.pl\n      utils/test_geography_joinestimation.pl\n      utils/test_joinestimation.pl\n    ]\n\n    man1.install Dir[\"doc/**/*.1\"]\n  end\n\n  def caveats\n    <<~EOS\n      To create a spatially-enabled database, see the documentation:\n        https://postgis.net/docs/manual-2.5/postgis_installation.html#create_new_db_extensions\n      If you are currently using PostGIS 2.0+, you can go the soft upgrade path:\n        ALTER EXTENSION postgis UPDATE TO \"#{version}\";\n      Users of 1.5 and below will need to go the hard-upgrade path, see here:\n        https://postgis.net/docs/manual-2.5/postgis_installation.html#upgrading\n\n      PostGIS SQL scripts installed to:\n        #{HOMEBREW_PREFIX}/share/postgresql/contrib/postgis-2.5\n      PostGIS plugin libraries installed to:\n        #{HOMEBREW_PREFIX}/lib\n      PostGIS extension modules installed to:\n        #{HOMEBREW_PREFIX}/share/postgresql/extension\n    EOS\n  end\n\n  test do\n    require \"base64\"\n    (testpath/\"brew.shp\").write ::Base64.decode64 <<~EOS\n      AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoOgDAAALAAAAAAAAAAAAAAAA\n      AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n      AAAAAAAAAAAAAAAAAAEAAAASCwAAAAAAAAAAAPA/AAAAAAAA8D8AAAAAAAAA\n      AAAAAAAAAAAAAAAAAgAAABILAAAAAAAAAAAACEAAAAAAAADwPwAAAAAAAAAA\n      AAAAAAAAAAAAAAADAAAAEgsAAAAAAAAAAAAQQAAAAAAAAAhAAAAAAAAAAAAA\n      AAAAAAAAAAAAAAQAAAASCwAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAA\n      AAAAAAAAAAAABQAAABILAAAAAAAAAAAAAAAAAAAAAAAUQAAAAAAAACJAAAAA\n      AAAAAEA=\n    EOS\n    (testpath/\"brew.dbf\").write ::Base64.decode64 <<~EOS\n      A3IJGgUAAABhAFsAAAAAAAAAAAAAAAAAAAAAAAAAAABGSVJTVF9GTEQAAEMA\n      AAAAMgAAAAAAAAAAAAAAAAAAAFNFQ09ORF9GTEQAQwAAAAAoAAAAAAAAAAAA\n      AAAAAAAADSBGaXJzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgU2Vjb25kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgIFRoaXJkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICAgUG9pbnQgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICBGb3VydGggICAgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgQXBwZW5kZWQgICAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAg\n      ICAgICAgICAgICAg\n    EOS\n    (testpath/\"brew.shx\").write ::Base64.decode64 <<~EOS\n      AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARugDAAALAAAAAAAAAAAAAAAA\n      AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\n      AAAAAAAAAAAAAAAAADIAAAASAAAASAAAABIAAABeAAAAEgAAAHQAAAASAAAA\n      igAAABI=\n    EOS\n    result = shell_output(\"#{bin}/shp2pgsql #{testpath}/brew.shp\")\n    assert_match(/Point/, result)\n    assert_match(/AddGeometryColumn/, result)\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-postgresql.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !osgeo_postgresql11_linked && !osgeo_postgresql10_linked && !core_postgresql_linked && !core_postgresql11_linked && !core_postgresql10_linked }\n\n  def osgeo_postgresql11_linked\n    Formula[\"osgeo-postgresql@11\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def osgeo_postgresql10_linked\n    Formula[\"osgeo-postgresql@10\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_postgresql_linked\n    Formula[\"postgresql\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_postgresql11_linked\n    Formula[\"postgresql@11\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_postgresql10_linked\n    Formula[\"postgresql@10\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink osgeo-postgresql@11\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies osgeo-postgresql@11\\e[0m\\n\\n\" if osgeo_postgresql11_linked\n    s += \"Unlink with \\e[32mbrew unlink osgeo-postgresql@10\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies osgeo-postgresql@10\\e[0m\\n\\n\" if osgeo_postgresql10_linked\n    s += \"Unlink with \\e[32mbrew unlink postgresql\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies postgresql\\e[0m\\n\\n\" if core_postgresql_linked\n    s += \"Unlink with \\e[32mbrew unlink postgresql@11\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies postgresq@11\\e[0m\\n\\n\" if core_postgresql11_linked\n    s += \"Unlink with \\e[32mbrew unlink postgresql@10\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies postgresq@10\\e[0m\\n\\n\" if core_postgresql10_linked\n    s\n  end\nend\n\nclass OsgeoPostgresql < Formula\n  desc \"Object-relational database system\"\n  homepage \"https://www.postgresql.org/\"\n  url \"https://ftp.postgresql.org/pub/source/v12.4/postgresql-12.4.tar.bz2\"\n  sha256 \"bee93fbe2c32f59419cb162bcc0145c58da9a8644ee154a30b9a5ce47de606cc\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"c2ffac019bf7f8aed005fb3a0c50d2cfe30b7daf3a1edda9e415e64e0328a153\" => :catalina\n    sha256 \"c2ffac019bf7f8aed005fb3a0c50d2cfe30b7daf3a1edda9e415e64e0328a153\" => :mojave\n    sha256 \"c2ffac019bf7f8aed005fb3a0c50d2cfe30b7daf3a1edda9e415e64e0328a153\" => :high_sierra\n  end\n\n  #revision 1\n\n  head \"https://github.com/postgres/postgres.git\", :branch => \"master\"\n\n  option \"with-cellar\", \"Use /Cellar in the path configuration (necessary for migration)\"\n\n  # keg_only \"postgresql is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"gettext\"\n  depends_on \"icu4c\"\n  depends_on \"openldap\" # libldap\n  depends_on \"openssl\"\n  depends_on \"readline\"\n  depends_on \"tcl-tk\"\n  depends_on \"krb5\"\n  depends_on \"libxml2\"\n  depends_on \"python\"\n  depends_on \"perl\"\n  depends_on \"zlib\"\n  # depends_on \"e2fsprogs\"\n\n  # others: pam\n\n  def install\n    # avoid adding the SDK library directory to the linker search path\n    # XML2_CONFIG=:\n    ENV[\"XML2_CONFIG\"] = \"xml2-config --exec-prefix=/usr\"\n\n    # As of Xcode/CLT 10.x the Perl headers were moved from /System\n    # to inside the SDK, so we need to use `-iwithsysroot` instead\n    # of `-I` to point to the correct location.\n    # https://www.postgresql.org/message-id/153558865647.1483.573481613491501077%40wrigleys.postgresql.org\n    ENV.prepend \"LDFLAGS\", \"-L#{Formula[\"openssl\"].opt_lib} -L#{Formula[\"readline\"].opt_lib} -R#{lib}/postgresql\"\n    ENV.prepend \"CPPFLAGS\", \"-I#{Formula[\"openssl\"].opt_include} -I#{Formula[\"readline\"].opt_include}\"\n\n    # ENV[\"PYTHON\"] = which(\"python3\")\n    ENV[\"PYTHON\"] = \"#{Formula[\"python\"].opt_bin}/python3\"\n\n    args = %W[\n      --disable-debug\n      --enable-thread-safety\n      --with-bonjour\n      --with-gssapi\n      --with-icu\n      --with-ldap\n      --with-libxml\n      --with-libxslt\n      --with-openssl\n      --with-pam\n      --with-perl\n      --with-uuid=e2fs\n      --enable-dtrace\n      --enable-nls\n      --with-python\n    ]\n\n    if build.with? \"cellar\"\n      args += [\n        \"--prefix=#{prefix}\",\n        # \"bindir=#{bin}\", # if define this, will refer to /Cellar\n        \"--datadir=#{share}/postgresql\",\n        \"--libdir=#{lib}/postgresql\",\n        \"--sysconfdir=#{etc}\",\n        \"--docdir=#{doc}/postgresql\",\n        \"--includedir=#{include}/postgresql\"\n      ]\n    else\n      # this is to not have the reference to /Cellar in the files\n      args += [\n        \"--prefix=#{prefix}\",\n        # \"--bindir=#{HOMEBREW_PREFIX}/bin\",\n        \"--sysconfdir=#{HOMEBREW_PREFIX}/etc\",\n        \"--libdir=#{HOMEBREW_PREFIX}/lib\",\n        \"--datadir=#{HOMEBREW_PREFIX}/share/postgresql\",\n        \"--docdir=#{HOMEBREW_PREFIX}/share/doc/postgresql\",\n        \"--localstatedir=#{HOMEBREW_PREFIX}/var\",\n        \"--includedir=#{HOMEBREW_PREFIX}/include\",\n        \"--datarootdir=#{HOMEBREW_PREFIX}/share\",\n        \"--localedir=#{HOMEBREW_PREFIX}/share/locale\",\n        \"--mandir=#{HOMEBREW_PREFIX}/share/man\",\n      ]\n\n      # args << \"--with-system-tzdata=#{HOMEBREW_PREFIX}/share/zoneinfo\" # use system time zone data in DIR\n    end\n\n    dirs = [\n      # \"bindir=#{bin}\",\n      \"datadir=#{share}/postgresql\", # #{pkgshare}\n      \"libdir=#{lib}\",\n      \"pkglibdir=#{lib}/postgresql\", # #{lib}\n      \"pkgincludedir=#{include}/postgresql\",\n      \"sysconfdir=#{etc}\",\n      \"includedir=#{include}\",\n      \"localedir=#{share}/locale\",\n      \"mandir=#{man}\",\n      \"docdir=#{share}/doc/postgresql\",\n    ]\n\n    # The CLT is required to build Tcl support on 10.7 and 10.8 because\n    # tclConfig.sh is not part of the SDK\n    args << \"--with-tcl\"\n    if File.exist?(\"#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework/tclConfig.sh\")\n      args << \"--with-tclconfig=#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework\"\n    end\n\n    # Add include and library directories of dependencies, so that\n    # they can be used for compiling extensions.  Superenv does this\n    # when compiling this package, but won't record it for pg_config.\n    deps = %w[gettext icu4c openldap openssl readline tcl-tk]\n    with_includes = deps.map { |f| Formula[f].opt_include }.join(\":\")\n    with_libraries = deps.map { |f| Formula[f].opt_lib }.join(\":\")\n    args << \"--with-includes=#{with_includes}\"\n    args << \"--with-libraries=#{with_libraries}\"\n\n    ENV[\"XML_CATALOG_FILES\"] = \"#{etc}/xml/catalog\"\n\n    system \"./configure\", *args\n    system \"make\"\n\n    # Temporarily disable building/installing the documentation.\n    # Postgresql seems to \"know\" the build system has been altered and\n    # tries to regenerate the documentation when using `install-world`.\n    # This results in the build failing:\n    #  `ERROR: `osx' is missing on your system.`\n    # Attempting to fix that by adding a dependency on `open-sp` doesn't\n    # work and the build errors out on generating the documentation, so\n    # for now let's simply omit it so we can package Postgresql for Mojave.\n    # if DevelopmentTools.clang_build_version >= 1000\n    system \"make\", \"all\"\n    system \"make\", \"-C\", \"contrib\", \"install\", \"all\", *dirs\n    system \"make\", \"install\", \"all\", *dirs\n    # else\n    #   system \"make\", \"install-world\", *dirs\n    # end\n  end\n\n  def post_install\n    # (var/\"log\").mkpath\n    # (var/\"postgresql\").mkpath\n    # unless File.exist? \"#{var}/postgresql/PG_VERSION\"\n    #   system \"#{bin}/initdb\", \"#{var}/postgresql\"\n    # end\n\n    if build.with? \"cellar\"\n      if File.exists?(File.join(\"#{HOMEBREW_PREFIX}/Cellar\", \"osgeo-postgis@2.4\"))\n        unless File.exists?(\"#{HOMEBREW_PREFIX}/opt/osgeo-postgresql/lib/postgresql/postgis-2.4.so\")\n          # copy postgis 2.4.x to postgresql 11.x\n          FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.4\"].opt_share}/postgresql/.\", \"#{share}/postgresql/\"\n          FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.4\"].opt_lib}/postgresql/.\", \"#{lib}/postgresql/\"\n          # FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.4\"].opt_lib}/postgresql/rtpostgis-2.4.so\", \"#{lib}/postgresql/\"\n          # FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.4\"].opt_lib}/postgresql/postgis-2.4.so\", \"#{lib}/postgresql/\"\n          # FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.4\"].opt_lib}/postgresql/postgis_topology-2.4.so\", \"#{lib}/postgresql/\"\n        end\n      end\n\n      # if File.exists?(File.join(\"#{HOMEBREW_PREFIX}/Cellar\", \"osgeo-postgis\"))\n      #   unless File.exists?(\"#{HOMEBREW_PREFIX}/opt/osgeo-postgresql/lib/postgresql/postgis-2.5.so\")\n      #     # install postgis 2.5.x to postgresql 11.x\n      #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_share}/postgresql/.\", \"#{share}/postgresql/\"\n      #     # FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/.\", \"#{lib}/postgresql/\"\n      #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/rtpostgis-2.5.so\", \"#{lib}/postgresql/\"\n      #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/postgis-2.5.so\", \"#{lib}/postgresql/\"\n      #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/postgis_topology-2.5.so\", \"#{lib}/postgresql/\"\n      #   end\n      # end\n    end\n  end\n\n  def caveats; <<~EOS\n\n    1 - If you need to link \"#{name}\":\n\n          \\e[32m$ brew link #{name} --force\\e[0m\n\n        Previously unlink any other version that you have installed.\n\n    2 - If you need to init postgresql just execute the following command:\n\n          \\e[32m$ initdb #{HOMEBREW_PREFIX}/var/postgresql -E utf8 --locale=en_US.UTF-8\\e[0m\n\n        If the file \"#{HOMEBREW_PREFIX}/var/postgresql/PG_VERSION\" exists,\n        it is because you already created this in postinstall or a previous installation.\n\n    3 - Start using:\n\n          \\e[32m$ pg_ctl start -D /usr/local/var/postgresql\\e[0m\n\n    4 - Connecting to our new database\n\n          \\e[32m$ psql -h localhost -d postgres\\e[0m\n\n    Note:\n\n      - Services doesn't start properly, add to \\e[32mhomebrew.mxcl.osgeo-postgresql.plist\\e[0m:\n\n          \\e[32m<key>EnvironmentVariables</key>\\e[0m\n          \\e[32m<dict>\\e[0m\n            \\e[32m<key>LC_ALL</key>\\e[0m\n            \\e[32m<string>en_US.UTF-8</string>\\e[0m\n          \\e[32m</dict>\\e[0m\n\n          issue: \\e[32mhttps://github.com/OSGeo/homebrew-osgeo4mac/issues/1075#issuecomment-490052517\\e[0m\n\n      - Could not bind ipv6 address database system was not properly shut:\n\n          \\e[32m$ sudo lsof -i :5432\\e[0m (search PID)\n\n          \\e[32m$ kill PID\\e[0m\n\n      - To migrate existing data from a previous major version of PostgreSQL run:\n\n          \\e[32m$ brew postgresql-upgrade-database\\e[0m\n\n      - For more information see our page with documentation:\n\n          \\e[32mhttps://osgeo.github.io/homebrew-osgeo4mac\\e[0m\n    EOS\n  end\n\n  plist_options :manual => \"pg_ctl -D #{HOMEBREW_PREFIX}/var/postgresql start\"\n\n  def plist; <<~EOS\n    <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n    <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n    <plist version=\"1.0\">\n    <dict>\n      <key>KeepAlive</key>\n      <true/>\n      <key>Label</key>\n      <string>#{plist_name}</string>\n      <key>ProgramArguments</key>\n      <array>\n        <string>#{opt_bin}/postgres</string>\n        <string>-D</string>\n        <string>#{var}/postgresql</string>\n      </array>\n      <key>RunAtLoad</key>\n      <true/>\n      <key>WorkingDirectory</key>\n      <string>#{HOMEBREW_PREFIX}</string>\n      <key>StandardOutPath</key>\n      <string>#{var}/log/postgresql.log</string>\n      <key>StandardErrorPath</key>\n      <string>#{var}/log/postgresql.log</string>\n    </dict>\n    </plist>\n  EOS\n  end\n\n  test do\n    ENV[\"LC_ALL\"]=\"en_US.UTF-8\"\n    ENV[\"LC_CTYPE\"]=\"en_US.UTF-8\"\n    system \"#{bin}/initdb\", testpath/\"test\"\n    if build.with? \"cellar\"\n      assert_equal (share/\"postgresql\").to_s, shell_output(\"#{bin}/pg_config --sharedir\").chomp\n      assert_equal (lib/\"postgresql\").to_s, shell_output(\"#{bin}/pg_config --libdir\").chomp\n      assert_equal (lib/\"postgresql\").to_s, shell_output(\"#{bin}/pg_config --pkglibdir\").chomp\n    else\n      assert_equal \"#{HOMEBREW_PREFIX}/share/postgresql\", shell_output(\"#{bin}/pg_config --sharedir\").chomp\n      assert_equal \"#{HOMEBREW_PREFIX}/lib\", shell_output(\"#{bin}/pg_config --libdir\").chomp\n      assert_equal \"#{HOMEBREW_PREFIX}/lib/postgresql\", shell_output(\"#{bin}/pg_config --pkglibdir\").chomp\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-postgresql@10.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !osgeo_postgresql11_linked && !osgeo_postgresql_linked && !core_postgresql_linked && !core_postgresql11_linked && !core_postgresql10_linked }\n\n  def osgeo_postgresql_linked\n    Formula[\"osgeo-postgresql\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def osgeo_postgresql11_linked\n    Formula[\"osgeo-postgresql@11\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_postgresql_linked\n    Formula[\"postgresql\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_postgresql11_linked\n    Formula[\"postgresql@11\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_postgresql10_linked\n    Formula[\"postgresql@10\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n    \n    s += \"Unlink with \\e[32mbrew unlink osgeo-postgresql\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies osgeo-postgresql\\e[0m\\n\\n\" if osgeo_postgresql_linked\n    s += \"Unlink with \\e[32mbrew unlink osgeo-postgresql@11\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies osgeo-postgresql@11\\e[0m\\n\\n\" if osgeo_postgresql11_linked\n    s += \"Unlink with \\e[32mbrew unlink postgresql\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies postgresql\\e[0m\\n\\n\" if core_postgresql_linked\n    s += \"Unlink with \\e[32mbrew unlink postgresql@11\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies postgresq@11\\e[0m\\n\\n\" if core_postgresql11_linked\n    s += \"Unlink with \\e[32mbrew unlink postgresql@10\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies postgresq@10\\e[0m\\n\\n\" if core_postgresql10_linked\n    s\n  end\nend\n\nclass OsgeoPostgresqlAT10 < Formula\n  desc \"Relational database management system\"\n  homepage \"https://www.postgresql.org/\"\n  url \"https://ftp.postgresql.org/pub/source/v10.14/postgresql-10.14.tar.bz2\"\n  sha256 \"381cd8f491d8f77db2f4326974542a50095b5fa7709f24d7c5b760be2518b23b\"\n\n  #revision 1\n\n  head \"https://github.com/postgres/postgres.git\", :branch => \"REL_10_STABLE\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"128325ac2bd019ac15159a331d5b18fde8a82657a5df25d868cba91426897d45\" => :catalina\n    sha256 \"128325ac2bd019ac15159a331d5b18fde8a82657a5df25d868cba91426897d45\" => :mojave\n    sha256 \"128325ac2bd019ac15159a331d5b18fde8a82657a5df25d868cba91426897d45\" => :high_sierra\n  end\n\n  option \"with-cellar\", \"Use /Cellar in the path configuration (necessary for migration)\"\n\n  # keg_only :versioned_formula\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"gettext\"\n  depends_on \"icu4c\"\n  depends_on \"openldap\" # libldap\n  depends_on \"openssl\"\n  depends_on \"readline\"\n  depends_on \"tcl-tk\"\n  depends_on \"krb5\"\n  depends_on \"libxml2\"\n  depends_on \"python\"\n  depends_on \"perl\"\n  depends_on \"zlib\"\n  # depends_on \"e2fsprogs\"\n\n  # others: pam\n\n  def install\n    # avoid adding the SDK library directory to the linker search path\n    # XML2_CONFIG=:\n    ENV[\"XML2_CONFIG\"] = \"xml2-config --exec-prefix=/usr\"\n\n    # As of Xcode/CLT 10.x the Perl headers were moved from /System\n    # to inside the SDK, so we need to use `-iwithsysroot` instead\n    # of `-I` to point to the correct location.\n    # https://www.postgresql.org/message-id/153558865647.1483.573481613491501077%40wrigleys.postgresql.org\n    ENV.prepend \"LDFLAGS\", \"-L#{Formula[\"openssl\"].opt_lib} -L#{Formula[\"readline\"].opt_lib} -R#{lib}/postgresql\"\n    ENV.prepend \"CPPFLAGS\", \"-I#{Formula[\"openssl\"].opt_include} -I#{Formula[\"readline\"].opt_include}\"\n\n    # ENV[\"PYTHON\"] = which(\"python3\")\n    ENV[\"PYTHON\"] = \"#{Formula[\"python\"].opt_bin}/python3\"\n\n    args = %W[\n      --disable-debug\n      --enable-thread-safety\n      --with-bonjour\n      --with-gssapi\n      --with-icu\n      --with-ldap\n      --with-libxml\n      --with-libxslt\n      --with-openssl\n      --with-pam\n      --with-perl\n      --enable-dtrace\n      --enable-nls\n      --with-python\n    ]\n\n    # --with-uuid=e2fs\n\n    if build.with? \"cellar\"\n      args += [\n        \"--prefix=#{prefix}\",\n        # \"bindir=#{bin}\", # if define this, will refer to /Cellar\n        \"--datadir=#{share}/postgresql\",\n        \"--libdir=#{lib}/postgresql\",\n        \"--sysconfdir=#{etc}\",\n        \"--docdir=#{doc}/postgresql\",\n        \"--includedir=#{include}/postgresql\"\n      ]\n    else\n      # this is to not have the reference to /Cellar in the files\n      args += [\n        \"--prefix=#{prefix}\",\n        # \"--bindir=#{HOMEBREW_PREFIX}/bin\",\n        \"--sysconfdir=#{HOMEBREW_PREFIX}/etc\",\n        \"--libdir=#{HOMEBREW_PREFIX}/lib\",\n        \"--datadir=#{HOMEBREW_PREFIX}/share/postgresql\",\n        \"--docdir=#{HOMEBREW_PREFIX}/share/doc/postgresql\",\n        \"--localstatedir=#{HOMEBREW_PREFIX}/var\",\n        \"--includedir=#{HOMEBREW_PREFIX}/include\",\n        \"--datarootdir=#{HOMEBREW_PREFIX}/share\",\n        \"--localedir=#{HOMEBREW_PREFIX}/share/locale\",\n        \"--mandir=#{HOMEBREW_PREFIX}/share/man\",\n      ]\n\n      # args << \"--with-system-tzdata=#{HOMEBREW_PREFIX}/share/zoneinfo\" # use system time zone data in DIR\n    end\n\n    dirs = [\n      # \"bindir=#{bin}\",\n      \"datadir=#{share}/postgresql\", # #{pkgshare}\n      \"libdir=#{lib}\",\n      \"pkglibdir=#{lib}/postgresql\", # #{lib}\n      \"pkgincludedir=#{include}/postgresql\",\n      \"sysconfdir=#{etc}\",\n      \"includedir=#{include}\",\n      \"localedir=#{share}/locale\",\n      \"mandir=#{man}\",\n      \"docdir=#{share}/doc/postgresql\",\n    ]\n\n    # The CLT is required to build Tcl support on 10.7 and 10.8 because\n    # tclConfig.sh is not part of the SDK\n    args << \"--with-tcl\"\n    if File.exist?(\"#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework/tclConfig.sh\")\n      args << \"--with-tclconfig=#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework\"\n    end\n\n    # Add include and library directories of dependencies, so that\n    # they can be used for compiling extensions.  Superenv does this\n    # when compiling this package, but won't record it for pg_config.\n    deps = %w[gettext icu4c openldap openssl readline tcl-tk]\n    with_includes = deps.map { |f| Formula[f].opt_include }.join(\":\")\n    with_libraries = deps.map { |f| Formula[f].opt_lib }.join(\":\")\n    args << \"--with-includes=#{with_includes}\"\n    args << \"--with-libraries=#{with_libraries}\"\n\n    ENV[\"XML_CATALOG_FILES\"] = \"#{etc}/xml/catalog\"\n\n    system \"./configure\", *args\n    system \"make\"\n\n    # Temporarily disable building/installing the documentation.\n    # Postgresql seems to \"know\" the build system has been altered and\n    # tries to regenerate the documentation when using `install-world`.\n    # This results in the build failing:\n    #  `ERROR: `osx' is missing on your system.`\n    # Attempting to fix that by adding a dependency on `open-sp` doesn't\n    # work and the build errors out on generating the documentation, so\n    # for now let's simply omit it so we can package Postgresql for Mojave.\n    # if DevelopmentTools.clang_build_version >= 1000\n    system \"make\", \"all\"\n    system \"make\", \"-C\", \"contrib\", \"install\", \"all\", *dirs\n    system \"make\", \"install\", \"all\", *dirs\n    # else\n    #   system \"make\", \"install-world\", *dirs\n    # end\n  end\n\n  def post_install\n    # (var/\"log\").mkpath\n    # (var/\"postgresql@10\").mkpath\n    # unless File.exist? \"#{var}/postgresql@10/PG_VERSION\"\n    #   system \"#{bin}/initdb\", \"#{var}/postgresql@10\"\n    # end\n\n    # if build.with? \"cellar\"\n    #   if File.exists?(File.join(\"#{HOMEBREW_PREFIX}/Cellar\", \"osgeo-postgis@2.4\"))\n    #     unless File.exists?(\"#{HOMEBREW_PREFIX}/opt/osgeo-postgresql@10/lib/postgresql/postgis-2.4.so\")\n    #       # copy postgis 2.4.x to postgresql 10.x\n    #       FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.4\"].opt_share}/postgresql/.\", \"#{share}/postgresql/\"\n    #       FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.4\"].opt_lib}/postgresql/.\", \"#{lib}/postgresql/\"\n    #       # FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.4\"].opt_lib}/postgresql/rtpostgis-2.4.so\", \"#{lib}/postgresql/\"\n    #       # FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.4\"].opt_lib}/postgresql/postgis-2.4.so\", \"#{lib}/postgresql/\"\n    #       # FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.4\"].opt_lib}/postgresql/postgis_topology-2.4.so\", \"#{lib}/postgresql/\"\n    #     end\n    #   end\n    #\n    #   # if File.exists?(File.join(\"#{HOMEBREW_PREFIX}/Cellar\", \"osgeo-postgis\"))\n    #   #   unless File.exists?(\"#{HOMEBREW_PREFIX}/opt/osgeo-postgresql@10/lib/postgresql/postgis-2.5.so\")\n    #   #     # install postgis 2.5.x to postgresql 10.x\n    #   #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_share}/postgresql/.\", \"#{share}/postgresql/\"\n    #   #     # FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/.\", \"#{lib}/postgresql/\"\n    #   #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/rtpostgis-2.5.so\", \"#{lib}/postgresql/\"\n    #   #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/postgis-2.5.so\", \"#{lib}/postgresql/\"\n    #   #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/postgis_topology-2.5.so\", \"#{lib}/postgresql/\"\n    #   #   end\n    #   # end\n    # end\n  end\n\n  def caveats; <<~EOS\n\n    1 - If you need to link \"#{name}\":\n\n          \\e[32m$ brew link #{name} --force\\e[0m\n\n        Previously unlink any other version that you have installed.\n\n    2 - If you need to init postgresql just execute the following command:\n\n          \\e[32m$ initdb #{HOMEBREW_PREFIX}/var/postgresql@10 -E utf8 --locale=en_US.UTF-8\\e[0m\n\n        If the file \"#{HOMEBREW_PREFIX}/var/postgresql@10/PG_VERSION\" exists,\n        it is because you already created this in postinstall or a previous installation.\n\n    3 - Start using:\n\n          \\e[32m$ pg_ctl start -D /usr/local/var/postgresql@10\\e[0m\n\n    4 - Connecting to our new database\n\n          \\e[32m$ psql -h localhost -d postgres\\e[0m\n\n    Note:\n\n      - Services doesn't start properly, add to \\e[32mhomebrew.mxcl.osgeo-postgresql@10.plist\\e[0m:\n\n          \\e[32m<key>EnvironmentVariables</key>\\e[0m\n          \\e[32m<dict>\\e[0m\n            \\e[32m<key>LC_ALL</key>\\e[0m\n            \\e[32m<string>en_US.UTF-8</string>\\e[0m\n          \\e[32m</dict>\\e[0m\n\n          issue: \\e[32mhttps://github.com/OSGeo/homebrew-osgeo4mac/issues/1075#issuecomment-490052517\\e[0m\n\n      - Could not bind ipv6 address database system was not properly shut:\n\n          \\e[32m$ sudo lsof -i :5432\\e[0m (search PID)\n\n          \\e[32m$ kill PID\\e[0m\n\n      - To migrate existing data from a previous major version of PostgreSQL run:\n\n          \\e[32m$ brew postgresql-upgrade-database\\e[0m\n\n      - For more information see our page with documentation:\n\n          \\e[32mhttps://osgeo.github.io/homebrew-osgeo4mac\\e[0m\n    EOS\n  end\n\n  plist_options :manual => \"pg_ctl -D #{HOMEBREW_PREFIX}/var/postgresql@10 start\"\n\n  def plist; <<~EOS\n    <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n    <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n    <plist version=\"1.0\">\n    <dict>\n      <key>KeepAlive</key>\n      <true/>\n      <key>Label</key>\n      <string>#{plist_name}</string>\n      <key>ProgramArguments</key>\n      <array>\n        <string>#{opt_bin}/postgres</string>\n        <string>-D</string>\n        <string>#{var}/postgresql@10</string>\n      </array>\n      <key>RunAtLoad</key>\n      <true/>\n      <key>WorkingDirectory</key>\n      <string>#{HOMEBREW_PREFIX}</string>\n      <key>StandardOutPath</key>\n      <string>#{var}/log/postgresql@10.log</string>\n      <key>StandardErrorPath</key>\n      <string>#{var}/log/postgresql@10.log</string>\n    </dict>\n    </plist>\n  EOS\n  end\n\n  test do\n    ENV[\"LC_ALL\"]=\"en_US.UTF-8\"\n    ENV[\"LC_CTYPE\"]=\"en_US.UTF-8\"\n    system \"#{bin}/initdb\", testpath/\"test\"\n    if build.with? \"cellar\"\n      assert_equal (share/\"postgresql\").to_s, shell_output(\"#{bin}/pg_config --sharedir\").chomp\n      assert_equal (lib/\"postgresql\").to_s, shell_output(\"#{bin}/pg_config --libdir\").chomp\n      assert_equal (lib/\"postgresql\").to_s, shell_output(\"#{bin}/pg_config --pkglibdir\").chomp\n    else\n      assert_equal \"#{HOMEBREW_PREFIX}/share/postgresql\", shell_output(\"#{bin}/pg_config --sharedir\").chomp\n      assert_equal \"#{HOMEBREW_PREFIX}/lib\", shell_output(\"#{bin}/pg_config --libdir\").chomp\n      assert_equal \"#{HOMEBREW_PREFIX}/lib/postgresql\", shell_output(\"#{bin}/pg_config --pkglibdir\").chomp\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-postgresql@11.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !osgeo_postgresql_linked && !osgeo_postgresql10_linked && !core_postgresql_linked && !core_postgresql11_linked && !core_postgresql10_linked }\n\n  def osgeo_postgresql_linked\n    Formula[\"osgeo-postgresql\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def osgeo_postgresql10_linked\n    Formula[\"osgeo-postgresql@10\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_postgresql_linked\n    Formula[\"postgresql\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_postgresql11_linked\n    Formula[\"postgresql@11\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def core_postgresql10_linked\n    Formula[\"postgresql@10\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink osgeo-postgresql\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies osgeo-postgresql\\e[0m\\n\\n\" if osgeo_postgresql_linked\n    s += \"Unlink with \\e[32mbrew unlink osgeo-postgresql@10\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies osgeo-postgresql@10\\e[0m\\n\\n\" if osgeo_postgresql10_linked\n    s += \"Unlink with \\e[32mbrew unlink postgresql\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies postgresql\\e[0m\\n\\n\" if core_postgresql_linked\n    s += \"Unlink with \\e[32mbrew unlink postgresql@11\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies postgresq@11\\e[0m\\n\\n\" if core_postgresql11_linked\n    s += \"Unlink with \\e[32mbrew unlink postgresql@10\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies postgresq@10\\e[0m\\n\\n\" if core_postgresql10_linked\n    s\n  end\nend\n\nclass OsgeoPostgresqlAT11 < Formula\n  desc \"Object-relational database system\"\n  homepage \"https://www.postgresql.org/\"\n  url \"https://ftp.postgresql.org/pub/source/v11.9/postgresql-11.9.tar.bz2\"\n  sha256 \"35618aa72e0372091f923c42389c6febd07513157b4fbb9408371706afbb6635\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"9746c2b686fc3a568f0c7062e62d517917612991832918eff4062627245701bd\" => :catalina\n    sha256 \"9746c2b686fc3a568f0c7062e62d517917612991832918eff4062627245701bd\" => :mojave\n    sha256 \"9746c2b686fc3a568f0c7062e62d517917612991832918eff4062627245701bd\" => :high_sierra\n  end\n\n  #revision 2\n\n  head \"https://github.com/postgres/postgres.git\", :branch => \"master\"\n\n  option \"with-cellar\", \"Use /Cellar in the path configuration (necessary for migration)\"\n\n  # keg_only \"postgresql is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  #depends_on Unlinked\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"gettext\"\n  depends_on \"icu4c\"\n  depends_on \"openldap\" # libldap\n  depends_on \"openssl\"\n  depends_on \"readline\"\n  depends_on \"tcl-tk\"\n  depends_on \"krb5\"\n  depends_on \"libxml2\"\n  depends_on \"python\"\n  depends_on \"perl\"\n  depends_on \"zlib\"\n  # depends_on \"e2fsprogs\"\n\n  # others: pam\n\n  def install\n    # avoid adding the SDK library directory to the linker search path\n    # XML2_CONFIG=:\n    ENV[\"XML2_CONFIG\"] = \"xml2-config --exec-prefix=/usr\"\n\n    # As of Xcode/CLT 10.x the Perl headers were moved from /System\n    # to inside the SDK, so we need to use `-iwithsysroot` instead\n    # of `-I` to point to the correct location.\n    # https://www.postgresql.org/message-id/153558865647.1483.573481613491501077%40wrigleys.postgresql.org\n    ENV.prepend \"LDFLAGS\", \"-L#{Formula[\"openssl\"].opt_lib} -L#{Formula[\"readline\"].opt_lib} -R#{lib}/postgresql\"\n    ENV.prepend \"CPPFLAGS\", \"-I#{Formula[\"openssl\"].opt_include} -I#{Formula[\"readline\"].opt_include}\"\n\n    # ENV[\"PYTHON\"] = which(\"python3\")\n    ENV[\"PYTHON\"] = \"#{Formula[\"python\"].opt_bin}/python3\"\n\n    args = %W[\n      --disable-debug\n      --enable-thread-safety\n      --with-bonjour\n      --with-gssapi\n      --with-icu\n      --with-ldap\n      --with-libxml\n      --with-libxslt\n      --with-openssl\n      --with-pam\n      --with-perl\n      --with-uuid=e2fs\n      --enable-dtrace\n      --enable-nls\n      --with-python\n    ]\n\n    if build.with? \"cellar\"\n      args += [\n        \"--prefix=#{prefix}\",\n        # \"bindir=#{bin}\", # if define this, will refer to /Cellar\n        \"--datadir=#{share}/postgresql\",\n        \"--libdir=#{lib}/postgresql\",\n        \"--sysconfdir=#{etc}\",\n        \"--docdir=#{doc}/postgresql\",\n        \"--includedir=#{include}/postgresql\"\n      ]\n    else\n      # this is to not have the reference to /Cellar in the files\n      args += [\n        \"--prefix=#{prefix}\",\n        # \"--bindir=#{HOMEBREW_PREFIX}/bin\",\n        \"--sysconfdir=#{HOMEBREW_PREFIX}/etc\",\n        \"--libdir=#{HOMEBREW_PREFIX}/lib\",\n        \"--datadir=#{HOMEBREW_PREFIX}/share/postgresql\",\n        \"--docdir=#{HOMEBREW_PREFIX}/share/doc/postgresql\",\n        \"--localstatedir=#{HOMEBREW_PREFIX}/var\",\n        \"--includedir=#{HOMEBREW_PREFIX}/include\",\n        \"--datarootdir=#{HOMEBREW_PREFIX}/share\",\n        \"--localedir=#{HOMEBREW_PREFIX}/share/locale\",\n        \"--mandir=#{HOMEBREW_PREFIX}/share/man\",\n      ]\n\n      # args << \"--with-system-tzdata=#{HOMEBREW_PREFIX}/share/zoneinfo\" # use system time zone data in DIR\n    end\n\n    dirs = [\n      # \"bindir=#{bin}\",\n      \"datadir=#{share}/postgresql\", # #{pkgshare}\n      \"libdir=#{lib}\",\n      \"pkglibdir=#{lib}/postgresql\", # #{lib}\n      \"pkgincludedir=#{include}/postgresql\",\n      \"sysconfdir=#{etc}\",\n      \"includedir=#{include}\",\n      \"localedir=#{share}/locale\",\n      \"mandir=#{man}\",\n      \"docdir=#{share}/doc/postgresql\",\n    ]\n\n    # The CLT is required to build Tcl support on 10.7 and 10.8 because\n    # tclConfig.sh is not part of the SDK\n    args << \"--with-tcl\"\n    if File.exist?(\"#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework/tclConfig.sh\")\n      args << \"--with-tclconfig=#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework\"\n    end\n\n    # Add include and library directories of dependencies, so that\n    # they can be used for compiling extensions.  Superenv does this\n    # when compiling this package, but won't record it for pg_config.\n    deps = %w[gettext icu4c openldap openssl readline tcl-tk]\n    with_includes = deps.map { |f| Formula[f].opt_include }.join(\":\")\n    with_libraries = deps.map { |f| Formula[f].opt_lib }.join(\":\")\n    args << \"--with-includes=#{with_includes}\"\n    args << \"--with-libraries=#{with_libraries}\"\n\n    ENV[\"XML_CATALOG_FILES\"] = \"#{etc}/xml/catalog\"\n\n    system \"./configure\", *args\n    system \"make\"\n\n    # Temporarily disable building/installing the documentation.\n    # Postgresql seems to \"know\" the build system has been altered and\n    # tries to regenerate the documentation when using `install-world`.\n    # This results in the build failing:\n    #  `ERROR: `osx' is missing on your system.`\n    # Attempting to fix that by adding a dependency on `open-sp` doesn't\n    # work and the build errors out on generating the documentation, so\n    # for now let's simply omit it so we can package Postgresql for Mojave.\n    # if DevelopmentTools.clang_build_version >= 1000\n    system \"make\", \"all\"\n    system \"make\", \"-C\", \"contrib\", \"install\", \"all\", *dirs\n    system \"make\", \"install\", \"all\", *dirs\n    # else\n    #   system \"make\", \"install-world\", *dirs\n    # end\n  end\n\n  def post_install\n    # (var/\"log\").mkpath\n    # (var/\"postgresql\").mkpath\n    # unless File.exist? \"#{var}/postgresql/PG_VERSION\"\n    #   system \"#{bin}/initdb\", \"#{var}/postgresql\"\n    # end\n\n    if build.with? \"cellar\"\n      if File.exists?(File.join(\"#{HOMEBREW_PREFIX}/Cellar\", \"osgeo-postgis@2.5\"))\n        unless File.exists?(\"#{HOMEBREW_PREFIX}/opt/osgeo-postgresql/lib/postgresql/postgis-2.5.so\")\n          # copy postgis 2.5.x to postgresql 11.x\n          FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.5\"].opt_share}/postgresql/.\", \"#{share}/postgresql/\"\n          FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.5\"].opt_lib}/postgresql/.\", \"#{lib}/postgresql/\"\n          # FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.5\"].opt_lib}/postgresql/rtpostgis-2.5.so\", \"#{lib}/postgresql/\"\n          # FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.5\"].opt_lib}/postgresql/postgis-2.5.so\", \"#{lib}/postgresql/\"\n          # FileUtils.cp_r \"#{Formula[\"osgeo-postgis@2.5\"].opt_lib}/postgresql/postgis_topology-2.5.so\", \"#{lib}/postgresql/\"\n        end\n      end\n\n      # if File.exists?(File.join(\"#{HOMEBREW_PREFIX}/Cellar\", \"osgeo-postgis\"))\n      #   unless File.exists?(\"#{HOMEBREW_PREFIX}/opt/osgeo-postgresql/lib/postgresql/postgis-2.5.so\")\n      #     # install postgis 2.5.x to postgresql 11.x\n      #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_share}/postgresql/.\", \"#{share}/postgresql/\"\n      #     # FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/.\", \"#{lib}/postgresql/\"\n      #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/rtpostgis-2.5.so\", \"#{lib}/postgresql/\"\n      #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/postgis-2.5.so\", \"#{lib}/postgresql/\"\n      #     FileUtils.cp_r \"#{Formula[\"osgeo-postgis\"].opt_lib}/postgresql/postgis_topology-2.5.so\", \"#{lib}/postgresql/\"\n      #   end\n      # end\n    end\n  end\n\n  def caveats; <<~EOS\n\n    1 - If you need to link \"#{name}\":\n\n          \\e[32m$ brew link #{name} --force\\e[0m\n\n        Previously unlink any other version that you have installed.\n\n    2 - If you need to init postgresql just execute the following command:\n\n          \\e[32m$ initdb #{HOMEBREW_PREFIX}/var/postgresql -E utf8 --locale=en_US.UTF-8\\e[0m\n\n        If the file \"#{HOMEBREW_PREFIX}/var/postgresql/PG_VERSION\" exists,\n        it is because you already created this in postinstall or a previous installation.\n\n    3 - Start using:\n\n          \\e[32m$ pg_ctl start -D /usr/local/var/postgresql\\e[0m\n\n    4 - Connecting to our new database\n\n          \\e[32m$ psql -h localhost -d postgres\\e[0m\n\n    Note:\n\n      - Services doesn't start properly, add to \\e[32mhomebrew.mxcl.osgeo-postgresql.plist\\e[0m:\n\n          \\e[32m<key>EnvironmentVariables</key>\\e[0m\n          \\e[32m<dict>\\e[0m\n            \\e[32m<key>LC_ALL</key>\\e[0m\n            \\e[32m<string>en_US.UTF-8</string>\\e[0m\n          \\e[32m</dict>\\e[0m\n\n          issue: \\e[32mhttps://github.com/OSGeo/homebrew-osgeo4mac/issues/1075#issuecomment-490052517\\e[0m\n\n      - Could not bind ipv6 address database system was not properly shut:\n\n          \\e[32m$ sudo lsof -i :5432\\e[0m (search PID)\n\n          \\e[32m$ kill PID\\e[0m\n\n      - To migrate existing data from a previous major version of PostgreSQL run:\n\n          \\e[32m$ brew postgresql-upgrade-database\\e[0m\n\n      - For more information see our page with documentation:\n\n          \\e[32mhttps://osgeo.github.io/homebrew-osgeo4mac\\e[0m\n    EOS\n  end\n\n  plist_options :manual => \"pg_ctl -D #{HOMEBREW_PREFIX}/var/postgresql start\"\n\n  def plist; <<~EOS\n    <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n    <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n    <plist version=\"1.0\">\n    <dict>\n      <key>KeepAlive</key>\n      <true/>\n      <key>Label</key>\n      <string>#{plist_name}</string>\n      <key>ProgramArguments</key>\n      <array>\n        <string>#{opt_bin}/postgres</string>\n        <string>-D</string>\n        <string>#{var}/postgresql</string>\n      </array>\n      <key>RunAtLoad</key>\n      <true/>\n      <key>WorkingDirectory</key>\n      <string>#{HOMEBREW_PREFIX}</string>\n      <key>StandardOutPath</key>\n      <string>#{var}/log/postgresql.log</string>\n      <key>StandardErrorPath</key>\n      <string>#{var}/log/postgresql.log</string>\n    </dict>\n    </plist>\n  EOS\n  end\n\n  test do\n    ENV[\"LC_ALL\"]=\"en_US.UTF-8\"\n    ENV[\"LC_CTYPE\"]=\"en_US.UTF-8\"\n    system \"#{bin}/initdb\", testpath/\"test\"\n    if build.with? \"cellar\"\n      assert_equal (share/\"postgresql\").to_s, shell_output(\"#{bin}/pg_config --sharedir\").chomp\n      assert_equal (lib/\"postgresql\").to_s, shell_output(\"#{bin}/pg_config --libdir\").chomp\n      assert_equal (lib/\"postgresql\").to_s, shell_output(\"#{bin}/pg_config --pkglibdir\").chomp\n    else\n      assert_equal \"#{HOMEBREW_PREFIX}/share/postgresql\", shell_output(\"#{bin}/pg_config --sharedir\").chomp\n      assert_equal \"#{HOMEBREW_PREFIX}/lib\", shell_output(\"#{bin}/pg_config --libdir\").chomp\n      assert_equal \"#{HOMEBREW_PREFIX}/lib/postgresql\", shell_output(\"#{bin}/pg_config --pkglibdir\").chomp\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-proj.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_proj_linked }\n\n  def core_proj_linked\n    Formula[\"proj\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink proj\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies proj\\e[0m\\n\\n\" if core_proj_linked\n    s\n  end\nend\n\nclass OsgeoProj < Formula\n  desc \"Cartographic Projections Library\"\n  homepage \"https://proj.org/\"\n  url \"https://github.com/OSGeo/PROJ/releases/download/6.3.2/proj-6.3.2.tar.gz\"\n  sha256 \"cb776a70f40c35579ae4ba04fb4a388c1d1ce025a1df6171350dc19f25b80311\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"729a8816d46c6f3293951bf7f68d6b6e32bb13e4c75f339a29140f44b5ffa2e7\" => :catalina\n    sha256 \"729a8816d46c6f3293951bf7f68d6b6e32bb13e4c75f339a29140f44b5ffa2e7\" => :mojave\n    sha256 \"729a8816d46c6f3293951bf7f68d6b6e32bb13e4c75f339a29140f44b5ffa2e7\" => :high_sierra\n  end\n\n  # revision 1\n\n  # keg_only \"proj is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  head do\n    url \"https://github.com/OSGeo/PROJ.git\", :branch => \"master\"\n    depends_on \"autoconf\" => :build\n    depends_on \"automake\" => :build\n    depends_on \"libtool\" => :build\n  end\n\n  depends_on \"pkg-config\" => :build\n  # depends_on \"libtiff\" Proj >7\n\n  conflicts_with \"blast\", :because => \"both install a `libproj.a` library\"\n\n  skip_clean :la\n\n  # The datum grid files are required to support datum shifting Proj <7\n  # TODO: If needed, include content from https://github.com/OSGeo/PROJ-data\n  #resource \"projdata\" do\n  resource \"datumgrid\" do\n    url \"https://download.osgeo.org/proj/proj-datumgrid-1.8.zip\"\n    sha256 \"b9838ae7e5f27ee732fb0bfed618f85b36e8bb56d7afb287d506338e9f33861e\"\n  end\n\n  def install\n    #(buildpath).install resource(\"projdata\")\n    (buildpath/\"nad\").install resource(\"datumgrid\")\n\n    system \"./autogen.sh\" if build.head?\n    system \"./configure\", \"--disable-dependency-tracking\",\n                          \"--prefix=#{prefix}\"\n    system \"make\", \"install\"\n  end\n\n  test do\n    (testpath/\"test\").write <<~EOS\n      45d15n 71d07w Boston, United States\n      40d40n 73d58w New York, United States\n      48d51n 2d20e Paris, France\n      51d30n 7'w London, England\n    EOS\n    match = <<~EOS\n      -4887590.49\\t7317961.48 Boston, United States\n      -5542524.55\\t6982689.05 New York, United States\n      171224.94\\t5415352.81 Paris, France\n      -8101.66\\t5707500.23 London, England\n    EOS\n\n    output = shell_output(\"#{bin}/proj +proj=poly +ellps=clrk66 -r #{testpath}/test\")\n    assert_equal match, output\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-psqlodbc.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_psqlodbc_linked }\n\n  def core_psqlodbc_linked\n    Formula[\"psqlodbc\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink psqlodbc\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies psqlodbc\\e[0m\\n\\n\" if core_psqlodbc_linked\n    s\n  end\nend\n\nclass OsgeoPsqlodbc < Formula\n  desc \"Official PostgreSQL ODBC driver\"\n  homepage \"https://odbc.postgresql.org\"\n  url \"https://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-12.02.0000.tar.gz\"\n  sha256 \"7b00d99ee729c06cfc784ab43deb7dee77761b667dd62122c2cb0cd7b043ba67\"\n\n  #revision 3\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"a9085711555601a64b30ee356643a2dfbecc7ff9ccd254c477d7977b66e0d365\" => :catalina\n    sha256 \"a9085711555601a64b30ee356643a2dfbecc7ff9ccd254c477d7977b66e0d365\" => :mojave\n    sha256 \"a9085711555601a64b30ee356643a2dfbecc7ff9ccd254c477d7977b66e0d365\" => :high_sierra\n  end\n\n  # revision 1\n\n  head do\n    url \"https://git.postgresql.org/git/psqlodbc.git\"\n    depends_on \"autoconf\" => :build\n    depends_on \"automake\" => :build\n    depends_on \"libtool\" => :build\n  end\n\n  option \"with-pg11\", \"Build with PostgreSQL 11 client\"\n\n  # keg_only \"psqlodbc is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"openssl\"\n  depends_on \"unixodbc\"\n\n  if build.with?(\"pg11\")\n    depends_on \"osgeo-postgresql@11\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  def install\n    system \"./bootstrap\" if build.head?\n    system \"./configure\", \"--prefix=#{prefix}\",\n                          \"--with-unixodbc=#{Formula[\"unixodbc\"].opt_prefix}\"\n    system \"make\"\n    system \"make\", \"install\"\n  end\n\n  test do\n    output = shell_output(\"#{Formula[\"unixodbc\"].bin}/dltest #{lib}/psqlodbcw.so\")\n    assert_equal \"SUCCESS: Loaded #{lib}/psqlodbcw.so\\n\", output\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-pyqt-webkit.rb",
    "content": "class OsgeoPyqtWebkit < Formula\n  desc \"Python bindings for v5 of Qt's Webkit\"\n  homepage \"https://www.riverbankcomputing.com/software/pyqt/intro\"\n  url \"https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.13.2/PyQt5-5.13.2.tar.gz\"\n  sha256 \"adc17c077bf233987b8e43ada87d1e0deca9bd71a13e5fd5fc377482ed69c827\"\n\n  revision 2\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"1e04c2744db39236c0f356fcaf118b9486912e91a348b9040fc1a8d088e7d1e9\" => :catalina\n    sha256 \"1e04c2744db39236c0f356fcaf118b9486912e91a348b9040fc1a8d088e7d1e9\" => :mojave\n    sha256 \"1e04c2744db39236c0f356fcaf118b9486912e91a348b9040fc1a8d088e7d1e9\" => :high_sierra\n  end\n\n  option \"with-debug\", \"Build with debug symbols\"\n\n  keg_only \"PyQt 5 Webkit has CMake issues when linked\"\n  # Error: Failed to fix install linkage\n  # adding -DCMAKE_INSTALL_NAME_DIR=#{lib} and -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON\n  # to the CMake arguments will fix the problem.\n\n  depends_on \"python\"\n  depends_on \"qt\"\n  depends_on \"osgeo-sip\"\n  depends_on \"osgeo-pyqt\"\n  depends_on \"osgeo-qt-webkit\"\n\n  def install\n    # sneak the WebKit modules into the Qt.modules setup before referencing in .pro files\n    wk_mods = Formula[\"osgeo-qt-webkit\"].opt_prefix/\"mkspecs/modules\"\n    inreplace \"configure.py\" do |s|\n      s.sub! /('TEMPLATE = lib'\\])/,\n             \"\\\\1\\n\" + <<-EOS\n    pro_lines.append('include(#{wk_mods}/qt_lib_webkit.pri)')\n    pro_lines.append('include(#{wk_mods}/qt_lib_webkitwidgets.pri)')\n    EOS\n    end\n\n    version = Language::Python.major_minor_version \"python3\"\n    args = [\"--confirm-license\",\n            \"--bindir=#{bin}\",\n            \"--destdir=#{lib}/python#{version}/site-packages\",\n            \"--stubsdir=#{lib}/python#{version}/site-packages/PyQt5\",\n            \"--sipdir=#{share}/sip/PyQt5\",\n            # sip.h could not be found automatically\n            \"--sip-incdir=#{Formula[\"osgeo-sip\"].opt_include}\",\n            \"--qmake=#{Formula[\"qt\"].bin}/qmake\",\n            # Force deployment target to avoid libc++ issues\n            \"QMAKE_MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}\",\n            \"--enable=QtWebKit\",\n            \"--enable=QtWebKitWidgets\",\n            \"--no-designer-plugin\",\n            \"--no-python-dbus\",\n            \"--no-qml-plugin\",\n            \"--no-qsci-api\",\n            \"--no-sip-files\",\n            \"--no-tools\",\n            \"--verbose\",\n            \"--no-dist-info\"\n           ]\n    args << \"--debug\" if build.with? \"debug\"\n\n    system \"python3\", \"configure.py\", *args\n    system \"make\"\n    system \"make\", \"install\"\n    system \"make\", \"clean\"\n\n    # clean out non-WebKit artifacts (already in pyqt5 formula prefix)\n    rm_r prefix/\"share\"\n    cd \"#{lib}/python#{version}/site-packages/PyQt5\" do\n      rm \"__init__.py\"\n      rm \"Qt.so\"\n      rm_r \"uic\"\n    end\n  end\n\n  test do\n    version = Language::Python.major_minor_version \"python3\"\n    ENV[\"PYTHONPATH\"] = lib/\"python#{version}/site-packages\"\n    system \"python3\", \"-c\", '\"import PyQt5.QtWebKit\"'\n    system \"python3\", \"-c\", '\"import PyQt5.QtWebKitWidgets\"'\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-pyspatialite.rb",
    "content": "class OsgeoPyspatialite < Formula\n  desc \"DB-API 2.0 interface for SQLite with Spatialite\"\n  homepage \"https://code.google.com/p/pyspatialite\"\n\n  revision 4\n\n  head \"https://code.google.com/p/pyspatialite/\", :using => :hg\n\n  stable do\n    # temporary download of source, prior to pyspatialite move to github\n    url \"https://osgeo4mac.s3.amazonaws.com/src/pyspatialite-3.0.1.tar.gz\"\n    sha256 \"81a3e4966fb6348802a985486cbf62e019a0fcb0a1e006b9522e8b02dc08f238\"\n    patch do\n      # Patch to work with libspatialite 4.x, drop amalgamation support, dynamically\n      # link libspatialite and sqlite3, and fix redeclaration build error\n      # Reported upstream: http://code.google.com/p/pyspatialite/issues/detail?id=15\n      # (not tested/supported with HEAD builds)\n      url \"https://gist.github.com/dakcarto/7510460/raw/2e56dd217c19d8dd661e4d3ffb2b669f34da580b/pyspatialite-3.0.1-Mac-patch.diff\"\n      sha256 \"8696caaadfc6edf9aa159fe61ed44ce1eac23da2fd68c242148fc2218e6c6901\"\n    end\n  end\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    rebuild 1\n    sha256 \"e092709d45638000fc044d2072230ed80abd586513b90539872e1113cd0da6a5\" => :mojave\n    sha256 \"e092709d45638000fc044d2072230ed80abd586513b90539872e1113cd0da6a5\" => :high_sierra\n    sha256 \"a3139ac50f2e8c5c202cb22a26a74b1a54f188780e2583a00eace33a471e9c7c\" => :sierra\n  end\n\n\n  depends_on \"python@2\"\n  depends_on \"geos\"\n  depends_on \"osgeo-proj\"\n  depends_on \"sqlite\"\n  depends_on \"osgeo-libspatialite\"\n\n  def install\n    # write setup.cfg\n    (buildpath/\"setup.cfg\").write <<~EOS\n      [build_ext]\n      include_dirs=#{HOMEBREW_PREFIX}/include/:#{HOMEBREW_PREFIX}/opt/sqlite/include/\n      library_dirs=#{HOMEBREW_PREFIX}/lib:#{HOMEBREW_PREFIX}/opt/sqlite/lib\n    EOS\n\n    system \"#{Formula[\"python@2\"].opt_bin}/python2\", \"setup.py\", \"build\"\n    system \"#{Formula[\"python@2\"].opt_bin}/python2\", \"setup.py\", \"install\", \"--prefix=#{prefix}\"\n  end\n\n  test do\n    Language::Python.each_python(build) do |python, _version|\n      system python, \"-c\", \"import pyspatialite\"\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-qscintilla2.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_qscintilla2_linked }\n\n  def core_qscintilla2_linked\n    Formula[\"qscintilla2\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink qscintilla2\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies qscintilla2\\e[0m\\n\\n\" if core_qscintilla2_linked\n    s\n  end\nend\n\nclass OsgeoQscintilla2 < Formula\n  desc \"Port to Qt of the Scintilla editing component\"\n  homepage \"https://www.riverbankcomputing.com/software/qscintilla/intro\"\n  url \"https://www.riverbankcomputing.com/static/Downloads/QScintilla/2.11.4/QScintilla-2.11.4.tar.gz\"\n  sha256 \"723f8f1d1686d9fc8f204cd855347e984322dd5cd727891d324d0d7d187bee20\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"106160e70896743c54ccc0ffeb5fd3bbbe986092588e0a5a7f5e500eaf895ff9\" => :catalina\n    sha256 \"106160e70896743c54ccc0ffeb5fd3bbbe986092588e0a5a7f5e500eaf895ff9\" => :mojave\n    sha256 \"106160e70896743c54ccc0ffeb5fd3bbbe986092588e0a5a7f5e500eaf895ff9\" => :high_sierra\n  end\n\n  revision 5\n\n  # keg_only \"qscintilla2 is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"python\"\n  depends_on \"qt\"\n  depends_on \"osgeo-sip\"\n  depends_on \"osgeo-pyqt\"\n\n  def install\n    spec = (ENV.compiler == :clang && MacOS.version >= :mavericks) ? \"macx-clang\" : \"macx-g++\"\n    args = %W[-config release -spec #{spec}]\n\n    cd \"Qt4Qt5\" do\n      inreplace \"qscintilla.pro\" do |s|\n        s.gsub! \"$$[QT_INSTALL_LIBS]\", lib\n        s.gsub! \"$$[QT_INSTALL_HEADERS]\", include\n        s.gsub! \"$$[QT_INSTALL_TRANSLATIONS]\", prefix/\"trans\"\n        s.gsub! \"$$[QT_INSTALL_DATA]\", prefix/\"data\"\n        s.gsub! \"$$[QT_HOST_DATA]\", prefix/\"data\"\n      end\n\n      inreplace \"features/qscintilla2.prf\" do |s|\n        s.gsub! \"$$[QT_INSTALL_LIBS]\", lib\n        s.gsub! \"$$[QT_INSTALL_HEADERS]\", include\n      end\n\n      system \"#{Formula[\"qt\"].bin}/qmake\", \"qscintilla.pro\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    # Add qscintilla2 features search path, since it is not installed in Qt keg's mkspecs/features/\n    ENV[\"QMAKEFEATURES\"] = prefix/\"data/mkspecs/features\"\n\n    cd \"Python\" do\n      (share/\"sip/PyQt5/Qsci\").mkpath\n      version = Language::Python.major_minor_version \"python3\"\n      ENV[\"PYTHONPATH\"] = lib/\"python#{version}/site-packages\"\n\n      system \"python3\", \"configure.py\", \"-o\", lib, \"-n\", include,\n                     \"--apidir=#{prefix}/qsci\",\n                     \"--destdir=#{lib}/python#{version}/site-packages/PyQt5\",\n                     \"--stubsdir=#{lib}/python#{version}/site-packages/PyQt5\",\n                     \"--qsci-sipdir=#{share}/sip/PyQt5\",\n                     \"--qsci-incdir=#{include}\",\n                     \"--qsci-libdir=#{lib}\",\n                     \"--pyqt=PyQt5\",\n                     \"--pyqt-sipdir=#{Formula[\"osgeo-pyqt\"].opt_share}/sip/PyQt5\",\n                     \"--sip-incdir=#{Formula[\"osgeo-sip\"].opt_include}\",\n                     \"--spec=#{spec}\",\n                     \"--no-dist-info\",\n                     \"--verbose\"\n      system \"make\"\n      system \"make\", \"install\"\n      system \"make\", \"clean\"\n    end\n      (share/\"sip/PyQt5/Qsci\").install Dir[\"sip/*.sip\"]\n  end\n\n  test do\n    (testpath/\"test.py\").write <<~EOS\n      import PyQt5.Qsci\n      assert(\"QsciLexer\" in dir(PyQt5.Qsci))\n    EOS\n\n    version = Language::Python.major_minor_version \"python3\"\n    ENV[\"PYTHONPATH\"] = lib/\"python#{version}/site-packages\"\n    system \"python3\", \"test.py\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-qt-mysql.rb",
    "content": "class OsgeoQtMysql < Formula\n  desc \"Qt SQL Database Driver - QMYSQL for MySQL 4 and higher\"\n  homepage \"https://doc.qt.io/qt-5/sql-driver.html\"\n  url \"https://download.qt.io/official_releases/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz\"\n  sha256 \"6f17f488f512b39c2feb57d83a5e0a13dcef32999bea2e2a8f832f54a29badb8\"\n\n  revision 1\n\n  head \"https://code.qt.io/qt/qt5.git\", :branch => \"5.14\", :shallow => false\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"a90441a61949cc849de6119ed35e3ac42151c4ec246519fc944660adcb501208\" => :catalina\n    sha256 \"a90441a61949cc849de6119ed35e3ac42151c4ec246519fc944660adcb501208\" => :mojave\n    sha256 \"a90441a61949cc849de6119ed35e3ac42151c4ec246519fc944660adcb501208\" => :high_sierra\n  end\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"libiconv\"\n  depends_on \"gettext\"\n  depends_on \"libxml2\"\n  depends_on \"libxslt\"\n  depends_on \"zlib\"\n  depends_on \"qt\"\n  depends_on \"sqlite\"\n  depends_on \"openssl\"\n  depends_on \"mysql\"\n  depends_on :xcode => :build\n\n  def install\n    qt_plugins = lib/\"qt/plugins\"\n    (qt_plugins/\"sqldrivers\").mkpath\n\n    chdir \"#{buildpath}/qtbase/src/plugins/sqldrivers\" do\n      system \"#{Formula[\"qt\"].opt_bin}/qmake\", \"--\", \"MYSQL_PREFIX=#{Formula[\"mysql\"].opt_prefix}\"\n      system \"make\"\n\n      # copy libqsqlmysql.dylib\n      # libqsqlite.dylib from qt\n      cp_r \"#{buildpath}/qtbase/src/plugins/sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib\", \"#{lib}/qt/plugins/sqldrivers/\"\n    end\n  end\n\n  def caveats; <<~EOS\n    Plugins generated are linked to the following directory:\n\n      #{HOMEBREW_PREFIX}/lib/qt/plugins/sqldrivers\n  EOS\n  end\n\n  test do\n    (testpath/\"hello.pro\").write <<~EOS\n      QT        += core sql\n      QT        -= gui\n      TARGET     = hello\n      CONFIG    += console\n      CONFIG    -= app_bundle\n      TEMPLATE   = app\n      HEADERS    = client.h\n      SOURCES   += client.cpp main.cpp\n    EOS\n\n    (testpath/\"client.h\").write <<~EOS\n    #ifndef CLIENT_H\n    #define CLIENT_H\n    #include <QObject>\n    #include <QSqlDatabase>\n    #include <QString>\n    class Client : public QObject\n    {\n      Q_OBJECT\n    public:\n      Client(QObject *parent = 0);\n    public slots:\n      void checkSqlDriver();\n    };\n    #endif // CLIENT_H\n    EOS\n\n    (testpath/\"client.cpp\").write <<~EOS\n    #include \"client.h\"\n    #include <QCoreApplication>\n    #include <QDebug>\n    #include <QSqlDatabase>\n    #include <QStringList>\n    Client::Client(QObject *parent)\n      : QObject(parent)\n    {\n    }\n    void Client::checkSqlDriver()\n    {\n      QCoreApplication::addLibraryPath(\"#{HOMEBREW_PREFIX}/lib/qt/plugins\");\n      QCoreApplication::addLibraryPath(\"#{lib}/qt/plugins\");\n      qDebug() << \"QSqlDatabase::drivers(): \" << QSqlDatabase::drivers().join(\" \");\n      QCoreApplication::exit(!QSqlDatabase::isDriverAvailable(\"QMYSQL\"));\n    }\n    EOS\n\n    (testpath/\"main.cpp\").write <<~EOS\n      #include <QCoreApplication>\n      #include <QDebug>\n      #include <QTimer>\n      #include \"client.h\"\n      int main(int argc, char *argv[])\n      {\n        QCoreApplication app(argc, argv);\n        Client c(app.instance());\n        qDebug() << \"Running application\";\n        QTimer::singleShot(1000, &c, SLOT(checkSqlDriver()));\n        return app.exec();\n      }\n    EOS\n\n    cd testpath do\n      system Formula[\"qt\"].bin/\"qmake\", \"hello.pro\"\n      system \"make\"\n      assert_predicate testpath/\"client.o\", :exist?\n      assert_predicate testpath/\"moc_client.o\", :exist?\n      assert_predicate testpath/\"main.o\", :exist?\n      assert_predicate testpath/\"hello\", :exist?\n      system \"./hello\"\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-qt-odbc.rb",
    "content": "class OsgeoQtOdbc < Formula\n  desc \"Qt SQL Database Driver - QODBC for Open Database Connectivity (ODBC)\"\n  homepage \"https://doc.qt.io/qt-5/sql-driver.html\"\n  url \"https://download.qt.io/official_releases/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz\"\n  sha256 \"6f17f488f512b39c2feb57d83a5e0a13dcef32999bea2e2a8f832f54a29badb8\"\n\n  revision 2\n\n  head \"https://code.qt.io/qt/qt5.git\", :branch => \"5.14\", :shallow => false\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"39d3f151cc9a2725ad9616c34589e430f850c9980b0b0d8f8a67a6efd3a1cc91\" => :catalina\n    sha256 \"39d3f151cc9a2725ad9616c34589e430f850c9980b0b0d8f8a67a6efd3a1cc91\" => :mojave\n    sha256 \"39d3f151cc9a2725ad9616c34589e430f850c9980b0b0d8f8a67a6efd3a1cc91\" => :high_sierra\n  end\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"libiconv\"\n  depends_on \"gettext\"\n  depends_on \"libxml2\"\n  depends_on \"libxslt\"\n  depends_on \"zlib\"\n  depends_on \"qt\"\n  depends_on \"sqlite\"\n  depends_on \"openssl\"\n  depends_on \"unixodbc\"\n  depends_on :xcode => :build\n\n  def install\n    qt_plugins = lib/\"qt/plugins\"\n    (qt_plugins/\"sqldrivers\").mkpath\n\n    chdir \"#{buildpath}/qtbase/src/plugins/sqldrivers\" do\n      system \"#{Formula[\"qt\"].opt_bin}/qmake\", \"--\", \"ODBC_PREFIX=#{Formula[\"unixodbc\"].opt_prefix}\"\n      system \"make\"\n\n      # copy libqsqlodbc.dylib\n      # libqsqlite.dylib from qt\n      cp_r \"#{buildpath}/qtbase/src/plugins/sqldrivers/plugins/sqldrivers/libqsqlodbc.dylib\", \"#{lib}/qt/plugins/sqldrivers/\"\n    end\n  end\n\n  def caveats; <<~EOS\n    Plugins generated are linked to the following directory:\n\n      #{HOMEBREW_PREFIX}/lib/qt/plugins/sqldrivers\n\n    EOS\n  end\n\n  test do\n    (testpath/\"hello.pro\").write <<~EOS\n      QT        += core sql\n      QT        -= gui\n      TARGET     = hello\n      CONFIG    += console\n      CONFIG    -= app_bundle\n      TEMPLATE   = app\n      HEADERS    = client.h\n      SOURCES   += client.cpp main.cpp\n    EOS\n\n    (testpath/\"client.h\").write <<~EOS\n    #ifndef CLIENT_H\n    #define CLIENT_H\n    #include <QObject>\n    #include <QSqlDatabase>\n    #include <QString>\n    class Client : public QObject\n    {\n      Q_OBJECT\n    public:\n      Client(QObject *parent = 0);\n    public slots:\n      void checkSqlDriver();\n    };\n    #endif // CLIENT_H\n    EOS\n\n    (testpath/\"client.cpp\").write <<~EOS\n    #include \"client.h\"\n    #include <QCoreApplication>\n    #include <QDebug>\n    #include <QSqlDatabase>\n    #include <QStringList>\n    Client::Client(QObject *parent)\n      : QObject(parent)\n    {\n    }\n    void Client::checkSqlDriver()\n    {\n      QCoreApplication::addLibraryPath(\"#{HOMEBREW_PREFIX}/lib/qt/plugins\");\n      QCoreApplication::addLibraryPath(\"#{lib}/qt/plugins\");\n      qDebug() << \"QSqlDatabase::drivers(): \" << QSqlDatabase::drivers().join(\" \");\n      QCoreApplication::exit(!QSqlDatabase::isDriverAvailable(\"QODBC\"));\n    }\n    EOS\n\n    (testpath/\"main.cpp\").write <<~EOS\n      #include <QCoreApplication>\n      #include <QDebug>\n      #include <QTimer>\n      #include \"client.h\"\n      int main(int argc, char *argv[])\n      {\n        QCoreApplication app(argc, argv);\n        Client c(app.instance());\n        qDebug() << \"Running application\";\n        QTimer::singleShot(1000, &c, SLOT(checkSqlDriver()));\n        return app.exec();\n      }\n    EOS\n\n    cd testpath do\n      system Formula[\"qt\"].bin/\"qmake\", \"hello.pro\"\n      system \"make\"\n      assert_predicate testpath/\"client.o\", :exist?\n      assert_predicate testpath/\"moc_client.o\", :exist?\n      assert_predicate testpath/\"main.o\", :exist?\n      assert_predicate testpath/\"hello\", :exist?\n      system \"./hello\"\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-qt-psql.rb",
    "content": "class OsgeoQtPsql < Formula\n  desc \"Qt SQL Database Driver - QPSQL for PostgreSQL\"\n  homepage \"https://doc.qt.io/qt-5/sql-driver.html\"\n  url \"https://download.qt.io/official_releases/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz\"\n  sha256 \"6f17f488f512b39c2feb57d83a5e0a13dcef32999bea2e2a8f832f54a29badb8\"\n\n  revision 2\n\n  head \"https://code.qt.io/qt/qt5.git\", :branch => \"5.14\", :shallow => false\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"fe8d91af1ea799a6f1ff983f0b6f1d920b2a3342951f867fb1f23b8deb80c8fe\" => :catalina\n    sha256 \"fe8d91af1ea799a6f1ff983f0b6f1d920b2a3342951f867fb1f23b8deb80c8fe\" => :mojave\n    sha256 \"fe8d91af1ea799a6f1ff983f0b6f1d920b2a3342951f867fb1f23b8deb80c8fe\" => :high_sierra\n  end\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"libiconv\"\n  depends_on \"gettext\"\n  depends_on \"libxml2\"\n  depends_on \"libxslt\"\n  depends_on \"zlib\"\n  depends_on \"qt\"\n  depends_on \"sqlite\"\n  depends_on \"openssl\"\n  depends_on \"libpq\"\n  depends_on \"osgeo-postgresql\"\n  depends_on :xcode => :build\n\n  def install\n    qt_plugins = lib/\"qt/plugins\"\n    (qt_plugins/\"sqldrivers\").mkpath\n\n    chdir \"#{buildpath}/qtbase/src/plugins/sqldrivers\" do\n      system \"#{Formula[\"qt\"].opt_bin}/qmake\", \"--\", \"PSQL_INCDIR=#{Formula[\"postgresql\"].opt_include}\"\n      system \"make\"\n\n      # copy libqsqlpsql.dylib\n      # libqsqlite.dylib from qt\n      cp_r \"#{buildpath}/qtbase/src/plugins/sqldrivers/plugins/sqldrivers/libqsqlpsql.dylib\", \"#{lib}/qt/plugins/sqldrivers/\"\n    end\n  end\n\n  def caveats; <<~EOS\n    Plugins generated are linked to the following directory:\n\n      #{HOMEBREW_PREFIX}/lib/qt/plugins/sqldrivers\n\n    EOS\n  end\n\n  test do\n    (testpath/\"hello.pro\").write <<~EOS\n      QT        += core sql\n      QT        -= gui\n      TARGET     = hello\n      CONFIG    += console\n      CONFIG    -= app_bundle\n      TEMPLATE   = app\n      HEADERS    = client.h\n      SOURCES   += client.cpp main.cpp\n    EOS\n\n    (testpath/\"client.h\").write <<~EOS\n    #ifndef CLIENT_H\n    #define CLIENT_H\n    #include <QObject>\n    #include <QSqlDatabase>\n    #include <QString>\n    class Client : public QObject\n    {\n      Q_OBJECT\n    public:\n      Client(QObject *parent = 0);\n    public slots:\n      void checkSqlDriver();\n    };\n    #endif // CLIENT_H\n    EOS\n\n    (testpath/\"client.cpp\").write <<~EOS\n    #include \"client.h\"\n    #include <QCoreApplication>\n    #include <QDebug>\n    #include <QSqlDatabase>\n    #include <QStringList>\n    Client::Client(QObject *parent)\n      : QObject(parent)\n    {\n    }\n    void Client::checkSqlDriver()\n    {\n      QCoreApplication::addLibraryPath(\"#{HOMEBREW_PREFIX}/lib/qt/plugins\");\n      QCoreApplication::addLibraryPath(\"#{lib}/qt/plugins\");\n      qDebug() << \"QSqlDatabase::drivers(): \" << QSqlDatabase::drivers().join(\" \");\n      QCoreApplication::exit(!QSqlDatabase::isDriverAvailable(\"QPSQL\"));\n    }\n    EOS\n\n    (testpath/\"main.cpp\").write <<~EOS\n      #include <QCoreApplication>\n      #include <QDebug>\n      #include <QTimer>\n      #include \"client.h\"\n      int main(int argc, char *argv[])\n      {\n        QCoreApplication app(argc, argv);\n        Client c(app.instance());\n        qDebug() << \"Running application\";\n        QTimer::singleShot(1000, &c, SLOT(checkSqlDriver()));\n        return app.exec();\n      }\n    EOS\n\n    cd testpath do\n      system Formula[\"qt\"].bin/\"qmake\", \"hello.pro\"\n      system \"make\"\n      assert_predicate testpath/\"client.o\", :exist?\n      assert_predicate testpath/\"moc_client.o\", :exist?\n      assert_predicate testpath/\"main.o\", :exist?\n      assert_predicate testpath/\"hello\", :exist?\n      system \"./hello\"\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-qt-webkit.rb",
    "content": "class OsgeoQtWebkit < Formula\n  desc \"Classes for a WebKit2 based implementation and a new QML API\"\n  homepage \"https://www.qt.io/developers\"\n  url \"https://github.com/qt/qtwebkit/archive/ab1bd15209abaf7effc51dbc2f272c5681af7223.tar.gz\"\n  sha256 \"0128e09a9623a62ffe93c395294f571306f2d318797cf4e69d812cca6e42ec90\"\n  version \"5.14.1\"\n\n  revision 3\n\n  # from the developer: \"https://github.com/annulen/webkit.git\"\n  head \"https://github.com/qt/qtwebkit.git\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"72b7e4c0f9740a19b9c296ddf690dff0be1e89d96051084e3036466f8e768673\" => :catalina\n    sha256 \"72b7e4c0f9740a19b9c296ddf690dff0be1e89d96051084e3036466f8e768673\" => :mojave\n    sha256 \"72b7e4c0f9740a19b9c296ddf690dff0be1e89d96051084e3036466f8e768673\" => :high_sierra\n  end\n\n  # insert the XPC_NOESCAPE macro in the right places in xpc_array_apply and xpc_dictionary_apply\n  # to match the definitions now used in the 10.14 SDK\n  # patch :DATA\n\n  depends_on \"cmake\" => :build\n  depends_on \"ninja\" => [:build, :recommended]\n  depends_on \"fontconfig\" => :build\n  depends_on \"freetype\" => :build\n  depends_on \"gperf\" => :build\n  depends_on \"sqlite\" => :build\n  depends_on \"bison\" => :build\n  depends_on \"pkg-config\" => :build\n\n  depends_on \"python\" => :build\n  depends_on \"ruby\" => :build\n  depends_on \"perl\" => :build\n  depends_on :xcode => :build\n\n  depends_on \"gcc\" => :build # features.h\n\n  depends_on \"libxslt\"\n  depends_on \"qt\"\n  depends_on \"webp\"\n  depends_on \"zlib\"\n\n  # depends_on \"gst-plugins-base\"\n  # depends_on \"libjpeg\" # Qt < 5.10\n  depends_on \"libjpeg-turbo\"\n  depends_on \"libpng\"\n  depends_on \"libxslt\"\n  depends_on \"gst-plugins-good\" => :optional\n\n  def cmake_args\n    args = %W[\n      -DCMAKE_INSTALL_PREFIX=#{prefix}\n      -DCMAKE_BUILD_TYPE=Release\n      -DCMAKE_FIND_FRAMEWORK=LAST\n      -DCMAKE_VERBOSE_MAKEFILE=ON\n      -Wno-dev\n    ]\n    args\n  end\n\n  def install\n    args = cmake_args\n    args << \"-DPORT=Qt\"\n    args << \"-DENABLE_TOOLS=OFF\"\n    args << \"-DCMAKE_MACOSX_RPATH=OFF\"\n    args << \"-DEGPF_SET_RPATH=OFF\"\n    args << \"-DCMAKE_SKIP_RPATH=ON\"\n    args << \"-DCMAKE_SKIP_INSTALL_RPATH=ON\"\n\n    # Fuck off rpath\n    # inreplace \"Source/cmake/OptionsQt.cmake\",\n    #           \"set(CMAKE_MACOSX_RPATH\\ ON)\",\n    #           \"\"\n    mkdir \"build\" do\n      system \"cmake\", \"-G\", build.with?(\"ninja\") ? \"Ninja\" : \"Unix Makefiles\", *args, \"..\"\n      system \"cmake\", \"--build\", \".\", \"--target\", \"all\", \"--\", \"-j\", Hardware::CPU.cores\n      system \"cmake\", \"--build\", \".\", \"--target\", \"install\", \"--\", \"-j\", Hardware::CPU.cores\n    end\n\n    # rename the .so files\n    mv \"#{lib}/qml/QtWebKit/libqmlwebkitplugin.so\", \"#{lib}/qml/QtWebKit/libqmlwebkitplugin.dylib\"\n    mv \"#{lib}/qml/QtWebKit/experimental/libqmlwebkitexperimentalplugin.so\", \"#{lib}/qml/QtWebKit/experimental/libqmlwebkitexperimentalplugin.dylib\"\n\n    ln_s \"#{lib}/qml\", \"#{prefix}/qml\"\n    ln_s \"#{lib}/libexec\", \"#{prefix}/libexec\"\n\n    # some config scripts will only find Qt in a \"Frameworks\" folder\n    frameworks.install_symlink Dir[\"#{lib}/*.framework\"]\n\n    # the pkg-config files installed suggest that headers can be found in the\n    # `include` directory. Make this so by creating symlinks from `include` to\n    # the Frameworks' Headers folders\n    Pathname.glob(\"#{lib}/*.framework/Headers\") do |path|\n      include.install_symlink path => path.parent.basename(\".framework\")\n    end\n\n    # for some reason it is not generating the .pc files, that's why they are created\n    # although these are not necessary\n    mkdir \"#{lib}/pkgconfig\" do\n      # create Qt5WebKit.pc\n      File.open(\"#{lib}/pkgconfig/Qt5WebKit.pc\", \"w\") { |file|\n        file << \"Name: Qt5WebKit\\n\"\n        file << \"Description: Qt WebKit module\\n\"\n        file << \"Version: #{version}\\n\"\n        # file << \"Libs: -F#{lib} -framework QtWebKit\"\n        file << \"Libs: -L#{lib} -lQt5WebKit\\n\"\n        # file << \"Cflags: -DQT_WEBKIT_LIB -I#{include}/QtWebKit\\n\"\n        file << \"Cflags: -I#{include}/QtWebKit\\n\"\n        file << \"Requires: Qt5Core Qt5Gui Qt5Network\"\n      }\n      # create QtWebKitWidgets.pc\n      File.open(\"#{lib}/pkgconfig/Qt5WebKitWidgets.pc\", \"w\") { |file|\n        file << \"Name: Qt5WebKitWidgets\\n\"\n        file << \"Description: Qt WebKitWidgets module\\n\"\n        file << \"Version: #{version}\\n\"\n        # file << \"Libs: -F#{lib} -framework QtWebKitWidgets\"\n        file << \"Libs: -L#{lib} -lQt5WebKitWidgets\\n\"\n        # file << \"Cflags: -DQT_WEBKITWIDGETS_LIB -I#{include}/QtWebKitWidgets\\n\"\n        file << \"Cflags: -I#{include}/QtWebKitWidgets\\n\"\n        file << \"Requires:\"\n      }\n    end\n\n    # fix rpath values\n    MachO::Tools.change_install_name(\"#{lib}/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets\",\n                                    \"@rpath/QtWebKit.framework/Versions/5/QtWebKit\",\n                                    \"#{lib}/QtWebKit.framework/Versions/5/QtWebKit\")\n    MachO::Tools.change_install_name(\"#{prefix}/qml/QtWebKit/libqmlwebkitplugin.dylib\",\n                                    \"@rpath/QtWebKit.framework/Versions/5/QtWebKit\",\n                                    \"#{lib}/QtWebKit.framework/Versions/5/QtWebKit\")\n    MachO::Tools.change_install_name(\"#{prefix}/qml/QtWebKit/experimental/libqmlwebkitexperimentalplugin.dylib\",\n                                    \"@rpath/QtWebKit.framework/Versions/5/QtWebKit\",\n                                    \"#{lib}/QtWebKit.framework/Versions/5/QtWebKit\")\n    MachO::Tools.change_install_name(\"#{libexec}/QtWebProcess\",\n                                     \"@rpath/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets\",\n                                     \"#{lib}/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets\")\n    MachO::Tools.change_install_name(\"#{libexec}/QtWebProcess\",\n                                    \"@rpath/QtWebKit.framework/Versions/5/QtWebKit\",\n                                    \"#{lib}/QtWebKit.framework/Versions/5/QtWebKit\")\n  end\n\n  # Failed to connect to localhost port 80: Connection refused\n  test do\n    # (testpath/\"hello.pro\").write <<~EOS\n    #   QT        += core webkitwidgets\n    #   QT        -= gui\n    #   TARGET     = hello\n    #   CONFIG    += console\n    #   CONFIG    -= app_bundle\n    #   TEMPLATE   = app\n    #   HEADERS    = client.h\n    #   SOURCES   += client.cpp main.cpp\n    #   include(#{prefix}/mkspecs/modules/qt_lib_webkit.pri)\n    #   include(#{prefix}/mkspecs/modules/qt_lib_webkitwidgets.pri)\n    # EOS\n    #\n    # (testpath/\"client.h\").write <<~EOS\n    # #ifndef CLIENT_H\n    # #define CLIENT_H\n    # #include <QWebPage>\n    # #include <QString>\n    #\n    # class Client : public QObject\n    # {\n    #   Q_OBJECT\n    #\n    # public:\n    #   Client(const QString &url, QObject *parent = 0);\n    #\n    # private Q_SLOTS:\n    #   void loadUrl();\n    #   void output(bool ok);\n    #\n    # private:\n    #   QWebPage page;\n    #   QString url;\n    #\n    # };\n    # #endif // CLIENT_H\n    # EOS\n    #\n    # (testpath/\"client.cpp\").write <<~EOS\n    # #include \"client.h\"\n    # #include <QCoreApplication>\n    # #include <QDebug>\n    # #include <QWebFrame>\n    # #include <QUrl>\n    #\n    # Client::Client(const QString &myurl, QObject *parent)\n    #   : QObject(parent)\n    #   , url(myurl)\n    # {\n    # }\n    #\n    # void Client::loadUrl()\n    # {\n    #   page.mainFrame()->load(QUrl(url));\n    #   connect(&page, SIGNAL(loadFinished(bool)), this, SLOT(output(bool)));\n    # }\n    #\n    # void Client::output(bool ok)\n    # {\n    #   if (ok){\n    #     qDebug() << \"Page title: \" << page.mainFrame()->title();\n    #     QCoreApplication::exit(0);\n    #   } else {\n    #     qDebug() << \"Error loading \" << url;\n    #     QCoreApplication::exit(1);\n    #   }\n    # }\n    # EOS\n    #\n    # (testpath/\"main.cpp\").write <<~EOS\n    #   #include <QApplication>\n    #   #include <QDebug>\n    #   #include <QTimer>\n    #   #include <QWebView>\n    #   #include \"client.h\"\n    #\n    #   int main(int argc, char *argv[])\n    #   {\n    #     QApplication app(argc, argv);\n    #     Client c(\"file://#{testpath}/test.html\", app.instance());\n    #     qDebug() << \"Running application\";\n    #     QTimer::singleShot(1000, &c, SLOT(loadUrl()));\n    #     return app.exec();\n    #   }\n    # EOS\n    #\n    # (testpath/\"test.html\").write <<~EOS\n    #   <!DOCTYPE html>\n    #   <html lang=\"en\">\n    #   <head><meta charset=\"utf-8\" /><title>My title</title></head>\n    #   <body>Body content</body>\n    #   </html>\n    # EOS\n    #\n    # cd testpath do\n    #   system Formula[\"qt5\"].bin/\"qmake\", \"hello.pro\"\n    #   system \"make\"\n    #   assert_predicate testpath/\"client.o\", :exist?\n    #   assert_predicate testpath/\"moc_client.o\", :exist?\n    #   assert_predicate testpath/\"main.o\", :exist?\n    #   assert_predicate testpath/\"hello\", :exist?\n    #\n    #   # test that we can actually serve the page\n    #   pid = fork do\n    #     exec testpath/\"hello\"\n    #   end\n    #   sleep 2\n    #   begin\n    #     assert_match \"<html><body><h1>It works!</h1></body></html>\\n\", shell_output(\"curl http://localhost:80\")\n    #   ensure\n    #     Process.kill(\"SIGINT\", pid)\n    #     Process.wait(pid)\n    #   end\n    # end\n  end\n  # could be used:\n  # (testpath/\"CMakeLists.txt\").write(\"find_package(Qt5 CONFIG COMPONENTS WebKit WebKitWidgets REQUIRED)\")\n  # system \"cmake\", \".\", \"-Wno-dev\"\nend\n\n__END__\n\n--- a/Source/cmake/WebKitCommon.cmake\n+++ b/Source/cmake/WebKitCommon.cmake\n@@ -24,9 +24,9 @@\n     # TODO Enforce version requirement for perl\n     find_package(Perl 5.10.0 REQUIRED)\n\n-    find_package(PythonInterp 2.7.0 REQUIRED)\n-    if (PYTHON_VERSION_MAJOR GREATER 2)\n-        message(FATAL_ERROR \"Python 2 is required, but Python ${PYTHON_VERSION_MAJOR} was found.\")\n+    find_package(PythonInterp 3.7.6 REQUIRED)\n+    if (PYTHON_VERSION_MAJOR GREATER 3)\n+        message(FATAL_ERROR \"Python 3 is required, but Python ${PYTHON_VERSION_MAJOR} was found.\")\n     endif ()\n\n     # We cannot check for RUBY_FOUND because it is set only when the full package is installed and\n\n\n# --- a/Source/WTF/wtf/spi/darwin/XPCSPI.h 2017-06-17 13:46:54.000000000 +0300\n# +++ b/Source/WTF/wtf/spi/darwin/XPCSPI.h 2018-09-08 23:41:06.397523110 +0300\n# @@ -89,10 +89,6 @@\n#  EXTERN_C const struct _xpc_type_s _xpc_type_string;\n#\n#  EXTERN_C xpc_object_t xpc_array_create(const xpc_object_t*, size_t count);\n# -#if COMPILER_SUPPORTS(BLOCKS)\n# -EXTERN_C bool xpc_array_apply(xpc_object_t, xpc_array_applier_t);\n# -EXTERN_C bool xpc_dictionary_apply(xpc_object_t xdict, xpc_dictionary_applier_t applier);\n# -#endif\n#  EXTERN_C size_t xpc_array_get_count(xpc_object_t);\n#  EXTERN_C const char* xpc_array_get_string(xpc_object_t, size_t index);\n#  EXTERN_C void xpc_array_set_string(xpc_object_t, size_t index, const char* string);\n"
  },
  {
    "path": "Formula/osgeo-qtkeychain.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_qtkeychain_linked }\n\n  def core_qtkeychain_linked\n    Formula[\"qtkeychain\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink qtkeychain\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies qtkeychain\\e[0m\\n\\n\" if core_qtkeychain_linked\n    s\n  end\nend\n\nclass OsgeoQtkeychain < Formula\n  desc \"Platform-independent Qt-based API for storing passwords securely\"\n  homepage \"https://github.com/frankosterfeld/qtkeychain\"\n  url \"https://github.com/frankosterfeld/qtkeychain/archive/v0.10.0.tar.gz\"\n  sha256 \"5f916cd97843de550467db32d2e10f218b904af5b21cfdfcc7c6425d7dfc3ec2\"\n\n  # revision 1\n\n  head \"https://github.com/frankosterfeld/qtkeychain.git\", :using => :git\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"a9261f3ce89b4e46e1cc52415d54b993fc2716cc7ed4fd713bb57d2f78596659\" => :catalina\n    sha256 \"a9261f3ce89b4e46e1cc52415d54b993fc2716cc7ed4fd713bb57d2f78596659\" => :mojave\n    sha256 \"a9261f3ce89b4e46e1cc52415d54b993fc2716cc7ed4fd713bb57d2f78596659\" => :high_sierra\n  end\n\n  option \"with-static\", \"Build static in addition to shared library\"\n  option \"with-translations\", \"Generate Qt translation (.ts) files\"\n\n  # keg_only \"qtkeychain is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"cmake\" => :build\n  depends_on \"qt\"\n\n  def lib_name\n    \"libqt5keychain\"\n  end\n\n  def install\n    args = std_cmake_args\n    args << \"-DQTKEYCHAIN_STATIC=OFF\"\n    args << \"-DBUILD_WITH_QT4=OFF\"\n    args << \"-DBUILD_TRANSLATIONS=#{build.with?(\"translations\") ? \"ON\" : \"OFF\"}\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\", \"install\"\n      (libexec/\"bin\").install \"testclient\"\n      so_ver = 1\n      lib_name_ver = \"#{lib_name}.#{so_ver}\"\n      MachO::Tools.change_install_name(\"#{libexec}/bin/testclient\",\n                                       \"@rpath/#{lib_name_ver}.dylib\",\n                                       \"#{opt_lib}/#{lib_name_ver}.dylib\")\n\n      if build.with? \"static\"\n        args << \"-DQTKEYCHAIN_STATIC=ON\"\n        system \"cmake\", \"..\", *args\n        system \"make\"\n        mv \"#{lib_name}.a\", lib/\"#{lib_name}_static.a\"\n      end\n    end\n  end\n\n  def caveats\n    if build.with? \"static\"\n      <<~EOS\n        Static library is available at:\n          #{opt_lib}/#{lib_name}_static.a\n      EOS\n    end\n  end\n\n  test do\n    assert_match \"Password deleted successfully\",\n                 shell_output(libexec/\"bin/testclient delete something-particular\")\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-saga-lts.rb",
    "content": "class OsgeoSagaLts < Formula\n  desc \"System for Automated Geoscientific Analyses - Long Term Support\"\n  homepage \"http://saga-gis.org\"\n  url \"https://downloads.sourceforge.net/project/saga-gis/SAGA%20-%207/SAGA%20-%207.3.0/saga-7.3.0.tar.gz\"\n  sha256 \"f3c0f805bd48c3afbad56a35b6b0aa40e8e92799ed0ef0d682aea275fa36fbbc\"\n\n  # QGIS & PROJ 6 & SAGA\n  # https://lists.osgeo.org/pipermail/qgis-developer/2019-December/059512.html\n  # https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py\n  # REQUIRED_VERSION = '2.3.'\n  # BETA_SUPPORT_VERSION = '7.3.'\n\n  revision 1\n\n  head \"https://git.code.sf.net/p/saga-gis/code.git\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"260038069d9185a8cfe5f5eafd4d496e9064cde276123eaf11b2508aadd2863c\" => :catalina\n    sha256 \"260038069d9185a8cfe5f5eafd4d496e9064cde276123eaf11b2508aadd2863c\" => :mojave\n    sha256 \"260038069d9185a8cfe5f5eafd4d496e9064cde276123eaf11b2508aadd2863c\" => :high_sierra\n  end\n\n  keg_only \"This version is specifically to work with QGIS\"\n\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n  option \"with-app\", \"Build SAGA.app Package\"\n\n  depends_on \"automake\" => :build\n  depends_on \"autoconf\" => :build\n  depends_on \"libtool\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"python\"\n  depends_on \"wxmac\"\n  depends_on \"wxpython\"\n  depends_on \"geos\"\n  depends_on \"jasper\"\n  depends_on \"fftw\"\n  depends_on \"libtiff\"\n  depends_on \"swig\"\n  depends_on \"xz\" # lzma\n  depends_on \"giflib\"\n  depends_on \"opencv@2\"\n  depends_on \"unixodbc\"\n  depends_on \"libharu\"\n  depends_on \"qhull\" # instead of looking for triangle\n  depends_on \"poppler\"\n  depends_on \"sqlite\"\n  depends_on \"hdf5\"\n  depends_on \"osgeo-hdf4\"\n  depends_on \"osgeo-proj\"\n  depends_on \"osgeo-netcdf\"\n  depends_on \"osgeo-laszip@2\"\n  depends_on \"osgeo-gdal\" # (gdal-curl, gdal-filegdb, gdal-hdf4)\n  depends_on \"osgeo-liblas\"\n\n  # Vigra support builds, but dylib in saga shows 'failed' when loaded\n  # Also, using --with-python will trigger vigra to be built with it, which\n  # triggers a source (re)build of boost --with-python\n  depends_on \"osgeo-vigra\" => :optional\n\n  if build.with?(\"pg10\")\n    depends_on \"osgeo-postgresql@10\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  resource \"app_icon\" do\n    url \"https://osgeo4mac.s3.amazonaws.com/src/saga_gui.icns\"\n    sha256 \"288e589d31158b8ffb9ef76fdaa8e62dd894cf4ca76feabbae24a8e7015e321f\"\n  end\n\n  def install\n    ENV.cxx11\n\n    # SKIP liblas support until SAGA supports > 1.8.1, which should support GDAL 2;\n    #      otherwise, SAGA binaries may lead to multiple GDAL versions being loaded\n    # See: https://github.com/libLAS/libLAS/issues/106\n    #      Update: https://github.com/libLAS/libLAS/issues/106\n\n    # https://sourceforge.net/p/saga-gis/wiki/Compiling%20SAGA%20on%20Mac%20OS%20X/\n    # configure FEATURES CXX=\"CXX\" CPPFLAGS=\"DEFINES GDAL_H $PROJ_H\" LDFLAGS=\"GDAL_SRCH PROJ_SRCH LINK_MISC\"\n\n    # cppflags : wx-config --version=3.0 --cppflags\n    # defines : -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__\n    cppflags = \"-I#{HOMEBREW_PREFIX}/lib/wx/include/osx_cocoa-unicode-3.0 -I#{HOMEBREW_PREFIX}/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__\"\n\n    # libs : wx-config --version=3.0 --libs\n    ldflags = \"-L#{HOMEBREW_PREFIX}/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_xrc-3.0 -lwx_osx_cocoau_html-3.0 -lwx_osx_cocoau_qa-3.0 -lwx_osx_cocoau_adv-3.0 -lwx_osx_cocoau_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0\" # -lwx_osx_cocoau_webview-3.0 \n\n    # xcode : xcrun --show-sdk-path\n    link_misc = \"-arch x86_64 -mmacosx-version-min=10.9 -isysroot #{MacOS::Xcode.prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX#{MacOS.version}.sdk -lstdc++\"\n\n    ENV.append \"CPPFLAGS\", \"-I#{Formula[\"osgeo-proj\"].opt_include} -I#{Formula[\"osgeo-gdal\"].opt_include} #{cppflags}\"\n    ENV.append \"LDFLAGS\", \"-L#{Formula[\"osgeo-proj\"].opt_lib}/libproj.dylib -L#{Formula[\"osgeo-gdal\"].opt_lib}/libgdal.dylib #{link_misc} #{ldflags}\"\n\n    # Disable narrowing warnings when compiling in C++11 mode.\n    ENV.append \"CXXFLAGS\", \"-Wno-c++11-narrowing -std=c++11\"\n\n    ENV.append \"PYTHON_VERSION\", \"3.7\"\n    ENV.append \"PYTHON\", \"#{Formula[\"python\"].opt_bin}/python3\"\n\n    # support for PROJ 6\n    # ENV.append_to_cflags \"-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H\"\n    # saga lts does not support proj 6\n    # https://github.com/OSGeo/proj.4/wiki/proj.h-adoption-status\n    # https://sourceforge.net/p/saga-gis/bugs/271/\n\n    # cd \"saga-gis\"\n\n    # fix homebrew-specific header location for qhull\n    inreplace \"src/tools/grid/grid_gridding/nn/delaunay.c\", \"qhull/\", \"libqhull/\" # if build.with? \"qhull\"\n\n    # libfire and triangle are for non-commercial use only, skip them\n    args = %W[\n      --prefix=#{prefix}\n      --disable-dependency-tracking\n      --disable-openmp\n      --disable-libfire\n      --enable-shared\n      --enable-debug\n      --disable-gui\n    ]\n    \n    #--enable-gui\n    # --enable-unicode\n\n    args << \"--disable-odbc\" if build.without? \"unixodbc\"\n    args << \"--disable-triangle\" # if build.with? \"qhull\"\n\n    args << \"--enable-python\" # if build.with? \"python\"\n\n    if build.with?(\"pg10\")\n      args << \"--with-postgresql=#{Formula[\"osgeo-postgresql@10\"].opt_bin}/pg_config\"\n    else\n      args << \"--with-postgresql=#{Formula[\"osgeo-postgresql\"].opt_bin}/pg_config\" # if build.with? \"postgresql\"\n    end\n\n    system \"autoreconf\", \"-i\"\n    system \"./configure\", *args\n    system \"make\", \"install\"\n\n    if build.with? \"app\"\n      (prefix/\"SAGA.app/Contents/PkgInfo\").write \"APPLSAGA\"\n      (prefix/\"SAGA.app/Contents/Resources\").install resource(\"app_icon\")\n\n      config = <<~EOS\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n        <plist version=\"1.0\">\n        <dict>\n          <key>CFBundleDevelopmentRegion</key>\n          <string>English</string>\n          <key>CFBundleExecutable</key>\n          <string>saga_gui</string>\n          <key>CFBundleIconFile</key>\n          <string>saga_gui.icns</string>\n          <key>CFBundleInfoDictionaryVersion</key>\n          <string>6.0</string>\n          <key>CFBundleName</key>\n          <string>SAGA</string>\n          <key>CFBundlePackageType</key>\n          <string>APPL</string>\n          <key>CFBundleSignature</key>\n          <string>SAGA</string>\n          <key>CFBundleVersion</key>\n          <string>1.0</string>\n          <key>CSResourcesFileMapped</key>\n          <true/>\n          <key>NSHighResolutionCapable</key>\n          <string>True</string>\n        </dict>\n        </plist>\n      EOS\n\n      (prefix/\"SAGA.app/Contents/Info.plist\").write config\n\n      chdir \"#{prefix}/SAGA.app/Contents\" do\n        mkdir \"MacOS\" do\n          ln_s \"#{bin}/saga_gui\", \"saga_gui\"\n        end\n      end\n    end\n  end\n\n  def caveats\n    if build.with? \"app\"\n      <<~EOS\n      SAGA.app was installed in:\n        #{prefix}\n\n      You may also symlink QGIS.app into /Applications or ~/Applications:\n        ln -Fs `find $(brew --prefix) -name \"SAGA.app\"` /Applications/SAGA.app\n\n      Note that the SAGA GUI does not work very well yet.\n      It has problems with creating a preferences file in the correct location and sometimes won't shut down (use Activity Monitor to force quit if necessary).\n      EOS\n    end\n  end\n\n  test do\n    output = `#{bin}/saga_cmd --help`\n    assert_match /The SAGA command line interpreter/, output\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-saga.rb",
    "content": "class OsgeoSaga < Formula\n  desc \"System for Automated Geoscientific Analyses - Long Term Support\"\n  homepage \"http://saga-gis.org\"\n  url \"https://downloads.sourceforge.net/project/saga-gis/SAGA%20-%207/SAGA%20-%207.7.0/saga-7.7.0.tar.gz\"\n  sha256 \"f327cf8502cb4850e921985b8c3d6aa97adb7c1c612b7b935657547619cdbbda\"\n  \n  # QGIS & PROJ 6 & SAGA\n  # https://lists.osgeo.org/pipermail/qgis-developer/2019-December/059512.html\n  # https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py\n  # REQUIRED_VERSION = '2.3.'\n  # BETA_SUPPORT_VERSION = '7.3.'\n\n  #revision 2\n\n  head \"https://git.code.sf.net/p/saga-gis/code.git\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"11e96aa538e00ace2a776418bea09cbabba808172487d08664b7bd0a036359b0\" => :catalina\n    sha256 \"11e96aa538e00ace2a776418bea09cbabba808172487d08664b7bd0a036359b0\" => :mojave\n    sha256 \"11e96aa538e00ace2a776418bea09cbabba808172487d08664b7bd0a036359b0\" => :high_sierra\n  end\n\n  keg_only \"QGIS fails to load the correct SAGA version, if the latest version is in the path\"\n\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n  option \"with-app\", \"Build SAGA.app Package\"\n\n  depends_on \"automake\" => :build\n  depends_on \"autoconf\" => :build\n  depends_on \"libtool\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"python@3.8\"\n  depends_on \"wxmac\"\n  depends_on \"wxpython\"\n  depends_on \"geos\"\n  depends_on \"jasper\"\n  depends_on \"fftw\"\n  depends_on \"libtiff\"\n  depends_on \"swig\"\n  depends_on \"xz\" # lzma\n  depends_on \"giflib\"\n  depends_on \"opencv@2\"\n  depends_on \"unixodbc\"\n  depends_on \"libharu\"\n  depends_on \"qhull\" # instead of looking for triangle\n  depends_on \"poppler\"\n  depends_on \"sqlite\"\n  depends_on \"hdf5\"\n  depends_on \"osgeo-hdf4\"\n  depends_on \"osgeo-proj\"\n  depends_on \"osgeo-netcdf\"\n  depends_on \"osgeo-gdal\" # (gdal-curl, gdal-filegdb, gdal-hdf4)\n  # TODO OpenMP support\n  depends_on \"libomp\" \n  \n  # SKIP liblas support until SAGA supports > 1.8.1, which should support GDAL 2;\n  #      otherwise, SAGA binaries may lead to multiple GDAL versions being loaded\n  # See: https://github.com/libLAS/libLAS/issues/106\n  #      Update: https://github.com/libLAS/libLAS/issues/106\n  #depends_on \"osgeo-laszip@2\"\n  #depends_on \"osgeo-liblas\"\n\n  # Vigra support builds, but dylib in saga shows 'failed' when loaded\n  # Also, using --with-python will trigger vigra to be built with it, which\n  # triggers a source (re)build of boost --with-python\n  depends_on \"osgeo-vigra\" => :optional\n\n  if build.with?(\"pg11\")\n    depends_on \"osgeo-postgresql@11\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  resource \"app_icon\" do\n    url \"https://osgeo4mac.s3.amazonaws.com/src/saga_gui.icns\"\n    sha256 \"288e589d31158b8ffb9ef76fdaa8e62dd894cf4ca76feabbae24a8e7015e321f\"\n  end\n\n  def install\n    ENV.cxx11\n\n\n    # https://sourceforge.net/p/saga-gis/wiki/Compiling%20SAGA%20on%20Mac%20OS%20X/\n    # configure FEATURES CXX=\"CXX\" CPPFLAGS=\"DEFINES GDAL_H $PROJ_H\" LDFLAGS=\"GDAL_SRCH PROJ_SRCH LINK_MISC\"\n\n    # cppflags : wx-config --version=3.0 --cppflags\n    # defines : -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__\n    cppflags = \"-I#{HOMEBREW_PREFIX}/lib/wx/include/osx_cocoa-unicode-3.0 -I#{HOMEBREW_PREFIX}/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__\"\n\n    # libs : wx-config --version=3.0 --libs\n    ldflags = \"-L#{HOMEBREW_PREFIX}/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau_xrc-3.0 -lwx_osx_cocoau_html-3.0 -lwx_osx_cocoau_qa-3.0 -lwx_osx_cocoau_adv-3.0 -lwx_osx_cocoau_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0\" # -lwx_osx_cocoau_webview-3.0\n\n    # xcode : xcrun --show-sdk-path\n    link_misc = \"-arch x86_64 -mmacosx-version-min=10.9 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lstdc++\"\n\n    ENV.append \"CPPFLAGS\", \"-I#{Formula[\"osgeo-proj\"].opt_include} -I#{Formula[\"osgeo-gdal\"].opt_include} #{cppflags}\"\n    ENV.append \"LDFLAGS\", \"-L#{Formula[\"osgeo-proj\"].opt_lib}/libproj.dylib -L#{Formula[\"osgeo-gdal\"].opt_lib}/libgdal.dylib #{link_misc} #{ldflags}\"\n\n    # Disable narrowing warnings when compiling in C++11 mode.\n    ENV.append \"CXXFLAGS\", \"-Wno-c++11-narrowing -std=c++11\"\n\n    ENV.append \"PYTHON_VERSION\", \"3.8\"\n    ENV.append \"PYTHON\", \"#{Formula[\"python@3.8\"].opt_bin}/python3\"\n\n    # support for PROJ 6\n    # ENV.append_to_cflags \"-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H\"\n    # saga lts does not support proj 6\n    # https://github.com/OSGeo/proj.4/wiki/proj.h-adoption-status\n    # https://sourceforge.net/p/saga-gis/bugs/271/\n\n    # cd \"saga-gis\"\n\n    # fix homebrew-specific header location for qhull\n    inreplace \"src/tools/grid/grid_gridding/nn/delaunay.c\", \"qhull/\", \"libqhull/\" # if build.with? \"qhull\"\n\n    # libfire and triangle are for non-commercial use only, skip them\n    args = %W[\n      --prefix=#{prefix}\n      --disable-dependency-tracking\n      --disable-libfire\n      --enable-shared\n      --enable-debug\n      --disable-gui \n    ]\n    #--disable-openmp\n    #--enable-gui\n    # --enable-unicode\n\n    args << \"--disable-odbc\" if build.without? \"unixodbc\"\n    args << \"--disable-triangle\" # if build.with? \"qhull\"\n\n    args << \"--enable-python\" # if build.with? \"python\"\n\n    if build.with?(\"pg11\")\n      args << \"--with-postgresql=#{Formula[\"osgeo-postgresql@11\"].opt_bin}/pg_config\"\n    else\n      args << \"--with-postgresql=#{Formula[\"osgeo-postgresql\"].opt_bin}/pg_config\" # if build.with? \"postgresql\"\n    end\n\n    system \"autoreconf\", \"-i\"\n    system \"./configure\", *args\n    system \"make\", \"install\"\n\n    if build.with? \"app\"\n      (prefix/\"SAGA.app/Contents/PkgInfo\").write \"APPLSAGA\"\n      (prefix/\"SAGA.app/Contents/Resources\").install resource(\"app_icon\")\n\n      config = <<~EOS\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n        <plist version=\"1.0\">\n        <dict>\n          <key>CFBundleDevelopmentRegion</key>\n          <string>English</string>\n          <key>CFBundleExecutable</key>\n          <string>saga_gui</string>\n          <key>CFBundleIconFile</key>\n          <string>saga_gui.icns</string>\n          <key>CFBundleInfoDictionaryVersion</key>\n          <string>6.0</string>\n          <key>CFBundleName</key>\n          <string>SAGA</string>\n          <key>CFBundlePackageType</key>\n          <string>APPL</string>\n          <key>CFBundleSignature</key>\n          <string>SAGA</string>\n          <key>CFBundleVersion</key>\n          <string>1.0</string>\n          <key>CSResourcesFileMapped</key>\n          <true/>\n          <key>NSHighResolutionCapable</key>\n          <string>True</string>\n        </dict>\n        </plist>\n      EOS\n\n      (prefix/\"SAGA.app/Contents/Info.plist\").write config\n\n      chdir \"#{prefix}/SAGA.app/Contents\" do\n        mkdir \"MacOS\" do\n          ln_s \"#{bin}/saga_gui\", \"saga_gui\"\n        end\n      end\n    end\n  end\n\n  def caveats\n    if build.with? \"app\"\n      <<~EOS\n      SAGA.app was installed in:\n        #{prefix}\n\n      You may also symlink QGIS.app into /Applications or ~/Applications:\n        ln -Fs `find $(brew --prefix) -name \"SAGA.app\"` /Applications/SAGA.app\n\n      Note that the SAGA GUI does not work very well yet.\n      It has problems with creating a preferences file in the correct location and sometimes won't shut down (use Activity Monitor to force quit if necessary).\n      EOS\n    end\n  end\n\n  test do\n    output = `#{bin}/saga_cmd --help`\n    assert_match /The SAGA command line interpreter/, output\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-shark.rb",
    "content": "class OsgeoShark < Formula\n  desc \"Machine leaning library\"\n  homepage \"http://image.diku.dk/shark/\"\n  url \"https://github.com/Shark-ML/Shark/archive/v4.0.1.tar.gz\"\n  sha256 \"1caf9c73c5ebf54f9543a090e2b05ac646f95559aa1de483cd7662c378c1ec21\"\n\n  revision 1\n\n  head \"https://github.com/Shark-ML/Shark.git\", :branch => \"master\"\n\n  bottle :disable, \"needs to be rebuilt with latest boost\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"boost\"\n\n  def install\n    system \"cmake\", \".\", *std_cmake_args\n    system \"make\", \"install\"\n  end\n\n  test do\n    system bin/\"SharkVersion\"\n    (testpath/\"test.cpp\").write <<~EOS\n      #include <shark/Core/Shark.h>\n      #include <iostream>\n\n      int main( int argc, char ** argv )\n      {\n      \tshark::Shark::info( std::cout );\n      }\n    EOS\n\n    system ENV.cxx, \"test.cpp\", \"-o\", \"test\", \"-L#{lib}\", \"-lshark\",\n           \"-L#{Formula[\"boost\"].lib}\", \"-lboost_serialization\",\n           \"-I#{Formula[\"boost\"].include}\"\n    system \"./test\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-simple-tiles.rb",
    "content": "class OsgeoSimpleTiles < Formula\n  desc \"Image generation library for spatial data\"\n  homepage \"https://propublica.github.io/simple-tiles\"\n  url \"https://github.com/propublica/simple-tiles/archive/v0.6.1.tar.gz\"\n  sha256 \"2391b2f727855de28adfea9fc95d8c7cbaca63c5b86c7286990d8cbbcd640d6f\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    rebuild 1\n    sha256 \"fec2a26451465b4e4d895e2ef383b20240af7f6956d57b5ea70fd7fcf059d47e\" => :mojave\n    sha256 \"fec2a26451465b4e4d895e2ef383b20240af7f6956d57b5ea70fd7fcf059d47e\" => :high_sierra\n    sha256 \"e1d77cc94e155ce5067b5f84d3b5dc781b3f5014eab0a5d18ce77681cbb9ecaa\" => :sierra\n  end\n\n  revision 2\n\n  head \"https://github.com/propublica/simple-tiles.git\", :branch => \"master\"\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"cairo\"\n  depends_on \"pango\"\n  depends_on \"osgeo-gdal\"\n\n  def install\n    system \"./configure\", \"--prefix=#{prefix}\"\n    system \"make\", \"install\"\n  end\n\n  test do\n    (testpath/\"test.c\").write <<~EOS\n      #include <simple-tiles/simple_tiles.h>\n\n      int main(){\n        simplet_map_t *map = simplet_map_new();\n        simplet_map_free(map);\n        return 0;\n      }\n    EOS\n    system ENV.cc, \"-I#{include}\", \"-L#{lib}\", \"-lsimple-tiles\",\n           \"-I#{Formula[\"cairo\"].opt_include}/cairo\",\n           \"-I#{Formula[\"osgeo-gdal\"].opt_include}\",\n           \"-I#{Formula[\"glib\"].opt_include}/glib-2.0\",\n           \"-I#{Formula[\"glib\"].opt_lib}/glib-2.0/include\",\n           \"-I#{Formula[\"pango\"].opt_include}/pango-1.0\",\n           \"test.c\", \"-o\", \"test\"\n    system testpath/\"test\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-six.rb",
    "content": "class OsgeoSix < Formula\n  desc \"Python 2 and 3 compatibility utilities\"\n  homepage \"https://pypi.python.org/pypi/six\"\n  url \"https://github.com/benjaminp/six/archive/1.15.0.tar.gz\"\n  sha256 \"36252a752837b72f60def78bc408a05c21d22fe00a34a7dc3409d96b2c6e20c8\"\n\n  #revision 3\n\n  head \"https://github.com/benjaminp/six.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any_skip_relocation\n    sha256 \"84f5bd6a34d8563f07531b51f13cd0783d5bfc337866d47980552daf35441122\" => :catalina\n    sha256 \"84f5bd6a34d8563f07531b51f13cd0783d5bfc337866d47980552daf35441122\" => :mojave\n    sha256 \"84f5bd6a34d8563f07531b51f13cd0783d5bfc337866d47980552daf35441122\" => :high_sierra\n  end\n\n  depends_on \"python\"\n  depends_on \"tcl-tk\"\n\n  resource \"setuptools\" do\n    url \"https://files.pythonhosted.org/packages/42/3e/2464120172859e5d103e5500315fb5555b1e908c0dacc73d80d35a9480ca/setuptools-45.1.0.zip\"\n    sha256 \"91f72d83602a6e5e4a9e4fe296e27185854038d7cbda49dcd7006c4d3b3b89d5\"\n  end\n\n  resource \"pytest\" do\n    url \"https://files.pythonhosted.org/packages/f0/5f/41376614e41f7cdee02d22d1aec1ea028301b4c6c4523a5f7ef8e960fe0b/pytest-5.3.5.tar.gz\"\n    sha256 \"0d5fe9189a148acc3c3eb2ac8e1ac0742cb7618c084f3d228baaec0c254b318d\"\n  end\n\n  def install\n    xy = Language::Python.major_minor_version \"python3\"\n    ENV.prepend_create_path \"PYTHONPATH\", \"#{libexec}/lib/python#{xy}/site-packages\"\n\n    resource(\"setuptools\").stage do\n      system \"python3\", \"setup.py\", \"install\", \"--prefix=#{libexec}\", \"--single-version-externally-managed\", \"--record=installed.txt\"\n    end\n\n    resource(\"pytest\").stage do\n      system \"python3\", \"setup.py\", \"install\", \"--prefix=#{libexec}\", \"--single-version-externally-managed\", \"--record=installed.txt\"\n    end\n\n    ENV.prepend_create_path \"PYTHONPATH\", \"#{lib}/python#{xy}/site-packages\"\n    system \"python3\", \"setup.py\", \"install\", \"--prefix=#{prefix}\", \"--single-version-externally-managed\", \"--record=installed.txt\", \"--optimize=1\"\n\n    bin.env_script_all_files(libexec/\"bin\", :PYTHONPATH => ENV[\"PYTHONPATH\"])\n  end\n\n  test do\n    # TODO\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-taudem.rb",
    "content": "class OsgeoTaudem < Formula\n  desc \"Terrain Analysis Using Digital Elevation Models for hydrology\"\n  homepage \"http://hydrology.usu.edu/taudem/taudem5/\"\n  url \"https://github.com/dtarb/TauDEM/archive/bf9417172225a9ce2462f11138c72c569c253a1a.tar.gz\"\n  sha256 \"2adffb82f6c9cdda42c2373f551aefb4d52f444005df961675eaf08f6edcbccc\"\n  version \"5.3.8\"\n\n  revision 2\n\n  head \"https://github.com/dtarb/TauDEM.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"4e5d5df235413e6f3b02c1112eda3a95b5200c7e1eae640f9df0ed50db62765e\" => :mojave\n    sha256 \"4e5d5df235413e6f3b02c1112eda3a95b5200c7e1eae640f9df0ed50db62765e\" => :high_sierra\n    sha256 \"a425c679506c2f16bc90f274b96fce85973ef826d2f7b926798255ff6f65d9f3\" => :sierra\n  end\n\n  depends_on \"cmake\" => :build\n  depends_on \"open-mpi\"\n  depends_on \"osgeo-gdal\"\n\n  resource \"logan\" do\n    url \"http://hydrology.usu.edu/taudem/taudem5/LoganDemo.zip\"\n    sha256 \"3340f75a30d3043e7ad09b7a7324fa71374811b22fa913ad577840499a7dab83\"\n    version \"5.3.5\"\n  end\n\n  def install\n    ENV.cxx11\n    args = std_cmake_args\n    cd \"src\" do\n      system \"cmake\", \".\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    mkdir \"#{bin}\"\n    bin.install_symlink Dir[\"#{prefix}/taudem/*\"]\n  end\n\n  test do\n    resource(\"logan\").stage do\n      system \"#{opt_prefix}/bin/pitremove\", \"logan.tif\"\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-vigra.rb",
    "content": "class OsgeoVigra < Formula\n  include Language::Python::Virtualenv\n  desc \"Image processing and analysis library\"\n  homepage \"https://ukoethe.github.io/vigra/\"\n  url \"https://github.com/ukoethe/vigra/releases/download/Version-1-11-1/vigra-1.11.1-src.tar.gz\"\n  sha256 \"a5564e1083f6af6a885431c1ee718bad77d11f117198b277557f8558fa461aaf\"\n\n  revision 2\n\n  head \"https://github.com/ukoethe/vigra.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    rebuild 1\n    sha256 \"3b864be9be725491b2db6cdad5c94fc130536c1bdc32d67d827b35d670e27cc3\" => :mojave\n    sha256 \"3b864be9be725491b2db6cdad5c94fc130536c1bdc32d67d827b35d670e27cc3\" => :high_sierra\n    sha256 \"ecd4a73b3e8f366c69014890e0ced53a6e8fc446dbd1bc6f91c666beebdf36d7\" => :sierra\n  end\n\n  option \"without-test\", \"skip tests\"\n  option \"with-python3\", \"Build with Python 3 (for Saga GIS no LTS)\"\n\n  deprecated_option \"without-check\" => \"without-test\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"boost\" => :build\n  depends_on \"jpeg\"\n  depends_on \"libpng\"\n  depends_on \"libtiff\"\n  depends_on \"numpy\"\n  depends_on \"hdf5\" => :recommended\n  depends_on \"fftw\" => :recommended\n  depends_on \"openexr\" # => :optional\n\n  if build.with? \"python3\"\n    depends_on \"python\"\n  else\n    depends_on \"python@2\" # => :optional\n  end\n\n  patch do\n    url \"https://git.archlinux.org/svntogit/community.git/plain/trunk/fix-incorrect-template-parameter-type.patch?h=packages/vigra\"\n    sha256 \"f151f902483dfa2b1f3d431f54bb161300cf184158c9f416fa653d19ab363cc4\"\n  end\n\n  patch do\n    url \"https://git.archlinux.org/svntogit/community.git/plain/trunk/py3.7.diff?h=packages/vigra\"\n    sha256 \"8fcdcce50c377be44387cbd4a001dadf5e03b32483de55c05a359c887e95a05b\"\n  end\n\n  resource \"numpy\" do\n    url \"https://files.pythonhosted.org/packages/93/48/956b9dcdddfcedb1705839280e02cbfeb2861ed5d7f59241210530867d5b/numpy-1.16.3.zip\"\n    sha256 \"78a6f89da87eeb48014ec652a65c4ffde370c036d780a995edaeb121d3625621\"\n  end\n\n  resource \"nose\" do\n    url \"https://files.pythonhosted.org/packages/58/a5/0dc93c3ec33f4e281849523a5a913fa1eea9a3068acfa754d44d88107a44/nose-1.3.7.tar.gz\"\n    sha256 \"f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98\"\n  end\n\n  # vigra python bindings requires boost-python\n  # see https://packages.ubuntu.com/saucy/python-vigra\n  depends_on \"boost-python\" => \"c++11\" # if build.with? \"python\"\n\n  def install\n    ENV.cxx11\n    ENV.append \"CXXFLAGS\", \"-ftemplate-depth=512\"\n\n    # if build.with? \"python\"\n    venv = virtualenv_create(libexec)\n    venv.pip_install resources\n    # end\n\n    cmake_args = std_cmake_args\n    cmake_args << \"-DWITH_VIGRANUMPY=0\" if build.without? :python\n    cmake_args << \"-DWITH_HDF5=0\" if build.without? \"hdf5\"\n    cmake_args << \"-DWITH_OPENEXR=1\" # if build.with? \"openexr\"\n    # cmake_args << \"-DVIGRANUMPY_INSTALL_DIR=#{lib}/python2.7/site-packages\" # if build.with? :python # not used by the project\n\n    if build.with? \"python3\"\n      cmake_args << \"-DPYTHON_EXECUTABLE=#{Formula[\"python\"].opt_bin}/python3\"\n    else\n      cmake_args << \"-DPYTHON_EXECUTABLE=#{Formula[\"python@2\"].opt_bin}/python2\" # if build.with? :python\n    end\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *cmake_args\n      system \"make\"\n      system \"make\", \"check\" if build.with? \"test\"\n      system \"make\", \"install\"\n    end\n  end\n\n  def caveats\n    s = \"\"\n    libtiff = Formula[\"libtiff\"]\n    libtiff_cxx11 = Tab.for_formula(libtiff).cxx11?\n    if (build.cxx11? && !libtiff_cxx11) || (libtiff_cxx11 && !build.cxx11?)\n      s += <<~EOS\n      The Homebrew warning about libtiff not being built with the C++11\n      standard may be safely ignored as Vigra only relies on C API of libtiff.\n      EOS\n    end\n    s\n  end\n\n  test do\n    system bin/\"vigra-config\", \"--version\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-vtk.rb",
    "content": "class OsgeoVtk < Formula\n  # include Language::Python::Virtualenv\n  desc \"Toolkit for 3D computer graphics, image processing, and visualization\"\n  homepage \"https://www.vtk.org/\"\n  url \"https://www.vtk.org/files/release/8.2/VTK-8.2.0.tar.gz\"\n  sha256 \"34c3dc775261be5e45a8049155f7228b6bd668106c72a3c435d95730d17d57bb\"\n  # url \"https://gitlab.kitware.com/vtk/vtk/-/archive/81221c6aa9076d4d22d388cfa07a46bc13e0cfc7/vtk-81221c6aa9076d4d22d388cfa07a46bc13e0cfc7.tar.gz\"\n  # sha256 \"badeaada5bd2ef93c010dd17445280d032505aad6eb45a5ec423aa1030fe9801\"\n  # version \"8.2.0\"\n\n  revision 16\n\n  head \"https://github.com/Kitware/VTK.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"3f74f585a3250d6308703072c0c008d6c2405b8bb318845b29cfd65efb36610d\" => :catalina\n    sha256 \"3f74f585a3250d6308703072c0c008d6c2405b8bb318845b29cfd65efb36610d\" => :mojave\n    sha256 \"3f74f585a3250d6308703072c0c008d6c2405b8bb318845b29cfd65efb36610d\" => :high_sierra\n  end\n\n  # resource \"FindPEGTL\" do\n  #   url \"https://src.fedoraproject.org/rpms/vtk/raw/master/f/FindPEGTL.cmake\"\n  #   sha256 \"0183debe3b115c8504edb2bf73b1eb4dc7127a864dce077d12c56a0b0ccf1b8a\"\n  # end\n\n  # Fix compile issues on Mojave and later\n    # Files:\n            # Infovis/BoostGraphAlgorithms/vtkBoostGraphAdapter.h\n  # Error: ‘my_bool’ was not declared in this scope;\n    # https://bugs.gentoo.org/692674\n    # Files:\n            # IO/MySQL/vtkMySQLDatabase.cxx\n            # IO/MySQL/vtkMySQLQuery.cxx\n  # Add libogg to IOMovie target link libraries\n    # Files:\n            # IO/Movie/CMakeLists.txt\n  # Allow-compilation-on-GLES-platforms\n    # On GLES 2.0 platforms (more specifically, for Qt5 \"opengl es2\" builds),\n    # QOpenGLFunctions_3_2_Core does not exist. Since Qt 5.7,\n    # QOpenGlFramebufferObject has a static wrapper method for framebuffer blitting, which in worst case is a noop.\n    # Files:\n            # GUISupport/Qt/QVTKOpenGLNativeWidget.cxx\n  # Make code calling proj4 compatible with proj4 5.0 and later\n    # GeoVis incompatible with external libproj4 6.0\n    # https://gitlab.kitware.com/vtk/vtk/issues/17554\n    # https://github.com/OSGeo/proj.4/wiki/proj.h-adoption-status\n    # - projects.h is no longer available in 6.0\n    # - use of proj_api.h has to be opted in since 6.0, to be removed in 7.0\n    # - pj_get_list_ref has been renamed proj_list_operations in 5.0\n    # - PJProps is opaque now, its contents can be accessed with proj_pj_info.\n    #   As the contents are no longer global, the const char* from\n    #   GetProjectionName has to be copied into the vtkGeoProjection object.\n    # Files:\n            # Geovis/Core/vtkGeoProjection.cxx\n            # Geovis/Core/vtkGeoTransform.cxx\n            # ThirdParty/libproj/vtk_libproj.h.in\n  # Bundled exodusii add missing libpthread\n  # Files:\n          # ThirdParty/exodusII/vtkexodusII/CMakeLists.txt\n  # Bundled libharu add missing libm\n    # Files:\n            # ThirdParty/libharu/vtklibharu/src/CMakeLists.txt\n  # Alt build - FindNetCDF - Wrapping/PythonCor\n    # Files:\n            # CMake/FindNetCDF.cmake\n            # Wrapping/PythonCore/CMakeLists.txt\n  # Fix compilation issue due to Python3.7 API change\n    # The PyUnicode_AsUTF8() method returns a \"const char *\" in Py37\n    # Files:\n            # Wrapping/PythonCore/vtkPythonArgs.cxx\n  # Wrap\n    # Files:\n            # /Wrapping/Tools/CMakeLists.txt\n  # Others compile\n    # Files:\n            # Wrapping/Java/CMakeLists.txt\n  # nohtmldoc\n    # Files:\n            # Utilities/Doxygen/CMakeLists.txt\n  # Compatibility for Python 3.8\n    # The PyTypeObject struct was modified in Python 3.8, this change is required to avoid compile errors.\n    # Files:\n            # PythonInterpreter/vtkPythonStdStreamCaptureHelper.h\n            # Wrapping/PythonCore/PyVTKMethodDescriptor.cxx\n            # Wrapping/PythonCore/PyVTKNamespace.cxx\n            # Wrapping/PythonCore/PyVTKReference.cxx\n            # Wrapping/PythonCore/PyVTKTemplate.cxx\n            # Wrapping/PythonCore/vtkPythonCompatibility.h\n            # Wrapping/Tools/vtkWrapPythonClass.c\n            # Wrapping/Tools/vtkWrapPythonEnum.c\n            # Wrapping/Tools/vtkWrapPythonType.c\n  # GDAL\n    # Files:\n            # IO/GDAL/vtkGDALVectorReader.cxx\n  # pthreads declaration\n    # Files:\n            # ThirdParty/libxml2/vtklibxml2/threads.c\n  patch :DATA\n\n  option \"with-pg11\", \"Build with PostgreSQL 11 client\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"boost\"\n  depends_on \"fontconfig\"\n  depends_on \"hdf5\"\n  depends_on \"jpeg\"\n  depends_on \"jpeg-turbo\"\n  depends_on \"libpng\"\n  depends_on \"libtiff\"\n  depends_on \"python\"\n  depends_on \"qt\"\n  depends_on \"osgeo-netcdf\"\n  \n  depends_on \"gcc\"\n  depends_on \"double-conversion\"\n  depends_on \"doxygen\"\n  depends_on \"ffmpeg\"\n  depends_on \"gnuplot\"\n\n  depends_on \"tcl-tk\"\n  depends_on \"unixodbc\"\n  depends_on \"wget\"\n  depends_on \"eigen\"\n  depends_on \"expat\"\n  depends_on \"freetype\"\n  depends_on \"glew\"\n  depends_on \"jsoncpp\"\n  depends_on \"libxml2\"\n  depends_on \"lz4\"\n  depends_on \"xz\"\n  depends_on \"libogg\"\n  depends_on \"pegtl\"\n  depends_on \"pugixml\"\n  depends_on \"ffmpeg2theora\"\n  depends_on \"zlib\"\n  depends_on \"sqlite\"\n  depends_on \"graphviz\"\n  depends_on \"osgeo-proj\"\n\n  depends_on \"osgeo-gdal\"\n  #depends_on \"osgeo-pyqt\"\n  depends_on \"pyqt\"\n  depends_on \"osgeo-qt-webkit\"\n  depends_on \"osgeo-matplotlib\"\n\n  # JAVA_VERSION = \"1.8\" # \"1.10+\"\n  depends_on \"openjdk\" => :build # JAVA_VERSION\n\n  depends_on \"gl2ps\"\n  depends_on \"libharu\"\n  # depends_on \"mysql\"\n  depends_on \"mysql-client\"\n  depends_on \"openslide\"\n  depends_on \"tbb\"\n  depends_on \"inetutils\"\n\n  if build.with?(\"pg11\")\n    depends_on \"osgeo-postgresql@11\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  depends_on \"open-mpi\"\n  # depends_on \"osgeo-mpi4py\"\n\n  def install\n    # Warning: python modules have explicit framework links\n    # These python extension modules were linked directly to a Python\n    # framework binary. They should be linked with -undefined dynamic_lookup\n    # instead of -lpython or -framework Python\n    # ENV[\"PYTHON_LIBS\"] = \"-undefined dynamic_lookup\"\n    # PYTHON_LDFLAGS=-undefined dynamic_lookup\n    # PYTHON_EXTRA_LIBS=-undefined dynamic_lookup\n    # PYTHON_EXTRA_LDFLAGS=-undefined dynamic_lookup\n\n    python_executable = `which python3`.strip\n    python_prefix = `#{python_executable} -c 'import sys;print(sys.prefix)'`.chomp\n    python_include = `#{python_executable} -c 'from distutils import sysconfig;print(sysconfig.get_python_inc(True))'`.chomp\n    python_version = \"python\" + `#{python_executable} -c 'import sys;print(sys.version[:3])'`.chomp\n    py_site_packages = \"#{lib}/#{python_version}/site-packages\"\n\n    # # install python environment\n    # venv = virtualenv_create(libexec/'vendor', \"#{Formula[\"python\"].opt_bin}/python3\")\n    #\n    # res_required = ['setuptools', 'mpi4py']\n    #\n    # res_required.each do |r|\n    #     venv.pip_install r\n    # end\n\n    # support for PROJ 6\n    # ENV.append_to_cflags \"-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H\"\n\n    # Fix build with Java 12\n    # sed -i 's/VTK_JAVA_SOURCE_VERSION \"1.6\"/VTK_JAVA_SOURCE_VERSION \"1.7\"/\n    #        s/VTK_JAVA_TARGET_VERSION \"1.6\"/VTK_JAVA_TARGET_VERSION \"1.7\"/' Wrapping/Java/CMakeLists.txt\n    inreplace \"Wrapping/Java/CMakeLists.txt\",\n              'VTK_JAVA_SOURCE_VERSION \"1.6\"', 'VTK_JAVA_SOURCE_VERSION \"1.7\"'\n    inreplace \"Wrapping/Java/CMakeLists.txt\",\n              'VTK_JAVA_TARGET_VERSION \"1.6\"', 'VTK_JAVA_TARGET_VERSION \"1.7\"'\n\n    cmd = Language::Java.java_home_cmd(\"1.8\") # JAVA_VERSION\n    ENV[\"JAVA_HOME\"] = Utils.popen_read(cmd).chomp\n    # export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)\n\n    args = std_cmake_args + %W[\n      -DBUILD_SHARED_LIBS=ON\n      -DBUILD_TESTING=OFF\n      -DCMAKE_INSTALL_NAME_DIR:STRING=#{lib}\n      -DCMAKE_INSTALL_RPATH:STRING=#{lib}\n      -DModule_vtkInfovisBoost=ON\n      -DModule_vtkInfovisBoostGraphAlgorithms=ON\n      -DModule_vtkRenderingFreeTypeFontConfig=ON\n      -DVTK_REQUIRED_OBJCXX_FLAGS=''\n      -DVTK_USE_COCOA=ON\n      -DVTK_USE_SYSTEM_EXPAT=ON\n      -DVTK_USE_SYSTEM_HDF5=ON\n      -DVTK_USE_SYSTEM_JPEG=ON\n      -DVTK_USE_SYSTEM_LIBXML2=ON\n      -DVTK_USE_SYSTEM_NETCDF=ON\n      -DVTK_USE_SYSTEM_PNG=ON\n      -DVTK_USE_SYSTEM_TIFF=ON\n      -DVTK_USE_SYSTEM_ZLIB=ON\n      -DVTK_WRAP_PYTHON=ON\n      -DVTK_PYTHON_VERSION=3\n      -DPYTHON_EXECUTABLE=#{python_executable}\n      -DPYTHON_INCLUDE_DIR=#{python_include}\n      -DVTK_PYTHON_SITE_PACKAGES_SUFFIX=#{py_site_packages}\n      -DVTK_INSTALL_PYTHON_MODULE_DIR=#{lib}/#{python_version}/site-packages\n      -DVTK_QT_VERSION=5\n      -DVTK_Group_Qt=ON\n      -DVTK_WRAP_PYTHON_SIP=ON\n      -DSIP_PYQT_DIR=#{HOMEBREW_PREFIX}/share/sip/PyQt5\n\n      -DVTK_USE_FFMPEG_ENCODER=ON\n      -DVTK_USE_LARGE_DATA=ON\n      -DVTK_WRAP_JAVA=ON\n      -DVTK_WRAP_TCL=ON\n      -DCMAKE_CXX_FLAGS=\"-D__STDC_CONSTANT_MACROS\"\n    ]\n\n    # Common with ParaView\n    # VTK_USE_SYSTEM_LIB=\"\"\n    args << \"-DVTK_USE_SYSTEM_DOUBLECONVERSION=ON\"\n    args << \"-DVTK_USE_SYSTEM_EIGEN=ON\"\n    args << \"-DVTK_USE_SYSTEM_FREETYPE=ON\"\n    args << \"-DVTK_USE_SYSTEM_GLEW=ON\"\n    args << \"-DVTK_USE_SYSTEM_JSONCPP=ON\"\n    args << \"-DVTK_USE_SYSTEM_LZ4=ON\"\n    args << \"-DVTK_USE_SYSTEM_LZMA=ON\"\n    args << \"-DVTK_USE_SYSTEM_OGG=ON\"\n    # args << \"-DVTK_USE_SYSTEM_PEGTL=ON\"\n    args << \"-DVTK_USE_SYSTEM_PUGIXML=ON\"\n    args << \"-DVTK_USE_SYSTEM_THEORA=ON\"\n\n    args << \"-DVTK_USE_SYSTEM_LIBPROJ=ON\"\n    args << \"-DVTK_USE_SYSTEM_SQLITE=ON\"\n\n\n    args << \"-DVTK_USE_OGGTHEORA_ENCODER=0N\"\n\n    args << \"-DOGGTHEORA_ogg_INCLUDE_DIR=#{Formula[\"libogg\"].opt_include}/ogg/ogg.h\" # ogg/ogg.h\n    args << \"-DOGGTHEORA_ogg_LIBRARY=#{Formula[\"libogg\"].opt_lib}/libogg.dylib\" # ogg\n    args << \"-DOGGTHEORA_theora_INCLUDE_DIR=#{Formula[\"theora\"].opt_include}/theora/theora.h\" # theora/theora.h\n    args << \"-DOGGTHEORA_theoraenc_LIBRARY=#{Formula[\"theora\"].opt_lib}/libtheoraenc.dylib\" # theoraenc\n    args << \"-DOGGTHEORA_theoradec_LIBRARY=#{Formula[\"theora\"].opt_lib}/libtheoradec.dylib\" # theoradec\n\n    # args << \"-DPEGTL_DIR=#{Formula[\"pegtl\"]}\"\n\n    # args << \"-DModule_vtkIOPDAL=ON\"\n\n    # args << \"-DVTK_CUSTOM_LIBRARY_SUFFIX=\"\n    # args << \"-DVTK_INSTALL_INCLUDE_DIR=include/vtk\"\n    # args << \"-DVTK_INSTALL_TCL_DIR=lib/tcl/vtk/\"\n\n    args << \"-DCMAKE_SKIP_RPATH=ON\"\n    args << \"-DBUILD_DOCUMENTATION=OFF\"\n    args << \"-DDOXYGEN_KEEP_TEMP=ON\"\n    args << \"-DDOCUMENTATION_HTML_HELP=OFF\"\n    args << \"-DDOCUMENTATION_HTML_TARZ=OFF\"\n    args << \"-DBUILD_EXAMPLES=ON\"\n    args << \"-DXDMF_STATIC_AND_SHARED=OFF\"\n\n    # args << \"-DVTK_USE_TK=ON\"\n    # args << \"-DVTK_USE_EXTERNAL=ON\"\n\n    # For MPI4PY\n\n    args << \"-DVTK_USE_SYSTEM_MPI4PY=OFF\"\n\n    # disable for error build ThirdParty/mpi4py\n    # args << \"-DVTK_USE_MPI=OFF\"\n\n    # args << \"-Dmpi4py_INCLUDE_DIR=#{libexec}/vendor/lib/python#{python_version}/site-packages/mpi4py/include\"\n\n    # args << \"-DVTK_GROUP_ENABLE_Rendering:STRING=WANT\"\n    # args << \"-DVTK_GROUP_ENABLE_StandAlone:STRING=WANT\"\n    # args << \"-DVTK_GROUP_ENABLE_Imaging:STRING=WANT\"\n    # args << \"-DVTK_GROUP_ENABLE_MPI:STRING=DONT_WANT\"\n    # args << \"-DVTK_GROUP_ENABLE_Views:STRING=WANT\"\n    # args << \"-DVTK_GROUP_ENABLE_Qt:STRING=WANT\"\n    # args << \"-DVTK_GROUP_ENABLE_Web:STRING=WANT\"\n\n    # args << \"-DVTK_Group_Rendering:BOOL=ON\"\n    # args << \"-DVTK_Group_StandAlone:BOOL=ON\"\n    # args << \"-DVTK_Group_Imaging:BOOL=ON\"\n    # args << \"-DVTK_Group_MPI:BOOL=OFF\"\n    # args << \"-DVTK_Group_Views:BOOL=ON\"\n    # args << \"-DVTK_Group_Qt:BOOL=ON\"\n    # args << \"-DVTK_Group_Web:BOOL=ON\"\n\n    # args << \"-DVTK_MODULE_ENABLE_VTK_ParallelMPI4Py:BOOL=OFF\"\n    # args << \"-DModule_vtkParallelMPI4Py:BOOL=OFF\"\n\n    args << \"-DVTK_BUILD_ALL_MODULES=ON\"\n\n    # For some reason, when ThirdParty/mpi4py is built it fails\n    # The options (see above) to disable it do not seem to work\n    # A non-ideal solution is applied, but that works to deactivate it\n    mv \"#{buildpath}/Parallel/MPI4Py/CMakeLists.txt\", \"#{buildpath}/Parallel/MPI4Py/CMakeLists.txt.bk\"\n    mv \"#{buildpath}/Parallel/MPI4Py/module.cmake\", \"#{buildpath}/Parallel/MPI4Py/module.cmake.bk\"\n    mv \"#{buildpath}/ThirdParty/mpi4py/CMakeLists.txt\", \"#{buildpath}/ThirdParty/mpi4py/CMakeLists.txt.bk\"\n    mv \"#{buildpath}/ThirdParty/mpi4py/module.cmake\", \"#{buildpath}/ThirdParty/mpi4py/module.cmake.bk\"\n\n    # CMake picks up the system's python dylib, even if we have a brewed one.\n    if File.exist? \"#{python_prefix}/Python\"\n      args << \"-DPYTHON_LIBRARY='#{python_prefix}/Python'\"\n    elsif File.exist? \"#{python_prefix}/lib/lib#{python_version}.a\"\n      args << \"-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.a'\"\n    elsif File.exist? \"#{python_prefix}/lib/lib#{python_version}.dylib\"\n      args << \"-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.dylib'\"\n    else\n      odie \"No libpythonX.Y.{dylib|a} file found!\"\n    end\n\n    # git submodule update --init\n    # system \"git submodule update --init --recursive\"\n    # (buildpath/\"ThirdParty/vtkm/vtkvtkm/vtk-m\").install resource(\"vtk-m\")\n\n    # rm \"#{buildpath}/CMake/FindPEGTL.cmake\"\n    # (buildpath/\"CMake/FindPEGTL.cmake\").install resource(\"FindPEGTL\")\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    # Avoid hard-coding Python's Cellar paths\n    inreplace Dir[\"#{lib}/cmake/**/vtkPython.cmake\"].first,\n      Formula[\"python\"].prefix.realpath,\n      Formula[\"python\"].opt_prefix\n\n    # Avoid hard-coding HDF5's Cellar path\n    inreplace Dir[\"#{lib}/cmake/**/vtkhdf5.cmake\"].first,\n      Formula[\"hdf5\"].prefix.realpath,\n      Formula[\"hdf5\"].opt_prefix\n\n    # fix lib/python\n    # maybe the reason is that it was changed VTK_INSTALL_PYTHON_MODULE_DIR\n    # by VTK_PYTHON_SITE_PACKAGES_SUFFIX\n    mv \"#{lib}/#{lib}/#{python_version}\", \"#{lib}/#{python_version}\"\n    rm_r \"#{lib}/usr\"\n\n    # fix: Could not fix @rpath/libjawt.dylib\n    MachO::Tools.change_install_name(\"#{lib}/libvtkChartsCoreJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkDomainsChemistryJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkDomainsChemistryOpenGL2Java.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkDomainsParallelChemistryJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkFiltersHybridJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkFiltersParallelDIY2Java.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkFiltersParallelGeometryJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkFiltersParallelImagingJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkFiltersParallelJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkFiltersParallelMPIJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkGeovisCoreJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkIOExportJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkIOExportOpenGL2Java.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkIOExportPDFJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkIOImportJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkIOMINCJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkIOMPIParallelJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkIOParallelJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkInteractionImageJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkInteractionStyleJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkInteractionWidgetsJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingAnnotationJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingContext2DJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingContextOpenGL2Java.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingCoreJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingFreeTypeJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingGL2PSOpenGL2Java.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingImageJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingLICOpenGL2Java.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingLODJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingLabelJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingMatplotlibJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingOpenGL2Java.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingParallelJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingParallelLICJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingQtJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingSceneGraphJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingVolumeAMRJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingVolumeJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkRenderingVolumeOpenGL2Java.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkTestingRenderingJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkViewsContext2DJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkViewsCoreJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkViewsGeovisJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n    MachO::Tools.change_install_name(\"#{lib}/libvtkViewsInfovisJava.dylib\", \"@rpath/libjawt.dylib\", \"#{ENV[\"JAVA_HOME\"]}/jre/lib/libjawt.dylib\")\n\n    # Warning: JARs were installed to \"/usr/local/opt/osgeo-vtk/lib\"\n    # Installing JARs to \"lib\" can cause conflicts between packages.\n    # For Java software, it is typically better for the formula to\n    # install to \"libexec\" and then symlink or wrap binaries into \"bin\".\n    # See \"activemq\", \"jruby\", etc. for examples.\n    # The offending files are:\n    #   /usr/local/opt/osgeo-vtk/lib/vtk.jar\n    # libexec.install Dir[\"*\"]\n    # bin.install_symlink Dir[\"#{libexec}/bin/*\"]\n  end\n\n  test do\n    vtk_include = Dir[opt_include/\"vtk-*\"].first\n    major, minor = vtk_include.match(/.*-(.*)$/)[1].split(\".\")\n\n    (testpath/\"version.cpp\").write <<~EOS\n      #include <vtkVersion.h>\n      #include <assert.h>\n      int main(int, char *[]) {\n        assert (vtkVersion::GetVTKMajorVersion()==#{major});\n        assert (vtkVersion::GetVTKMinorVersion()==#{minor});\n        return EXIT_SUCCESS;\n      }\n    EOS\n\n    system ENV.cxx, \"-std=c++11\", \"version.cpp\", \"-I#{vtk_include}\"\n    system \"./a.out\"\n    system \"#{bin}/vtkpython\", \"-c\", \"exit()\"\n  end\nend\n\n__END__\n\n################################################################################\n--- a/Infovis/BoostGraphAlgorithms/vtkBoostGraphAdapter.h\n+++ b/Infovis/BoostGraphAlgorithms/vtkBoostGraphAdapter.h\n@@ -159,14 +159,14 @@ namespace boost {\n     public iterator_facade<vtk_vertex_iterator,\n                            vtkIdType,\n                            bidirectional_traversal_tag,\n-                           vtkIdType,\n+                           const vtkIdType&,\n                            vtkIdType>\n   {\n     public:\n       explicit vtk_vertex_iterator(vtkIdType i = 0) : index(i) {}\n\n     private:\n-      vtkIdType dereference() const { return index; }\n+      const vtkIdType& dereference() const { return index; }\n\n       bool equal(const vtk_vertex_iterator& other) const\n         { return index == other.index; }\n@@ -183,7 +183,7 @@ namespace boost {\n     public iterator_facade<vtk_edge_iterator,\n                            vtkEdgeType,\n                            forward_traversal_tag,\n-                           vtkEdgeType,\n+                           const vtkEdgeType&,\n                            vtkIdType>\n   {\n     public:\n@@ -243,11 +243,16 @@ namespace boost {\n             iter = nullptr;\n           }\n         }\n+\n+        RecalculateEdge();\n       }\n\n     private:\n-      vtkEdgeType dereference() const\n-        { return vtkEdgeType(vertex, iter->Target, iter->Id); }\n+      const vtkEdgeType& dereference() const\n+      {\n+        assert(iter);\n+        return edge;\n+      }\n\n       bool equal(const vtk_edge_iterator& other) const\n         { return vertex == other.vertex && iter == other.iter; }\n@@ -277,6 +282,7 @@ namespace boost {\n             inc();\n           }\n         }\n+        RecalculateEdge();\n       }\n\n       void inc()\n@@ -304,12 +310,21 @@ namespace boost {\n         }\n       }\n\n+      void RecalculateEdge()\n+      {\n+        if (iter)\n+        {\n+          edge = vtkEdgeType(vertex, iter->Target, iter->Id);\n+        }\n+      }\n+\n       bool directed;\n       vtkIdType vertex;\n       vtkIdType lastVertex;\n       const vtkOutEdgeType * iter;\n       const vtkOutEdgeType * end;\n       vtkGraph *graph;\n+      vtkEdgeType edge;\n\n       friend class iterator_core_access;\n   };\n@@ -318,12 +333,12 @@ namespace boost {\n     public iterator_facade<vtk_out_edge_pointer_iterator,\n                            vtkEdgeType,\n                            bidirectional_traversal_tag,\n-                           vtkEdgeType,\n+                           const vtkEdgeType&,\n                            ptrdiff_t>\n   {\n     public:\n       explicit vtk_out_edge_pointer_iterator(vtkGraph *g = 0, vtkIdType v = 0, bool end = false) :\n-        vertex(v)\n+        vertex(v), iter(nullptr)\n       {\n         if (g)\n         {\n@@ -334,19 +349,42 @@ namespace boost {\n             iter += nedges;\n           }\n         }\n+        RecalculateEdge();\n       }\n\n     private:\n-      vtkEdgeType dereference() const { return vtkEdgeType(vertex, iter->Target, iter->Id); }\n+      const vtkEdgeType& dereference() const\n+      {\n+        assert(iter);\n+        return edge;\n+      }\n\n       bool equal(const vtk_out_edge_pointer_iterator& other) const\n       { return iter == other.iter; }\n\n-      void increment() { iter++; }\n-      void decrement() { iter--; }\n+      void increment()\n+      {\n+        iter++;\n+        RecalculateEdge();\n+      }\n+\n+      void decrement()\n+      {\n+        iter--;\n+        RecalculateEdge();\n+      }\n+\n+      void RecalculateEdge()\n+      {\n+        if (iter)\n+        {\n+          edge = vtkEdgeType(vertex, iter->Target, iter->Id);\n+        }\n+      }\n\n       vtkIdType vertex;\n       const vtkOutEdgeType *iter;\n+      vtkEdgeType edge;\n\n       friend class iterator_core_access;\n   };\n@@ -355,12 +393,12 @@ namespace boost {\n     public iterator_facade<vtk_in_edge_pointer_iterator,\n                            vtkEdgeType,\n                            bidirectional_traversal_tag,\n-                           vtkEdgeType,\n+                           const vtkEdgeType&,\n                            ptrdiff_t>\n   {\n     public:\n       explicit vtk_in_edge_pointer_iterator(vtkGraph *g = 0, vtkIdType v = 0, bool end = false) :\n-        vertex(v)\n+        vertex(v), iter(nullptr)\n       {\n         if (g)\n         {\n@@ -371,19 +409,42 @@ namespace boost {\n             iter += nedges;\n           }\n         }\n+        RecalculateEdge();\n       }\n\n     private:\n-      vtkEdgeType dereference() const { return vtkEdgeType(iter->Source, vertex, iter->Id); }\n+      const vtkEdgeType& dereference() const\n+      {\n+        assert(iter);\n+        return edge;\n+      }\n\n       bool equal(const vtk_in_edge_pointer_iterator& other) const\n       { return iter == other.iter; }\n\n-      void increment() { iter++; }\n-      void decrement() { iter--; }\n+      void increment()\n+      {\n+        iter++;\n+        RecalculateEdge();\n+      }\n+\n+      void decrement()\n+      {\n+        iter--;\n+        RecalculateEdge();\n+      }\n+\n+      void RecalculateEdge()\n+      {\n+        if (iter)\n+        {\n+          edge = vtkEdgeType(iter->Source, vertex, iter->Id);\n+        }\n+      }\n\n       vtkIdType vertex;\n       const vtkInEdgeType *iter;\n+      vtkEdgeType edge;\n\n       friend class iterator_core_access;\n   };\n################################################################################\n\n\n################################################################################\n--- a/IO/MySQL/vtkMySQLDatabase.cxx\n+++ b/IO/MySQL/vtkMySQLDatabase.cxx\n@@ -146,7 +146,7 @@\n\n   if ( this->Reconnect )\n   {\n-    my_bool recon = true;\n+    bool recon = true;\n     mysql_options( &this->Private->NullConnection, MYSQL_OPT_RECONNECT, &recon );\n   }\n\n--- a/IO/MySQL/vtkMySQLQuery.cxx\n+++ b/IO/MySQL/vtkMySQLQuery.cxx\n@@ -103,13 +103,13 @@\n   }\n\n public:\n-  my_bool           IsNull;      // Is this parameter nullptr?\n-  my_bool           IsUnsigned;  // For integer types, is it unsigned?\n+  bool              IsNull;      // Is this parameter nullptr?\n+  bool              IsUnsigned;  // For integer types, is it unsigned?\n   char             *Data;        // Buffer holding actual data\n   unsigned long     BufferSize;  // Buffer size\n   unsigned long     DataLength;  // Size of the data in the buffer (must\n                               // be less than or equal to BufferSize)\n-  my_bool           HasError;    // for the server to report truncation\n+  bool              HasError;    // for the server to report truncation\n   enum enum_field_types  DataType;    // MySQL data type for the contained data\n };\n################################################################################\n\n\n################################################################################\n--- a/IO/Movie/CMakeLists.txt\n+++ b/IO/Movie/CMakeLists.txt\n@@ -33,3 +33,7 @@ vtk_module_library(vtkIOMovie ${Module_SRCS})\n if(WIN32 AND VTK_USE_VIDEO_FOR_WINDOWS)\n   vtk_module_link_libraries(vtkIOMovie LINK_PRIVATE vfw32)\n endif()\n+\n+if(vtkIOMovie_vtkoggtheora)\n+  target_link_libraries(vtkIOMovie PUBLIC ogg)\n+endif()\n\n# @@ -30,6 +30,8 @@ set(vtkIOMovie_HDRS\n#\n#  vtk_module_library(vtkIOMovie ${Module_SRCS})\n#\n# +vtk_module_link_libraries(vtkIOMovie LINK_PRIVATE ogg)\n# +\n#  if(WIN32 AND VTK_USE_VIDEO_FOR_WINDOWS)\n#    vtk_module_link_libraries(vtkIOMovie LINK_PRIVATE vfw32)\n#  endif()\n################################################################################\n\n\n################################################################################\n--- a/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx\n+++ b/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx\n@@ -534,10 +534,15 @@ void QVTKOpenGLNativeWidget::paintGL()\n\n   // blit from this->FBO to QOpenGLWidget's FBO.\n   vtkQVTKOpenGLNativeWidgetDebugMacro(\"paintGL::blit-to-defaultFBO\");\n+#if QT_VERSION < 0x050700\n   QOpenGLFunctions_3_2_Core* f =\n     QOpenGLContext::currentContext()->versionFunctions<QOpenGLFunctions_3_2_Core>();\n+#else\n+  QOpenGLFunctions* f = QOpenGLContext::currentContext()->functions();\n+#endif\n   if (f)\n   {\n+#if QT_VERSION < 0x050700\n     vtkOpenGLState *ostate = this->RenderWindow->GetState();\n\n     f->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, this->defaultFramebufferObject());\n@@ -556,6 +561,13 @@ void QVTKOpenGLNativeWidget::paintGL()\n     f->glBlitFramebuffer(0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1],\n       0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1], GL_COLOR_BUFFER_BIT,\n       GL_NEAREST);\n+#else\n+    f->glDisable(GL_SCISSOR_TEST); // Scissor affects glBindFramebuffer.\n+    QRect rect(0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1]);\n+    QOpenGLFramebufferObject::blitFramebuffer(0 /* binds to default framebuffer */, rect,\n+      this->FBO, rect, GL_COLOR_BUFFER_BIT, GL_NEAREST, GL_COLOR_ATTACHMENT0,\n+      GL_COLOR_ATTACHMENT0, QOpenGLFramebufferObject::DontRestoreFramebufferBinding);\n+#endif\n\n     // now clear alpha otherwise we end up blending the rendering with\n     // background windows in certain cases. It happens on OsX\n################################################################################\n\n################################################################################\n--- a/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt\n+++ b/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt\n@@ -297,8 +297,10 @@\n   \"${CMAKE_CURRENT_BINARY_DIR}/include/exodusII_cfg.h\"\n   \"${CMAKE_CURRENT_BINARY_DIR}/include/exodus_config.h\")\n\n-vtk_add_library(vtkexodusII ${sources} ${headers})\n+vtk_add_library(vtkexodusII ${sources} ${headers})\n+set_property(TARGET vtkexodusII PROPERTY POSITION_INDEPENDENT_CODE ON)\n target_link_libraries(vtkexodusII PUBLIC ${vtknetcdf_LIBRARIES})\n+target_link_libraries(vtkexodusII PUBLIC ${vtknetcdf_LIBRARIES} -pthread)\n if (NOT VTK_INSTALL_NO_DEVELOPMENT)\n   install(FILES\n     ${headers}\n################################################################################\n\n################################################################################\n--- a/ThirdParty/libharu/vtklibharu/src/CMakeLists.txt\n+++ b/ThirdParty/libharu/vtklibharu/src/CMakeLists.txt\n@@ -101,8 +101,10 @@\n   )\n endif(LIBHPDF_SHARED)\n else ()\n-  vtk_add_library(vtklibharu ${LIBHPDF_SRCS})\n+  vtk_add_library(vtklibharu ${LIBHPDF_SRCS})\n+  set_property(TARGET vtklibharu PROPERTY POSITION_INDEPENDENT_CODE ON)\n   target_link_libraries(vtklibharu PRIVATE ${vtkzlib_LIBRARIES} ${vtkpng_LIBRARIES})\n+  target_link_libraries(vtklibharu PRIVATE ${vtkzlib_LIBRARIES} ${vtkpng_LIBRARIES} m)\n   if (WIN32)\n     set_target_properties(vtklibharu\n       PROPERTIES\n################################################################################\n\n\n################################################################################\n--- a/CMake/FindNetCDF.cmake\n+++ b/CMake/FindNetCDF.cmake\n@@ -44,7 +44,7 @@ if(NETCDF_USE_DEFAULT_PATHS)\n endif()\n\n find_path (NETCDF_INCLUDE_DIR netcdf.h\n-  PATHS \"${NETCDF_DIR}/include\")\n+  PATHS \"${NETCDF_DIR}/include/netcdf\")\n mark_as_advanced (NETCDF_INCLUDE_DIR)\n set (NETCDF_C_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR})\n\n@@ -67,7 +67,7 @@ macro (NetCDF_check_interface lang header libs)\n     #search starting from user modifiable cache var\n     find_path (NETCDF_${lang}_INCLUDE_DIR NAMES ${header}\n       HINTS \"${NETCDF_INCLUDE_DIR}\"\n-      HINTS \"${NETCDF_${lang}_ROOT}/include\"\n+      HINTS \"${NETCDF_${lang}_ROOT}/include/netcdf\"\n       ${USE_DEFAULT_PATHS})\n\n     find_library (NETCDF_${lang}_LIBRARY NAMES ${libs}\n\n\n--- a/Wrapping/PythonCore/CMakeLists.txt\n+++ b/Wrapping/PythonCore/CMakeLists.txt\n@@ -44,6 +44,7 @@ set(${vtk-module}_INCLUDE_DIRS)\n\n set(XY ${PYTHON_MAJOR_VERSION}${PYTHON_MINOR_VERSION})\n vtk_module_library(${vtk-module} ${Module_SRCS})\n+vtk_module_link_libraries(${vtk-module} LINK_PRIVATE ${PYTHON_LIBRARIES})\n get_property(output_name TARGET ${vtk-module} PROPERTY OUTPUT_NAME)\n string(REPLACE \"Python\" \"Python${XY}\" output_name \"${output_name}\")\n set_property(TARGET ${vtk-module} PROPERTY OUTPUT_NAME ${output_name})\n################################################################################\n\n\n################################################################################\n--- a/Wrapping/PythonCore/vtkPythonArgs.cxx\n+++ b/Wrapping/PythonCore/vtkPythonArgs.cxx\n@@ -124,8 +124,13 @@\n {\n   if (PyBytes_Check(o))\n   {\n+#if PY_VERSION_HEX >= 0x03070000\n+    a = const_cast<char *>(PyBytes_AS_STRING(o));\n+    return true;\n+#else\n     a = PyBytes_AS_STRING(o);\n     return true;\n+#endif\n   }\n   else if (PyByteArray_Check(o))\n   {\n@@ -135,7 +140,10 @@\n #ifdef Py_USING_UNICODE\n   else if (PyUnicode_Check(o))\n   {\n-#if PY_VERSION_HEX >= 0x03030000\n+#if PY_VERSION_HEX >= 0x03070000\n+    a = const_cast<char *>(PyUnicode_AsUTF8(o));\n+    return true;\n+#elif PY_VERSION_HEX >= 0x03030000\n     a = PyUnicode_AsUTF8(o);\n     return true;\n #else\n################################################################################\n\n################################################################################\n--- a/Wrapping/Tools/CMakeLists.txt\n+++ b/Wrapping/Tools/CMakeLists.txt\n@@ -66,6 +66,7 @@\n   target_link_libraries(vtkWrapHierarchy vtkWrappingTools)\n   vtk_compile_tools_target(vtkWrapHierarchy)\n\n+if(VTK_WRAP_PYTHON)\n   add_executable(vtkWrapPython\n     vtkWrapPython.c\n     vtkWrapPythonClass.c\n@@ -82,12 +83,15 @@\n   add_executable(vtkWrapPythonInit vtkWrapPythonInit.c)\n   vtk_compile_tools_target(vtkWrapPython)\n   vtk_compile_tools_target(vtkWrapPythonInit)\n+endif()\n\n+if(VTK_WRAP_JAVA)\n   add_executable(vtkParseJava vtkParseJava.c)\n   target_link_libraries(vtkParseJava vtkWrappingTools)\n   add_executable(vtkWrapJava vtkWrapJava.c)\n   target_link_libraries(vtkWrapJava vtkWrappingTools)\n   vtk_compile_tools_target(vtkParseJava)\n   vtk_compile_tools_target(vtkWrapJava)\n+endif()\n\n endif()\n\n# other\n# if(VTK_WRAP_TCL)\n#    add_executable(vtkWrapTcl vtkWrapTcl.c)\n#    target_link_libraries(vtkWrapTcl vtkWrappingTools)\n#    add_executable(vtkWrapTclInit vtkWrapTclInit.c)\n#    vtk_compile_tools_target(vtkWrapTcl)\n#    vtk_compile_tools_target(vtkWrapTclInit)\n# endif()\n################################################################################\n\n################################################################################\n# --- a/Wrapping/Java/CMakeLists.txt\n# +++ b/Wrapping/Java/CMakeLists.txt\n# @@ -339,9 +339,9 @@ if(JOGL_GLUE)\n#  endif()\n#\n#  # Set the javac source version\n# -set(VTK_JAVA_SOURCE_VERSION \"1.6\" CACHE STRING \"javac source version\")\n# +set(VTK_JAVA_SOURCE_VERSION \"13\" CACHE STRING \"javac source version\")\n#  mark_as_advanced(VTK_JAVA_SOURCE_VERSION)\n# -set(VTK_JAVA_TARGET_VERSION \"1.6\" CACHE STRING \"javac target version\")\n# +set(VTK_JAVA_TARGET_VERSION \"13\" CACHE STRING \"javac target version\")\n#  mark_as_advanced(VTK_JAVA_TARGET_VERSION)\n#\n#  # On machines with long paths to VTK (or windows where the command line length\n################################################################################\n\n\n################################################################################\n--- a/Utilities/Doxygen/CMakeLists.txt\n+++ b/Utilities/Doxygen/CMakeLists.txt\n@@ -80,7 +80,4 @@\n   install(FILES doc_readme.txt\n     DESTINATION ${VTK_INSTALL_DOXYGEN_DIR}\n     COMPONENT Development)\n-  install(DIRECTORY ${VTK_BINARY_DIR}/Utilities/Doxygen/doc/html\n-      DESTINATION ${VTK_INSTALL_DOXYGEN_DIR}\n-      COMPONENT Development)\n endif()\n################################################################################\n\n\n################################################################################\n--- a/CMake/FindLibPROJ.cmake\n+++ b/CMake/FindLibPROJ.cmake\n@@ -30,7 +30,7 @@ if ( NOT LibPROJ_INCLUDE_DIR OR NOT LibP\n   )\n\n   find_path( LibPROJ_INCLUDE_DIR\n-    NAMES proj_api.h\n+    NAMES proj_api.h proj.h\n     HINTS\n       ${_LibPROJ_DIR}\n       ${_LibPROJ_DIR}/include\n--- a/Geovis/Core/vtkGeoProjection.cxx\n+++ b/Geovis/Core/vtkGeoProjection.cxx\n@@ -72,6 +72,9 @@ public:\n   }\n\n   std::map< std::string, std::string > OptionalParameters;\n+#if PROJ_VERSION_MAJOR >= 5\n+  PJ_PROJ_INFO ProjInfo;\n+#endif\n };\n\n //-----------------------------------------------------------------------------\n@@ -80,7 +83,7 @@ int vtkGeoProjection::GetNumberOfProject\n   if ( vtkGeoProjectionNumProj < 0 )\n   {\n     vtkGeoProjectionNumProj = 0;\n-    for ( const PJ_LIST* pj = pj_get_list_ref(); pj && pj->id; ++ pj )\n+    for ( const PJ_LIST* pj = proj_list_operations(); pj && pj->id; ++ pj )\n       ++ vtkGeoProjectionNumProj;\n   }\n   return vtkGeoProjectionNumProj;\n@@ -91,7 +94,7 @@ const char* vtkGeoProjection::GetProject\n   if ( projection < 0 || projection >= vtkGeoProjection::GetNumberOfProjections() )\n     return nullptr;\n\n-  return pj_get_list_ref()[projection].id;\n+  return proj_list_operations()[projection].id;\n }\n //-----------------------------------------------------------------------------\n const char* vtkGeoProjection::GetProjectionDescription( int projection )\n@@ -99,7 +102,7 @@ const char* vtkGeoProjection::GetProject\n   if ( projection < 0 || projection >= vtkGeoProjection::GetNumberOfProjections() )\n     return nullptr;\n\n-  return pj_get_list_ref()[projection].descr[0];\n+  return proj_list_operations()[projection].descr[0];\n }\n //-----------------------------------------------------------------------------\n vtkGeoProjection::vtkGeoProjection()\n@@ -144,7 +147,7 @@ void vtkGeoProjection::PrintSelf( ostrea\n int vtkGeoProjection::GetIndex()\n {\n   int i = 0;\n-  for ( const PJ_LIST* proj = pj_get_list_ref(); proj && proj->id; ++ proj, ++ i )\n+  for ( const PJ_LIST* proj = proj_list_operations(); proj && proj->id; ++ proj, ++ i )\n   {\n     if ( ! strcmp( proj->id, this->Name ) )\n     {\n@@ -161,7 +164,11 @@ const char* vtkGeoProjection::GetDescrip\n   {\n     return nullptr;\n   }\n+#if PROJ_VERSION_MAJOR >= 5\n+  return this->Internals->ProjInfo.description;\n+#else\n   return this->Projection->descr;\n+#endif\n }\n //-----------------------------------------------------------------------------\n projPJ vtkGeoProjection::GetProjection()\n@@ -232,6 +239,9 @@ int vtkGeoProjection::UpdateProjection()\n   this->ProjectionMTime = this->GetMTime();\n   if ( this->Projection )\n   {\n+#if PROJ_VERSION_MAJOR >= 5\n+    this->Internals->ProjInfo = proj_pj_info(this->Projection);\n+#endif\n     return 0;\n   }\n   return 1;\n--- a/Geovis/Core/vtkGeoTransform.cxx\n+++ b/Geovis/Core/vtkGeoTransform.cxx\n@@ -167,9 +167,17 @@ void vtkGeoTransform::InternalTransformP\n     double* coord = x;\n     for ( vtkIdType i = 0; i < numPts; ++ i )\n     {\n+#if PROJ_VERSION_MAJOR >= 5\n+      xy.x = coord[0]; xy.y = coord[1];\n+#else\n       xy.u = coord[0]; xy.v = coord[1];\n+#endif\n       lp = pj_inv( xy, src );\n+#if PROJ_VERSION_MAJOR >= 5\n+      coord[0] = lp.lam; coord[1] = lp.phi;\n+#else\n       coord[0] = lp.u; coord[1] = lp.v;\n+#endif\n       coord += stride;\n     }\n   }\n@@ -191,9 +199,17 @@ void vtkGeoTransform::InternalTransformP\n     double* coord = x;\n     for ( vtkIdType i = 0; i < numPts; ++ i )\n     {\n+#if PROJ_VERSION_MAJOR >= 5\n+      lp.lam = coord[0]; lp.phi = coord[1];\n+#else\n       lp.u = coord[0]; lp.v = coord[1];\n+#endif\n       xy = pj_fwd( lp, dst );\n+#if PROJ_VERSION_MAJOR >= 5\n+      coord[0] = xy.x; coord[1] = xy.y;\n+#else\n       coord[0] = xy.u; coord[1] = xy.v;\n+#endif\n       coord += stride;\n     }\n   }\n--- a/ThirdParty/libproj/vtk_libproj.h.in\n+++ b/ThirdParty/libproj/vtk_libproj.h.in\n@@ -15,10 +15,20 @@\n #ifndef vtk_libproj_h\n #define vtk_libproj_h\n\n+#define VTK_LibPROJ_MAJOR_VERSION @LibPROJ_MAJOR_VERSION@\n+\n /* Use the libproj library configured for VTK.  */\n #cmakedefine VTK_USE_SYSTEM_LIBPROJ\n #ifdef VTK_USE_SYSTEM_LIBPROJ\n-# include <projects.h>\n+# if VTK_LibPROJ_MAJOR_VERSION >= 5\n+#  include <proj.h>\n+# endif\n+# if VTK_LibPROJ_MAJOR_VERSION < 6\n+#  include <projects.h>\n+# endif\n+# if VTK_LibPROJ_MAJOR_VERSION >= 6\n+#  define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1\n+# endif\n # include <proj_api.h>\n # include <geodesic.h>\n #else\n--- VTK-8.2.0/CMake/FindLibPROJ.cmake\t2019-09-11 22:13:29.493741215 -0600\n+++ vtk/CMake/FindLibPROJ.cmake\t2019-09-11 19:56:57.465802610 -0600\n@@ -1,55 +1,67 @@\n-# Find LibPROJ library and header file\n-# Sets\n-#   LibPROJ_FOUND       to 0 or 1 depending on the result\n-#   LibPROJ_INCLUDE_DIR to directories required for using libproj4\n-#   LibPROJ_LIBRARIES   to libproj4 and any dependent libraries\n-# If LibPROJ_REQUIRED is defined, then a fatal error message will be generated if libproj4 is not found\n-\n-if ( NOT LibPROJ_INCLUDE_DIR OR NOT LibPROJ_LIBRARIES OR NOT LibPROJ_FOUND )\n+find_path(LibPROJ_INCLUDE_DIR\n+  NAMES proj_api.h proj.h\n+  DOC \"libproj include directories\")\n+mark_as_advanced(LibPROJ_INCLUDE_DIR)\n\n-  if ( $ENV{LibPROJ_DIR} )\n-    file( TO_CMAKE_PATH \"$ENV{LibPROJ_DIR}\" _LibPROJ_DIR )\n+find_library(LibPROJ_LIBRARY_RELEASE\n+  NAMES proj\n+  DOC \"libproj release library\")\n+mark_as_advanced(LibPROJ_LIBRARY_RELEASE)\n+\n+find_library(LibPROJ_LIBRARY_DEBUG\n+  NAMES projd\n+  DOC \"libproj debug library\")\n+mark_as_advanced(LibPROJ_LIBRARY_DEBUG)\n+\n+include(SelectLibraryConfigurations)\n+select_library_configurations(LibPROJ)\n+\n+if (LibPROJ_INCLUDE_DIR)\n+  if (EXISTS \"${LibPROJ_INCLUDE_DIR}/proj.h\")\n+    file(STRINGS \"${LibPROJ_INCLUDE_DIR}/proj.h\" _libproj_version_lines REGEX \"#define[ \\t]+PROJ_VERSION_(MAJOR|MINOR|PATCH)\")\n+    string(REGEX REPLACE \".*PROJ_VERSION_MAJOR *\\([0-9]*\\).*\" \"\\\\1\" _libproj_version_major \"${_libproj_version_lines}\")\n+    string(REGEX REPLACE \".*PROJ_VERSION_MINOR *\\([0-9]*\\).*\" \"\\\\1\" _libproj_version_minor \"${_libproj_version_lines}\")\n+    string(REGEX REPLACE \".*PROJ_VERSION_PATCH *\\([0-9]*\\).*\" \"\\\\1\" _libproj_version_patch \"${_libproj_version_lines}\")\n+  else ()\n+    file(STRINGS \"${LibPROJ_INCLUDE_DIR}/proj_api.h\" _libproj_version_lines REGEX \"#define[ \\t]+PJ_VERSION\")\n+    string(REGEX REPLACE \".*PJ_VERSION *\\([0-9]*\\).*\" \"\\\\1\" _libproj_version \"${_libproj_version_lines}\")\n+    math(EXPR _libproj_version_major \"${_libproj_version} / 100\")\n+    math(EXPR _libproj_version_minor \"(${_libproj_version} % 100) / 10\")\n+    math(EXPR _libproj_version_patch \"${_libproj_version} % 10\")\n   endif ()\n-\n-  set(LibPROJ_LIBRARY_SEARCH_PATHS\n-    ${_LibPROJ_DIR}\n-    ${_LibPROJ_DIR}/lib64\n-    ${_LibPROJ_DIR}/lib\n-  )\n-\n-  find_library( LibPROJ_LIBRARY_RELEASE\n-    NAMES proj\n-    HINTS\n-      ${LibPROJ_LIBRARY_SEARCH_PATHS}\n-  )\n-\n-  find_library( LibPROJ_LIBRARY_DEBUG\n-    NAMES projd\n-    PATHS\n-      ${LibPROJ_LIBRARY_SEARCH_PATHS}\n-  )\n-\n-  find_path( LibPROJ_INCLUDE_DIR\n-    NAMES proj_api.h proj.h\n-    HINTS\n-      ${_LibPROJ_DIR}\n-      ${_LibPROJ_DIR}/include\n-  )\n-\n-  include(SelectLibraryConfigurations)\n-  select_library_configurations(LibPROJ)\n-\n-  include(FindPackageHandleStandardArgs)\n-  find_package_handle_standard_args(LibPROJ\n-                                    REQUIRED_VARS LibPROJ_LIBRARY LibPROJ_INCLUDE_DIR)\n-\n-  if(LibPROJ_FOUND)\n-    set(LibPROJ_INCLUDE_DIRS ${LibPROJ_INCLUDE_DIR})\n-\n-    if(NOT LibPROJ_LIBRARIES)\n-      set(LibPROJ_LIBRARIES ${LibPROJ_LIBRARY})\n-    endif()\n-  endif()\n+  set(LibPROJ_VERSION \"${_libproj_version_major}.${_libproj_version_minor}.${_libproj_version_patch}\")\n+  set(LibPROJ_MAJOR_VERSION \"${_libproj_version_major}\")\n+  unset(_libproj_version_major)\n+  unset(_libproj_version_minor)\n+  unset(_libproj_version_patch)\n+  unset(_libproj_version)\n+  unset(_libproj_version_lines)\n endif ()\n\n-mark_as_advanced(LibPROJ_INCLUDE_DIR)\n+include(FindPackageHandleStandardArgs)\n+find_package_handle_standard_args(LibPROJ\n+  REQUIRED_VARS LibPROJ_LIBRARY LibPROJ_INCLUDE_DIR\n+  VERSION_VAR LibPROJ_VERSION)\n+\n+if (LibPROJ_FOUND)\n+  set(LibPROJ_INCLUDE_DIRS \"${LibPROJ_INCLUDE_DIR}\")\n+  set(LibPROJ_LIBRARIES \"${LibPROJ_LIBRARY}\")\n+\n+  if (NOT TARGET LibPROJ::LibPROJ)\n+    add_library(LibPROJ::LibPROJ UNKNOWN IMPORTED)\n+    set_target_properties(LibPROJ::LibPROJ PROPERTIES\n+      INTERFACE_INCLUDE_DIRECTORIES \"${LibPROJ_INCLUDE_DIR}\")\n+    if (LibPROJ_LIBRARY_RELEASE)\n+      set_property(TARGET LibPROJ::LibPROJ APPEND PROPERTY\n+        IMPORTED_CONFIGURATIONS RELEASE)\n+      set_target_properties(LibPROJ::LibPROJ PROPERTIES\n+        IMPORTED_LOCATION_RELEASE \"${LibPROJ_LIBRARY_RELEASE}\")\n+    endif ()\n+    if (LibPROJ_LIBRARY_DEBUG)\n+      set_property(TARGET LibPROJ::LibPROJ APPEND PROPERTY\n+        IMPORTED_CONFIGURATIONS DEBUG)\n+      set_target_properties(LibPROJ::LibPROJ PROPERTIES\n+        IMPORTED_LOCATION_DEBUG \"${LibPROJ_LIBRARY_DEBUG}\")\n+    endif ()\n+  endif ()\n+endif ()\n################################################################################\n\n\n################################################################################\n--- a/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h\n+++ b/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h\n@@ -140,6 +140,12 @@ static PyTypeObject vtkPythonStdStreamCaptureHelperType = {\n #if PY_VERSION_HEX >= 0x03040000\n   0, // tp_finalize\n #endif\n+#if PY_VERSION_HEX >= 0x03080000\n+  0, // tp_vectorcall\n+#if PY_VERSION_HEX < 0x03090000\n+  0, // tp_print\n+#endif\n+#endif\n };\n\n static PyObject* vtkWrite(PyObject* self, PyObject* args)\n\n--- a/Wrapping/PythonCore/PyVTKMethodDescriptor.cxx\n+++ b/Wrapping/PythonCore/PyVTKMethodDescriptor.cxx\n@@ -186,7 +186,7 @@ PyTypeObject PyVTKMethodDescriptor_Type = {\n   sizeof(PyMethodDescrObject),           // tp_basicsize\n   0,                                     // tp_itemsize\n   PyVTKMethodDescriptor_Delete,          // tp_dealloc\n-  nullptr,                               // tp_print\n+  0,                                     // tp_vectorcall_offset\n   nullptr,                               // tp_getattr\n   nullptr,                               // tp_setattr\n   nullptr,                               // tp_compare\n\n--- a/Wrapping/PythonCore/PyVTKNamespace.cxx\n+++ b/Wrapping/PythonCore/PyVTKNamespace.cxx\n@@ -49,7 +49,7 @@ PyTypeObject PyVTKNamespace_Type = {\n   0,                                     // tp_basicsize\n   0,                                     // tp_itemsize\n   PyVTKNamespace_Delete,                 // tp_dealloc\n-  nullptr,                               // tp_print\n+  0,                                     // tp_vectorcall_offset\n   nullptr,                               // tp_getattr\n   nullptr,                               // tp_setattr\n   nullptr,                               // tp_compare\n\n--- a/Wrapping/PythonCore/PyVTKReference.cxx\n+++ b/Wrapping/PythonCore/PyVTKReference.cxx\n@@ -1010,7 +1010,7 @@ PyTypeObject PyVTKReference_Type = {\n   sizeof(PyVTKReference),                // tp_basicsize\n   0,                                     // tp_itemsize\n   PyVTKReference_Delete,                 // tp_dealloc\n-  nullptr,                               // tp_print\n+  0,                                     // tp_vectorcall_offset\n   nullptr,                               // tp_getattr\n   nullptr,                               // tp_setattr\n   nullptr,                               // tp_compare\n@@ -1067,7 +1067,7 @@ PyTypeObject PyVTKNumberReference_Type = {\n   sizeof(PyVTKReference),                // tp_basicsize\n   0,                                     // tp_itemsize\n   PyVTKReference_Delete,                 // tp_dealloc\n-  nullptr,                               // tp_print\n+  0,                                     // tp_vectorcall_offset\n   nullptr,                               // tp_getattr\n   nullptr,                               // tp_setattr\n   nullptr,                               // tp_compare\n@@ -1124,7 +1124,7 @@ PyTypeObject PyVTKStringReference_Type = {\n   sizeof(PyVTKReference),                // tp_basicsize\n   0,                                     // tp_itemsize\n   PyVTKReference_Delete,                 // tp_dealloc\n-  nullptr,                               // tp_print\n+  0,                                     // tp_vectorcall_offset\n   nullptr,                               // tp_getattr\n   nullptr,                               // tp_setattr\n   nullptr,                               // tp_compare\n@@ -1181,7 +1181,7 @@ PyTypeObject PyVTKTupleReference_Type = {\n   sizeof(PyVTKReference),                // tp_basicsize\n   0,                                     // tp_itemsize\n   PyVTKReference_Delete,                 // tp_dealloc\n-  nullptr,                               // tp_print\n+  0,                                     // tp_vectorcall_offset\n   nullptr,                               // tp_getattr\n   nullptr,                               // tp_setattr\n   nullptr,                               // tp_compare\n\n--- a/Wrapping/PythonCore/PyVTKTemplate.cxx\n+++ b/Wrapping/PythonCore/PyVTKTemplate.cxx\n@@ -268,7 +268,7 @@ PyTypeObject PyVTKTemplate_Type = {\n   0,                                     // tp_basicsize\n   0,                                     // tp_itemsize\n   nullptr,                               // tp_dealloc\n-  nullptr,                               // tp_print\n+  0,                                     // tp_vectorcall_offset\n   nullptr,                               // tp_getattr\n   nullptr,                               // tp_setattr\n   nullptr,                               // tp_compare\n\n--- a/Wrapping/PythonCore/vtkPythonCompatibility.h\n+++ b/Wrapping/PythonCore/vtkPythonCompatibility.h\n@@ -64,7 +64,13 @@\n #endif\n\n // PyTypeObject compatibility\n-#if PY_VERSION_HEX >= 0x03040000\n+#if PY_VERSION_HEX >= 0x03090000\n+#define VTK_WRAP_PYTHON_SUPPRESS_UNINITIALIZED \\\n+  0, 0, 0, 0,\n+#elif PY_VERSION_HEX >= 0x03080000\n+#define VTK_WRAP_PYTHON_SUPPRESS_UNINITIALIZED \\\n+  0, 0, 0, 0, 0,\n+#elif PY_VERSION_HEX >= 0x03040000\n #define VTK_WRAP_PYTHON_SUPPRESS_UNINITIALIZED \\\n   0, 0, 0,\n #else\n\n--- a/Wrapping/Tools/vtkWrapPythonClass.c\n+++ b/Wrapping/Tools/vtkWrapPythonClass.c\n@@ -521,7 +521,7 @@ void vtkWrapPython_GenerateObjectType(\n     \"  sizeof(PyVTKObject), // tp_basicsize\\n\"\n     \"  0, // tp_itemsize\\n\"\n     \"  PyVTKObject_Delete, // tp_dealloc\\n\"\n-    \"  nullptr, // tp_print\\n\"\n+    \"  0, // tp_vectorcall_offset\\n\"\n     \"  nullptr, // tp_getattr\\n\"\n     \"  nullptr, // tp_setattr\\n\"\n     \"  nullptr, // tp_compare\\n\"\n\n--- a/Wrapping/Tools/vtkWrapPythonEnum.c\n+++ b/Wrapping/Tools/vtkWrapPythonEnum.c\n@@ -145,7 +145,7 @@ void vtkWrapPython_GenerateEnumType(\n     \"  sizeof(PyIntObject), // tp_basicsize\\n\"\n     \"  0, // tp_itemsize\\n\"\n     \"  nullptr, // tp_dealloc\\n\"\n-    \"  nullptr, // tp_print\\n\"\n+    \"  0, // tp_vectorcall_offset\\n\"\n     \"  nullptr, // tp_getattr\\n\"\n     \"  nullptr, // tp_setattr\\n\"\n     \"  nullptr, // tp_compare\\n\"\n\n--- a/Wrapping/Tools/vtkWrapPythonType.c\n+++ b/Wrapping/Tools/vtkWrapPythonType.c\n@@ -709,7 +709,7 @@ void vtkWrapPython_GenerateSpecialType(\n     \"  sizeof(PyVTKSpecialObject), // tp_basicsize\\n\"\n     \"  0, // tp_itemsize\\n\"\n     \"  Py%s_Delete, // tp_dealloc\\n\"\n-    \"  nullptr, // tp_print\\n\"\n+    \"  0, // tp_vectorcall_offset\\n\"\n     \"  nullptr, // tp_getattr\\n\"\n     \"  nullptr, // tp_setattr\\n\"\n     \"  nullptr, // tp_compare\\n\"\n################################################################################\n\n\n################################################################################\n# --- a/IO/GDAL/vtkGDALVectorReader.cxx\n# +++ b/IO/GDAL/vtkGDALVectorReader.cxx\n# @@ -44,7 +44,7 @@ class vtkGDALVectorReader::Internal\n#  public:\n#    Internal( const char* srcName, int srcMode, int appendFeatures, int addFeatIds )\n#      {\n# -    this->Source = OGRSFDriverRegistrar::Open( srcName, srcMode, &this->Driver );\n# +    this->Source = (GDALDataset*) OGROpen( srcName, srcMode, NULL );\n#      if ( ! this->Source )\n#        {\n#        this->LastError = CPLGetLastErrorMsg();\n# @@ -61,7 +61,7 @@ public:\n#      {\n#      if ( this->Source )\n#        {\n# -      OGRDataSource::DestroyDataSource( this->Source );\n# +      GDALClose( (GDALDatasetH) this->Source );\n#        }\n#      }\n#\n# @@ -304,7 +304,7 @@ public:\n#      return nCells;\n#      }\n#\n# -  OGRDataSource* Source;\n# +  GDALDataset* Source;\n#    OGRSFDriver* Driver;\n#    const char* LastError;\n#    int LayerIdx;\n################################################################################\n\n################################################################################\n# --- a/ThirdParty/libxml2/vtklibxml2/threads.c\n# +++ b/ThirdParty/libxml2/vtklibxml2/threads.c\n# @@ -49,7 +49,7 @@\n#  #ifdef HAVE_PTHREAD_H\n#\n#  static int libxml_is_threaded = -1;\n# -#ifdef __GNUC__\n# +#if 0\n#  #ifdef linux\n#  #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)\n#  extern int pthread_once (pthread_once_t *__once_control,\n################################################################################\n"
  },
  {
    "path": "Formula/osgeo-whitebox-tools.rb",
    "content": "class OsgeoWhiteboxTools < Formula\n  desc \"An advanced geospatial data analysis platform\"\n  homepage \"https://www.uoguelph.ca/~hydrogeo/WhiteboxTools\"\n  url \"https://jblindsay.github.io/ghrg/WhiteboxTools/WhiteboxTools_darwin_amd64.zip\"\n  sha256 \"c6bbd1bf8775ee778b11bb816f54dc50a93633b5f8480b512129d27cad346737\"\n  version \"1.2.0\"\n\n  # revision 1\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any_skip_relocation\n    sha256 \"24b5c05d0b058953e7a783f1a923be428ff1ffc27fc48a4a9bc7b120a6830809\" => :catalina\n    sha256 \"24b5c05d0b058953e7a783f1a923be428ff1ffc27fc48a4a9bc7b120a6830809\" => :mojave\n    sha256 \"24b5c05d0b058953e7a783f1a923be428ff1ffc27fc48a4a9bc7b120a6830809\" => :high_sierra\n  end\n\n  def install\n    cp_r buildpath.to_s, prefix.to_s\n    mkdir bin.to_s\n    ln_s \"#{prefix}/WBT/whitebox_tools\", \"#{bin}/whitebox_tools\"\n  end\n\n  test do\n    system \"#{bin}/whitebox_tools\", \"--toolbox=Slope\"\n  end\nend\n"
  },
  {
    "path": "Formula/osgeo-whitebox.rb",
    "content": "class OsgeoWhitebox < Formula\n  desc \"Geographic information system (GIS) and remote sensing package intended for advanced geospatial analysis and data visualization\"\n  homepage \"https://www.uoguelph.ca/~hydrogeo/Whitebox\"\n  url \"https://www.uoguelph.ca/~hydrogeo/Whitebox/WhiteboxGAT-mac.zip\"\n  sha256 \"32b2a75dab883e97d271621c60e7ad254558587b8bda0f1013bb9562077eea34\"\n  version \"3.4.0\"\n\n  revision 6\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any_skip_relocation\n    sha256 \"3f55a7bc83ba79dfdf98d73e37385ae4f10601c31e44d351afe040573ec42e73\" => :catalina\n    sha256 \"3f55a7bc83ba79dfdf98d73e37385ae4f10601c31e44d351afe040573ec42e73\" => :mojave\n    sha256 \"3f55a7bc83ba79dfdf98d73e37385ae4f10601c31e44d351afe040573ec42e73\" => :high_sierra\n  end\n\n  option \"with-app\", \"Build WBT.app Package\"\n\n  depends_on \"bash\"\n  # depends_on \"openjdk\"\n\n  def install\n\n    cp_r \"#{buildpath}\", \"#{prefix}\"\n\n    mkdir \"#{bin}\"\n\n    # create whitebox\n    File.open(\"#{bin}/whitebox\", \"w\") { |file|\n      file << '#!/bin/sh'\n      file << \"\\n\"\n      file << \"/usr/bin/java -jar #{prefix}/WhiteboxGAT-mac/WhiteboxGIS.jar\"\n    }\n\n    # chmod(\"+x\", \"#{bin}/whitebox\")\n\n    if build.with? \"app\"\n      (prefix/\"WBT.app/Contents/PkgInfo\").write \"APPLWBT\"\n\n      (prefix/\"WBT.app/Contents/Resources\").mkpath\n\n      cp_r \"#{prefix}/WhiteboxGAT-mac/resources/Images/wbGAT.png\", \"#{prefix}/WBT.app/Contents/Resources/whitebox.icns\"\n\n      config = <<~EOS\n        <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n        <!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n        <plist version=\"1.0\">\n        <dict>\n          <key>CFBundleDevelopmentRegion</key>\n          <string>English</string>\n          <key>CFBundleExecutable</key>\n          <string>whitebox</string>\n          <key>CFBundleIconFile</key>\n          <string>whitebox.icns</string>\n          <key>CFBundleInfoDictionaryVersion</key>\n          <string>6.0</string>\n          <key>CFBundleName</key>\n          <string>WTB</string>\n          <key>CFBundlePackageType</key>\n          <string>APPL</string>\n          <key>CFBundleSignature</key>\n          <string>WTB</string>\n          <key>CFBundleVersion</key>\n          <string>1.0</string>\n          <key>CSResourcesFileMapped</key>\n          <true/>\n          <key>NSHighResolutionCapable</key>\n          <string>True</string>\n        </dict>\n        </plist>\n      EOS\n\n      (prefix/\"WBT.app/Contents/Info.plist\").write config\n\n      chdir \"#{prefix}/WBT.app/Contents\" do\n        mkdir \"MacOS\" do\n          ln_s \"#{bin}/whitebox\", \"whitebox\"\n        end\n      end\n    end\n  end\n\n  def caveats\n    s = <<~EOS\n    \\n\\033[31mRequires Java 8.\\e[0m\n\n    \\e[0mHow To Install Java 8:\n\n      \\e[32mbrew tap caskroom/cask\\e[0m\n      \\e[32mbrew install java8\\e[0m\n\n    Install Multiple Java Versions:\n\n      https://gist.github.com/ntamvl/5f4dbaa8f68e6897b99682a395a44c2e\n      https://gist.github.com/alChaCC/ddb11542c9e6b6683bad80d9ca858bc5\n\n    EOS\n\n    if build.with? \"app\"\n      s += <<~EOS\n\n      \\e[32mWBT.app\\e[0m was installed in: \\e[32m#{prefix}\\e[0m\n\n      You may also symlink to /Applications or ~/Applications:\n\n        \\e[32mln -Fs `find $(brew --prefix) -name \"WBT.app\"` /Applications/WBT.app\\e[0m\n\n      EOS\n    end\n    s\n  end\n\n  test do\n    # TODO\n  end\nend\n"
  },
  {
    "path": "Formula/prepair.rb",
    "content": "class Prepair < Formula\n  desc \"Automatic repair of single GIS polygons using constrained triangulation\"\n  homepage \"https://github.com/tudelft-gist/prepair\"\n  url \"https://github.com/tudelft3d/prepair/archive/v0.7.1.tar.gz\"\n  sha256 \"2abc69588880e595552af363580e38c1a4a63c9d51549f6450ab6f96ee1ad67f\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    cellar :any\n    sha256 \"25ac4f4cdb1282e662718e7bf6cb1419d9ae586af842db3ac26bfb9ce1d8848c\" => :high_sierra\n    sha256 \"25ac4f4cdb1282e662718e7bf6cb1419d9ae586af842db3ac26bfb9ce1d8848c\" => :sierra\n  end\n\n  option \"with-library\", \"Build library in addition to executable\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"cgal\"\n  depends_on \"gdal2\"\n\n  def install\n    libexec.install(%w[data icon.png]) # geojson sample data and project icon\n    args = std_cmake_args\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      # system \"/usr/local/bin/bbedit\", \"CMakeCache.txt\"\n      # raise\n      system \"make\"\n      bin.install \"prepair\"\n\n      if build.with? \"library\"\n        args << \"-DAS_LIBRARY=ON\"\n        system \"cmake\", \"..\", *args\n        system \"make\"\n        lib.install \"libprepair.dylib\"\n      end\n    end\n  end\n\n  test do\n    mktemp do\n      system \"#{bin}/prepair\", \"--shpOut\", \"--ogr\", \"#{libexec}/data/CLC2006_180927.geojson\"\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/qca-qt@5.7.rb",
    "content": "class QcaQtAT57 < Formula\n  desc \"Qt Cryptographic Architecture (QCA)\"\n  homepage \"http://delta.affinix.com/qca/\"\n  head \"https://anongit.kde.org/qca.git\"\n\n  stable do\n    url \"https://github.com/KDE/qca/archive/v2.1.1.tar.gz\"\n    sha256 \"aa8ec328da163a5e20ac59146e56b17d0677789f020d0c3875c4ed5e9e82e749\"\n\n    # Fix for linking CoreFoundation and removing deprecated code (already in HEAD)\n    patch do\n      url \"https://github.com/KDE/qca/commit/f223ce03d4b94ffbb093fc8be5adf8d968f54434.diff\"\n      sha256 \"75ef105b01658c3b4030b8c697338dbceddbcc654b022162b284e0fa8df582b5\"\n    end\n\n    # Fix for framework installation (already in HEAD)\n    patch do\n      url \"https://github.com/KDE/qca/commit/9e4bf795434304bce32626fe0f6887c10fec0824.diff\"\n      sha256 \"5f4e575d2c9f55090c7e3358dc27b6e22cccecaaee264d1638aabac86421c314\"\n    end\n  end\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    sha256 \"f478153f18c3640a42d0dbe22495e194d2ddeb8c55ab8d67d08a9b850a4b9ed3\" => :sierra\n  end\n\n  keg_only \"Qt5 is keg-only\"\n\n  option \"with-api-docs\", \"Build API documentation\"\n\n  deprecated_option \"with-gnupg\" => \"with-gpg2\"\n  deprecated_option \"with-qt\" => \"with-qt@5.7\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"qt@5.7\" => :recommended\n\n  # Plugins (QCA needs at least one plugin to do anything useful)\n  depends_on \"openssl\" # qca-ossl\n  depends_on \"botan\" => :optional # qca-botan\n  depends_on \"libgcrypt\" => :optional # qca-gcrypt\n  depends_on \"gpg\" => :optional # qca-gnupg\n  depends_on \"nss\" => :optional # qca-nss\n  depends_on \"pkcs11-helper\" => :optional # qca-pkcs11\n\n  if build.with? \"api-docs\"\n    depends_on \"graphviz\" => :build\n    depends_on \"doxygen\" => [:build, \"with-graphviz\"]\n  end\n\n  def install\n    odie \"Qt dependency must be defined\" if build.without?(\"qt\") && build.without?(\"qt@5.7\")\n\n    args = std_cmake_args\n    args << \"-DQT4_BUILD=OFF\"\n    args << \"-DBUILD_TESTS=OFF\"\n\n    # Plugins (qca-ossl, qca-cyrus-sasl, qca-logger, qca-softstore always built)\n    args << \"-DWITH_botan_PLUGIN=#{build.with?(\"botan\") ? \"YES\" : \"NO\"}\"\n    args << \"-DWITH_gcrypt_PLUGIN=#{build.with?(\"libgcrypt\") ? \"YES\" : \"NO\"}\"\n    args << \"-DWITH_gnupg_PLUGIN=#{build.with?(\"gpg2\") ? \"YES\" : \"NO\"}\"\n    args << \"-DWITH_nss_PLUGIN=#{build.with?(\"nss\") ? \"YES\" : \"NO\"}\"\n    args << \"-DWITH_pkcs11_PLUGIN=#{build.with?(\"pkcs11-helper\") ? \"YES\" : \"NO\"}\"\n\n    system \"cmake\", \".\", *args\n    system \"make\", \"install\"\n\n    if build.with? \"api-docs\"\n      system \"make\", \"doc\"\n      doc.install \"apidocs/html\"\n    end\n  end\n\n  test do\n    system bin/\"qcatool-qt5\", \"--noprompt\", \"--newpass=\",\n                              \"key\", \"make\", \"rsa\", \"2048\", \"test.key\"\n  end\nend\n"
  },
  {
    "path": "Formula/qt-ifw-qt5.rb",
    "content": "class QtIfwQt5 < Formula\n  desc \"Static build of version 5 of Qt for use in Qt Installer Framework\"\n  homepage \"http://qt-project.org\"\n  url \"https://download.qt.io/official_releases/qt/5.6/5.6.0/single/qt-everywhere-opensource-src-5.6.0.tar.xz\"\n  mirror \"https://www.mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.6/5.6.0/single/qt-everywhere-opensource-src-5.6.0.tar.xz\"\n  sha256 \"76a95cf6c1503290f75a641aa25079cd0c5a8fcd7cff07ddebff80a955b07de7\"\n\n  keg_only \"Qt 5 conflicts Qt 4 (which is currently much more widely used).\"\n\n  # OS X 10.7 Lion is still supported in Qt 5.5, but is no longer a reference\n  # configuration and thus untested in practice. Builds on OS X 10.7 have been\n  # reported to fail: <https://github.com/Homebrew/homebrew/issues/45284>.\n  # depends_on :macos => :mountain_lion # error: unknown version \n  depends_on \"pkg-config\" => :build\n  depends_on :xcode => :build\n\n  def install\n    args = [\"-prefix\", prefix, \"-release\", \"-static\", \"-accessibility\",\n            \"-qt-zlib\", \"-qt-libpng\", \"-qt-libjpeg\", \"-qt-freetype\", \"-qt-pcre\",\n            \"-no-cups\", \"-no-sql-sqlite\", \"-no-qml-debug\",\n            \"-nomake\", \"examples\", \"-nomake\", \"tests\",\n            \"-skip\", \"qt3d\", \"-skip\", \"qtactiveqt\", \"-skip\", \"qtcanvas3d\",\n            \"-skip\", \"qtenginio\", \"-skip\", \"qtlocation\", \"-skip\", \"qtmultimedia\",\n            \"-skip\", \"qtserialbus\", \"-skip\", \"qtserialport\",\n            \"-skip\", \"qtquickcontrols\", \"-skip\", \"qtquickcontrols2\",\n            \"-skip\", \"qtscript\", \"-skip\", \"qtsensors\",\n            \"-skip\", \"qtwebview\", \"-skip\", \"qtwebsockets\", \"-skip\", \"qtxmlpatterns\",\n            \"-confirm-license\", \"-opensource\"]\n\n    system \"./configure\", *args\n    system \"make\"\n    ENV.j1\n    system \"make\", \"install\"\n\n    # Some config scripts will only find Qt in a \"Frameworks\" folder\n    frameworks.install_symlink Dir[\"#{lib}/*.framework\"]\n\n    # The pkg-config files installed suggest that headers can be found in the\n    # `include` directory. Make this so by creating symlinks from `include` to\n    # the Frameworks' Headers folders.\n    Pathname.glob(\"#{lib}/*.framework/Headers\") do |path|\n      include.install_symlink path => path.parent.basename(\".framework\")\n    end\n\n    # configure saved PKG_CONFIG_LIBDIR set up by superenv; remove it\n    # see: https://github.com/Homebrew/homebrew/issues/27184\n    inreplace prefix/\"mkspecs/qconfig.pri\",\n              /\\n# pkgconfig\\n(PKG_CONFIG_(SYSROOT_DIR|LIBDIR) = .*\\n){2}\\n/,\n              \"\\n\"\n\n    # Move `*.app` bundles into `libexec` to expose them to `brew linkapps` and\n    # because we don't like having them in `bin`. Also add a `-qt5` suffix to\n    # avoid conflict with the `*.app` bundles provided by the `qt` formula.\n    # (Note: This move/rename breaks invocation of Assistant via the Help menu\n    # of both Designer and Linguist as that relies on Assistant being in `bin`.)\n    libexec.mkpath\n    Pathname.glob(\"#{bin}/*.app\") do |app|\n      mv app, libexec/\"#{app.basename(\".app\")}-qt5.app\"\n    end\n  end\n\n  def caveats; <<~EOS\n      We agreed to the Qt5 opensource license for you.\n      If this is unacceptable you should uninstall.\n    EOS\n  end\n\n  test do\n    (testpath/\"hello.pro\").write <<~EOS\n      QT       += core\n      QT       -= gui\n      TARGET = hello\n      CONFIG   += console\n      CONFIG   -= app_bundle\n      TEMPLATE = app\n      SOURCES += main.cpp\n    EOS\n\n    (testpath/\"main.cpp\").write <<~EOS\n      #include <QCoreApplication>\n      #include <QDebug>\n\n      int main(int argc, char *argv[])\n      {\n        QCoreApplication a(argc, argv);\n        qDebug() << \"Hello World!\";\n        return 0;\n      }\n    EOS\n\n    system bin/\"qmake\", testpath/\"hello.pro\"\n    system \"make\"\n    assert_predicate \"hello\", :exists?\n    assert_predicate \"main.o\", :exists?\n    system \"./hello\"\n  end\nend\n"
  },
  {
    "path": "Formula/qt-ifw.rb",
    "content": "class QtIfw < Formula\n  desc \"Tools and utilities to create installers for Qt desktop platforms\"\n  homepage \"http://qt-project.org/wiki/Qt-Installer-Framework\"\n  url \"https://download.qt.io/official_releases/qt-installer-framework/2.0.1/qt-installer-framework-opensource-2.0.1-src.tar.gz\"\n  sha256 \"9f3bdb46182cef0254920750315bb22ea83fef4b45ab19a00161175823fabd98\"\n\n  depends_on \"qt-ifw-qt5\"\n\n  def install\n    args = %w[installerfw.pro -config release]\n    args << \"PREFIX=#{prefix}\"\n\n    system \"#{Formula[\"qt-ifw-qt5\"].opt_bin}/qmake\", *args\n    system \"make\"\n    # system \"make\", \"docs\"\n\n    # no install targets, just copy to prefix\n    prefix.install \"bin\"\n    prefix.install \"lib\"\n    prefix.install \"examples\"\n    prefix.install Dir[\"LICENSE*\"], \"LGPL_EXCEPTION.txt\"\n    # doc.install \"doc/html\", \"doc/ifw.qch\"\n  end\n\n  def caveats; <<~EOS\n      We agreed to the Qt5 opensource license for you.\n      If this is unacceptable you should uninstall.\n    EOS\n  end\n\n  test do\n    # pass\n  end\nend\n"
  },
  {
    "path": "Formula/qt5-webkit-qt@5.7.rb",
    "content": "class NoQt5WebKitAlreadyRequirement < Requirement\n  fatal true\n  satisfy(:build_env => false) { !(Formula[\"qt@5.7\"].lib/\"QtWebKit.framework\").exist? }\n\n  def message; <<~EOS\n    Qt5 formula already has QtWebKit installed (e.g. built `--with-webkit``)\n  EOS\n  end\nend\n\nclass Qt5WebkitQtAT57 < Formula\n  desc \"QtWebit module for Qt 5.7.x\"\n  homepage \"https://download.qt.io/community_releases/5.7/5.7.1/\"\n  url \"https://download.qt.io/community_releases/5.7/5.7.1/qtwebkit-opensource-src-5.7.1.tar.xz\"\n  sha256 \"a46cf7c89339645f94a5777e8ae5baccf75c5fc87ab52c9dafc25da3327b5f03\"\n\n  keg_only \"Qt5 is keg-only\"\n\n  depends_on NoQt5WebKitAlreadyRequirement\n  # depends on \"pkg-config\" => :build\n\n  depends_on \"qt@5.7\"\n  # TODO: main qt5 formula does not use these, should we here?\n  #       the .pro setup seems to opportunistically check for them,\n  #       but depending upon the formulae does not help find them\n  # depends on \"fontconfig\"\n  # depends on \"icu4c\"\n  depends_on \"webp\" # might as well add it since compilation fails if lib found\n  depends_on \"libxslt\"\n  depends_on \"sqlite\"\n\n  # depends_on :macos => :mountain_lion # # error: unknown version\n  depends_on :xcode => :build\n\n  def install\n    # On Mavericks we want to target libc++, this requires a macx-clang flag.\n    if ENV.compiler == :clang && MacOS.version >= :mavericks\n      spec = \"macx-clang\"\n    else\n      spec = \"macx-g++\"\n    end\n    args = %W[-config release -spec #{spec}]\n\n    args << %Q(INCLUDEPATH+=\"#{Formula[\"webp\"].opt_include}\")\n\n    mkdir \"build\" do\n      system Formula[\"qt@5.7\"].bin/\"qmake\", \"../WebKit.pro\", *args\n      system \"make\"\n      ENV.deparallelize\n      # just let it install to qt@5.7 formula prefix\n      system \"make\", \"install\"\n    end\n\n    # now move installed bits back to this formula prefix\n    (lib/\"cmake\").mkpath\n    (lib/\"pkgconfig\").mkpath\n    # (prefix/\"imports\").mkpath # TODO: necessary for .pri?\n    (prefix/\"mkspecs/modules\").mkpath\n    (prefix/\"plugins\").mkpath\n    (prefix/\"qml\").mkpath\n    libexec.mkpath\n\n    qt5 = Formula[\"qt@5.7\"]\n    mv Dir[\"#{qt5.opt_lib}/QtWebKit*.framework\"], \"#{lib}/\"\n    mv Dir[\"#{qt5.opt_lib}/cmake/Qt5WebKit*\"], \"#{lib}/cmake/\"\n    mv Dir[\"#{qt5.opt_lib}/pkgconfig/Qt5WebKit*.pc\"], \"#{lib}/pkgconfig/\"\n    mv Dir[\"#{qt5.opt_prefix}/mkspecs/modules/qt_lib_webkit*.pri\"], \"#{prefix}/mkspecs/modules/\"\n    mv qt5.opt_prefix/\"plugins/webkit\", \"#{prefix}/plugins/\"\n    mv qt5.opt_prefix/\"qml/QtWebKit\", \"#{prefix}/qml/\"\n    mv qt5.opt_libexec/\"QtWebProcess\", \"#{libexec}/\"\n\n    # Some config scripts will only find Qt in a \"Frameworks\" folder\n    frameworks.install_symlink Dir[\"#{lib}/*.framework\"]\n\n    # The pkg-config files installed suggest that headers can be found in the\n    # `include` directory. Make this so by creating symlinks from `include` to\n    # the Frameworks' Headers folders.\n    Pathname.glob(\"#{lib}/*.framework/Headers\") do |path|\n      include.install_symlink path => path.parent.basename(\".framework\")\n    end\n\n    # update pkgconfig files\n    Dir[\"#{lib}/pkgconfig/Qt5WebKit*.pc\"].each do |pc|\n      inreplace pc do |s|\n        s.sub! /^(prefix=).*$/, \"\\\\1#{prefix}\"\n      end\n    end\n\n    # update .pri files\n    # TODO: unsure if QT_MODULE_IMPORT_BASE is relative to module or its imports\n    Dir[\"#{prefix}/mkspecs/modules/qt_lib_webkit*.pri\"].each do |pri|\n      inreplace pri do |s|\n        s.gsub! \"$$QT_MODULE_LIB_BASE\", opt_lib.to_s\n        next if pri.end_with? \"_private.pri\"\n        s.gsub! \"$$QT_MODULE_BIN_BASE\", opt_bin.to_s\n        s.gsub! \"$$QT_MODULE_LIBEXEC_BASE\", opt_libexec.to_s\n        s.gsub! \"$$QT_MODULE_PLUGIN_BASE\", (opt_prefix/\"plugins/webkit\").to_s\n        # s.gsub! \"$$QT_MODULE_IMPORT_BASE\", (opt_prefix/\"imports\").to_s\n        s.gsub! \"$$QT_MODULE_QML_BASE\", (opt_prefix/\"qml\").to_s\n      end\n    end\n\n    # fix up linking to QtWebKit*.frameworks in qt5 prefix path\n    machos = [\n      lib/\"QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets\",\n      libexec/\"QtWebProcess\",\n      prefix/\"qml/QtWebKit/libqmlwebkitplugin.dylib\",\n      prefix/\"qml/QtWebKit/experimental/libqmlwebkitexperimentalplugin.dylib\",\n    ]\n    qt5 = Formula[\"qt@5.7\"]\n    qt5_prefix = \"#{HOMEBREW_CELLAR}/#{qt5.name}/#{qt5.installed_version}\"\n    machos.each do |m|\n      dylibs = m.dynamically_linked_libraries\n      m.ensure_writable do\n        dylibs.each do |d|\n          next unless d.to_s =~ %r{^#{qt5_prefix}/lib/QtWebKit(Widgets)?\\.framework}\n          # Deprecated: Using MachO::Tools\n#          system \"install_name_tool\", \"-change\", d, d.sub(\"#{qt5_prefix}/lib\", opt_lib), m.to_s\n          MachO::Tools.change_dylib_name(d, d.sub(\"#{qt5_prefix}/lib\", opt_lib), m.to_s)\n        end\n      end\n    end\n  end\n\n  test do\n    (testpath/\"hello.pro\").write <<~EOS\n      QT        += core webkitwidgets\n      TARGET     = hello\n      CONFIG    += console\n      CONFIG    -= app_bundle\n      TEMPLATE   = app\n      HEADERS    = client.h\n      SOURCES   += client.cpp main.cpp\n      include(#{prefix}/mkspecs/modules/qt_lib_webkit.pri)\n      include(#{prefix}/mkspecs/modules/qt_lib_webkitwidgets.pri)\n    EOS\n\n    (testpath/\"client.h\").write <<~EOS\n    #ifndef CLIENT_H\n    #define CLIENT_H\n    #include <QWebPage>\n    #include <QString>\n\n    class Client : public QObject\n    {\n      Q_OBJECT\n\n    public:\n      Client(const QString &url, QObject *parent = 0);\n\n    private Q_SLOTS:\n      void loadUrl();\n      void output(bool ok);\n\n    private:\n      QWebPage page;\n      QString url;\n\n    };\n    #endif // CLIENT_H\n    EOS\n\n    (testpath/\"client.cpp\").write <<~EOS\n    #include \"client.h\"\n    #include <QCoreApplication>\n    #include <QDebug>\n    #include <QWebFrame>\n    #include <QUrl>\n\n    Client::Client(const QString &myurl, QObject *parent)\n      : QObject(parent)\n      , url(myurl)\n    {\n    }\n\n    void Client::loadUrl()\n    {\n      page.mainFrame()->load(QUrl(url));\n      connect(&page, SIGNAL(loadFinished(bool)), this, SLOT(output(bool)));\n    }\n\n    void Client::output(bool ok)\n    {\n      if (ok){\n        qDebug() << \"Page title: \" << page.mainFrame()->title();\n        QCoreApplication::exit(0);\n      } else {\n        qDebug() << \"Error loading \" << url;\n        QCoreApplication::exit(1);\n      }\n    }\n    EOS\n\n    (testpath/\"main.cpp\").write <<~EOS\n      #include <QApplication>\n      #include <QDebug>\n      #include <QTimer>\n      #include <QWebView>\n      #include \"client.h\"\n\n      int main(int argc, char *argv[])\n      {\n        QApplication app(argc, argv);\n        Client c(\"http://www.example.com/\", app.instance());\n        qDebug() << \"Running application\";\n        QTimer::singleShot(1000, &c, SLOT(loadUrl()));\n        return app.exec();\n      }\n    EOS\n\n    cd testpath do\n      system Formula[\"qt@5.7\"].bin/\"qmake\", \"hello.pro\"\n      system \"make\"\n      assert_predicate \"client.o\", :exists?\n      assert_predicate \"moc_client.o\", :exists?\n      assert_predicate \"main.o\", :exists?\n      assert_predicate \"hello\", :exists?\n      system \"./hello\"\n    end\n  end\nend\n"
  },
  {
    "path": "Formula/qtkeychain-qt@5.7.rb",
    "content": "class QtkeychainQtAT57 < Formula\n  desc \"Platform-independent Qt API for storing passwords securely\"\n  homepage \"https://github.com/frankosterfeld/qtkeychain\"\n  url \"https://github.com/frankosterfeld/qtkeychain/archive/d077333d7c4bb2846b9de9f3b8631a0b58f70a7e.tar.gz\"\n  version \"0.7.90\"\n  sha256 \"fe766d6189ffd89f5c8303833b43b832b13e14481970466ac09821e28d103f08\"\n\n  head \"https://github.com/frankosterfeld/qtkeychain.git\", :using => :git\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    cellar :any\n    sha256 \"ca83e609900bee30417f87265e50775eaa4bf20ca82fc0ad1ff755a6632fd178\" => :sierra\n  end\n\n  keg_only \"Qt5 is keg-only\"\n\n  option \"with-static\", \"Build static in addition to shared library\"\n  option \"with-translations\", \"Generate Qt translation (.ts) files\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"qt@5.7\"\n\n  def install\n    args = std_cmake_args\n    args << \"-DQTKEYCHAIN_STATIC=OFF\"\n    args << \"-DBUILD_WITH_QT4=OFF\"\n    args << \"-DBUILD_TRANSLATIONS=#{build.with?(\"translations\") ? \"ON\" : \"OFF\"}\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\", \"install\"\n      (libexec/\"bin\").install \"testclient\"\n      system \"install_name_tool\", \"-change\", \"@rpath/libqt5keychain.1.dylib\",\n             \"#{opt_lib}/libqt5keychain.1.dylib\",\n             \"#{libexec}/bin/testclient\"\n\n      if build.with? \"static\"\n        args << \"-DQTKEYCHAIN_STATIC=ON\"\n        system \"cmake\", \"..\", *args\n        system \"make\"\n        mv \"libqtkeychain.a\", lib/\"libqtkeychain_static.a\"\n      end\n    end\n  end\n\n  def caveats\n    if build.with? \"static\"\n      <<~EOS\n        Static library is available at:\n          #{opt_lib}/libqtkeychain_static.a\n      EOS\n    end\n  end\n\n  test do\n    assert_match \"Password deleted successfully\",\n                 shell_output(libexec/\"bin/testclient delete something\")\n  end\nend\n"
  },
  {
    "path": "Formula/travis-cache-seed.rb",
    "content": "class TravisCacheSeed < Formula\n  desc \"Trigger update of Travis CI cache with geospatial dependencies\"\n  homepage \"https://github.com/OSGeo/homebrew-osgeo4mac\"\n  url \"https://osgeo4mac.s3.amazonaws.com/src/dummy.tar.gz\"\n  version \"0.0.1\"\n  sha256 \"e7776e2ff278d6460300bd69a26d7383e6c5e2fbeb17ff12998255e7fc4c9511\"\n\n  keg_only \"because it doesn't really install anything\"\n\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"bison\"\n  depends_on \"boost\"\n  depends_on \"cairo\"\n  depends_on \"cgal\"\n  depends_on \"cmake\" => :build\n  depends_on \"coreutils\"\n  depends_on \"expat\"\n  depends_on \"fcgi\"\n  depends_on \"fftw\"\n  depends_on \"flex\"\n  depends_on \"freetype\"\n  depends_on \"gdal2-python\"\n  depends_on \"gdal2\"\n  depends_on \"geos\"\n  depends_on \"gettext\"\n  depends_on \"ghostscript\"\n  # depends on \"git\"\n  depends_on \"glew\"\n  depends_on \"glfw\"\n  # depends on \"gnupg\"\n  # depends on \"gpg-agent\"\n  depends_on \"gpsbabel-qt4\"\n  depends_on \"gsl\"\n  # depends on \"brewsci/science/insighttoolkit\"\n  # depends on \"brewsci/science/osgearth\"\n  depends_on \"jpeg\"\n  depends_on \"lbzip2\"\n  # depends on \"libevent\"\n  depends_on \"osgeo-libgeotiff\"\n  depends_on \"libgpg-error\"\n  depends_on \"libharu\"\n  depends_on \"libkml\"\n  depends_on \"libpng\"\n  depends_on \"libssh\"\n  depends_on \"libsvm\"\n  depends_on \"libtiff\"\n  depends_on \"libtool\" => :build\n  depends_on \"minizip\"\n  depends_on \"muparser\"\n  # depends on \"mysql\"\n  # depends on \"numpy\"\n  depends_on \"open-scene-graph\"\n  depends_on \"openssl\"\n  depends_on \"osgeo-ossim\"\n  depends_on \"pcre\"\n  depends_on \"pkg-config\" => :build\n  # depends on \"postgis\" # creates dep on gdal 1.x\n  depends_on \"osgeo-postgresql\"\n  depends_on \"osgeo-proj\"\n  depends_on \"pyenv\"\n  depends_on \"pyqt-qt4\"\n  depends_on \"pyspatialite\"\n  depends_on \"python\"\n  # depends on \"python3\"\n  depends_on \"qca-qt4\"\n  depends_on \"qhull\"\n  depends_on \"qjson-qt4\"\n  depends_on \"qscintilla2-qt4\"\n  depends_on \"qt-4\"\n  depends_on \"qwt-qt4\"\n  depends_on \"qwtpolar-qt4\"\n  depends_on \"readline\"\n  depends_on \"sfcgal\"\n  depends_on \"sip-qt4\"\n  depends_on \"spatialindex\"\n  depends_on \"sqlite\"\n  depends_on \"swig\" => :build\n  depends_on \"tinyxml\"\n  depends_on \"unixodbc\"\n  # depends on \"vtk\"\n  # depends on \"wxmac\"\n  # depends on \"wxpython\"\n  depends_on \"zlib\"\n\n  def install\n    (share/\"blank\").write \"blank\"\n  end\n\n  def caveats; <<~EOS\n    Formula does not install anything per se. Just updates cache at Travis CI\n    with geospatial dependencies to reduce build times of larger formulae.\n\n    Example `.travis.yml` settings:\n\n      cache:\n        directories:\n          - /usr/local\n        timeout: 900\n      before_cache:\n        - brew cleanup\n\n    EOS\n  end\n\n  test do\n    #\n  end\nend\n"
  },
  {
    "path": "LICENSE",
    "content": "BSD 3-Clause License\n\nCopyright (c) 2003, Open Source Geospatial Foundation\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n* Neither the name of the copyright holder nor the names of its\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "README.md",
    "content": "![docs/assets/images/osgeo-logo-brew-rgb.png](docs/assets/images/osgeo-logo-brew-rgb.png)\n\n\n\n# Homebrew-osgeo4mac\n\n**Build Status**: [![CircleCI](https://circleci.com/gh/OSGeo/homebrew-osgeo4mac.svg?style=svg)](https://circleci.com/gh/OSGeo/homebrew-osgeo4mac)\n\nThis is the [homebrew's][homebrew] tap for the **stable** versions of the [OSGeo][osgeo] geospatial toolset for macOS. We provide up-to-date and easy-to-install formulae for the end user of several projects as [PROJ][proj], [GDAL][gdal] or [PostGIS][postgis]. The tap also includes formulae that may not be specifically from an OSGeo project, but do extend the toolset's functionality.\n\n## How do I install these formulae?\n\nJust `brew tap osgeo/osgeo4mac` and then `brew install <formula>`. Easy, isn't it? \n\nYou can also install via URL:\n\n```shell\n$ brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/master/Formula/<formula>.rb\n```\n\n## Docs\n\nRun `brew help`, `man brew`, check the [Homebrew documentation][documentation] or the [tap documentation][osgeo4mac-docs].\n\n## Help wanted :sos:\n\nIf you are interested in collaborating more close with us in the repo maintenance, formula development or just have an idea to take this tap further, please tell us. Any help, idea or suggestion is really welcomed because we want this top to be useful to people that are interested into use OSGeo toolset on macOS. \n\nIn addition to the normal communication over the issue tracker in this repo we also have a have a slack  workplace were we discuss repo matters in a more dynamic way. If you want to join us, because you are interested into collaborate in the discussion please tell us. \n\n\n[homebrew]: http://brew.sh\n[taps]: https://github.com/Homebrew/homebrew-versions\n[osgeo]: https://www.osgeo.org\n[proj]: https://github.com/OSGeo/PROJ\n[gdal]: https://github.com/OSGeo/gdal\n[postgis]: https://postgis.net/\n[documentation]: https://github.com/Homebrew/brew/tree/master/docs#readme\n[osgeo4mac-docs]: https://osgeo.github.io/homebrew-osgeo4mac/\n\n[taps-docs]: https://docs.brew.sh/Taps\n[homebrew-core]: https://github.com/Homebrew/homebrew-core\n"
  },
  {
    "path": "Requirements/gdal_third_party.rb",
    "content": "class GdalThirdParty < Requirement\n  fatal true\n\n  satisfy do\n    envar = ENV['GDAL_THIRD_PARTY']\n    envar && File.exists?(envar)\n  end\n\n  def message; <<~EOS\n    Define GDAL_THIRD_PARTY environment variable that points to a directory,\n    which contains the unaltered download archive of the third-party library:\n\n      `export GDAL_THIRD_PARTY=/path/to/gdal/third-party/directory`\n\n  EOS\n  end\nend"
  },
  {
    "path": "Requirements/grass_requirements.rb",
    "content": "class UnlinkedGRASS7 < Requirement\n  fatal true\n\n  def unlinked_grass\n    found = `readlink ${HOMEBREW_PREFIX}/bin/grass7* | egrep -o '/grass[^/]*/' | tr -d '/' | tr -d '\\n'`\n    return found.empty?, found\n  end\n\n  satisfy(:build_env => false) { unlinked_grass[0] }\n\n  def message\n    grass_f = unlinked_grass[1]\n    <<~EOS\n\n      Another GRASS 7.x formula is linked: #{grass_f}\n\n      Do `brew unlink #{grass_f}` then try installing this formula again.\n      You can leave #{grass_f} unlinked and installed as keg-only;\n      however, launching it as keg-only may cause issues or crashes, since it\n      will be now be referencing Python modules of any newly linked GRASS.\n\n      Keep all GRASS formulae unlinked if you wish to run multiple installs.\n\n    EOS\n  end\nend\n\nclass UnlinkedGRASS6 < Requirement\n  fatal true\n\n  def unlinked_grass\n    found = `readlink ${HOMEBREW_PREFIX}/bin/grass6* | egrep -o '/grass[^/]*/' | tr -d '/' | tr -d '\\n'`\n    return found.empty?, found\n  end\n\n  satisfy(:build_env => false) { unlinked_grass[0] }\n\n  def message\n    grass_f = unlinked_grass[1]\n    <<~EOS\n\n      Another GRASS 6.x formula is linked: #{grass_f}\n\n      Do `brew unlink #{grass_f}` then try installing this formula again.\n      You can leave #{grass_f} unlinked and installed as keg-only;\n      however, launching it as keg-only may cause issues or crashes, since it\n      will be now be referencing Python modules of any newly linked GRASS.\n\n      Keep all GRASS formulae unlinked if you wish to run multiple installs.\n\n    EOS\n  end\nend\n"
  },
  {
    "path": "Requirements/qgis_requirements.rb",
    "content": "class UnlinkedQGIS2 < Requirement\n  fatal true\n\n  def unlinked_qgis\n    found = `readlink ${HOMEBREW_PREFIX}/bin/qgis | egrep -o '/qgis[^/]*/' | tr -d '/' | tr -d '\\n'`\n    return found.empty?, found\n  end\n\n  satisfy(:build_env => false) { unlinked_qgis[0] }\n\n  def message\n    qgis_f = unlinked_qgis[1]\n    <<~EOS\n\n      Another QGIS formula is linked: #{qgis_f}\n\n      Do `brew unlink #{qgis_f}` then try installing this formula again.\n      You can leave #{qgis_f} unlinked and installed as keg-only;\n      however, launching it as keg-only may cause issues or crashes, since it\n      will be now be referencing Python modules of any newly linked QGIS.\n\n      Issue can be overcome by setting PYTHONPATH, e.g. in the app's Options.\n\n      Or, keep all QGIS formulae unlinked if you wish to run multiple installs.\n\n    EOS\n  end\nend\n\nclass SipBinary < Requirement\n  fatal true\n  #noinspection RubyResolve\n#  default_formula 'sip'\n  satisfy(:build_env => false) { which 'sip' }\n\n  def message\n    <<~EOS\n      The `sip` binary is missing. It is needed to generate the Python bindings for QGIS.\n      Ensure `sip` formula is installed and linked.\n\n    EOS\n  end\nend\n\nclass PyQtConfig < Requirement\n  fatal true\n  #noinspection RubyResolve\n#  default_formula 'pyqt'\n  # pyqtconfig is not created with PyQt4 >= 4.10.x when using configure-ng.\n  # Homebrew's `pyqt` formula corrects this. Remains an issue until QGIS project\n  # adjusts FindPyQt.py in CMake setup to work with configure-ng.\n  satisfy(:build_env => false) { quiet_system 'python', '-c', 'from PyQt4 import pyqtconfig' }\n\n  def message\n    <<~EOS\n      Python could not import the PyQt4.pyqtconfig module. This will cause the QGIS build to fail.\n      The most common reason for this failure is that the PYTHONPATH needs to be adjusted.\n      The `pyqt` caveats explain this adjustment and may be reviewed using:\n\n          brew info pyqt\n\n      Ensure `pyqt` formula is installed and linked, and that it includes the `pyqtconfig` module.\n\n    EOS\n  end\nend\n"
  },
  {
    "path": "Strategies/cache-download.rb",
    "content": "class CacheDownloadStrategy < CurlDownloadStrategy\n  def fetch\n    archive = @url.sub(%r[^file://], \"\")\n    unless File.exists?(archive)\n      odie <<~EOS\n        Formula expects to locate the following archive:\n          #{Pathname.new(archive).basename}\n\n        in the HOMEBREW_CACHE directory:\n          #{HOMEBREW_CACHE}\n\n        Copy archive to cache or create a symlink in cache to archive:\n          ln -sf /path/to/archive $(brew --cache)/\n      EOS\n    end\n    super\n  end\nend\n"
  },
  {
    "path": "boneyard/brew-stack.rb",
    "content": "# Install a formula and dependencies from pre-made bottles or as built bottles.\n#\n# Useful for creating a portable Homebrew directory for a specific OS version.\n# Example: portable domain-specific software stack in custom Homebrew prefix\n#\n# Hint: Use command in `brew bundle` Brewfiles to quickly build full stacks.\n#       Also, --dry option helps create correctly ordered Brewfiles when you\n#       want to use custom options for dependencies and build those first.\n\nrequire \"formula\"\nrequire \"cmd/deps\"\nrequire \"utils\"\nrequire \"hooks/bottles\"\n\ndef usage; <<-EOS\n  Usage: brew stack [--dry] [install-options...] formula [formula-options...]\n\n         Same options as for `brew install`, but only for a single formula.\n         Note: --interactive install option is not supported\n\n  Options: --dry  Don't install anything, just output topologically ordered list\n                  of install commands.\n           --all  List all dependencies, including installed, on --dry run.\n\n  EOS\nend\n\n\nclass Stack\n  attr_reader :f, :opts, :argv, :dry, :all, :verbose\n\n  # Variable to track what's been installed, to avoid endless loops with --dry.\n  @@dry_installed = []\n  @@first_run = true\n\n  def initialize formula, options=[], argv=nil, dry=false, all=false, verbose=false\n    @f = formula\n    @opts = options\n    @argv = argv\n    @dry = dry\n    @all = all\n    @verbose = verbose\n  end\n\n  def tap_name(f_obj)\n    (f_obj.tap? ? f_obj.tap.sub(\"homebrew-\", \"\") + \"/\" : \"\") + f_obj.name\n  end\n\n  def to_tap_names(f_name_list)\n    f_name_list.map { |f| tap_name(Formulary.factory(f)) }\n  end\n\n  def oohai title, *sput\n    # don't truncate, like ohai\n    puts \"#{Tty.blue}==>#{Tty.white} #{title}#{Tty.reset}\"\n    puts sput unless sput.empty?\n  end\n\n  def ooh1 title\n    # don't truncate, like oh1\n    puts \"#{Tty.green}==>#{Tty.white} #{title}#{Tty.reset}\"\n  end\n\n  def owell title\n    puts \"#{Tty.gray}==>#{Tty.white} #{title}#{Tty.reset}\"\n  end\n\n  def install\n    # Install dependencies in topological order.\n    # This is necessary to ensure --build-bottle is used for any source builds.\n    f_build_opts = @f.build.used_options.as_flags\n    unless @argv && @argv.ignore_deps?\n      deps = Homebrew.deps_for_formula(@f, true) # recurse\n      deps = deps.reject { |d| d.installed? } unless @dry && @all\n      deps = deps.reject { |d| @@dry_installed.include?(tap_name(d.to_formula)) } if @dry\n\n      if @dry\n        if @verbose\n          oohai \"Installed formulae: #{to_tap_names(%x[brew list].split(\"\\n\")).join(\" \")}\\n\" if @@first_run\n          unless f_build_opts.empty?\n            oohai \"Options used, #{@f.name}: #{f_build_opts.join(\" \")}\"\n            oohai \"Options unused, #{@f.name}: #{(@f.build.as_flags - f_build_opts).join(\" \")}\"\n          end\n        end\n        unless deps.empty?\n          deps_w_opts = deps.map do |d|\n            d.to_s + (d.options.empty? ? \"\" : \" \") + d.options.as_flags.join(\" \")\n          end\n          oohai \"Deps needed, #{@f.name}: #{deps_w_opts.join(\", \")}\"\n        end\n        puts if @@first_run\n      end\n      @@first_run = false\n\n      deps.each do |d|\n        d_obj = d.to_formula\n        d_args = []\n        d_args.concat @opts - f_build_opts + d.options.as_flags\n        # strip these options\n        d_args -= %W[--ignore-dependencies --only-dependencies]\n        d_args -= %W[--build-from-source --force-bottle --build-bottle]\n        d_args -= %W[--devel --HEAD]\n        # recurse down into dependencies, nixing argv\n        Stack.new(d_obj, options=d_args, argv=nil, dry=@dry, all=@all, verbose=@verbose).install\n      end unless deps.empty?\n    end\n\n    # Install formula\n    unless @argv && @argv.only_deps?\n      f_tap_name = tap_name(@f)\n      if (@f.installed? && !(@dry && @all)) || (@dry && @@dry_installed.include?(f_tap_name))\n        owell \"#{f_tap_name} already installed\"\n      else\n        f_args = []\n        f_args.concat @opts\n        if (@argv && @argv.build_from_source?) || !pour_bottle?(@f)\n          f_args |= %W[--build-bottle]\n        end\n        attempt_install @f, f_args\n      end\n    end\n  end\n\n  def attempt_install f_obj, args\n    f_tap_name = tap_name(f_obj)\n    args -= %W[--dry --all --build-from-source]\n    args << f_tap_name\n    ooh1 \"brew install #{args.join(\" \")}\"\n    if @dry\n      @@dry_installed += [f_tap_name]\n      return\n    end\n\n    return if system \"brew\", \"install\", *args\n\n    if args.include?(\"--build-bottle\")\n      odie \"Source bottle build failed\"\n    else\n      opoo \"Bottle may have failed to install\"\n      ohai \"Attempting to build bottle from source\"\n      args |= %W[--build-bottle]\n\n      return if system \"brew\", \"install\", *args\n      odie \"Source bottle build failed\"\n    end\n  end\n\n  def pour_bottle? f\n    # Culled from FormulaInstaller::pour_bottle?\n    return true  if Homebrew::Hooks::Bottles.formula_has_bottle?(f)\n\n    return true  if @argv && @argv.force_bottle? && f.bottle\n    return false if @argv && (@argv.build_from_source? || @argv.build_bottle?)\n    return false unless f.build.used_options.empty?\n\n    return true  if f.local_bottle_path\n    return false unless f.bottle && f.pour_bottle?\n\n    f.requirements.each do |req|\n      next if req.optional? || req.pour_bottle?\n      opoo \"Bottle for #{f} blocked by #{req} requirement\"\n      return false\n    end\n\n    unless f.bottle.compatible_cellar?\n      opoo \"Cellar of #{f}'s bottle is #{f.bottle.cellar}\"\n      return false\n    end\n\n    true\n  end\n\nend\n\n# Necessary to raise error if bottle fails to install\nENV[\"HOMEBREW_DEVELOPER\"] = \"1\"\n\nif ARGV.formulae.length != 1 || ARGV.interactive?\n  puts usage\n  exit 1\nend\n\nif ARGV.include? \"--help\"\n  puts usage\n  exit 0\nend\n\nStack.new(\n    ARGV.formulae[0],\n    options=ARGV.options_only,\n    argv=ARGV,\n    dry=ARGV.include?(\"--dry\"),\n    all=ARGV.include?(\"--all\"),\n    verbose=(ARGV.verbose? || ARGV.switch?(\"v\"))\n).install\n\nputs \"\\n  ---------- DRY RUN ----------\" if ARGV.include?(\"--dry\")\n\nexit 0\n"
  },
  {
    "path": "boneyard/enki.rb",
    "content": "require \"formula\"\n\nclass Enki < Formula\n  homepage \"http://enki-editor.org/\"\n  url \"https://github.com/hlamer/enki/archive/v13.11.1.tar.gz\"\n  sha1 \"2bcf6bb14550b07c5a227a5525834aa28849fb59\"\n\n  depends_on :python\n  depends_on \"pyqt\"\n  depends_on \"qutepart\"\n  depends_on \"ctags\" => :recommended\n  depends_on \"pyparsing\" => [:python]\n  depends_on \"markdown\" => [:python]\n  depends_on \"docutils\" => [:python]\n\n  def install\n    ENV.deparallelize\n    system \"python\", \"setup.py\", \"install\", \"--prefix=#{prefix}\"\n  end\n\n  test do\n    assert_equal %x(enki --version).strip, \"enki #{version}\"\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal-110.rb",
    "content": "require 'formula'\n\nclass Gdal110 < Formula\n  homepage 'http://www.gdal.org/'\n  url 'http://download.osgeo.org/gdal/1.10.1/gdal-1.10.1.tar.gz'\n  sha256 '9984f0314c0bd831eb59fb646c2bc5e13cf1378be4f51499045166cbe62be6ea'\n\n  option 'complete', 'Use additional Homebrew libraries to provide more drivers.'\n  option 'enable-opencl', 'Build with OpenCL acceleration.'\n  option 'enable-armadillo', 'Build with Armadillo accelerated TPS transforms.'\n  option 'enable-unsupported', \"Allow configure to drag in any library it can find. Invoke this at your own risk.\"\n  option 'enable-mdb', 'Build with Access MDB driver (requires Java 1.6+ JDK/JRE, from Apple or Oracle).'\n\n  keg_only \"Older version; gdal is in main tap and installs same components\"\n\n  depends_on :python => :recommended\n  if build.with? \"python\"\n    depends_on \"fortran\" => :build\n  end\n\n  depends_on 'libpng'\n  depends_on 'jpeg'\n  depends_on 'giflib'\n  depends_on 'libtiff'\n  depends_on 'libgeotiff'\n  depends_on 'proj'\n  depends_on 'geos'\n\n  depends_on 'sqlite' # To ensure compatibility with SpatiaLite.\n  depends_on 'freexl'\n  depends_on 'libspatialite'\n\n  depends_on \"postgresql\" => :optional\n  depends_on \"mysql\" => :optional\n\n  depends_on 'homebrew/science/armadillo' if build.include? 'enable-armadillo'\n\n  depends_on \"homebrew/versions/openjpeg20\" if build.include? 'enable-unsupported'\n\n  if build.include? 'complete'\n    # Raster libraries\n    depends_on \"homebrew/science/netcdf\" # Also brings in HDF5\n    depends_on \"jasper\"\n    depends_on \"webp\"\n    depends_on \"cfitsio\"\n    depends_on \"epsilon\"\n    depends_on \"libdap\"\n\n    # Vector libraries\n    depends_on \"unixodbc\" # OS X version is not complete enough\n    depends_on \"xerces-c\"\n\n    # Other libraries\n    depends_on \"xz\" # get liblzma compression algorithm library from XZutils\n    depends_on \"poppler\"\n  end\n\n  # Prevent build failure on 10.6 / 10.7: http://trac.osgeo.org/gdal/ticket/5197\n  # Fix build against MySQL 5.6.x: http://trac.osgeo.org/gdal/ticket/5284\n  patch :DATA\n\n  stable do\n    # Patch of configure that finds Mac Java for MDB driver (uses Oracle or Mac default JDK)\n    # TODO: Remove when future GDAL release includes a fix\n    # http://trac.osgeo.org/gdal/ticket/5267  (patch applied to trunk, 2.0 release milestone)\n    # Must come before DATA\n    patch do\n      url \"https://gist.githubusercontent.com/dakcarto/6877854/raw/82ae81e558c0b6048336f0acb5d7577bd0a237d5/gdal-mdb-patch.diff\"\n      sha256 \"63bf3d3d984dd851856a5d61c85828978f0f0b0ed3bbff9dce01a4c38309bfb7\"\n    end if build.include? \"enable-mdb\"\n  end\n\n  resource 'numpy' do\n    url 'http://downloads.sourceforge.net/project/numpy/NumPy/1.8.1/numpy-1.8.1.tar.gz'\n    sha256 'd4f85af64afe57a76e2b3a79cfcac740fb8ce8a3cd6402662f3c760abfa515e4'\n  end\n\n  def get_configure_args\n    args = [\n      # Base configuration.\n      \"--prefix=#{prefix}\",\n      \"--mandir=#{man}\",\n      \"--disable-debug\",\n      \"--with-local=#{prefix}\",\n      \"--with-threads\",\n      \"--with-libtool\",\n\n      # GDAL native backends.\n      \"--with-pcraster=internal\",\n      \"--with-pcidsk=internal\",\n      \"--with-bsb\",\n      \"--with-grib\",\n      \"--with-pam\",\n\n      # Backends supported by OS X.\n      \"--with-libiconv-prefix=/usr\",\n      \"--with-libz=/usr\",\n      \"--with-png=#{Formula[\"libpng\"].opt_prefix}\",\n      \"--with-expat=/usr\",\n      \"--with-curl=/usr/bin/curl-config\",\n\n      # Default Homebrew backends.\n      \"--with-jpeg=#{HOMEBREW_PREFIX}\",\n      \"--without-jpeg12\", # Needs specially configured JPEG and TIFF libraries.\n      \"--with-gif=#{HOMEBREW_PREFIX}\",\n      \"--with-libtiff=#{HOMEBREW_PREFIX}\",\n      \"--with-geotiff=#{HOMEBREW_PREFIX}\",\n      \"--with-sqlite3=#{Formula[\"sqlite\"].opt_prefix}\",\n      \"--with-freexl=#{HOMEBREW_PREFIX}\",\n      \"--with-spatialite=#{HOMEBREW_PREFIX}\",\n      \"--with-geos=#{HOMEBREW_PREFIX}/bin/geos-config\",\n      \"--with-static-proj4=#{HOMEBREW_PREFIX}\",\n\n      # GRASS backend explicitly disabled.  Creates a chicken-and-egg problem.\n      # Should be installed separately after GRASS installation using the\n      # official GDAL GRASS plugin.\n      \"--without-grass\",\n      \"--without-libgrass\"\n    ]\n\n    # Optional Homebrew packages supporting additional formats.\n    supported_backends = %w[\n      liblzma\n      cfitsio\n      hdf5\n      netcdf\n      jasper\n      xerces\n      odbc\n      dods-root\n      epsilon\n      webp\n      poppler\n    ]\n    if build.include? 'complete'\n      supported_backends.delete 'liblzma'\n      args << '--with-liblzma=yes'\n      args.concat supported_backends.map {|b| '--with-' + b + '=' + HOMEBREW_PREFIX}\n    else\n      args.concat supported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported'\n    end\n\n    # The following libraries are either proprietary, not available for public\n    # download or have no stable version in the Homebrew core that is\n    # compatible with GDAL. Interested users will have to install such software\n    # manually and most likely have to tweak the install routine.\n    #\n    # Podofo is disabled because Poppler provides the same functionality and\n    # then some.\n    unsupported_backends = %w[\n      gta\n      ogdi\n      fme\n      hdf4\n      openjpeg\n      fgdb\n      ecw\n      kakadu\n      mrsid\n      jp2mrsid\n      mrsid_lidar\n      msg\n      oci\n      ingres\n      libkml\n      dwgdirect\n      idb\n      sde\n      podofo\n      rasdaman\n    ]\n    args.concat unsupported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported'\n\n    # Database support.\n    args << (build.with?(\"postgresql\") ? \"--with-pg=#{HOMEBREW_PREFIX}/bin/pg_config\" : \"--without-pg\")\n    args << (build.with?(\"mysql\") ? \"--with-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config\" : \"--without-mysql\")\n\n    if build.include? 'enable-mdb'\n      args << \"--with-java=yes\"\n      # The rpath is only embedded for Oracle (non-framework) installs\n      args << \"--with-jvm-lib-add-rpath=yes\"\n      args << \"--with-mdb=yes\"\n    end\n\n    # There is a problem with compiling and avx, so disable avx for HEAD builds\n    args << \"--without-avx\" if build.head?\n\n    # Python is installed manually to ensure everything is properly sandboxed.\n    args << '--without-python'\n\n    # Scripting APIs that have not been re-worked to respect Homebrew prefixes.\n    #\n    # Currently disabled as they install willy-nilly into locations outside of\n    # the Homebrew prefix.  Enable if you feel like it, but uninstallation may be\n    # a manual affair.\n    #\n    # TODO: Fix installation of script bindings so they install into the\n    # Homebrew prefix.\n    args << \"--without-perl\"\n    args << \"--without-php\"\n    args << \"--without-ruby\"\n\n    args << (build.include?(\"enable-opencl\") ? \"--with-opencl\" : \"--without-opencl\")\n    args << (build.include?(\"enable-armadillo\") ? \"--with-armadillo=yes\" : \"--with-armadillo=no\")\n\n    return args\n  end\n\n  def install\n    if build.with? 'python'\n      ENV.prepend_create_path 'PYTHONPATH', libexec+'lib/python2.7/site-packages'\n      numpy_args = [ \"build\", \"--fcompiler=gnu95\",\n                     \"install\", \"--prefix=#{libexec}\" ]\n      resource('numpy').stage { system \"python\", \"setup.py\", *numpy_args }\n    end\n\n    # Linking flags for SQLite are not added at a critical moment when the GDAL\n    # library is being assembled. This causes the build to fail due to missing\n    # symbols. Also, ensure Homebrew SQLite is used so that Spatialite is\n    # functional.\n    #\n    # Fortunately, this can be remedied using LDFLAGS.\n    sqlite = Formula[\"sqlite\"]\n    ENV.append 'LDFLAGS', \"-L#{sqlite.opt_lib} -lsqlite3\"\n    ENV.append 'CFLAGS', \"-I#{sqlite.opt_include}\"\n    # Needed by libdap\n    ENV.libxml2 if build.include? 'complete'\n\n    # Reset ARCHFLAGS to match how we build.\n    ENV['ARCHFLAGS'] = \"-arch #{MacOS.preferred_arch}\"\n\n    # Fix hardcoded mandir: http://trac.osgeo.org/gdal/ticket/5092\n    inreplace 'configure', %r[^mandir='\\$\\{prefix\\}/man'$], ''\n\n    system \"./configure\", *get_configure_args\n    system \"make\"\n    system \"make install\"\n\n    # `python-config` may try to talk us into building bindings for more\n    # architectures than we really should.\n    if MacOS.prefer_64_bit?\n      ENV.append_to_cflags \"-arch #{Hardware::CPU.arch_64_bit}\"\n    else\n      ENV.append_to_cflags \"-arch #{Hardware::CPU.arch_32_bit}\"\n    end\n\n    cd 'swig/python' do\n      system \"python\", \"setup.py\", \"install\", \"--prefix=#{prefix}\", \"--record=installed.txt\", \"--single-version-externally-managed\"\n      bin.install Dir['scripts/*']\n    end\n\n    system 'make', 'man' if build.head?\n    system 'make', 'install-man'\n    # Clean up any stray doxygen files.\n    Dir[bin + '*.dox'].each { |p| rm p }\n  end\n\n  def caveats\n    if build.include? 'enable-mdb'\n      <<~EOS\n\n      To have a functional MDB driver, install supporting .jar files in:\n        `/Library/Java/Extensions/`\n\n      See: `http://www.gdal.org/ogr/drv_mdb.html`\n      EOS\n    end\n  end\nend\n\n__END__\ndiff --git a/GDALmake.opt.in b/GDALmake.opt.in\nindex d7273aa..2fcbd53 100644\n--- a/GDALmake.opt.in\n+++ b/GDALmake.opt.in\n@@ -123,6 +123,7 @@ INGRES_INC = @INGRES_INC@\n HAVE_MYSQL =\t@HAVE_MYSQL@\n MYSQL_LIB  =\t@MYSQL_LIB@\n MYSQL_INC  =\t@MYSQL_INC@\n+MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION  =    @MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION@\n LIBS\t   +=\t$(MYSQL_LIB)\n \n #\ndiff --git a/configure b/configure\nindex 1c4f8fb..120b17f 100755\n--- a/configure\n+++ b/configure\n@@ -700,6 +700,7 @@ INGRES_INC\n INGRES_LIB\n II_SYSTEM\n HAVE_INGRES\n+MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION\n MYSQL_LIB\n MYSQL_INC\n HAVE_MYSQL\n@@ -23045,6 +23046,34 @@ $as_echo \"no, mysql is pre-4.x\" >&6; }\n       MYSQL_INC=\"`$MYSQL_CONFIG --include`\"\n       { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes\" >&5\n $as_echo \"yes\" >&6; }\n+\n+      # Check if mysql headers declare load_defaults\n+      { $as_echo \"$as_me:${as_lineno-$LINENO}: checking load_defaults() in MySQL\" >&5\n+$as_echo_n \"checking load_defaults() in MySQL... \" >&6; }\n+      rm -f testmysql.*\n+      echo '#include \"my_global.h\"' > testmysql.cpp\n+      echo '#include \"my_sys.h\"' >> testmysql.cpp\n+      echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\n+      if test -z \"`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`\" ; then\n+        { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes, found in my_sys.h\" >&5\n+$as_echo \"yes, found in my_sys.h\" >&6; }\n+      else\n+        echo 'extern \"C\" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp\n+        echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\n+        if test -z \"`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`\" ; then\n+            { $as_echo \"$as_me:${as_lineno-$LINENO}: result: yes, found in library but not in header\" >&5\n+$as_echo \"yes, found in library but not in header\" >&6; }\n+            MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes\n+        else\n+            HAVE_MYSQL=no\n+            MYSQL_LIB=\n+            MYSQL_INC=\n+            as_fn_error $? \"Cannot find load_defaults()\" \"$LINENO\" 5\n+        fi\n+      fi\n+      rm -f testmysql.*\n+      rm -f testmysql\n+\n \t;;\n   esac\n fi\n@@ -23055,6 +23084,8 @@ MYSQL_INC=$MYSQL_INC\n \n MYSQL_LIB=$MYSQL_LIB\n \n+MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=$MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION\n+\n \n \n \ndiff --git a/configure.in b/configure.in\nindex 481e8ea..d83797f 100644\n--- a/configure.in\n+++ b/configure.in\n@@ -2294,6 +2294,31 @@ else\n       MYSQL_LIB=\"`$MYSQL_CONFIG --libs`\"\n       MYSQL_INC=\"`$MYSQL_CONFIG --include`\"\n       AC_MSG_RESULT([yes])\n+\n+      # Check if mysql headers declare load_defaults\n+      AC_MSG_CHECKING([load_defaults() in MySQL])\n+      rm -f testmysql.*\n+      echo '#include \"my_global.h\"' > testmysql.cpp\n+      echo '#include \"my_sys.h\"' >> testmysql.cpp\n+      echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\n+      if test -z \"`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`\" ; then\n+        AC_MSG_RESULT([yes, found in my_sys.h])\n+      else\n+        echo 'extern \"C\" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp\n+        echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\n+        if test -z \"`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`\" ; then\n+            AC_MSG_RESULT([yes, found in library but not in header])\n+            MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes\n+        else\n+            HAVE_MYSQL=no\n+            MYSQL_LIB=\n+            MYSQL_INC=\n+            AC_MSG_ERROR([Cannot find load_defaults()])\n+        fi\n+      fi\n+      rm -f testmysql.*\n+      rm -f testmysql\n+\n \t;;\n   esac\n fi\n@@ -2301,6 +2326,7 @@ fi\n AC_SUBST(HAVE_MYSQL,$HAVE_MYSQL)\n AC_SUBST(MYSQL_INC,$MYSQL_INC)\n AC_SUBST(MYSQL_LIB,$MYSQL_LIB)\n+AC_SUBST(MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION,$MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION)\n \n dnl ---------------------------------------------------------------------------\n dnl INGRES support.\ndiff --git a/ogr/ogrsf_frmts/mysql/GNUmakefile b/ogr/ogrsf_frmts/mysql/GNUmakefile\nindex 292ae45..e78398d 100644\n--- a/ogr/ogrsf_frmts/mysql/GNUmakefile\n+++ b/ogr/ogrsf_frmts/mysql/GNUmakefile\n@@ -7,6 +7,11 @@ OBJ\t=\togrmysqldriver.o ogrmysqldatasource.o \\\n \n CPPFLAGS\t:=\t-I.. -I../.. $(GDAL_INCLUDE) $(MYSQL_INC) $(CPPFLAGS)\n \n+ifeq ($(MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION),yes)\n+CPPFLAGS +=   -DMYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION\n+endif\n+\n+\n default:\t$(O_OBJ:.o=.$(OBJ_EXT))\n \n clean:\ndiff --git a/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp b/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp\nindex 65c275b..447e374 100644\n--- a/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp\n+++ b/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp\n@@ -36,6 +36,16 @@\n #include \"cpl_conv.h\"\n #include \"cpl_string.h\"\n \n+/* Recent versions of mysql no longer declare load_defaults() in my_sys.h */\n+/* but they still have it in the lib. Very fragile... */\n+#ifdef MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION\n+extern \"C\" {\n+int load_defaults(const char *conf_file, const char **groups,\n+                  int *argc, char ***argv);\n+void free_defaults(char **argv);\n+}\n+#endif\n+\n CPL_CVSID(\"$Id: ogrmysqldatasource.cpp 24947 2012-09-22 09:54:23Z rouault $\");\n /************************************************************************/\n /*                         OGRMySQLDataSource()                         */\ndiff --git a/port/cpl_spawn.cpp b/port/cpl_spawn.cpp\nindex d702594..69ea3c2 100644\n--- a/port/cpl_spawn.cpp\n+++ b/port/cpl_spawn.cpp\n@@ -464,7 +464,7 @@ void CPLSpawnAsyncCloseErrorFileHandle(CPLSpawnedProcess* p)\n     #ifdef __APPLE__\n         #include <TargetConditionals.h>\n     #endif\n-    #if defined(__APPLE__) && !defined(TARGET_OS_IPHONE)\n+    #if defined(__APPLE__) && (!defined(TARGET_OS_IPHONE) || TARGET_OS_IPHONE==0)\n         #include <crt_externs.h>\n         #define environ (*_NSGetEnviron())\n     #else\n"
  },
  {
    "path": "boneyard/gdal-19.rb",
    "content": "require 'formula'\n\nclass Gdal19 < Formula\n  homepage 'http://www.gdal.org/'\n  url 'http://download.osgeo.org/gdal/gdal-1.9.2.tar.gz'\n  sha256 '9f3b9ae968eaa8d06ee5448e5b65e7bfa940e2e345282a29d95275421f36c688'\n\n  conflicts_with 'gdal'\n\n  option 'complete', 'Use additional Homebrew libraries to provide more drivers.'\n  option 'with-postgres', 'Specify PostgreSQL as a dependency.'\n  option 'with-mysql', 'Specify MySQL as a dependency.'\n  option 'without-python', 'Build without Python support (disables a lot of tools).'\n  option 'enable-opencl', 'Build with OpenCL acceleration.'\n  option 'enable-armadillo', 'Build with Armadillo accelerated TPS transforms.'\n  option 'enable-unsupported', \"Allow configure to drag in any library it can find. Invoke this at your own risk.\"\n\n  # For creating up to date man pages.\n  depends_on 'doxygen' => :build if build.head?\n\n  depends_on 'libpng'\n  depends_on 'jpeg'\n  depends_on 'giflib'\n  depends_on 'libtiff'\n  depends_on 'libgeotiff'\n  depends_on 'proj'\n  depends_on 'geos'\n\n  depends_on 'sqlite'  # To ensure compatibility with SpatiaLite.\n  depends_on 'freexl'\n  depends_on 'libspatialite'\n\n  depends_on \"postgresql\" if build.include? 'with-postgres'\n  depends_on \"mysql\" if build.include? 'with-mysql'\n\n  # Without Numpy, the Python bindings can't deal with raster data.\n  depends_on 'numpy' => :python unless build.include? 'without-python'\n\n  depends_on 'homebrew/science/armadillo' if build.include? 'enable-armadillo'\n\n  if build.include? 'complete'\n    # Raster libraries\n    depends_on \"netcdf\" # Also brings in HDF5\n    depends_on \"jasper\"\n    depends_on \"webp\"\n    depends_on \"cfitsio\"\n    depends_on \"epsilon\"\n    depends_on \"libdap\"\n    # Fix a bug in LibDAP detection: http://trac.osgeo.org/gdal/ticket/4630\n    patch :DATA unless build.head?\n\n    # Vector libraries\n    depends_on \"unixodbc\" # OS X version is not complete enough\n    depends_on \"xerces-c\"\n\n    # Other libraries\n    depends_on \"xz\" # get liblzma compression algorithm library from XZutils\n    depends_on \"poppler\"\n  end\n\n  def get_configure_args\n    args = [\n      # Base configuration.\n      \"--prefix=#{prefix}\",\n      \"--mandir=#{man}\",\n      \"--disable-debug\",\n      \"--with-local=#{prefix}\",\n      \"--with-threads\",\n      \"--with-libtool\",\n\n      # GDAL native backends.\n      \"--with-pcraster=internal\",\n      \"--with-pcidsk=internal\",\n      \"--with-bsb\",\n      \"--with-grib\",\n      \"--with-pam\",\n\n      # Backends supported by OS X.\n      \"--with-libiconv-prefix=/usr\",\n      \"--with-libz=/usr\",\n      \"--with-png=#{(MacOS.version >= :mountain_lion) ? HOMEBREW_PREFIX : MacOS::X11.prefix}\",\n      \"--with-expat=/usr\",\n      \"--with-curl=/usr/bin/curl-config\",\n\n      # Default Homebrew backends.\n      \"--with-jpeg=#{HOMEBREW_PREFIX}\",\n      \"--without-jpeg12\", # Needs specially configured JPEG and TIFF libraries.\n      \"--with-gif=#{HOMEBREW_PREFIX}\",\n      \"--with-libtiff=#{HOMEBREW_PREFIX}\",\n      \"--with-geotiff=#{HOMEBREW_PREFIX}\",\n      \"--with-sqlite3=#{Formula['sqlite'].opt_prefix}\",\n      \"--with-freexl=#{HOMEBREW_PREFIX}\",\n      \"--with-spatialite=#{HOMEBREW_PREFIX}\",\n      \"--with-geos=#{HOMEBREW_PREFIX}/bin/geos-config\",\n      \"--with-static-proj4=#{HOMEBREW_PREFIX}\",\n\n      # GRASS backend explicitly disabled.  Creates a chicken-and-egg problem.\n      # Should be installed separately after GRASS installation using the\n      # official GDAL GRASS plugin.\n      \"--without-grass\",\n      \"--without-libgrass\"\n    ]\n\n    # Optional Homebrew packages supporting additional formats.\n    supported_backends = %w[\n      liblzma\n      cfitsio\n      hdf5\n      netcdf\n      jasper\n      xerces\n      odbc\n      dods-root\n      epsilon\n      webp\n      poppler\n    ]\n    if build.include? 'complete'\n      supported_backends.delete 'liblzma'\n      args << '--with-liblzma=yes'\n      args.concat supported_backends.map {|b| '--with-' + b + '=' + HOMEBREW_PREFIX}\n    else\n      args.concat supported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported'\n    end\n\n    # The following libraries are either proprietary, not available for public\n    # download or have no stable version in the Homebrew core that is\n    # compatible with GDAL. Interested users will have to install such software\n    # manually and most likely have to tweak the install routine.\n    #\n    # Podofo is disabled because Poppler provides the same functionality and\n    # then some.\n    unsupported_backends = %w[\n      gta\n      ogdi\n      fme\n      hdf4\n      openjpeg\n      fgdb\n      ecw\n      kakadu\n      mrsid\n      jp2mrsid\n      mrsid_lidar\n      msg\n      oci\n      ingres\n      libkml\n      dwgdirect\n      idb\n      sde\n      podofo\n      rasdaman\n    ]\n    args.concat unsupported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported'\n\n    # Database support.\n    args << (build.include?(\"with-postgres\") ? \"--with-pg=#{HOMEBREW_PREFIX}/bin/pg_config\" : \"--without-pg\")\n    args << (build.include?(\"with-mysql\") ? \"--with-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config\" : \"--without-mysql\")\n\n    # Python is installed manually to ensure everything is properly sandboxed.\n    args << '--without-python'\n\n    # Scripting APIs that have not been re-worked to respect Homebrew prefixes.\n    #\n    # Currently disabled as they install willy-nilly into locations outside of\n    # the Homebrew prefix.  Enable if you feel like it, but uninstallation may be\n    # a manual affair.\n    #\n    # TODO: Fix installation of script bindings so they install into the\n    # Homebrew prefix.\n    args << \"--without-perl\"\n    args << \"--without-php\"\n    args << \"--without-ruby\"\n\n    args << (build.include?(\"enable-opencl\") ? \"--with-opencl\" : \"--without-opencl\")\n    args << (build.include?(\"enable-armadillo\") ? \"--with-armadillo=yes\" : \"--with-armadillo=no\")\n\n    return args\n  end\n\n  def install\n    # Linking flags for SQLite are not added at a critical moment when the GDAL\n    # library is being assembled. This causes the build to fail due to missing\n    # symbols. Also, ensure Homebrew SQLite is used so that Spatialite is\n    # functional.\n    #\n    # Fortunately, this can be remedied using LDFLAGS.\n    sqlite = Formula.factory 'sqlite'\n    ENV.append 'LDFLAGS', \"-L#{sqlite.opt_prefix}/lib -lsqlite3\"\n    # Needed by libdap.\n    ENV.append 'CPPFLAGS', '-I/usr/include/libxml2' if build.include? 'complete'\n\n    # Reset ARCHFLAGS to match how we build.\n    if MacOS.prefer_64_bit?\n      ENV['ARCHFLAGS'] = \"-arch x86_64\"\n    else\n      ENV['ARCHFLAGS'] = \"-arch i386\"\n    end\n\n    system \"./configure\", *get_configure_args\n    system \"make\"\n    system \"make install\"\n\n    unless build.include? 'without-python'\n      # If setuptools happens to be installed, setup.py will cowardly refuse to\n      # install to anywhere that is not on the PYTHONPATH.\n      #\n      # Really setuptools, we're all consenting adults here...\n      python_lib = lib + which_python + 'site-packages'\n      ENV.append 'PYTHONPATH', python_lib\n\n      # setuptools is also apparently incapable of making the directory it's\n      # self\n      python_lib.mkpath\n\n      # `python-config` may try to talk us into building bindings for more\n      # architectures than we really should.\n      if MacOS.prefer_64_bit?\n        ENV.append_to_cflags '-arch x86_64'\n      else\n        ENV.append_to_cflags '-arch i386'\n      end\n\n      cd 'swig/python' do\n        system \"python\", \"setup.py\", \"install_lib\", \"--install-dir=#{python_lib}\"\n        bin.install Dir['scripts/*']\n      end\n    end\n\n    system 'make', 'man' if build.head?\n    system 'make', 'install-man'\n    # Clean up any stray doxygen files.\n    Dir[bin + '*.dox'].each { |p| rm p }\n  end\n\n  def which_python\n    \"python\" + `python -c 'import sys;print(sys.version[:3])'`.strip\n  end\n\n  unless build.include? 'without-python'\n    def caveats\n      <<-EOS\nThis version of GDAL was built with Python support.  In addition to providing\nmodules that makes GDAL functions available to Python scripts, the Python\nbinding provides ~18 additional command line tools.\n\nUnless you are using Homebrew's Python, both the bindings and the\nadditional tools will be unusable unless the following directory is added to\nthe PYTHONPATH:\n\n    #{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages\n      EOS\n    end\n  end\nend\n\n__END__\nFix test for LibDAP >= 3.10.\n\n\ndiff --git a/configure b/configure\nindex 997bbbf..a1928d5 100755\n--- a/configure\n+++ b/configure\n@@ -24197,7 +24197,7 @@ else\n rm -f islibdappost310.*\n echo '#include \"Connect.h\"' > islibdappost310.cpp\n echo 'int main(int argc, char** argv) { return 0; } ' >> islibdappost310.cpp\n-if test -z \"`${CXX} islibdappost310.cpp -c ${DODS_INC} 2>&1`\" ; then\n+if test -z \"`${CXX} islibdappost310.cpp -c ${DODS_INC} ${CPPFLAGS} 2>&1`\" ; then\n     DODS_INC=\"$DODS_INC -DLIBDAP_310 -DLIBDAP_39\"\n     { $as_echo \"$as_me:${as_lineno-$LINENO}: result: libdap >= 3.10\" >&5\n $as_echo \"libdap >= 3.10\" >&6; }\n"
  },
  {
    "path": "boneyard/gdal-20.rb",
    "content": "class Gdal20 < Formula\n  desc \"GDAL: Geospatial Data Abstraction Library\"\n  homepage \"http://www.gdal.org/\"\n  url \"http://download.osgeo.org/gdal/2.1.0/gdal-2.1.0.tar.gz\"\n  sha256 \"eb499b18e5c5262a803bb7530ae56e95c3293be7b26c74bcadf67489203bf2cd\"\n\n  bottle do\n    root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n    sha256 \"efc51d54d02e302fb1339b3e2520fe15e3aba7418d5accd970d1e9faee298361\" => :mavericks\n  end\n\n  head do\n    url \"https://svn.osgeo.org/gdal/trunk/gdal\"\n    depends_on \"doxygen\" => :build\n  end\n\n  keg_only \"Older version of gdal is in main tap and installs similar components\"\n\n  option \"with-complete\", \"Use additional Homebrew libraries to provide more drivers.\"\n  option \"with-qhull\", \"Build with internal qhull libary support\"\n  option \"with-opencl\", \"Build with OpenCL acceleration.\"\n  option \"with-armadillo\", \"Build with Armadillo accelerated TPS transforms.\"\n  option \"with-unsupported\", \"Allow configure to drag in any library it can find. Invoke this at your own risk.\"\n  option \"with-mdb\", \"Build with Access MDB driver (requires Java 1.6+ JDK/JRE, from Apple or Oracle).\"\n  option \"with-libkml\", \"Build with Google's libkml driver (requires libkml --HEAD or >= 1.3)\"\n  option \"without-python\", \"Build without python2 support\"\n  option \"with-swig-java\", \"Build the swig java bindings\"\n\n  deprecated_option \"enable-opencl\" => \"with-opencl\"\n  deprecated_option \"enable-armadillo\" => \"with-armadillo\"\n  deprecated_option \"enable-unsupported\" => \"with-unsupported\"\n  deprecated_option \"enable-mdb\" => \"with-mdb\"\n  deprecated_option \"complete\" => \"with-complete\"\n\n  depends_on \"libpng\"\n  depends_on \"jpeg\"\n  depends_on \"giflib\"\n  depends_on \"libtiff\"\n  depends_on \"libgeotiff\"\n  depends_on \"proj\"\n  depends_on \"geos\"\n\n  depends_on \"sqlite\" # To ensure compatibility with SpatiaLite.\n  depends_on \"freexl\"\n  depends_on \"libspatialite\"\n\n  depends_on \"postgresql\" => :optional\n  depends_on \"mysql\" => :optional\n\n  depends_on \"homebrew/science/armadillo\" if build.with? \"armadillo\"\n\n  if build.with? \"libkml\"\n    depends_on \"autoconf\" => :build\n    depends_on \"automake\" => :build\n    depends_on \"libtool\" => :build\n  end\n\n  if build.with? \"complete\"\n    # Raster libraries\n    depends_on \"homebrew/science/netcdf\" # Also brings in HDF5\n    depends_on \"jasper\"\n    depends_on \"webp\"\n    depends_on \"homebrew/science/cfitsio\"\n    depends_on \"epsilon\"\n    depends_on \"libdap\"\n    depends_on \"libxml2\"\n    depends_on \"openjpeg\"\n\n    # Vector libraries\n    depends_on \"unixodbc\" # OS X version is not complete enough\n    depends_on \"xerces-c\"\n\n    # Other libraries\n    depends_on \"xz\" # get liblzma compression algorithm library from XZutils\n    depends_on \"poppler\"\n    depends_on \"podofo\"\n    depends_on \"json-c\"\n  end\n\n  depends_on \"java\" => [\"1.7+\", :optional, :build]\n\n  if build.with? \"swig-java\"\n    depends_on \"ant\" => :build\n    depends_on \"swig\" => :build\n  end\n\n  depends_on :python => :optional if MacOS.version <= :snow_leopard\n  depends_on :python3 => :optional\n  depends_on \"numpy\" => :python if build.with? \"python\"\n  depends_on \"numpy\" => :python3 if build.with? \"python3\"\n\n  resource \"libkml\" do\n    # Until 1.3 is stable, use master branch\n    url \"https://github.com/google/libkml.git\",\n        :revision => \"9b50572641f671194e523ad21d0171ea6537426e\"\n    version \"1.3-dev\"\n  end\n\n  def configure_args\n    args = [\n      # Base configuration.\n      \"--prefix=#{prefix}\",\n      \"--mandir=#{man}\",\n      \"--disable-debug\",\n      \"--with-local=#{prefix}\",\n      \"--with-threads\",\n      \"--with-libtool\",\n\n      # GDAL native backends.\n      \"--with-pcraster=internal\",\n      \"--with-pcidsk=internal\",\n      \"--with-bsb\",\n      \"--with-grib\",\n      \"--with-pam\",\n\n      # Backends supported by OS X.\n      \"--with-libiconv-prefix=/usr\",\n      \"--with-libz=/usr\",\n      \"--with-png=#{Formula[\"libpng\"].opt_prefix}\",\n      \"--with-expat=/usr\",\n      \"--with-curl=/usr/bin/curl-config\",\n\n      # Default Homebrew backends.\n      \"--with-jpeg=#{HOMEBREW_PREFIX}\",\n      \"--without-jpeg12\", # Needs specially configured JPEG and TIFF libraries.\n      \"--with-gif=#{HOMEBREW_PREFIX}\",\n      \"--with-libtiff=#{HOMEBREW_PREFIX}\",\n      \"--with-geotiff=#{HOMEBREW_PREFIX}\",\n      \"--with-sqlite3=#{Formula[\"sqlite\"].opt_prefix}\",\n      \"--with-freexl=#{HOMEBREW_PREFIX}\",\n      \"--with-spatialite=#{HOMEBREW_PREFIX}\",\n      \"--with-geos=#{HOMEBREW_PREFIX}/bin/geos-config\",\n      \"--with-static-proj4=#{HOMEBREW_PREFIX}\",\n      \"--with-libjson-c=#{Formula[\"json-c\"].opt_prefix}\",\n\n      # GRASS backend explicitly disabled.  Creates a chicken-and-egg problem.\n      # Should be installed separately after GRASS installation using the\n      # official GDAL GRASS plugin.\n      \"--without-grass\",\n      \"--without-libgrass\",\n    ]\n\n    # Optional Homebrew packages supporting additional formats.\n    supported_backends = %w[\n      liblzma\n      cfitsio\n      hdf5\n      netcdf\n      jasper\n      xerces\n      odbc\n      dods-root\n      epsilon\n      webp\n      openjpeg\n      podofo\n      pdfium\n    ]\n    if build.with? \"complete\"\n      supported_backends.delete \"liblzma\"\n      args << \"--with-liblzma=yes\"\n      supported_backends.delete \"pdfium\"\n      args << \"--with-pdfium=yes\"\n      args.concat supported_backends.map { |b| \"--with-\" + b + \"=\" + HOMEBREW_PREFIX }\n    elsif build.without? \"unsupported\"\n      args.concat supported_backends.map { |b| \"--without-\" + b }\n    end\n\n    # The following libraries are either proprietary, not available for public\n    # download or have no stable version in the Homebrew core that is\n    # compatible with GDAL. Interested users will have to install such software\n    # manually and most likely have to tweak the install routine.\n    #\n    # Podofo is disabled because Poppler provides the same functionality and\n    # then some.\n    unsupported_backends = %w[\n      gta\n      ogdi\n      fme\n      hdf4\n      fgdb\n      ecw\n      kakadu\n      mrsid\n      jp2mrsid\n      mrsid_lidar\n      msg\n      oci\n      ingres\n      dwgdirect\n      idb\n      sde\n      rasdaman\n      sosi\n    ]\n    args.concat unsupported_backends.map { |b| \"--without-\" + b } if build.without? \"unsupported\"\n\n    # Database support.\n    args << (build.with?(\"postgresql\") ? \"--with-pg=#{HOMEBREW_PREFIX}/bin/pg_config\" : \"--without-pg\")\n    args << (build.with?(\"mysql\") ? \"--with-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config\" : \"--without-mysql\")\n\n    if build.with? \"mdb\"\n      args << \"--with-java=yes\"\n      # The rpath is only embedded for Oracle (non-framework) installs\n      args << \"--with-jvm-lib-add-rpath=yes\"\n      args << \"--with-mdb=yes\"\n    end\n\n    args << \"--with-libkml=#{libexec}\" if build.with? \"libkml\"\n\n    args << \"--with-qhull=#{build.with?(\"qhull\") ? \"internal\" : \"no\"}\"\n\n    # Python is installed manually to ensure everything is properly sandboxed.\n    args << \"--without-python\"\n\n    # Scripting APIs that have not been re-worked to respect Homebrew prefixes.\n    #\n    # Currently disabled as they install willy-nilly into locations outside of\n    # the Homebrew prefix.  Enable if you feel like it, but uninstallation may be\n    # a manual affair.\n    #\n    # TODO: Fix installation of script bindings so they install into the\n    # Homebrew prefix.\n    args << \"--without-perl\"\n    args << \"--without-php\"\n    args << \"--without-ruby\"\n\n    args << (build.with?(\"opencl\") ? \"--with-opencl\" : \"--without-opencl\")\n    args << (build.with?(\"armadillo\") ? \"--with-armadillo=#{Formula[\"armadillo\"].opt_prefix}\" : \"--with-armadillo=no\")\n\n    args\n  end\n\n  def install\n    if build.with? \"libkml\"\n      resource(\"libkml\").stage do\n        # See main `libkml` formula for info on patches\n        inreplace \"configure.ac\", \"-Werror\", \"\"\n        inreplace \"third_party/Makefile.am\" do |s|\n          s.sub! /(lib_LTLIBRARIES =) libminizip.la liburiparser.la/, \"\\\\1\"\n          s.sub! /(noinst_LTLIBRARIES = libgtest.la libgtest_main.la)/,\n                 \"\\\\1 libminizip.la liburiparser.la\"\n          s.sub! /(libminizip_la_LDFLAGS =)/, \"\\\\1 -static\"\n          s.sub! /(liburiparser_la_LDFLAGS =)/, \"\\\\1 -static\"\n        end\n\n        system \"./autogen.sh\"\n        system \"./configure\", \"--prefix=#{libexec}\"\n        system \"make\", \"install\"\n      end\n    end\n\n    # Linking flags for SQLite are not added at a critical moment when the GDAL\n    # library is being assembled. This causes the build to fail due to missing\n    # symbols. Also, ensure Homebrew SQLite is used so that Spatialite is\n    # functional.\n    #\n    # Fortunately, this can be remedied using LDFLAGS.\n    sqlite = Formula[\"sqlite\"]\n    ENV.append \"LDFLAGS\", \"-L#{sqlite.opt_lib} -lsqlite3\"\n    ENV.append \"CFLAGS\", \"-I#{sqlite.opt_include}\"\n\n    # Reset ARCHFLAGS to match how we build.\n    ENV[\"ARCHFLAGS\"] = \"-arch #{MacOS.preferred_arch}\"\n\n    # Fix hardcoded mandir: http://trac.osgeo.org/gdal/ticket/5092\n    inreplace \"configure\", %r[^mandir='\\$\\{prefix\\}/man'$], \"\"\n\n    # These libs are statically linked in vendored libkml and libkml formula\n    inreplace \"configure\", \" -lminizip -luriparser\", \"\" if build.with? \"libkml\"\n\n    system \"./configure\", *configure_args\n    system \"make\"\n    system \"make\", \"install\"\n\n    inreplace \"swig/python/setup.cfg\" do |s|\n      s.gsub! /#(.*_dirs)/, \"\\\\1\"\n      s.sub! /(include_dirs = \\S+)/, \"\\\\1:../../apps/\"\n    end\n    Language::Python.each_python(build) do |python, _python_version|\n      cd \"swig/python\" do\n        system python, *Language::Python.setup_install_args(prefix)\n        bin.install Dir[\"scripts/*\"] if python == \"python\"\n      end\n    end\n\n    if build.with? \"swig-java\"\n      cd \"swig/java\" do\n        inreplace \"java.opt\", \"linux\", \"darwin\"\n        inreplace \"java.opt\", \"#JAVA_HOME = /usr/lib/jvm/java-6-openjdk/\", \"JAVA_HOME=$(shell echo $$JAVA_HOME)\"\n        system \"make\"\n        system \"make\", \"install\"\n\n        # Install the jar that complements the native JNI bindings\n        system \"ant\"\n        lib.install \"gdal.jar\"\n      end\n    end\n\n    system \"make\", \"man\" if build.head?\n    system \"make\", \"install-man\"\n    # Clean up any stray doxygen files.\n    Dir.glob(\"#{bin}/*.dox\") { |p| rm p }\n  end\n\n  def caveats\n    if build.with? \"mdb\"\n      <<~EOS\n\n      To have a functional MDB driver, install supporting .jar files in:\n        `/Library/Java/Extensions/`\n\n      See: `http://www.gdal.org/ogr/drv_mdb.html`\n      EOS\n    end\n  end\n\n  test do\n    # basic tests to see if third-party dylibs are loading OK\n    system \"#{bin}/gdalinfo\", \"--formats\"\n    system \"#{bin}/ogrinfo\", \"--formats\"\n\n    # test Python support\n    Language::Python.each_python(build) do |python, python_version|\n      if (lib/\"python#{python_version}/site-packages\").exist?\n        ENV[\"PYTHONPATH\"] = lib/\"python#{python_version}/site-packages\"\n        system python, \"-c\", \"from osgeo import gdal, ogr, osr, gdal_array, gdalconst\"\n      end\n    end\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal-ecwjp2.rb",
    "content": "ECWJP2_SDK = \"/Hexagon/ERDASEcwJpeg2000SDK5.2.1/Desktop_Read-Only\"\n\nclass EcwJp2Sdk < Requirement\n  fatal true\n  satisfy(:build_env => false) { File.exist? ECWJP2_SDK }\n\n  def message; <<~EOS\n    ERDAS ECW/JP2 SDK was not found at:\n      #{ECWJP2_SDK}\n\n    Download SDK and install 'Desktop Read-Only' to default location from:\n      http://download.intergraph.com/?ProductName=ERDAS%20ECW/JPEG2000%20SDK\n  EOS\n  end\nend\n\nclass GdalEcwjp2 < Formula\n  homepage \"http://www.gdal.org/frmt_ecw.html\"\n  url \"http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz\"\n  sha256 \"989db33ff411e2c888348e71edec5ad06c74ed68781ebfbc4e85179b9d65aafe\"\n\n  depends_on \"macos\" => :lion # as per SDK docs\n  depends_on EcwJp2Sdk\n  depends_on \"gdal\"\n\n  def gdal_clib\n    gdal_lib = \"#{Formula[\"gdal\"].opt_lib}/libgdal.dylib\"\n    (%x[otool -L #{gdal_lib}].include? \"libstdc++\") ? \"std\" : \"\"\n  end\n\n  def install\n    gdal = Formula[\"gdal\"]\n    (lib/\"gdalplugins\").mkpath\n\n    # vendor Desktop Read-Only lib, etc\n    # match c-lib that gdal was built against\n    cp \"#{ECWJP2_SDK}/lib/lib#{gdal_clib}c++/dynamic/libNCSEcw.dylib\", \"#{lib}/\"\n    system \"install_name_tool\", \"-id\", HOMEBREW_PREFIX/\"lib/libNCSEcw.dylib\", lib/\"libNCSEcw.dylib\"\n    cp_r \"#{ECWJP2_SDK}/etc\", \"#{prefix}/\"\n\n    # cxx flags\n    args = %W[-Iport -Igcore -Ifrmts -DFRMT_ecw -DECWSDK_VERSION=51 -Ifrmts/ecw\n              -I#{ECWJP2_SDK}/include -I#{ECWJP2_SDK}/include/NCSEcw/API\n              -I#{ECWJP2_SDK}/include/NCSEcw/ECW -I#{ECWJP2_SDK}/include/NCSEcw/JP2]\n\n    # source files\n    Dir[\"frmts/ecw/*.cpp\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    args.concat %W[\n      -dynamiclib\n      -install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/gdal_ECW_JP2ECW.dylib\n      -current_version #{version}\n      -compatibility_version #{version}\n      -o #{lib}/gdalplugins/gdal_ECW_JP2ECW.dylib\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{lib} -lNCSEcw]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n\n  end\n\n  def caveats; <<~EOS\n    This formula provides a plugin that allows GDAL or OGR to access geospatial\n    data stored in its format. In order to use the shared plugin, you will need\n    to set the following enviroment variable:\n\n      export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n\n    Once plugin is installed, the ERDAS ECW/JP2 SDK can be deleted from its\n    default install location of:\n\n      /Hexagon/ERDASEcwJpeg2000SDK*\n\n  EOS\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal-filegdb.rb",
    "content": "require 'formula'\n\nclass GdalFilegdb < Formula\n  homepage 'http://www.gdal.org/ogr/drv_filegdb.html'\n  url 'http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz'\n  sha256 '989db33ff411e2c888348e71edec5ad06c74ed68781ebfbc4e85179b9d65aafe'\n\n  depends_on \"filegdb-api\"\n  depends_on 'gdal'\n\n  def install\n    filegdb_opt = Formula['filegdb-api'].opt_prefix\n    (lib/'gdalplugins').mkpath\n\n    # cxx flags\n    args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n               -Iogr/ogrsf_frmts/filegdb -I#{filegdb_opt}/include/filegdb]\n\n    # source files\n    Dir['ogr/ogrsf_frmts/filegdb/*.c*'].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    args.concat %W[\n      -dynamiclib\n      -install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/ogr_FileGDB.dylib\n      -current_version #{version}\n      -compatibility_version #{version}\n      -o #{lib}/gdalplugins/ogr_FileGDB.dylib\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{filegdb_opt}/lib -lFileGDBAPI]\n\n    # build and install shared plugin\n    if ENV.compiler == :clang && MacOS.version >= :mavericks\n      # fixes to make plugin work with gdal possibly built against libc++\n      # NOTE: works, but I don't know if it is a sane fix\n      # see: http://forums.arcgis.com/threads/95958-OS-X-Mavericks\n      #      https://gist.github.com/jctull/f4d620cd5f1560577d17\n      # TODO: needs removed as soon as ESRI updates filegdb binaries for libc++\n      cxxstdlib_check :skip\n      args.unshift \"-mmacosx-version-min=10.8\" # better than -stdlib=libstdc++ ?\n    end\n    system ENV.cxx, *args\n\n  end\n\n  def caveats; <<~EOS\n    This formula provides a plugin that allows GDAL or OGR to access geospatial\n    data stored in its format. In order to use the shared plugin, you will need\n    to set the following enviroment variable:\n\n      export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n\n    ============================== IMPORTANT ==============================\n    If compiled using clang (default) on 10.9+ this plugin was built against\n    libstdc++ (like filegdb binaries), which may load into your GDAL, but\n    possibly be incompatible. Please report any issues to:\n        https://github.com/osgeo/homebrew-osgeo4mac/issues\n\n    EOS\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal-grass64.rb",
    "content": "require 'formula'\n\nclass GdalGrass64 < Formula\n  homepage 'http://www.gdal.org'\n  url 'http://download.osgeo.org/gdal/gdal-grass-1.4.3.tar.gz'\n  sha256 'ea18d1e773e8875aaf3261a6ccd2a5fa22d998f064196399dfe73d991688f1dd'\n  revision 1\n\n  bottle do\n    root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n    sha256 \"93be8a55d7855eb95e08fe888ec7ce893aa1d2e34d91f8a19669d56c9c060c27\" => :mavericks\n    sha256 \"30f9c487696e908e73efbf74702668ad896d68a7238e529dd19671255b15e651\" => :yosemite\n    sha256 \"43fdc5d8e5b6ac67f05551fca316bc5f91e36e14cb3bc5cdd698516a724748f8\" => :el_capitan\n  end\n\n  depends_on 'gdal'\n  depends_on 'grass-64'\n\n  conflicts_with 'gdal-grass', :because => 'both install same-named gdal plugin'\n\n  def install\n    gdal = Formula['gdal']\n    grass = Formula['grass-64']\n\n    system \"./configure\", \"--prefix=#{prefix}\",\n                          \"--disable-debug\",\n                          \"--disable-dependency-tracking\",\n                          \"--with-gdal=#{gdal.bin}/gdal-config\",\n                          \"--with-grass=#{grass.prefix}/grass-#{grass.version}\",\n                          \"--with-autoload=#{lib}/gdalplugins\"\n\n    inreplace \"Makefile\", 'mkdir', 'mkdir -p'\n\n    system \"make install\"\n  end\n\n  def caveats; <<~EOS\n    This formula provides a plugin that allows GDAL and OGR to access geospatial\n    data stored using the GRASS vector and raster formats. In order to use the\n    plugin, you will need to add the following path to the GDAL_DRIVER_PATH\n    enviroment variable:\n      #{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal-mrsid.rb",
    "content": "class GdalMrsid < Formula\n  homepage \"http://www.gdal.org/frmt_mrsid.html\"\n  url \"http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz\"\n  sha256 \"989db33ff411e2c888348e71edec5ad06c74ed68781ebfbc4e85179b9d65aafe\"\n\n  depends_on \"mrsid-sdk\"\n  depends_on \"gdal\"\n\n  def install\n    mrsid_sdk_opt = Formula['mrsid-sdk'].opt_prefix\n    (lib/\"gdalplugins\").mkpath\n    plugins = {}\n    lidar_args, mrsid_args = [], []\n\n    # source files & cxx/ld flags\n    # gdal_MG4Lidar.dylib\n    Dir[\"frmts/mrsid_lidar/*.c*\"].each { |src| lidar_args.concat %W[#{src}] }\n    lidar_args.concat %W[\n      -Iport -Igcore -Ifrmts -Ifrmts/mrsid_lidar\n      -I#{mrsid_sdk_opt}/include/mrsid\n    ]\n    lidar_args.concat %W[-L#{mrsid_sdk_opt}/lib -llti_lidar_dsdk]\n    plugins[:gdal_MG4Lidar] = lidar_args\n\n    # gdal_MrSID.dylib\n    Dir[\"frmts/mrsid/*.c*\"].each { |src| mrsid_args.concat %W[#{src}] }\n    mrsid_args.concat %W[\n      -DMRSID_J2K=1\n      -Iport -Igcore -Ifrmts -Ifrmts/mrsid\n      -I#{mrsid_sdk_opt}/include/mrsid\n    ]\n    mrsid_args.concat %W[-L#{mrsid_sdk_opt}/lib -lltidsdk]\n    plugins[:gdal_MrSID] = mrsid_args\n\n    # plugin dylib\n    # TODO: remove cxxstdlib_check, after LizardTech updates binaries for libc++\n    #       https://www.lizardtech.com/forums/viewtopic.php?f=6&t=821\n    cxxstdlib_check :skip\n    plugins.each do |key, args|\n      # TODO: can the compatibility_version be 1.10.0?\n      args.concat %W[\n        -dynamiclib\n        -install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/#{key.to_s}.dylib\n        -current_version #{version}\n        -compatibility_version #{version}\n        -o #{lib}/gdalplugins/#{key.to_s}.dylib\n        -undefined dynamic_lookup\n      ]\n      # build and install shared plugin\n      system ENV.cxx, *args\n    end\n\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you will need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n\n      ============================== IMPORTANT ==============================\n      If compiled using clang (default) on 10.9+ this plugin links to libc++\n      (whereas MrSID libs/binaries link to libstdc++). This may lead to issues\n      during usage, including crashes. Please report any issues to:\n          https://github.com/osgeo/homebrew-osgeo4mac/issues\n\n    EOS\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal-oracle.rb",
    "content": "class GdalOracle < Formula\n  homepage \"http://www.gdal.org/ogr/drv_oci.html\"\n  url 'http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz'\n  sha256 '989db33ff411e2c888348e71edec5ad06c74ed68781ebfbc4e85179b9d65aafe'\n\n  depends_on \"oracle-client-sdk\"\n  depends_on \"gdal\"\n\n  def install\n    oracle_opt = Formula['oracle-client-sdk'].opt_prefix\n    (lib/\"gdalplugins\").mkpath\n    args = []\n\n    # source files\n    args.concat %W[ogr/ogrsf_frmts/oci/oci_utils.cpp]\n    Dir[\"ogr/ogrsf_frmts/oci/ogr*.c*\"].each { |src| args.concat %W[#{src}] }\n\n    # plugin dylib\n    # TODO: can the compatibility_version be 1.10.0?\n    args.concat %W[\n      -dynamiclib\n      -install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/ogr_OCI.dylib\n      -current_version #{version}\n      -compatibility_version #{version}\n      -o #{lib}/gdalplugins/ogr_OCI.dylib\n      -undefined dynamic_lookup\n    ]\n\n    # cxx flags\n    args.concat %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts\n                   -Iogr/ogrsf_frmts/oci -I#{oracle_opt}/sdk/include]\n\n    # ld flags\n    args.concat %W[-L#{oracle_opt}/lib -lclntsh]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you will need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n\n  EOS\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal-sosi.rb",
    "content": "class GdalSosi < Formula\n  homepage \"http://trac.osgeo.org/gdal/wiki/SOSI\"\n  url \"http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz\"\n  sha256 \"989db33ff411e2c888348e71edec5ad06c74ed68781ebfbc4e85179b9d65aafe\"\n\n  depends_on \"fyba\"\n  depends_on \"gdal\"\n\n  def install\n    fyba_opt = Formula[\"fyba\"].opt_prefix\n    (lib/\"gdalplugins\").mkpath\n\n    # cxx flags\n    args = %W[-DLINUX -DUNIX -Iport -Igcore -Iogr\n              -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n              -Iogr/ogrsf_frmts/sosi -I#{fyba_opt}/include/fyba]\n\n    # source files\n    Dir['ogr/ogrsf_frmts/sosi/ogrsosi*.c*'].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    args.concat %W[\n      -dynamiclib\n      -install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/ogr_SOSI.dylib\n      -current_version #{version}\n      -compatibility_version #{version}\n      -o #{lib}/gdalplugins/ogr_SOSI.dylib\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{fyba_opt}/lib -lfyba -lfygm -lfyut]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n\n  end\n\n  def caveats; <<~EOS\n    This formula provides a plugin that allows GDAL or OGR to access geospatial\n    data stored in its format. In order to use the shared plugin, you will need\n    to set the following enviroment variable:\n\n      export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n\n    EOS\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal1-ecwjp2.rb",
    "content": "class Gdal1Ecwjp2 < Formula\n  desc \"GDAL/OGR 1.x plugin for ECW driver\"\n  homepage \"http://www.gdal.org/frmt_ecw.html\"\n  url \"http://download.osgeo.org/gdal/1.11.5/gdal-1.11.5.tar.gz\"\n  sha256 \"49f99971182864abed9ac42de10545a92392d88f7dbcfdb11afe449a7eb754fe\"\n\n  depends_on \"ecwjp2-sdk\"\n  depends_on \"gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def gdal_clib\n    gdal_lib = \"#{Formula[\"gdal\"].opt_lib}/libgdal.dylib\"\n    (`otool -L #{gdal_lib}`.include? \"libstdc++\") ? \"-stdcxx\" : \"\"\n  end\n\n  def install\n    ENV.libstdcxx if gdal_clib == \"-stdcxx\"\n\n    ecwjp2_opt = Formula[\"ecwjp2-sdk\"].opt_prefix\n    ecwjp2_opt_include = ecwjp2_opt/\"include/ECWJP2\"\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n    (HOMEBREW_PREFIX/\"lib/#{gdal_plugins_subdirectory}\").mkpath\n\n    # cxx flags\n    args = %W[-Iport -Igcore -Ifrmts -DFRMT_ecw -DECWSDK_VERSION=53 -Ifrmts/ecw\n              -I#{ecwjp2_opt_include} -I#{ecwjp2_opt_include}/NCSEcw/API\n              -I#{ecwjp2_opt_include}/NCSEcw/ECW -I#{ecwjp2_opt_include}/NCSEcw/JP2]\n\n    # source files\n    Dir[\"frmts/ecw/*.cpp\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"gdal_ECW_JP2ECW.dylib\"\n    args.concat %W[\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{ecwjp2_opt}/lib -lNCSEcw#{gdal_clib}]\n    args << \"-stdlib=libstdc++\" if gdal_clib == \"-stdcxx\"\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"gdal\"].opt_bin\n    out = `#{gdal_opt_bin}/gdalinfo --formats`\n    assert_match \"ECW (rov)\", out\n    assert_match \"JP2ECW (rov)\", out\n\n    ecwjp2_test = Formula[\"ecwjp2-sdk\"].opt_prefix/\"test\"\n    out = `#{gdal_opt_bin}/gdalinfo #{ecwjp2_test}/RGB_8bit.ecw`\n    assert_match \"Driver: ECW/ERDAS Compressed Wavelets\", out\n    assert_match \"Size is 4320, 2160\", out\n    out = `#{gdal_opt_bin}/gdalinfo #{ecwjp2_test}/RGB_8bit.jp2`\n    assert_match \"Driver: JP2ECW/ERDAS JPEG2000\", out\n    assert_match \"Size is 4320, 2160\", out\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal1-filegdb.rb",
    "content": "class Gdal1Filegdb < Formula\n  desc \"GDAL/OGR 1.x plugin for ESRI FileGDB driver\"\n  homepage \"http://www.gdal.org/drv_filegdb.html\"\n  url \"http://download.osgeo.org/gdal/1.11.5/gdal-1.11.5.tar.gz\"\n  sha256 \"49f99971182864abed9ac42de10545a92392d88f7dbcfdb11afe449a7eb754fe\"\n\n  depends_on \"filegdb-api\"\n  depends_on \"gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    filegdb_opt = Formula[\"filegdb-api\"].opt_prefix\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n    (HOMEBREW_PREFIX/\"lib/#{gdal_plugins_subdirectory}\").mkpath\n\n    # cxx flags\n    args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n              -Iogr/ogrsf_frmts/filegdb -I#{filegdb_opt}/include/filegdb]\n\n    # source files\n    Dir[\"ogr/ogrsf_frmts/filegdb/*.c*\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"ogr_FileGDB.dylib\"\n    args.concat %W[\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{filegdb_opt}/lib -lFileGDBAPI]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"gdal\"].opt_bin\n    out = `#{gdal_opt_bin}/ogrinfo --formats`\n    assert_match \"\\\"FileGDB\\\" (read/write)\", out\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal1-grass6.rb",
    "content": "class Gdal1Grass6 < Formula\n  desc \"GDAL/OGR 1.x plugin for GRASS 6\"\n  homepage \"http://www.gdal.org\"\n  url \"http://download.osgeo.org/gdal/gdal-grass-1.11.2.tar.gz\"\n  sha256 \"08473ade53d699e1292c54a4271ed0108ec39e0b3a5ebfea04dc88d31e44bd1b\"\n  revision 1\n\n  # bottle do\n  #   root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n  #   sha256 \"\" => :mavericks\n  # end\n\n  depends_on \"gdal\"\n  depends_on \"grass6\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def install\n    gdal = Formula[\"gdal\"]\n    gdal_plugins = lib/\"gdalplugins/#{gdal_majmin_ver}\"\n    gdal_plugins.mkpath\n    (HOMEBREW_PREFIX/\"lib/gdalplugins/#{gdal_majmin_ver}\").mkpath\n    grass = Formula[\"grass6\"]\n\n    # due to DYLD_LIBRARY_PATH no longer being setable, strictly define extension\n    inreplace \"Makefile.in\", \".so\", \".dylib\"\n\n    system \"./configure\", \"--prefix=#{prefix}\",\n                          \"--disable-debug\",\n                          \"--disable-dependency-tracking\",\n                          \"--with-gdal=#{gdal.opt_bin}/gdal-config\",\n                          \"--with-grass=#{grass.prefix}/grass-#{grass.version}\",\n                          \"--with-autoload=#{gdal_plugins}\"\n\n    inreplace \"Makefile\", \"mkdir\", \"mkdir -p\"\n\n    system \"make\", \"install\"\n  end\n\n  def caveats; <<~EOS\n    This formula provides a plugin that allows GDAL and OGR to access geospatial\n    data stored using the GRASS vector and raster formats. In order to use the\n    plugin, you will need to add the following path to the GDAL_DRIVER_PATH\n    enviroment variable:\n      #{HOMEBREW_PREFIX}/lib/gdalplugins/#{gdal_majmin_ver}\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"gdal\"].opt_bin\n    out = `#{gdal_opt_bin}/gdalinfo --formats`\n    assert_match \"GRASS (ro)\", out\n    out = `#{gdal_opt_bin}/ogrinfo --formats`\n    assert_match \"\\\"GRASS\\\" (readonly)\", out\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal1-mrsid.rb",
    "content": "class Gdal1Mrsid < Formula\n  desc \"GDAL/OGR 1 plugin for MrSID raster and LiDAR drivers\"\n  homepage \"http://www.gdal.org/frmt_mrsid.html\"\n  url \"http://download.osgeo.org/gdal/1.11.5/gdal-1.11.5.tar.gz\"\n  sha256 \"49f99971182864abed9ac42de10545a92392d88f7dbcfdb11afe449a7eb754fe\"\n\n  depends_on \"mrsid-sdk\"\n  depends_on \"gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    mrsid_sdk_opt = Formula[\"mrsid-sdk\"].opt_prefix\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n    (HOMEBREW_PREFIX/\"lib/#{gdal_plugins_subdirectory}\").mkpath\n\n    plugins = {}\n    lidar_args = []\n    mrsid_args = []\n\n    # source files & cxx/ld flags\n    # gdal_MG4Lidar.dylib\n    Dir[\"frmts/mrsid_lidar/*.c*\"].each { |src| lidar_args.concat %W[#{src}] }\n    lidar_args.concat %W[\n      -Iport -Igcore -Ifrmts -Ifrmts/mrsid_lidar\n      -I#{mrsid_sdk_opt}/include/mrsid\n    ]\n    lidar_args.concat %W[-L#{mrsid_sdk_opt}/lib -llti_lidar_dsdk]\n    plugins[:gdal_MG4Lidar] = lidar_args\n\n    # gdal_MrSID.dylib\n    Dir[\"frmts/mrsid/*.c*\"].each { |src| mrsid_args.concat %W[#{src}] }\n    mrsid_args.concat %W[\n      -DMRSID_J2K=1\n      -Iport -Igcore -Ifrmts -Ifrmts/mrsid -Ifrmts/gtiff/libgeotiff\n      -I#{mrsid_sdk_opt}/include/mrsid\n    ]\n    mrsid_args.concat %W[-L#{mrsid_sdk_opt}/lib -lltidsdk]\n    plugins[:gdal_MrSID] = mrsid_args\n\n    # plugin dylib\n    plugins.each do |key, args|\n      args.concat %W[\n        -dynamiclib\n        -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{key}.dylib\n        -current_version #{version}\n        -compatibility_version #{gdal_majmin_ver}.0\n        -o #{gdal_plugins}/#{key}.dylib\n        -undefined dynamic_lookup\n      ]\n      # build and install shared plugin\n      system ENV.cxx, *args\n    end\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"gdal\"].opt_bin\n    out = `#{gdal_opt_bin}/gdalinfo --formats`\n    assert_match \"MG4Lidar (ro)\", out\n    assert_match \"MrSID (rov)\", out\n    assert_match \"JP2MrSID (rov)\", out\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal1-mysql.rb",
    "content": "class Gdal1Mysql < Formula\n  desc \"GDAL/OGR 1.x plugin for MySQL driver\"\n  homepage \"http://www.gdal.org/drv_mysql.html\"\n  url \"http://download.osgeo.org/gdal/1.11.5/gdal-1.11.5.tar.gz\"\n  sha256 \"49f99971182864abed9ac42de10545a92392d88f7dbcfdb11afe449a7eb754fe\"\n\n  depends_on \"mysql\" => :build # adds openssl\n  depends_on \"gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    mysql = Formula[\"mysql\"]\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n    (HOMEBREW_PREFIX/\"lib/#{gdal_plugins_subdirectory}\").mkpath\n\n    # cxx flags\n    args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n              -Iogr/ogrsf_frmts/mysql -I#{mysql.opt_include}/mysql]\n\n    # source files\n    Dir[\"ogr/ogrsf_frmts/mysql/*.c*\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"ogr_MySQL.dylib\"\n    args.concat %W[\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[\n      #{mysql.opt_lib}/libmysqlclient.a\n      -L#{Formula[\"openssl\"].opt_lib}\n      -lssl\n      -lcrypto\n    ]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"gdal\"].opt_bin\n    out = `#{gdal_opt_bin}/ogrinfo --formats`\n    assert_match \"\\\"MySQL\\\" (read/write)\", out\n  end\nend\n"
  },
  {
    "path": "boneyard/gdal1-oracle.rb",
    "content": "class Gdal1Oracle < Formula\n  desc \"GDAL/OGR 1.x plugin for Oracle Spatial driver\"\n  homepage \"http://www.gdal.org/drv_oci.html\"\n  url \"http://download.osgeo.org/gdal/1.11.5/gdal-1.11.5.tar.gz\"\n  sha256 \"49f99971182864abed9ac42de10545a92392d88f7dbcfdb11afe449a7eb754fe\"\n\n  depends_on \"oracle-client-sdk\"\n  depends_on \"gdal\"\n\n  def gdal_majmin_ver\n    gdal_ver_list = Formula[\"gdal\"].version.to_s.split(\".\")\n    \"#{gdal_ver_list[0]}.#{gdal_ver_list[1]}\"\n  end\n\n  def gdal_plugins_subdirectory\n    \"gdalplugins/#{gdal_majmin_ver}\"\n  end\n\n  def install\n    oracle_opt = Formula[\"oracle-client-sdk\"].opt_prefix\n\n    gdal_plugins = lib/gdal_plugins_subdirectory\n    gdal_plugins.mkpath\n    (HOMEBREW_PREFIX/\"lib/#{gdal_plugins_subdirectory}\").mkpath\n\n    # cxx flags\n    args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic\n              -Iogr/ogrsf_frmts/oci -I#{oracle_opt}/include/oci]\n\n    # source files\n    Dir[\"ogr/ogrsf_frmts/oci/oci_utils.cpp\", \"ogr/ogrsf_frmts/oci/ogr*.c*\"].each do |src|\n      args.concat %W[#{src}]\n    end\n\n    # plugin dylib\n    dylib_name = \"ogr_OCI.dylib\"\n    args.concat %W[\n      -dynamiclib\n      -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name}\n      -current_version #{version}\n      -compatibility_version #{gdal_majmin_ver}.0\n      -o #{gdal_plugins}/#{dylib_name}\n      -undefined dynamic_lookup\n    ]\n\n    # ld flags\n    args.concat %W[-L#{oracle_opt}/lib -lclntsh]\n\n    # build and install shared plugin\n    system ENV.cxx, *args\n  end\n\n  def caveats; <<~EOS\n      This formula provides a plugin that allows GDAL or OGR to access geospatial\n      data stored in its format. In order to use the shared plugin, you may need\n      to set the following enviroment variable:\n\n        export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins\n    EOS\n  end\n\n  test do\n    ENV[\"GDAL_DRIVER_PATH\"] = \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    gdal_opt_bin = Formula[\"gdal\"].opt_bin\n    out = `#{gdal_opt_bin}/ogrinfo --formats`\n    assert_match \"\\\"OCI\\\" (read/write)\", out\n  end\nend\n"
  },
  {
    "path": "boneyard/gpsbabel-qt4.rb",
    "content": "class GpsbabelQt4 < Formula\n  desc \"Converts/uploads GPS waypoints, tracks, and routes\"\n  homepage \"https://www.gpsbabel.org/\"\n  url \"https://github.com/gpsbabel/gpsbabel/archive/gpsbabel_1_5_3.tar.gz\"\n  sha256 \"10b7aaca44ce557fa1175fec37297b8df55611ab2c51cb199753a22dbf2d3997\"\n  revision 1\n\n  head \"https://github.com/gpsbabel/gpsbabel.git\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    sha256 \"6d25eda9d6eca9e834c56a2d05dc5049ede3a7ee8988422f145d7075664a470d\" => :sierra\n    sha256 \"6d25eda9d6eca9e834c56a2d05dc5049ede3a7ee8988422f145d7075664a470d\" => :high_sierra\n  end\n\n  keg_only \"gpsbabel is in main tap and same-name bin utilities are installed\"\n\n  depends_on \"libusb\" => :optional\n  depends_on \"qt-4\"\n\n  # Fix build with Xcode 9, remove for next version\n  patch do\n    url \"https://github.com/gpsbabel/gpsbabel/commit/b7365b93.patch?full_index=1\"\n    sha256 \"e949182def36fef99889e43ba4bc4d61e36d6b95badc74188a8cd3da5156d341\"\n  end\n\n  def install\n    args = [\"--disable-debug\", \"--disable-dependency-tracking\",\n            \"--prefix=#{prefix}\"]\n    args << \"--without-libusb\" if build.without? \"libusb\"\n    system \"./configure\", *args\n    system \"make\", \"install\"\n  end\n\n  test do\n    (testpath/\"test.loc\").write <<~EOS\n      <?xml version=\"1.0\"?>\n      <loc version=\"1.0\">\n        <waypoint>\n          <name id=\"1 Infinite Loop\"><![CDATA[Apple headquarters]]></name>\n          <coord lat=\"37.331695\" lon=\"-122.030091\"/>\n        </waypoint>\n      </loc>\n    EOS\n    system bin/\"gpsbabel\", \"-i\", \"geo\", \"-f\", \"test.loc\", \"-o\", \"gpx\", \"-F\", \"test.gpx\"\n    assert_predicate testpath/\"test.gpx\", :exist?\n  end\nend\n"
  },
  {
    "path": "boneyard/grass-64.rb",
    "content": "class Grass64 < Formula\n  desc \"Geographic Resources Analysis Support System\"\n  homepage \"http://grass.osgeo.org/\"\n\n  stable do\n    url \"https://grass.osgeo.org/grass64/source/grass-6.4.5.tar.gz\"\n    sha256 \"f501da62807eb08efcb85820859fe5ade9bc392e20641b606273c956bb678f3e\"\n\n    # Patches to keep files from being installed outside of the prefix.\n    # Remove lines from Makefile that try to install to /Library/Documentation.\n    # Also, quick patch for compiling with clang (as yet, unreported issue)\n    patch :DATA\n  end\n\n  bottle do\n    # root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n    # revision 1\n    # sha256 \"13723d19221024073a0e781dddf3cbb9ab30e13a3b8d4d50c6eb61d0e60c347f\" => :mavericks\n    # sha256 \"f951bfe72e348529ebd8ee56f202872258ccd803cee472079222d68acfd70e9b\" => :yosemite\n  end\n\n  keg_only \"grass is in main tap and same-name bin utilities are installed\"\n\n  option \"without-gui\", \"Build without WxPython interface. Command line tools still available.\"\n\n  # TODO: test on 10.6 first. may work with latest wxWidgets 3.0\n  # depends on :macos => :lion\n  # TODO: builds with clang (has same non-fatal errors as gcc), but is it compiled correctly?\n  # depends on \"gcc\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"gettext\"\n  depends_on \"readline\"\n  depends_on \"gdal\"\n  depends_on \"libtiff\"\n  depends_on \"unixodbc\"\n  depends_on \"fftw\"\n  depends_on :python\n  depends_on \"wxpython\"\n  depends_on \"postgresql\" => :optional\n  depends_on \"mysql\" => :optional\n  depends_on \"cairo\"\n  depends_on \"x11\" # needs to find at least X11/include/GL/gl.h\n\n  def headless?\n    # The GRASS GUI is based on WxPython.\n    build.without? \"gui\"\n  end\n\n  def install\n    readline = Formula[\"readline\"].opt_prefix\n    gettext = Formula[\"gettext\"].opt_prefix\n\n    # noinspection RubyLiteralArrayInspection\n    args = [\n      \"--disable-debug\", \"--disable-dependency-tracking\",\n      \"--enable-largefile\",\n      \"--enable-shared\",\n      \"--with-cxx\",\n      \"--without-motif\",\n      \"--with-python\",\n      \"--with-blas\",\n      \"--with-lapack\",\n      \"--with-sqlite\",\n      \"--with-odbc\",\n      \"--with-geos=#{Formula[\"geos\"].opt_bin}/geos-config\",\n      \"--with-proj-share=#{Formula[\"proj\"].opt_share}/proj\",\n      \"--with-png\",\n      \"--with-readline-includes=#{readline}/include\",\n      \"--with-readline-libs=#{readline}/lib\",\n      \"--with-readline\",\n      \"--with-nls-includes=#{gettext}/include\",\n      \"--with-nls-libs=#{gettext}/lib\",\n      \"--with-nls\",\n      \"--with-freetype\",\n      \"--without-tcltk\", # Disabled due to compatibility issues with OS X Tcl/Tk\n      \"--with-includes=#{gettext}/include\"\n    ]\n\n    unless MacOS::CLT.installed?\n      # On Xcode-only systems (without the CLT), we have to help:\n      args << \"--with-macosx-sdk=#{MacOS.sdk_path}\"\n      args << \"--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers\"\n    end\n\n    if headless?\n      args << \"--without-wxwidgets\"\n    else\n      wx_paths = formula_site_packages \"wxpython\"\n      ENV.prepend(\"PYTHONPATH\", wx_paths, File::PATH_SEPARATOR) if wx_paths\n      args << \"--with-wxwidgets=#{Formula[\"wxmac\"].opt_bin}/wx-config\"\n    end\n\n    args << \"--enable-64bit\" if MacOS.prefer_64_bit?\n    args << \"--with-macos-archs=#{MacOS.preferred_arch}\"\n\n    cairo = Formula[\"cairo\"]\n    args << \"--with-cairo-includes=#{cairo.include}/cairo\"\n    args << \"--with-cairo-libs=#{cairo.lib}\"\n    args << \"--with-cairo\"\n\n    # Database support\n    args << \"--with-postgres\" if build.with? \"postgresql\"\n\n    if build.with? \"mysql\"\n      mysql = Formula[\"mysql\"]\n      args << \"--with-mysql-includes=#{mysql.include}/mysql\"\n      args << \"--with-mysql-libs=#{mysql.lib}\"\n      args << \"--with-mysql\"\n    end\n\n    if MacOS.version >= :el_capitan\n      # handle stripping of DYLD_* env vars by SIP when passed to utilities;\n      # HOME env var is .brew_home during build, so it is still checked for lib\n      ln_sf \"#{buildpath}/dist.x86_64-apple-darwin#{`uname -r`.strip}/lib\", \".brew_home/lib\"\n    end\n\n    system \"./configure\", \"--prefix=#{prefix}\", *args\n    system \"make\", \"GDAL_DYNAMIC=\" # make and make install must be separate steps.\n    system \"make\", \"GDAL_DYNAMIC=\", \"install\" # GDAL_DYNAMIC set to blank for r.external compatability\n  end\n\n  def post_install\n    # ensure QGIS's Processing plugin recognizes install\n    ln_sf \"../bin/grass64\", prefix/\"grass-#{version}/grass.sh\"\n    # link so settings in external apps don't need updated on grass version bump\n    # in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass-64/grass-base\n    ln_sf \"grass-#{version}\", prefix/\"grass-base\"\n  end\n\n  def formula_site_packages(f)\n    `python -c \"import os, sys, site; sp1 = list(sys.path); site.addsitedir('#{Formula[f].opt_lib}/python2.7/site-packages'); print(os.pathsep.join([x for x in sys.path if x not in sp1]))\"`.strip\n  end\n\n  def caveats\n    if headless?\n      <<~EOS\n        This build of GRASS has been compiled without the WxPython GUI.\n\n        The command line tools remain fully functional.\n        EOS\n    end\n  end\n\n  test do\n    system \"#{bin}/grass64\", \"--version\"\n  end\nend\n\n\n__END__\ndiff --git a/Makefile b/Makefile\nindex f1edea6..be404b0 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -304,8 +304,6 @@ ifeq ($(strip $(MINGW)),)\n \t-tar cBf - gem/skeleton | (cd ${INST_DIR}/etc ; tar xBf - ) 2>/dev/null\n \t-${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${BINDIR} 2>/dev/null\n endif\n-\t@# enable OSX Help Viewer\n-\t@if [ \"`cat include/Make/Platform.make | grep -i '^ARCH.*darwin'`\" ] ; then /bin/ln -sfh \"${INST_DIR}/docs/html\" /Library/Documentation/Help/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} ; fi\n\n\n install-strip: FORCE\ndiff --git a/raster/r.terraflow/direction.cc b/raster/r.terraflow/direction.cc\nindex 7744518..778c225 100644\n--- a/raster/r.terraflow/direction.cc\n+++ b/raster/r.terraflow/direction.cc\n@@ -53,11 +53,11 @@ encodeDirectionMFD(const genericWindow<elevation_type>& elevwin,\n   \n   if(!is_nodata(elevwin.get())) {\n     dir = 0;\n-    if (elevwin.get(5) < elevwin.get() && !is_void(elevwin.get(5))) dir |= 1;\n-    if (elevwin.get(3) < elevwin.get() && !is_void(elevwin.get(3))) dir |= 16;\n+    if (elevwin.get(5) < elevwin.get() && !is_voided(elevwin.get(5))) dir |= 1;\n+    if (elevwin.get(3) < elevwin.get() && !is_voided(elevwin.get(3))) dir |= 16;\n     for(int i=0; i<3; i++) {\n-      if(elevwin.get(i) < elevwin.get() && !is_void(elevwin.get(i))) dir |= 32<<i;\n-      if(elevwin.get(i+6) < elevwin.get() && !is_void(elevwin.get(6+i))) dir |= 8>>i;\n+      if(elevwin.get(i) < elevwin.get() && !is_voided(elevwin.get(i))) dir |= 32<<i;\n+      if(elevwin.get(i+6) < elevwin.get() && !is_voided(elevwin.get(6+i))) dir |= 8>>i;\n     }\n   }\n   \ndiff --git a/raster/r.terraflow/nodata.cc b/raster/r.terraflow/nodata.cc\nindex 159c66d..610ca55 100644\n--- a/raster/r.terraflow/nodata.cc\n+++ b/raster/r.terraflow/nodata.cc\n@@ -73,7 +73,7 @@ is_nodata(float x) {\n \n \n int\n-is_void(elevation_type el) {\n+is_voided(elevation_type el) {\n   return (el == nodataType::ELEVATION_NODATA);\n }\n \ndiff --git a/raster/r.terraflow/nodata.h b/raster/r.terraflow/nodata.h\nindex 1e843c5..ac56504 100644\n--- a/raster/r.terraflow/nodata.h\n+++ b/raster/r.terraflow/nodata.h\n@@ -37,7 +37,7 @@\n int is_nodata(elevation_type el);\n int is_nodata(int x);\n int is_nodata(float x);\n-int is_void(elevation_type el);\n+int is_voided(elevation_type el);\n \n \n class nodataType : public ijBaseType {\n"
  },
  {
    "path": "boneyard/grass-70.rb",
    "content": "class Grass70 < Formula\n  desc \"Geographic Resources Analysis Support System\"\n  homepage \"http://grass.osgeo.org/\"\n\n  stable do\n    url \"https://grass.osgeo.org/grass70/source/grass-7.0.4.tar.gz\"\n    sha256 \"657188dc640b8482d16f889ff281abe424a0b232d03328086ba28cbf02c65af2\"\n\n    # Patches to keep files from being installed outside of the prefix.\n    # Remove lines from Makefile that try to install to /Library/Documentation.\n    patch :DATA\n  end\n\n  bottle do\n    root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n    sha256 \"bb240ec7666eb963c4642913d067a8225b7e644d41eea14a74f441dc92c53275\" => :mavericks\n  end\n\n  option \"without-gui\", \"Build without WxPython interface. Command line tools still available.\"\n  option \"with-gdal-1\", \"Build with GDAL/OGR v1.x instead of v2.x\"\n\n  # TODO: test on 10.6 first. may work with latest wxWidgets 3.0\n  # depends on :macos => :lion\n  # TODO: builds with clang (has same non-fatal errors as gcc), but is it compiled correctly?\n  # depends on \"gcc\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"gettext\"\n  depends_on \"readline\"\n  if build.with? \"gdal-1\"\n    depends_on \"gdal\"\n  else\n    depends_on \"gdal2\"\n  end\n  depends_on \"libtiff\"\n  depends_on \"unixodbc\"\n  depends_on \"fftw\"\n  depends_on :python\n  depends_on \"wxpython\"\n  depends_on \"postgresql\" => :optional\n  depends_on \"mysql\" => :optional\n  depends_on \"cairo\"\n  depends_on \"ghostscript\" # for cartographic composer previews\n  depends_on \"x11\" # needs to find at least X11/include/GL/gl.h\n  depends_on \"openblas\" => :optional\n  depends_on \"liblas\" => :optional\n  depends_on \"netcdf\" => :optional\n  depends_on \"ffmpeg\" => :optional\n\n  def headless?\n    # The GRASS GUI is based on WxPython.\n    build.without? \"gui\"\n  end\n\n  def install\n    readline = Formula[\"readline\"]\n    gettext = Formula[\"gettext\"]\n\n    # noinspection RubyLiteralArrayInspection\n    args = [\n      \"--disable-debug\", \"--disable-dependency-tracking\",\n      \"--enable-shared\",\n      \"--with-cxx\",\n      \"--with-python\",\n      \"--with-blas\",\n      \"--with-lapack\",\n      \"--with-sqlite\",\n      \"--with-odbc\",\n      \"--with-geos=#{Formula[\"geos\"].opt_bin}/geos-config\",\n      \"--with-proj-share=#{Formula[\"proj\"].opt_share}/proj\",\n      \"--with-png\",\n      \"--with-readline-includes=#{readline.opt_include}\",\n      \"--with-readline-libs=#{readline.opt_lib}\",\n      \"--with-readline\",\n      \"--with-nls-includes=#{gettext.opt_include}\",\n      \"--with-nls-libs=#{gettext.opt_lib}\",\n      \"--with-nls\",\n      \"--with-freetype\",\n      \"--without-tcltk\", # Disabled due to compatibility issues with OS X Tcl/Tk\n      \"--with-includes=#{gettext.opt_include}\"\n    ]\n\n    unless MacOS::CLT.installed?\n      # On Xcode-only systems (without the CLT), we have to help:\n      args << \"--with-macosx-sdk=#{MacOS.sdk_path}\"\n      args << \"--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers\"\n    end\n\n    if headless?\n      args << \"--without-wxwidgets\"\n    else\n      wx_paths = formula_site_packages \"wxpython\"\n      ENV.prepend(\"PYTHONPATH\", wx_paths, File::PATH_SEPARATOR) if wx_paths\n      args << \"--with-wxwidgets=#{Formula[\"wxmac\"].opt_bin}/wx-config\"\n    end\n\n    args << \"--enable-64bit\" if MacOS.prefer_64_bit?\n    args << \"--with-macos-archs=#{MacOS.preferred_arch}\"\n\n    cairo = Formula[\"cairo\"]\n    args << \"--with-cairo-includes=#{cairo.opt_include}/cairo\"\n    args << \"--with-cairo-libs=#{cairo.opt_lib}\"\n    args << \"--with-cairo\"\n\n    # Database support\n    args << \"--with-postgres\" if build.with? \"postgresql\"\n\n    if build.with? \"mysql\"\n      mysql = Formula[\"mysql\"]\n      args << \"--with-mysql-includes=#{mysql.opt_include}/mysql\"\n      args << \"--with-mysql-libs=#{mysql.opt_lib}\"\n      args << \"--with-mysql\"\n    end\n\n    # other optional support\n    if build.with? \"openblas\" # otherwise, Apple's will be found\n      openblas = Formula[\"openblas\"]\n      args << \"--with-blas-includes=#{openblas.opt_include}\"\n      args << \"--with-blas-libs=#{openblas.opt_lib}\"\n    end\n\n    args << \"--with-liblas=#{Formula[\"liblas\"].opt_bin}/liblas-config\" if build.with? \"liblas\"\n    args << \"--with-netcdf=#{Formula[\"netcdf\"].opt_bin}/nc-config\" if build.with? \"netcdf\"\n\n    if build.with? \"ffmpeg\"\n      ffmpeg = Formula[\"ffmpeg\"]\n      args << \"--with-ffmpeg-includes=#{(Dir[\"#{ffmpeg.opt_include}/*\"]).join(\" \")}\"\n      args << \"--with-ffmpeg-libs=#{ffmpeg.opt_lib}\"\n      args << \"--with-ffmpeg\"\n    end\n\n    if MacOS.version >= :el_capitan\n      # handle stripping of DYLD_* env vars by SIP when passed to utilities;\n      # HOME env var is .brew_home during build, so it is still checked for lib\n      ln_sf \"#{buildpath}/dist.x86_64-apple-darwin#{`uname -r`.strip}/lib\", \".brew_home/lib\"\n    end\n\n    system \"./configure\", \"--prefix=#{prefix}\", *args\n    system \"make\", \"GDAL_DYNAMIC=\" # make and make install must be separate steps.\n    system \"make\", \"GDAL_DYNAMIC=\", \"install\" # GDAL_DYNAMIC set to blank for r.external compatability\n\n    # ensure QGIS's Processing plugin recognizes install\n    ln_sf \"../bin/grass70\", prefix/\"grass-#{version}/grass70.sh\"\n    # link so settings in external apps don't need updated on grass version bump\n    # in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass-70/grass-base\n    ln_sf \"grass-#{version}\", prefix/\"grass-base\"\n  end\n\n  def formula_site_packages(f)\n    `python -c \"import os, sys, site; sp1 = list(sys.path); site.addsitedir('#{Formula[f].opt_lib}/python2.7/site-packages'); print(os.pathsep.join([x for x in sys.path if x not in sp1]))\"`.strip\n  end\n\n  def caveats\n    if headless?\n      <<~EOS\n        This build of GRASS has been compiled without the WxPython GUI.\n\n        The command line tools remain fully functional.\n        EOS\n    end\n  end\n\n  test do\n    system bin/\"grass70\", \"--version\"\n  end\nend\n\n__END__\ndiff --git a/include/Make/Install.make b/include/Make/Install.make\nindex cf16788..8c0007b 100644\n--- a/include/Make/Install.make\n+++ b/include/Make/Install.make\n@@ -114,11 +114,6 @@ real-install: | $(INST_DIR) $(UNIX_BIN)\n \t-$(INSTALL) config.status $(INST_DIR)/config.status\n \t-$(CHMOD) -R a+rX $(INST_DIR) 2>/dev/null\n \n-ifneq ($(findstring darwin,$(ARCH)),)\n-\t@# enable OSX Help Viewer\n-\t@/bin/ln -sfh \"$(INST_DIR)/docs/html\" /Library/Documentation/Help/GRASS-$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR)\n-endif\n-\n $(INST_DIR) $(UNIX_BIN):\n \t$(MAKE_DIR_CMD) $@\n \n"
  },
  {
    "path": "boneyard/grass6.rb",
    "content": "require File.expand_path(\"../../Requirements/grass_requirements\",\n                         Pathname.new(__FILE__).realpath)\n\nclass Grass6 < Formula\n  desc \"Geographic Resources Analysis Support System\"\n  homepage \"http://grass.osgeo.org/\"\n\n  stable do\n    url \"https://grass.osgeo.org/grass64/source/grass-6.4.6.tar.gz\"\n    sha256 \"5a84754614619cc265d843980e28f39a1d24048805b9b2865e76a583d973f333\"\n\n    # Patches to keep files from being installed outside of the prefix.\n    # Remove lines from Makefile that try to install to /Library/Documentation.\n    # Also, quick patch for compiling with clang (as yet, unreported issue)\n    patch :DATA\n  end\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    sha256 \"3b3257f5fcc7c3d4eb3997c658e8965fbdbda67f5068a6465eeeeea38c025134\" => :sierra\n  end\n\n  option \"without-gui\", \"Build without WxPython interface. Command line tools still available.\"\n\n  depends_on UnlinkedGRASS6\n\n  # TODO: test on 10.6 first. may work with latest wxWidgets 3.0\n  # depends on :macos => :lion\n  # TODO: builds with clang (has same non-fatal errors as gcc), but is it compiled correctly?\n  # depends on \"gcc\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"gettext\"\n  depends_on \"readline\"\n  depends_on \"gdal\"\n  depends_on \"libtiff\"\n  depends_on \"unixodbc\"\n  depends_on \"fftw\"\n  depends_on \"python@2\"\n  depends_on \"wxpython\"\n  depends_on \"osgeo-postgresql\" => :optional\n  depends_on \"mysql\" => :optional\n  depends_on \"cairo\"\n  depends_on :x11 # needs to find at least X11/include/GL/gl.h\n\n  def headless?\n    # The GRASS GUI is based on WxPython.\n    build.without? \"gui\"\n  end\n\n  def install\n    readline = Formula[\"readline\"].opt_prefix\n    gettext = Formula[\"gettext\"].opt_prefix\n\n    # noinspection RubyLiteralArrayInspection\n    args = [\n      \"--disable-debug\", \"--disable-dependency-tracking\",\n      \"--enable-largefile\",\n      \"--enable-shared\",\n      \"--with-cxx\",\n      \"--without-motif\",\n      \"--with-python\",\n      \"--with-blas\",\n      \"--with-lapack\",\n      \"--with-sqlite\",\n      \"--with-odbc\",\n      \"--with-geos=#{Formula[\"geos\"].opt_bin}/geos-config\",\n      \"--with-proj-share=#{Formula[\"proj\"].opt_share}/proj\",\n      \"--with-png\",\n      \"--with-readline-includes=#{readline}/include\",\n      \"--with-readline-libs=#{readline}/lib\",\n      \"--with-readline\",\n      \"--with-nls-includes=#{gettext}/include\",\n      \"--with-nls-libs=#{gettext}/lib\",\n      \"--with-nls\",\n      \"--with-freetype\",\n      \"--without-tcltk\", # Disabled due to compatibility issues with OS X Tcl/Tk\n      \"--with-includes=#{gettext}/include\"\n    ]\n\n    unless MacOS::CLT.installed?\n      # On Xcode-only systems (without the CLT), we have to help:\n      args << \"--with-macosx-sdk=#{MacOS.sdk_path}\"\n      args << \"--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers\"\n    end\n\n    if headless?\n      args << \"--without-wxwidgets\"\n    else\n      wx_paths = formula_site_packages \"wxpython\"\n      ENV.prepend(\"PYTHONPATH\", wx_paths, File::PATH_SEPARATOR) if wx_paths\n      args << \"--with-wxwidgets=#{Formula[\"wxmac\"].opt_bin}/wx-config\"\n    end\n\n    args << \"--enable-64bit\" if MacOS.prefer_64_bit?\n    args << \"--with-macos-archs=#{MacOS.preferred_arch}\"\n\n    cairo = Formula[\"cairo\"]\n    args << \"--with-cairo-includes=#{cairo.include}/cairo\"\n    args << \"--with-cairo-libs=#{cairo.lib}\"\n    args << \"--with-cairo\"\n\n    # Database support\n    args << \"--with-postgres\" if build.with? \"postgresql\"\n\n    if build.with? \"mysql\"\n      mysql = Formula[\"mysql\"]\n      args << \"--with-mysql-includes=#{mysql.include}/mysql\"\n      args << \"--with-mysql-libs=#{mysql.lib}\"\n      args << \"--with-mysql\"\n    end\n\n    if MacOS.version >= :el_capitan\n      # handle stripping of DYLD_* env vars by SIP when passed to utilities;\n      # HOME env var is .brew_home during build, so it is still checked for lib\n      ln_sf \"#{buildpath}/dist.x86_64-apple-darwin#{`uname -r`.strip}/lib\", \".brew_home/lib\"\n    end\n\n    system \"./configure\", \"--prefix=#{prefix}\", *args\n    system \"make\", \"GDAL_DYNAMIC=\" # make and make install must be separate steps.\n    system \"make\", \"GDAL_DYNAMIC=\", \"install\" # GDAL_DYNAMIC set to blank for r.external compatability\n  end\n\n  def post_install\n    # ensure QGIS's Processing plugin recognizes install\n    ln_sf \"../bin/grass64\", prefix/\"grass-#{version}/grass.sh\"\n    # link so settings in external apps don't need updated on grass version bump\n    # in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass6/grass-base\n    ln_sf \"grass-#{version}\", prefix/\"grass-base\"\n  end\n\n  def formula_site_packages(f)\n    `python2 -c \"import os, sys, site; sp1 = list(sys.path); site.addsitedir('#{Formula[f].opt_lib}/python2.7/site-packages'); print(os.pathsep.join([x for x in sys.path if x not in sp1]))\"`.strip\n  end\n\n  def caveats\n    if headless?\n      <<~EOS\n        This build of GRASS has been compiled without the WxPython GUI.\n\n        The command line tools remain fully functional.\n        EOS\n    end\n  end\n\n  test do\n    system \"#{bin}/grass64\", \"--version\"\n  end\nend\n\n\n__END__\ndiff --git a/Makefile b/Makefile\nindex 40b736d..1a1d8df 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -311,8 +311,6 @@ ifeq ($(strip $(MINGW)),)\n \t-tar cBf - gem/skeleton | (cd ${INST_DIR}/etc ; tar xBf - ) 2>/dev/null\n \t-${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${BINDIR} 2>/dev/null\n endif\n-\t@# enable OSX Help Viewer\n-\t@if [ \"`cat include/Make/Platform.make | grep -i '^ARCH.*darwin'`\" ] ; then /bin/ln -sfh \"${INST_DIR}/docs/html\" /Library/Documentation/Help/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} ; fi\n \n \n install-strip: FORCE\ndiff --git a/raster/r.terraflow/direction.cpp b/raster/r.terraflow/direction.cpp\nindex 7744518..778c225 100644\n--- a/raster/r.terraflow/direction.cpp\n+++ b/raster/r.terraflow/direction.cpp\n@@ -53,11 +53,11 @@ encodeDirectionMFD(const genericWindow<elevation_type>& elevwin,\n   \n   if(!is_nodata(elevwin.get())) {\n     dir = 0;\n-    if (elevwin.get(5) < elevwin.get() && !is_void(elevwin.get(5))) dir |= 1;\n-    if (elevwin.get(3) < elevwin.get() && !is_void(elevwin.get(3))) dir |= 16;\n+    if (elevwin.get(5) < elevwin.get() && !is_voided(elevwin.get(5))) dir |= 1;\n+    if (elevwin.get(3) < elevwin.get() && !is_voided(elevwin.get(3))) dir |= 16;\n     for(int i=0; i<3; i++) {\n-      if(elevwin.get(i) < elevwin.get() && !is_void(elevwin.get(i))) dir |= 32<<i;\n-      if(elevwin.get(i+6) < elevwin.get() && !is_void(elevwin.get(6+i))) dir |= 8>>i;\n+      if(elevwin.get(i) < elevwin.get() && !is_voided(elevwin.get(i))) dir |= 32<<i;\n+      if(elevwin.get(i+6) < elevwin.get() && !is_voided(elevwin.get(6+i))) dir |= 8>>i;\n     }\n   }\n   \ndiff --git a/raster/r.terraflow/nodata.cpp b/raster/r.terraflow/nodata.cpp\nindex 159c66d..610ca55 100644\n--- a/raster/r.terraflow/nodata.cpp\n+++ b/raster/r.terraflow/nodata.cpp\n@@ -73,7 +73,7 @@ is_nodata(float x) {\n \n \n int\n-is_void(elevation_type el) {\n+is_voided(elevation_type el) {\n   return (el == nodataType::ELEVATION_NODATA);\n }\n \ndiff --git a/raster/r.terraflow/nodata.h b/raster/r.terraflow/nodata.h\nindex 1e843c5..ac56504 100644\n--- a/raster/r.terraflow/nodata.h\n+++ b/raster/r.terraflow/nodata.h\n@@ -37,7 +37,7 @@\n int is_nodata(elevation_type el);\n int is_nodata(int x);\n int is_nodata(float x);\n-int is_void(elevation_type el);\n+int is_voided(elevation_type el);\n \n \n class nodataType : public ijBaseType {\n"
  },
  {
    "path": "boneyard/grass7-lts.rb",
    "content": "require File.expand_path(\"../../Requirements/grass_requirements\",\n                         Pathname.new(__FILE__).realpath)\n\nclass Grass7Lts < Formula\n  desc \"Geographic Resources Analysis Support System\"\n  homepage \"https://grass.osgeo.org/\"\n\n  stable do\n    url \"https://grass.osgeo.org/grass72/source/grass-7.2.3.tar.gz\"\n    sha256 \"a8d9a024d2c64c11082e8128f4200222c05659b971e3d826a146f9a8f9d93398\"\n\n    # Patches to keep files from being installed outside of the prefix.\n    # Remove lines from Makefile that try to install to /Library/Documentation.\n    patch :DATA\n  end\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    sha256 \"e2ddee7d7fa3575a9ba42634613bb9667897b773d5a82d01feb810496599919d\" => :high_sierra\n    sha256 \"e2ddee7d7fa3575a9ba42634613bb9667897b773d5a82d01feb810496599919d\" => :sierra\n  end\n\n  option \"without-gui\", \"Build without WxPython interface. Command line tools still available.\"\n  option \"with-liblas\", \"Build with LibLAS-with-GDAL2 support\"\n\n  depends_on UnlinkedGRASS7\n\n  # TODO: test on 10.6 first. may work with latest wxWidgets 3.0\n  # depends on :macos => :lion\n  # TODO: builds with clang (has same non-fatal errors as gcc), but is it compiled correctly?\n  # depends on \"gcc\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"gettext\"\n  depends_on \"readline\"\n  depends_on \"flex\"\n  depends_on \"bison\"\n  depends_on \"lbzip2\"\n  depends_on \"gdal2\"\n  depends_on \"libtiff\"\n  depends_on \"unixodbc\"\n  depends_on \"fftw\"\n  depends_on \"python@2\"\n  depends_on \"numpy\"\n  depends_on \"wxpython\"\n  depends_on \"osgeo-postgresql\" => :optional\n  depends_on \"mysql\" => :optional\n  depends_on \"cairo\"\n  depends_on \"ghostscript\" # for cartographic composer previews\n  depends_on :x11 # needs to find at least X11/include/GL/gl.h\n  depends_on \"openblas\" => :optional\n  depends_on \"liblas-gdal2\" if build.with? \"liblas\"\n  depends_on \"osgeo-netcdf\" => :optional\n  depends_on \"ffmpeg\" => :optional\n\n  def headless?\n    # The GRASS GUI is based on WxPython.\n    build.without? \"gui\"\n  end\n\n  def majmin_ver\n    ver_split = version.to_s.split(\".\")\n    ver_split[0] + ver_split[1]\n  end\n\n  def install\n    readline = Formula[\"readline\"]\n    gettext = Formula[\"gettext\"]\n\n    # noinspection RubyLiteralArrayInspection\n    args = [\n      \"--disable-debug\", \"--disable-dependency-tracking\",\n      \"--enable-shared\",\n      \"--with-cxx\",\n      \"--with-python\",\n      \"--with-blas\",\n      \"--with-lapack\",\n      \"--with-sqlite\",\n      \"--with-odbc\",\n      \"--with-bzlib\",\n      \"--with-geos=#{Formula[\"geos\"].opt_bin}/geos-config\",\n      \"--with-proj-share=#{Formula[\"proj\"].opt_share}/proj\",\n      \"--with-png\",\n      \"--with-readline-includes=#{readline.opt_include}\",\n      \"--with-readline-libs=#{readline.opt_lib}\",\n      \"--with-readline\",\n      \"--with-nls-includes=#{gettext.opt_include}\",\n      \"--with-nls-libs=#{gettext.opt_lib}\",\n      \"--with-nls\",\n      \"--with-freetype\",\n      \"--without-tcltk\", # Disabled due to compatibility issues with OS X Tcl/Tk\n      \"--with-includes=#{gettext.opt_include}\"\n    ]\n\n    unless MacOS::CLT.installed?\n      # On Xcode-only systems (without the CLT), we have to help:\n      args << \"--with-macosx-sdk=#{MacOS.sdk_path}\"\n      args << \"--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers\"\n    end\n\n    if headless?\n      args << \"--without-wxwidgets\"\n    else\n      wx_paths = formula_site_packages \"wxpython\"\n      ENV.prepend(\"PYTHONPATH\", wx_paths, File::PATH_SEPARATOR) if wx_paths\n      args << \"--with-wxwidgets=#{Formula[\"wxmac\"].opt_bin}/wx-config\"\n    end\n\n    args << \"--enable-64bit\" if MacOS.prefer_64_bit?\n    args << \"--with-macos-archs=#{MacOS.preferred_arch}\"\n\n    cairo = Formula[\"cairo\"]\n    args << \"--with-cairo-includes=#{cairo.opt_include}/cairo\"\n    args << \"--with-cairo-libs=#{cairo.opt_lib}\"\n    args << \"--with-cairo\"\n\n    # Database support\n    args << \"--with-postgres\" if build.with? \"postgresql\"\n\n    if build.with? \"mysql\"\n      mysql = Formula[\"mysql\"]\n      args << \"--with-mysql-includes=#{mysql.opt_include}/mysql\"\n      args << \"--with-mysql-libs=#{mysql.opt_lib}\"\n      args << \"--with-mysql\"\n    end\n\n    # other optional support\n    if build.with? \"openblas\" # otherwise, Apple's will be found\n      openblas = Formula[\"openblas\"]\n      args << \"--with-blas-includes=#{openblas.opt_include}\"\n      args << \"--with-blas-libs=#{openblas.opt_lib}\"\n    end\n\n    args << \"--with-liblas=#{Formula[\"liblas-gdal2\"].opt_bin}/liblas-config\" if build.with? \"liblas\"\n    args << \"--with-netcdf=#{Formula[\"netcdf\"].opt_bin}/nc-config\" if build.with? \"netcdf\"\n\n    if build.with? \"ffmpeg\"\n      ffmpeg = Formula[\"ffmpeg\"]\n      args << \"--with-ffmpeg-includes=#{(Dir[\"#{ffmpeg.opt_include}/*\"]).join(\" \")}\"\n      args << \"--with-ffmpeg-libs=#{ffmpeg.opt_lib}\"\n      args << \"--with-ffmpeg\"\n    end\n\n    if MacOS.version >= :el_capitan\n      # handle stripping of DYLD_* env vars by SIP when passed to utilities;\n      # HOME env var is .brew_home during build, so it is still checked for lib\n      ln_sf \"#{buildpath}/dist.x86_64-apple-darwin#{`uname -r`.strip}/lib\", \".brew_home/lib\"\n    end\n\n    system \"./configure\", \"--prefix=#{prefix}\", *args\n    system \"make\", \"GDAL_DYNAMIC=\" # make and make install must be separate steps.\n    system \"make\", \"GDAL_DYNAMIC=\", \"install\" # GDAL_DYNAMIC set to blank for r.external compatability\n\n    # ensure QGIS's Processing plugin recognizes install\n    # 2.14.8+ and other newer QGIS versions may reference just grass.sh\n    bin_grass = \"../bin/grass#{majmin_ver}\"\n    ln_sf bin_grass, prefix/\"grass-#{version}/grass#{majmin_ver}.sh\"\n    ln_sf bin_grass, prefix/\"grass-#{version}/grass.sh\"\n    # link so settings in external apps don't need updated on grass version bump\n    # in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass7/grass-base\n    ln_sf \"grass-#{version}\", prefix/\"grass-base\"\n    # ensure python2 is used\n    bin.env_script_all_files(libexec/\"bin\", :GRASS_PYTHON => \"python2\")\n  end\n\n  def formula_site_packages(f)\n    `python2 -c \"import os, sys, site; sp1 = list(sys.path); site.addsitedir('#{Formula[f].opt_lib}/python2.7/site-packages'); print(os.pathsep.join([x for x in sys.path if x not in sp1]))\"`.strip\n  end\n\n  def caveats\n    if headless?\n      <<~EOS\n        This build of GRASS has been compiled without the WxPython GUI.\n\n        The command line tools remain fully functional.\n        EOS\n    end\n  end\n\n  test do\n    system bin/\"grass#{majmin_ver}\", \"--version\"\n  end\nend\n\n__END__\ndiff --git a/include/Make/Install.make b/include/Make/Install.make\nindex cf16788..8c0007b 100644\n--- a/include/Make/Install.make\n+++ b/include/Make/Install.make\n@@ -114,11 +114,6 @@ real-install: | $(INST_DIR) $(UNIX_BIN)\n \t-$(INSTALL) config.status $(INST_DIR)/config.status\n \t-$(CHMOD) -R a+rX $(INST_DIR) 2>/dev/null\n \n-ifneq ($(findstring darwin,$(ARCH)),)\n-\t@# enable OSX Help Viewer\n-\t@/bin/ln -sfh \"$(INST_DIR)/docs/html\" /Library/Documentation/Help/GRASS-$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR)\n-endif\n-\n $(INST_DIR) $(UNIX_BIN):\n \t$(MAKE_DIR_CMD) $@\n \n"
  },
  {
    "path": "boneyard/libgpkg.rb",
    "content": "require \"formula\"\n\nclass RubyVersion19 < Requirement\n  fatal true\n  satisfy(:build_env => false) { %x(ruby -e 'print RUBY_VERSION').strip.to_f >= 1.9 }\n\n  def message; <<~EOS\n      Ruby >= 1.9 is required to run tests, which utilize Encoding class.\n      Install without `--with-tests` option.\n  EOS\n  end\nend\n\nclass Libgpkg < Formula\n  homepage \"https://bitbucket.org/luciad/libgpkg\"\n  url \"https://bitbucket.org/luciad/libgpkg/get/0.9.15.tar.gz\"\n  sha1 \"1c42c36c0fd0b043b532efe11208652f581aa52c\"\n\n  head \"https://bitbucket.org/luciad/libgpkg\", :using => :hg, :branch => \"default\"\n\n  option \"with-tests\", \"Run unit tests after build, prior to install\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"geos\" => :recommended\n  if build.with? \"tests\"\n    depends_on RubyVersion19\n    depends_on \"ruby\" => :build\n    depends_on \"bundler\" => :ruby\n  end\n\n  def install\n    args = std_cmake_args\n    args << \"-DGPKG_GEOS=ON\" if build.with? \"geos\"\n    args << \"-DGPKG_TEST=ON\" if build.with? \"tests\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      IO.popen(\"make test\") {|io| io.each {|s| print s}} if build.with? \"tests\"\n      system \"make\", \"install\"\n    end\n  end\n\n  def caveats; <<~EOS\n      Custom SQLite command-line shell that autoloads static GeoPackage extension:\n        #{opt_prefix}/bin/gpkg\n\n      Make sure to review Usage (extension loading) and Function Reference docs:\n        https://bitbucket.org/luciad/libgpkg/wiki/Home\n\n  EOS\n  end\nend\n"
  },
  {
    "path": "boneyard/mapcache-12.rb",
    "content": "class Mapcache12 < Formula\n  MAPSERVER = \"mapserver-64\"\n\n  homepage \"http://mapserver.org/mapcache/\"\n  url \"https://github.com/mapserver/mapcache/archive/rel-1-2-1.tar.gz\"\n  sha256 \"31c6c074324f609eda69743b288926c36bb23826eb6bf090f1146aaf31b59c20\"\n  version \"1.2.1\"\n\n  option \"with-tiff-cache\", \"Build with TIFFs as a cache backend\"\n  option \"without-apache-module\", \"Build without Apache2 module\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"apr\" => :build if build.with? \"apache-module\"\n  depends_on \"libpng\"\n  depends_on \"jpeg\"\n  depends_on \"pcre\" => :recommended\n  depends_on \"pixman\" => :recommended\n  depends_on \"fcgi\"\n  depends_on \"sqlite\"\n  depends_on \"gdal\"\n  depends_on \"geos\"\n\n  if build.with? \"tiff-cache\"\n    depends_on \"libgeotiff\"\n    depends_on \"libtiff\"\n  end\n  depends_on \"berkeley-db\" => :optional\n  depends_on \"memcached\" => :optional\n  depends_on MAPSERVER => :optional\n\n  def install\n    args = std_cmake_args\n    # option(WITH_SQLITE \"Use sqlite as a cache backend\" ON)\n    # option(WITH_GEOS \"Choose if GEOS geometry operations support should be built in\" ON)\n    # option(WITH_OGR \"Choose if OGR/GDAL input vector support should be built in\" ON)\n    # option(WITH_CGI \"Choose if CGI executable should be built\" ON)\n    # option(WITH_FCGI \"Choose if CGI executable should support FastCGI\" ON)\n    # Fix up .fcgi install path\n    args << \"-DCMAKE_INSTALL_CGIBINDIR=#{libexec}\"\n\n    # option(WITH_VERSION_STRING \"Show MapCache in server version string\" ON)\n    # option(WITH_APACHE \"Build Apache Module\" ON)\n    if build.with? \"apache-module\"\n      args << \"-DAPACHE_MODULE_DIR=#{libexec}\"\n    else\n      args << \"-DWITH_APACHE=OFF\"\n    end\n    # option(WITH_PIXMAN \"Use pixman for SSE optimized image manipulations\" ON)\n    args << \"-DWWITH_PIXMAN=\" + (build.with?(\"pixman\") ? \"ON\" : \"OFF\")\n    # option(WITH_BERKELEY_DB \"Use Berkeley DB as a cache backend\" OFF)\n    args << \"-DWITH_BERKELEY_DB=\" + (build.with?(\"berkeley-db\") ? \"ON\" : \"OFF\")\n    # option(WITH_MEMCACHE \"Use memcache as a cache backend (requires recent apr-util)\" OFF)\n    args << \"-DWITH_MEMCACHE=\" + (build.with?(\"memcached\") ? \"ON\" : \"OFF\")\n    # option(WITH_PCRE \"Use PCRE for regex tests\" OFF)\n    args << \"-DWITH_PCRE=\" + (build.with?(\"pcre\") ? \"ON\" : \"OFF\")\n    # option(WITH_MAPSERVER \"Enable (experimental) support for the mapserver library\" OFF)\n    args << \"-DWITH_MAPSERVER=\" + (build.with?(MAPSERVER) ? \"ON\" : \"OFF\")\n\n    # option(WITH_TIFF \"Use TIFFs as a cache backend\" OFF)\n    # option(WITH_TIFF_WRITE_SUPPORT \"Enable (experimental) support for writable TIFF cache backends\" OFF)\n    # option(WITH_GEOTIFF \"Allow GeoTIFF metadata creation for TIFF cache backends\" OFF)\n    args << \"-DWITH_TIFF=\" + (build.with?(\"tiff-cache\") ? \"ON\" : \"OFF\")\n    args << \"-DWITH_GEOTIFF=\" + (build.with?(\"tiff-cache\") ? \"ON\" : \"OFF\")\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      # system \"/usr/local/bin/bbedit\", \"CMakeCache.txt\"\n      # raise\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    # Add config examples\n    (prefix/\"config\").mkpath\n    cp Dir[\"mapcache.xml*\"], prefix/\"config\"\n  end\n\n  def caveats; <<~EOS\n    The MapCache FCGI executable and Apache module are located in:\n      #{libexec}/\n\n    Configuration examples are located in:\n      #{prefix}/\n\n  EOS\n  end\nend\n"
  },
  {
    "path": "boneyard/mapserver-64.rb",
    "content": "class JavaJDK < Requirement\n  fatal true\n\n  def self.home\n    [\n        `/usr/libexec/java_home`.chomp!,\n        ENV[\"JAVA_HOME\"]\n    ].find { |dir| dir && File.exist?(\"#{dir}/bin/javac\") &&\n        (File.exist?(\"#{dir}/include\" || File.exist?(\"#{dir}/bundle\"))) }\n  end\n\n  satisfy :build_env => false do\n    self.class.home\n  end\n\n  def message; <<~EOS\n    Could not find a JDK (i.e. not a JRE)\n\n    Do one of the following:\n    - install a JDK that is detected with /usr/libexec/java_home\n    - set the JAVA_HOME environment variable\n    - specify --without-java\n\n  EOS\n  end\nend\n\nclass Mapserver64 < Formula\n  # TODO: audit and comapare against `mapserver` in core\n  desc \"\"\n  homepage \"http://mapserver.org/\"\n  url \"http://download.osgeo.org/mapserver/mapserver-6.4.3.tar.gz\"\n  sha256 \"1f432d4b44e7a0e4e9ce883b02c91c9a66314123028eebb0415144903b8de9c2\"\n\n  # bottle do\n  #   root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n  #   sha256 \"\" => :mavericks\n  # end\n\n  head do\n    url \"https://github.com/mapserver/mapserver.git\", :branch => \"master\"\n    depends_on \"harfbuzz\"\n    depends_on \"v8\" => :optional\n  end\n\n  conflicts_with \"mapserver\", :because => \"mapserver is in main tap\"\n\n  option \"without-php\", \"Build PHP MapScript module\"\n  option \"without-rpath\", \"Don't embed rpath to installed libmapserver in modules\"\n  option \"without-geos\", \"Build without GEOS spatial operations support\"\n  option \"without-postgresql\", \"Build without PostgreSQL data source support\"\n  option \"without-xml-mapfile\", \"Build with native XML mapfile support\"\n  option \"with-java\", \"Build Java MapScript module\"\n  option \"with-gd\", \"Build with GD support (deprecated)\" unless build.head?\n  option \"with-librsvg\", \"Build with SVG symbology support\"\n  option \"with-docs\", \"Download and generate HTML documentation\"\n  option \"with-unit-tests\", \"Download and install full unit test suite\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"freetype\"\n  depends_on \"libpng\"\n  depends_on :python\n  depends_on \"swig\" => :build\n  depends_on JavaJDK if build.with? \"java\"\n  depends_on \"giflib\"\n  depends_on \"gd\" => :optional unless build.head?\n  depends_on \"proj\"\n  depends_on \"geos\" => :recommended\n  depends_on \"gdal\"\n  depends_on \"postgresql\" => :recommended\n  depends_on \"mysql\" => :optional\n  depends_on \"fcgi\" => :recommended\n  depends_on \"cairo\" => :recommended\n  depends_on \"libxml2\" if build.with? \"xml-mapfile\" or MacOS.version < :mountain_lion\n  depends_on \"libxslt\" if build.with? \"xml-mapfile\"\n  depends_on \"librsvg\" => :optional\n  depends_on \"fribidi\"\n  depends_on :python => %w[sphinx] if build.with? \"docs\"\n\n  resource \"sphinx\" do\n    url \"https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.2.tar.gz\"\n    sha256 \"2d3415f5b3e6b7535877f4c84fe228bdb802a8993c239b2d02c23169d67349bd\"\n  end\n\n  resource \"docs\" do\n    # NOTE: seems to be no tagged releases for `docs`, just active branches\n    url \"https://github.com/mapserver/docs.git\", :branch => \"branch-6-4\"\n    version \"6.4\"\n  end\n\n  resource \"unittests\" do\n    url \"https://github.com/mapserver/msautotest.git\",\n        :revision => \"b0ba5ccbfb6b0395820f492eb5a190cf643b5ed8\"\n    version \"6.4\"\n  end\n\n  def png_prefix\n    png = Formula[\"libpng\"]\n    (png.installed? or MacOS.version >= :mountain_lion) ? png.opt_prefix : MacOS::X11.prefix\n  end\n\n  def freetype_prefix\n    ft = Formula[\"freetype\"]\n    (ft.installed? or MacOS.version >= :mountain_lion) ? ft.opt_prefix : MacOS::X11.prefix\n  end\n\n  def install\n    # install unit tests\n    (prefix/\"msautotest\").install resource(\"unittests\") if build.with? \"unit-tests\"\n\n    ENV.prepend_path \"CMAKE_PREFIX_PATH\", freetype_prefix\n    ENV.prepend_path \"CMAKE_PREFIX_PATH\", png_prefix\n\n    args = std_cmake_args\n    if MacOS.prefer_64_bit?\n      args << \"-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}\"\n    else\n      args << \"-DCMAKE_OSX_ARCHITECTURES=i386\"\n    end\n\n    # defaults different than CMakeLists.txt (they don't incur extra dependencies)\n    args.concat %W[\n      -DWITH_KML=ON\n      -DWITH_CURL=ON\n      -DWITH_CLIENT_WMS=ON\n      -DWITH_CLIENT_WFS=ON\n      -DWITH_SOS=ON\n    ]\n\n    args << \"-DWITH_XMLMAPFILE=ON\" if build.with? \"xml-mapfile\"\n    args << \"-DWITH_MYSQL=ON\" if build.with? \"mysql\"\n    args << \"-DWITH_GD=ON\" if build.with? \"gd\" && !build.head?\n    args << \"-DWITH_RSVG=ON\" if build.with? \"librsvg\"\n\n    mapscr_dir = prefix/\"mapscript\"\n    mapscr_dir.mkpath\n    rpath = %Q{-Wl,-rpath,\"#{opt_prefix/\"lib\"}\"}\n    use_rpath = build.with? \"rpath\"\n    cd \"mapscript\" do\n      args << \"-DWITH_PYTHON=ON\"\n      inreplace \"python/CMakeLists.txt\" do |s|\n        s.gsub! \"${PYTHON_SITE_PACKAGES}\", %Q{\"#{lib/which_python/\"site-packages\"}\"}\n        s.sub! \"${MAPSERVER_LIBMAPSERVER}\",\n               \"#{rpath} ${MAPSERVER_LIBMAPSERVER}\" if use_rpath\n      end\n\n      # override language extension install locations, e.g. install to prefix/\"mapscript/lang\"\n      args << \"-DWITH_RUBY=ON\"\n      (mapscr_dir/\"ruby\").mkpath\n      inreplace \"ruby/CMakeLists.txt\" do |s|\n        s.gsub! \"${RUBY_SITEARCHDIR}\", %Q{\"#{mapscr_dir}/ruby\"}\n        s.sub! \"${MAPSERVER_LIBMAPSERVER}\",\n               \"#{rpath} ${MAPSERVER_LIBMAPSERVER}\" if use_rpath\n      end\n\n      if build.with? \"php\"\n        args << \"-DWITH_PHP=ON\"\n        (mapscr_dir/\"php\").mkpath\n        inreplace \"php/CMakeLists.txt\" do |s|\n          s.gsub! \"${PHP5_EXTENSION_DIR}\", %Q{\"#{mapscr_dir}/php\"}\n          s.sub! \"${MAPSERVER_LIBMAPSERVER}\",\n                 \"#{rpath} ${MAPSERVER_LIBMAPSERVER}\" if use_rpath\n        end\n      end\n\n      args << \"-DWITH_PERL=ON\"\n      (mapscr_dir/\"perl\").mkpath\n      args << \"-DCUSTOM_PERL_SITE_ARCH_DIR=#{mapscr_dir}/perl\"\n      inreplace \"perl/CMakeLists.txt\", \"${MAPSERVER_LIBMAPSERVER}\",\n                \"#{rpath} ${MAPSERVER_LIBMAPSERVER}\" if use_rpath\n\n      if build.with? \"java\"\n        args << \"-DWITH_JAVA=ON\"\n        ENV[\"JAVA_HOME\"] = JavaJDK.home\n        (mapscr_dir/\"java\").mkpath\n        inreplace \"java/CMakeLists.txt\" do |s|\n          s.gsub! \"DESTINATION ${CMAKE_INSTALL_LIBDIR}\",\n                  %Q|${CMAKE_CURRENT_BINARY_DIR}/mapscript.jar DESTINATION \"#{mapscr_dir}/java\"|\n          s.sub! \"${MAPSERVER_LIBMAPSERVER}\",\n                 \"#{rpath} ${MAPSERVER_LIBMAPSERVER}\" if use_rpath\n        end\n      end\n    end\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\", \"install\"\n    end\n\n    # install devel headers\n    (include/\"mapserver\").install Dir[\"*.h\"]\n\n    prefix.install \"tests\"\n    (mapscr_dir/\"python\").install \"mapscript/python/tests\"\n    cd \"mapscript\" do\n      %w[python ruby perl].each {|x|(mapscr_dir/\"#{x}\").install \"#{x}/examples\"}\n      (mapscr_dir/\"php\").install \"php/examples\" if build.with? \"php\"\n      (mapscr_dir/\"java\").install \"java/examples\" if build.with? \"java\"\n    end\n\n    # write install instructions for modules\n    s = \"\"\n    mapscr_opt_dir = opt_prefix/\"mapscript\"\n    if build.with? \"php\"\n      s += <<~EOS\n        Using the built PHP module:\n          * Add the following line to php.ini:\n            extension=\"#{mapscr_opt_dir}/php/php_mapscript.so\"\n          * Execute \"php -m\"\n          * You should see MapScript in the module list\n\n      EOS\n    end\n    %w[ruby perl java].each do |m|\n      if m != \"java\" or build.with? m\n        cmd = []\n        case m\n        when \"ruby\"\n          ruby_site = %x[ruby -r rbconfig -e 'puts RbConfig::CONFIG[\"sitearchdir\"]'].chomp\n          cmd << \"sudo cp -f mapscript.bundle #{ruby_site}/\"\n        when \"perl\"\n          perl_site = %x[perl -MConfig -e 'print $Config{\"sitearch\"};'].chomp\n          cmd << \"sudo cp -f mapscript.pm #{perl_site}/\"\n          cmd << \"sudo cp -fR auto/mapscript #{perl_site}/auto/\"\n        when \"java\"\n          cmd << \"sudo cp -f libjavamapscript.jnilib mapscript.jar /Library/Java/Extensions/\"\n        else\n        end\n        s += <<~EOS\n          Install the built #{m.upcase} module with:\n            cd #{mapscr_opt_dir}/#{m}\n            #{cmd[0]}\n            #{cmd[1] + \"\\n\" if cmd[1]}\n        EOS\n      end\n    end\n    (mapscr_dir/\"Install_Modules.txt\").write s\n\n    if build.with? \"docs\"\n      unless which(\"sphinx-build\")\n        # vendor a local sphinx install\n        sphinx_site = libexec/\"lib/python2.7/site-packages\"\n        ENV.prepend_create_path \"PYTHONPATH\", sphinx_site\n        resource(\"sphinx\").stage {quiet_system \"python2.7\", \"setup.py\", \"install\", \"--prefix=#{libexec}\"}\n        ENV.prepend_path \"PATH\", libexec/\"bin\"\n      end\n      resource(\"docs\").stage do\n        # just build the en docs\n        inreplace \"Makefile\", \"$(TRANSLATIONS_I18N) $(TRANSLATIONS_STATIC)\", \"\"\n        system \"make\", \"html\"\n        doc.install \"build/html\" => \"html\"\n      end\n    end\n  end\n\n  def caveats; <<~EOS\n    The Mapserver CGI executable is #{opt_prefix}/bin/mapserv\n\n    Instructions for installing any built, but uninstalled, mapscript modules:\n      #{opt_prefix}/mapscript/Install_Modules.txt\n\n    EOS\n  end\n\n  test do\n    mapscr_opt_dir = opt_prefix/\"mapscript\"\n    system \"#{bin}/mapserv\", \"-v\"\n    system \"python\", \"-c\", '\"import mapscript\"'\n    system \"ruby\", \"-e\", \"\\\"require '#{mapscr_opt_dir}/ruby/mapscript'\\\"\"\n    system \"perl\", \"-I#{mapscr_opt_dir}/perl\", \"-e\", '\"use mapscript;\"'\n\n    cd \"#{mapscr_opt_dir}/java/examples\" do\n      system \"#{JavaJDK.home}/bin/javac\",\n             \"-classpath\", \"../\", \"-Djava.ext.dirs=../\", \"RFC24.java\"\n      system \"#{JavaJDK.home}/bin/java\",\n             \"-classpath\", \"../\", \"-Djava.library.path=../\", \"-Djava.ext.dirs=../\",\n             \"RFC24\", \"../../../tests/test.map\"\n    end if build.with? \"java\"\n  end\n\n  private\n\n  def which_python\n    \"python\" + %x(python -c \"import sys;print(sys.version[:3])\").strip\n  end\nend\n"
  },
  {
    "path": "boneyard/minizip.rb",
    "content": "require 'formula'\n\nclass Minizip < Formula\n  homepage 'http://www.winimage.com/zLibDll/minizip.html'\n  url 'http://zlib.net/zlib-1.2.8.tar.gz'\n  sha1 'a4d316c404ff54ca545ea71a27af7dbc29817088'\n\n  # version for minizip, not zlib\n  version '1.1'\n\n  option :universal\n\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"libtool\" => :build\n\n  def patches\n    # configure script fails to detect the right compiler when \"cc\" is\n    # clang, not gcc.\n    # see: https://github.com/Homebrew/homebrew-dupes/pull/228\n    #      https://github.com/madler/zlib/pull/54\n    DATA\n  end\n\n  def install\n    ENV.universal_binary if build.universal?\n    system './configure', \"--prefix=#{prefix}\"\n    system 'make'\n\n    cd 'contrib/minizip' do\n      # edits to statically link to libz.a\n      inreplace 'Makefile.am' do |s|\n        s.sub! '-L$(zlib_top_builddir)', '$(zlib_top_builddir)/libz.a'\n        s.sub! '-version-info 1:0:0 -lz', '-version-info 1:0:0'\n        s.sub! 'libminizip.la -lz', 'libminizip.la'\n      end\n      system 'autoreconf', '-fi'\n      system './configure', \"--prefix=#{prefix}\"\n      system 'make install'\n    end\n\n  end\n\n  def caveats\n    <<~EOS\n      Minizip headers installed in 'minizip' subdirectory, since they conflict\n      with the venerable 'unzip' library.\n    EOS\n  end\nend\n\n__END__\ndiff --git a/configure b/configure\nindex b77a8a8..54f33f7 100755\n--- a/configure\n+++ b/configure\n@@ -159,6 +159,7 @@ case \"$cc\" in\n esac\n case `$cc -v 2>&1` in\n   *gcc*) gcc=1 ;;\n+  *clang*) gcc=1 ;;\n esac\n\n show $cc -c $test.c\n"
  },
  {
    "path": "boneyard/openjpeg20.rb",
    "content": "require 'formula'\n\nclass Openjpeg20 < Formula\n  homepage 'http://www.openjpeg.org/'\n  url 'http://openjpeg.googlecode.com/files/openjpeg-2.0.0.tar.gz'\n  sha1 '0af78ab2283b43421458f80373422d8029a9f7a7'\n\n  keg_only 'Conflicts with openjpeg in main repository.'\n\n  head 'http://openjpeg.googlecode.com/svn/trunk/'\n\n  depends_on 'cmake' => :build\n  depends_on 'little-cms2'\n  depends_on 'libtiff'\n  depends_on \"libpng\"\n\n  def install\n    system 'cmake', '.', *std_cmake_args\n    system 'make install'\n  end\nend\n"
  },
  {
    "path": "boneyard/orfeo-32.rb",
    "content": "require 'formula'\n\nclass Orfeo32 < Formula\n  homepage 'http://www.orfeo-toolbox.org/otb/'\n  url 'https://downloads.sourceforge.net/project/orfeo-toolbox/OTB/OTB-3.20/OTB-3.20.0.tgz'\n  sha256 '0b7ae22aca430b357457b0878cf6d0c62b7a0eb27b6e3368b8012de054fd726fsha'\n\n  option \"with-external-boost\", \"Build with brewed Boost\"\n\n  keg_only \"Older version; orfeo is in main tap and installs same components\"\n\n  depends_on 'cmake' => :build\n  depends_on \"boost\" if build.with? \"external-boost\"\n  depends_on :python => :optional\n  depends_on 'fltk'\n  depends_on 'gdal'\n  depends_on 'qt'\n  depends_on \"muparser\"\n  depends_on \"liblas\" # support removed in v4.0, but still functional here\n  depends_on \"libkml\"\n  depends_on \"minizip\"\n  depends_on \"tinyxml\"\n  depends_on \"fftw\" => :optional # restricts built binaries to GPL license\n  depends_on \"opencv\" => :optional\n\n  option 'examples', 'Compile and install various examples'\n  option 'java', 'Enable Java support'\n  option 'patented', 'Enable patented algorithms'\n\n  resource \"geoid\" do\n    # geoid to use in elevation calculations, if no DEM defined or avialable\n    url \"http://hg.orfeo-toolbox.org/OTB-Data/raw-file/dec1ce83a5f3/Input/DEM/egm96.grd\"\n    sha256 \"2babe341e8e04db11447e823ac0dfe4b17f37fd24c7966bb6aeab85a30d9a733\"\n    version \"3.20.0\"\n  end\n\n  patch do\n    # Fix some CMake modules\n    #   Ensure external liblas_c and liblas are found on Mac\n    #   Ensure external libOpenThreads is not used unless specified; otherwise it\n    #   may use open-scene-graph's newer lib, which fails when linking with orfeo\n    url \"https://gist.github.com/dakcarto/8890690/raw/ab16c6cbaf7d214b786583f456d8839585a04fa7/orfeo-cmake-fixes.diff\"\n    sha256 \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n  end\n\n  patch do\n    if MacOS.version >= :mavericks\n      # Fix for forward declaration (and other issues) with clang and libc++\n      #   See https://groups.google.com/forum/#!topic/otb-users/dRjdIxlDWfs\n      url \"https://gist.github.com/dakcarto/8930966/raw/331cca49a8e8dd579c4c19c865b17090a7433cd6/orfeo-libc-fixes.diff\"\n      sha256 \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"\n    end\n  end\n\n  def install\n    (libexec/\"default_geoid\").install resource(\"geoid\")\n\n    # gettext, libpqxx support removed in v4.0, deprecated here\n    args = std_cmake_args + %W[\n      -DBUILD_APPLICATIONS=ON\n      -DOTB_USE_EXTERNAL_FLTK=ON\n      -DBUILD_TESTING=OFF\n      -DOTB_USE_EXTERNAL_OPENTHREADS=OFF\n      -DOTB_USE_GETTEXT=OFF\n      -DOTB_USE_PQXX=OFF\n      -DBUILD_SHARED_LIBS=ON\n      -DOTB_WRAP_QT=ON\n    ]\n\n    args << \"-DOTB_USE_EXTERNAL_BOOST=\" + ((build.with? \"external-boost\") ? 'ON' : 'OFF')\n    args << '-DBUILD_EXAMPLES=' + ((build.include? 'examples') ? 'ON' : 'OFF')\n    args << '-DOTB_WRAP_JAVA=' + ((build.include? 'java') ? 'ON' : 'OFF')\n    args << '-DOTB_USE_PATENTED=' + ((build.include? 'patented') ? 'ON' : 'OFF')\n    args << '-DOTB_WRAP_PYTHON=OFF' if build.without? 'python'\n    args << \"-DUSE_FFTWF=\" + ((build.with? \"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENCV=\" + ((build.with? \"opencv\") ? \"ON\" : \"OFF\")\n\n    mkdir 'build' do\n      system 'cmake', '..', *args\n      #system \"bbedit\", \"CMakeCache.txt\"\n      #raise\n      system 'make'\n      system 'make install'\n    end\n  end\nend\n"
  },
  {
    "path": "boneyard/orfeo-40.rb",
    "content": "require 'formula'\n\nclass Orfeo40 < Formula\n  homepage 'http://www.orfeo-toolbox.org/otb/'\n  # url 'https://downloads.sf.net/project/orfeo-toolbox/OTB/OTB-4.0/OTB-4.0.0.tgz'\n  # sha1 'c2417cc4d11544fb477007e06d3a82a032353c95'\n  url \"http://hg.orfeo-toolbox.org/OTB/archive/b06793664fbc.tar.gz\"\n  sha1 \"e848f43266dd5ad62f5cc455aa1cc211d6285f76\"\n  version \"4.0.0\"\n  revision 1\n\n  bottle do\n    root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n    sha1 \"7c81e6235c700ee17281d79a7ac647d678388c0a\" => :mavericks\n  end\n\n  option \"with-external-boost\", \"Build with brewed Boost\"\n  option \"with-external-itk\", \"Build with brewed Insight Segmentation and Registration Toolkit\"\n  option 'examples', 'Compile and install various examples'\n  option 'java', 'Enable Java support'\n  option 'patented', 'Enable patented algorithms'\n\n  depends_on 'cmake' => :build\n  depends_on \"boost\" if build.with? \"external-boost\"\n  depends_on \"homebrew/science/insighttoolkit\" if build.with? \"external-itk\"\n  depends_on :python => :optional\n  depends_on 'gdal'\n  depends_on 'qt'\n  depends_on \"muparser\"\n  depends_on \"libkml\"\n  depends_on \"minizip\"\n  depends_on \"tinyxml\"\n  depends_on \"fftw\" => :optional # restricts built binaries to GPL license\n  depends_on \"opencv\" => :optional\n  # external libs that may work in next release:\n  #depends_on \"open-scene-graph\" # (for libOpenThreads, now internal to osg)\n\n  # conflicts_with \"orfeo\", :because => \"orfeo is in main tap\"\n\n  resource \"geoid\" do\n    # geoid to use in elevation calculations, if no DEM defined or avialable\n    url \"http://hg.orfeo-toolbox.org/OTB-Data/raw-file/dec1ce83a5f3/Input/DEM/egm96.grd\"\n    sha1 \"034ae375ff41b87d5e964f280fde0438c8fc8983\"\n    version \"4.0.0\"\n  end\n\n  patch :DATA\n\n  def install\n    (libexec/\"default_geoid\").install resource(\"geoid\")\n\n    args = std_cmake_args + %W[\n      -DBUILD_APPLICATIONS=ON\n      -DBUILD_TESTING=OFF\n      -DOTB_USE_EXTERNAL_OPENTHREADS=OFF\n      -DBUILD_SHARED_LIBS=ON\n      -DOTB_WRAP_QT=ON\n    ]\n\n    args << \"-DOTB_USE_EXTERNAL_BOOST=\" + ((build.with? \"external-boost\") ? 'ON' : 'OFF')\n    args << \"-DOTB_USE_EXTERNAL_ITK=\" + ((build.with? \"external-itk\") ? 'ON' : 'OFF')\n    args << '-DBUILD_EXAMPLES=' + ((build.include? 'examples') ? 'ON' : 'OFF')\n    args << '-DOTB_WRAP_JAVA=' + ((build.include? 'java') ? 'ON' : 'OFF')\n    args << '-DOTB_USE_PATENTED=' + ((build.include? 'patented') ? 'ON' : 'OFF')\n    args << '-DOTB_WRAP_PYTHON=OFF' if build.without? 'python'\n    args << \"-DITK_USE_FFTWF=\" + ((build.with? \"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DITK_USE_FFTWD=\" + ((build.with? \"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DITK_USE_SYSTEM_FFTW=\" + ((build.with? \"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENCV=\" + ((build.with? \"opencv\") ? \"ON\" : \"OFF\")\n\n    mkdir 'build' do\n      system 'cmake', '..', *args\n      #system \"bbedit\", \"CMakeCache.txt\"\n      #raise\n      system 'make'\n      system 'make install'\n    end\n  end\nend\n\n__END__\ndiff --git a/Code/ApplicationEngine/otbWrapperApplication.h b/Code/ApplicationEngine/otbWrapperApplication.h\nindex 4bebf08..f977d9f 100644\n--- a/Code/ApplicationEngine/otbWrapperApplication.h\n+++ b/Code/ApplicationEngine/otbWrapperApplication.h\n@@ -707,7 +707,7 @@ protected:\n     if (dynamic_cast<InputImageParameter*>(param))\n       {\n       InputImageParameter* paramDown = dynamic_cast<InputImageParameter*>(param);\n-      ret = paramDown->GetImage<TImageType>();\n+      ret = dynamic_cast<TImageType*>(paramDown->GetImage());\n       }\n \n     //TODO: exception if not found ?\n"
  },
  {
    "path": "boneyard/orfeo-42.rb",
    "content": "class Orfeo42 < Formula\n  homepage \"http://www.orfeo-toolbox.org/otb/\"\n  url \"https://downloads.sourceforge.net/project/orfeo-toolbox/OTB/OTB-4.2.1/OTB-4.2.1.tgz\"\n  sha1 \"c4f1299a2828a6f6acb81c1e022c706b7b7f10ea\"\n\n  bottle do\n    root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n    sha1 \"55f60cff6d66ce5c82ded881def49f65a64e5d1e\" => :mavericks\n  end\n\n  option \"with-external-boost\", \"Build with brewed Boost\"\n  option \"with-external-itk\", \"Build with brewed Insight Segmentation and Registration Toolkit\"\n  option \"examples\", \"Compile and install various examples\"\n  option \"java\", \"Enable Java support\"\n  option \"patented\", \"Enable patented algorithms\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"boost\" if build.with? \"external-boost\"\n  depends_on \"homebrew/science/insighttoolkit\" if build.with? \"external-itk\"\n  depends_on :python => :optional\n  depends_on \"gdal\"\n  depends_on \"qt\"\n  depends_on \"muparser\"\n  depends_on \"libkml\"\n  depends_on \"minizip\"\n  depends_on \"tinyxml\"\n  depends_on \"fftw\" => :optional # restricts built binaries to GPL license\n  depends_on \"opencv\" => :optional\n  # external libs that may work in next release:\n  #depends on \"open-scene-graph\" # (for libOpenThreads, now internal to osg)\n\n  # conflicts_with \"orfeo\", :because => \"orfeo provides same functionality\"\n  conflicts_with \"orfeo-40\", :because => \"orfeo-40 provides same functionality\"\n  conflicts_with \"orfeo-32\", :because => \"orfeo-32 provides same functionality\"\n\n  resource \"geoid\" do\n    # geoid to use in elevation calculations, if no DEM defined or avialable\n    url \"http://hg.orfeo-toolbox.org/OTB-Data/raw-file/dec1ce83a5f3/Input/DEM/egm96.grd\"\n    sha1 \"034ae375ff41b87d5e964f280fde0438c8fc8983\"\n    version \"4.0.0\"\n  end\n\n  def install\n    (libexec/\"default_geoid\").install resource(\"geoid\")\n\n    args = std_cmake_args + %W[\n      -DBUILD_APPLICATIONS=ON\n      -DBUILD_TESTING=OFF\n      -DOTB_USE_EXTERNAL_OPENTHREADS=OFF\n      -DBUILD_SHARED_LIBS=ON\n      -DOTB_WRAP_QT=ON\n      -DCMAKE_MACOSX_RPATH=OFF\n    ]\n\n    args << \"-DOTB_USE_EXTERNAL_BOOST=\" + (build.with?(\"external-boost\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_EXTERNAL_ITK=\" + (build.with?(\"external-itk\") ? \"ON\" : \"OFF\")\n    args << \"-DBUILD_EXAMPLES=\" + (build.include?(\"examples\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_WRAP_JAVA=\" + (build.include?(\"java\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_PATENTED=\" + (build.include?(\"patented\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_WRAP_PYTHON=OFF\" if build.without? \"python\"\n    args << \"-DITK_USE_FFTWF=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DITK_USE_FFTWD=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DITK_USE_SYSTEM_FFTW=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENCV=\" + (build.with?(\"opencv\") ? \"ON\" : \"OFF\")\n\n    if build.without?(\"external-itk\")\n      # nix @rpath prefix for install names of libs for internal ITK build\n      inreplace \"Utilities/ITK/Modules/ThirdParty/KWSys/src/CMakeLists.txt\",\n                \"set(KWSYS_PROPERTIES_CXX MACOSX_RPATH 1)\", \"\"\n      inreplace \"Utilities/ITK/CMakeLists.txt\" do |s|\n        s.sub! \"project(ITK)\", \"project(ITK)\\nset(CMAKE_MACOSX_RPATH 0)\"\n        # Don't let internal ITK conflict with linking of insighttoolkit formula\n        s.sub! \"share/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}\", \"\\\\0-orfeo\"\n        s.sub! \"share/doc/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}\", \"\\\\0-orfeo\"\n        s.sub! \"lib/cmake/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}\", \"\\\\0-orfeo\"\n      end\n    end\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      # system \"/usr/local/bin/bbedit\", \"CMakeCache.txt\"\n      # raise\n      system \"make\"\n      system \"make\", \"install\"\n    end\n  end\nend\n"
  },
  {
    "path": "boneyard/orfeo-54.rb",
    "content": "class Orfeo54 < Formula\n  desc \"Library of image processing algorithms\"\n  homepage \"http://www.orfeo-toolbox.org/otb/\"\n  url \"https://github.com/orfeotoolbox/OTB/archive/5.4.0.tar.gz\"\n  sha256 \"d232e8099bab7d9777ab2213a8fc1bf97d6731db88dad8963aa930f2ac13e38f\"\n  revision 1\n\n  # bottle do\n  #   root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n  #   cellar :any\n  #   sha256 \"\" => :mavericks\n  # end\n\n  option \"with-examples\", \"Compile and install various examples\"\n  option \"with-java\", \"Enable Java support\"\n  # option \"with-patented\", \"Enable patented algorithms\"\n\n  depends_on \"cmake\" => :build\n\n  # required\n  depends_on \"boost\"\n  depends_on \"homebrew/science/vtk\"\n  depends_on \"homebrew/science/insighttoolkit\"\n  depends_on \"libgeotiff\"\n  depends_on \"ossim\"\n  depends_on \"tinyxml\"\n  depends_on \"open-scene-graph\" # (for libOpenThreads, now internal to osg)\n\n  # recommended\n  depends_on \"gdal2\" => :recommended\n  depends_on \"qt\" => :recommended\n  depends_on \"muparser\" => :recommended\n  depends_on \"libkml\" => :recommended\n  depends_on \"libsvm\" => :recommended\n  depends_on \"minizip\" => :recommended\n\n  # optional\n  depends_on :python => :optional\n  depends_on \"mapnik\" => :optional\n  depends_on \"openjpeg\" => :optional\n  depends_on \"homebrew/x11/freeglut\" => :optional\n  depends_on \"fftw\" => :optional # restricts built binaries to GPL license\n  depends_on \"opencv\" => :optional\n  depends_on \"glew\" => :optional\n\n  conflicts_with \"orfeo\", :because => \"orfeo provides same functionality\"\n\n  resource \"geoid\" do\n    # geoid to use in elevation calculations, if no DEM defined or avialable\n    url \"https://git.orfeo-toolbox.org/otb-data.git/blob_plain/88264d17dffd4269d36a4fb93a236a915f729515:/Input/DEM/egm96.grd\"\n    sha256 \"2babe341e8e04db11447e823ac0dfe4b17f37fd24c7966bb6aeab85a30d9a733\"\n    version \"5.0.0\"\n  end\n\n  def install\n    (libexec/\"default_geoid\").install resource(\"geoid\")\n\n    args = std_cmake_args + %W[\n      -DOTB_BUILD_DEFAULT_MODULES=ON\n      -DBUILD_TESTING=OFF\n      -DBUILD_SHARED_LIBS=ON\n      -DCMAKE_MACOSX_RPATH=OFF\n    ]\n\n    args << \"-DBUILD_EXAMPLES=\" + (build.with?(\"examples\") ? \"ON\" : \"OFF\")\n    # args << \"-DOTB_USE_PATENTED=\" + (build.with?(\"patented\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_WRAP_JAVA=\" + (build.with?(\"java\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_WRAP_PYTHON=OFF\" if build.without? \"python\"\n    args << \"-DITK_USE_FFTWF=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DITK_USE_FFTWD=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DITK_USE_SYSTEM_FFTW=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENCV=\" + (build.with?(\"opencv\") ? \"ON\" : \"OFF\")\n\n    args << \"-DOTB_USE_CURL=\" + (build.with?(\"examples\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_GLEW=\" + (build.with?(\"glew\") ? \"ON\" : \"OFF\")\n    # args << \"-DOTB_USE_GLFW=\" + (build.with?(\"\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_GLUT=\" + (build.with?(\"freeglut\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_LIBKML=\" + (build.with?(\"libkml\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_LIBSVM=\" + (build.with?(\"libsvm\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_MAPNIK=\" + (build.with?(\"mapnik\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_MUPARSER=\" + (build.with?(\"muparser\") ? \"ON\" : \"OFF\")\n    # args << \"-DOTB_USE_MUPARSERX=\" + (build.with?(\"\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENCV=\" + (build.with?(\"opencv\") ? \"ON\" : \"OFF\")\n    # args << \"-DOTB_USE_OPENGL=\" + (build.with?(\"examples\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENJPEG=\" + (build.with?(\"openjpeg\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_QT4=\" + (build.with?(\"qt\") ? \"ON\" : \"OFF\")\n    # args << \"-DOTB_USE_SIFTFAST=\" + (build.with?(\"\") ? \"ON\" : \"OFF\")\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      # bbedit = \"/usr/local/bin/bbedit\"\n      # cmake_config = Pathname(\"#{Dir.pwd}/orfeo-50_cmake-config.txt\")\n      # cmake_config.write [\"cmake ..\", *args].join(\" \\\\\\n\")\n      # system bbedit, cmake_config.to_s\n      # system bbedit, \"CMakeCache.txt\"\n      # raise\n      system \"make\"\n      system \"make\", \"install\"\n    end\n  end\n\n  test do\n    #\n  end\nend\n"
  },
  {
    "path": "boneyard/orfeo5.rb",
    "content": "class Orfeo5 < Formula\n  desc \"Library of image processing algorithms\"\n  homepage \"https://www.orfeo-toolbox.org/otb/\"\n\n  stable do\n    url \"https://github.com/orfeotoolbox/OTB/archive/5.10.1.tar.gz\"\n    sha256 \"01b40747f0afba51af1aa5e696a7205c2177b0f99f5208d9db8369acc984fe39\"\n\n    # Patch to fix OSSIM adaptor compilation\n    patch :DATA\n  end\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    cellar :any\n    rebuild 1\n    sha256 \"d9a2e74ea28e4d2d2c87cac68852e5e96b8c31bfea682df22e196a572b24136b\" => :high_sierra\n    sha256 \"d9a2e74ea28e4d2d2c87cac68852e5e96b8c31bfea682df22e196a572b24136b\" => :sierra\n  end\n\n  option \"without-monteverdi\", \"Build without Monteverdi and Mapla applications (Qt4 required)\"\n  option \"with-iceviewer\", \"Build with ICE Viewer application (Qt4 and X11 required)\"\n  option \"with-examples\", \"Compile and install various examples\"\n  option \"with-java\", \"Enable Java support\"\n\n  depends_on \"cmake\" => :build\n\n  # required\n  depends_on \"boost\"\n  depends_on \"osgeo-vtk\"\n  depends_on \"brewsci/science/insighttoolkit\"\n  depends_on \"osgeo-libgeotiff\"\n  depends_on \"libpng\"\n  depends_on \"pcre\"\n  depends_on \"openssl\"\n  depends_on \"ossim@2.1\"\n  depends_on \"sqlite\"\n  depends_on \"tinyxml\"\n  depends_on \"open-scene-graph\" # (for libOpenThreads, now internal to osg)\n  depends_on \"zlib\"\n  depends_on \"qwt-qt4@5.2\"\n\n  # recommended\n  depends_on \"muparser\" => :recommended\n  depends_on \"libkml\" => :recommended\n  depends_on \"libsvm\" => :recommended\n  depends_on \"minizip\" => :recommended\n\n  # optional\n  depends_on \"python@2\" => :optional\n  depends_on \"swig\" if build.with? \"python@2\"\n  depends_on \"fftw\" => :optional # restricts built binaries to GPL license\n  depends_on \"mapnik\" => :optional\n  depends_on \"brewsci/science/opencv\" => :optional\n  depends_on \"openjpeg\" => :optional\n  depends_on \"open-mpi\" => :optional\n  depends_on \"brewsci/science/shark\" => :optional\n\n  # ICE Viewer: needs X11 support\n  # apparently, GLUT is not needed by Monteverdi, which uses ICE non-gui module,\n  # but is needed for the ICE Viewer\n  depends_on \"freeglut\" if build.with? \"iceviewer\"\n\n  # Monteverdi: required deps and required/optionals shared with OTB\n  if build.with? \"monteverdi\"\n    depends_on \"gdal2\"\n    depends_on \"glew\"\n    depends_on \"glfw\"\n    depends_on \"qt-4\"\n    depends_on \"qwt-qt4@5.2\"\n  else\n    depends_on \"gdal2\" => :recommended\n    depends_on \"glew\" => :optional\n    depends_on \"glfw\" => :optional\n    depends_on \"qt-4\" => :optional\n  end\n\n  resource \"geoid\" do\n    # geoid to use in elevation calculations, if no DEM defined or avialable\n    url \"https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-data/raw/master/Input/DEM/egm96.grd\"\n    sha256 \"2babe341e8e04db11447e823ac0dfe4b17f37fd24c7966bb6aeab85a30d9a733\"\n    version \"5.0.0\"\n  end\n\n  def install\n    (libexec/\"default_geoid\").install resource(\"geoid\")\n\n    args = std_cmake_args + %W[\n      -DOTB_BUILD_DEFAULT_MODULES=ON\n      -DBUILD_TESTING=OFF\n      -DBUILD_SHARED_LIBS=ON\n      -DCMAKE_MACOSX_RPATH=OFF\n      -DCMAKE_CXX_STANDARD=11\n      -DQWT_LIB=#{Formula['qwt-qt4@5.2'].lib}\n      -DQWT_INCLUDE_DIR=#{Formula['qwt-qt4@5.2'].include}\n    ]\n\n    ENV.cxx11\n\n    if build.with? \"iceviewer\"\n      fg = Formula[\"freeglut\"]\n      args << \"-DGLUT_INCLUDE_DIR=#{fg.opt_include}\"\n      args << \"-DGLUT_glut_LIBRARY=#{fg.opt_lib}/libglut.dylib\"\n    end\n\n    args << \"-DBUILD_EXAMPLES=\" + (build.with?(\"examples\") ? \"ON\" : \"OFF\")\n    # args << \"-DOTB_USE_PATENTED=\" + (build.with?(\"patented\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_WRAP_JAVA=\" + (build.with?(\"java\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_WRAP_PYTHON=OFF\" if build.without? \"python@2\"\n    args << \"-DITK_USE_FFTWF=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DITK_USE_FFTWD=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DITK_USE_SYSTEM_FFTW=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n\n    args << \"-DOTB_USE_CURL=ON\"\n    args << \"-DOTB_USE_GLEW=\" + ((build.with?(\"glew\") || build.with?(\"monteverdi\")) ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_GLFW=\" + ((build.with?(\"glfw\") || build.with?(\"monteverdi\")) ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_GLUT=\" + (build.with?(\"iceviewer\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_LIBKML=\" + (build.with?(\"libkml\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_LIBSVM=\" + (build.with?(\"libsvm\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_MAPNIK=\" + (build.with?(\"mapnik\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_MUPARSER=\" + (build.with?(\"muparser\") ? \"ON\" : \"OFF\")\n    # args << \"-DOTB_USE_MUPARSERX=\" + (build.with?(\"\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENCV=\" + (build.with?(\"opencv\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENGL=\" + ((build.with?(\"examples\") || build.with?(\"iceviewer\") || build.with?(\"monteverdi\")) ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_MPI=\" + (build.with?(\"mpi\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENJPEG=\" + (build.with?(\"openjpeg\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_QT4=\" + ((build.with?(\"qt-4\") || build.with?(\"monteverdi\")) ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_QWT=\" + ((build.with?(\"qt-4\") || build.with?(\"monteverdi\")) ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_SIFTFAST=ON\"\n    args << \"-DOTB_USE_SHARK=\" + (build.with?(\"brewsci/science/shark\") ? \"ON\" : \"OFF\")\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    # clean up any unneeded otbgui script wrappers\n    rm_f Dir[\"#{bin}/otbgui*\"] unless (bin/\"otbgui\").exist?\n\n    # make env-wrapped command line utility launcher scripts\n    envars = {\n      :GDAL_DATA => \"#{Formula[\"gdal2\"].opt_share}/gdal\",\n      :OTB_APPLICATION_PATH => \"#{opt_lib}/otb/applications\",\n    }\n    bin.env_script_all_files(libexec/\"bin\", envars)\n  end\n\n  def caveats; <<~EOS\n      The default geoid to use in elevation calculations is available in:\n\n        #{opt_libexec}/default_geoid/egm96.grd\n\n  EOS\n  end\n\n  test do\n    puts \"Testing CLI wrapper\"\n    out = `#{opt_bin}/otbcli 2>&1`\n    assert_match \"module_name [MODULEPATH] [arguments]\", out\n    puts \"Testing Rescale CLI app\"\n    out = `#{opt_bin}/otbcli_Rescale 2>&1`\n    assert_match \"Rescale the image between two given values\", out\n    if (opt_bin/\"otbgui\").exist?\n      puts \"Testing Qt GUI wrapper\"\n      out = `#{opt_bin}/otbgui 2>&1`\n      assert_match \"module_name [module_path]\", out\n    end\n  end\nend\n\n__END__\ndiff --git a/Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx b/Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx\nindex d20e208..92796dd 100644\n--- a/Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx\n+++ b/Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx\n@@ -109,7 +109,8 @@ RPCSolverAdapter::Solve(const GCPsContainerType& gcpContainer,\n   rmsError = rpcSolver->getRmsError();\n\n   // Retrieve the output RPC projection\n-  ossimRefPtr<ossimRpcProjection> rpcProjection = dynamic_cast<ossimRpcProjection*>(rpcSolver->createRpcProjection()->getProjection());\n+  ossimRefPtr<ossimImageGeometry> outputProj = dynamic_cast<ossimImageGeometry*>(rpcSolver->createRpcProjection());\n+  ossimRefPtr<ossimRpcProjection> rpcProjection = dynamic_cast<ossimRpcProjection*>(outputProj->getProjection());\n\n   // Export the sensor model in an ossimKeywordlist\n   ossimKeywordlist geom_kwl;\n"
  },
  {
    "path": "boneyard/orfeo5@5.4.rb",
    "content": "class Orfeo5AT54 < Formula\n  desc \"Library of image processing algorithms\"\n  homepage \"http://www.orfeo-toolbox.org/otb/\"\n  url \"https://github.com/orfeotoolbox/OTB/archive/5.4.0.tar.gz\"\n  sha256 \"d232e8099bab7d9777ab2213a8fc1bf97d6731db88dad8963aa930f2ac13e38f\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    sha256 \"41187da6cafbc580f1eb05d75f3491581cc53903d87d2e24052abc07d708ec9e\" => :sierra\n  end\n\n  keg_only \"to avoid conflict with newer OTB installs\"\n\n  option \"with-iceviewer\", \"Build with ICE Viewer application (Qt4 and X11 required)\"\n  option \"with-examples\", \"Compile and install various examples\"\n  option \"with-java\", \"Enable Java support\"\n  # option \"with-patented\", \"Enable patented algorithms\"\n\n  depends_on \"cmake\" => :build\n\n  # required\n  depends_on \"boost\"\n  depends_on \"osgeo-vtk\"\n  depends_on \"brewsci/science/insighttoolkit\"\n  depends_on \"osgeo-libgeotiff\"\n  depends_on \"libpng\"\n  depends_on \"pcre\"\n  depends_on \"openssl\"\n  depends_on \"ossim@2.1\"\n  depends_on \"sqlite\"\n  depends_on \"tinyxml\"\n  depends_on \"open-scene-graph\" # (for libOpenThreads, now internal to osg)\n  depends_on \"zlib\"\n\n  # recommended\n  depends_on \"muparser\" => :recommended\n  depends_on \"libkml\" => :recommended\n  depends_on \"libsvm\" => :recommended\n  depends_on \"minizip\" => :recommended\n\n  # optional\n  depends_on \"python@2\" => :optional\n  depends_on \"swig\" if build.with? \"python@2\"\n  depends_on \"fftw\" => :optional # restricts built binaries to GPL license\n  depends_on \"mapnik\" => :optional\n  depends_on \"brewsci/science/opencv\" => :optional\n  depends_on \"openjpeg\" => :optional\n\n  # ICE Viewer: needs X11 support\n  if build.with? \"iceviewer\"\n    depends_on \"freeglut\"\n    depends_on \"gdal2\"\n    depends_on \"glew\"\n    depends_on \"glfw\"\n    depends_on \"qt-4\"\n  else\n    depends_on \"gdal2\" => :recommended\n    depends_on \"glew\" => :optional\n    depends_on \"glfw\" => :optional\n    depends_on \"qt-4\" => :optional\n  end\n\n  resource \"geoid\" do\n    # geoid to use in elevation calculations, if no DEM defined or avialable\n    url \"https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-data/raw/master/Input/DEM/egm96.grd\"\n    sha256 \"2babe341e8e04db11447e823ac0dfe4b17f37fd24c7966bb6aeab85a30d9a733\"\n    version \"5.0.0\"\n  end\n\n  def install\n    (libexec/\"default_geoid\").install resource(\"geoid\")\n\n    args = std_cmake_args + %w[\n      -DOTB_BUILD_DEFAULT_MODULES=ON\n      -DBUILD_TESTING=OFF\n      -DBUILD_SHARED_LIBS=ON\n      -DCMAKE_MACOSX_RPATH=OFF\n    ]\n\n    if build.with? \"iceviewer\"\n      fg = Formula[\"freeglut\"]\n      args << \"-DGLUT_INCLUDE_DIR=#{fg.opt_include}\"\n      args << \"-DGLUT_glut_LIBRARY=#{fg.opt_lib}/libglut.dylib\"\n    end\n\n    args << \"-DBUILD_EXAMPLES=\" + (build.with?(\"examples\") ? \"ON\" : \"OFF\")\n    # args << \"-DOTB_USE_PATENTED=\" + (build.with?(\"patented\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_WRAP_JAVA=\" + (build.with?(\"java\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_WRAP_PYTHON=OFF\" if build.without? \"python@2\"\n    args << \"-DITK_USE_FFTWF=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DITK_USE_FFTWD=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DITK_USE_SYSTEM_FFTW=\" + (build.with?(\"fftw\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENCV=\" + (build.with?(\"opencv\") ? \"ON\" : \"OFF\")\n\n    args << \"-DOTB_USE_CURL=ON\"\n    args << \"-DOTB_USE_GLEW=\" + (build.with?(\"glew\") || build.with?(\"iceviewer\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_GLFW=\" + (build.with?(\"glfw\") || build.with?(\"iceviewer\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_GLUT=\" + (build.with?(\"iceviewer\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_LIBKML=\" + (build.with?(\"libkml\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_LIBSVM=\" + (build.with?(\"libsvm\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_MAPNIK=\" + (build.with?(\"mapnik\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_MUPARSER=\" + (build.with?(\"muparser\") ? \"ON\" : \"OFF\")\n    # args << \"-DOTB_USE_MUPARSERX=\" + (build.with?(\"\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENCV=\" + (build.with?(\"opencv\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENGL=\" + (build.with?(\"examples\") || build.with?(\"iceviewer\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_OPENJPEG=\" + (build.with?(\"openjpeg\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_QT4=\" + (build.with?(\"qt-4\") || build.with?(\"iceviewer\") ? \"ON\" : \"OFF\")\n    args << \"-DOTB_USE_SIFTFAST=ON\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      # bbedit = \"/usr/local/bin/bbedit\"\n      # cmake_config = Pathname(\"#{Dir.pwd}/orfeo5@5.4_cmake-config.txt\")\n      # cmake_config.write [\"cmake ..\", *args].join(\" \\\\\\n\")\n      # system bbedit, cmake_config.to_s\n      # system bbedit, \"CMakeCache.txt\"\n      # raise\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    # clean up any unneeded otbgui script wrappers\n    unless (bin/\"otbgui\").exist?\n      rm_f Dir[\"#{bin}/otbgui*\"]\n    end\n\n    # make env-wrapped command line utility launcher scripts\n    envars = {\n      :GDAL_DATA => \"#{Formula[\"gdal2\"].opt_share}/gdal\",\n      :OTB_APPLICATION_PATH => \"#{opt_lib}/otb/applications\",\n    }\n    bin.env_script_all_files(libexec/\"bin\", envars)\n  end\n\n  def caveats; <<~EOS\n      The default geoid to use in elevation calculations is available in:\n\n        #{opt_libexec}/default_geoid/egm96.grd\n\n  EOS\n  end\n\n  test do\n    puts \"Testing CLI wrapper\"\n    out = `#{opt_bin}/otbcli 2>&1`\n    assert_match \"module_name [MODULEPATH] [arguments]\", out\n    puts \"Testing Rescale CLI app\"\n    out = `#{opt_bin}/otbcli_Rescale 2>&1`\n    assert_match \"Rescale the image between two given values\", out\n    if (opt_bin/\"otbgui\").exist?\n      puts \"Testing Qt GUI wrapper\"\n      out = `#{opt_bin}/otbgui 2>&1`\n      assert_match \"module_name [module_path]\", out\n    end\n  end\nend\n"
  },
  {
    "path": "boneyard/osgearth-qt4.rb",
    "content": "class OsgearthQt4 < Formula\n  desc \"Geospatial SDK and terrain engine for OpenSceneGraph\"\n  homepage \"http://osgearth.org\"\n  url \"https://github.com/gwaldron/osgearth.git\",\n    :branch => \"2.7\",\n    :commit => \"dda0f0a92cedc83d6d40ed69cfb01140008f9911\"\n  version \"2.7.0\"\n  # QGIS Globe Plugin does not support a larger version than OSGearh v2.7.\n\n  # revision 1\n\n  head \"https://github.com/gwaldron/osgearth.git\", :branch => \"master\"\n\n  bottle do\n    root_url \"https://dl.bintray.com/homebrew-osgeo/osgeo-bottles\"\n    sha256 \"7080cdc8b0da8e250cc48fc3288236ed0366ad7beca38a638fca358a5986e551\" => :mojave\n    sha256 \"7080cdc8b0da8e250cc48fc3288236ed0366ad7beca38a638fca358a5986e551\" => :high_sierra\n    sha256 \"7080cdc8b0da8e250cc48fc3288236ed0366ad7beca38a638fca358a5986e551\" => :sierra\n  end\n\n  # The OSGearth 2.7 version is not being built with GDAL 2.x.\n  patch :DATA\n\n  option \"without-minizip\", \"Build without Google KMZ file access support\"\n  option \"with-v8\", \"Build with Google's V8 JavaScript engine support\"\n  option \"with-tinyxml\", \"Use external libtinyxml, instead of internal\"\n  option \"with-docs-examples\", \"Build and install html documentation and examples\"\n\n  depends_on \"cmake\" => :build\n  # depends_on \"gdal2\"\n  depends_on \"sqlite\"\n  depends_on \"qt-4\"\n  depends_on \"minizip\" => :recommended\n  depends_on \"v8\" => :optional\n  depends_on \"tinyxml\" => :optional\n\n  if (build.with? \"docs-examples\") && (!which(\"sphinx-build\"))\n    # temporarily vendor a local sphinx install\n    sphinx_dir = prefix/\"sphinx\"\n    sphinx_site = sphinx_dir/\"lib/python#{py_ver}/site-packages\"\n    sphinx_site.mkpath\n    ENV.prepend_create_path \"PYTHONPATH\", sphinx_site\n    resource(\"Sphinx\").stage { quiet_system \"python#{py_ver}\", \"setup.py\", \"install\", \"--prefix=#{sphinx_dir}\" }\n    ENV.prepend_path \"PATH\", sphinx_dir/\"bin\"\n  end\n\n  def install\n    if (build.with? \"docs-examples\") && (!which(\"sphinx-build\"))\n      # temporarily vendor a local sphinx install\n      sphinx_dir = prefix/\"sphinx\"\n      sphinx_site = sphinx_dir/\"lib/python2.7/site-packages\"\n      sphinx_site.mkpath\n      ENV.prepend_create_path \"PYTHONPATH\", sphinx_site\n      resource(\"sphinx\").stage { quiet_system \"python2.7\", \"setup.py\", \"install\", \"--prefix=#{sphinx_dir}\" }\n      ENV.prepend_path \"PATH\", sphinx_dir/\"bin\"\n    end\n\n    args = std_cmake_args\n\n    args << \"-DOSGEARTH_USE_QT=OFF\"\n\n    args << \"-DWITH_EXTERNAL_TINYXML=ON\" if build.with? \"tinyxml\"\n\n    # v8 and minizip options should have empty values if not defined '--with'\n    if build.without? \"v8\"\n      args << \"-DV8_INCLUDE_DIR=''\" << \"-DV8_BASE_LIBRARY=''\" << \"-DV8_SNAPSHOT_LIBRARY=''\"\n      args << \"-DV8_ICUI18N_LIBRARY=''\" << \"-DV8_ICUUC_LIBRARY=''\"\n    end\n    # define libminizip paths (skips the only pkconfig dependency in cmake modules)\n    mzo = Formula[\"minizip\"].opt_prefix\n    args << \"-DMINIZIP_INCLUDE_DIR=#{(build.with? \"minizip\") ? mzo/\"include/minizip\" : \"''\"}\"\n    args << \"-DMINIZIP_LIBRARY=#{(build.with? \"minizip\") ? mzo/\"lib/libminizip.dylib\" : \"''\"}\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\", \"install\"\n    end\n\n    if build.with? \"docs-examples\"\n      cd \"docs\" do\n        system \"make\", \"html\"\n        doc.install \"build/html\" => \"html\"\n      end\n      doc.install \"data\"\n      doc.install \"tests\" => \"examples\"\n      rm_r prefix/\"sphinx\" if File.exist?(prefix/\"sphinx\")\n    end\n  end\n\n  def caveats\n    osg = Formula[\"open-scene-graph\"]\n    osgver = (osg.linked_keg.exist?) ? osg.version : \"#.#.# (version)\"\n    <<~EOS\n    This formula installs Open Scene Graph plugins. To ensure access when using\n    the osgEarth toolset, set the OSG_LIBRARY_PATH enviroment variable to:\n\n      #{HOMEBREW_PREFIX}/lib/osgPlugins-#{osgver}\n\n    EOS\n  end\n\n  test do\n    system \"#{bin}/osgearth_version\"\n  end\nend\n\n__END__\n\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -117,7 +117,7 @@\n FIND_PACKAGE(OpenGL)\n\n FIND_PACKAGE(CURL)\n-FIND_PACKAGE(GDAL)\n+# FIND_PACKAGE(GDAL)\n FIND_PACKAGE(GEOS)\n FIND_PACKAGE(Sqlite3)\n FIND_PACKAGE(ZLIB)\n"
  },
  {
    "path": "boneyard/osgearth.rb",
    "content": "require \"formula\"\n\nclass Osgearth < Formula\n  homepage \"http://osgearth.org\"\n  url \"https://github.com/gwaldron/osgearth/archive/osgearth-2.5.tar.gz\"\n  sha1 \"97ed0075422c3efcb7b958f89ae02b32d670c48e\"\n\n  head \"https://github.com/gwaldron/osgearth.git\", :branch => \"master\"\n\n  option \"without-minizip\", \"Build without Google KMZ file access support\"\n  option \"with-v8\", \"Build with Google's V8 JavaScript engine support\"\n  option \"with-libnoise\", \"Build with coherent noise-generating terrain support\"\n  option \"with-tinyxml\", \"Use external libtinyxml, instead of internal\"\n  option \"with-docs-examples\", \"Build and install html documentation and examples\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"open-scene-graph\"\n  depends_on \"gdal\"\n  depends_on \"sqlite\"\n  depends_on \"qt\" => :recommended\n  depends_on \"minizip\" => :recommended\n  depends_on \"v8\" => :optional\n  depends_on \"libnoise\" => :optional\n  depends_on \"tinyxml\" => :optional\n\n  resource \"sphinx\" do\n    url \"https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.1.tar.gz\"\n    sha1 \"448cdb89d96c85993e01fe793ce7786494cbcda7\"\n  end\n\n  # all merged upstream, remove on next version\n  # find a v8 lib: https://github.com/gwaldron/osgearth/pull/434\n  # find JavaScriptCore lib: https://github.com/gwaldron/osgearth/pull/435\n  # find libnoise lib: https://github.com/gwaldron/osgearth/pull/436\n  def patches\n    DATA\n  end\n\n  def install\n    if build.with? \"docs-examples\" and not which(\"sphinx-build\")\n      # temporarily vendor a local sphinx install\n      sphinx_dir = prefix/\"sphinx\"\n      sphinx_site = sphinx_dir/\"lib/python2.7/site-packages\"\n      sphinx_site.mkpath\n      ENV.prepend_create_path \"PYTHONPATH\", sphinx_site\n      resource(\"sphinx\").stage {quiet_system \"python2.7\", \"setup.py\", \"install\", \"--prefix=#{sphinx_dir}\"}\n      ENV.prepend_path \"PATH\", sphinx_dir/\"bin\"\n    end\n\n    args = std_cmake_args\n    if MacOS.prefer_64_bit?\n      args << \"-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}\"\n    else\n      args << \"-DCMAKE_OSX_ARCHITECTURES=i386\"\n    end\n\n    args << \"-DOSGEARTH_USE_QT=OFF\" if build.without? \"qt\"\n    args << \"-DWITH_EXTERNAL_TINYXML=ON\" if build.with? \"tinyxml\"\n\n    # v8, noise and minizip options should have empty values if not defined '--with'\n    if build.without? \"v8\"\n      args << \"-DV8_INCLUDE_DIR=''\" << \"-DV8_BASE_LIBRARY=''\" << \"-DV8_SNAPSHOT_LIBRARY=''\"\n      args << \"-DV8_ICUI18N_LIBRARY=''\" << \"-DV8_ICUUC_LIBRARY=''\"\n    end\n    args << \"-DLIBNOISE_INCLUDE_DIR=''\" << \"-DLIBNOISE_LIBRARY=''\" if build.without? \"libnoise\"\n    # define libminizip paths (skips the only pkconfig dependency in cmake modules)\n    mzo = Formula.factory(\"minizip\").opt_prefix\n    args << \"-DMINIZIP_INCLUDE_DIR=#{(build.with? \"minizip\") ? mzo/\"include/minizip\" : \"''\"}\"\n    args << \"-DMINIZIP_LIBRARY=#{(build.with? \"minizip\") ? mzo/\"lib/libminizip.dylib\" : \"''\"}\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\", \"install\"\n    end\n\n    if build.with? \"docs-examples\"\n      cd \"docs\" do\n        system \"make\", \"html\"\n        doc.install \"build/html\" => \"html\"\n      end\n      doc.install \"data\"\n      doc.install \"tests\" => \"examples\"\n      rm_r prefix/\"sphinx\" if File.exist?(prefix/\"sphinx\")\n    end\n  end\n\n  def caveats\n    osg = Formula.factory(\"open-scene-graph\")\n    osgver = (osg.linked_keg.exist?) ? osg.version : \"#.#.# (version)\"\n    <<~EOS\n    This formula installs Open Scene Graph plugins. To ensure access when using\n    the osgEarth toolset, set the OSG_LIBRARY_PATH enviroment variable to:\n\n      #{HOMEBREW_PREFIX}/lib/osgPlugins-#{osgver}\n\n    EOS\n  end\n\n  test do\n    system \"#{bin}/osgearth_version\"\n  end\nend\n\n__END__\ndiff --git a/CMakeModules/FindV8.cmake b/CMakeModules/FindV8.cmake\nindex 9f5684d..94cf4c4 100644\n--- a/CMakeModules/FindV8.cmake\n+++ b/CMakeModules/FindV8.cmake\n@@ -21,7 +21,7 @@ FIND_PATH(V8_INCLUDE_DIR v8.h\n )\n \n FIND_LIBRARY(V8_BASE_LIBRARY\n-    NAMES v8_base v8_base.ia32 libv8_base\n+    NAMES v8_base v8_base.ia32 v8_base.x64 libv8_base\n     PATHS\n     ${V8_DIR}\n     ${V8_DIR}/lib\n@@ -40,7 +40,7 @@ FIND_LIBRARY(V8_BASE_LIBRARY\n )\n \n FIND_LIBRARY(V8_BASE_LIBRARY_DEBUG\n-    NAMES v8_base v8_base.ia32 libv8_base\n+    NAMES v8_base v8_base.ia32 v8_base.x64 libv8_base\n     PATHS\n     ${V8_DIR}\n     ${V8_DIR}/lib\ndiff --git a/CMakeModules/FindJavaScriptCore.cmake b/CMakeModules/FindJavaScriptCore.cmake\nindex 1bca250..3877cd5 100644\n--- a/CMakeModules/FindJavaScriptCore.cmake\n+++ b/CMakeModules/FindJavaScriptCore.cmake\n@@ -21,7 +21,7 @@ FIND_PATH(JAVASCRIPTCORE_INCLUDE_DIR JavaScriptCore.h\n )\n\n FIND_LIBRARY(JAVASCRIPTCORE_LIBRARY\n-    NAMES libJavaScriptCore\n+    NAMES libJavaScriptCore JavaScriptCore\n     PATHS\n     ${JAVASCRIPTCORE_DIR}\n     ${JAVASCRIPTCORE_DIR}/lib\ndiff --git a/CMakeModules/FindLibNoise.cmake b/CMakeModules/FindLibNoise.cmake\nindex 99d006b..0051b51 100644\n--- a/CMakeModules/FindLibNoise.cmake\n+++ b/CMakeModules/FindLibNoise.cmake\n@@ -43,7 +43,7 @@ FIND_LIBRARY(LIBNOISE_LIBRARY\n )\n\n FIND_LIBRARY(LIBNOISE_LIBRARY\n-  NAMES libnoise\n+  NAMES libnoise noise\n   PATHS\n     ~/Library/Frameworks\n     /Library/Frameworks\n"
  },
  {
    "path": "boneyard/osgeo-proj@5.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_proj_linked }\n\n  def core_proj_linked\n    Formula[\"proj\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink proj\\e[0m or remove with \\e[32mbrew uninstall --ignore-dependencies proj\\e[0m\\n\\n\" if core_proj_linked\n    s\n  end\nend\n\nclass OsgeoProjAT5 < Formula\n  desc \"Cartographic Projections Library\"\n  homepage \"https://proj4.org/\"\n  url \"https://github.com/OSGeo/proj.4/archive/5.2.0.tar.gz\"\n  sha256 \"d784d51a8e56282123eb5918a2c685ed7da5097595afcacf5fa0246337a44361\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    sha256 \"623b42fc026ca183a93ecc14e7db9ecc1cf30a729e15cad255d025268088d5d7\" => :mojave\n    sha256 \"623b42fc026ca183a93ecc14e7db9ecc1cf30a729e15cad255d025268088d5d7\" => :high_sierra\n    sha256 \"bd9c8607cc813b32b7c956b349ff1235519323deb710fb0d8a1232eab83b6d6b\" => :sierra\n  end\n\n  # revision 1\n\n  head \"https://github.com/OSGeo/proj.4.git\", :branch => \"master\"\n\n  keg_only :versioned_formula\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"autoconf\" => :build\n  depends_on \"automake\" => :build\n  depends_on \"libtool\" => :build\n\n  conflicts_with \"blast\", :because => \"both install a `libproj.a` library\"\n\n  skip_clean :la\n\n  # The datum grid files are required to support datum shifting\n  resource \"datumgrid\" do\n    url \"https://download.osgeo.org/proj/proj-datumgrid-1.8.zip\"\n    sha256 \"b9838ae7e5f27ee732fb0bfed618f85b36e8bb56d7afb287d506338e9f33861e\"\n  end\n\n  def install\n    (buildpath/\"nad\").install resource(\"datumgrid\")\n\n    system \"./autogen.sh\"\n    system \"./configure\", \"--disable-dependency-tracking\",\n                          \"--prefix=#{prefix}\"\n    system \"make\", \"install\"\n  end\n\n  test do\n    (testpath/\"test\").write <<~EOS\n      45d15n 71d07w Boston, United States\n      40d40n 73d58w New York, United States\n      48d51n 2d20e Paris, France\n      51d30n 7'w London, England\n    EOS\n    match = <<~EOS\n      -4887590.49\\t7317961.48 Boston, United States\n      -5542524.55\\t6982689.05 New York, United States\n      171224.94\\t5415352.81 Paris, France\n      -8101.66\\t5707500.23 London, England\n    EOS\n\n    output = shell_output(\"#{bin}/proj +proj=poly +ellps=clrk66 -r #{testpath}/test\")\n    assert_equal match, output\n  end\nend\n"
  },
  {
    "path": "boneyard/osgeo-pyqt.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_pyqt_linked }\n\n  def core_pyqt_linked\n    Formula[\"pyqt\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink pyqt\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies pyqt\\e[0m\\n\\n\" if core_pyqt_linked\n    s\n  end\nend\n\nclass OsgeoPyqt < Formula\n  desc \"Python bindings for v5 of Qt\"\n  homepage \"https://www.riverbankcomputing.com/software/pyqt/download5\"\n  url \"https://files.pythonhosted.org/packages/4d/81/b9a66a28fb9a7bbeb60e266f06ebc4703e7e42b99e3609bf1b58ddd232b9/PyQt5-5.14.2.tar.gz\"\n  sha256 \"bd230c6fd699eabf1ceb51e13a8b79b74c00a80272c622427b80141a22269eb0\"\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"d12d8f3633c20c53d850fa7618003deffcfd643bf2ce300597ad77225c1a21c7\" => :catalina\n    sha256 \"d12d8f3633c20c53d850fa7618003deffcfd643bf2ce300597ad77225c1a21c7\" => :mojave\n    sha256 \"d12d8f3633c20c53d850fa7618003deffcfd643bf2ce300597ad77225c1a21c7\" => :high_sierra\n  end\n\n  # revision 5\n\n  # keg_only \"pyqt\" is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"python\"\n  depends_on \"osgeo-sip\"\n  depends_on \"qt\"\n  depends_on \"dbus\" => :optional\n\n  def install\n    version = Language::Python.major_minor_version \"python3\"\n    ENV[\"PYTHONPATH\"] = lib/\"python#{version}/site-packages\"\n    args = [\"--confirm-license\",\n            \"--bindir=#{bin}\",\n            \"--destdir=#{lib}/python#{version}/site-packages\",\n            \"--stubsdir=#{lib}/python#{version}/site-packages/PyQt5\",\n            \"--sipdir=#{share}/sip/PyQt5\", # Qt5\n            # sip.h could not be found automatically\n            \"--sip-incdir=#{Formula[\"osgeo-sip\"].opt_include}\",\n            \"--qmake=#{Formula[\"qt\"].bin}/qmake\",\n            # Force deployment target to avoid libc++ issues\n            \"QMAKE_MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}\",\n            \"--designer-plugindir=#{pkgshare}/plugins\",\n            \"--qml-plugindir=#{pkgshare}/plugins\",\n            \"--verbose\",\n            \"--sip=#{Formula[\"osgeo-sip\"].opt_bin}/sip\",\n            #  ERROR: Unknown module(s) in QT\n            \"--disable=QtWebKit\",\n            \"--disable=QtWebKitWidgets\",\n            \"--disable=QAxContainer\",\n            \"--disable=QtX11Extras\",\n            \"--disable=QtWinExtras\",\n            \"--disable=Enginio\",\n            \"--no-dist-info\"\n           ]\n\n    system \"python3\", \"configure.py\", *args\n    system \"make\"\n    # system \"make\", \"install\"\n    ENV.deparallelize { system \"make\", \"install\" }\n    system \"make\", \"clean\"\n  end\n\n  test do\n    system \"#{bin}/pyuic5\", \"--version\"\n    system \"#{bin}/pylupdate5\", \"-version\"\n\n    version = Language::Python.major_minor_version \"python3\"\n    ENV[\"PYTHONPATH\"] = lib/\"python#{version}/site-packages\"\n    system \"python3\", \"-c\", '\"import PyQt5\"'\n    system \"python3\", \"-c\", '\"import PyQt5.QtGui\"'\n    system \"python3\", \"-c\", '\"import PyQt5.QtLocation\"'\n    system \"python3\", \"-c\", '\"import PyQt5.QtMultimedia\"'\n    system \"python3\", \"-c\", '\"import PyQt5.QtNetwork\"'\n    system \"python3\", \"-c\", '\"import PyQt5.QtQuick\"'\n    system \"python3\", \"-c\", '\"import PyQt5.QtSvg\"'\n    system \"python3\", \"-c\", '\"import PyQt5.QtWidgets\"'\n    system \"python3\", \"-c\", '\"import PyQt5.QtXml\"'\n  end\nend\n"
  },
  {
    "path": "boneyard/osgeo-qgis-ltr.rb",
    "content": "################################################################################\n# Maintainer: FJ Perini @fjperini\n# Collaborator: Luis Puerto @luispuerto\n################################################################################\n\nclass UnlinkedQGIS < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !qt4_linked && !pyqt4_linked && !txt2tags_linked }\n\n  def qt4_linked\n    (Formula[\"qt-4\"].linked_keg/\"lib/QtCore.framework/Versions/4\").exist?\n  rescue\n    return false\n  end\n\n  def pyqt4_linked\n    (Formula[\"pyqt-qt4\"].linked_keg/\"lib/qt-4/python2.7/site-packages/PyQt4\").exist?\n  rescue\n    return false\n  end\n\n  def txt2tags_linked\n    Formula[\"txt2tags\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"Compilation can fail if these formulae are installed and linked:\\n\\n\"\n\n    s += \"Unlink with `brew unlink qt-4` or remove with `brew uninstall qt-4`\\n\" if qt4_linked\n    s += \"Unlink with `brew unlink pyqt-qt4` or remove with `brew uninstall pyqt-qt4`\\n\" if pyqt4_linked\n    s += \"Unlink with `brew unlink txt2tags` or remove with `brew uninstall txt2tags`\\n\" if txt2tags_linked\n    s\n  end\nend\n\nclass OsgeoQgisLtr < Formula\n  desc \"Open Source Geographic Information System\"\n  homepage \"https://www.qgis.org\"\n  url \"https://github.com/qgis/QGIS/archive/final-3_4_9.tar.gz\"\n  sha256 \"bfdc8442e12e1f7521beaf6eb41f9d0cb3aba13ea0f649cb315444cdbc480cd8\"\n  # version \"3.4.9\"\n\n  # revision 1\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"741f70d5bff7420a445b129b677dabff7f9e47a54ae2634e767e98acf3c5199b\" => :mojave\n    sha256 \"741f70d5bff7420a445b129b677dabff7f9e47a54ae2634e767e98acf3c5199b\" => :high_sierra\n    sha256 \"709f5dc7ae4c284e25185c1ae8353fdd5e885bae5484be02f4250e6105d13e5f\" => :sierra\n  end\n\n  head \"https://github.com/qgis/QGIS.git\", :branch => \"master\"\n\n  # fix FindQsci and FindPyQt5\n  patch :DATA\n\n  def pour_bottle?\n    brewed_python?\n  end\n\n  option \"without-debug\", \"Disable debug build, which outputs info to system.log or console\"\n  option \"without-ninja\", \"Disable use of ninja CMake generator\"\n  option \"without-server\", \"Build without QGIS Server (qgis_mapserv.fcgi)\"\n  option \"without-postgresql\", \"Build without current PostgreSQL client\"\n  option \"without-pyqt5-webkit\", \"Build without webkit python bindings\"\n  option \"without-qgis-res\", \"Build without QGIS Resources support\"\n  option \"with-api-docs\", \"Build the API documentation with Doxygen and Graphviz\"\n  option \"with-isolation\", \"Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs\"\n  option \"with-mssql\", \"Build with Microsoft ODBC Driver for SQL Server\"\n  option \"with-oracle\", \"Build extra Oracle geospatial database and raster support\"\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n  # option \"with-globe\", \"Build with Globe plugin, based upon osgEarth\"\n\n  # Build with 3D Map View panel\n  # Build with GPSBabel. Read, write and manipulate GPS waypoints in a variety of formats\n  # Build with GRASS 7 integration plugin and Processing plugin support (or install grass-7x first)\n  # Build with LAStools, efficient tools for LiDAR processing. Contains LASlib, a C++ programming API for reading / writing LIDAR data stored in standard LAS format.\n  # Build extra Orfeo Toolbox for Processing plugin\n  # Build QSpatialite Qt database driver\n  # Build extra R for Processing plugin\n  # Build extra Saga GIS (LTS) for Processing plugin\n  # Build with QGIS Server (qgis_mapserv.fcgi)\n  # Build with TauDEM, Terrain Analysis Using Digital Elevation Models for hydrology\n  # Build with Whitebox Tools, an advanced geospatial data analysis platform\n\n  deprecated_option \"with-saga-gis-lts\" => \"with-saga\"\n  deprecated_option \"with-postgresql10\" => \"with-pg10\"\n\n  depends_on UnlinkedQGIS\n\n  # required\n  depends_on \"cmake\" => :build\n  depends_on \"ninja\" => [:build, :recommended]\n  depends_on \"gsl\" => :build # Georeferencer plugin\n  depends_on \"six\" => [:build, :recommended]\n  depends_on \"osgeo-sip\" => [:build, :recommended]\n  depends_on \"bison\" => :build\n  depends_on \"flex\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"python\"\n  depends_on \"osgeo-gdal-python\" # gdal - core providers\n  depends_on \"libzip\"\n  depends_on \"osgeo-qscintilla2\"\n  depends_on \"qca\"\n  depends_on \"qt\"\n  depends_on \"osgeo-pyqt\"\n  depends_on \"osgeo-pyqt-webkit\" # qt5-webkit\n  depends_on \"osgeo-qtkeychain\"\n  depends_on \"qwt\"\n  depends_on \"spatialindex\"\n  depends_on \"sqlite\"\n  depends_on \"expat\"\n  depends_on \"osgeo-proj\"\n  depends_on \"hdf5\"\n  depends_on \"geos\"\n  depends_on \"libtasn1\"\n  depends_on \"osgeo-libspatialite\"\n  depends_on \"qwtpolar\"\n  depends_on \"desktop-file-utils\"\n  depends_on \"hicolor-icon-theme\"\n\n  # recommended\n  depends_on \"openssl\"\n  depends_on \"qjson\"\n  depends_on \"unixodbc\"\n  # depends_on \"libiodbc\"\n  depends_on \"freetds\"\n  depends_on \"osgeo-psqlodbc\"\n  depends_on \"libpq\"\n  depends_on \"osgeo-postgis\"\n  depends_on \"exiv2\"\n  depends_on \"osgeo-liblas\"\n  depends_on \"osgeo-netcdf\"\n  depends_on \"osgeo-pdal\"\n  depends_on \"szip\"\n  depends_on \"openvpn\"\n  depends_on \"curl\"\n  depends_on \"libiconv\"\n  depends_on \"poppler\"\n  depends_on \"gnu-sed\"\n  depends_on \"git\"\n  depends_on \"libxml2\"\n  depends_on \"libffi\"\n\n  depends_on \"numpy\"\n  depends_on \"scipy\"\n  depends_on \"osgeo-matplotlib\"\n\n  if build.with?(\"api-docs\")\n    depends_on \"graphviz\" => :build\n    depends_on \"doxygen\" => :build\n  end\n\n  # requires python modules\n  # jinja - MetaSearch\n  # numpy - Processing\n  # owslib - MetaSearch\n  # psycopg2 - DB Manager and Processing\n  # pygments - MetaSearch\n  # yaml - Processing\n  # many useful modules are incorporated\n  depends_on \"osgeo-qgis-res\"\n\n  # fcgi - server\n  depends_on \"fcgi\"\n  depends_on \"spawn-fcgi\"\n  depends_on \"lighttpd\"\n\n  # core plugins (c++ and python\n\n  # grass\n  depends_on \"osgeo-grass\"\n  depends_on \"gettext\"\n\n  depends_on \"gpsbabel\" # GPS Tools plugin\n\n  # the Globe Plugin for QGIS 3 is still not available,\n  # only for QGIS 2 and it does not support a larger version than OSGearh v2.7.\n  # working on the implementation\n  # if build.with? \"globe\"\n  #   depends_on \"osgeo-openscenegraph\"\n  #   depends_on \"osgeo-osgqt\"\n  #   depends_on \"osgeo-osgearth\"\n  # end\n\n  # TODO: remove \"pyspatialite\" when PyPi package supports spatialite 4.x\n  #       or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite)\n  # TODO: what to do for Py3 and pyspatialite?\n  depends_on \"osgeo-pyspatialite\" # for DB Manager\n\n  # use newer postgresql client than Apple's, also needed by `psycopg2`\n  if build.with?(\"pg10\")\n    depends_on \"osgeo-postgresql@10\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  depends_on \"osgeo-oracle-client-sdk\" if build.with?(\"oracle\")\n\n  # TODO: add MSSQL third-party support formula?, :optional\n  if build.with?(\"mssql\")\n    depends_on \"microsoft/mssql-release/msodbcsql17\"\n    depends_on \"microsoft/mssql-release/mssql-tools\"\n  end\n\n  depends_on \"osgeo-qt-psql\"\n  depends_on \"osgeo-qt-odbc\"\n  depends_on \"osgeo-qt-mysql\" # for eVis plugin\n  # depends_on \"osgeo-qt-tds\" # obsolete from Qt 4.7\n  # depends_on \"osgeo-qt-oci\" # from oracle-client-sdk?\n\n  # core processing plugin extras\n  # see `grass` above\n  depends_on \"osgeo-orfeo\"\n  depends_on \"osgeo-saga-lts\"\n  depends_on \"osgeo-whitebox-tools\"\n  depends_on \"osgeo-lastools\"\n  depends_on \"osgeo-taudem\"\n\n  # R with more support\n  # https://github.com/adamhsparks/setup_macOS_for_R\n  # fix: will not build if the R version does not match\n  # If you installed sethrfore/r-srf/r, before installing\n  # rename \"/usr/local/opt/r\" to \"/usr/local/Cellar/r-bk\"\n  # and then restore it after installing qgis\n  depends_on \"r\" # optional\n\n  # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools)\n  # TODO: Fusion from USFS (via `wine`?)\n\n  # R Plugin\n  resource \"r\" do\n    url \"https://github.com/north-road/qgis-processing-r/archive/51371402c0200b6649fa3daa8ca8067e83aa6c15.tar.gz\"\n    sha256 \"f6309e1edc334f76938f46a396c71e986b1910dd8c4c58936cad8d7fad54a346\"\n    version \"1.0.5\"\n  end\n\n  # OTB Plugin\n  unless build.head?\n    resource \"otb\" do\n      url \"https://gitlab.orfeo-toolbox.org/orfeotoolbox/qgis-otb-plugin/-/archive/d5e8f0a2e11e9d1d5b28f1a0d1f9af1a4985b477/qgis-otb-plugin-d5e8f0a2e11e9d1d5b28f1a0d1f9af1a4985b477.tar.gz\"\n      sha256 \"939b89065604c10ee3a1b61f186e494f8e734aae1856547a32b1cb296dc4895b\"\n      version \"1.4.2\"\n    end\n    # # Patch: OtbUtils\n    # resource \"OtbUtils\" do\n    #   url \"https://gist.githubusercontent.com/fjperini/dc45ed0f637ae7dc8ec543a701e012f6/raw/c2b6bbafd6a9439bba903403f14c1b3c1ec3683d/OtbUtils.diff\"\n    #   sha256 \"b02c2fba5751dea84284072c590ce969ef215bb54e06cc2043ccbaf4449189e5\"\n    # end\n    # # Patch: OtbAlgorithmProvider\n    # resource \"OtbAlgorithmProvider\" do\n    #   url \"https://gist.githubusercontent.com/fjperini/d8fe440818814c0800e5071a0ccb4f70/raw/034e1dc2950749fcf70b2fd2925df11aa6deaae3/OtbAlgorithmProvider.diff\"\n    #   sha256 \"add76b970cee0c42bd56af50da1f77e1a214ae8912e6b8e3da6e82611ecc30b5\"\n    # end\n  end\n\n  # WhiteboxTools Plugin\n  resource \"whitebox\" do\n    url \"https://github.com/alexbruy/processing-whitebox/archive/5cbd81240e2a4e08fa0df515bf3dbf11957998ea.tar.gz\"\n    sha256 \"4ccf112dae81447842ccaa08a86d3c5fa12b0a1087e8dc485723a5c8737ebbd9\"\n    version \"0.9.0\"\n  end\n  # Patch: whiteboxProvider\n  resource \"whiteboxProvider\" do\n    url \"https://gist.githubusercontent.com/fjperini/fcb9f964c5396ab8b72c874a8db41b1d/raw/154deb8f17d52d11f1fba2642d43df2b1d0d936d/whiteboxProvider.diff\"\n    sha256 \"e95191b38765d6072c1a637e735114cce03d53173e47b96626bb30930b5e9c7f\"\n  end\n\n  # TauDEM Plugin\n  resource \"taudem\" do\n    url \"https://github.com/alexbruy/processing-taudem/archive/38dc454c477b6a6e917f2b3777dc69ed3ecd6062.tar.gz\"\n    sha256 \"7df793ae6a26ed65b6b15a8c8151b7f8598118b9f8da920eb260049d7c57229d\"\n    version \"2.0.0\"\n  end\n  # Patch: taudemProvider\n  resource \"taudemProvider\" do\n    url \"https://gist.githubusercontent.com/fjperini/1899e20e0286058a74116aecf466f0a0/raw/a2fc2c7a31c747fca5fbed4e885a6503fe6a5d4c/taudemProvider.diff\"\n    sha256 \"39a494f886d00011a0101b40715d828465592f304590438a7658d03298950cf5\"\n  end\n  # Patch: taudemUtils\n  resource \"taudemUtils\" do\n    url \"https://gist.githubusercontent.com/fjperini/f3e5ed0e964f4b7ead80a7c39a7115f6/raw/c3c8cca96d51156d0f60fe487b5b848faa3d0c2c/taudemUtils.diff\"\n    sha256 \"3cf403f74c2ed67f6cdfb87c04cf0b09b085fb9f77ddde9be1d7f2ac12fe53a3\"\n  end\n\n  # LAStools Plugin\n  resource \"lastools\" do\n    url \"https://github.com/rapidlasso/LAStoolsPluginQGIS3/archive/55866f1685c03c8f9771a6a995550e08095b1f8a.tar.gz\"\n    sha256 \"0badea99da9f14ae02a50860e368c48953eea921bf732593a2c059c090e1c248\"\n    version \"1.3\"\n  end\n  # Patch: LAStoolsProvider\n  resource \"LAStoolsProvider\" do\n    url \"https://gist.githubusercontent.com/fjperini/d6dd9f294be338fba4a05959b845f095/raw/4da2e9e0bd931ad00b3ca66777c3a9d50cde18ba/LAStoolsProvider.diff\"\n    sha256 \"82656a9fd6f42056d5c2a5487f2429b7f2c66c83287852fb644517abccecc563\"\n  end\n\n  # splash\n  resource \"splash\" do\n    url \"https://bottle.download.osgeo.org/qgis-splash/splash-3.4.png\"\n    sha256 \"39aa3a7f99b3056a763da053ff74f39250f12b4088b02115c21ea97723d7fcb0\"\n  end\n\n  def install\n    ENV.cxx11\n\n    # change splash\n    rm \"#{buildpath}/images/splash/splash.png\"\n    (buildpath/\"images/splash\").install resource(\"splash\")\n    mv \"#{buildpath}/images/splash/splash-3.4.png\", \"#{buildpath}/images/splash/splash.png\"\n\n    # suggestions before installing\n    printf  \"\\n\\033[31mSome suggestions that you should keep in mind!!!\\e[0m\\n\\n\"\n    printf  \"- In case you have installed another version of Python\\e[0m (Anaconda, Miniconda or if you used the installer provided by python.org),\\n\"\n    printf  \"  QGIS will use the first Python that is in its PATH, so the installation may fail.\\n\\n\"\n    printf  \"- If the installation failed due to the problem reported in \\e[32mhttps://github.com/OSGeo/homebrew-osgeo4mac/issues/520\\e[0m\\n\\n\"\n    printf  \"  Try after doing:\\n\\n\"\n    printf  \"    \\e[32m$ brew unlink python && brew link --force python\\e[0m  \\e[1;33m(*)\\e[0m\\n\\n\"\n    printf  \"    \\e[32m$ $PATH (Check that there is no other version)\\e[0m\\n\\n\"\n    printf  \"- If the installation failed due to the problem reported in \\e[32mhttps://github.com/OSGeo/homebrew-osgeo4mac/issues/510\\e[0m\\n\\n\"\n    printf  \"  Try after doing:\\n\\n\"\n    printf  \"    \\e[32m$ brew reinstall ninja gsl python qt osgeo-sip osgeo-pyqt osgeo-pyqt-webkit osgeo-qscintilla2 six bison flex pkg-config\\e[0m\\n\\n\"\n    printf  \"    \\e[32m$ brew link --overwrite osgeo-pyqt\\e[0m  \\e[1;33m(**)\\e[0m\\n\\n\"\n    printf  \"- Other Notes:\\n\\n\"\n    printf  \"    - An installation that failed previously may have created this link\\n\\n\"\n    printf  \"      \\033[31m#{HOMEBREW_PREFIX}/lib/python#{py_ver}/site-packages/PyQt5/uic/widget-plugins/qgis_customwidgets.py\\e[0m, you will need to delete it.\\n\\n\"\n    printf  \"    - Also make sure that the folder \\033[31m#{HOMEBREW_PREFIX}/Cellar/qgis\\e[0m does not exist if the installation fails.\\n\\n\"\n    printf  \"    - It is also recommended remove the Homebrew Cache \\e[32m$ rm -rf $(brew --cache)\\e[0m (\\e[32m~/Library/Caches/Homebrew\\e[0m) and the temporary build files in \\e[32m/tmp\\e[0m.\\n\\n\"\n    printf  \"    - If you are going to install with several options you may have the following error:\\n\\n\"\n    printf  \"      \\033[31mError: Too many open files @ rb_sysopen - #{HOMEBREW_PREFIX}/var/homebrew/locks/..\\e[0m\\n\\n\"\n    printf  \"      Check before with: \\e[32m$ ulimit -n\\e[0m\\n\"\n    printf  \"      You can change it temporarily to avoid this problem: \\e[32m$ ulimit -n 1024\\e[0m\\n\"\n    printf  \"      Will be re-established in the next session\\n\\n\"\n    printf  \"    - If the installation failed with the error\\n\\n\"\n    printf  \"      \\033[31mfatal error: 'libintl.h' file not found\\e[0m\\n\\n\"\n    printf  \"      Try after doing: \\e[32m$ brew unlink gettext && brew link --force gettext\\e[0m  \\e[1;33m(***)\\e[0m\\n\\n\"\n    printf  \"\\n\\033[31mWe recommend that you run on the terminal\\e[0m \\e[1;33m(*)\\e[0m\\033[31m,\\e[1;33m(**)\\e[0m \\033[31mand\\e[0m \\e[1;33m(***)\\e[0m \\033[31mbefore installation,\\e[0m\\n\"\n    printf  \"\\n\\033[31mto make sure everything works correctly.\\e[0m\\n\\n\"\n    printf \"\\033[31mThe installation will continue, but remember the above.\\e[0m\\n\"\n\n    30.downto(0) do |i|\n        printf \"#{'%02d'% i}.\"\n        sleep 1\n    end\n\n    printf \"\\n\\n\"\n\n    # proceeds to install the add-ons as a first step,\n    # to ensure that the patches are applied\n    mkdir \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n\n    # OTB is available from branch_3.8\n    unless build.head?\n    #   resource(\"otb\").stage do\n    #     cp_r \"./otb\", \"#{buildpath}/python/plugins/\"\n    #   end\n      resource(\"otb\").stage do\n        cp_r \"./otb\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n      end\n    #   resource(\"OtbUtils\").stage do\n    #     cp_r \"./OtbUtils.diff\", \"#{buildpath}\"\n    #   end\n    #   resource(\"OtbAlgorithmProvider\").stage do\n    #     cp_r \"./OtbAlgorithmProvider.diff\", \"#{buildpath}\"\n    #   end\n    #   system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/OtbUtils.diff\"\n    #   system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/OtbAlgorithmProvider.diff\"\n    #   cp_r \"#{buildpath}/python/plugins/otb\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n    end\n\n    # R\n    resource(\"r\").stage do\n      cp_r \"./processing_r\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n    end\n\n    # WhiteboxTools\n    resource(\"whitebox\").stage do\n      cp_r \"./\", \"#{buildpath}/python/plugins/processing_whitebox\"\n    end\n    resource(\"whiteboxProvider\").stage do\n      cp_r \"./whiteboxProvider.diff\", \"#{buildpath}\"\n    end\n    system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/whiteboxProvider.diff\"\n    cp_r \"#{buildpath}/python/plugins/processing_whitebox\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n\n    # TauDEM\n    resource(\"taudem\").stage do\n      cp_r \"./\", \"#{buildpath}/python/plugins/processing_taudem\"\n    end\n    resource(\"taudemProvider\").stage do\n      cp_r \"./taudemProvider.diff\", \"#{buildpath}\"\n    end\n    resource(\"taudemUtils\").stage do\n      cp_r \"./taudemUtils.diff\", \"#{buildpath}\"\n    end\n    system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/taudemProvider.diff\"\n    system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/taudemUtils.diff\"\n    cp_r \"#{buildpath}/python/plugins/processing_taudem\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n\n    # LASTools\n    resource(\"lastools\").stage do\n      cp_r \"./LAStools\", \"#{buildpath}/python/plugins/lastools\"\n    end\n    resource(\"LAStoolsProvider\").stage do\n      cp_r \"./LAStoolsProvider.diff\", \"#{buildpath}\"\n    end\n    system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/LAStoolsProvider.diff\"\n    cp_r \"#{buildpath}/python/plugins/lastools\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n\n    # if you have a 3rd party Python installed, and/or Python 3,\n    # you need to remove it from your path for the installation.\n    # once installed, QGIS will run even if the primary Python is,\n    # for example, Anaconda Python 3.\n    # reset path\n    ENV[\"PATH\"] = nil\n    pths = \"#{HOMEBREW_PREFIX}/bin:#{HOMEBREW_PREFIX}/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11/bin\"\n    ENV.append_path \"PATH\", \"#{pths}\"\n\n    # when osgeo-gdal-python.rb loaded, PYTHONPATH gets set to 2.7 site-packages...\n    # clear it before calling any local python3 functions\n    ENV[\"PYTHONPATH\"] = nil\n    if ARGV.debug?\n      puts \"brewed_python?: #{brewed_python?}\"\n      puts \"python_prefix: #{python_prefix}\"\n      puts \"python_exec: #{python_exec}\"\n      puts \"py_ver: #{py_ver}\"\n      puts \"python_site_packages: #{python_site_packages}\"\n      puts \"qgis_site_packages: #{qgis_site_packages}\"\n      puts \"qgis_python_packages: #{qgis_python_packages}\"\n      puts \"gdal_python_packages: #{gdal_python_packages}\"\n      puts \"gdal_python_opt_bin: #{gdal_python_opt_bin}\"\n      puts \"gdal_opt_bin: #{gdal_opt_bin}\"\n    end\n\n    # set bundling level back to 0 (the default in all versions prior to 1.8.0)\n    # so that no time and energy is wasted copying the Qt frameworks into QGIS.\n\n    # install custom widgets Designer plugin to local qt plugins prefix\n    mkdir lib/\"qt/plugins/designer\"\n    inreplace \"src/customwidgets/CMakeLists.txt\",\n              \"${QT_PLUGINS_DIR}/designer\", lib/\"qt/plugins/designer\".to_s\n\n    # fix custom widgets Designer module install path\n    mkdir lib/\"python#{py_ver}/site-packages/PyQt5\"\n    inreplace \"CMakeLists.txt\",\n              \"${PYQT5_MOD_DIR}\", lib/\"python#{py_ver}/site-packages/PyQt5\".to_s\n\n    # install db plugins to local qt plugins prefix\n    # qspatialite\n    mkdir lib/\"qt/plugins/sqldrivers\"\n    inreplace \"external/qspatialite/CMakeLists.txt\",\n              \"${QT_PLUGINS_DIR}/sqldrivers\", lib/\"qt/plugins/sqldrivers\".to_s\n\n    # end\n    if build.with? \"oracle\"\n      mkdir lib/\"qt/plugins/sqldrivers\"\n      inreplace \"src/providers/oracle/ocispatial/CMakeLists.txt\",\n                \"${QT_PLUGINS_DIR}/sqldrivers\", lib/\"qt/plugins/sqldrivers\".to_s\n    end\n\n    # support for PROJ 6\n    # https://github.com/OSGeo/proj.4/wiki/proj.h-adoption-status\n    # ENV.append \"CFLAGS\", \"-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H\"\n\n    args = std_cmake_args\n    args << \"-DCMAKE_BUILD_TYPE=RelWithDebInfo\" if build.with? \"debug\" # override\n\n    cmake_prefixes = %w[\n      qt\n      osgeo-qt-webkit\n      osgeo-pyqt-webkit\n      osgeo-qscintilla2\n      osgeo-pyqt\n      osgeo-sip\n      qwt\n      qwtpolar\n      qca\n      osgeo-qtkeychain\n      osgeo-gdal\n      gsl\n      geos\n      osgeo-proj\n      osgeo-libspatialite\n      spatialindex\n      expat\n      sqlite\n      libzip\n      flex\n      bison\n      fcgi\n    ].freeze\n\n    # force CMake to search HB/opt paths first, so headers in HB/include are not found instead;\n    # specifically, ensure any gdal v1 includes are not used\n    args << \"-DCMAKE_PREFIX_PATH=#{cmake_prefixes.map { |f| Formula[f.to_s].opt_prefix }.join(\";\")}\"\n\n    qwt_fw = Formula[\"qwt\"].opt_lib/\"qwt.framework\"\n    qwtpolar_fw = Formula[\"qwtpolar\"].opt_lib/\"qwtpolar.framework\"\n    qca_fw = Formula[\"qca\"].opt_lib/\"qca-qt5.framework\"\n    args += %W[\n      -DBISON_EXECUTABLE=#{Formula[\"bison\"].opt_bin}/bison\n      -DEXPAT_INCLUDE_DIR=#{Formula[\"expat\"].opt_include}\n      -DEXPAT_LIBRARY=#{Formula[\"expat\"].opt_lib}/libexpat.dylib\n      -DFLEX_EXECUTABLE=#{Formula[\"flex\"].opt_bin}/flex\n      -DPROJ_INCLUDE_DIR=#{Formula[\"osgeo-proj\"].opt_include}\n      -DPROJ_LIBRARY=#{Formula[\"osgeo-proj\"].opt_lib}/libproj.dylib\n      -DQCA_INCLUDE_DIR=#{qca_fw}/Headers\n      -DQCA_LIBRARY=#{qca_fw}/qca-qt5\n      -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers\n      -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar\n      -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers\n      -DQWT_LIBRARY=#{qwt_fw}/qwt\n      -DSPATIALINDEX_INCLUDE_DIR=#{Formula[\"spatialindex\"].opt_include}\n      -DSPATIALINDEX_LIBRARY=#{Formula[\"spatialindex\"].opt_lib}/libspatialindex.dylib\n      -DSQLITE3_INCLUDE_DIR=#{Formula[\"sqlite\"].opt_include}\n      -DSQLITE3_LIBRARY=#{Formula[\"sqlite\"].opt_lib}/libsqlite3.dylib\n      -DLIBZIP_CONF_INCLUDE_DIR=#{Formula[\"libzip\"].opt_lib}/pkgconfig\n      -DLIBZIP_INCLUDE_DIR=#{Formula[\"libzip\"].opt_include}\n      -DLIBZIP_LIBRARY=#{Formula[\"libzip\"].opt_lib}/libzip.dylib\n      -DSPATIALITE_INCLUDE_DIR=#{Formula[\"osgeo-libspatialite\"].opt_include}\n      -DSPATIALITE_LIBRARY=#{Formula[\"osgeo-libspatialite\"].opt_lib}/libspatialite.dylib\n      -DQTKEYCHAIN_INCLUDE_DIR=#{Formula[\"qtkeychain\"].opt_include}/qt5keychain\n      -DQTKEYCHAIN_LIBRARY=#{Formula[\"osgeo-qtkeychain\"].opt_lib}/libqt5keychain.dylib\n      -DLIBTASN1_INCLUDE_DIR=#{Formula[\"libtasn1\"].opt_include}\n      -DLIBTASN1_LIBRARY=#{Formula[\"libtasn1\"].opt_lib}/libtasn1.dylib\n      -DPYRCC_PROGRAM=#{libexec}/vendor/bin/pyrcc5\n      -DPYUIC_PROGRAM=#{libexec}/vendor/bin/pyuic5\n      -DWITH_QWTPOLAR=TRUE\n      -DWITH_INTERNAL_QWTPOLAR=FALSE\n      -DWITH_QSCIAPI=FALSE\n      -DWITH_CUSTOM_WIDGETS=TRUE\n      -DWITH_ASTYLE=FALSE\n      -DWITH_QTWEBKIT=TRUE\n      -DQT_LRELEASE_EXECUTABLE=#{Formula[\"qt\"].opt_bin}/lrelease\n      -DQT5_3DEXTRA_INCLUDE_DIR=#{Formula[\"qt\"].opt_lib}/cmake/Qt53DExtras\n      -DQt5WebKitWidgets_DIR=#{Formula[\"osgeo-qt-webkit\"].opt_lib}/cmake/Qt5WebKitWidgets\n      -DQt5WebKit_DIR=#{Formula[\"osgeo-qt-webkit\"].opt_lib}/cmake/Qt5WebKit\n    ]\n\n    args << \"-DQGIS_MACAPP_BUNDLE=0\"\n    args << \"-DQGIS_MACAPP_INSTALL_DEV=FALSE\"\n    # args << \"-DQGIS_APP_NAME=QGIS-HB\"\n\n    # Build unit tests\n    args << \"-DENABLE_TESTS=FALSE\"\n    # Enable QT ModelTest (not for production)\n    args << \"-DENABLE_MODELTEST=FALSE\"\n    # Perform coverage tests\n    args << \"-DENABLE_COVERAGE=FALSE\"\n\n    args << \"-DSIP_BINARY_PATH=#{Formula[\"osgeo-sip\"].opt_bin}/sip\"\n    args << \"-DSIP_DEFAULT_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip\"\n    args << \"-DSIP_INCLUDE_DIR=#{Formula[\"osgeo-sip\"].opt_include}\"\n    args << \"-DSIP_MODULE_DIR=#{Formula[\"osgeo-sip\"].opt_lib}/python#{py_ver}/site-packages\"\n\n    args << \"-DPYQT5_MOD_DIR=#{Formula[\"python\"].opt_prefix}/Frameworks/Python.framework/Versions/#{py_ver}/lib/python#{py_ver}/site-packages/PyQt5\"\n    args << \"-DPYQT5_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip/PyQt5\" # Qt5\n    args << \"-DPYQT5_BIN_DIR=#{Formula[\"python\"].opt_prefix}/Frameworks/Python.framework/Versions/#{py_ver}/bin\"\n    args << \"-DPYQT5_SIP_IMPORT=PyQt5.sip\"\n    args << \"-DPYQT5_SIP_FLAGS=-n PyQt5.sip -t WS_MACX -t Qt_5_12_1\"\n\n    args << \"-DQSCI_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip/PyQt5/Qsci\" # Qsci/qscimod5.sip\n    args << \"-DQSCINTILLA_INCLUDE_DIR=#{Formula[\"osgeo-qscintilla2\"].opt_include}\" # Qsci/qsciglobal.h\n    args << \"-DQSCINTILLA_LIBRARY=#{Formula[\"osgeo-qscintilla2\"].opt_lib}/libqscintilla2_qt5.dylib\"\n\n    # disable CCache\n    args << \"-DUSE_CCACHE=OFF\"\n\n    # Determines whether QGIS core should be built\n    args << \"-DWITH_CORE=TRUE\"\n\n    # Determines whether QGIS GUI library (and everything built on top of it) should be built\n    args << \"-DWITH_GUI=TRUE\"\n\n    # Determines whether QGIS analysis library should be built\n    # args << \"-DWITH_ANALYSIS=TRUE\"\n\n    # Determines whether QGIS desktop should be built\n    args << \"-DWITH_DESKTOP=TRUE\"\n\n    # Determines whether QGIS Quick library should be built\n    args << \"-DWITH_QUICK=FALSE\"\n\n    # Determines whether MDAL support should be built\n    args << \"-DWITH_INTERNAL_MDAL=TRUE\"\n\n    # Determines whether GeoReferencer plugin should be built\n    args << \"-DWITH_GEOREFERENCER=TRUE\"\n\n    # Determines whether std::thread_local should be used\n    args << \"-DWITH_THREAD_LOCAL=TRUE\"\n\n    # Determines whether Qt5SerialPort should be tried for GPS positioning\n    # args << \"-DWITH_QT5SERIALPORT=TRUE\"\n\n    # Use Clang tidy\n    args << \"-DWITH_CLANG_TIDY=FALSE\"\n\n    # try to configure and build python bindings by default\n    # determines whether python bindings should be built\n    args << \"-DWITH_BINDINGS=TRUE\"\n    # by default bindings will be installed only to QGIS directory\n    # someone might want to install it to python site-packages directory\n    # as otherwise user has to use PYTHONPATH environment variable to add\n    # QGIS bindings to package search path\n    # install bindings to global python directory? (might need root)\n    args << \"-DBINDINGS_GLOBAL_INSTALL=FALSE\"\n    # Stage-install core Python plugins to run from build directory? (utilities and console are always staged)\n    args << \"-DWITH_STAGED_PLUGINS=TRUE\"\n    # Determines whether Python modules in staged or installed locations are byte-compiled\"\n    args << \"-DWITH_PY_COMPILE=FALSE\"\n\n    # python Configuration\n    args << \"-DPYTHON_EXECUTABLE=#{`#{Formula[\"python\"].opt_bin}/python3 -c \"import sys; print(sys.executable)\"`.chomp}\"\n    # args << \"-DPYTHON_INCLUDE_PATH=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/include/python#{py_ver}m\"\n    # args << \"-DPYTHON_LIBRARY=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/Python\"\n    # args << \"-DPYTHON_SITE_PACKAGES_DIR=#{HOMEBREW_PREFIX}/lib/python#{py_ver}/site-packages\"\n\n    # if using Homebrew's Python, make sure its components are always found first\n    # see: https://github.com/Homebrew/homebrew/pull/28597\n    ENV[\"PYTHONHOME\"] = python_prefix if brewed_python?\n\n    # handle custom site-packages for keg-only modules and packages\n    ENV.append_path \"PYTHONPATH\", \"#{python_site_packages}\"\n    ENV.append_path \"PYTHONPATH\", \"#{qgis_site_packages}\"\n    ENV.append_path \"PYTHONPATH\", \"#{qgis_python_packages}\"\n    ENV.append_path \"PYTHONPATH\", \"#{gdal_python_packages}\"\n\n    # find git revision for HEAD build\n    if build.head? && File.exist?(\"#{cached_download}/.git/index\")\n      args << \"-DGITCOMMAND=#{Formula[\"git\"].opt_bin}/git\"\n      args << \"-DGIT_MARKER=#{cached_download}/.git/index\"\n\n      # disable OpenCL support\n      # necessary to build from branch: master\n      # fix for CL/cl2.hpp\n      # https://github.com/qgis/QGIS/pull/7451\n      # args << \"-DUSE_OPENCL=OFF\"\n    end\n\n    # used internal sources\n    # args << \"OPENCL_HPP_INCLUDE_DIR=\"\n\n    # server\n    args << \"-DWITH_SERVER=TRUE\"\n    args << \"-DWITH_SERVER_PLUGINS=TRUE\"\n    fcgi_opt = Formula[\"fcgi\"].opt_prefix\n    args << \"-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include\"\n    args << \"-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib\"\n\n    # postgresql\n    args << \"-DWITH_POSTGRESQL=TRUE\"\n    if build.with?(\"pg10\")\n      args << \"-DPOSTGRES_CONFIG=#{Formula[\"osgeo-postgresql@10\"].opt_bin}/pg_config\"\n      args << \"-DPOSTGRES_INCLUDE_DIR=#{Formula[\"osgeo-postgresql@10\"].opt_include}\"\n      args << \"-DPOSTGRES_LIBRARY=#{Formula[\"osgeo-postgresql@10\"].opt_lib}/libpq.dylib\"\n    else\n      args << \"-DPOSTGRES_CONFIG=#{Formula[\"osgeo-postgresql\"].opt_bin}/pg_config\"\n      args << \"-DPOSTGRES_INCLUDE_DIR=#{Formula[\"osgeo-postgresql\"].opt_include}\"\n      args << \"-DPOSTGRES_LIBRARY=#{Formula[\"osgeo-postgresql\"].opt_lib}/libpq.dylib\"\n    end\n\n    # grass\n    args << \"-DWITH_GRASS7=TRUE\"\n    args << \"-DWITH_GRASS=FALSE\" # grass6\n    # this is to build the GRASS Plugin, not for Processing plugin support\n    grass = Formula[\"osgeo-grass\"]\n    args << \"-DGRASS_PREFIX7=#{grass.opt_prefix}/grass-base\"\n    # keep superenv from stripping (use Cellar prefix)\n    ENV.append \"CXXFLAGS\", \"-isystem #{grass.prefix.resolved_path}/grass-base/include\"\n    # So that `libintl.h` can be found (use Cellar prefix; should not be needed anymore with QGIS 2.99+)\n    ENV.append \"CXXFLAGS\", \"-isystem #{Formula[\"gettext\"].include.resolved_path}\"\n\n    # args << \"-DWITH_GLOBE=TRUE\"\n    # osg = Formula[\"osgeo-openscenegraph\"]\n    # osgqt = Formula[\"osgqt\"]\n    # osgearth = Formula[\"osgeo-osgearth\"]\n    # opoo \"`osgeo-openscenegraph` formula's keg not linked.\" unless osg.linked_keg.exist?\n    # # OSG\n    # # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there\n    # args << \"-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}\"\n    # args << \"-DOSG_DIR=#{osg.opt_prefix}\"\n    # args << \"-DOSG_INCLUDE_DIR=#{osg.opt_include}\" # osg/Node\n    # args << \"-DOSG_GEN_INCLUDE_DIR=#{osg.opt_include}\" # osg/Config\n    # args << \"-DOSG_LIBRARY=#{osg.opt_lib}/libosg.dylib\"\n    # args << \"-DOSGUTIL_LIBRARY=#{osg.opt_lib}/libosgUtil.dylib\"\n    # args << \"-DOSGDB_LIBRARY=#{osg.opt_lib}/libosgDB.dylib\"\n    # args << \"-DOSGTEXT_LIBRARY=#{osg.opt_lib}/libosgText.dylib\"\n    # args << \"-DOSGTERRAIN_LIBRARY=#{osg.opt_lib}/libosgTerrain.dylib\"\n    # args << \"-DOSGFX_LIBRARY=#{osg.opt_lib}/libosgFX.dylib\"\n    # args << \"-DOSGSIM_LIBRARY=#{osg.opt_lib}/libosgSim.dylib\"\n    # args << \"-DOSGVIEWER_LIBRARY=#{osg.opt_lib}/libosgViewer.dylib\"\n    # args << \"-DOSGGA_LIBRARY=#{osg.opt_lib}/libosgGA.dylib\"\n    # args << \"-DOSGQT_LIBRARY=#{osgqt.opt_lib}/libosgQt5.dylib\"\n    # args << \"-DOSGWIDGET_LIBRARY=#{osg.opt_lib}/libosgWidget.dylib\"\n    # args << \"-DOPENTHREADS_LIBRARY=#{osg.opt_lib}/libOpenThreads.dylib\"\n    # # args << \"-DOPENTHREADS_INCLUDE_DIR=#{osg.opt_include}\"\n    # # args << \"-DOSGSHADOW_LIBRARY=#{osg.opt_lib}/libosgShadow.dylib\"\n    # # args << \"-DOSGMANIPULATOR_LIBRARY=#{osg.opt_lib}/libosgManipulator.dylib\"\n    # # args << \"-DOSGPARTICLE_LIBRARY=#{osg.opt_lib}/libosgParticle.dylib\"\n    # # OSGEARTH\n    # args << \"-DOSGEARTH_DIR=#{osgearth.opt_prefix}\"\n    # args << \"-DOSGEARTH_INCLUDE_DIR=#{osgearth.opt_include}\" # osgEarth/TileSource\n    # args << \"-DOSGEARTH_GEN_INCLUDE_DIR=#{osgearth.opt_include}\" # osgEarth/Common\n    # args << \"-DOSGEARTH_ELEVATION_QUERY=#{osgearth.opt_include}\" # osgEarth/ElevationQuery\n    # args << \"-DOSGEARTH_LIBRARY=#{osgearth.opt_lib}/libosgEarth.dylib\"\n    # args << \"-DOSGEARTHUTIL_LIBRARY=#{osgearth.opt_lib}/libosgEarthUtil.dylib\"\n    # args << \"-DOSGEARTHFEATURES_LIBRARY=#{osgearth.opt_lib}/libosgEarthFeatures.dylib\"\n    # args << \"-DOSGEARTHSYMBOLOGY_LIBRARY=#{osgearth.opt_lib}/libosgEarthSymbology.dylib\"\n    # args << \"-DOSGEARTHQT_LIBRARY=#{osgearth.opt_lib}/libosgEarthQt5.dylib\"\n    # args << \"-DOSGEARTHANNOTATION_LIBRARY=#{osgearth.opt_lib}/libosgEarthAnnotation.dylib\"\n    # # qt\n    # args << \"-DQt5OpenGL_INCLUDE_DIRS=#{Formula[\"qt\"].opt_include}/QtOpenGL\"\n\n    args << \"-DWITH_ORACLE=#{build.with?(\"oracle\") || brewed_oracle? ? \"TRUE\" : \"FALSE\"}\"\n    if build.with?(\"oracle\") || brewed_oracle?\n      oracle_opt = Formula[\"osgeo-oracle-client-sdk\"].opt_prefix\n      args << \"-DOCI_INCLUDE_DIR=#{oracle_opt}/include/oci\"\n      args << \"-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib\"\n    end\n\n    args << \"-DWITH_QSPATIALITE=TRUE\"\n\n    args << \"-DWITH_APIDOC=#{build.with?(\"api-docs\") ? \"TRUE\" : \"FALSE\"}\"\n\n    args << \"-DWITH_3D=TRUE\"\n\n    # args << \"-DWITH_QTWEBKIT=#{build.with?(\"osgeo-qt-webkit\") ? \"TRUE\" : \"FALSE\"}\"\n    # if build.with? \"qtwebkit\"\n    #   args << \"-DOPTIONAL_QTWEBKIT=#{Formula[\"osgeo-qt-webkit\"].opt_lib}/cmake/Qt5WebKitWidgets\"\n    # end\n\n    # prefer opt_prefix for CMake modules that find versioned prefix by default\n    # this keeps non-critical dependency upgrades from breaking QGIS linking\n    args << \"-DGDAL_CONFIG=#{Formula[\"osgeo-gdal\"].opt_bin}/gdal-config\"\n    args << \"-DGDAL_INCLUDE_DIR=#{Formula[\"osgeo-gdal\"].opt_include}\"\n    args << \"-DGDAL_LIBRARY=#{Formula[\"osgeo-gdal\"].opt_lib}/libgdal.dylib\"\n    args << \"-DGEOS_CONFIG=#{Formula[\"geos\"].opt_bin}/geos-config\"\n    args << \"-DGEOS_INCLUDE_DIR=#{Formula[\"geos\"].opt_include}\"\n    args << \"-DGEOS_LIBRARY=#{Formula[\"geos\"].opt_lib}/libgeos_c.dylib\"\n    args << \"-DGSL_CONFIG=#{Formula[\"gsl\"].opt_bin}/gsl-config\"\n    args << \"-DGSL_INCLUDE_DIR=#{Formula[\"gsl\"].opt_include}\"\n    args << \"-DGSL_LIBRARIES='-L#{Formula[\"gsl\"].opt_lib} -lgsl -lgslcblas'\"\n\n    # avoid ld: framework not found QtSql\n    # (https://github.com/Homebrew/homebrew-science/issues/23)\n    ENV.append \"CXXFLAGS\", \"-F#{Formula[\"qt\"].opt_lib}\"\n\n    # handle some compiler warnings\n    # ENV[\"CXX_EXTRA_FLAGS\"] = \"-Wno-unused-private-field -Wno-deprecated-register\"\n    # if ENV.compiler == :clang && (MacOS::Xcode.version >= \"7.0\" || MacOS::CLT.version >= \"7.0\")\n    #   ENV.append \"CXX_EXTRA_FLAGS\", \"-Wno-inconsistent-missing-override\"\n    # end\n\n    args << \"-DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations\"\n\n    # If set to true, it will disable deprecated functionality to prepare for the next generation of QGIS\n    # args << \"-DDISABLE_DEPRECATED=TRUE\"\n\n    # Newer versions of UseQt4.cmake include Qt with -isystem automatically\n    # This can be used to force this behavior on older systems\n    # Can be removed as soon as Travis-CI updates from precise\n    # args << \"-DSUPPRESS_QT_WARNINGS=TRUE\"\n\n    ENV.prepend_path \"PATH\", libexec/\"vendor/bin\"\n\n    mkdir \"#{libexec}/vendor/bin\"\n\n    # create pyrcc5\n    File.open(\"#{libexec}/vendor/bin/pyrcc5\", \"w\") { |file|\n\t\t\tfile << '#!/bin/sh'\n\t\t\tfile << \"\\n\"\n\t\t\tfile << 'exec' + \" #{Formula[\"python\"].opt_bin}/python3 \" + '-m PyQt5.pyrcc_main ${1+\"$@\"}'\n    }\n\n    # create pyuic5\n    File.open(\"#{libexec}/vendor/bin/pyuic5\", \"w\") { |file|\n\t\t\tfile << '#!/bin/sh'\n\t\t\tfile << \"\\n\"\n\t\t\tfile << 'exec' + \" #{Formula[\"python\"].opt_bin}/python3 \" + '-m PyQt5.pyuic5_main ${1+\"$@\"}'\n    }\n\n    chmod(\"+x\", \"#{libexec}/vendor/bin/pyrcc5\")\n    chmod(\"+x\", \"#{libexec}/vendor/bin/pyuic5\")\n\n    mkdir \"build\" do\n      system \"cmake\", \"-G\", build.with?(\"ninja\") ? \"Ninja\" : \"Unix Makefiles\", *args, \"..\"\n      system \"cmake\", \"--build\", \".\", \"--target\", \"all\", \"--\", \"-j\", Hardware::CPU.cores\n      system \"cmake\", \"--build\", \".\", \"--target\", \"install\", \"--\", \"-j\", Hardware::CPU.cores\n    end\n\n    # fixup some errant lib linking\n    # TODO: fix upstream in CMake\n    dy_libs = [lib/\"qt/plugins/designer/libqgis_customwidgets.dylib\"]\n    dy_libs << lib/\"qt/plugins/sqldrivers/libqsqlspatialite.dylib\" # qspatialite\n    dy_libs << lib/\"qt/plugins/sqldrivers/libqsqlocispatial.dylib\" if build.with? \"oracle\"\n    dy_libs.each do |dy_lib|\n      MachO::Tools.dylibs(dy_lib.to_s).each do |i_n|\n        %w[core gui native].each do |f_n|\n          sufx = i_n[/(qgis_#{f_n}\\.framework.*)/, 1]\n          next if sufx.nil?\n          i_n_to = \"#{opt_prefix}/QGIS.app/Contents/Frameworks/#{sufx}\"\n          puts \"Changing install name #{i_n} to #{i_n_to} in #{dy_lib}\" if ARGV.debug?\n          dy_lib.ensure_writable do\n            MachO::Tools.change_install_name(dy_lib.to_s, i_n.to_s, i_n_to, :strict => false)\n          end\n        end\n      end\n    end\n\n    # update .app's bundle identifier, so other installers doesn't get confused\n    inreplace prefix/\"QGIS.app/Contents/Info.plist\",\n              \"org.qgis.qgis3\", \"org.qgis.osgeo-qgis-ltr-hb#{build.head? ? \"-dev\" : \"\"}\"\n\n    py_lib = lib/\"python#{py_ver}/site-packages\"\n    py_lib.mkpath\n    ln_s \"../../../QGIS.app/Contents/Resources/python/qgis\", py_lib/\"qgis\"\n\n    ln_s \"QGIS.app/Contents/MacOS/fcgi-bin\", prefix/\"fcgi-bin\" # server\n\n    doc.mkpath\n    mv prefix/\"QGIS.app/Contents/Resources/doc/api\", doc/\"api\" if build.with? \"api-docs\"\n    ln_s \"../../../QGIS.app/Contents/Resources/doc\", doc/\"doc\"\n\n    # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped)\n    # only works with QGIS > 2.0.1\n    # doesn't need executable bit set, loaded by Python runner in QGIS\n    # TODO: for Py3\n    cp_r \"#{Formula[\"osgeo-qgis-res\"].opt_libexec}/pyqgis_startup.py\", \"#{libexec}/pyqgis_startup.py\"\n\n    bin.mkdir\n    qgis_bin = bin/name.to_s\n    touch qgis_bin.to_s # so it will be linked into HOMEBREW_PREFIX\n    qgis_bin.chmod 0755\n    post_install\n  end\n\n  def post_install\n    # configure environment variables for .app and launching binary directly.\n    # having this in `post_intsall` allows it to be individually run *after* installation with:\n    #    `brew postinstall -v <formula-name>`\n\n    app = prefix/\"QGIS.app\"\n    tab = Tab.for_formula(self)\n    opts = tab.used_options\n    # bottle_poured = tab.poured_from_bottle\n\n    # define default isolation env vars\n    pthsep = File::PATH_SEPARATOR\n    pypth = \"#{python_site_packages}\"\n    pths = %W[#{HOMEBREW_PREFIX}/bin #{HOMEBREW_PREFIX}/sbin /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin]\n\n    unless opts.include?(\"with-isolation\")\n      pths = ORIGINAL_PATHS.dup\n      pyenv = ENV[\"PYTHONPATH\"]\n      if pyenv\n        pypth = pyenv.include?(pypth) ? pyenv : pypth + pthsep + pyenv\n      end\n    end\n\n    unless pths.include?(HOMEBREW_PREFIX/\"bin\")\n      pths = pths.insert(0, HOMEBREW_PREFIX/\"bin\")\n    end\n\n    # set install's lib/python#{py_ver}/site-packages first, so app will work if unlinked\n    pypths = %W[#{qgis_python_packages} #{qgis_site_packages} #{pypth}]\n\n    pths.insert(0, \"#{gdal_opt_bin}\")\n    pths.insert(0, \"#{gdal_python_opt_bin}\")\n    pypths.insert(0, \"#{gdal_python_packages}\")\n\n    # prepend qt based utils to PATH (reverse order)\n    pths.insert(0, \"#{Formula[\"qca\"].opt_bin}\")\n    pths.insert(0, \"#{Formula[\"osgeo-pyqt\"].opt_bin}\")\n    pths.insert(0, \"#{Formula[\"osgeo-sip\"].opt_bin}\")\n    pths.insert(0, \"#{Formula[\"qt\"].opt_bin}\")\n\n    pths.insert(0, \"#{Formula[\"gpsbabel\"].opt_bin}\")\n\n    # we need to manually add the saga lts path, since it's keg only\n    pths.insert(0, \"#{Formula[\"osgeo-saga-lts\"].opt_bin}\")\n\n    envars = {\n      :PATH => pths.join(pthsep),\n      :QGIS_BUNDLE => \"#{opt_prefix}/QGIS.app/Contents\",\n      :QGIS_PREFIX_PATH => \"#{opt_prefix}/QGIS.app/Contents/MacOS\",\n      :GDAL_DRIVER_PATH => \"#{HOMEBREW_PREFIX}/lib/gdalplugins\",\n      :GDAL_DATA => \"#{Formula[\"osgeo-gdal\"].opt_share}/gdal\",\n      :CHECK_DISK_FREE_SPACE => \"FALSE\",\n      :PYTHONPATH => pypths.join(pthsep),\n      # if it is set, grass it will not work correctly, using Python 2\n      # it will be necessary to wait until it is built with Python 3\n      # :PYTHONHOME =>  \"#{Formula[\"python\"].opt_frameworks}/Python.framework/Versions/#{py_ver}\",\n    }\n\n    # handle multiple Qt plugins directories\n    qtplgpths = %W[\n      #{opt_lib}/qt/plugins\n      #{Formula[\"qt\"].opt_prefix}/plugins\n      #{HOMEBREW_PREFIX}/lib/qt/plugins\n    ]\n    envars[:QT_PLUGIN_PATH] = qtplgpths.join(pthsep)\n    envars[:QT_AUTO_SCREEN_SCALE_FACTOR] = \"1\"\n    # https://github.com/OSGeo/homebrew-osgeo4mac/issues/447\n    # envars[:QT_AUTO_SCREEN_SCALE_FACTOR] = \"0\"\n    # envars[:QT_DEVICE_PIXEL_RATIO] = \"1\"\n\n    proc_plugins = \"#{app}/Contents/Resources/python/plugins\"\n    proc_plugins_algs = \"#{proc_plugins}/processing/algs\"\n\n    # for core integration plugin support\n\n    # grass\n    grass = Formula[\"osgeo-grass\"]\n    grass_version = \"#{grass.version}\"\n    envars[:GRASS_PREFIX] = \"#{grass.opt_prefix}/grass-base\"\n    envars[:GRASS_SH] = \"/bin/sh\"\n    envars[:GRASS_PROJSHARE] = \"#{Formula[\"osgeo-proj\"].opt_share}\"\n    envars[:GRASS_VERSION] = \"#{grass_version}\"\n    envars[:GRASS_LD_LIBRARY_PATH] = \"#{grass.opt_prefix}/grass#{majmin_ver}/lib\"\n    # envars[:GRASS_PERL] = \"#{Formula[\"perl\"].opt_bin}/perl\"\n    envars[:PROJ_LIB] = \"#{Formula[\"osgeo-proj\"].opt_lib}\"\n    envars[:GEOTIFF_CSV] = \"#{Formula[\"osgeo-libgeotiff\"].opt_share}/epsg_csv\"\n    # envars[:R_HOME] = \"#{Formula[\"r\"].opt_bin}/R\"\n    # envars[:R_HOME] = \"/Applications/RStudio.app/Contents/MacOS/RStudio\"\n    # envars[:R_USER] = \"USER_PROFILE/Documents\"\n    begin\n      inreplace \"#{proc_plugins_algs}/grass7/Grass7Utils.py\",\n                \"'/Applications/GRASS-7.{}.app/Contents/MacOS'.format(version)\",\n                \"'#{grass.opt_prefix}/grass-base'\"\n      puts \"GRASS 7 GrassUtils.py has been updated\"\n      rescue Utils::InreplaceError\n      puts \"GRASS 7 GrassUtils.py already updated\"\n    end\n\n    # OTB is available from branch_3.8\n    # unless build.head?\n    #   orfeo = Formula[\"osgeo-orfeo\"]\n    #   # envars[:QGIS_PLUGINPATH] = \"#{orfeo.opt_prefix}\"\n    #   begin\n    #     inreplace \"#{proc_plugins}/otb/OTBUtils.py\" do |s|\n    #     # default geoid path\n    #     # try to replace first, so it fails (if already done) before global replaces\n    #     s.sub! \"OTB_FOLDER\", \"#{orfeo.opt_prefix}\"\n    #     s.sub! \"OTB_APP_FOLDER\", \"#{orfeo.opt_lib}/otb/applications\"\n    #     s.sub! \"OTB_GEOID_FILE\", \"#{orfeo.opt_libexec}/default_geoid/egm96.grd\"\n    #     end\n    #     puts \"ORFEO 6 OTBUtils.py has been updated\"\n    #     rescue Utils::InreplaceError\n    #     puts \"ORFEO 6 OTBUtils.py already updated\"\n    #   end\n    # end\n\n    # R\n    # Remove setting to activate provider\n    # See: https://github.com/north-road/qgis-processing-r/commit/7d8d182962392297690c02f77829b8cd64b5e8a9#diff-ce2ac984448f961cfa0f7e446bdbd4ca\n    # begin\n    #   inreplace \"#{proc_plugins}/processing_r/processing/provider.py\" do |s|\n    #   s.gsub! \"'Activate'), False))\", \"'Activate'), True))\"\n    #   end\n    #   puts \"R RAlgorithmProvider.py has been updated\"\n    #   rescue Utils::InreplaceError\n    #   puts \"R provider.py already updated\"\n    # end\n\n    # WhiteboxTools\n    begin\n      whitebox=\"#{Formula[\"osgeo-whitebox-tools\"].opt_bin}/whitebox_tools\"\n      inreplace \"#{proc_plugins}/processing_whitebox/whiteboxProvider.py\" do |s|\n      s.gsub! \"/usr/local/opt/whitebox-tools/bin/whitebox_tools\", \"#{whitebox}\"\n      end\n      puts \"Whitebox Tools whiteboxProvider.py has been updated\"\n      rescue Utils::InreplaceError\n      puts \"Whitebox Tools whiteboxProvider.py already updated\"\n    end\n\n    # TauDEM\n    begin\n      taudem=\"#{Formula[\"osgeo-taudem\"].opt_bin}\"\n      mpich=\"#{Formula[\"open-mpi\"].opt_bin}\"\n      inreplace \"#{proc_plugins}/processing_taudem/taudemProvider.py\" do |s|\n      s.gsub! \"/usr/local/opt/taudem/bin\", \"#{taudem}\"\n      s.gsub! \"/usr/local/opt/open-mpi/bin\", \"#{mpich}\"\n      end\n      puts \"TauDEM taudemProvider.py and has been updated\"\n      rescue Utils::InreplaceError\n      puts \"TauDEM taudemProvider.py already updated\"\n    end\n\n    # LASTools\n    begin\n      lastools=\"#{Formula[\"osgeo-lastools\"].opt_prefix}\"\n      inreplace \"#{proc_plugins}/lastools/LAStoolsProvider.py\" do |s|\n      s.gsub! 'C:\\LAStools', \"#{lastools}\"\n      end\n      puts \"LAStools LAStoolsProvider.py has been updated\"\n      rescue Utils::InreplaceError\n      puts \"LAStools LAStoolsProvider.py already updated\"\n    end\n\n    unless opts.include?(\"without-globe\")\n      osg = Formula[\"osgeo-openscenegraph\"]\n      envars[:OSG_LIBRARY_PATH] = \"#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}\"\n    end\n\n    if opts.include?(\"with-isolation\")\n      envars[:DYLD_FRAMEWORK_PATH] = \"#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks\"\n      versioned = %W[\n        #{Formula[\"sqlite\"].opt_lib}\n        #{Formula[\"expat\"].opt_lib}\n        #{Formula[\"libxml2\"].opt_lib}\n        #{HOMEBREW_PREFIX}/lib\n      ]\n      envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep)\n    end\n\n    # TODO: add for Py3\n    if opts.include?(\"with-isolation\") || File.exist?(\"/Library/Frameworks/GDAL.framework\")\n      envars[:PYQGIS_STARTUP] = opt_libexec/\"pyqgis_startup.py\"\n    end\n\n    # envars.each { |key, value| puts \"#{key.to_s}=#{value}\" }\n    # exit\n\n    # add env vars to QGIS.app's Info.plist, in LSEnvironment section\n    plst = app/\"Contents/Info.plist\"\n    # first delete any LSEnvironment setting, ignoring errors\n    # CAUTION!: may not be what you want, if .app already has LSEnvironment settings\n    dflt = `defaults read-type \\\"#{plst}\\\" LSEnvironment 2> /dev/null`\n    `defaults delete \\\"#{plst}\\\" LSEnvironment` if dflt\n    kv = \"{ \"\n    envars.each { |key, value| kv += \"'#{key}' = '#{value}'; \" }\n    kv += \"}\"\n    `defaults write \\\"#{plst}\\\" LSEnvironment \\\"#{kv}\\\"`\n    # add ability to toggle high resolution in Get Info dialog for app\n    hrc = `defaults read-type \\\"#{plst}\\\" NSHighResolutionCapable 2> /dev/null`\n    `defaults delete \\\"#{plst}\\\" NSHighResolutionCapable` if hrc\n    `defaults write \\\"#{plst}\\\" NSHighResolutionCapable \\\"True\\\"`\n    # leave the plist readable; convert from binary to XML format\n    `plutil -convert xml1 -- \\\"#{plst}\\\"`\n    # make sure plist is readble by all users\n    plst.chmod 0644\n    # update modification date on app bundle, or changes won't take effect\n    touch app.to_s\n\n    # add env vars to launch script for QGIS app's binary\n    qgis_bin = bin/name.to_s\n    rm_f qgis_bin if File.exist?(qgis_bin) # install generates empty file\n    bin_cmds = %W[#!/bin/sh\\n]\n    # setup shell-prepended env vars (may result in duplication of paths)\n    unless pths.include? HOMEBREW_PREFIX/\"bin\"\n      pths.insert(0, HOMEBREW_PREFIX/\"bin\")\n    end\n    # even though this should be affected by with-isolation, allow local env override\n    pths << \"$PATH\"\n    pypths << \"$PYTHONPATH\"\n    envars[:PATH] = pths.join(pthsep)\n    envars[:PYTHONPATH] = pypths.join(pthsep)\n    envars.each { |key, value| bin_cmds << \"export #{key}=#{value}\" }\n    bin_cmds << opt_prefix/\"QGIS.app/Contents/MacOS/QGIS \\\"$@\\\"\"\n    qgis_bin.write(bin_cmds.join(\"\\n\"))\n    qgis_bin.chmod 0755\n\n    # link python modules\n    (prefix/\"QGIS.app/Contents/Resources/python\").install_symlink Dir[\"#{Formula[\"osgeo-qgis-res\"].opt_libexec}/vendor/lib/python#{py_ver}/site-packages/*\"]\n    (prefix/\"QGIS.app/Contents/Resources/python/PyQt5\").install_symlink Dir[\"#{Formula[\"osgeo-sip\"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*\"]\n    ln_s \"#{Formula[\"osgeo-sip\"].opt_lib}/python#{py_ver}/site-packages/sipconfig.py\", \"#{prefix}/QGIS.app/Contents/Resources/python/sipconfig.py\"\n    ln_s \"#{Formula[\"osgeo-sip\"].opt_lib}/python#{py_ver}/site-packages/sipdistutils.py\", \"#{prefix}/QGIS.app/Contents/Resources/python/sipdistutils.py\"\n    (prefix/\"QGIS.app/Contents/Resources/python/PyQt5\").install_symlink Dir[\"#{Formula[\"osgeo-pyqt\"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*\"]\n    (prefix/\"QGIS.app/Contents/Resources/python/PyQt5\").install_symlink Dir[\"#{Formula[\"osgeo-pyqt-webkit\"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*\"]\n    (prefix/\"QGIS.app/Contents/Resources/python/PyQt5\").install_symlink Dir[\"#{Formula[\"osgeo-qscintilla2\"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*\"]\n    # (prefix/\"QGIS.app/Contents/Resources/python\").install_symlink Dir[\"#{Formula[\"osgeo-matplotlib\"].opt_lib}/python#{py_ver}/site-packages/*\"]\n    # (prefix/\"QGIS.app/Contents/Resources/python\").install_symlink Dir[\"#{Formula[\"numpy\"].opt_lib}/python#{py_ver}/site-packages/*\"]\n    # (prefix/\"QGIS.app/Contents/Resources/python\").install_symlink Dir[\"#{Formula[\"scipy\"].opt_lib}/python#{py_ver}/site-packages/*\"]\n    (prefix/\"QGIS.app/Contents/Resources/python\").install_symlink Dir[\"#{Formula[\"osgeo-gdal-python\"].opt_lib}/python#{py_ver}/site-packages/*\"]\n\n    # fix ImportError: No module named site for gdal_*.py\n    mkdir \"#{prefix}/QGIS.app/Contents/MacOS/bin\"\n    (prefix/\"QGIS.app/Contents/MacOS/bin\").install_symlink Dir[\"#{Formula[\"osgeo-gdal-python\"].opt_bin}/*\"]\n    (prefix/\"QGIS.app/Contents/MacOS/bin\").install_symlink Dir[\"#{Formula[\"osgeo-gdal\"].opt_bin}/*\"]\n    (prefix/\"QGIS.app/Contents/Frameworks\").install_symlink Dir[\"#{Formula[\"qt\"].opt_frameworks}/*\"]\n    (prefix/\"QGIS.app/Contents/Frameworks\").install_symlink Dir[\"#{Formula[\"python\"].opt_frameworks}/*\"]\n\n    ln_s \"#{prefix}/QGIS.app/Contents/MacOS/lib\", \"#{prefix}/QGIS.app/Contents/MacOS/bin\"\n    ln_s \"#{prefix}/QGIS.app/Contents/Frameworks\", \"#{prefix}/QGIS.app/Contents/MacOS\"\n    ln_s \"#{Formula[\"python\"].opt_bin}/python#{py_ver}\", \"#{prefix}/QGIS.app/Contents/MacOS/bin/python3\"\n    ln_s \"#{Formula[\"python\"].opt_bin}/python#{py_ver}\", \"#{prefix}/QGIS.app/Contents/MacOS/bin/python\"\n  end\n\n  def caveats\n    s = <<~EOS\n      \\nQGIS is built as an application bundle. Environment variables for the\n      Homebrew prefix are embedded in \\e[32mQGIS.app\\e[0m:\n\n        \\e[32m#{opt_prefix}/QGIS.app\\e[0m\n\n      You may also symlink \\e[32mQGIS.app\\e[0m into \\e[32m/Applications\\e[0m or \\e[32m~/Applications\\e[0m:\n\n        \\e[32mln -Fs `find $(brew --prefix) -name \"QGIS.app\"` /Applications/QGIS.app\\e[0m\n\n      To directly run the \\e[32m`QGIS.app/Contents/MacOS/QGIS`\\e[0m binary use the wrapper\n      script pre-defined with Homebrew prefix environment variables:\n\n        \\e[32m#{opt_bin}/#{name}\\e[0m\n\n      If you need QGIS to appear in Spotlight, create and run the following script:\n\n        \\e[32m#!/usr/bin/env bash\\e[0m\n\n        \\e[32mqgis_location=$(find $(brew --prefix)/Cellar/osgeo-qgis/ -name \"3.*\" -print -quit)/QGIS.app\\e[0m\n        \\e[32mosascript -e 'tell application \"Finder\"' -e 'make new alias to file (posix file \"'$qgis_location'\") at (posix file \"/Applications\")' -e 'end tell'\\e[0m\n\n        https://github.com/OSGeo/homebrew-osgeo4mac/issues/607#issuecomment-455905926\n\n      NOTE: Your current PATH and PYTHONPATH environment variables are honored\n            when launching via the wrapper script, while launching \\e[32mQGIS.app\\e[0m\n            bundle they are not.\n\n      For standalone Python 3 development, set the following environment variable:\n\n        \\e[32mexport PYTHONPATH=#{python_site_packages}:#{qgis_site_packages}:#{qgis_python_packages}:#{gdal_python_packages}:$PYTHONPATH\\e[0m\n\n    EOS\n\n    if build.with?(\"isolation\")\n      s += <<~EOS\n        \\033[31mQGIS built with isolation enabled. This allows it to coexist with other types of installations\n        of QGIS on your Mac. However, on versions >= 2.0.1, this also means Python modules installed in the\n        *system* Python will NOT be available to Python processes within QGIS.app.\\e[0m\n\n      EOS\n    end\n\n    s += <<~EOS\n\n      You installed LAStools!\n\n      If you will use Wine to have more features:\n\n      \\n1 - Download \\e[32mhttp://lastools.org/download/LAStools.zip\\e[0m and unzip LASTools.\n          Remember where you unzipped it.\n\n      2 - Start QGIS. Select \\e[32mProcessing/Options.\\e[0m\n          In the Providers section scroll to “LASTools”\n\n          \\033[31mLASTools folder:\\e[0m \\e[32mLASTools directory\\e[0m (unzipped)\n          \\033[31mWine Folder:\\e[0m \\e[32m#{Formula[\"wine\"].opt_bin}\\e[0m\\n\n    EOS\n\n    s += <<~EOS\n      If you have built GRASS 7 for the Processing plugin set the following in QGIS\n\n        \\e[32mProcessing -> Options: Providers -> GRASS GIS 7 commands -> GRASS 7 folder\\e[0m\n\n        to \\e[32m#{HOMEBREW_PREFIX}/opt/osgeo-grass/grass-base\\e[0m\n\n    EOS\n\n    s += <<~EOS\n      QGIS plugins may need extra Python modules to function. Most can be installed\n      with \\e[32mpip\\e[0m in a Terminal:\n\n          \\e[32mpip3 install modulename\\e[0m\n\n      If you want to upgrade modules, add the \\e[32m-U\\e[0m option:\n\n          \\e[32mpip3 install -U modulename\\e[0m\n\n    EOS\n\n    s += <<~EOS\n\n      Activate plugins\n\n        \\e[32mManage and Install Plugins -> Installed ->  Plugin name\\e[0m (click its checkbox)\n\n    EOS\n    s\n  end\n\n  test do\n    output = `#{bin}/#{name.to_s} --help 2>&1` # why does help go to stderr?\n    assert_match /^QGIS is a user friendly/, output\n  end\n\n  private\n\n  def majmin_ver\n    grass_version = \"#{Formula[\"osgeo-grass\"].version}\"\n    ver_split = grass_version.to_s.split(\".\")\n    ver_split[0] + ver_split[1]\n  end\n\n  # def brewed_openscenegraph?\n  #   Formula[\"osgeo-openscenegraph\"].opt_prefix.exist?\n  # end\n\n  # def brewed_osgqt?\n  #   Formula[\"osgeo-osgqt\"].opt_prefix.exist?\n  # end\n\n  # def brewed_osgearth?\n  #   Formula[\"osgeo-osgearth\"].opt_prefix.exist?\n  # end\n\n  def brewed_oracle?\n    Formula[\"osgeo-oracle-client-sdk\"].opt_prefix.exist?\n  end\n\n  def brewed_python?\n    Formula[\"python\"].linked_keg.exist?\n  end\n\n  def python_exec\n    if brewed_python?\n      \"#{Formula[\"python\"].opt_bin}/python3\"\n    else\n      py_exec = `which python3`.strip\n      raise if py_exec == \"\"\n      py_exec\n    end\n  end\n\n  def py_ver\n    `#{python_exec} -c 'import sys;print(\"{0}.{1}\".format(sys.version_info[0],sys.version_info[1]))'`.strip\n  end\n\n  def python_prefix\n    `#{python_exec} -c 'import sys;print(sys.prefix)'`.strip\n  end\n\n  def qgis_python_packages\n    \"#{opt_prefix}/QGIS.app/Contents/Resources/python\"\n  end\n\n  def qgis_site_packages\n    \"#{opt_lib}/python#{py_ver}/site-packages\"\n  end\n\n  def python_site_packages\n    \"#{HOMEBREW_PREFIX}/opt/lib/python#{py_ver}/site-packages\"\n  end\n\n  def gdal_python_packages\n    \"#{Formula[\"osgeo-gdal-python\"].opt_lib}/python#{py_ver}/site-packages\"\n  end\n\n  def gdal_python_opt_bin\n    \"#{Formula[\"osgeo-gdal-python\"].opt_bin}\"\n  end\n\n  def gdal_opt_bin\n    \"#{Formula[\"osgeo-gdal\"].opt_bin}\"\n  end\nend\n\n__END__\n\n--- a/cmake/FindQsci.cmake\n+++ b/cmake/FindQsci.cmake\n@@ -21,16 +21,20 @@\n   SET(QSCI_FOUND TRUE)\n ELSE(EXISTS QSCI_MOD_VERSION_STR)\n\n-  FIND_FILE(_find_qsci_py FindQsci.py PATHS ${CMAKE_MODULE_PATH})\n+  # FIND_FILE(_find_qsci_py FindQsci.py PATHS ${CMAKE_MODULE_PATH})\n\n   SET(QSCI_VER 5)\n\n-  EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_qsci_py} ${QSCI_VER} OUTPUT_VARIABLE qsci_ver)\n+  # EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_qsci_py} ${QSCI_VER} OUTPUT_VARIABLE qsci_ver)\n\n   IF(qsci_ver)\n     STRING(REGEX REPLACE \"^qsci_version_str:([^\\n]+).*$\" \"\\\\1\" QSCI_MOD_VERSION_STR ${qsci_ver})\n     SET(QSCI_FOUND TRUE)\n   ENDIF(qsci_ver)\n+\n+  SET(QSCI_FOUND TRUE)\n+  SET(QSCI_MOD_VERSION_STR 2.11.1)\n+\n\n   IF(QSCI_FOUND)\n     FIND_PATH(QSCI_SIP_DIR\n\n--- a/cmake/FindPyQt5.py\n+++ b/cmake/FindPyQt5.py\n@@ -39,7 +39,7 @@\n     import os.path\n     import sys\n     cfg = sipconfig.Configuration()\n-    sip_dir = cfg.default_sip_dir\n+    sip_dir = \"HOMEBREW_PREFIX/share/sip\"\n     if sys.platform.startswith('freebsd'):\n         py_version = str(sys.version_info.major) + str(sys.version_info.minor)\n         sip_dir = sip_dir.replace(py_version, '')\n\n--- a/cmake/FindPyQt5.cmake\n+++ b/cmake/FindPyQt5.cmake\n@@ -37,9 +37,7 @@\n     STRING(REGEX REPLACE \".*\\npyqt_version_num:([^\\n]+).*$\" \"\\\\1\" PYQT5_VERSION_NUM ${pyqt_config})\n     STRING(REGEX REPLACE \".*\\npyqt_mod_dir:([^\\n]+).*$\" \"\\\\1\" PYQT5_MOD_DIR ${pyqt_config})\n     STRING(REGEX REPLACE \".*\\npyqt_sip_dir:([^\\n]+).*$\" \"\\\\1\" PYQT5_SIP_DIR ${pyqt_config})\n-    IF(EXISTS ${PYQT5_SIP_DIR}/Qt5)\n-      SET(PYQT5_SIP_DIR ${PYQT5_SIP_DIR}/Qt5)\n-    ENDIF(EXISTS ${PYQT5_SIP_DIR}/Qt5)\n+    SET(PYQT5_SIP_DIR ${PYQT5_SIP_DIR})\n     STRING(REGEX REPLACE \".*\\npyqt_sip_flags:([^\\n]+).*$\" \"\\\\1\" PYQT5_SIP_FLAGS ${pyqt_config})\n     STRING(REGEX REPLACE \".*\\npyqt_bin_dir:([^\\n]+).*$\" \"\\\\1\" PYQT5_BIN_DIR ${pyqt_config})\n     STRING(REGEX REPLACE \".*\\npyqt_sip_module:([^\\n]+).*$\" \"\\\\1\" PYQT5_SIP_IMPORT ${pyqt_config})\n\n\n--- a/src/app/qgisapp.cpp\n+++ b/src/app/qgisapp.cpp\n@@ -509,7 +509,7 @@\n   if ( QgsProject::instance()->isDirty() )\n     caption.prepend( '*' );\n\n-  caption += QgisApp::tr( \"QGIS\" );\n+  caption += QgisApp::tr( \"OSGeo4Mac - QGIS\" );\n\n   if ( Qgis::QGIS_VERSION.endsWith( QLatin1String( \"Master\" ) ) )\n   {\n\n\n--- a/src/ui/qgsabout.ui\n+++ b/src/ui/qgsabout.ui\n@@ -244,6 +244,16 @@\n               </size>\n              </property>\n             </spacer>\n+           </item>\n+           <item>\n+            <widget class=\"QLabel\" name=\"label_osgeo\">\n+             <property name=\"text\">\n+              <string>OSGeo4Mac Team / Maintainer: @fjperini - Collaborator: @luispuerto</string>\n+             </property>\n+             <property name=\"alignment\">\n+              <set>Qt::AlignCenter</set>\n+             </property>\n+            </widget>\n            </item>\n            <item>\n             <widget class=\"QLabel\" name=\"label_3\">\n"
  },
  {
    "path": "boneyard/osgeo-qgis-res.rb",
    "content": "################################################################################\n# Maintainer: FJ Perini @fjperini\n# Collaborator: Luis Puerto @luispuerto\n################################################################################\n\nclass OsgeoQgisRes < Formula\n  include Language::Python::Virtualenv\n  desc \"Resources for QGIS\"\n  homepage \"https://www.qgis.org\"\n  url \"https://gist.githubusercontent.com/dakcarto/11385561/raw/e49f75ecec96ed7d6d3950f45ad3f30fe94d4fb2/pyqgis_startup.py\"\n  sha256 \"385dce925fc2d29f05afd6508bc1f46ec84c0bc607cc0c8dfce78a4bb93b9c4e\"\n  version \"3.8.0\"\n\n  # revision 1\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"8e9ab749b7f1aa6d8e423803ac837038cc46c1c63e9b5c6581fa80068a7fc0c4\" => :mojave\n    sha256 \"8e9ab749b7f1aa6d8e423803ac837038cc46c1c63e9b5c6581fa80068a7fc0c4\" => :high_sierra\n    sha256 \"550e3697860fc778b23e93b38246da65181afef57872f4616e11ee29cb38be7c\" => :sierra\n  end\n\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n\n  depends_on \"pkg-config\" => :build\n  depends_on \"gcc\" => :build # for gfortran # numpy\n  depends_on \"python\" => :build\n  depends_on \"swig\" => :build\n  depends_on \"lapack\"\n  depends_on \"openblas\"\n  depends_on \"cython\"\n  depends_on \"libyaml\" # yaml\n  depends_on \"tcl-tk\" # six\n  depends_on \"openjpeg\" # for Pillow\n  depends_on \"zlib\" # for Pillow\n  depends_on \"freetype\"\n\n  depends_on \"dbus\"\n  depends_on \"glib\"\n  depends_on \"qt\"\n  depends_on \"osgeo-pyqt\"\n\n  # psycopg2\n  if build.with?(\"pg10\")\n    depends_on \"osgeo-postgresql@10\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  depends_on \"swig\"\n  depends_on \"libagg\"\n  depends_on \"libpng\"\n  depends_on \"openssl\"\n  depends_on \"libssh\"\n  depends_on \"qhull\"\n  depends_on \"ghostscript\"\n  depends_on \"cairo\"\n  depends_on \"py3cairo\"\n  depends_on \"libsvg-cairo\"\n  depends_on \"librsvg\"\n  depends_on \"svg2pdf\"\n  depends_on \"gtk+3\"\n  depends_on \"pygobject3\"\n  depends_on \"pygobject\"\n  depends_on \"pygtk\"\n  depends_on \"wxpython\"\n  depends_on \"ffmpeg\"\n  depends_on \"imagemagick\"\n\n  depends_on \"numpy\"\n  depends_on \"scipy\"\n  depends_on \"osgeo-matplotlib\"\n\n  depends_on \"osgeo-gdal-python\" # osgeo-gdal: for Fiona\n  depends_on \"spatialindex\" # for Rtree\n  depends_on \"hdf5\" # for h5py\n  depends_on \"unixodbc\" # for pyodbc\n  depends_on \"pyside\" # for pyqtgraph / required llvm\n  depends_on \"freetds\" # for pymssql\n\n  # R with more support\n  # https://github.com/adamhsparks/setup_macOS_for_R\n  # rpy2 requires finding R\n  # unless Formula[\"sethrfore/r-srf/r\"].linked_keg.exist?\n  depends_on \"r\"\n  # end\n\n  # for rpy2\n  depends_on \"gettext\"\n  depends_on \"readline\"\n  depends_on \"pcre\"\n  depends_on \"xz\"\n  depends_on \"bzip2\"\n  depends_on \"libiconv\"\n  depends_on \"icu4c\"\n\n  # pyqgis_startup.py\n  # TODO: add one for Py3 (only necessary when macOS ships a Python3 or 3rd-party isolation is needed)\n\n  # resource \"pyproj\" do\n  #   url \"https://files.pythonhosted.org/packages/93/48/956b9dcdddfcedb1705839280e02cbfeb2861ed5d7f59241210530867d5b/numpy-1.16.3.zip\"\n  #   sha256 \"78a6f89da87eeb48014ec652a65c4ffde370c036d780a995edaeb121d3625621\"\n  # end\n\n  resource \"numpy\" do\n    url \"https://files.pythonhosted.org/packages/93/48/956b9dcdddfcedb1705839280e02cbfeb2861ed5d7f59241210530867d5b/numpy-1.16.3.zip\"\n    sha256 \"78a6f89da87eeb48014ec652a65c4ffde370c036d780a995edaeb121d3625621\"\n  end\n\n  resource \"scipy\" do\n    url \"https://files.pythonhosted.org/packages/cb/97/361c8c6ceb3eb765371a702ea873ff2fe112fa40073e7d2b8199db8eb56e/scipy-1.3.0.tar.gz\"\n    sha256 \"c3bb4bd2aca82fb498247deeac12265921fe231502a6bc6edea3ee7fe6c40a7a\"\n  end\n\n  resource \"matplotlib\" do\n    url \"https://files.pythonhosted.org/packages/26/04/8b381d5b166508cc258632b225adbafec49bbe69aa9a4fa1f1b461428313/matplotlib-3.0.3.tar.gz\"\n    sha256 \"e1d33589e32f482d0a7d1957bf473d43341115d40d33f578dad44432e47df7b7\"\n  end\n\n  def install\n    # install python environment\n    venv = virtualenv_create(libexec/'vendor', \"#{Formula[\"python\"].opt_bin}/python3\")\n\n    py_ver = Language::Python.major_minor_version \"#{libexec}/vendor/bin/python3\"\n\n    # fix pip._vendor.pep517.wrappers.BackendUnavailable  // use pip<19.0.0\n    system libexec/\"vendor/bin/pip3\", \"install\", \"--upgrade\", \"-v\", \"setuptools\", \"pip\", \"wheel\"\n\n    res_r = ['rpy2', 'sphinxcontrib-websupport']\n\n    res_r.each do |r|\n      venv.pip_install r\n    end\n\n    # fix ModuleNotFoundError: No module named 'pip.req'\n    system libexec/\"vendor/bin/pip3\", \"install\", \"--upgrade\", \"-v\", \"setuptools\", \"pip==9.0.3\", \"wheel\"\n    venv.pip_install \"pyRscript\"\n\n    # fix pip._vendor.pep517.wrappers.BackendUnavailable\n    system libexec/\"vendor/bin/pip3\", \"install\", \"--upgrade\", \"-v\", \"setuptools\", \"pip<19.0.0\", \"wheel\"\n\n    res_required = ['requests', 'six', 'future', 'Sphinx', 'setuptools-scm', 'chardet', 'idna', 'urllib3', 'PySocks', 'Pillow', 'cycler', \\\n      'kiwisolver', 'tornado', 'Unidecode', 'pyparsing', 'MarkupSafe', 'nose', 'Cython', 'python-dateutil', 'pytz', 'Jinja2', 'OWSLib', \\\n      'psycopg2', 'Pygments', 'PyYAML', \"dbus-python\", \"PyOpenGL\", 'certifi', 'funcsigs', 'coverage', 'mock', 'pbr', 'termcolor', 'oauthlib', 'pyOpenSSL', 'httplib2']\n\n    res_required.each do |r|\n        venv.pip_install r\n    end\n\n    resource(\"numpy\").stage do\n      openblas = Formula[\"openblas\"].opt_prefix\n      ENV[\"ATLAS\"] = \"None\" # avoid linking against Accelerate.framework\n      ENV[\"BLAS\"] = ENV[\"LAPACK\"] = \"#{openblas}/lib/libopenblas.dylib\"\n\n      config = <<~EOS\n        [openblas]\n        libraries = openblas\n        library_dirs = #{openblas}/lib\n        include_dirs = #{openblas}/include\n      EOS\n\n      Pathname(\"site.cfg\").write config\n\n      system \"#{libexec}/vendor/bin/python3\", \"setup.py\",\n        \"build\", \"--fcompiler=gnu95\", \"--parallel=#{ENV.make_jobs}\",\n        \"install\", \"--prefix=#{libexec}/vendor\",\n        \"--single-version-externally-managed\", \"--record=installed.txt\"\n    end\n\n    resource(\"scipy\").stage do\n      openblas = Formula[\"openblas\"].opt_prefix\n      ENV[\"ATLAS\"] = \"None\" # avoid linking against Accelerate.framework\n      ENV[\"BLAS\"] = ENV[\"LAPACK\"] = \"#{openblas}/lib/libopenblas.dylib\"\n\n      config = <<~EOS\n        [DEFAULT]\n        library_dirs = #{HOMEBREW_PREFIX}/lib\n        include_dirs = #{HOMEBREW_PREFIX}/include\n        [openblas]\n        libraries = openblas\n        library_dirs = #{openblas}/lib\n        include_dirs = #{openblas}/include\n      EOS\n\n      Pathname(\"site.cfg\").write config\n\n      system \"#{libexec}/vendor/bin/python3\", \"setup.py\",\n        \"build\", \"--fcompiler=gnu95\",\n        \"install\", \"--prefix=#{libexec}/vendor\"\n      # cleanup leftover .pyc files from previous installs which can cause problems\n      # see https://github.com/Homebrew/homebrew-python/issues/185#issuecomment-67534979\n      rm_f Dir[\"#{libexec}/vendor/lib/python*.*/site-packages/scipy/**/*.pyc\"]\n    end\n\n    resource(\"matplotlib\").stage do\n      if DevelopmentTools.clang_build_version >= 900\n        ENV.delete \"SDKROOT\"\n        ENV.delete \"HOMEBREW_SDKROOT\"\n      end\n\n      inreplace \"setupext.py\",\n                \"'darwin': ['/usr/local/'\",\n                \"'darwin': ['#{HOMEBREW_PREFIX}'\"\n\n      system \"#{libexec}/vendor/bin/python3\", \"setup.py\",\n        \"install\", \"--prefix=#{libexec}/vendor\"\n    end\n\n    res_optional = ['argparse', 'asn1crypto', 'atlas', 'backports.functools_lru_cache', 'beautifulsoup4', 'blosc', 'bottleneck', \\\n      'cffi', 'cryptography', 'decorator', 'descartes', 'ExifRead', 'Fiona', 'geopandas', 'geopy', 'geos', 'gitdb', 'gitdb2', 'GitPython', \\\n      'gnm', 'h5py', 'ipython', 'ipython_genutils', 'jsonschema', 'jupyter', 'jupyter_core', 'lidar', 'lxml', 'mpmath', 'nbformat', \\\n      'networkx', 'nltk', 'nose2', 'numexpr', 'olefile', 'openpyxl', 'palettable', 'pandas', 'pandas_oracle', 'pandas-datareader', 'pgi', \\\n      'plotly', 'ply', 'pubsub', 'py-postgresql', 'py2oracle', 'pycparser', 'pymssql', 'PyMySQL', 'pyodbc', 'PyPubSub', \\\n      'pyqtgraph', 'Pyro4', 'PySAL', 'pytest', 'pytils', 'qtpy', 'retrying', 'Rtree', 'seaborn', 'Shapely', 'simplejson', 'smmap', \\\n      'smmap2', 'sqlalchemy', 'statsmodels', 'subprocess32', 'sympy', 'test', 'tools', 'traitlets', 'whitebox', 'xlrd', 'xlsxwriter', 'xlwt']\n\n    # others: gmt-python, pytables\n    res_optional.each do |r|\n      venv.pip_install r\n    end\n\n    # 'scikit-learn': It seems that scikit-learn cannot be built with OpenMP support\n    # 'pyproj': version 2.0.0 supports & requires PROJ 6\n    system libexec/\"vendor/bin/pip3\", \"install\", \"--upgrade\", \"-v\", \"setuptools\", \"pip<19.0.0\", \"wheel\", \"scikit-learn==0.19.2\", \"pyproj==1.9.6\"\n\n    # upgrade pip\n    # system libexec/\"vendor/bin/pip3\", \"install\", \"--upgrade\", \"-v\", \"setuptools\", \"pip\", \"wheel\"\n\n    cp_r \"#{buildpath}/pyqgis_startup.py\", \"#{libexec}\"\n  end\n\n  def caveats\n      s = <<~EOS\n\n        This formula was created to have more Python modules and save time using the generated bottle.\n\n        It is not necessary to build each time a new version or revision of the QGIS formula is generated.\n\n        It will only be updated if necessary, although you can choose to update modules if you wish,\n\n        just remember that you will need to build QGIS again.\n\n      EOS\n    s\n  end\n\n  test do\n    #  TODO\n  end\nend\n"
  },
  {
    "path": "boneyard/osgeo-qgis.rb",
    "content": "################################################################################\n# Maintainer: FJ Perini @fjperini\n# Collaborator: Luis Puerto @luispuerto\n################################################################################\n\nclass UnlinkedQGIS < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !qt4_linked && !pyqt4_linked && !txt2tags_linked }\n\n  def qt4_linked\n    (Formula[\"qt-4\"].linked_keg/\"lib/QtCore.framework/Versions/4\").exist?\n  rescue\n    return false\n  end\n\n  def pyqt4_linked\n    (Formula[\"pyqt-qt4\"].linked_keg/\"lib/qt-4/python2.7/site-packages/PyQt4\").exist?\n  rescue\n    return false\n  end\n\n  def txt2tags_linked\n    Formula[\"txt2tags\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"Compilation can fail if these formulae are installed and linked:\\n\\n\"\n\n    s += \"Unlink with `brew unlink qt-4` or remove with `brew uninstall qt-4`\\n\" if qt4_linked\n    s += \"Unlink with `brew unlink pyqt-qt4` or remove with `brew uninstall pyqt-qt4`\\n\" if pyqt4_linked\n    s += \"Unlink with `brew unlink txt2tags` or remove with `brew uninstall txt2tags`\\n\" if txt2tags_linked\n    s\n  end\nend\n\nclass OsgeoQgis < Formula\n  desc \"Open Source Geographic Information System\"\n  homepage \"https://www.qgis.org\"\n  url \"https://github.com/qgis/QGIS/archive/final-3_8_0.tar.gz\"\n  sha256 \"f6db56b8cce8482933ec492b26376a2c62cb269cd1b722b374b6c828e35f258e\"\n  # version \"3.8.0\"\n\n  revision 1\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any\n    sha256 \"2a576d409659dee8a6033356b06962aee01782dd7a00240039bf15ba880ba227\" => :mojave\n    sha256 \"2a576d409659dee8a6033356b06962aee01782dd7a00240039bf15ba880ba227\" => :high_sierra\n    sha256 \"7c7b0b8c196a716380ed817749a519680487fd82ec472e7ac347e8fa41b3b824\" => :sierra\n  end\n\n  head \"https://github.com/qgis/QGIS.git\", :branch => \"master\"\n\n  # fix FindQsci and FindPyQt5\n  patch :DATA\n\n  def pour_bottle?\n    brewed_python?\n  end\n\n  option \"without-debug\", \"Disable debug build, which outputs info to system.log or console\"\n  option \"without-ninja\", \"Disable use of ninja CMake generator\"\n  option \"without-server\", \"Build without QGIS Server (qgis_mapserv.fcgi)\"\n  option \"without-postgresql\", \"Build without current PostgreSQL client\"\n  option \"without-pyqt5-webkit\", \"Build without webkit python bindings\"\n  option \"without-qgis-res\", \"Build without QGIS Resources support\"\n  option \"with-api-docs\", \"Build the API documentation with Doxygen and Graphviz\"\n  option \"with-isolation\", \"Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs\"\n  option \"with-mssql\", \"Build with Microsoft ODBC Driver for SQL Server\"\n  option \"with-oracle\", \"Build extra Oracle geospatial database and raster support\"\n  option \"with-pg10\", \"Build with PostgreSQL 10 client\"\n  # option \"with-globe\", \"Build with Globe plugin, based upon osgEarth\"\n\n  # Build with 3D Map View panel\n  # Build with GPSBabel. Read, write and manipulate GPS waypoints in a variety of formats\n  # Build with GRASS 7 integration plugin and Processing plugin support (or install grass-7x first)\n  # Build with LAStools, efficient tools for LiDAR processing. Contains LASlib, a C++ programming API for reading / writing LIDAR data stored in standard LAS format.\n  # Build extra Orfeo Toolbox for Processing plugin\n  # Build QSpatialite Qt database driver\n  # Build extra R for Processing plugin\n  # Build extra Saga GIS (LTS) for Processing plugin\n  # Build with QGIS Server (qgis_mapserv.fcgi)\n  # Build with TauDEM, Terrain Analysis Using Digital Elevation Models for hydrology\n  # Build with Whitebox Tools, an advanced geospatial data analysis platform\n\n  deprecated_option \"with-saga-gis-lts\" => \"with-saga\"\n  deprecated_option \"with-postgresql10\" => \"with-pg10\"\n\n  depends_on UnlinkedQGIS\n\n  # required\n  depends_on \"cmake\" => :build\n  depends_on \"ninja\" => [:build, :recommended]\n  depends_on \"gsl\" => :build # Georeferencer plugin\n  depends_on \"six\" => [:build, :recommended]\n  depends_on \"osgeo-sip\" => [:build, :recommended]\n  depends_on \"bison\" => :build\n  depends_on \"flex\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"python\"\n  depends_on \"osgeo-gdal-python\" # gdal - core providers\n  depends_on \"libzip\"\n  depends_on \"osgeo-qscintilla2\"\n  depends_on \"qca\"\n  depends_on \"qt\"\n  depends_on \"osgeo-pyqt\"\n  depends_on \"osgeo-pyqt-webkit\" # qt5-webkit\n  depends_on \"osgeo-qtkeychain\"\n  depends_on \"qwt\"\n  depends_on \"spatialindex\"\n  depends_on \"sqlite\"\n  depends_on \"expat\"\n  depends_on \"osgeo-proj\"\n  depends_on \"hdf5\"\n  depends_on \"geos\"\n  depends_on \"libtasn1\"\n  depends_on \"osgeo-libspatialite\"\n  depends_on \"qwtpolar\"\n  depends_on \"desktop-file-utils\"\n  depends_on \"hicolor-icon-theme\"\n\n  # recommended\n  depends_on \"openssl\"\n  depends_on \"qjson\"\n  depends_on \"unixodbc\"\n  # depends_on \"libiodbc\"\n  depends_on \"freetds\"\n  depends_on \"osgeo-psqlodbc\"\n  depends_on \"libpq\"\n  depends_on \"osgeo-postgis\"\n  depends_on \"exiv2\"\n  depends_on \"osgeo-liblas\"\n  depends_on \"osgeo-netcdf\"\n  depends_on \"osgeo-pdal\"\n  depends_on \"szip\"\n  depends_on \"openvpn\"\n  depends_on \"curl\"\n  depends_on \"libiconv\"\n  depends_on \"poppler\"\n  depends_on \"gnu-sed\"\n  depends_on \"git\"\n  depends_on \"libxml2\"\n  depends_on \"libffi\"\n\n  depends_on \"numpy\"\n  depends_on \"scipy\"\n  depends_on \"osgeo-matplotlib\"\n\n  if build.with?(\"api-docs\")\n    depends_on \"graphviz\" => :build\n    depends_on \"doxygen\" => :build\n  end\n\n  # requires python modules\n  # jinja - MetaSearch\n  # numpy - Processing\n  # owslib - MetaSearch\n  # psycopg2 - DB Manager and Processing\n  # pygments - MetaSearch\n  # yaml - Processing\n  # many useful modules are incorporated\n  depends_on \"osgeo-qgis-res\"\n\n  # fcgi - server\n  depends_on \"fcgi\"\n  depends_on \"spawn-fcgi\"\n  depends_on \"lighttpd\"\n\n  # core plugins (c++ and python\n\n  # grass\n  depends_on \"osgeo-grass\"\n  depends_on \"gettext\"\n\n  depends_on \"gpsbabel\" # GPS Tools plugin\n\n  # the Globe Plugin for QGIS 3 is still not available,\n  # only for QGIS 2 and it does not support a larger version than OSGearh v2.7.\n  # working on the implementation\n  # if build.with? \"globe\"\n  #   depends_on \"osgeo-openscenegraph\"\n  #   depends_on \"osgeo-osgqt\"\n  #   depends_on \"osgeo-osgearth\"\n  # end\n\n  # TODO: remove \"pyspatialite\" when PyPi package supports spatialite 4.x\n  #       or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite)\n  # TODO: what to do for Py3 and pyspatialite?\n  depends_on \"osgeo-pyspatialite\" # for DB Manager\n\n  # use newer postgresql client than Apple's, also needed by `psycopg2`\n  if build.with?(\"pg10\")\n    depends_on \"osgeo-postgresql@10\"\n  else\n    depends_on \"osgeo-postgresql\"\n  end\n\n  depends_on \"osgeo-oracle-client-sdk\" if build.with?(\"oracle\")\n\n  # TODO: add MSSQL third-party support formula?, :optional\n  if build.with?(\"mssql\")\n    depends_on \"microsoft/mssql-release/msodbcsql17\"\n    depends_on \"microsoft/mssql-release/mssql-tools\"\n  end\n\n  depends_on \"osgeo-qt-psql\"\n  depends_on \"osgeo-qt-odbc\"\n  depends_on \"osgeo-qt-mysql\" # for eVis plugin\n  # depends_on \"osgeo-qt-tds\" # obsolete from Qt 4.7\n  # depends_on \"osgeo-qt-oci\" # from oracle-client-sdk?\n\n  # core processing plugin extras\n  # see `grass` above\n  depends_on \"osgeo-orfeo\"\n  depends_on \"osgeo-saga-lts\"\n  depends_on \"osgeo-whitebox-tools\"\n  depends_on \"osgeo-lastools\"\n  depends_on \"osgeo-taudem\"\n\n  # R with more support\n  # https://github.com/adamhsparks/setup_macOS_for_R\n  # fix: will not build if the R version does not match\n  # If you installed sethrfore/r-srf/r, before installing\n  # rename \"/usr/local/opt/r\" to \"/usr/local/Cellar/r-bk\"\n  # and then restore it after installing qgis\n  depends_on \"r\" # optional\n\n  # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools)\n  # TODO: Fusion from USFS (via `wine`?)\n\n  # R Plugin\n  resource \"r\" do\n    url \"https://github.com/north-road/qgis-processing-r/archive/51371402c0200b6649fa3daa8ca8067e83aa6c15.tar.gz\"\n    sha256 \"f6309e1edc334f76938f46a396c71e986b1910dd8c4c58936cad8d7fad54a346\"\n    version \"1.0.5\"\n  end\n\n  # OTB Plugin\n  unless build.head?\n    resource \"otb\" do\n      url \"https://gitlab.orfeo-toolbox.org/orfeotoolbox/qgis-otb-plugin/-/archive/d5e8f0a2e11e9d1d5b28f1a0d1f9af1a4985b477/qgis-otb-plugin-d5e8f0a2e11e9d1d5b28f1a0d1f9af1a4985b477.tar.gz\"\n      sha256 \"939b89065604c10ee3a1b61f186e494f8e734aae1856547a32b1cb296dc4895b\"\n      version \"1.4.2\"\n    end\n    # # Patch: OtbUtils\n    # resource \"OtbUtils\" do\n    #   url \"https://gist.githubusercontent.com/fjperini/dc45ed0f637ae7dc8ec543a701e012f6/raw/c2b6bbafd6a9439bba903403f14c1b3c1ec3683d/OtbUtils.diff\"\n    #   sha256 \"b02c2fba5751dea84284072c590ce969ef215bb54e06cc2043ccbaf4449189e5\"\n    # end\n    # # Patch: OtbAlgorithmProvider\n    # resource \"OtbAlgorithmProvider\" do\n    #   url \"https://gist.githubusercontent.com/fjperini/d8fe440818814c0800e5071a0ccb4f70/raw/034e1dc2950749fcf70b2fd2925df11aa6deaae3/OtbAlgorithmProvider.diff\"\n    #   sha256 \"add76b970cee0c42bd56af50da1f77e1a214ae8912e6b8e3da6e82611ecc30b5\"\n    # end\n  end\n\n  # WhiteboxTools Plugin\n  resource \"whitebox\" do\n    url \"https://github.com/alexbruy/processing-whitebox/archive/5cbd81240e2a4e08fa0df515bf3dbf11957998ea.tar.gz\"\n    sha256 \"4ccf112dae81447842ccaa08a86d3c5fa12b0a1087e8dc485723a5c8737ebbd9\"\n    version \"0.9.0\"\n  end\n  # Patch: whiteboxProvider\n  resource \"whiteboxProvider\" do\n    url \"https://gist.githubusercontent.com/fjperini/fcb9f964c5396ab8b72c874a8db41b1d/raw/154deb8f17d52d11f1fba2642d43df2b1d0d936d/whiteboxProvider.diff\"\n    sha256 \"e95191b38765d6072c1a637e735114cce03d53173e47b96626bb30930b5e9c7f\"\n  end\n\n  # TauDEM Plugin\n  resource \"taudem\" do\n    url \"https://github.com/alexbruy/processing-taudem/archive/38dc454c477b6a6e917f2b3777dc69ed3ecd6062.tar.gz\"\n    sha256 \"7df793ae6a26ed65b6b15a8c8151b7f8598118b9f8da920eb260049d7c57229d\"\n    version \"2.0.0\"\n  end\n  # Patch: taudemProvider\n  resource \"taudemProvider\" do\n    url \"https://gist.githubusercontent.com/fjperini/1899e20e0286058a74116aecf466f0a0/raw/a2fc2c7a31c747fca5fbed4e885a6503fe6a5d4c/taudemProvider.diff\"\n    sha256 \"39a494f886d00011a0101b40715d828465592f304590438a7658d03298950cf5\"\n  end\n  # Patch: taudemUtils\n  resource \"taudemUtils\" do\n    url \"https://gist.githubusercontent.com/fjperini/f3e5ed0e964f4b7ead80a7c39a7115f6/raw/c3c8cca96d51156d0f60fe487b5b848faa3d0c2c/taudemUtils.diff\"\n    sha256 \"3cf403f74c2ed67f6cdfb87c04cf0b09b085fb9f77ddde9be1d7f2ac12fe53a3\"\n  end\n\n  # LAStools Plugin\n  resource \"lastools\" do\n    url \"https://github.com/rapidlasso/LAStoolsPluginQGIS3/archive/55866f1685c03c8f9771a6a995550e08095b1f8a.tar.gz\"\n    sha256 \"0badea99da9f14ae02a50860e368c48953eea921bf732593a2c059c090e1c248\"\n    version \"1.3\"\n  end\n  # Patch: LAStoolsProvider\n  resource \"LAStoolsProvider\" do\n    url \"https://gist.githubusercontent.com/fjperini/d6dd9f294be338fba4a05959b845f095/raw/4da2e9e0bd931ad00b3ca66777c3a9d50cde18ba/LAStoolsProvider.diff\"\n    sha256 \"82656a9fd6f42056d5c2a5487f2429b7f2c66c83287852fb644517abccecc563\"\n  end\n\n  # splash\n  resource \"splash\" do\n    url \"https://bottle.download.osgeo.org/qgis-splash/splash-3.8.png\"\n    sha256 \"e53726b42fc4e11c97f667b662a052ef25ef0c7d99d358e2ee3a21189d2bfc04\"\n  end\n\n  def install\n    ENV.cxx11\n\n    # change splash\n    rm \"#{buildpath}/images/splash/splash.png\"\n    (buildpath/\"images/splash\").install resource(\"splash\")\n    mv \"#{buildpath}/images/splash/splash-3.8.png\", \"#{buildpath}/images/splash/splash.png\"\n\n    # suggestions before installing\n    printf  \"\\n\\033[31mSome suggestions that you should keep in mind!!!\\e[0m\\n\\n\"\n    printf  \"- In case you have installed another version of Python\\e[0m (Anaconda, Miniconda or if you used the installer provided by python.org),\\n\"\n    printf  \"  QGIS will use the first Python that is in its PATH, so the installation may fail.\\n\\n\"\n    printf  \"- If the installation failed due to the problem reported in \\e[32mhttps://github.com/OSGeo/homebrew-osgeo4mac/issues/520\\e[0m\\n\\n\"\n    printf  \"  Try after doing:\\n\\n\"\n    printf  \"    \\e[32m$ brew unlink python && brew link --force python\\e[0m  \\e[1;33m(*)\\e[0m\\n\\n\"\n    printf  \"    \\e[32m$ $PATH (Check that there is no other version)\\e[0m\\n\\n\"\n    printf  \"- If the installation failed due to the problem reported in \\e[32mhttps://github.com/OSGeo/homebrew-osgeo4mac/issues/510\\e[0m\\n\\n\"\n    printf  \"  Try after doing:\\n\\n\"\n    printf  \"    \\e[32m$ brew reinstall ninja gsl python qt osgeo-sip osgeo-pyqt osgeo-pyqt-webkit osgeo-qscintilla2 six bison flex pkg-config\\e[0m\\n\\n\"\n    printf  \"    \\e[32m$ brew link --overwrite osgeo-pyqt\\e[0m  \\e[1;33m(**)\\e[0m\\n\\n\"\n    printf  \"- Other Notes:\\n\\n\"\n    printf  \"    - An installation that failed previously may have created this link\\n\\n\"\n    printf  \"      \\033[31m#{HOMEBREW_PREFIX}/lib/python#{py_ver}/site-packages/PyQt5/uic/widget-plugins/qgis_customwidgets.py\\e[0m, you will need to delete it.\\n\\n\"\n    printf  \"    - Also make sure that the folder \\033[31m#{HOMEBREW_PREFIX}/Cellar/qgis\\e[0m does not exist if the installation fails.\\n\\n\"\n    printf  \"    - It is also recommended remove the Homebrew Cache \\e[32m$ rm -rf $(brew --cache)\\e[0m (\\e[32m~/Library/Caches/Homebrew\\e[0m) and the temporary build files in \\e[32m/tmp\\e[0m.\\n\\n\"\n    printf  \"    - If you are going to install with several options you may have the following error:\\n\\n\"\n    printf  \"      \\033[31mError: Too many open files @ rb_sysopen - #{HOMEBREW_PREFIX}/var/homebrew/locks/..\\e[0m\\n\\n\"\n    printf  \"      Check before with: \\e[32m$ ulimit -n\\e[0m\\n\"\n    printf  \"      You can change it temporarily to avoid this problem: \\e[32m$ ulimit -n 1024\\e[0m\\n\"\n    printf  \"      Will be re-established in the next session\\n\\n\"\n    printf  \"    - If the installation failed with the error\\n\\n\"\n    printf  \"      \\033[31mfatal error: 'libintl.h' file not found\\e[0m\\n\\n\"\n    printf  \"      Try after doing: \\e[32m$ brew unlink gettext && brew link --force gettext\\e[0m  \\e[1;33m(***)\\e[0m\\n\\n\"\n    printf  \"\\n\\033[31mWe recommend that you run on the terminal\\e[0m \\e[1;33m(*)\\e[0m\\033[31m,\\e[1;33m(**)\\e[0m \\033[31mand\\e[0m \\e[1;33m(***)\\e[0m \\033[31mbefore installation,\\e[0m\\n\"\n    printf  \"\\n\\033[31mto make sure everything works correctly.\\e[0m\\n\\n\"\n    printf \"\\033[31mThe installation will continue, but remember the above.\\e[0m\\n\"\n\n    30.downto(0) do |i|\n        printf \"#{'%02d'% i}.\"\n        sleep 1\n    end\n\n    printf \"\\n\\n\"\n\n    # proceeds to install the add-ons as a first step,\n    # to ensure that the patches are applied\n    mkdir \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n\n    # OTB is available from branch_3.8\n    unless build.head?\n    #   resource(\"otb\").stage do\n    #     cp_r \"./otb\", \"#{buildpath}/python/plugins/\"\n    #   end\n      resource(\"otb\").stage do\n        cp_r \"./otb\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n      end\n    #   resource(\"OtbUtils\").stage do\n    #     cp_r \"./OtbUtils.diff\", \"#{buildpath}\"\n    #   end\n    #   resource(\"OtbAlgorithmProvider\").stage do\n    #     cp_r \"./OtbAlgorithmProvider.diff\", \"#{buildpath}\"\n    #   end\n    #   system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/OtbUtils.diff\"\n    #   system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/OtbAlgorithmProvider.diff\"\n    #   cp_r \"#{buildpath}/python/plugins/otb\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n    end\n\n    # R\n    resource(\"r\").stage do\n      cp_r \"./processing_r\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n    end\n\n    # WhiteboxTools\n    resource(\"whitebox\").stage do\n      cp_r \"./\", \"#{buildpath}/python/plugins/processing_whitebox\"\n    end\n    resource(\"whiteboxProvider\").stage do\n      cp_r \"./whiteboxProvider.diff\", \"#{buildpath}\"\n    end\n    system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/whiteboxProvider.diff\"\n    cp_r \"#{buildpath}/python/plugins/processing_whitebox\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n\n    # TauDEM\n    resource(\"taudem\").stage do\n      cp_r \"./\", \"#{buildpath}/python/plugins/processing_taudem\"\n    end\n    resource(\"taudemProvider\").stage do\n      cp_r \"./taudemProvider.diff\", \"#{buildpath}\"\n    end\n    resource(\"taudemUtils\").stage do\n      cp_r \"./taudemUtils.diff\", \"#{buildpath}\"\n    end\n    system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/taudemProvider.diff\"\n    system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/taudemUtils.diff\"\n    cp_r \"#{buildpath}/python/plugins/processing_taudem\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n\n    # LASTools\n    resource(\"lastools\").stage do\n      cp_r \"./LAStools\", \"#{buildpath}/python/plugins/lastools\"\n    end\n    resource(\"LAStoolsProvider\").stage do\n      cp_r \"./LAStoolsProvider.diff\", \"#{buildpath}\"\n    end\n    system \"patch\", \"-p1\", \"-i\", \"#{buildpath}/LAStoolsProvider.diff\"\n    cp_r \"#{buildpath}/python/plugins/lastools\", \"#{prefix}/QGIS.app/Contents/Resources/python/plugins/\"\n\n    # if you have a 3rd party Python installed, and/or Python 3,\n    # you need to remove it from your path for the installation.\n    # once installed, QGIS will run even if the primary Python is,\n    # for example, Anaconda Python 3.\n    # reset path\n    ENV[\"PATH\"] = nil\n    pths = \"#{HOMEBREW_PREFIX}/bin:#{HOMEBREW_PREFIX}/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11/bin\"\n    ENV.append_path \"PATH\", \"#{pths}\"\n\n    # when osgeo-gdal-python.rb loaded, PYTHONPATH gets set to 2.7 site-packages...\n    # clear it before calling any local python3 functions\n    ENV[\"PYTHONPATH\"] = nil\n    if ARGV.debug?\n      puts \"brewed_python?: #{brewed_python?}\"\n      puts \"python_prefix: #{python_prefix}\"\n      puts \"python_exec: #{python_exec}\"\n      puts \"py_ver: #{py_ver}\"\n      puts \"python_site_packages: #{python_site_packages}\"\n      puts \"qgis_site_packages: #{qgis_site_packages}\"\n      puts \"qgis_python_packages: #{qgis_python_packages}\"\n      puts \"gdal_python_packages: #{gdal_python_packages}\"\n      puts \"gdal_python_opt_bin: #{gdal_python_opt_bin}\"\n      puts \"gdal_opt_bin: #{gdal_opt_bin}\"\n    end\n\n    # set bundling level back to 0 (the default in all versions prior to 1.8.0)\n    # so that no time and energy is wasted copying the Qt frameworks into QGIS.\n\n    # install custom widgets Designer plugin to local qt plugins prefix\n    mkdir lib/\"qt/plugins/designer\"\n    inreplace \"src/customwidgets/CMakeLists.txt\",\n              \"${QT_PLUGINS_DIR}/designer\", lib/\"qt/plugins/designer\".to_s\n\n    # fix custom widgets Designer module install path\n    mkdir lib/\"python#{py_ver}/site-packages/PyQt5\"\n    inreplace \"CMakeLists.txt\",\n              \"${PYQT5_MOD_DIR}\", lib/\"python#{py_ver}/site-packages/PyQt5\".to_s\n\n    # install db plugins to local qt plugins prefix\n    # qspatialite\n    mkdir lib/\"qt/plugins/sqldrivers\"\n    inreplace \"external/qspatialite/CMakeLists.txt\",\n              \"${QT_PLUGINS_DIR}/sqldrivers\", lib/\"qt/plugins/sqldrivers\".to_s\n\n    # end\n    if build.with? \"oracle\"\n      mkdir lib/\"qt/plugins/sqldrivers\"\n      inreplace \"src/providers/oracle/ocispatial/CMakeLists.txt\",\n                \"${QT_PLUGINS_DIR}/sqldrivers\", lib/\"qt/plugins/sqldrivers\".to_s\n    end\n\n    # support for PROJ 6\n    # https://github.com/OSGeo/proj.4/wiki/proj.h-adoption-status\n    # ENV.append \"CFLAGS\", \"-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H\"\n\n    args = std_cmake_args\n    args << \"-DCMAKE_BUILD_TYPE=RelWithDebInfo\" if build.with? \"debug\" # override\n\n    cmake_prefixes = %w[\n      qt\n      osgeo-qt-webkit\n      osgeo-pyqt-webkit\n      osgeo-qscintilla2\n      osgeo-pyqt\n      osgeo-sip\n      qwt\n      qwtpolar\n      qca\n      osgeo-qtkeychain\n      osgeo-gdal\n      gsl\n      geos\n      osgeo-proj\n      osgeo-libspatialite\n      spatialindex\n      expat\n      sqlite\n      libzip\n      flex\n      bison\n      fcgi\n    ].freeze\n\n    # force CMake to search HB/opt paths first, so headers in HB/include are not found instead;\n    # specifically, ensure any gdal v1 includes are not used\n    args << \"-DCMAKE_PREFIX_PATH=#{cmake_prefixes.map { |f| Formula[f.to_s].opt_prefix }.join(\";\")}\"\n\n    qwt_fw = Formula[\"qwt\"].opt_lib/\"qwt.framework\"\n    qwtpolar_fw = Formula[\"qwtpolar\"].opt_lib/\"qwtpolar.framework\"\n    qca_fw = Formula[\"qca\"].opt_lib/\"qca-qt5.framework\"\n    args += %W[\n      -DBISON_EXECUTABLE=#{Formula[\"bison\"].opt_bin}/bison\n      -DEXPAT_INCLUDE_DIR=#{Formula[\"expat\"].opt_include}\n      -DEXPAT_LIBRARY=#{Formula[\"expat\"].opt_lib}/libexpat.dylib\n      -DFLEX_EXECUTABLE=#{Formula[\"flex\"].opt_bin}/flex\n      -DPROJ_INCLUDE_DIR=#{Formula[\"osgeo-proj\"].opt_include}\n      -DPROJ_LIBRARY=#{Formula[\"osgeo-proj\"].opt_lib}/libproj.dylib\n      -DQCA_INCLUDE_DIR=#{qca_fw}/Headers\n      -DQCA_LIBRARY=#{qca_fw}/qca-qt5\n      -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers\n      -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar\n      -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers\n      -DQWT_LIBRARY=#{qwt_fw}/qwt\n      -DSPATIALINDEX_INCLUDE_DIR=#{Formula[\"spatialindex\"].opt_include}\n      -DSPATIALINDEX_LIBRARY=#{Formula[\"spatialindex\"].opt_lib}/libspatialindex.dylib\n      -DSQLITE3_INCLUDE_DIR=#{Formula[\"sqlite\"].opt_include}\n      -DSQLITE3_LIBRARY=#{Formula[\"sqlite\"].opt_lib}/libsqlite3.dylib\n      -DLIBZIP_CONF_INCLUDE_DIR=#{Formula[\"libzip\"].opt_lib}/pkgconfig\n      -DLIBZIP_INCLUDE_DIR=#{Formula[\"libzip\"].opt_include}\n      -DLIBZIP_LIBRARY=#{Formula[\"libzip\"].opt_lib}/libzip.dylib\n      -DSPATIALITE_INCLUDE_DIR=#{Formula[\"osgeo-libspatialite\"].opt_include}\n      -DSPATIALITE_LIBRARY=#{Formula[\"osgeo-libspatialite\"].opt_lib}/libspatialite.dylib\n      -DQTKEYCHAIN_INCLUDE_DIR=#{Formula[\"qtkeychain\"].opt_include}/qt5keychain\n      -DQTKEYCHAIN_LIBRARY=#{Formula[\"osgeo-qtkeychain\"].opt_lib}/libqt5keychain.dylib\n      -DLIBTASN1_INCLUDE_DIR=#{Formula[\"libtasn1\"].opt_include}\n      -DLIBTASN1_LIBRARY=#{Formula[\"libtasn1\"].opt_lib}/libtasn1.dylib\n      -DPYRCC_PROGRAM=#{libexec}/vendor/bin/pyrcc5\n      -DPYUIC_PROGRAM=#{libexec}/vendor/bin/pyuic5\n      -DWITH_QWTPOLAR=TRUE\n      -DWITH_INTERNAL_QWTPOLAR=FALSE\n      -DWITH_QSCIAPI=FALSE\n      -DWITH_CUSTOM_WIDGETS=TRUE\n      -DWITH_ASTYLE=FALSE\n      -DWITH_QTWEBKIT=TRUE\n      -DQT_LRELEASE_EXECUTABLE=#{Formula[\"qt\"].opt_bin}/lrelease\n      -DQT5_3DEXTRA_INCLUDE_DIR=#{Formula[\"qt\"].opt_lib}/cmake/Qt53DExtras\n      -DQt5WebKitWidgets_DIR=#{Formula[\"osgeo-qt-webkit\"].opt_lib}/cmake/Qt5WebKitWidgets\n      -DQt5WebKit_DIR=#{Formula[\"osgeo-qt-webkit\"].opt_lib}/cmake/Qt5WebKit\n    ]\n\n    args << \"-DQGIS_MACAPP_BUNDLE=0\"\n    args << \"-DQGIS_MACAPP_INSTALL_DEV=FALSE\"\n    # args << \"-DQGIS_APP_NAME=QGIS-HB\"\n\n    # Build unit tests\n    args << \"-DENABLE_TESTS=FALSE\"\n    # Enable QT ModelTest (not for production)\n    args << \"-DENABLE_MODELTEST=FALSE\"\n    # Perform coverage tests\n    args << \"-DENABLE_COVERAGE=FALSE\"\n\n    args << \"-DSIP_BINARY_PATH=#{Formula[\"osgeo-sip\"].opt_bin}/sip\"\n    args << \"-DSIP_DEFAULT_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip\"\n    args << \"-DSIP_INCLUDE_DIR=#{Formula[\"osgeo-sip\"].opt_include}\"\n    args << \"-DSIP_MODULE_DIR=#{Formula[\"osgeo-sip\"].opt_lib}/python#{py_ver}/site-packages\"\n\n    args << \"-DPYQT5_MOD_DIR=#{Formula[\"python\"].opt_prefix}/Frameworks/Python.framework/Versions/#{py_ver}/lib/python#{py_ver}/site-packages/PyQt5\"\n    args << \"-DPYQT5_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip/PyQt5\" # Qt5\n    args << \"-DPYQT5_BIN_DIR=#{Formula[\"python\"].opt_prefix}/Frameworks/Python.framework/Versions/#{py_ver}/bin\"\n    args << \"-DPYQT5_SIP_IMPORT=PyQt5.sip\"\n    args << \"-DPYQT5_SIP_FLAGS=-n PyQt5.sip -t WS_MACX -t Qt_5_12_1\"\n\n    args << \"-DQSCI_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip/PyQt5/Qsci\" # Qsci/qscimod5.sip\n    args << \"-DQSCINTILLA_INCLUDE_DIR=#{Formula[\"osgeo-qscintilla2\"].opt_include}\" # Qsci/qsciglobal.h\n    args << \"-DQSCINTILLA_LIBRARY=#{Formula[\"osgeo-qscintilla2\"].opt_lib}/libqscintilla2_qt5.dylib\"\n\n    # disable CCache\n    args << \"-DUSE_CCACHE=OFF\"\n\n    # Determines whether QGIS core should be built\n    args << \"-DWITH_CORE=TRUE\"\n\n    # Determines whether QGIS GUI library (and everything built on top of it) should be built\n    args << \"-DWITH_GUI=TRUE\"\n\n    # Determines whether QGIS analysis library should be built\n    # args << \"-DWITH_ANALYSIS=TRUE\"\n\n    # Determines whether QGIS desktop should be built\n    args << \"-DWITH_DESKTOP=TRUE\"\n\n    # Determines whether QGIS Quick library should be built\n    args << \"-DWITH_QUICK=FALSE\"\n\n    # Determines whether MDAL support should be built\n    args << \"-DWITH_INTERNAL_MDAL=TRUE\"\n\n    # Determines whether GeoReferencer plugin should be built\n    args << \"-DWITH_GEOREFERENCER=TRUE\"\n\n    # Determines whether std::thread_local should be used\n    args << \"-DWITH_THREAD_LOCAL=TRUE\"\n\n    # Determines whether Qt5SerialPort should be tried for GPS positioning\n    # args << \"-DWITH_QT5SERIALPORT=TRUE\"\n\n    # Use Clang tidy\n    args << \"-DWITH_CLANG_TIDY=FALSE\"\n\n    # try to configure and build python bindings by default\n    # determines whether python bindings should be built\n    args << \"-DWITH_BINDINGS=TRUE\"\n    # by default bindings will be installed only to QGIS directory\n    # someone might want to install it to python site-packages directory\n    # as otherwise user has to use PYTHONPATH environment variable to add\n    # QGIS bindings to package search path\n    # install bindings to global python directory? (might need root)\n    args << \"-DBINDINGS_GLOBAL_INSTALL=FALSE\"\n    # Stage-install core Python plugins to run from build directory? (utilities and console are always staged)\n    args << \"-DWITH_STAGED_PLUGINS=TRUE\"\n    # Determines whether Python modules in staged or installed locations are byte-compiled\"\n    args << \"-DWITH_PY_COMPILE=FALSE\"\n\n    # python Configuration\n    args << \"-DPYTHON_EXECUTABLE=#{`#{Formula[\"python\"].opt_bin}/python3 -c \"import sys; print(sys.executable)\"`.chomp}\"\n    # args << \"-DPYTHON_INCLUDE_PATH=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/include/python#{py_ver}m\"\n    # args << \"-DPYTHON_LIBRARY=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/Python\"\n    # args << \"-DPYTHON_SITE_PACKAGES_DIR=#{HOMEBREW_PREFIX}/lib/python#{py_ver}/site-packages\"\n\n    # if using Homebrew's Python, make sure its components are always found first\n    # see: https://github.com/Homebrew/homebrew/pull/28597\n    ENV[\"PYTHONHOME\"] = python_prefix if brewed_python?\n\n    # handle custom site-packages for keg-only modules and packages\n    ENV.append_path \"PYTHONPATH\", \"#{python_site_packages}\"\n    ENV.append_path \"PYTHONPATH\", \"#{qgis_site_packages}\"\n    ENV.append_path \"PYTHONPATH\", \"#{qgis_python_packages}\"\n    ENV.append_path \"PYTHONPATH\", \"#{gdal_python_packages}\"\n\n    # find git revision for HEAD build\n    if build.head? && File.exist?(\"#{cached_download}/.git/index\")\n      args << \"-DGITCOMMAND=#{Formula[\"git\"].opt_bin}/git\"\n      args << \"-DGIT_MARKER=#{cached_download}/.git/index\"\n\n      # disable OpenCL support\n      # necessary to build from branch: master\n      # fix for CL/cl2.hpp\n      # https://github.com/qgis/QGIS/pull/7451\n      # args << \"-DUSE_OPENCL=OFF\"\n    end\n\n    # used internal sources\n    # args << \"OPENCL_HPP_INCLUDE_DIR=\"\n\n    # server\n    args << \"-DWITH_SERVER=TRUE\"\n    args << \"-DWITH_SERVER_PLUGINS=TRUE\"\n    fcgi_opt = Formula[\"fcgi\"].opt_prefix\n    args << \"-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include\"\n    args << \"-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib\"\n\n    # postgresql\n    args << \"-DWITH_POSTGRESQL=TRUE\"\n    if build.with?(\"pg10\")\n      args << \"-DPOSTGRES_CONFIG=#{Formula[\"osgeo-postgresql@10\"].opt_bin}/pg_config\"\n      args << \"-DPOSTGRES_INCLUDE_DIR=#{Formula[\"osgeo-postgresql@10\"].opt_include}\"\n      args << \"-DPOSTGRES_LIBRARY=#{Formula[\"osgeo-postgresql@10\"].opt_lib}/libpq.dylib\"\n    else\n      args << \"-DPOSTGRES_CONFIG=#{Formula[\"osgeo-postgresql\"].opt_bin}/pg_config\"\n      args << \"-DPOSTGRES_INCLUDE_DIR=#{Formula[\"osgeo-postgresql\"].opt_include}\"\n      args << \"-DPOSTGRES_LIBRARY=#{Formula[\"osgeo-postgresql\"].opt_lib}/libpq.dylib\"\n    end\n\n    # grass\n    args << \"-DWITH_GRASS7=TRUE\"\n    args << \"-DWITH_GRASS=FALSE\" # grass6\n    # this is to build the GRASS Plugin, not for Processing plugin support\n    grass = Formula[\"osgeo-grass\"]\n    args << \"-DGRASS_PREFIX7=#{grass.opt_prefix}/grass-base\"\n    # keep superenv from stripping (use Cellar prefix)\n    ENV.append \"CXXFLAGS\", \"-isystem #{grass.prefix.resolved_path}/grass-base/include\"\n    # So that `libintl.h` can be found (use Cellar prefix; should not be needed anymore with QGIS 2.99+)\n    ENV.append \"CXXFLAGS\", \"-isystem #{Formula[\"gettext\"].include.resolved_path}\"\n\n    # args << \"-DWITH_GLOBE=TRUE\"\n    # osg = Formula[\"osgeo-openscenegraph\"]\n    # osgqt = Formula[\"osgqt\"]\n    # osgearth = Formula[\"osgeo-osgearth\"]\n    # opoo \"`osgeo-openscenegraph` formula's keg not linked.\" unless osg.linked_keg.exist?\n    # # OSG\n    # # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there\n    # args << \"-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}\"\n    # args << \"-DOSG_DIR=#{osg.opt_prefix}\"\n    # args << \"-DOSG_INCLUDE_DIR=#{osg.opt_include}\" # osg/Node\n    # args << \"-DOSG_GEN_INCLUDE_DIR=#{osg.opt_include}\" # osg/Config\n    # args << \"-DOSG_LIBRARY=#{osg.opt_lib}/libosg.dylib\"\n    # args << \"-DOSGUTIL_LIBRARY=#{osg.opt_lib}/libosgUtil.dylib\"\n    # args << \"-DOSGDB_LIBRARY=#{osg.opt_lib}/libosgDB.dylib\"\n    # args << \"-DOSGTEXT_LIBRARY=#{osg.opt_lib}/libosgText.dylib\"\n    # args << \"-DOSGTERRAIN_LIBRARY=#{osg.opt_lib}/libosgTerrain.dylib\"\n    # args << \"-DOSGFX_LIBRARY=#{osg.opt_lib}/libosgFX.dylib\"\n    # args << \"-DOSGSIM_LIBRARY=#{osg.opt_lib}/libosgSim.dylib\"\n    # args << \"-DOSGVIEWER_LIBRARY=#{osg.opt_lib}/libosgViewer.dylib\"\n    # args << \"-DOSGGA_LIBRARY=#{osg.opt_lib}/libosgGA.dylib\"\n    # args << \"-DOSGQT_LIBRARY=#{osgqt.opt_lib}/libosgQt5.dylib\"\n    # args << \"-DOSGWIDGET_LIBRARY=#{osg.opt_lib}/libosgWidget.dylib\"\n    # args << \"-DOPENTHREADS_LIBRARY=#{osg.opt_lib}/libOpenThreads.dylib\"\n    # # args << \"-DOPENTHREADS_INCLUDE_DIR=#{osg.opt_include}\"\n    # # args << \"-DOSGSHADOW_LIBRARY=#{osg.opt_lib}/libosgShadow.dylib\"\n    # # args << \"-DOSGMANIPULATOR_LIBRARY=#{osg.opt_lib}/libosgManipulator.dylib\"\n    # # args << \"-DOSGPARTICLE_LIBRARY=#{osg.opt_lib}/libosgParticle.dylib\"\n    # # OSGEARTH\n    # args << \"-DOSGEARTH_DIR=#{osgearth.opt_prefix}\"\n    # args << \"-DOSGEARTH_INCLUDE_DIR=#{osgearth.opt_include}\" # osgEarth/TileSource\n    # args << \"-DOSGEARTH_GEN_INCLUDE_DIR=#{osgearth.opt_include}\" # osgEarth/Common\n    # args << \"-DOSGEARTH_ELEVATION_QUERY=#{osgearth.opt_include}\" # osgEarth/ElevationQuery\n    # args << \"-DOSGEARTH_LIBRARY=#{osgearth.opt_lib}/libosgEarth.dylib\"\n    # args << \"-DOSGEARTHUTIL_LIBRARY=#{osgearth.opt_lib}/libosgEarthUtil.dylib\"\n    # args << \"-DOSGEARTHFEATURES_LIBRARY=#{osgearth.opt_lib}/libosgEarthFeatures.dylib\"\n    # args << \"-DOSGEARTHSYMBOLOGY_LIBRARY=#{osgearth.opt_lib}/libosgEarthSymbology.dylib\"\n    # args << \"-DOSGEARTHQT_LIBRARY=#{osgearth.opt_lib}/libosgEarthQt5.dylib\"\n    # args << \"-DOSGEARTHANNOTATION_LIBRARY=#{osgearth.opt_lib}/libosgEarthAnnotation.dylib\"\n    # # qt\n    # args << \"-DQt5OpenGL_INCLUDE_DIRS=#{Formula[\"qt\"].opt_include}/QtOpenGL\"\n\n    args << \"-DWITH_ORACLE=#{build.with?(\"oracle\") || brewed_oracle? ? \"TRUE\" : \"FALSE\"}\"\n    if build.with?(\"oracle\") || brewed_oracle?\n      oracle_opt = Formula[\"osgeo-oracle-client-sdk\"].opt_prefix\n      args << \"-DOCI_INCLUDE_DIR=#{oracle_opt}/include/oci\"\n      args << \"-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib\"\n    end\n\n    args << \"-DWITH_QSPATIALITE=TRUE\"\n\n    args << \"-DWITH_APIDOC=#{build.with?(\"api-docs\") ? \"TRUE\" : \"FALSE\"}\"\n\n    args << \"-DWITH_3D=TRUE\"\n\n    # args << \"-DWITH_QTWEBKIT=#{build.with?(\"osgeo-qt-webkit\") ? \"TRUE\" : \"FALSE\"}\"\n    # if build.with? \"qtwebkit\"\n    #   args << \"-DOPTIONAL_QTWEBKIT=#{Formula[\"osgeo-qt-webkit\"].opt_lib}/cmake/Qt5WebKitWidgets\"\n    # end\n\n    # prefer opt_prefix for CMake modules that find versioned prefix by default\n    # this keeps non-critical dependency upgrades from breaking QGIS linking\n    args << \"-DGDAL_CONFIG=#{Formula[\"osgeo-gdal\"].opt_bin}/gdal-config\"\n    args << \"-DGDAL_INCLUDE_DIR=#{Formula[\"osgeo-gdal\"].opt_include}\"\n    args << \"-DGDAL_LIBRARY=#{Formula[\"osgeo-gdal\"].opt_lib}/libgdal.dylib\"\n    args << \"-DGEOS_CONFIG=#{Formula[\"geos\"].opt_bin}/geos-config\"\n    args << \"-DGEOS_INCLUDE_DIR=#{Formula[\"geos\"].opt_include}\"\n    args << \"-DGEOS_LIBRARY=#{Formula[\"geos\"].opt_lib}/libgeos_c.dylib\"\n    args << \"-DGSL_CONFIG=#{Formula[\"gsl\"].opt_bin}/gsl-config\"\n    args << \"-DGSL_INCLUDE_DIR=#{Formula[\"gsl\"].opt_include}\"\n    args << \"-DGSL_LIBRARIES='-L#{Formula[\"gsl\"].opt_lib} -lgsl -lgslcblas'\"\n\n    # avoid ld: framework not found QtSql\n    # (https://github.com/Homebrew/homebrew-science/issues/23)\n    ENV.append \"CXXFLAGS\", \"-F#{Formula[\"qt\"].opt_lib}\"\n\n    # handle some compiler warnings\n    # ENV[\"CXX_EXTRA_FLAGS\"] = \"-Wno-unused-private-field -Wno-deprecated-register\"\n    # if ENV.compiler == :clang && (MacOS::Xcode.version >= \"7.0\" || MacOS::CLT.version >= \"7.0\")\n    #   ENV.append \"CXX_EXTRA_FLAGS\", \"-Wno-inconsistent-missing-override\"\n    # end\n\n    args << \"-DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations\"\n\n    # If set to true, it will disable deprecated functionality to prepare for the next generation of QGIS\n    # args << \"-DDISABLE_DEPRECATED=TRUE\"\n\n    # Newer versions of UseQt4.cmake include Qt with -isystem automatically\n    # This can be used to force this behavior on older systems\n    # Can be removed as soon as Travis-CI updates from precise\n    # args << \"-DSUPPRESS_QT_WARNINGS=TRUE\"\n\n    ENV.prepend_path \"PATH\", libexec/\"vendor/bin\"\n\n    mkdir \"#{libexec}/vendor/bin\"\n\n    # create pyrcc5\n    File.open(\"#{libexec}/vendor/bin/pyrcc5\", \"w\") { |file|\n\t\t\tfile << '#!/bin/sh'\n\t\t\tfile << \"\\n\"\n\t\t\tfile << 'exec' + \" #{Formula[\"python\"].opt_bin}/python3 \" + '-m PyQt5.pyrcc_main ${1+\"$@\"}'\n    }\n\n    # create pyuic5\n    File.open(\"#{libexec}/vendor/bin/pyuic5\", \"w\") { |file|\n\t\t\tfile << '#!/bin/sh'\n\t\t\tfile << \"\\n\"\n\t\t\tfile << 'exec' + \" #{Formula[\"python\"].opt_bin}/python3 \" + '-m PyQt5.pyuic5_main ${1+\"$@\"}'\n    }\n\n    chmod(\"+x\", \"#{libexec}/vendor/bin/pyrcc5\")\n    chmod(\"+x\", \"#{libexec}/vendor/bin/pyuic5\")\n\n    mkdir \"build\" do\n      system \"cmake\", \"-G\", build.with?(\"ninja\") ? \"Ninja\" : \"Unix Makefiles\", *args, \"..\"\n      system \"cmake\", \"--build\", \".\", \"--target\", \"all\", \"--\", \"-j\", Hardware::CPU.cores\n      system \"cmake\", \"--build\", \".\", \"--target\", \"install\", \"--\", \"-j\", Hardware::CPU.cores\n    end\n\n    # fixup some errant lib linking\n    # TODO: fix upstream in CMake\n    dy_libs = [lib/\"qt/plugins/designer/libqgis_customwidgets.dylib\"]\n    dy_libs << lib/\"qt/plugins/sqldrivers/libqsqlspatialite.dylib\" # qspatialite\n    dy_libs << lib/\"qt/plugins/sqldrivers/libqsqlocispatial.dylib\" if build.with? \"oracle\"\n    dy_libs.each do |dy_lib|\n      MachO::Tools.dylibs(dy_lib.to_s).each do |i_n|\n        %w[core gui native].each do |f_n|\n          sufx = i_n[/(qgis_#{f_n}\\.framework.*)/, 1]\n          next if sufx.nil?\n          i_n_to = \"#{opt_prefix}/QGIS.app/Contents/Frameworks/#{sufx}\"\n          puts \"Changing install name #{i_n} to #{i_n_to} in #{dy_lib}\" if ARGV.debug?\n          dy_lib.ensure_writable do\n            MachO::Tools.change_install_name(dy_lib.to_s, i_n.to_s, i_n_to, :strict => false)\n          end\n        end\n      end\n    end\n\n    # update .app's bundle identifier, so other installers doesn't get confused\n    inreplace prefix/\"QGIS.app/Contents/Info.plist\",\n              \"org.qgis.qgis3\", \"org.qgis.osgeo-qgis-hb#{build.head? ? \"-dev\" : \"\"}\"\n\n    py_lib = lib/\"python#{py_ver}/site-packages\"\n    py_lib.mkpath\n    ln_s \"../../../QGIS.app/Contents/Resources/python/qgis\", py_lib/\"qgis\"\n\n    ln_s \"QGIS.app/Contents/MacOS/fcgi-bin\", prefix/\"fcgi-bin\" # server\n\n    doc.mkpath\n    mv prefix/\"QGIS.app/Contents/Resources/doc/api\", doc/\"api\" if build.with? \"api-docs\"\n    ln_s \"../../../QGIS.app/Contents/Resources/doc\", doc/\"doc\"\n\n    # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped)\n    # only works with QGIS > 2.0.1\n    # doesn't need executable bit set, loaded by Python runner in QGIS\n    # TODO: for Py3\n    cp_r \"#{Formula[\"osgeo-qgis-res\"].opt_libexec}/pyqgis_startup.py\", \"#{libexec}/pyqgis_startup.py\"\n\n    bin.mkdir\n    qgis_bin = bin/name.to_s\n    touch qgis_bin.to_s # so it will be linked into HOMEBREW_PREFIX\n    qgis_bin.chmod 0755\n    post_install\n  end\n\n  def post_install\n    # configure environment variables for .app and launching binary directly.\n    # having this in `post_intsall` allows it to be individually run *after* installation with:\n    #    `brew postinstall -v <formula-name>`\n\n    app = prefix/\"QGIS.app\"\n    tab = Tab.for_formula(self)\n    opts = tab.used_options\n    # bottle_poured = tab.poured_from_bottle\n\n    # define default isolation env vars\n    pthsep = File::PATH_SEPARATOR\n    pypth = \"#{python_site_packages}\"\n    pths = %W[#{HOMEBREW_PREFIX}/bin #{HOMEBREW_PREFIX}/sbin /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin]\n\n    unless opts.include?(\"with-isolation\")\n      pths = ORIGINAL_PATHS.dup\n      pyenv = ENV[\"PYTHONPATH\"]\n      if pyenv\n        pypth = pyenv.include?(pypth) ? pyenv : pypth + pthsep + pyenv\n      end\n    end\n\n    unless pths.include?(HOMEBREW_PREFIX/\"bin\")\n      pths = pths.insert(0, HOMEBREW_PREFIX/\"bin\")\n    end\n\n    # set install's lib/python#{py_ver}/site-packages first, so app will work if unlinked\n    pypths = %W[#{qgis_python_packages} #{qgis_site_packages} #{pypth}]\n\n    pths.insert(0, \"#{gdal_opt_bin}\")\n    pths.insert(0, \"#{gdal_python_opt_bin}\")\n    pypths.insert(0, \"#{gdal_python_packages}\")\n\n    # prepend qt based utils to PATH (reverse order)\n    pths.insert(0, \"#{Formula[\"qca\"].opt_bin}\")\n    pths.insert(0, \"#{Formula[\"osgeo-pyqt\"].opt_bin}\")\n    pths.insert(0, \"#{Formula[\"osgeo-sip\"].opt_bin}\")\n    pths.insert(0, \"#{Formula[\"qt\"].opt_bin}\")\n\n    pths.insert(0, \"#{Formula[\"gpsbabel\"].opt_bin}\")\n\n    # we need to manually add the saga lts path, since it's keg only\n    pths.insert(0, \"#{Formula[\"osgeo-saga-lts\"].opt_bin}\")\n\n    envars = {\n      :PATH => pths.join(pthsep),\n      :QGIS_BUNDLE => \"#{opt_prefix}/QGIS.app/Contents\",\n      :QGIS_PREFIX_PATH => \"#{opt_prefix}/QGIS.app/Contents/MacOS\",\n      :GDAL_DRIVER_PATH => \"#{HOMEBREW_PREFIX}/lib/gdalplugins\",\n      :GDAL_DATA => \"#{Formula[\"osgeo-gdal\"].opt_share}/gdal\",\n      :CHECK_DISK_FREE_SPACE => \"FALSE\",\n      :PYTHONPATH => pypths.join(pthsep),\n      # if it is set, grass it will not work correctly, using Python 2\n      # it will be necessary to wait until it is built with Python 3\n      # :PYTHONHOME =>  \"#{Formula[\"python\"].opt_frameworks}/Python.framework/Versions/#{py_ver}\",\n    }\n\n    # handle multiple Qt plugins directories\n    qtplgpths = %W[\n      #{opt_lib}/qt/plugins\n      #{Formula[\"qt\"].opt_prefix}/plugins\n      #{HOMEBREW_PREFIX}/lib/qt/plugins\n    ]\n    envars[:QT_PLUGIN_PATH] = qtplgpths.join(pthsep)\n    envars[:QT_AUTO_SCREEN_SCALE_FACTOR] = \"1\"\n    # https://github.com/OSGeo/homebrew-osgeo4mac/issues/447\n    # envars[:QT_AUTO_SCREEN_SCALE_FACTOR] = \"0\"\n    # envars[:QT_DEVICE_PIXEL_RATIO] = \"1\"\n\n    proc_plugins = \"#{app}/Contents/Resources/python/plugins\"\n    proc_plugins_algs = \"#{proc_plugins}/processing/algs\"\n\n    # for core integration plugin support\n\n    # grass\n    grass = Formula[\"osgeo-grass\"]\n    grass_version = \"#{grass.version}\"\n    envars[:GRASS_PREFIX] = \"#{grass.opt_prefix}/grass-base\"\n    envars[:GRASS_SH] = \"/bin/sh\"\n    envars[:GRASS_PROJSHARE] = \"#{Formula[\"osgeo-proj\"].opt_share}\"\n    envars[:GRASS_VERSION] = \"#{grass_version}\"\n    envars[:GRASS_LD_LIBRARY_PATH] = \"#{grass.opt_prefix}/grass#{majmin_ver}/lib\"\n    # envars[:GRASS_PERL] = \"#{Formula[\"perl\"].opt_bin}/perl\"\n    envars[:PROJ_LIB] = \"#{Formula[\"osgeo-proj\"].opt_lib}\"\n    envars[:GEOTIFF_CSV] = \"#{Formula[\"osgeo-libgeotiff\"].opt_share}/epsg_csv\"\n    # envars[:R_HOME] = \"#{Formula[\"r\"].opt_bin}/R\"\n    # envars[:R_HOME] = \"/Applications/RStudio.app/Contents/MacOS/RStudio\"\n    # envars[:R_USER] = \"USER_PROFILE/Documents\"\n    begin\n      inreplace \"#{proc_plugins_algs}/grass7/Grass7Utils.py\",\n                \"'/Applications/GRASS-7.{}.app/Contents/MacOS'.format(version)\",\n                \"'#{grass.opt_prefix}/grass-base'\"\n      puts \"GRASS 7 GrassUtils.py has been updated\"\n      rescue Utils::InreplaceError\n      puts \"GRASS 7 GrassUtils.py already updated\"\n    end\n\n    # OTB is available from branch_3.8\n    # unless build.head?\n    #   orfeo = Formula[\"osgeo-orfeo\"]\n    #   # envars[:QGIS_PLUGINPATH] = \"#{orfeo.opt_prefix}\"\n    #   begin\n    #     inreplace \"#{proc_plugins}/otb/OTBUtils.py\" do |s|\n    #     # default geoid path\n    #     # try to replace first, so it fails (if already done) before global replaces\n    #     s.sub! \"OTB_FOLDER\", \"#{orfeo.opt_prefix}\"\n    #     s.sub! \"OTB_APP_FOLDER\", \"#{orfeo.opt_lib}/otb/applications\"\n    #     s.sub! \"OTB_GEOID_FILE\", \"#{orfeo.opt_libexec}/default_geoid/egm96.grd\"\n    #     end\n    #     puts \"ORFEO 6 OTBUtils.py has been updated\"\n    #     rescue Utils::InreplaceError\n    #     puts \"ORFEO 6 OTBUtils.py already updated\"\n    #   end\n    # end\n\n    # R\n    # Remove setting to activate provider\n    # See: https://github.com/north-road/qgis-processing-r/commit/7d8d182962392297690c02f77829b8cd64b5e8a9#diff-ce2ac984448f961cfa0f7e446bdbd4ca\n    # begin\n    #   inreplace \"#{proc_plugins}/processing_r/processing/provider.py\" do |s|\n    #   s.gsub! \"'Activate'), False))\", \"'Activate'), True))\"\n    #   end\n    #   puts \"R RAlgorithmProvider.py has been updated\"\n    #   rescue Utils::InreplaceError\n    #   puts \"R provider.py already updated\"\n    # end\n\n    # WhiteboxTools\n    begin\n      whitebox=\"#{Formula[\"osgeo-whitebox-tools\"].opt_bin}/whitebox_tools\"\n      inreplace \"#{proc_plugins}/processing_whitebox/whiteboxProvider.py\" do |s|\n      s.gsub! \"/usr/local/opt/whitebox-tools/bin/whitebox_tools\", \"#{whitebox}\"\n      end\n      puts \"Whitebox Tools whiteboxProvider.py has been updated\"\n      rescue Utils::InreplaceError\n      puts \"Whitebox Tools whiteboxProvider.py already updated\"\n    end\n\n    # TauDEM\n    begin\n      taudem=\"#{Formula[\"osgeo-taudem\"].opt_bin}\"\n      mpich=\"#{Formula[\"open-mpi\"].opt_bin}\"\n      inreplace \"#{proc_plugins}/processing_taudem/taudemProvider.py\" do |s|\n      s.gsub! \"/usr/local/opt/taudem/bin\", \"#{taudem}\"\n      s.gsub! \"/usr/local/opt/open-mpi/bin\", \"#{mpich}\"\n      end\n      puts \"TauDEM taudemProvider.py and has been updated\"\n      rescue Utils::InreplaceError\n      puts \"TauDEM taudemProvider.py already updated\"\n    end\n\n    # LASTools\n    begin\n      lastools=\"#{Formula[\"osgeo-lastools\"].opt_prefix}\"\n      inreplace \"#{proc_plugins}/lastools/LAStoolsProvider.py\" do |s|\n      s.gsub! 'C:\\LAStools', \"#{lastools}\"\n      end\n      puts \"LAStools LAStoolsProvider.py has been updated\"\n      rescue Utils::InreplaceError\n      puts \"LAStools LAStoolsProvider.py already updated\"\n    end\n\n    unless opts.include?(\"without-globe\")\n      osg = Formula[\"osgeo-openscenegraph\"]\n      envars[:OSG_LIBRARY_PATH] = \"#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}\"\n    end\n\n    if opts.include?(\"with-isolation\")\n      envars[:DYLD_FRAMEWORK_PATH] = \"#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks\"\n      versioned = %W[\n        #{Formula[\"sqlite\"].opt_lib}\n        #{Formula[\"expat\"].opt_lib}\n        #{Formula[\"libxml2\"].opt_lib}\n        #{HOMEBREW_PREFIX}/lib\n      ]\n      envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep)\n    end\n\n    # TODO: add for Py3\n    if opts.include?(\"with-isolation\") || File.exist?(\"/Library/Frameworks/GDAL.framework\")\n      envars[:PYQGIS_STARTUP] = opt_libexec/\"pyqgis_startup.py\"\n    end\n\n    # envars.each { |key, value| puts \"#{key.to_s}=#{value}\" }\n    # exit\n\n    # add env vars to QGIS.app's Info.plist, in LSEnvironment section\n    plst = app/\"Contents/Info.plist\"\n    # first delete any LSEnvironment setting, ignoring errors\n    # CAUTION!: may not be what you want, if .app already has LSEnvironment settings\n    dflt = `defaults read-type \\\"#{plst}\\\" LSEnvironment 2> /dev/null`\n    `defaults delete \\\"#{plst}\\\" LSEnvironment` if dflt\n    kv = \"{ \"\n    envars.each { |key, value| kv += \"'#{key}' = '#{value}'; \" }\n    kv += \"}\"\n    `defaults write \\\"#{plst}\\\" LSEnvironment \\\"#{kv}\\\"`\n    # add ability to toggle high resolution in Get Info dialog for app\n    hrc = `defaults read-type \\\"#{plst}\\\" NSHighResolutionCapable 2> /dev/null`\n    `defaults delete \\\"#{plst}\\\" NSHighResolutionCapable` if hrc\n    `defaults write \\\"#{plst}\\\" NSHighResolutionCapable \\\"True\\\"`\n    # leave the plist readable; convert from binary to XML format\n    `plutil -convert xml1 -- \\\"#{plst}\\\"`\n    # make sure plist is readble by all users\n    plst.chmod 0644\n    # update modification date on app bundle, or changes won't take effect\n    touch app.to_s\n\n    # add env vars to launch script for QGIS app's binary\n    qgis_bin = bin/name.to_s\n    rm_f qgis_bin if File.exist?(qgis_bin) # install generates empty file\n    bin_cmds = %W[#!/bin/sh\\n]\n    # setup shell-prepended env vars (may result in duplication of paths)\n    unless pths.include? HOMEBREW_PREFIX/\"bin\"\n      pths.insert(0, HOMEBREW_PREFIX/\"bin\")\n    end\n    # even though this should be affected by with-isolation, allow local env override\n    pths << \"$PATH\"\n    pypths << \"$PYTHONPATH\"\n    envars[:PATH] = pths.join(pthsep)\n    envars[:PYTHONPATH] = pypths.join(pthsep)\n    envars.each { |key, value| bin_cmds << \"export #{key}=#{value}\" }\n    bin_cmds << opt_prefix/\"QGIS.app/Contents/MacOS/QGIS \\\"$@\\\"\"\n    qgis_bin.write(bin_cmds.join(\"\\n\"))\n    qgis_bin.chmod 0755\n\n    # link python modules\n    (prefix/\"QGIS.app/Contents/Resources/python\").install_symlink Dir[\"#{Formula[\"osgeo-qgis-res\"].opt_libexec}/vendor/lib/python#{py_ver}/site-packages/*\"]\n    (prefix/\"QGIS.app/Contents/Resources/python/PyQt5\").install_symlink Dir[\"#{Formula[\"osgeo-sip\"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*\"]\n    ln_s \"#{Formula[\"osgeo-sip\"].opt_lib}/python#{py_ver}/site-packages/sipconfig.py\", \"#{prefix}/QGIS.app/Contents/Resources/python/sipconfig.py\"\n    ln_s \"#{Formula[\"osgeo-sip\"].opt_lib}/python#{py_ver}/site-packages/sipdistutils.py\", \"#{prefix}/QGIS.app/Contents/Resources/python/sipdistutils.py\"\n    (prefix/\"QGIS.app/Contents/Resources/python/PyQt5\").install_symlink Dir[\"#{Formula[\"osgeo-pyqt\"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*\"]\n    (prefix/\"QGIS.app/Contents/Resources/python/PyQt5\").install_symlink Dir[\"#{Formula[\"osgeo-pyqt-webkit\"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*\"]\n    (prefix/\"QGIS.app/Contents/Resources/python/PyQt5\").install_symlink Dir[\"#{Formula[\"osgeo-qscintilla2\"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*\"]\n    # (prefix/\"QGIS.app/Contents/Resources/python\").install_symlink Dir[\"#{Formula[\"osgeo-matplotlib\"].opt_lib}/python#{py_ver}/site-packages/*\"]\n    # (prefix/\"QGIS.app/Contents/Resources/python\").install_symlink Dir[\"#{Formula[\"numpy\"].opt_lib}/python#{py_ver}/site-packages/*\"]\n    # (prefix/\"QGIS.app/Contents/Resources/python\").install_symlink Dir[\"#{Formula[\"scipy\"].opt_lib}/python#{py_ver}/site-packages/*\"]\n    (prefix/\"QGIS.app/Contents/Resources/python\").install_symlink Dir[\"#{Formula[\"osgeo-gdal-python\"].opt_lib}/python#{py_ver}/site-packages/*\"]\n\n    # fix ImportError: No module named site for gdal_*.py\n    mkdir \"#{prefix}/QGIS.app/Contents/MacOS/bin\"\n    (prefix/\"QGIS.app/Contents/MacOS/bin\").install_symlink Dir[\"#{Formula[\"osgeo-gdal-python\"].opt_bin}/*\"]\n    (prefix/\"QGIS.app/Contents/MacOS/bin\").install_symlink Dir[\"#{Formula[\"osgeo-gdal\"].opt_bin}/*\"]\n    (prefix/\"QGIS.app/Contents/Frameworks\").install_symlink Dir[\"#{Formula[\"qt\"].opt_frameworks}/*\"]\n    (prefix/\"QGIS.app/Contents/Frameworks\").install_symlink Dir[\"#{Formula[\"python\"].opt_frameworks}/*\"]\n\n    ln_s \"#{prefix}/QGIS.app/Contents/MacOS/lib\", \"#{prefix}/QGIS.app/Contents/MacOS/bin\"\n    ln_s \"#{prefix}/QGIS.app/Contents/Frameworks\", \"#{prefix}/QGIS.app/Contents/MacOS\"\n    ln_s \"#{Formula[\"python\"].opt_bin}/python#{py_ver}\", \"#{prefix}/QGIS.app/Contents/MacOS/bin/python3\"\n    ln_s \"#{Formula[\"python\"].opt_bin}/python#{py_ver}\", \"#{prefix}/QGIS.app/Contents/MacOS/bin/python\"\n  end\n\n  def caveats\n    s = <<~EOS\n      \\nQGIS is built as an application bundle. Environment variables for the\n      Homebrew prefix are embedded in \\e[32mQGIS.app\\e[0m:\n\n        \\e[32m#{opt_prefix}/QGIS.app\\e[0m\n\n      You may also symlink \\e[32mQGIS.app\\e[0m into \\e[32m/Applications\\e[0m or \\e[32m~/Applications\\e[0m:\n\n        \\e[32mln -Fs `find $(brew --prefix) -name \"QGIS.app\"` /Applications/QGIS.app\\e[0m\n\n      To directly run the \\e[32m`QGIS.app/Contents/MacOS/QGIS`\\e[0m binary use the wrapper\n      script pre-defined with Homebrew prefix environment variables:\n\n        \\e[32m#{opt_bin}/#{name}\\e[0m\n\n      If you need QGIS to appear in Spotlight, create and run the following script:\n\n        \\e[32m#!/usr/bin/env bash\\e[0m\n\n        \\e[32mqgis_location=$(find $(brew --prefix)/Cellar/osgeo-qgis/ -name \"3.*\" -print -quit)/QGIS.app\\e[0m\n        \\e[32mosascript -e 'tell application \"Finder\"' -e 'make new alias to file (posix file \"'$qgis_location'\") at (posix file \"/Applications\")' -e 'end tell'\\e[0m\n\n        https://github.com/OSGeo/homebrew-osgeo4mac/issues/607#issuecomment-455905926\n\n      NOTE: Your current PATH and PYTHONPATH environment variables are honored\n            when launching via the wrapper script, while launching \\e[32mQGIS.app\\e[0m\n            bundle they are not.\n\n      For standalone Python 3 development, set the following environment variable:\n\n        \\e[32mexport PYTHONPATH=#{python_site_packages}:#{qgis_site_packages}:#{qgis_python_packages}:#{gdal_python_packages}:$PYTHONPATH\\e[0m\n\n    EOS\n\n    if build.with?(\"isolation\")\n      s += <<~EOS\n        \\033[31mQGIS built with isolation enabled. This allows it to coexist with other types of installations\n        of QGIS on your Mac. However, on versions >= 2.0.1, this also means Python modules installed in the\n        *system* Python will NOT be available to Python processes within QGIS.app.\\e[0m\n\n      EOS\n    end\n\n    s += <<~EOS\n\n      You installed LAStools!\n\n      If you will use Wine to have more features:\n\n      \\n1 - Download \\e[32mhttp://lastools.org/download/LAStools.zip\\e[0m and unzip LASTools.\n          Remember where you unzipped it.\n\n      2 - Start QGIS. Select \\e[32mProcessing/Options.\\e[0m\n          In the Providers section scroll to “LASTools”\n\n          \\033[31mLASTools folder:\\e[0m \\e[32mLASTools directory\\e[0m (unzipped)\n          \\033[31mWine Folder:\\e[0m \\e[32m#{Formula[\"wine\"].opt_bin}\\e[0m\\n\n    EOS\n\n    s += <<~EOS\n      If you have built GRASS 7 for the Processing plugin set the following in QGIS\n\n        \\e[32mProcessing -> Options: Providers -> GRASS GIS 7 commands -> GRASS 7 folder\\e[0m\n\n        to \\e[32m#{HOMEBREW_PREFIX}/opt/osgeo-grass/grass-base\\e[0m\n\n    EOS\n\n    s += <<~EOS\n      QGIS plugins may need extra Python modules to function. Most can be installed\n      with \\e[32mpip\\e[0m in a Terminal:\n\n          \\e[32mpip3 install modulename\\e[0m\n\n      If you want to upgrade modules, add the \\e[32m-U\\e[0m option:\n\n          \\e[32mpip3 install -U modulename\\e[0m\n\n    EOS\n\n    s += <<~EOS\n\n      Activate plugins\n\n        \\e[32mManage and Install Plugins -> Installed ->  Plugin name\\e[0m (click its checkbox)\n\n    EOS\n    s\n  end\n\n  test do\n    output = `#{bin}/#{name.to_s} --help 2>&1` # why does help go to stderr?\n    assert_match /^QGIS is a user friendly/, output\n  end\n\n  private\n\n  def majmin_ver\n    grass_version = \"#{Formula[\"osgeo-grass\"].version}\"\n    ver_split = grass_version.to_s.split(\".\")\n    ver_split[0] + ver_split[1]\n  end\n\n  # def brewed_openscenegraph?\n  #   Formula[\"osgeo-openscenegraph\"].opt_prefix.exist?\n  # end\n\n  # def brewed_osgqt?\n  #   Formula[\"osgeo-osgqt\"].opt_prefix.exist?\n  # end\n\n  # def brewed_osgearth?\n  #   Formula[\"osgeo-osgearth\"].opt_prefix.exist?\n  # end\n\n  def brewed_oracle?\n    Formula[\"osgeo-oracle-client-sdk\"].opt_prefix.exist?\n  end\n\n  def brewed_python?\n    Formula[\"python\"].linked_keg.exist?\n  end\n\n  def python_exec\n    if brewed_python?\n      \"#{Formula[\"python\"].opt_bin}/python3\"\n    else\n      py_exec = `which python3`.strip\n      raise if py_exec == \"\"\n      py_exec\n    end\n  end\n\n  def py_ver\n    `#{python_exec} -c 'import sys;print(\"{0}.{1}\".format(sys.version_info[0],sys.version_info[1]))'`.strip\n  end\n\n  def python_prefix\n    `#{python_exec} -c 'import sys;print(sys.prefix)'`.strip\n  end\n\n  def qgis_python_packages\n    \"#{opt_prefix}/QGIS.app/Contents/Resources/python\"\n  end\n\n  def qgis_site_packages\n    \"#{opt_lib}/python#{py_ver}/site-packages\"\n  end\n\n  def python_site_packages\n    \"#{HOMEBREW_PREFIX}/opt/lib/python#{py_ver}/site-packages\"\n  end\n\n  def gdal_python_packages\n    \"#{Formula[\"osgeo-gdal-python\"].opt_lib}/python#{py_ver}/site-packages\"\n  end\n\n  def gdal_python_opt_bin\n    \"#{Formula[\"osgeo-gdal-python\"].opt_bin}\"\n  end\n\n  def gdal_opt_bin\n    \"#{Formula[\"osgeo-gdal\"].opt_bin}\"\n  end\nend\n\n__END__\n\n--- a/cmake/FindQsci.cmake\n+++ b/cmake/FindQsci.cmake\n@@ -21,16 +21,20 @@\n   SET(QSCI_FOUND TRUE)\n ELSE(EXISTS QSCI_MOD_VERSION_STR)\n\n-  FIND_FILE(_find_qsci_py FindQsci.py PATHS ${CMAKE_MODULE_PATH})\n+  # FIND_FILE(_find_qsci_py FindQsci.py PATHS ${CMAKE_MODULE_PATH})\n\n   SET(QSCI_VER 5)\n\n-  EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_qsci_py} ${QSCI_VER} OUTPUT_VARIABLE qsci_ver)\n+  # EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_qsci_py} ${QSCI_VER} OUTPUT_VARIABLE qsci_ver)\n\n   IF(qsci_ver)\n     STRING(REGEX REPLACE \"^qsci_version_str:([^\\n]+).*$\" \"\\\\1\" QSCI_MOD_VERSION_STR ${qsci_ver})\n     SET(QSCI_FOUND TRUE)\n   ENDIF(qsci_ver)\n+\n+  SET(QSCI_FOUND TRUE)\n+  SET(QSCI_MOD_VERSION_STR 2.11.1)\n+\n\n   IF(QSCI_FOUND)\n     FIND_PATH(QSCI_SIP_DIR\n\n--- a/cmake/FindPyQt5.py\n+++ b/cmake/FindPyQt5.py\n@@ -39,7 +39,7 @@\n     import os.path\n     import sys\n     cfg = sipconfig.Configuration()\n-    sip_dir = cfg.default_sip_dir\n+    sip_dir = \"HOMEBREW_PREFIX/share/sip\"\n     if sys.platform.startswith('freebsd'):\n         py_version = str(sys.version_info.major) + str(sys.version_info.minor)\n         sip_dir = sip_dir.replace(py_version, '')\n\n--- a/cmake/FindPyQt5.cmake\n+++ b/cmake/FindPyQt5.cmake\n@@ -37,9 +37,7 @@\n     STRING(REGEX REPLACE \".*\\npyqt_version_num:([^\\n]+).*$\" \"\\\\1\" PYQT5_VERSION_NUM ${pyqt_config})\n     STRING(REGEX REPLACE \".*\\npyqt_mod_dir:([^\\n]+).*$\" \"\\\\1\" PYQT5_MOD_DIR ${pyqt_config})\n     STRING(REGEX REPLACE \".*\\npyqt_sip_dir:([^\\n]+).*$\" \"\\\\1\" PYQT5_SIP_DIR ${pyqt_config})\n-    IF(EXISTS ${PYQT5_SIP_DIR}/Qt5)\n-      SET(PYQT5_SIP_DIR ${PYQT5_SIP_DIR}/Qt5)\n-    ENDIF(EXISTS ${PYQT5_SIP_DIR}/Qt5)\n+    SET(PYQT5_SIP_DIR ${PYQT5_SIP_DIR})\n     STRING(REGEX REPLACE \".*\\npyqt_sip_flags:([^\\n]+).*$\" \"\\\\1\" PYQT5_SIP_FLAGS ${pyqt_config})\n     STRING(REGEX REPLACE \".*\\npyqt_bin_dir:([^\\n]+).*$\" \"\\\\1\" PYQT5_BIN_DIR ${pyqt_config})\n     STRING(REGEX REPLACE \".*\\npyqt_sip_module:([^\\n]+).*$\" \"\\\\1\" PYQT5_SIP_IMPORT ${pyqt_config})\n\n\n# --- a/src/core/processing/qgsprocessingfeedback.cpp\n# +++ b/src/core/processing/qgsprocessingfeedback.cpp\n# @@ -22,6 +22,9 @@\n#  #if PROJ_VERSION_MAJOR > 4\n#  #include <proj.h>\n#  #else\n# +#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H\n# +#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H\n# +#endif\n#  #include <proj_api.h>\n#  #endif\n#\n# @@ -124,4 +127,3 @@ void QgsProcessingMultiStepFeedback::updateOverallProgress( double progress )\n#    double currentAlgorithmProgress = progress / mChildSteps;\n#    mFeedback->setProgress( baseProgress + currentAlgorithmProgress );\n#  }\n# -\n\n\n--- a/src/app/qgisapp.cpp\n+++ b/src/app/qgisapp.cpp\n@@ -509,7 +509,7 @@\n   if ( QgsProject::instance()->isDirty() )\n     caption.prepend( '*' );\n\n-  caption += QgisApp::tr( \"QGIS\" );\n+  caption += QgisApp::tr( \"OSGeo4Mac - QGIS\" );\n\n   if ( Qgis::QGIS_VERSION.endsWith( QLatin1String( \"Master\" ) ) )\n   {\n\n\n--- a/src/ui/qgsabout.ui\n+++ b/src/ui/qgsabout.ui\n@@ -244,6 +244,16 @@\n               </size>\n              </property>\n             </spacer>\n+           </item>\n+           <item>\n+            <widget class=\"QLabel\" name=\"label_osgeo\">\n+             <property name=\"text\">\n+              <string>OSGeo4Mac Team / Maintainer: @fjperini - Collaborator: @luispuerto</string>\n+             </property>\n+             <property name=\"alignment\">\n+              <set>Qt::AlignCenter</set>\n+             </property>\n+            </widget>\n            </item>\n            <item>\n             <widget class=\"QLabel\" name=\"label_3\">\n"
  },
  {
    "path": "boneyard/osgeo-sip.rb",
    "content": "class Unlinked < Requirement\n  fatal true\n\n  satisfy(:build_env => false) { !core_sip_linked }\n\n  def core_sip_linked\n    Formula[\"sip\"].linked_keg.exist?\n  rescue\n    return false\n  end\n\n  def message\n    s = \"\\033[31mYou have other linked versions!\\e[0m\\n\\n\"\n\n    s += \"Unlink with \\e[32mbrew unlink sip\\e[0m or remove with brew \\e[32muninstall --ignore-dependencies sip\\e[0m\\n\\n\" if core_sip_linked\n    s\n  end\nend\n\n\nclass OsgeoSip < Formula\n  desc \"Tool to create Python bindings for C and C++ libraries\"\n  homepage \"https://www.riverbankcomputing.com/software/sip/intro\"\n  url \"https://www.riverbankcomputing.com/static/Downloads/sip/4.19.22/sip-4.19.22.tar.gz\"\n  sha256 \"e1b768824ec1a2ee38dd536b6b6b3d06de27b00a2f5f55470d1b512306e3be45\"\n\n  # revision 5\n\n  head \"https://www.riverbankcomputing.com/hg/sip\", :using => :hg\n\n  bottle do\n    root_url \"https://bottle.download.osgeo.org\"\n    cellar :any_skip_relocation\n    sha256 \"85280c9f58b9b1e4f601cebb09b1a69729030ea4188348fde32d02698db5cb55\" => :catalina\n    sha256 \"85280c9f58b9b1e4f601cebb09b1a69729030ea4188348fde32d02698db5cb55\" => :mojave\n    sha256 \"85280c9f58b9b1e4f601cebb09b1a69729030ea4188348fde32d02698db5cb55\" => :high_sierra\n  end\n\n  # keg_only \"sip\" is already provided by homebrew/core\"\n  # we will verify that other versions are not linked\n  depends_on Unlinked\n\n  depends_on \"python\"\n\n  def install\n    ENV.prepend_path \"PATH\", Formula[\"python\"].opt_libexec/\"bin\"\n    ENV.delete(\"SDKROOT\") # Avoid picking up /Application/Xcode.app paths\n\n    if build.head?\n      # Link the Mercurial repository into the download directory so\n      # build.py can use it to figure out a version number.\n      ln_s cached_download/\".hg\", \".hg\"\n      # build.py doesn't run with python3\n      system \"python3\", \"build.py\", \"prepare\"\n    end\n\n    version = Language::Python.major_minor_version \"python3\"\n    system \"python3\", \"configure.py\",\n                   \"--deployment-target=#{MacOS.version}\",\n                   \"--destdir=#{lib}/python#{version}/site-packages\",\n                   \"--bindir=#{bin}\",\n                   \"--incdir=#{include}\",\n                   \"--sipdir=#{HOMEBREW_PREFIX}/share/sip\",\n                   \"--sip-module=PyQt5.sip\",\n                   \"--no-dist-info\"\n    system \"make\"\n    system \"make\", \"install\"\n    system \"make\", \"clean\"\n  end\n\n  def post_install\n    (HOMEBREW_PREFIX/\"share/sip\").mkpath\n  end\n\n  def caveats; <<~EOS\n    The sip-dir for Python is #{HOMEBREW_PREFIX}/share/sip.\n  EOS\n  end\n\n  test do\n    (testpath/\"test.h\").write <<~EOS\n      #pragma once\n      class Test {\n      public:\n        Test();\n        void test();\n      };\n    EOS\n    (testpath/\"test.cpp\").write <<~EOS\n      #include \"test.h\"\n      #include <iostream>\n      Test::Test() {}\n      void Test::test()\n      {\n        std::cout << \"Hello World!\" << std::endl;\n      }\n    EOS\n    (testpath/\"test.sip\").write <<~EOS\n      %Module test\n      class Test {\n      %TypeHeaderCode\n      #include \"test.h\"\n      %End\n      public:\n        Test();\n        void test();\n      };\n    EOS\n\n    system ENV.cxx, \"-shared\", \"-Wl,-install_name,#{testpath}/libtest.dylib\",\n                    \"-o\", \"libtest.dylib\", \"test.cpp\"\n    system bin/\"sip\", \"-b\", \"test.build\", \"-c\", \".\", \"test.sip\"\n\n    version = Language::Python.major_minor_version \"python3\"\n    ENV[\"PYTHONPATH\"] = lib/\"python#{version}/site-packages\"\n    system \"python3\", \"-c\", '\"import PyQt5.sip\"'\n  end\nend\n"
  },
  {
    "path": "boneyard/ossim@2.1.rb",
    "content": "class OssimAT21 < Formula\n  desc \"Geospatial libs and apps to process imagery, terrain, and vector data\"\n  homepage \"https://trac.osgeo.org/ossim/\"\n\n  stable do\n    url \"https://github.com/ossimlabs/ossim/archive/EgmontKey-2.1.0.tar.gz\"\n    sha256 \"f1a9577c10ee98962d024b19e78ba53b029d5acc4f506b322a5cffe89e3c122f\"\n  end\n\n  bottle do\n    root_url \"https://dl.bintray.com/homebrew-osgeo/osgeo-bottles\"\n    rebuild 1\n    sha256 \"9002228f425c996fe332e1e150424cf2bc6bb94b8bea8687ab626a9185e872d7\" => :high_sierra\n    sha256 \"9002228f425c996fe332e1e150424cf2bc6bb94b8bea8687ab626a9185e872d7\" => :sierra\n  end\n\n  keg_only :versioned_formula\n\n  option \"with-curl-apps\", \"Build curl-dependent apps\"\n  option \"without-framework\", \"Generate library instead of framework\"\n  option \"with-gui\", \"Build new ossimGui library and geocell application\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"open-scene-graph\" # just for its OpenThreads lib\n  depends_on \"jpeg\"\n  depends_on \"jsoncpp\"\n  depends_on \"libtiff\"\n  depends_on \"osgeo-libgeotiff\"\n  depends_on \"geos\"\n  depends_on \"freetype\"\n  depends_on \"zlib\"\n  depends_on \"open-mpi\" => :optional\n\n  def install\n    ENV.cxx11\n\n    # build setup expects the checkout to be in subdir named 'ossim'\n#    cur_dir = Dir[\"*\", \".git*\"]\n#    mkdir \"ossim\"\n#    (buildpath/\"ossim\").install cur_dir\n#    mkdir \"build\"\n\n    ENV[\"OSSIM_DEV_HOME\"] = buildpath.to_s\n    ENV[\"OSSIM_BUILD_DIR\"] = (buildpath/\"build\").to_s\n    ENV[\"OSSIM_INSTALL_PREFIX\"] = prefix.to_s\n\n    # TODO: add options and deps for plugins\n    args = std_cmake_args + %W[\n      -DCMAKE_CXX_STANDARD=11\n      -DOSSIM_DEV_HOME=#{ENV[\"OSSIM_DEV_HOME\"]}\n      -DINSTALL_LIBRARY_DIR=lib\n      -DBUILD_OSSIM_APPS=ON\n      -DBUILD_OMS=OFF\n      -DBUILD_CNES_PLUGIN=OFF\n      -DBUILD_GEOPDF_PLUGIN=OFF\n      -DBUILD_GDAL_PLUGIN=OFF\n      -DBUILD_HDF5_PLUGIN=OFF\n      -DBUILD_KAKADU_PLUGIN=OFF\n      -DBUILD_KML_PLUGIN=OFF\n      -DBUILD_MRSID_PLUGIN=OFF\n      -DMRSID_DIR=\n      -DOSSIM_PLUGIN_LINK_TYPE=SHARED\n      -DBUILD_OPENCV_PLUGIN=OFF\n      -DBUILD_OPENJPEG_PLUGIN=OFF\n      -DBUILD_PDAL_PLUGIN=OFF\n      -DBUILD_PNG_PLUGIN=OFF\n      -DBUILD_POTRACE_PLUGIN=OFF\n      -DBUILD_SQLITE_PLUGIN=OFF\n      -DBUILD_WEB_PLUGIN=OFF\n      -DBUILD_OSSIM_VIDEO=OFF\n      -DBUILD_OSSIM_WMS=OFF\n      -DBUILD_OSSIM_PLANET=OFF\n      -DOSSIM_BUILD_ADDITIONAL_DIRECTORIES=\n      -DBUILD_OSSIM_TESTS=OFF\n    ]\n\n    args << \"-DBUILD_OSSIM_FRAMEWORKS=\" + (build.with?(\"framework\") ? \"ON\" : \"OFF\")\n    args << \"-DBUILD_OSSIM_MPI_SUPPORT=\" + (build.with?(\"mpi\") ? \"ON\" : \"OFF\")\n    args << \"-DBUILD_OSSIM_CURL_APPS=\" + (build.with?(\"curl-apps\") ? \"ON\" : \"OFF\")\n    args << \"-DBUILD_OSSIM_GUI=\" + (build.with?(\"gui\") ? \"ON\" : \"OFF\")\n\n    # fix up include/ossim/base/ossimRefPtr.h\n#    inreplace \"ossim/include/ossim/base/ossimRefPtr.h\" do |s|\n#      s.sub! /(#include <stddef.h>)/, \"\\\\1\\n#include <cstddef>\"\n#      s.gsub! \"nullptr_t\", \"std::nullptr_t\"\n#    end\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\"\n      system \"make\", \"install\"\n#      File.rename (prefix/\"lib64\").to_s, lib.to_s\n    end\n  end\n\n  test do\n    system bin/\"ossim-cli\", \"--version\"\n  end\nend\n"
  },
  {
    "path": "boneyard/pdfium.rb",
    "content": "class Pdfium < Formula\n  ver = \"3625\".freeze # relates to chromium version\n\n  desc \"Google-contributed PDF library (without V8 JavaScript engine)\"\n  homepage \"https://pdfium.googlesource.com/pdfium/\"\n  url \"https://pdfium.googlesource.com/pdfium.git\",\n      :branch => \"chromium/#{ver}\"\n  version ver\n\n  bottle do\n    root_url \"https://dl.bintray.com/homebrew-osgeo/osgeo-bottles\"\n    cellar :any_skip_relocation\n    sha256 \"8d36c01cd5d05370bbcdfc8e33e74b1784b8373d4d0184a954db207079e2a605\" => :mojave\n    sha256 \"8d36c01cd5d05370bbcdfc8e33e74b1784b8373d4d0184a954db207079e2a605\" => :high_sierra\n    sha256 \"8d36c01cd5d05370bbcdfc8e33e74b1784b8373d4d0184a954db207079e2a605\" => :sierra\n  end\n\n  depends_on \"python@2\" => :build # gyp doesn't run under 2.6 or lower\n\n  resource \"depot_tools\" do\n    url \"https://chromium.googlesource.com/chromium/tools/depot_tools.git\"\n  end\n\n  resource \"chromium_icu\" do\n    url \"https://chromium.googlesource.com/chromium/deps/icu.git\",\n      :revision => \"e4194dc7bbb3305d84cbb1b294274ca70d230721\"\n  end\n\n  def pdfium_build_dir\n    \"out/Release_x64\"\n  end\n\n  def copy_file_and_dir_path(dir_search, dst_pathname)\n    Dir[dir_search].each do |f|\n      dst = dst_pathname/File.dirname(f)\n      dst.mkpath\n      dst.install(f)\n    end\n  end\n\n  def install\n    # need to move git checkout into gclient solutions directory\n    base_install = Dir[\".*\", \"*\"] - [\".\", \"..\", \".brew_home\"]\n    (buildpath/\"pdfium/\").mkpath\n    base_install.each { |f| mv f, buildpath/\"pdfium/\" }\n\n    # install chromium's build tools, includes ninja and gyp\n    (buildpath/\"depot_tools\").install resource(\"depot_tools\")\n    ENV.prepend_path \"PATH\", buildpath/\"depot_tools\"\n\n    # Add Chromium ICU\n    (buildpath/\"pdfium/third_party/icu\").install resource(\"chromium_icu\")\n\n    # use pdfium's gyp scripts to create ninja build files.\n    ENV[\"GYP_GENERATORS\"] = \"ninja\"\n\n    system \"gclient\", \"config\", \"--unmanaged\", \"--name=pdfium\",\n           \"https://pdfium.googlesource.com/pdfium.git\" # @#{pdfium_rev}\n\n    system \"gclient\", \"sync\", \"--no-history\" # \"--shallow\"\n\n    cd \"pdfium\" do\n      cwdir = Pathname.new(Dir.pwd)\n      # system \"./build/install-build-deps.sh\" # Linux-only\n      (cwdir/pdfium_build_dir).mkpath\n      # write out config args\n      (cwdir/\"#{pdfium_build_dir}/args.gn\").write <<~EOS\n        # Build arguments go here.\n        # See \"gn args <out_dir> --list\" for available build arguments.\n        use_goma=false\n        is_debug=false\n        pdf_use_skia=false\n        pdf_use_skia_paths=false\n        pdf_enable_xfa=false\n        pdf_enable_v8=false\n        pdf_is_standalone=true\n        pdf_is_complete_lib=true\n        is_component_build=false\n        clang_use_chrome_plugins=false\n        is_clang=true\n        mac_deployment_target=\"#{MacOS.version}\"\n      EOS\n      system \"gn\", \"gen\", pdfium_build_dir\n\n      # compile release build of pdfium & its test binaries\n      system \"ninja\", \"-C\", pdfium_build_dir, \"pdfium_all\"\n\n      # copy header files into a pdfium directory\n      copy_file_and_dir_path(\"core/**/*.h\", include/\"pdfium\")\n      copy_file_and_dir_path(\"fpdfsdk/**/*.h\", include/\"pdfium\")\n      (include/\"pdfium\").install Dir[\"public/**/*.h\"]\n\n      # and 3rd party dependency headers\n      (include/\"pdfium/third_party/base/numerics\").install Dir[\"third_party/base/numerics/*.h\"]\n      (include/\"pdfium/third_party/base\").install Dir[\"third_party/base/*.h\"]\n\n      # test data\n      (libexec/\"testing/resources\").install Dir[\"testing/resources/*\"]\n\n      cd pdfium_build_dir do\n        (lib/\"pdfium\").install Dir[\"obj/lib*.a\"]\n        bin.install \"pdfium_test\", \"pdfium_diff\"\n        (libexec/pdfium_build_dir).install Dir[\"pdfium_*tests\"]\n      end\n    end\n  end\n\n  def caveats; <<~EOS\n    For building other software, static libs are located in\n      #{opt_lib}/pdfium\n\n    and includes in\n      #{opt_include}/pdfium\n  EOS\n  end\n\n  test do\n    system libexec/\"#{pdfium_build_dir}/pdfium_unittests\"\n    system libexec/\"#{pdfium_build_dir}/pdfium_embeddertests\"\n  end\nend\n"
  },
  {
    "path": "boneyard/points2grid.rb",
    "content": "require 'formula'\n\nclass Points2grid < Formula\n  homepage 'https://github.com/CRREL/points2grid'\n  url 'https://github.com/CRREL/points2grid/archive/1.2.1.tar.gz'\n  sha1 'afd1b8ac0086b7ac220a3615e0ec1512161a4628'\n\n  head \"https://github.com/CRREL/points2grid.git\"\n\n  depends_on 'cmake' => :build\n  depends_on 'boost'\n\n  def install\n    libexec.install \"example.las\"\n    system \"cmake\", \".\", *std_cmake_args\n    system \"make install\"\n  end\n\n  test do\n    mktemp do\n      system bin/\"points2grid\",\n             \"-i\", libexec/\"example.las\",\n             \"-o\", \"example\",\n             \"--max\", \"--output_format\", \"grid\"\n      assert_equal 5, %x(grep -c '423.820000' < example.max.grid).strip.to_i\n    end\n  end\nend\n"
  },
  {
    "path": "boneyard/pyqt-qt4.rb",
    "content": "class PyqtQt4 < Formula\n  desc \"Python bindings for Qt\"\n  homepage \"https://www.riverbankcomputing.com/software/pyqt/intro\"\n  url \"https://downloads.sf.net/project/pyqt/PyQt4/PyQt-4.11.4/PyQt-mac-gpl-4.11.4.tar.gz\"\n  sha256 \"f178ba12a814191df8e9f87fb95c11084a0addc827604f1a18a82944225ed918\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    rebuild 1\n    sha256 \"00d6c9ee4e673050ebc4bdf7fbd7f95689981fe7e2186bc8be4f1ab16c07a1bd\" => :high_sierra\n    sha256 \"00d6c9ee4e673050ebc4bdf7fbd7f95689981fe7e2186bc8be4f1ab16c07a1bd\" => :sierra\n  end\n\n  depends_on \"python@2\" => :recommended\n  depends_on \"qt-4\"\n  depends_on \"sip-qt4\"\n\n  def install\n    if build.without? \"python@2\"\n      # this is a flaw in Homebrew, where `depends on :python` alone does not work\n      odie \"Must be built with Python2\"\n    end\n\n    # On Mavericks we want to target libc++, this requires a non default qt makespec\n    if ENV.compiler == :clang && MacOS.version >= :mavericks\n      ENV.append \"QMAKESPEC\", \"unsupported/macx-clang-libc++\"\n    end\n\n    ENV.prepend_path \"PATH\", \"#{Formula[\"sip-qt4\"].opt_libexec}/bin\"\n\n    Language::Python.each_python(build) do |python, version|\n      ENV[\"PYTHONPATH\"] = \"#{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages\"\n\n      args = %W[\n        --confirm-license\n        --bindir=#{bin}\n        --destdir=#{lib}/qt-4/python#{version}/site-packages\n        --sipdir=#{share}/sip-qt4\n      ]\n\n      # We need to run \"configure.py\" so that pyqtconfig.py is generated, which\n      # is needed by QGIS, PyQWT (and many other PyQt interoperable\n      # implementations such as the ROS GUI libs). This file is currently needed\n      # for generating build files appropriate for the qmake spec that was used\n      # to build Qt. The alternatives provided by configure-ng.py is not\n      # sufficient to replace pyqtconfig.py yet (see\n      # https://github.com/qgis/QGIS/pull/1508). Using configure.py is\n      # deprecated and will be removed with SIP v5, so we do the actual compile\n      # using the newer configure-ng.py as recommended. In order not to\n      # interfere with the build using configure-ng.py, we run configure.py in a\n      # temporary directory and only retain the pyqtconfig.py from that.\n\n      oldargs = args + %W[--plugin-destdir=#{lib}/qt-4/plugins]\n\n      require \"tmpdir\"\n      dir = Dir.mktmpdir\n      begin\n        cp_r(Dir.glob(\"*\"), dir)\n        cd dir do\n          system python, \"configure.py\", *oldargs\n          qt4 = Formula[\"qt-4\"]\n          # can't use qt4.prefix anymore, as it is opt-relative\n          inreplace \"pyqtconfig.py\",\n                    qt4.opt_prefix.realpath,\n                    qt4.opt_prefix\n          inreplace \"pyqtconfig.py\",\n                    \"#{HOMEBREW_CELLAR}/#{name}/#{installed_version}\",\n                    opt_prefix\n          (lib/\"qt-4/python#{version}/site-packages/PyQt4\").install \"pyqtconfig.py\"\n        end\n      ensure\n        remove_entry_secure dir\n      end\n\n      # On Mavericks we want to target libc++, this requires a non default qt makespec\n      if ENV.compiler == :clang && MacOS.version >= :mavericks\n        args << \"--spec\" << \"unsupported/macx-clang-libc++\"\n      end\n\n      ngargs = args + %W[\n        --sip-incdir=#{Formula[\"sip-qt4\"].opt_libexec}/include\n        --designer-plugindir=#{lib}/qt-4/plugins/designer\n      ]\n\n      system python, \"configure-ng.py\", *ngargs\n      system \"make\"\n      system \"make\", \"install\"\n      system \"make\", \"clean\" # for when building against multiple Pythons\n    end\n  end\n\n  def caveats\n    s = \"Phonon support is broken.\\n\\n\"\n    s += \"Python modules in:\\n\"\n    Language::Python.each_python(build) do |_python, version|\n      s += \"  #{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages/PyQt4\"\n    end\n    s\n  end\n\n  test do\n    Language::Python.each_python(build) do |python, version|\n      ENV[\"PYTHONPATH\"] = HOMEBREW_PREFIX/\"lib/qt-4/python#{version}/site-packages\"\n      system \"#{bin}/pyuic4\", \"--version\"\n      system \"#{bin}/pylupdate4\", \"-version\"\n      system python, \"-c\", \"import PyQt4\"\n      %w[\n        Qt\n        QtCore\n        QtDeclarative\n        QtDesigner\n        QtGui\n        QtHelp\n        QtMultimedia\n        QtNetwork\n        QtOpenGL\n        QtScript\n        QtScriptTools\n        QtSql\n        QtSvg\n        QtTest\n        QtWebKit\n        QtXml\n        QtXmlPatterns\n      ].each { |mod| system python, \"-c\", \"import PyQt4.#{mod}\" }\n    end\n  end\nend\n"
  },
  {
    "path": "boneyard/qca-qt4.rb",
    "content": "class QcaQt4 < Formula\n  desc \"Qt Cryptographic Architecture (QCA)\"\n  homepage \"http://delta.affinix.com/qca/\"\n  head \"https://anongit.kde.org/qca.git\"\n\n  stable do\n    url \"https://github.com/KDE/qca/archive/v2.1.1.tar.gz\"\n    sha256 \"aa8ec328da163a5e20ac59146e56b17d0677789f020d0c3875c4ed5e9e82e749\"\n\n    # Fix for linking CoreFoundation and removing deprecated code; already in HEAD).\n    patch do\n      url \"https://github.com/KDE/qca/commit/f223ce03d4b94ffbb093fc8be5adf8d968f54434.diff?full_index=1\"\n      sha256 \"e882bfa4a290d62a7ddea8c05019d5e616234027c95f7f8339072af03a2e6bc7\"\n    end\n\n    # Fix for framework installation; already in HEAD).\n    patch do\n      url \"https://github.com/KDE/qca/commit/9e4bf795434304bce32626fe0f6887c10fec0824.diff?full_index=1\"\n      sha256 \"a7dc91e0d68b38712fbe2228f3c028090e6e2f8ba3a74b334b46bae4276430ee\"\n    end\n  end\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    rebuild 1\n    sha256 \"b36a88ea9d3f7d2588341e37e9b2c6d4580cb1de1cdafa2a09a4571d5afe722f\" => :high_sierra\n    sha256 \"b36a88ea9d3f7d2588341e37e9b2c6d4580cb1de1cdafa2a09a4571d5afe722f\" => :sierra\n  end\n\n  keg_only \"newer Qt5-only version in homebrew-core\"\n\n  option \"with-api-docs\", \"Build API documentation\"\n\n  deprecated_option \"with-gnupg\" => \"with-gpg2\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"pkg-config\" => :build\n  depends_on \"qt-4\"\n\n  # Plugins (QCA needs at least one plugin to do anything useful)\n  depends_on \"openssl\" # qca-ossl\n  depends_on \"botan\" => :optional # qca-botan\n  depends_on \"libgcrypt\" => :optional # qca-gcrypt\n  depends_on \"gnupg\"\n  depends_on \"nss\" => :optional # qca-nss\n  depends_on \"pkcs11-helper\" => :optional # qca-pkcs11\n\n  if build.with? \"api-docs\"\n    depends_on \"graphviz\" => :build\n    depends_on \"doxygen\" => :build\n  end\n\n  def install\n    args = std_cmake_args\n    args << \"-DQT4_BUILD=ON\"\n    args << \"-DBUILD_TESTS=OFF\"\n\n    # Plugins (qca-ossl, qca-cyrus-sasl, qca-logger, qca-softstore always built)\n    args << \"-DWITH_botan_PLUGIN=#{build.with?(\"botan\") ? \"YES\" : \"NO\"}\"\n    args << \"-DWITH_gcrypt_PLUGIN=#{build.with?(\"libgcrypt\") ? \"YES\" : \"NO\"}\"\n    args << \"-DWITH_gnupg_PLUGIN=#{build.with?(\"gpg2\") ? \"YES\" : \"NO\"}\"\n    args << \"-DWITH_nss_PLUGIN=#{build.with?(\"nss\") ? \"YES\" : \"NO\"}\"\n    args << \"-DWITH_pkcs11_PLUGIN=#{build.with?(\"pkcs11-helper\") ? \"YES\" : \"NO\"}\"\n\n    system \"cmake\", \".\", *args\n    system \"make\", \"install\"\n\n    if build.with? \"api-docs\"\n      system \"make\", \"doc\"\n      doc.install \"apidocs/html\"\n    end\n  end\n\n  test do\n    system bin/\"qcatool\", \"--noprompt\", \"--newpass=\",\n                          \"key\", \"make\", \"rsa\", \"2048\", \"test.key\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qgis-18.rb",
    "content": "require 'formula'\n\nclass PyQtImportable < Requirement\n  fatal true\n  satisfy { quiet_system 'python', '-c', '\"from PyQt4 import QtCore\"' }\n\n  def message\n    <<~EOS\n      Python could not import the PyQt4 module. This will cause the QGIS build to fail.\n      The most common reason for this failure is that the PYTHONPATH needs to be adjusted.\n      The pyqt caveats explain this adjustment and may be reviewed using:\n\n          brew info pyqt\n    EOS\n  end\nend\n\nclass Qgis18 < Formula\n  homepage 'http://www.qgis.org'\n  url 'http://qgis.org/downloads/qgis-1.8.0.tar.bz2'\n  sha1 '99c0d716acbe0dd70ad0774242d01e9251c5a130'\n\n  depends_on 'cmake' => :build\n  depends_on :python\n  depends_on PyQtImportable\n\n  depends_on 'gsl'\n  depends_on 'pyqt'\n  depends_on 'qwt60'\n  depends_on 'expat'\n  depends_on 'gdal-19'\n  depends_on 'proj'\n  depends_on 'spatialindex'\n  depends_on 'bison'\n  depends_on 'grass' => :optional\n  depends_on 'gettext' if build.with? 'grass'\n  depends_on 'postgis' => :optional\n\n  def install\n    cxxstdlib_check :skip\n    # Set bundling level back to 0 (the default in all versions prior to 1.8.0)\n    # so that no time and energy is wasted copying the Qt frameworks into QGIS.\n    args = std_cmake_args.concat %W[\n      -DQWT_INCLUDE_DIR=#{Formula['qwt60'].opt_prefix}/lib/qwt.framework/Headers/\n      -DQWT_LIBRARY=#{Formula['qwt60'].opt_prefix}/lib/qwt.framework/qwt\n      -DBISON_EXECUTABLE=#{Formula['bison'].opt_prefix}/bin/bison\n      -DENABLE_TESTS=NO\n      -DQGIS_MACAPP_BUNDLE=0\n      -DQGIS_MACAPP_DEV_PREFIX='#{prefix}/Frameworks'\n      -DQGIS_MACAPP_INSTALL_DEV=YES\n      -DPYTHON_INCLUDE_DIR='#{python.incdir}'\n      -DPYTHON_LIBRARY='#{python.libdir}/lib#{python.xy}.dylib'\n    ]\n\n    grass = Formula['grass']\n    args << \"-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version}'\" if build.with? 'grass'\n\n    # So that `libintl.h` can be found\n    ENV.append 'CXXFLAGS', \"-I'#{Formula['gettext'].opt_prefix}/include'\" if build.with? 'grass'\n\n    # Avoid ld: framework not found QtSql (https://github.com/Homebrew/homebrew-science/issues/23)\n    ENV.append 'CXXFLAGS', \"-F#{Formula['qt'].opt_prefix}/lib\"\n\n    Dir.mkdir 'build'\n    python do\n      Dir.chdir 'build' do\n        system 'cmake', '..', *args\n        system 'make install'\n      end\n\n      py_lib = lib/\"#{python.xy}/site-packages\"\n      qgis_modules = prefix + 'QGIS.app/Contents/Resources/python/qgis'\n      py_lib.mkpath\n      ln_s qgis_modules, py_lib + 'qgis'\n\n      # Create script to launch QGIS app\n      (bin + 'qgis').write <<~EOS\n        #!/bin/sh\n        # Ensure Python modules can be found when QGIS is running.\n        env PATH='#{HOMEBREW_PREFIX}/bin':$PATH PYTHONPATH='#{HOMEBREW_PREFIX}/lib/#{python.xy}/site-packages':$PYTHONPATH\\\\\n          open #{prefix}/QGIS.app\n      EOS\n    end\n  end\n\n  def caveats\n    s = <<~EOS\n      QGIS has been built as an application bundle. To make it easily available, a\n      wrapper script has been written that launches the app with environment\n      variables set so that Python modules will be functional:\n\n        qgis\n\n      You may also symlink QGIS.app into ~/Applications:\n        brew linkapps\n        mkdir -p #{ENV['HOME']}/.MacOSX\n        defaults write #{ENV['HOME']}/.MacOSX/environment.plist PYTHONPATH -string \"#{HOMEBREW_PREFIX}/lib/#{python.xy}/site-packages\"\n\n      You will need to log out and log in again to make environment.plist effective.\n\n    EOS\n    #s += python.standard_caveats if python\n    s\n  end\nend\n"
  },
  {
    "path": "boneyard/qgis-20.rb",
    "content": "require 'formula'\nrequire File.expand_path(\"../../Requirements/qgis_requirements\",\n                         Pathname.new(__FILE__).realpath)\n\nclass UnlinkedQGIS20 < UnlinkedQGIS\n  fatal true\n  def qgis_list\n    %W[homebrew/science/qgis qgis-18 qgis-22 qgis-24]\n  end\n  satisfy(:build_env => false) { no_linked_qgis[0] }\nend\n\nclass Qgis20 < Formula\n  homepage 'http://www.qgis.org'\n  url 'https://github.com/qgis/QGIS/archive/final-2_0_1.tar.gz'\n  sha1 'd532677c1934c3faacd3036af15958b464051853'\n  revision 4\n\n  option 'enable-isolation', \"Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs\"\n  option 'with-debug', 'Enable debug build, which outputs info to system.log or console'\n  option 'skip-stdlib-check', 'Build skips checking if dependencies are built against conflicting stdlib.'\n  option 'without-server', 'Build without QGIS Server (qgis_mapserv.fcgi)'\n  option 'without-postgresql', 'Build without current PostgreSQL client'\n  option 'with-globe', 'Build with Globe plugin, based upon osgEarth'\n  option 'with-grass', 'Build with GRASS integration plugin support'\n  option 'with-postgis', 'Build extra PostGIS geospatial database extender'\n  option 'with-oracle', 'Build extra Oracle geospatial database and raster support'\n  option 'with-orfeo', 'Build extra Orfeo Toolbox for Processing plugin'\n  option 'with-r', 'Build extra R for Processing plugin'\n  option 'with-saga-gis', 'Build extra Saga GIS for Processing plugin'\n  option 'with-qt-mysql', 'Build extra Qt MySQL plugin for eVis plugin'\n  option 'with-api-docs', 'Build the API documentation with Doxygen and Graphviz'\n  #option 'persistent-build', 'Maintain the build directory in HOMEBREW_TEMP (--HEAD only)'\n\n  depends_on UnlinkedQGIS20\n\n  # core qgis\n  depends_on 'cmake' => :build\n  depends_on 'bison' => :build\n  if build.with? 'api-docs'\n    depends_on 'graphviz' => [:build, 'with-freetype']\n    depends_on 'doxygen' => [:build, 'with-dot'] # with graphviz support\n  end\n  depends_on (build.include? 'enable-isolation' || MacOS.version < :lion ) ? 'python' : :python\n  depends_on 'qt'\n  depends_on 'pyqt'\n  depends_on SipBinary\n  depends_on PyQtConfig\n  depends_on 'qscintilla2' # will probably be a C++ lib deps in near future\n  depends_on 'qwt'\n  depends_on 'qwtpolar'\n  depends_on 'gsl'\n  depends_on 'sqlite' # keg_only\n  depends_on 'expat' # keg_only\n  depends_on 'proj'\n  depends_on 'spatialindex'\n  depends_on 'fcgi' if build.with? 'server'\n  # use newer postgresql client than Apple's, also needed by `psycopg2`\n  depends_on 'postgresql' => :recommended\n\n  # core providers\n  depends_on 'gdal'\n  depends_on 'postgis' => :optional\n  depends_on \"oracle-client-sdk\" if build.with? \"oracle\"\n  # TODO: add MSSQL third-party support formula?, :optional\n\n  # core plugins (c++ and python)\n  depends_on \"grass-64\" => :optional\n  depends_on 'gdal-grass' if build.with? 'grass'\n  depends_on 'gettext' if build.with? 'grass'\n  depends_on 'gpsbabel' => [:recommended, 'with-libusb']\n  depends_on 'open-scene-graph' if build.with? 'globe'\n  depends_on 'homebrew/science/osgearth' if build.with? 'globe'\n  # TODO: remove 'pyspatialite' when PyPi package supports spatialite 4.x\n  #       or DB Manager supports libspatialite > 4.1.1 (with mod_spatialite)\n  depends_on 'pyspatialite' # for DB Manager\n  depends_on 'qt-mysql' => :optional # for eVis plugin (non-functional in 2.0.1?)\n\n  # core processing plugin extras\n  # see `postgis` and `grass` above\n  depends_on 'orfeo' => :optional\n  depends_on 'homebrew/science/r' => :optional\n  depends_on 'saga-gis' => :optional\n  # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools)\n  # TODO: Fusion from USFS (via `wine`?)\n\n  resource \"pyqgis-startup\" do\n    url \"https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py\"\n    sha1 \"13d624e8ccc6bf072bbaeaf68cd6f7309abc1e74\"\n    version \"2.0.0\"\n  end\n\n  # fixes for stable to work with sip 4.15, remove on release > 2.0.1\n  #   see: https://github.com/qgis/QGIS/commit/d27ad33c\n  #        https://github.com/qgis/QGIS/commit/641359d3\n  #        https://github.com/qgis/QGIS/commit/6f9795b0\n  # fix for finding Qt Plugins directory when QGIS_MACAPP_BUNDLE = 0\n  #   see: https://github.com/osgeo/homebrew-osgeo4mac/issues/13\n  # backport PYQGIS_STARTUP support for isolation, or to avoid Kyngchaos.com\n  #   python modules pulling in duplicate linked *.framework libs\n  patch do\n    url  \"https://gist.githubusercontent.com/dakcarto/11231756/raw/8454c7bf118e5672899afadc53f61d252316ce21/qgis-20_fixes.patch\"\n    sha1 \"8bbc5cbca1eaa4befb04b3e8319036c5a263119b\"\n  end\n\n  def install\n    # Set bundling level back to 0 (the default in all versions prior to 1.8.0)\n    # so that no time and energy is wasted copying the Qt frameworks into QGIS.\n    qwt_fw = Formula['qwt'].opt_prefix/\"lib/qwt.framework\"\n    qwtpolar_fw = Formula['qwtpolar'].opt_prefix/\"lib/qwtpolar.framework\"\n    dev_fw = lib/'qgis-dev'\n    dev_fw.mkpath\n    qsci_opt = Formula['qscintilla2'].opt_prefix\n    args = %W[\n      -DCMAKE_INSTALL_PREFIX=#{prefix}\n      -DCMAKE_BUILD_TYPE=#{(build.with?('debug')) ? 'RelWithDebInfo' : 'None' }\n      -DCMAKE_FIND_FRAMEWORK=LAST\n      -DCMAKE_VERBOSE_MAKEFILE=TRUE\n      -Wno-dev\n      -DBISON_EXECUTABLE=#{Formula['bison'].opt_prefix}/bin/bison\n      -DENABLE_TESTS=FALSE\n      -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers\n      -DQWT_LIBRARY=#{qwt_fw}/qwt\n      -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers\n      -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar\n      -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include/Qsci\n      -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib\n      -DWITH_INTERNAL_QWTPOLAR=FALSE\n      -DQGIS_MACAPP_BUNDLE=0\n      -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}'\n      -DQGIS_MACAPP_INSTALL_DEV=TRUE\n      -DWITH_QSCIAPI=FALSE\n      -DWITH_STAGED_PLUGINS=FALSE\n    ]\n\n    args << \"-DPYTHON_EXECUTABLE='#{python_exec}'\"\n    # brewed python is used if installed\n    if brewed_python?\n      args << \"-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'\"\n    end\n\n    args << \"-DGIT_MARKER=''\" # if release tarball, ends up defined as 'exported'\n\n    args << '-DWITH_MAPSERVER=TRUE' if build.with? 'server'\n\n    pgsql = Formula['postgresql']\n    args << \"-DPOSTGRES_CONFIG=#{pgsql.opt_prefix}/bin/pg_config\" if build.with? 'postgresql'\n\n    if build.with? 'oracle'\n      args << '-DWITH_ORACLE=TRUE'\n      oracle_opt = Formula['oracle-client-sdk'].opt_prefix\n      args << \"-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include\"\n      args << \"-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib\"\n    end\n\n    if build.with? 'grass'\n      grass = Formula[\"grass-64\"]\n      args << \"-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version.to_s}'\"\n      # So that `libintl.h` can be found\n      ENV.append 'CXXFLAGS', \"-I'#{Formula['gettext'].opt_prefix}/include'\"\n    end\n\n    if build.with? 'globe'\n      osg = Formula['open-scene-graph']\n      opoo \"`open-scene-graph` formula's keg not linked.\" unless osg.linked_keg.exist?\n      args << '-DWITH_GLOBE=TRUE'\n      # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there\n      args << \"-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.linked_keg.realpath.basename.to_s}\"\n    end\n\n    args << '-DWITH_APIDOC=TRUE' if build.with? 'api-docs'\n\n    # Avoid ld: framework not found QtSql\n    # (https://github.com/Homebrew/homebrew-science/issues/23)\n    ENV.append 'CXXFLAGS', \"-F#{Formula['qt'].opt_prefix}/lib\"\n\n    # TODO: update .app's bundle identifier for HEAD builds\n    # (convert to using `defaults`)\n    #/usr/libexec/PlistBuddy -c \"Set :CFBundleIdentifier org.qgis.qgis-dev\" \"$APPTARGET/Contents/Info.plist\"\n\n    # TODO: keep persistent build directory for HEAD builds\n    mkdir 'build'\n\n    cd 'build' do\n      # fix install fail on stdlib check for Mavericks+, if mixing supporting libs with different stdlibs\n      cxxstdlib_check :skip if MacOS.version >= :mavericks and build.include? 'skip-stdlib-check'\n\n      system 'cmake', '..', *args\n      #system 'bbedit', 'CMakeCache.txt'\n      #raise\n      system 'make', 'install'\n    end\n\n    py_lib = lib/\"python2.7/site-packages\"\n    qgis_modules = prefix/'QGIS.app/Contents/Resources/python/qgis'\n    py_lib.mkpath\n    ln_s qgis_modules, py_lib/'qgis'\n\n    ln_s 'QGIS.app/Contents/MacOS/fcgi-bin', prefix/'fcgi-bin' if build.with? 'server'\n\n    doc.mkpath\n    mv prefix/'QGIS.app/Contents/Resources/doc/api', doc/'api' if build.with? 'api-docs'\n    ln_s prefix/'QGIS.app/Contents/Resources/doc', doc/'doc'\n\n    # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped)\n    # only works with QGIS > 2.0.1\n    # doesn't need executable bit set, loaded by Python runner in QGIS\n    libexec.install resource(\"pyqgis-startup\")\n\n    bin.mkdir\n    touch \"#{bin}/qgis\" # so it will be linked into HOMEBREW_PREFIX\n  end\n\n  def post_install\n    # configure environment variables for .app and launching binary directly.\n    # having this in `post_intsall` allows it to be individually run *after* installation with:\n    #    `brew postinstall -v qgis-20`\n\n    opts = Tab.for_formula(self).used_options\n\n    # define default isolation env vars\n    pthsep = File::PATH_SEPARATOR\n    pypth = \"#{python_site_packages}\"\n    pths = %W[#{HOMEBREW_PREFIX/'bin'} /usr/bin /bin /usr/sbin /sbin /usr/X11/bin].join(pthsep)\n\n    unless opts.include? 'enable-isolation'\n      pths = ORIGINAL_PATHS.join(pthsep)\n      unless pths.include? HOMEBREW_PREFIX/'bin'\n        pths = HOMEBREW_PREFIX/'bin' + pthsep + pths\n      end\n      pyenv = ENV['PYTHONPATH']\n      if pyenv\n        pypth = (pyenv.include?(pypth)) ? pyenv : pypth + pthsep + pyenv\n      end\n    end\n\n    envars = {\n      :PATH => \"#{pths}\",\n      :PYTHONPATH => \"#{pypth}\",\n      :GDAL_DRIVER_PATH => \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    }\n\n    if opts.include? 'with-grass'\n      grass = Formula[\"grass-64\"]\n      envars[:GRASS_PREFIX] = \"#{grass.opt_prefix}/grass-#{grass.version.to_s}\"\n    end\n\n    if opts.include? 'with-globe'\n      osg = Formula['open-scene-graph']\n      envars[:OSG_LIBRARY_PATH] = \"#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.linked_keg.realpath.basename}\"\n    end\n\n    if opts.include? 'enable-isolation'\n      envars[:DYLD_FRAMEWORK_PATH] = \"#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks\"\n      versioned = %W[\n        #{Formula['sqlite'].opt_prefix}/lib\n        #{Formula['expat'].opt_prefix}/lib\n        #{Formula['libxml2'].opt_prefix}/lib\n        #{HOMEBREW_PREFIX}/lib\n      ]\n      envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep)\n    end\n    if opts.include? 'enable-isolation' or File.exist?(\"/Library/Frameworks/GDAL.framework\")\n      # TODO: is PYTHONHOME necessary for isolation, or is it set by embedded interpreter?\n      #envars[:PYTHONHOME] = \"#{python.framework}/Python.framework/Versions/Current\"\n      envars[:PYQGIS_STARTUP] = opt_libexec/'pyqgis_startup.py'\n    end\n\n    #envars.each { |key, value| puts \"#{key.to_s}=#{value}\" }\n    #exit\n\n    # add env vars to QGIS.app's Info.plist, in LSEnvironment section\n    app = prefix/'QGIS.app'\n    plst = app/'Contents/Info.plist'\n    # first delete any LSEnvironment setting, ignoring errors\n    # CAUTION!: may not be what you want, if .app already has LSEnvironment settings\n    dflt = quiet_system \"defaults read-type \\\"#{plst}\\\" LSEnvironment\"\n    system \"defaults delete \\\"#{plst}\\\" LSEnvironment\" if dflt\n    kv = '{ '\n    envars.each { |key, value| kv += \"'#{key.to_s}' = '#{value}'; \" }\n    kv += '}'\n    system \"defaults write \\\"#{plst}\\\" LSEnvironment \\\"#{kv}\\\"\"\n    # leave the plist readable; convert from binary to XML format\n    system \"plutil -convert xml1 -- \\\"#{plst}\\\"\"\n    # update modification date on app bundle, or changes won't take effect\n    system \"touch \\\"#{app}\\\"\"\n\n    # add env vars to launch script for QGIS app's binary\n    qgis_bin = bin/'qgis'\n    rm_f qgis_bin if File.exists?(qgis_bin) # install generates empty file\n    bin_cmds = %W[#!/bin/sh\\n]\n    # setup shell-prepended env vars (may result in duplication of paths)\n    envars[:PATH] = \"#{HOMEBREW_PREFIX}/bin\" + pthsep + '$PATH'\n    envars[:PYTHONPATH] = \"#{python_site_packages}\" + pthsep + '$PYTHONPATH'\n    envars.each { |key, value| bin_cmds << \"export #{key.to_s}=#{value}\" }\n    bin_cmds << opt_prefix/'QGIS.app/Contents/MacOS/QGIS'\n    qgis_bin.write(bin_cmds.join(\"\\n\"))\n    qgis_bin.chmod 0755\n  end\n\n  def caveats\n    s = <<~EOS\n      QGIS is built as an application bundle. Environment variables for the\n      Homebrew prefix are embedded in QGIS.app:\n        #{opt_prefix}/QGIS.app\n\n      You may also symlink QGIS.app into /Applications or ~/Applications:\n        brew linkapps [--local]\n\n      To run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper script\n      pre-defined with Homebrew prefix environment variables:\n        #{opt_prefix}/bin/qgis\n\n      NOTE: Your current PATH and PYTHONPATH environment variables are honored\n            when launching via the wrapper script, while launching QGIS.app\n            bundle they are not.\n\n      For standalone Python development, set the following environment variable:\n        export PYTHONPATH=#{python_site_packages}:$PYTHONPATH\n\n      Developer frameworks are installed in:\n        #{opt_prefix}/lib/qgis-dev\n        NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation.\n              Use dyld -F option in CPPFLAGS/LDFLAGS when building other software.\n\n    EOS\n\n    if build.include? 'enable-isolation'\n      s += <<~EOS\n        QGIS built with isolation enabled. This allows it to coexist with other\n        types of installations of QGIS on your Mac. However, on versions >= 2.0.1,\n        this also means Python modules installed in the *system* Python will NOT\n        be available to Python processes within QGIS.app.\n\n      EOS\n    end\n\n    # check for required run-time Python module dependencies\n    # TODO: add 'pyspatialite' when PyPi package supports spatialite 4.x\n    xm = []\n    %w[psycopg2 matplotlib].each { |m| xm << m unless module_importable? m }\n    unless xm.empty?\n      s += <<~EOS\n        The following Python modules are needed by QGIS during run-time:\n\n            #{xm.join(', ')}\n\n        You can install manually, via installer package or with `pip` (if availble):\n\n            pip install <module>  OR  pip-2.7 install <module>\n\n      EOS\n    end\n    # TODO: remove this when libqscintilla.dylib becomes core build dependency?\n    unless module_importable? 'PyQt4.Qsci'\n      s += <<~EOS\n        QScintilla Python module is needed by QGIS during run-time.\n        Ensure `qscintilla2` formula is linked.\n\n      EOS\n    end\n    s\n  end\n\n  private\n  # python utils (deprecated in latest Homebrew)\n  # see: https://github.com/Homebrew/homebrew/pull/24842\n\n  #def osx_python?\n  #  p = `python -c \"import sys; print(sys.prefix)\"`.strip\n  #  p.start_with?(\"/System/Library/Frameworks/Python.framework\")\n  #end\n\n  def brewed_python_framework\n    HOMEBREW_PREFIX/\"Frameworks/Python.framework/Versions/2.7\"\n  end\n\n  def brewed_python_framework?\n    brewed_python_framework.exist?\n  end\n\n  def brewed_python?\n    Formula[\"python\"].linked_keg.exist? and brewed_python_framework?\n  end\n\n  def python_exec\n    if brewed_python?\n      brewed_python_framework/\"bin/python\"\n    else\n      which(\"python\")\n    end\n  end\n\n  def python_incdir\n    Pathname.new(`#{python_exec} -c 'from distutils import sysconfig; print(sysconfig.get_python_inc())'`.strip)\n  end\n\n  def python_libdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))\"`.strip)\n  end\n\n  def python_site_packages\n    HOMEBREW_PREFIX/\"lib/python2.7/site-packages\"\n  end\n\n  def module_importable?(mod)\n    quiet_system python_exec, \"-c\", \"import #{mod}\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qgis-214.rb",
    "content": "require File.expand_path(\"../../Requirements/qgis_requirements\",\n                         Pathname.new(__FILE__).realpath)\n\nclass Qgis214 < Formula\n  desc \"Open Source Geographic Information System\"\n  homepage \"http://www.qgis.org\"\n\n  head \"https://github.com/qgis/QGIS.git\", branch: \"release-2_14\"\n\n  stable do\n    url \"https://github.com/qgis/QGIS/archive/final-2_14_6.tar.gz\"\n    sha256 \"a3c5a1cb2359dac925e3efea9d6b56d37ab9dd3639c38b9915be0d340b54f5ad\"\n\n    # patches that represent all backports to release-2_14 branch, since 2.14.2 tag, git id (date)\n    # see: https://github.com/qgis/QGIS/commits/release-2_14\n    # patch do\n    #   # git id (date) through git id (date) minus windows-formatted patches\n    #   url \"\"\n    #   sha256 \"\"\n    # end\n  end\n\n  bottle do\n    root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n    sha256 \"cea85a8c16c481180bf5756f2032584e918c150b251f8a261428cacc34ea0ce3\" => :mavericks\n  end\n\n  def pour_bottle?\n    brewed_python?\n  end\n\n  option \"with-isolation\", \"Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs\"\n  option \"without-debug\", \"Disable debug build, which outputs info to system.log or console\"\n  option \"without-server\", \"Build without QGIS Server (qgis_mapserv.fcgi)\"\n  option \"without-postgresql\", \"Build without current PostgreSQL client\"\n  option \"with-gdal-1\", \"Build with GDAL/OGR v1.x instead of v2.x\"\n  option \"with-globe\", \"Build with Globe plugin, based upon osgEarth\"\n  option \"with-grass\", \"Build with GRASS 7 integration plugin and Processing plugin support (or install grass-7x first)\"\n  option \"with-grass6\", \"Build extra GRASS 6 for Processing plugin\"\n  option \"with-oracle\", \"Build extra Oracle geospatial database and raster support\"\n  option \"with-orfeo\", \"Build extra Orfeo Toolbox for Processing plugin\"\n  option \"with-r\", \"Build extra R for Processing plugin\"\n  option \"with-saga-gis\", \"Build extra Saga GIS for Processing plugin\"\n  option \"with-qt-mysql\", \"Build extra Qt MySQL plugin for eVis plugin\"\n  option \"with-qspatialite\", \"Build QSpatialite Qt database driver\"\n  option \"with-api-docs\", \"Build the API documentation with Doxygen and Graphviz\"\n\n  deprecated_option \"enable-isolation\" => \"with-isolation\"\n\n  depends_on UnlinkedQGIS2\n\n  # core qgis\n  depends_on \"cmake\" => :build\n  depends_on \"bison\" => :build\n  if build.with? \"api-docs\"\n    depends_on \"graphviz\" => [:build, \"with-freetype\"]\n    depends_on \"doxygen\" => [:build, \"with-dot\"] # with graphviz support\n  end\n  depends_on (build.with?(\"isolation\") || MacOS.version < :lion) ? \"python\" : :python\n  depends_on \"qt\"\n  depends_on \"pyqt\"\n  depends_on SipBinary\n  depends_on PyQtConfig\n  depends_on \"qca\"\n  depends_on \"qscintilla2-qt4\" # will probably be a C++ lib deps in near future\n  depends_on \"qwt\"\n  depends_on \"qwtpolar\"\n  depends_on \"gsl\"\n  depends_on \"sqlite\" # keg_only\n  depends_on \"expat\" # keg_only\n  depends_on \"proj\"\n  depends_on \"spatialindex\"\n  depends_on \"fcgi\" if build.with? \"server\"\n  # use newer postgresql client than Apple's, also needed by `psycopg2`\n  depends_on \"postgresql\" => :recommended\n\n  # core providers\n  if build.with? \"gdal-1\"\n    depends_on \"gdal\"\n  else\n    depends_on \"gdal-20\"\n  end\n  depends_on \"oracle-client-sdk\" if build.with? \"oracle\"\n  # TODO: add MSSQL third-party support formula?, :optional\n\n  # core plugins (c++ and python)\n  if build.with? \"grass\"\n    depends_on \"grass-70\"\n    depends_on \"gettext\"\n  end\n\n  if build.with? \"globe\"\n    # this is pretty borked with OS X >= 10.10+\n    depends_on \"open-scene-graph\" => [\"with-qt\"]\n    depends_on \"homebrew/science/osgearth\"\n  end\n  depends_on \"gpsbabel\"\n  # TODO: remove \"pyspatialite\" when PyPi package supports spatialite 4.x\n  #       or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite)\n  depends_on \"pyspatialite\" # for DB Manager\n  depends_on \"qt-mysql\" => :optional # for eVis plugin (non-functional in 2.x?)\n\n  # core processing plugin extras\n  # see `grass` above\n  depends_on \"grass-64\" if build.with? \"grass6\"\n  depends_on \"orfeo-54\" if build.with? \"orfeo\"\n  depends_on \"homebrew/science/r\" => :optional\n  depends_on \"saga-gis\" => :optional\n  # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools)\n  # TODO: Fusion from USFS (via `wine`?)\n\n  resource \"pyqgis-startup\" do\n    url \"https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py\"\n    sha256 \"3d0adca0c8684f3d907c626fc86d93d73165e184960d16ae883fca665ecc32e6\"\n    version \"2.0.0\"\n  end\n\n  def install\n    # Set bundling level back to 0 (the default in all versions prior to 1.8.0)\n    # so that no time and energy is wasted copying the Qt frameworks into QGIS.\n    qwt_fw = Formula[\"qwt\"].opt_lib/\"qwt.framework\"\n    qwtpolar_fw = Formula[\"qwtpolar\"].opt_lib/\"qwtpolar.framework\"\n    dev_fw = lib/\"qgis-dev\"\n    dev_fw.mkpath\n    qsci_opt = Formula[\"qscintilla2-qt4\"].opt_prefix\n    args = std_cmake_args\n    args << \"-DCMAKE_BUILD_TYPE=RelWithDebInfo\" if build.with? \"debug\" # override\n    args += %W[\n      -DBISON_EXECUTABLE=#{Formula[\"bison\"].opt_bin}/bison\n      -DENABLE_TESTS=FALSE\n      -DENABLE_MODELTEST=FALSE\n      -DSUPPRESS_QT_WARNINGS=TRUE\n      -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers\n      -DQWT_LIBRARY=#{qwt_fw}/qwt\n      -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers\n      -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar\n      -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include\n      -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib\n      -DQSCI_SIP_DIR=#{qsci_opt}/share/sip\n      -DWITH_QWTPOLAR=TRUE\n      -DWITH_INTERNAL_QWTPOLAR=FALSE\n      -DQGIS_MACAPP_BUNDLE=0\n      -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}'\n      -DQGIS_MACAPP_INSTALL_DEV=TRUE\n      -DWITH_QSCIAPI=FALSE\n      -DWITH_STAGED_PLUGINS=TRUE\n      -DWITH_GRASS=FALSE\n    ]\n\n    if build.without? \"gdal-1\"\n      args << \"-DGDAL_LIBRARY=#{Formula[\"gdal-20\"].opt_lib}/libgdal.dylib\"\n      args << \"-DGDAL_INCLUDE_DIR=#{Formula[\"gdal-20\"].opt_include}\"\n      # These specific includes help ensure any gdal v1 includes are not\n      # accidentally pulled from /usr/local/include\n      # In CMakeLists.txt throughout QGIS source tree these includes may come\n      # before opt/gdal-20/include; 'fixing' many CMakeLists.txt may be unwise\n      args << \"-DGEOS_INCLUDE_DIR=#{Formula[\"geos\"].opt_include}\"\n      args << \"-DGSL_INCLUDE_DIR=#{Formula[\"gsl\"].opt_include}\"\n      args << \"-DPROJ_INCLUDE_DIR=#{Formula[\"proj\"].opt_include}\"\n      args << \"-DQCA_INCLUDE_DIR=#{Formula[\"qca\"].opt_lib}/qca.framework/Headers\"\n      args << \"-DSPATIALINDEX_INCLUDE_DIR=#{Formula[\"spatialindex\"].opt_include}/spatialindex\"\n      args << \"-DSPATIALITE_INCLUDE_DIR=#{Formula[\"libspatialite\"].opt_include}\"\n      args << \"-DSQLITE3_INCLUDE_DIR=#{Formula[\"sqlite\"].opt_include}\"\n    end\n\n    args << \"-DPYTHON_EXECUTABLE='#{python_exec}'\"\n    # brewed python is used if installed\n    if brewed_python?\n      args << \"-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'\"\n    end\n\n    # find git revision for HEAD build\n    if build.head? && File.exist?(\"#{cached_download}/.git/index\")\n      args << \"-DGITCOMMAND=#{Formula[\"git\"].opt_bin}/git\"\n      args << \"-DGIT_MARKER=#{cached_download}/.git/index\"\n    end\n\n    args << \"-DWITH_SERVER=#{build.with?(\"server\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"server\"\n      fcgi_opt = Formula[\"fcgi\"].opt_prefix\n      args << \"-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include\"\n      args << \"-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib\"\n    end\n\n    args << \"-DPOSTGRES_CONFIG=#{Formula[\"postgresql\"].opt_bin}/pg_config\" if build.with? \"postgresql\"\n\n    args << \"-DWITH_GRASS7=#{(build.with?(\"grass\") || brewed_grass7?) ? \"TRUE\" : \"FALSE\"}\"\n    if build.with?(\"grass\") || brewed_grass7?\n      # this is to build the GRASS Plugin, not for Processing plugin support\n      grass7 = Formula[\"grass-70\"]\n      args << \"-DGRASS_PREFIX7='#{grass7.opt_prefix}/grass-#{grass7.version}'\"\n      # So that `libintl.h` can be found\n      ENV.append \"CXXFLAGS\", \"-I'#{Formula[\"gettext\"].opt_include}'\"\n    end\n\n    args << \"-DWITH_GLOBE=#{build.with?(\"globe\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"globe\"\n      osg = Formula[\"open-scene-graph\"]\n      opoo \"`open-scene-graph` formula's keg not linked.\" unless osg.linked_keg.exist?\n      # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there\n      args << \"-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}\"\n    end\n\n    args << \"-DWITH_ORACLE=#{build.with?(\"oracle\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"oracle\"\n      oracle_opt = Formula[\"oracle-client-sdk\"].opt_prefix\n      args << \"-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include\"\n      args << \"-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib\"\n    end\n\n    args << \"-DWITH_QSPATIALITE=#{build.with?(\"qspatialite\") ? \"TRUE\" : \"FALSE\"}\"\n\n    args << \"-DWITH_APIDOC=#{build.with?(\"api-docs\") ? \"TRUE\" : \"FALSE\"}\"\n\n    # Avoid ld: framework not found QtSql\n    # (https://github.com/Homebrew/homebrew-science/issues/23)\n    ENV.append \"CXXFLAGS\", \"-F#{Formula[\"qt\"].opt_lib}\"\n\n    # if using Homebrew's Python, make sure its components are always found first\n    # see: https://github.com/Homebrew/homebrew/pull/28597\n    ENV[\"PYTHONHOME\"] = brewed_python_framework.to_s if brewed_python?\n\n    # handle some compiler warnings\n    ENV[\"CXX_EXTRA_FLAGS\"] = \"-Wno-unused-private-field -Wno-deprecated-register\"\n    if ENV.compiler == :clang && (MacOS::Xcode.version >= \"7.0\" || MacOS::CLT.version >= \"7.0\")\n      ENV.append \"CXX_EXTRA_FLAGS\", \"-Wno-inconsistent-missing-override\"\n    end\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      # system \"bbedit\", \"CMakeCache.txt\"\n      # raise\n      system \"make\", \"install\"\n    end\n\n    # Update .app's bundle identifier, so Kyngchaos.com installer doesn't get confused\n    inreplace prefix/\"QGIS.app/Contents/Info.plist\",\n              \"org.qgis.qgis2\", \"org.qgis.qgis2-hb#{build.head? ? \"-dev\" : \"\"}\"\n\n    py_lib = lib/\"python2.7/site-packages\"\n    py_lib.mkpath\n    ln_s \"../../../QGIS.app/Contents/Resources/python/qgis\", py_lib/\"qgis\"\n\n    ln_s \"QGIS.app/Contents/MacOS/fcgi-bin\", prefix/\"fcgi-bin\" if build.with? \"server\"\n\n    doc.mkpath\n    mv prefix/\"QGIS.app/Contents/Resources/doc/api\", doc/\"api\" if build.with? \"api-docs\"\n    ln_s \"../../../QGIS.app/Contents/Resources/doc\", doc/\"doc\"\n\n    # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped)\n    # only works with QGIS > 2.0.1\n    # doesn't need executable bit set, loaded by Python runner in QGIS\n    libexec.install resource(\"pyqgis-startup\")\n\n    bin.mkdir\n    touch \"#{bin}/qgis\" # so it will be linked into HOMEBREW_PREFIX\n    post_install\n  end\n\n  def post_install\n    # configure environment variables for .app and launching binary directly.\n    # having this in `post_intsall` allows it to be individually run *after* installation with:\n    #    `brew postinstall -v qgis-XX` <-- where XX is formula version\n\n    app = prefix/\"QGIS.app\"\n    tab = Tab.for_formula(self)\n    opts = tab.used_options\n    # bottle_poured = tab.poured_from_bottle\n\n    # define default isolation env vars\n    pthsep = File::PATH_SEPARATOR\n    pypth = python_site_packages.to_s\n    pths = %W[#{HOMEBREW_PREFIX/\"bin\"} /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin].join(pthsep)\n    gdalpth = \"#{Formula[\"gdal-20\"].opt_lib}/python2.7/site-packages\"\n    qscipth = \"#{Formula[\"qscintilla2-qt4\"].opt_lib}/python2.7/site-packages\"\n\n    unless opts.include? \"with-isolation\"\n      pths = ORIGINAL_PATHS.join(pthsep)\n      unless pths.include? HOMEBREW_PREFIX/\"bin\"\n        pths = HOMEBREW_PREFIX/\"bin\" + pthsep + pths\n      end\n      pyenv = ENV[\"PYTHONPATH\"]\n      if pyenv\n        pypth = pyenv.include?(pypth) ? pyenv : pypth + pthsep + pyenv\n      end\n    end\n\n    # set install's lib/python2.7/site-packages first, so app will work if unlinked\n    pypth = %W[#{qscipth} #{gdalpth} #{lib}/python2.7/site-packages #{pypth}].join(pthsep)\n\n    envars = {\n      PATH: pths.to_s,\n      PYTHONPATH: pypth.to_s,\n      GDAL_DRIVER_PATH: \"#{HOMEBREW_PREFIX}/lib/gdalplugins\",\n    }\n\n    proc_algs = \"Contents/Resources/python/plugins/processing/algs\"\n    if opts.include?(\"with-grass\") || brewed_grass7?\n      grass7 = Formula[\"grass-70\"]\n      # for core integration plugin support\n      envars[:GRASS_PREFIX] = \"#{grass7.opt_prefix}/grass-#{grass7.version}\"\n      begin\n        inreplace app/\"#{proc_algs}/grass7/Grass7Utils.py\",\n                  \"/Applications/GRASS-7.0.app/Contents/MacOS\",\n                  \"#{grass7.opt_prefix}/grass-base\"\n      rescue Utils::InreplaceError\n        puts \"GRASS 7 GrassUtils already updated\"\n      end\n    end\n\n    if opts.include?(\"with-grass6\") || brewed_grass6?\n      grass6 = Formula[\"grass-64\"]\n      begin\n        inreplace app/\"#{proc_algs}/grass/GrassUtils.py\",\n                  \"/Applications/GRASS-6.4.app/Contents/MacOS\",\n                  \"#{grass6.opt_prefix}/grass-base\"\n      rescue Utils::InreplaceError\n        puts \"GRASS 6 GrassUtils already updated\"\n      end\n    end\n\n    unless opts.include? \"without-globe\"\n      osg = Formula[\"open-scene-graph\"]\n      envars[:OSG_LIBRARY_PATH] = \"#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}\"\n    end\n\n    if opts.include? \"with-isolation\"\n      envars[:DYLD_FRAMEWORK_PATH] = \"#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks\"\n      versioned = %W[\n        #{Formula[\"sqlite\"].opt_lib}\n        #{Formula[\"expat\"].opt_lib}\n        #{Formula[\"libxml2\"].opt_lib}\n        #{HOMEBREW_PREFIX}/lib\n      ]\n      envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep)\n    end\n    if opts.include?(\"with-isolation\") || File.exist?(\"/Library/Frameworks/GDAL.framework\")\n      envars[:PYQGIS_STARTUP] = opt_libexec/\"pyqgis_startup.py\"\n    end\n\n    # envars.each { |key, value| puts \"#{key.to_s}=#{value}\" }\n    # exit\n\n    # add env vars to QGIS.app's Info.plist, in LSEnvironment section\n    plst = app/\"Contents/Info.plist\"\n    # first delete any LSEnvironment setting, ignoring errors\n    # CAUTION!: may not be what you want, if .app already has LSEnvironment settings\n    dflt = `defaults read-type \\\"#{plst}\\\" LSEnvironment 2> /dev/null`\n    `defaults delete \\\"#{plst}\\\" LSEnvironment` if dflt\n    kv = \"{ \"\n    envars.each { |key, value| kv += \"'#{key}' = '#{value}'; \" }\n    kv += \"}\"\n    `defaults write \\\"#{plst}\\\" LSEnvironment \\\"#{kv}\\\"`\n    # add ability to toggle high resolution in Get Info dialog for app\n    hrc = `defaults read-type \\\"#{plst}\\\" NSHighResolutionCapable 2> /dev/null`\n    `defaults delete \\\"#{plst}\\\" NSHighResolutionCapable` if hrc\n    `defaults write \\\"#{plst}\\\" NSHighResolutionCapable \\\"False\\\"`\n    # leave the plist readable; convert from binary to XML format\n    `plutil -convert xml1 -- \\\"#{plst}\\\"`\n    # update modification date on app bundle, or changes won't take effect\n    touch app.to_s\n\n    # add env vars to launch script for QGIS app's binary\n    qgis_bin = bin/\"qgis\"\n    rm_f qgis_bin if File.exist?(qgis_bin) # install generates empty file\n    bin_cmds = %W[#!/bin/sh\\n]\n    # setup shell-prepended env vars (may result in duplication of paths)\n    envars[:PATH] = \"#{HOMEBREW_PREFIX}/bin\" + pthsep + \"$PATH\"\n    envars[:PYTHONPATH] = %W[#{gdalpth} #{python_site_packages} $PYTHONPATH].join(pthsep)\n    envars.each { |key, value| bin_cmds << \"export #{key}=#{value}\" }\n    bin_cmds << opt_prefix/\"QGIS.app/Contents/MacOS/QGIS \\\"$@\\\"\"\n    qgis_bin.write(bin_cmds.join(\"\\n\"))\n    qgis_bin.chmod 0755\n  end\n\n  def caveats\n    s = <<~EOS\n      Bottles support only Homebrew's Python\n\n      QGIS is built as an application bundle. Environment variables for the\n      Homebrew prefix are embedded in QGIS.app:\n        #{opt_prefix}/QGIS.app\n\n      You may also symlink QGIS.app into /Applications or ~/Applications:\n        brew linkapps [--local]\n\n      To directly run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper\n      script pre-defined with Homebrew prefix environment variables:\n        #{opt_bin}/qgis\n\n      NOTE: Your current PATH and PYTHONPATH environment variables are honored\n            when launching via the wrapper script, while launching QGIS.app\n            bundle they are not.\n\n      For standalone Python development, set the following environment variable:\n        export PYTHONPATH=#{python_site_packages}:$PYTHONPATH\n\n      Developer frameworks are installed in:\n        #{opt_lib}/qgis-dev\n        NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation.\n              Use dyld -F option in CPPFLAGS/LDFLAGS when building other software.\n\n    EOS\n\n    if build.with? \"isolation\"\n      s += <<~EOS\n        QGIS built with isolation enabled. This allows it to coexist with other\n        types of installations of QGIS on your Mac. However, on versions >= 2.0.1,\n        this also means Python modules installed in the *system* Python will NOT\n        be available to Python processes within QGIS.app.\n\n      EOS\n    end\n\n    # check for required run-time Python module dependencies\n    # TODO: add \"pyspatialite\" when PyPi package supports spatialite 4.x\n    xm = []\n    %w[psycopg2 matplotlib pyparsing].each do |m|\n      xm << m unless module_importable? m\n    end\n    unless xm.empty?\n      s += <<~EOS\n        The following Python modules are needed by QGIS during run-time:\n\n            #{xm.join(\", \")}\n\n        You can install manually, via installer package or with `pip` (if availble):\n\n            pip install <module>  OR  pip-2.7 install <module>\n\n      EOS\n    end\n    # TODO: remove this when libqscintilla.dylib becomes core build dependency?\n    unless module_importable? \"PyQt4.Qsci\"\n      s += <<~EOS\n        QScintilla Python module is needed by QGIS during run-time.\n        Ensure `qscintilla2` formula is linked.\n\n      EOS\n    end\n\n    s += <<~EOS\n      If you have built GRASS 6.4.x or 7.0.x support for the Processing plugin set\n      the following in QGIS:\n        Processing->Options: Providers->GRASS commands->GRASS folder to:\n           #{HOMEBREW_PREFIX}/opt/grass-64/grass-base\n        Processing->Options: Providers->GRASS GIS 7 commands->GRASS 7 folder to:\n           #{HOMEBREW_PREFIX}/opt/grass-70/grass-base\n\n    EOS\n\n    s\n  end\n\n  test do\n    output = `#{bin}/qgis --help 2>&1` # why does help go to stderr?\n    assert_match /^QGIS is a user friendly/, output\n  end\n\n  private\n\n  def brewed_grass7?\n    Formula[\"grass-70\"].opt_prefix.exist?\n  end\n\n  def brewed_grass6?\n    Formula[\"grass-64\"].opt_prefix.exist?\n  end\n\n  def brewed_python_framework\n    HOMEBREW_PREFIX/\"Frameworks/Python.framework/Versions/2.7\"\n  end\n\n  def brewed_python_framework?\n    brewed_python_framework.exist?\n  end\n\n  def brewed_python?\n    Formula[\"python\"].linked_keg.exist? && brewed_python_framework?\n  end\n\n  def python_exec\n    if brewed_python?\n      brewed_python_framework/\"bin/python\"\n    else\n      which(\"python\")\n    end\n  end\n\n  def python_incdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_python_inc())\"`.strip)\n  end\n\n  def python_libdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))\"`.strip)\n  end\n\n  def python_site_packages\n    HOMEBREW_PREFIX/\"lib/python2.7/site-packages\"\n  end\n\n  def module_importable?(mod)\n    quiet_system python_exec, \"-c\", \"import #{mod}\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qgis-22.rb",
    "content": "require 'formula'\nrequire File.expand_path(\"../../Requirements/qgis_requirements\",\n                         Pathname.new(__FILE__).realpath)\n\nclass UnlinkedQGIS22 < UnlinkedQGIS\n  fatal true\n  def qgis_formula_name\n    \"qgis-22\"\n  end\n  satisfy(:build_env => false) { no_linked_qgis[0] }\nend\n\nclass Qgis22 < Formula\n  homepage 'http://www.qgis.org'\n  url 'https://github.com/qgis/QGIS/archive/final-2_2_0.tar.gz'\n  sha1 '5d043ef6b31a043aa2608a3eebdc3d7d997f2189'\n  revision 4\n\n  option 'enable-isolation', \"Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs\"\n  option 'with-debug', 'Enable debug build, which outputs info to system.log or console'\n  option 'skip-stdlib-check', 'Build skips checking if dependencies are built against conflicting stdlib.'\n  option 'without-server', 'Build without QGIS Server (qgis_mapserv.fcgi)'\n  option 'without-postgresql', 'Build without current PostgreSQL client'\n  option 'with-globe', 'Build with Globe plugin, based upon osgEarth'\n  option 'with-grass', 'Build with GRASS integration plugin support'\n  option 'with-postgis', 'Build extra PostGIS geospatial database extender'\n  option 'with-oracle', 'Build extra Oracle geospatial database and raster support'\n  option 'with-orfeo', 'Build extra Orfeo Toolbox for Processing plugin'\n  option 'with-r', 'Build extra R for Processing plugin'\n  option 'with-saga-gis', 'Build extra Saga GIS for Processing plugin'\n  option 'with-qt-mysql', 'Build extra Qt MySQL plugin for eVis plugin'\n  option 'with-api-docs', 'Build the API documentation with Doxygen and Graphviz'\n\n  depends_on UnlinkedQGIS22\n\n  # core qgis\n  depends_on 'cmake' => :build\n  depends_on 'bison' => :build\n  if build.with? 'api-docs'\n    depends_on 'graphviz' => [:build, 'with-freetype']\n    depends_on 'doxygen' => [:build, 'with-dot'] # with graphviz support\n  end\n  depends_on (build.include? 'enable-isolation' || MacOS.version < :lion ) ? 'python' : :python\n  depends_on 'qt'\n  depends_on 'pyqt'\n  depends_on SipBinary\n  depends_on PyQtConfig\n  depends_on 'qscintilla2' # will probably be a C++ lib deps in near future\n  depends_on 'qwt'\n  depends_on 'qwtpolar'\n  depends_on 'gsl'\n  depends_on 'sqlite' # keg_only\n  depends_on 'expat' # keg_only\n  depends_on 'proj'\n  depends_on 'spatialindex'\n  depends_on 'fcgi' if build.with? 'server'\n  # use newer postgresql client than Apple's, also needed by `psycopg2`\n  depends_on 'postgresql' => :recommended\n\n  # core providers\n  depends_on 'gdal'\n  depends_on 'postgis' => :optional\n  depends_on \"oracle-client-sdk\" if build.with? \"oracle\"\n\n  # core plugins (c++ and python)\n  depends_on 'grass-64' => :optional\n  depends_on 'gdal-grass64' if build.with? 'grass'\n  depends_on 'gettext' if build.with? 'grass'\n  depends_on 'gpsbabel' => [:recommended, 'with-libusb']\n  depends_on 'open-scene-graph' if build.with? 'globe'\n  depends_on 'homebrew/science/osgearth' if build.with? 'globe'\n  depends_on 'pyspatialite' # for DB Manager\n  depends_on 'qt-mysql' => :optional # for eVis plugin (non-functional in 2.0.1?)\n\n  # core processing plugin extras\n  # see `postgis` and `grass` above\n  depends_on 'orfeo' => :optional\n  depends_on 'homebrew/science/r' => :optional\n  depends_on 'saga-gis' => :optional\n\n  resource \"pyqgis-startup\" do\n    url \"https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py\"\n    sha1 \"13d624e8ccc6bf072bbaeaf68cd6f7309abc1e74\"\n    version \"2.0.0\"\n  end\n\n  # patch that represents all backports to release-2_2 branch,\n  # through 03e15e05b28fbab68541ba37be17e3ea6b1dfec2\n  stable do\n    patch do\n      url \"https://gist.githubusercontent.com/dakcarto/9781934/raw/19d25932c8f0e1e89849cc8d2fc50a43dacfae42/qgis-22-backports.diff\"\n      sha1 \"5cf37ba41686c78bc71430ed4405c6b5998b09cf\"\n    end\n  end\n\n  def install\n    # Set bundling level back to 0 (the default in all versions prior to 1.8.0)\n    # so that no time and energy is wasted copying the Qt frameworks into QGIS.\n    qwt_fw = Formula['qwt'].opt_prefix/\"lib/qwt.framework\"\n    qwtpolar_fw = Formula['qwtpolar'].opt_prefix/\"lib/qwtpolar.framework\"\n    dev_fw = lib/'qgis-dev'\n    dev_fw.mkpath\n    qsci_opt = Formula['qscintilla2'].opt_prefix\n    args = %W[\n      -DCMAKE_INSTALL_PREFIX=#{prefix}\n      -DCMAKE_BUILD_TYPE=#{(build.with?('debug')) ? 'RelWithDebInfo' : 'None' }\n      -DCMAKE_FIND_FRAMEWORK=LAST\n      -DCMAKE_VERBOSE_MAKEFILE=TRUE\n      -Wno-dev\n      -DBISON_EXECUTABLE=#{Formula['bison'].opt_prefix}/bin/bison\n      -DENABLE_TESTS=FALSE\n      -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers\n      -DQWT_LIBRARY=#{qwt_fw}/qwt\n      -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers\n      -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar\n      -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include/Qsci\n      -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib\n      -DWITH_INTERNAL_QWTPOLAR=FALSE\n      -DQGIS_MACAPP_BUNDLE=0\n      -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}'\n      -DQGIS_MACAPP_INSTALL_DEV=TRUE\n      -DWITH_QSCIAPI=FALSE\n      -DWITH_STAGED_PLUGINS=FALSE\n    ]\n\n    args << \"-DPYTHON_EXECUTABLE='#{python_exec}'\"\n    # brewed python is used if installed\n    if brewed_python?\n      args << \"-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'\"\n    end\n\n    args << \"-DGIT_MARKER=''\" # if git clone borked, or release tarball, ends up defined as 'exported'\n\n    args << '-DWITH_MAPSERVER=TRUE' if build.with? 'server'\n\n    pgsql = Formula['postgresql']\n    args << \"-DPOSTGRES_CONFIG=#{pgsql.opt_prefix}/bin/pg_config\" if build.with? 'postgresql'\n\n    if build.with? 'oracle'\n      args << '-DWITH_ORACLE=TRUE'\n      oracle_opt = Formula['oracle-client-sdk'].opt_prefix\n      args << \"-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include\"\n      args << \"-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib\"\n    end\n\n    if build.with? 'grass'\n      grass = Formula[\"grass-64\"]\n      args << \"-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version.to_s}'\"\n      # So that `libintl.h` can be found\n      ENV.append 'CXXFLAGS', \"-I'#{Formula['gettext'].opt_prefix}/include'\"\n    end\n\n    if build.with? 'globe'\n      osg = Formula['open-scene-graph']\n      opoo \"`open-scene-graph` formula's keg not linked.\" unless osg.linked_keg.exist?\n      args << '-DWITH_GLOBE=TRUE'\n      # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there\n      args << \"-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.linked_keg.realpath.basename.to_s}\"\n    end\n\n    args << '-DWITH_APIDOC=TRUE' if build.with? 'api-docs'\n\n    # Avoid ld: framework not found QtSql\n    # (https://github.com/Homebrew/homebrew-science/issues/23)\n    ENV.append 'CXXFLAGS', \"-F#{Formula['qt'].opt_prefix}/lib\"\n\n    mkdir 'build'\n\n    cd 'build' do\n      # fix install fail on stdlib check for Mavericks+, if mixing supporting libs with different stdlibs\n      cxxstdlib_check :skip if MacOS.version >= :mavericks and build.include? 'skip-stdlib-check'\n\n      system 'cmake', '..', *args\n      #system 'bbedit', 'CMakeCache.txt'\n      #raise\n      system 'make', 'install'\n    end\n\n    py_lib = lib/\"python2.7/site-packages\"\n    qgis_modules = prefix/'QGIS.app/Contents/Resources/python/qgis'\n    py_lib.mkpath\n    ln_s qgis_modules, py_lib/'qgis'\n\n    ln_s 'QGIS.app/Contents/MacOS/fcgi-bin', prefix/'fcgi-bin' if build.with? 'server'\n\n    doc.mkpath\n    mv prefix/'QGIS.app/Contents/Resources/doc/api', doc/'api' if build.with? 'api-docs'\n    ln_s prefix/'QGIS.app/Contents/Resources/doc', doc/'doc'\n\n    # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped)\n    # only works with QGIS > 2.0.1\n    # doesn't need executable bit set, loaded by Python runner in QGIS\n    libexec.install resource(\"pyqgis-startup\")\n\n    bin.mkdir\n    touch \"#{bin}/qgis\" # so it will be linked into HOMEBREW_PREFIX\n  end\n\n  def post_install\n    # configure environment variables for .app and launching binary directly.\n    # having this in `post_intsall` allows it to be individually run *after* installation with:\n    #    `brew postinstall -v qgis-22`\n\n    opts = Tab.for_formula(self).used_options\n\n    # define default isolation env vars\n    pthsep = File::PATH_SEPARATOR\n    pypth = \"#{python_site_packages}\"\n    pths = %W[#{HOMEBREW_PREFIX/'bin'} /usr/bin /bin /usr/sbin /sbin /usr/X11/bin].join(pthsep)\n\n    unless opts.include? 'enable-isolation'\n      pths = ORIGINAL_PATHS.join(pthsep)\n      unless pths.include? HOMEBREW_PREFIX/'bin'\n        pths = HOMEBREW_PREFIX/'bin' + pthsep + pths\n      end\n      pyenv = ENV['PYTHONPATH']\n      if pyenv\n        pypth = (pyenv.include?(pypth)) ? pyenv : pypth + pthsep + pyenv\n      end\n    end\n\n    envars = {\n      :PATH => \"#{pths}\",\n      :PYTHONPATH => \"#{pypth}\",\n      :GDAL_DRIVER_PATH => \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    }\n\n    if opts.include? 'with-grass'\n      grass = Formula[\"grass-64\"]\n      envars[:GRASS_PREFIX] = \"#{grass.opt_prefix}/grass-#{grass.version.to_s}\"\n    end\n\n    if opts.include? 'with-globe'\n      osg = Formula['open-scene-graph']\n      envars[:OSG_LIBRARY_PATH] = \"#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.linked_keg.realpath.basename}\"\n    end\n\n    if opts.include? 'enable-isolation'\n      envars[:DYLD_FRAMEWORK_PATH] = \"#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks\"\n      versioned = %W[\n        #{Formula['sqlite'].opt_prefix}/lib\n        #{Formula['expat'].opt_prefix}/lib\n        #{Formula['libxml2'].opt_prefix}/lib\n        #{HOMEBREW_PREFIX}/lib\n      ]\n      envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep)\n    end\n    if opts.include? 'enable-isolation' or File.exist?(\"/Library/Frameworks/GDAL.framework\")\n      envars[:PYQGIS_STARTUP] = opt_libexec/'pyqgis_startup.py'\n    end\n\n    #envars.each { |key, value| puts \"#{key.to_s}=#{value}\" }\n    #exit\n\n    # add env vars to QGIS.app's Info.plist, in LSEnvironment section\n    app = prefix/'QGIS.app'\n    plst = app/'Contents/Info.plist'\n    # first delete any LSEnvironment setting, ignoring errors\n    # CAUTION!: may not be what you want, if .app already has LSEnvironment settings\n    dflt = quiet_system \"defaults read-type \\\"#{plst}\\\" LSEnvironment\"\n    system \"defaults delete \\\"#{plst}\\\" LSEnvironment\" if dflt\n    kv = '{ '\n    envars.each { |key, value| kv += \"'#{key.to_s}' = '#{value}'; \" }\n    kv += '}'\n    system \"defaults write \\\"#{plst}\\\" LSEnvironment \\\"#{kv}\\\"\"\n    # leave the plist readable; convert from binary to XML format\n    system \"plutil -convert xml1 -- \\\"#{plst}\\\"\"\n    # update modification date on app bundle, or changes won't take effect\n    system \"touch \\\"#{app}\\\"\"\n\n    # add env vars to launch script for QGIS app's binary\n    qgis_bin = bin/'qgis'\n    rm_f qgis_bin if File.exists?(qgis_bin) # install generates empty file\n    bin_cmds = %W[#!/bin/sh\\n]\n    # setup shell-prepended env vars (may result in duplication of paths)\n    envars[:PATH] = \"#{HOMEBREW_PREFIX}/bin\" + pthsep + '$PATH'\n    envars[:PYTHONPATH] = \"#{python_site_packages}\" + pthsep + '$PYTHONPATH'\n    envars.each { |key, value| bin_cmds << \"export #{key.to_s}=#{value}\" }\n    bin_cmds << opt_prefix/'QGIS.app/Contents/MacOS/QGIS'\n    qgis_bin.write(bin_cmds.join(\"\\n\"))\n    qgis_bin.chmod 0755\n  end\n\n  def caveats\n    s = <<~EOS\n      QGIS is built as an application bundle. Environment variables for the\n      Homebrew prefix are embedded in QGIS.app:\n        #{opt_prefix}/QGIS.app\n\n      You may also symlink QGIS.app into /Applications or ~/Applications:\n        brew linkapps [--local]\n\n      To run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper script\n      pre-defined with Homebrew prefix environment variables:\n        #{opt_prefix}/bin/qgis\n\n      NOTE: Your current PATH and PYTHONPATH environment variables are honored\n            when launching via the wrapper script, while launching QGIS.app\n            bundle they are not.\n\n      For standalone Python development, set the following environment variable:\n        export PYTHONPATH=#{python_site_packages}:$PYTHONPATH\n\n      Developer frameworks are installed in:\n        #{opt_prefix}/lib/qgis-dev\n        NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation.\n              Use dyld -F option in CPPFLAGS/LDFLAGS when building other software.\n\n    EOS\n\n    if build.include? 'enable-isolation'\n      s += <<~EOS\n        QGIS built with isolation enabled. This allows it to coexist with other\n        types of installations of QGIS on your Mac. However, on versions >= 2.0.1,\n        this also means Python modules installed in the *system* Python will NOT\n        be available to Python processes within QGIS.app.\n\n      EOS\n    end\n\n    # check for required run-time Python module dependencies\n    # TODO: add 'pyspatialite' when PyPi package supports spatialite 4.x\n    xm = []\n    %w[psycopg2 matplotlib pyparsing].each {\n        |m| xm << m unless module_importable? m\n    }\n    unless xm.empty?\n      s += <<~EOS\n        The following Python modules are needed by QGIS during run-time:\n\n            #{xm.join(', ')}\n\n        You can install manually, via installer package or with `pip` (if availble):\n\n            pip install <module>  OR  pip-2.7 install <module>\n\n      EOS\n    end\n    # TODO: remove this when libqscintilla.dylib becomes core build dependency?\n    unless module_importable? 'PyQt4.Qsci'\n      s += <<~EOS\n        QScintilla Python module is needed by QGIS during run-time.\n        Ensure `qscintilla2` formula is linked.\n\n      EOS\n    end\n    s\n  end\n\n  private\n  # python utils (deprecated in latest Homebrew)\n\n  def brewed_python_framework\n    HOMEBREW_PREFIX/\"Frameworks/Python.framework/Versions/2.7\"\n  end\n\n  def brewed_python_framework?\n    brewed_python_framework.exist?\n  end\n\n  def brewed_python?\n    Formula[\"python\"].linked_keg.exist? and brewed_python_framework?\n  end\n\n  def python_exec\n    if brewed_python?\n      brewed_python_framework/\"bin/python\"\n    else\n      which(\"python\")\n    end\n  end\n\n  def python_incdir\n    Pathname.new(`#{python_exec} -c 'from distutils import sysconfig; print(sysconfig.get_python_inc())'`.strip)\n  end\n\n  def python_libdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))\"`.strip)\n  end\n\n  def python_site_packages\n    HOMEBREW_PREFIX/\"lib/python2.7/site-packages\"\n  end\n\n  def module_importable?(mod)\n    quiet_system python_exec, \"-c\", \"import #{mod}\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qgis-24.rb",
    "content": "require File.expand_path(\"../../Requirements/qgis_requirements\",\n                         Pathname.new(__FILE__).realpath)\n\nclass UnlinkedQGIS24 < UnlinkedQGIS\n  fatal true\n  def qgis_formula_name\n    \"qgis-24\"\n  end\n  satisfy(:build_env => false) { no_linked_qgis[0] }\nend\n\nclass Qgis24 < Formula\n  homepage \"http://www.qgis.org\"\n  url \"https://github.com/qgis/QGIS/archive/final-2_4_0.tar.gz\"\n  sha1 \"df479a4c3ffe2c0f9f4777f320aab92ae2dd08b0\"\n  revision 4\n\n  def pour_bottle?\n    brewed_python?\n  end\n\n  def bottle_caveat\n    (MacOS.version == :mavericks) ? \"Bottle supports only Homebrew Python\\n\\n\" : \"\"\n  end\n\n  option \"enable-isolation\", \"Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs\"\n  option \"with-debug\", \"Enable debug build, which outputs info to system.log or console\"\n  option \"without-server\", \"Build without QGIS Server (qgis_mapserv.fcgi)\"\n  option \"without-postgresql\", \"Build without current PostgreSQL client\"\n  option \"with-globe\", \"Build with Globe plugin, based upon osgEarth\"\n  option \"without-postgis\", \"Build without extra PostGIS geospatial database extender\"\n  option \"without-grass\", \"Build without GRASS 6 integration plugin and Processing plugin support\"\n  option \"with-grass7\", \"Build with GRASS 7 for Processing plugin\"\n  option \"with-oracle\", \"Build extra Oracle geospatial database and raster support\"\n  option \"with-orfeo\", \"Build extra Orfeo Toolbox for Processing plugin\"\n  option \"with-r\", \"Build extra R for Processing plugin\"\n  option \"with-saga-gis\", \"Build extra Saga GIS for Processing plugin\"\n  option \"with-qt-mysql\", \"Build extra Qt MySQL plugin for eVis plugin\"\n  option \"with-api-docs\", \"Build the API documentation with Doxygen and Graphviz\"\n\n  depends_on UnlinkedQGIS24\n\n  # core qgis\n  depends_on \"cmake\" => :build\n  depends_on \"bison\" => :build\n  if build.with? \"api-docs\"\n    depends_on \"graphviz\" => [:build, \"with-freetype\"]\n    depends_on \"doxygen\" => [:build, \"with-dot\"] # with graphviz support\n  end\n  depends_on (build.include? \"enable-isolation\" || MacOS.version < :lion ) ? \"python\" : :python\n  depends_on \"qt\"\n  depends_on \"pyqt\"\n  depends_on SipBinary\n  depends_on PyQtConfig\n  depends_on \"qscintilla2\" # will probably be a C++ lib deps in near future\n  depends_on \"qwt\"\n  depends_on \"qwtpolar\"\n  depends_on \"gsl\"\n  depends_on \"sqlite\" # keg_only\n  depends_on \"expat\" # keg_only\n  depends_on \"proj\"\n  depends_on \"spatialindex\"\n  depends_on \"fcgi\" if build.with? \"server\"\n  # use newer postgresql client than Apple's, also needed by `psycopg2`\n  depends_on \"postgresql\" => :recommended\n\n  # core providers\n  depends_on \"gdal\"\n  depends_on \"postgis\" => :recommended\n  depends_on \"oracle-client-sdk\" if build.with? \"oracle\"\n  # TODO: add MSSQL third-party support formula?, :optional\n\n  # core plugins (c++ and python)\n  if build.with? \"grass\"\n    depends_on \"grass-64\"\n    depends_on \"gdal-grass64\"\n    depends_on \"gettext\"\n  end\n\n  if build.with? \"globe\"\n    depends_on \"open-scene-graph\" => [\"with-qt\"]\n    depends_on \"homebrew/science/osgearth\"\n  end\n  depends_on \"gpsbabel\" => [:recommended, \"with-libusb\"]\n  # TODO: remove \"pyspatialite\" when PyPi package supports spatialite 4.x\n  #       or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite)\n  depends_on \"pyspatialite\" # for DB Manager\n  depends_on \"qt-mysql\" => :optional # for eVis plugin (non-functional in 2.x?)\n\n  # core processing plugin extras\n  # see `postgis` and `grass` above\n  depends_on \"grass-70\" if build.with? \"grass7\"\n  depends_on \"orfeo-40\" if build.with? \"orfeo\"\n  depends_on \"homebrew/science/r\" => :optional\n  depends_on \"saga-gis\" => :optional\n  # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools)\n  # TODO: Fusion from USFS (via `wine`?)\n\n  resource \"pyqgis-startup\" do\n    url \"https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py\"\n    sha1 \"13d624e8ccc6bf072bbaeaf68cd6f7309abc1e74\"\n    version \"2.0.0\"\n  end\n\n  # patch that represents all backports to release-2_4 branch,\n  stable do\n    patch do\n      # 8fdd08a through ed14cf3, with all ms-windows subdirectory changes stripped (line endings break patch apply)\n      url \"https://gist.githubusercontent.com/dakcarto/ef82c5ade74120d92339/raw/1f7a5e39d87f07da79e8185e3f4aa6b00935456f/qgis-24-backports.diff\"\n      sha1 \"298f6f9a853d03ae33dfe09eb4608d1aeaf8d5b8\"\n    end\n    patch do\n      # ed10647 through e973c66\n      url \"https://gist.githubusercontent.com/dakcarto/a0465f760dd054d2ed02/raw/53c9ec6d6c042db4cbf807a7cd3d4e93a51e738d/qgis-24-backports-2.diff\"\n      sha1 \"4ec068f7f2b42f680e90bb8d837f963b39f479ff\"\n    end\n  end\n\n  def install\n    # Set bundling level back to 0 (the default in all versions prior to 1.8.0)\n    # so that no time and energy is wasted copying the Qt frameworks into QGIS.\n    qwt_fw = Formula[\"qwt\"].opt_lib/\"qwt.framework\"\n    qwtpolar_fw = Formula[\"qwtpolar\"].opt_lib/\"qwtpolar.framework\"\n    dev_fw = lib/\"qgis-dev\"\n    dev_fw.mkpath\n    qsci_opt = Formula[\"qscintilla2\"].opt_prefix\n    args = std_cmake_args\n    args << \"-DCMAKE_BUILD_TYPE=RelWithDebInfo\" if build.with? \"debug\" # override\n    args += %W[\n      -DBISON_EXECUTABLE=#{Formula[\"bison\"].opt_bin}/bison\n      -DENABLE_TESTS=FALSE\n      -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers\n      -DQWT_LIBRARY=#{qwt_fw}/qwt\n      -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers\n      -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar\n      -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include/Qsci\n      -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib\n      -DWITH_INTERNAL_QWTPOLAR=FALSE\n      -DQGIS_MACAPP_BUNDLE=0\n      -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}'\n      -DQGIS_MACAPP_INSTALL_DEV=TRUE\n      -DWITH_QSCIAPI=FALSE\n      -DWITH_STAGED_PLUGINS=FALSE\n    ]\n\n    args << \"-DPYTHON_EXECUTABLE='#{python_exec}'\"\n    # brewed python is used if installed\n    if brewed_python?\n      args << \"-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'\"\n    end\n\n    args << \"-DGIT_MARKER=''\" # if git clone borked, or release tarball, ends up defined as 'exported'\n\n    args << \"-DWITH_MAPSERVER=#{build.with?(\"server\") ? \"TRUE\" : \"FALSE\"}\"\n\n    args << \"-DPOSTGRES_CONFIG=#{Formula[\"postgresql\"].opt_bin}/pg_config\" if build.with? \"postgresql\"\n\n    args << \"-DWITH_GRASS=#{build.with?(\"grass\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"grass\"\n      # this is to build the GRASS Plugin, not for Processing plugin support\n      grass = Formula[\"grass-64\"]\n      args << \"-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version.to_s}'\"\n      # So that `libintl.h` can be found\n      ENV.append \"CXXFLAGS\", \"-I'#{Formula[\"gettext\"].opt_include}'\"\n    end\n\n    args << \"-DWITH_GLOBE=#{build.with?(\"globe\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"globe\"\n      osg = Formula[\"open-scene-graph\"]\n      opoo \"`open-scene-graph` formula's keg not linked.\" unless osg.linked_keg.exist?\n      # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there\n      args << \"-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}\"\n    end\n\n    args << \"-DWITH_ORACLE=#{build.with?(\"oracle\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"oracle\"\n      oracle_opt = Formula[\"oracle-client-sdk\"].opt_prefix\n      args << \"-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include\"\n      args << \"-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib\"\n    end\n\n    args << \"-DWITH_APIDOC=#{build.with?(\"api-docs\") ? \"TRUE\" : \"FALSE\"}\"\n\n    # Avoid ld: framework not found QtSql\n    # (https://github.com/Homebrew/homebrew-science/issues/23)\n    ENV.append \"CXXFLAGS\", \"-F#{Formula[\"qt\"].opt_lib}\"\n\n    # if using Homebrew's Python, make sure its components are always found first\n    # see: https://github.com/Homebrew/homebrew/pull/28597\n    ENV[\"PYTHONHOME\"] = \"#{brewed_python_framework}\" if brewed_python?\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      #system \"bbedit\", \"CMakeCache.txt\"\n      #raise\n      system \"make\", \"install\"\n    end\n\n    # Update .app's bundle identifier, so Kyngchaos.com installer doesn't get confused\n    inreplace prefix/\"QGIS.app/Contents/Info.plist\",\n              \"org.qgis.qgis2\", \"org.qgis.qgis2-hb\"\n\n    py_lib = lib/\"python2.7/site-packages\"\n    qgis_modules = prefix/\"QGIS.app/Contents/Resources/python/qgis\"\n    py_lib.mkpath\n    ln_s qgis_modules, py_lib/\"qgis\"\n\n    ln_s \"QGIS.app/Contents/MacOS/fcgi-bin\", prefix/\"fcgi-bin\" if build.with? \"server\"\n\n    doc.mkpath\n    mv prefix/\"QGIS.app/Contents/Resources/doc/api\", doc/\"api\" if build.with? \"api-docs\"\n    ln_s prefix/\"QGIS.app/Contents/Resources/doc\", doc/\"doc\"\n\n    # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped)\n    # only works with QGIS > 2.0.1\n    # doesn't need executable bit set, loaded by Python runner in QGIS\n    libexec.install resource(\"pyqgis-startup\")\n\n    bin.mkdir\n    touch \"#{bin}/qgis\" # so it will be linked into HOMEBREW_PREFIX\n  end\n\n  def post_install\n    # configure environment variables for .app and launching binary directly.\n    # having this in `post_intsall` allows it to be individually run *after* installation with:\n    #    `brew postinstall -v qgis-XX` <-- where XX is formula version\n\n    app = prefix/\"QGIS.app\"\n    tab = Tab.for_formula(self)\n    opts = tab.used_options\n    bottle_poured = tab.poured_from_bottle\n\n    # define default isolation env vars\n    pthsep = File::PATH_SEPARATOR\n    pypth = \"#{python_site_packages}\"\n    pths = %W[#{HOMEBREW_PREFIX/\"bin\"} /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin].join(pthsep)\n\n    unless opts.include? \"enable-isolation\"\n      pths = ORIGINAL_PATHS.join(pthsep)\n      unless pths.include? HOMEBREW_PREFIX/\"bin\"\n        pths = HOMEBREW_PREFIX/\"bin\" + pthsep + pths\n      end\n      pyenv = ENV[\"PYTHONPATH\"]\n      if pyenv\n        pypth = (pyenv.include?(pypth)) ? pyenv : pypth + pthsep + pyenv\n      end\n    end\n\n    # set install's lib/python2.7/site-packages first, so app will work if unlinked\n    pypth = \"#{lib}/python2.7/site-packages\" + pthsep + pypth\n\n    envars = {\n      :PATH => \"#{pths}\",\n      :PYTHONPATH => \"#{pypth}\",\n      :GDAL_DRIVER_PATH => \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    }\n\n    proc_algs = \"Contents/Resources/python/plugins/processing/algs\"\n    unless opts.include? \"without-grass\"\n      grass = Formula[\"grass-64\"]\n      envars[:GRASS_PREFIX] = \"#{grass.opt_prefix}/grass-#{grass.version.to_s}\"\n      begin\n        inreplace app/\"#{proc_algs}/grass/GrassUtils.py\",\n                  \"/Applications/GRASS-6.4.app/Contents/MacOS\",\n                  HOMEBREW_PREFIX/\"opt/grass-64/grass-base\" unless bottle_poured\n      rescue Utils::InreplaceError\n        puts \"GRASS 6 GrassUtils already updated\"\n      end\n\n    end\n\n    if opts.include? \"with-grass7\"\n      begin\n        inreplace app/\"#{proc_algs}/grass7/Grass7Utils.py\",\n                  \"/Applications/GRASS-7.0.app/Contents/MacOS\",\n                  HOMEBREW_PREFIX/\"opt/grass-70/grass-base\"\n      rescue Utils::InreplaceError\n        puts \"GRASS 7 GrassUtils already updated\"\n      end\n    end\n\n    unless opts.include? \"without-globe\"\n      osg = Formula[\"open-scene-graph\"]\n      envars[:OSG_LIBRARY_PATH] = \"#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}\"\n    end\n\n    if opts.include? \"enable-isolation\"\n      envars[:DYLD_FRAMEWORK_PATH] = \"#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks\"\n      versioned = %W[\n        #{Formula[\"sqlite\"].opt_lib}\n        #{Formula[\"expat\"].opt_lib}\n        #{Formula[\"libxml2\"].opt_lib}\n        #{HOMEBREW_PREFIX}/lib\n      ]\n      envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep)\n    end\n    if opts.include? \"enable-isolation\" or File.exist?(\"/Library/Frameworks/GDAL.framework\")\n      envars[:PYQGIS_STARTUP] = opt_libexec/\"pyqgis_startup.py\"\n    end\n\n    #envars.each { |key, value| puts \"#{key.to_s}=#{value}\" }\n    #exit\n\n    # add env vars to QGIS.app's Info.plist, in LSEnvironment section\n    plst = app/\"Contents/Info.plist\"\n    # first delete any LSEnvironment setting, ignoring errors\n    # CAUTION!: may not be what you want, if .app already has LSEnvironment settings\n    dflt = quiet_system \"defaults read-type \\\"#{plst}\\\" LSEnvironment\"\n    system \"defaults delete \\\"#{plst}\\\" LSEnvironment\" if dflt\n    kv = \"{ \"\n    envars.each { |key, value| kv += \"'#{key.to_s}' = '#{value}'; \" }\n    kv += \"}\"\n    system \"defaults write \\\"#{plst}\\\" LSEnvironment \\\"#{kv}\\\"\"\n    # leave the plist readable; convert from binary to XML format\n    system \"plutil -convert xml1 -- \\\"#{plst}\\\"\"\n    # update modification date on app bundle, or changes won't take effect\n    system \"touch \\\"#{app}\\\"\"\n\n    # add env vars to launch script for QGIS app's binary\n    qgis_bin = bin/\"qgis\"\n    rm_f qgis_bin if File.exists?(qgis_bin) # install generates empty file\n    bin_cmds = %W[#!/bin/sh\\n]\n    # setup shell-prepended env vars (may result in duplication of paths)\n    envars[:PATH] = \"#{HOMEBREW_PREFIX}/bin\" + pthsep + \"$PATH\"\n    envars[:PYTHONPATH] = \"#{python_site_packages}\" + pthsep + \"$PYTHONPATH\"\n    envars.each { |key, value| bin_cmds << \"export #{key.to_s}=#{value}\" }\n    bin_cmds << opt_prefix/\"QGIS.app/Contents/MacOS/QGIS \\\"$@\\\"\"\n    qgis_bin.write(bin_cmds.join(\"\\n\"))\n    qgis_bin.chmod 0755\n  end\n\n  def caveats\n    s = bottle_caveat\n    s += <<~EOS\n      QGIS is built as an application bundle. Environment variables for the\n      Homebrew prefix are embedded in QGIS.app:\n        #{opt_prefix}/QGIS.app\n\n      You may also symlink QGIS.app into /Applications or ~/Applications:\n        brew linkapps [--local]\n\n      To directly run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper\n      script pre-defined with Homebrew prefix environment variables:\n        #{opt_bin}/qgis\n\n      NOTE: Your current PATH and PYTHONPATH environment variables are honored\n            when launching via the wrapper script, while launching QGIS.app\n            bundle they are not.\n\n      For standalone Python development, set the following environment variable:\n        export PYTHONPATH=#{python_site_packages}:$PYTHONPATH\n\n      Developer frameworks are installed in:\n        #{opt_lib}/qgis-dev\n        NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation.\n              Use dyld -F option in CPPFLAGS/LDFLAGS when building other software.\n\n    EOS\n\n    if build.include? \"enable-isolation\"\n      s += <<~EOS\n        QGIS built with isolation enabled. This allows it to coexist with other\n        types of installations of QGIS on your Mac. However, on versions >= 2.0.1,\n        this also means Python modules installed in the *system* Python will NOT\n        be available to Python processes within QGIS.app.\n\n      EOS\n    end\n\n    # check for required run-time Python module dependencies\n    # TODO: add \"pyspatialite\" when PyPi package supports spatialite 4.x\n    xm = []\n    %w[psycopg2 matplotlib pyparsing].each {\n        |m| xm << m unless module_importable? m\n    }\n    unless xm.empty?\n      s += <<~EOS\n        The following Python modules are needed by QGIS during run-time:\n\n            #{xm.join(\", \")}\n\n        You can install manually, via installer package or with `pip` (if availble):\n\n            pip install <module>  OR  pip-2.7 install <module>\n\n      EOS\n    end\n    # TODO: remove this when libqscintilla.dylib becomes core build dependency?\n    unless module_importable? \"PyQt4.Qsci\"\n      s += <<~EOS\n        QScintilla Python module is needed by QGIS during run-time.\n        Ensure `qscintilla2` formula is linked.\n\n      EOS\n    end\n\n    s += <<~EOS\n      If you have built GRASS 6.4.x or 7.0.x support for the Processing plugin set\n      the following in QGIS:\n        Processing->Options: Providers->GRASS commands->GRASS folder to:\n           #{HOMEBREW_PREFIX}/opt/grass-64/grass-base\n        Processing->Options: Providers->GRASS GIS 7 commands->GRASS 7 folder to:\n           #{HOMEBREW_PREFIX}/opt/grass-70/grass-base\n\n    EOS\n\n    s\n  end\n\n  private\n  # python utils (deprecated in latest Homebrew)\n  # see: https://github.com/Homebrew/homebrew/pull/24842\n\n  #def osx_python?\n  #  p = `python -c \"import sys; print(sys.prefix)\"`.strip\n  #  p.start_with?(\"/System/Library/Frameworks/Python.framework\")\n  #end\n\n  def brewed_python_framework\n    HOMEBREW_PREFIX/\"Frameworks/Python.framework/Versions/2.7\"\n  end\n\n  def brewed_python_framework?\n    brewed_python_framework.exist?\n  end\n\n  def brewed_python?\n    Formula[\"python\"].linked_keg.exist? and brewed_python_framework?\n  end\n\n  def python_exec\n    if brewed_python?\n      brewed_python_framework/\"bin/python\"\n    else\n      which(\"python\")\n    end\n  end\n\n  def python_incdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_python_inc())\"`.strip)\n  end\n\n  def python_libdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))\"`.strip)\n  end\n\n  def python_site_packages\n    HOMEBREW_PREFIX/\"lib/python2.7/site-packages\"\n  end\n\n  def module_importable?(mod)\n    quiet_system python_exec, \"-c\", \"import #{mod}\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qgis-26.rb",
    "content": "require File.expand_path(\"../../Requirements/qgis_requirements\",\n                         Pathname.new(__FILE__).realpath)\n\nclass UnlinkedQGIS26 < UnlinkedQGIS\n  fatal true\n  def qgis_formula_name\n    \"qgis-26\"\n  end\n  satisfy(:build_env => false) { no_linked_qgis[0] }\nend\n\nclass Qgis26 < Formula\n  homepage \"http://www.qgis.org\"\n  url \"https://github.com/qgis/QGIS/archive/final-2_6_1.tar.gz\"\n  sha1 \"44f11f227658034c96b1bb8de52e84765422308c\"\n  revision 2\n\n  bottle do\n    root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n    sha1 \"16f3990b210998f3d81e6aa13652d685ba18e897\" => :mavericks\n    sha1 \"b4d5b5ee6fe443c000dd51c3c8437613aecaa3f1\" => :yosemite\n  end\n\n  def pour_bottle?\n    brewed_python?\n  end\n\n  option \"enable-isolation\", \"Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs\"\n  option \"with-debug\", \"Enable debug build, which outputs info to system.log or console\"\n  option \"without-server\", \"Build without QGIS Server (qgis_mapserv.fcgi)\"\n  option \"without-postgresql\", \"Build without current PostgreSQL client\"\n  option \"with-globe\", \"Build with Globe plugin, based upon osgEarth\"\n  option \"without-postgis\", \"Build without extra PostGIS geospatial database extender\"\n  option \"without-grass\", \"Build without GRASS 6 integration plugin and Processing plugin support\"\n  option \"with-grass7\", \"Build with GRASS 7 for Processing plugin\"\n  option \"with-oracle\", \"Build extra Oracle geospatial database and raster support\"\n  option \"with-orfeo\", \"Build extra Orfeo Toolbox for Processing plugin\"\n  option \"with-r\", \"Build extra R for Processing plugin\"\n  option \"with-saga-gis\", \"Build extra Saga GIS for Processing plugin\"\n  option \"with-qt-mysql\", \"Build extra Qt MySQL plugin for eVis plugin\"\n  option \"with-api-docs\", \"Build the API documentation with Doxygen and Graphviz\"\n\n  depends_on UnlinkedQGIS26\n\n  # core qgis\n  depends_on \"cmake\" => :build\n  depends_on \"bison\" => :build\n  if build.with? \"api-docs\"\n    depends_on \"graphviz\" => [:build, \"with-freetype\"]\n    depends_on \"doxygen\" => [:build, \"with-dot\"] # with graphviz support\n  end\n  depends_on (build.include? \"enable-isolation\" || MacOS.version < :lion ) ? \"python\" : :python\n  depends_on \"qt\"\n  depends_on \"pyqt\"\n  depends_on SipBinary\n  depends_on PyQtConfig\n  depends_on \"qscintilla2\" # will probably be a C++ lib deps in near future\n  depends_on \"qwt\"\n  depends_on \"qwtpolar\"\n  depends_on \"gsl\"\n  depends_on \"sqlite\" # keg_only\n  depends_on \"expat\" # keg_only\n  depends_on \"proj\"\n  depends_on \"spatialindex\"\n  depends_on \"fcgi\" if build.with? \"server\"\n  # use newer postgresql client than Apple's, also needed by `psycopg2`\n  depends_on \"postgresql\" => :recommended\n\n  # core providers\n  depends_on \"gdal\"\n  depends_on \"postgis\" => :recommended\n  depends_on \"oracle-client-sdk\" if build.with? \"oracle\"\n  # TODO: add MSSQL third-party support formula?, :optional\n\n  # core plugins (c++ and python)\n  if build.with? \"grass\"\n    depends_on \"grass-64\"\n    depends_on \"gdal-grass64\"\n    depends_on \"gettext\"\n  end\n\n  if build.with? \"globe\"\n    depends_on \"open-scene-graph\" => [\"with-qt\"]\n    depends_on \"homebrew/science/osgearth\"\n  end\n  depends_on \"gpsbabel\" => [:recommended, \"with-libusb\"]\n  # TODO: remove \"pyspatialite\" when PyPi package supports spatialite 4.x\n  #       or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite)\n  depends_on \"pyspatialite\" # for DB Manager\n  depends_on \"qt-mysql\" => :optional # for eVis plugin (non-functional in 2.x?)\n\n  # core processing plugin extras\n  # see `postgis` and `grass` above\n  depends_on \"grass-70\" if build.with? \"grass7\"\n  depends_on \"orfeo-40\" if build.with? \"orfeo\"\n  depends_on \"homebrew/science/r\" => :optional\n  depends_on \"saga-gis\" => :optional\n  # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools)\n  # TODO: Fusion from USFS (via `wine`?)\n\n  resource \"pyqgis-startup\" do\n    url \"https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py\"\n    sha1 \"13d624e8ccc6bf072bbaeaf68cd6f7309abc1e74\"\n    version \"2.0.0\"\n  end\n\n  # patches that represent all backports to release-2_6 branch, since 2.6.1 tag, e2a51df (2014-11-28)\n  # see: https://github.com/qgis/QGIS/commits/release-2_6\n  #      and https://github.com/qgis/QGIS/commits/final-2_6_1\n  stable do\n    patch do\n      # 4e78b8b (2014-25-28) through e4d34cb (2015-01-20) minus windows-formatted patches\n      url \"https://gist.githubusercontent.com/dakcarto/55fa8700ca9640561b9f/raw/0da58873ce64e05f6e7add3c879c43879fa7b799/qgis-261-backports_A.diff\"\n      sha1 \"8c426efec3d378038effc2e59b34f03acd1bcd0e\"\n    end\n  end\n\n  def install\n    # Set bundling level back to 0 (the default in all versions prior to 1.8.0)\n    # so that no time and energy is wasted copying the Qt frameworks into QGIS.\n    qwt_fw = Formula[\"qwt\"].opt_lib/\"qwt.framework\"\n    qwtpolar_fw = Formula[\"qwtpolar\"].opt_lib/\"qwtpolar.framework\"\n    dev_fw = lib/\"qgis-dev\"\n    dev_fw.mkpath\n    qsci_opt = Formula[\"qscintilla2\"].opt_prefix\n    args = std_cmake_args\n    args << \"-DCMAKE_BUILD_TYPE=RelWithDebInfo\" if build.with? \"debug\" # override\n    args += %W[\n      -DBISON_EXECUTABLE=#{Formula[\"bison\"].opt_bin}/bison\n      -DENABLE_TESTS=FALSE\n      -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers\n      -DQWT_LIBRARY=#{qwt_fw}/qwt\n      -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers\n      -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar\n      -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include\n      -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib\n      -DQSCI_SIP_DIR=#{qsci_opt}/share/sip\n      -DWITH_INTERNAL_QWTPOLAR=FALSE\n      -DQGIS_MACAPP_BUNDLE=0\n      -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}'\n      -DQGIS_MACAPP_INSTALL_DEV=TRUE\n      -DWITH_QSCIAPI=FALSE\n      -DWITH_STAGED_PLUGINS=FALSE\n    ]\n\n    args << \"-DPYTHON_EXECUTABLE='#{python_exec}'\"\n    # brewed python is used if installed\n    if brewed_python?\n      args << \"-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'\"\n    end\n\n    args << \"-DGIT_MARKER=''\" # if git clone borked, or release tarball, ends up defined as 'exported'\n\n    args << \"-DWITH_SERVER=#{build.with?(\"server\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"server\"\n      fcgi_opt = Formula[\"fcgi\"].opt_prefix\n      args << \"-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include\"\n      args << \"-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib\"\n    end\n\n    args << \"-DPOSTGRES_CONFIG=#{Formula[\"postgresql\"].opt_bin}/pg_config\" if build.with? \"postgresql\"\n\n    args << \"-DWITH_GRASS=#{build.with?(\"grass\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"grass\"\n      # this is to build the GRASS Plugin, not for Processing plugin support\n      grass = Formula[\"grass-64\"]\n      args << \"-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version.to_s}'\"\n      # So that `libintl.h` can be found\n      ENV.append \"CXXFLAGS\", \"-I'#{Formula[\"gettext\"].opt_include}'\"\n    end\n\n    args << \"-DWITH_GLOBE=#{build.with?(\"globe\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"globe\"\n      osg = Formula[\"open-scene-graph\"]\n      opoo \"`open-scene-graph` formula's keg not linked.\" unless osg.linked_keg.exist?\n      # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there\n      args << \"-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}\"\n    end\n\n    args << \"-DWITH_ORACLE=#{build.with?(\"oracle\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"oracle\"\n      oracle_opt = Formula[\"oracle-client-sdk\"].opt_prefix\n      args << \"-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include\"\n      args << \"-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib\"\n    end\n\n    args << \"-DWITH_APIDOC=#{build.with?(\"api-docs\") ? \"TRUE\" : \"FALSE\"}\"\n\n    # Avoid ld: framework not found QtSql\n    # (https://github.com/Homebrew/homebrew-science/issues/23)\n    ENV.append \"CXXFLAGS\", \"-F#{Formula[\"qt\"].opt_lib}\"\n\n    # if using Homebrew's Python, make sure its components are always found first\n    # see: https://github.com/Homebrew/homebrew/pull/28597\n    ENV[\"PYTHONHOME\"] = \"#{brewed_python_framework}\" if brewed_python?\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      #system \"bbedit\", \"CMakeCache.txt\"\n      #raise\n      system \"make\", \"install\"\n    end\n\n    # Update .app's bundle identifier, so Kyngchaos.com installer doesn't get confused\n    inreplace prefix/\"QGIS.app/Contents/Info.plist\",\n              \"org.qgis.qgis2\", \"org.qgis.qgis2-hb\"\n\n    py_lib = lib/\"python2.7/site-packages\"\n    qgis_modules = prefix/\"QGIS.app/Contents/Resources/python/qgis\"\n    py_lib.mkpath\n    ln_s qgis_modules, py_lib/\"qgis\"\n\n    ln_s \"QGIS.app/Contents/MacOS/fcgi-bin\", prefix/\"fcgi-bin\" if build.with? \"server\"\n\n    doc.mkpath\n    mv prefix/\"QGIS.app/Contents/Resources/doc/api\", doc/\"api\" if build.with? \"api-docs\"\n    ln_s prefix/\"QGIS.app/Contents/Resources/doc\", doc/\"doc\"\n\n    # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped)\n    # only works with QGIS > 2.0.1\n    # doesn't need executable bit set, loaded by Python runner in QGIS\n    libexec.install resource(\"pyqgis-startup\")\n\n    bin.mkdir\n    touch \"#{bin}/qgis\" # so it will be linked into HOMEBREW_PREFIX\n  end\n\n  def post_install\n    # configure environment variables for .app and launching binary directly.\n    # having this in `post_intsall` allows it to be individually run *after* installation with:\n    #    `brew postinstall -v qgis-XX` <-- where XX is formula version\n\n    app = prefix/\"QGIS.app\"\n    tab = Tab.for_formula(self)\n    opts = tab.used_options\n    bottle_poured = tab.poured_from_bottle\n\n    # define default isolation env vars\n    pthsep = File::PATH_SEPARATOR\n    pypth = \"#{python_site_packages}\"\n    pths = %W[#{HOMEBREW_PREFIX/\"bin\"} /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin].join(pthsep)\n\n    unless opts.include? \"enable-isolation\"\n      pths = ORIGINAL_PATHS.join(pthsep)\n      unless pths.include? HOMEBREW_PREFIX/\"bin\"\n        pths = HOMEBREW_PREFIX/\"bin\" + pthsep + pths\n      end\n      pyenv = ENV[\"PYTHONPATH\"]\n      if pyenv\n        pypth = (pyenv.include?(pypth)) ? pyenv : pypth + pthsep + pyenv\n      end\n    end\n\n    # set install's lib/python2.7/site-packages first, so app will work if unlinked\n    pypth = \"#{lib}/python2.7/site-packages\" + pthsep + pypth\n\n    envars = {\n      :PATH => \"#{pths}\",\n      :PYTHONPATH => \"#{pypth}\",\n      :GDAL_DRIVER_PATH => \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    }\n\n    proc_algs = \"Contents/Resources/python/plugins/processing/algs\"\n    unless opts.include? \"without-grass\"\n      grass = Formula[\"grass-64\"]\n      envars[:GRASS_PREFIX] = \"#{grass.opt_prefix}/grass-#{grass.version.to_s}\"\n      begin\n        inreplace app/\"#{proc_algs}/grass/GrassUtils.py\",\n                  \"/Applications/GRASS-6.4.app/Contents/MacOS\",\n                  HOMEBREW_PREFIX/\"opt/grass-64/grass-base\" unless bottle_poured\n      rescue Utils::InreplaceError\n        puts \"GRASS 6 GrassUtils already updated\"\n      end\n\n    end\n\n    if opts.include? \"with-grass7\"\n      begin\n        inreplace app/\"#{proc_algs}/grass7/Grass7Utils.py\",\n                  \"/Applications/GRASS-7.0.app/Contents/MacOS\",\n                  HOMEBREW_PREFIX/\"opt/grass-70/grass-base\"\n      rescue Utils::InreplaceError\n        puts \"GRASS 7 GrassUtils already updated\"\n      end\n    end\n\n    unless opts.include? \"without-globe\"\n      osg = Formula[\"open-scene-graph\"]\n      envars[:OSG_LIBRARY_PATH] = \"#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}\"\n    end\n\n    if opts.include? \"enable-isolation\"\n      envars[:DYLD_FRAMEWORK_PATH] = \"#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks\"\n      versioned = %W[\n        #{Formula[\"sqlite\"].opt_lib}\n        #{Formula[\"expat\"].opt_lib}\n        #{Formula[\"libxml2\"].opt_lib}\n        #{HOMEBREW_PREFIX}/lib\n      ]\n      envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep)\n    end\n    if opts.include? \"enable-isolation\" or File.exist?(\"/Library/Frameworks/GDAL.framework\")\n      envars[:PYQGIS_STARTUP] = opt_libexec/\"pyqgis_startup.py\"\n    end\n\n    #envars.each { |key, value| puts \"#{key.to_s}=#{value}\" }\n    #exit\n\n    # add env vars to QGIS.app's Info.plist, in LSEnvironment section\n    plst = app/\"Contents/Info.plist\"\n    # first delete any LSEnvironment setting, ignoring errors\n    # CAUTION!: may not be what you want, if .app already has LSEnvironment settings\n    dflt = quiet_system \"defaults read-type \\\"#{plst}\\\" LSEnvironment\"\n    system \"defaults delete \\\"#{plst}\\\" LSEnvironment\" if dflt\n    kv = \"{ \"\n    envars.each { |key, value| kv += \"'#{key.to_s}' = '#{value}'; \" }\n    kv += \"}\"\n    system \"defaults write \\\"#{plst}\\\" LSEnvironment \\\"#{kv}\\\"\"\n    # leave the plist readable; convert from binary to XML format\n    system \"plutil -convert xml1 -- \\\"#{plst}\\\"\"\n    # update modification date on app bundle, or changes won't take effect\n    touch \"#{app}\"\n\n    # add env vars to launch script for QGIS app's binary\n    qgis_bin = bin/\"qgis\"\n    rm_f qgis_bin if File.exists?(qgis_bin) # install generates empty file\n    bin_cmds = %W[#!/bin/sh\\n]\n    # setup shell-prepended env vars (may result in duplication of paths)\n    envars[:PATH] = \"#{HOMEBREW_PREFIX}/bin\" + pthsep + \"$PATH\"\n    envars[:PYTHONPATH] = \"#{python_site_packages}\" + pthsep + \"$PYTHONPATH\"\n    envars.each { |key, value| bin_cmds << \"export #{key.to_s}=#{value}\" }\n    bin_cmds << opt_prefix/\"QGIS.app/Contents/MacOS/QGIS \\\"$@\\\"\"\n    qgis_bin.write(bin_cmds.join(\"\\n\"))\n    qgis_bin.chmod 0755\n  end\n\n  def caveats\n    s = <<~EOS\n      Bottles support only Homebrew's Python\n\n      QGIS is built as an application bundle. Environment variables for the\n      Homebrew prefix are embedded in QGIS.app:\n        #{opt_prefix}/QGIS.app\n\n      You may also symlink QGIS.app into /Applications or ~/Applications:\n        brew linkapps [--local]\n\n      To directly run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper\n      script pre-defined with Homebrew prefix environment variables:\n        #{opt_bin}/qgis\n\n      NOTE: Your current PATH and PYTHONPATH environment variables are honored\n            when launching via the wrapper script, while launching QGIS.app\n            bundle they are not.\n\n      For standalone Python development, set the following environment variable:\n        export PYTHONPATH=#{python_site_packages}:$PYTHONPATH\n\n      Developer frameworks are installed in:\n        #{opt_lib}/qgis-dev\n        NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation.\n              Use dyld -F option in CPPFLAGS/LDFLAGS when building other software.\n\n    EOS\n\n    if build.include? \"enable-isolation\"\n      s += <<~EOS\n        QGIS built with isolation enabled. This allows it to coexist with other\n        types of installations of QGIS on your Mac. However, on versions >= 2.0.1,\n        this also means Python modules installed in the *system* Python will NOT\n        be available to Python processes within QGIS.app.\n\n      EOS\n    end\n\n    # check for required run-time Python module dependencies\n    # TODO: add \"pyspatialite\" when PyPi package supports spatialite 4.x\n    xm = []\n    %w[psycopg2 matplotlib pyparsing].each {\n        |m| xm << m unless module_importable? m\n    }\n    unless xm.empty?\n      s += <<~EOS\n        The following Python modules are needed by QGIS during run-time:\n\n            #{xm.join(\", \")}\n\n        You can install manually, via installer package or with `pip` (if availble):\n\n            pip install <module>  OR  pip-2.7 install <module>\n\n      EOS\n    end\n    # TODO: remove this when libqscintilla.dylib becomes core build dependency?\n    unless module_importable? \"PyQt4.Qsci\"\n      s += <<~EOS\n        QScintilla Python module is needed by QGIS during run-time.\n        Ensure `qscintilla2` formula is linked.\n\n      EOS\n    end\n\n    s += <<~EOS\n      If you have built GRASS 6.4.x or 7.0.x support for the Processing plugin set\n      the following in QGIS:\n        Processing->Options: Providers->GRASS commands->GRASS folder to:\n           #{HOMEBREW_PREFIX}/opt/grass-64/grass-base\n        Processing->Options: Providers->GRASS GIS 7 commands->GRASS 7 folder to:\n           #{HOMEBREW_PREFIX}/opt/grass-70/grass-base\n\n    EOS\n\n    s\n  end\n\n  private\n  # python utils (deprecated in latest Homebrew)\n  # see: https://github.com/Homebrew/homebrew/pull/24842\n\n  #def osx_python?\n  #  p = `python -c \"import sys; print(sys.prefix)\"`.strip\n  #  p.start_with?(\"/System/Library/Frameworks/Python.framework\")\n  #end\n\n  def brewed_python_framework\n    HOMEBREW_PREFIX/\"Frameworks/Python.framework/Versions/2.7\"\n  end\n\n  def brewed_python_framework?\n    brewed_python_framework.exist?\n  end\n\n  def brewed_python?\n    Formula[\"python\"].linked_keg.exist? and brewed_python_framework?\n  end\n\n  def python_exec\n    if brewed_python?\n      brewed_python_framework/\"bin/python\"\n    else\n      which(\"python\")\n    end\n  end\n\n  def python_incdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_python_inc())\"`.strip)\n  end\n\n  def python_libdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))\"`.strip)\n  end\n\n  def python_site_packages\n    HOMEBREW_PREFIX/\"lib/python2.7/site-packages\"\n  end\n\n  def module_importable?(mod)\n    quiet_system python_exec, \"-c\", \"import #{mod}\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qgis-28.rb",
    "content": "require File.expand_path(\"../../Requirements/qgis_requirements\",\n                         Pathname.new(__FILE__).realpath)\n\nclass UnlinkedQGIS28 < UnlinkedQGIS\n  fatal true\n  def qgis_formula_name\n    \"qgis-28\"\n  end\n  satisfy(:build_env => false) { no_linked_qgis[0] }\nend\n\nclass Qgis28 < Formula\n  desc \"Open Source Geographic Information System\"\n  homepage \"http://www.qgis.org\"\n  url \"https://github.com/qgis/QGIS/archive/final-2_8_9.tar.gz\"\n  sha256 \"7bfc6fa2221ec7fc809c0cacc5ef821f6d3b6d8d8254b4cee8fd9c452731e3d6\"\n\n  bottle do\n    # root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n    # sha256 \"6a2d89239b8da548a765beb839d428a81d1a1b34c3e64d8fe4c8699993aff7ef\" => :mavericks\n    # sha256 \"15210d5e07cf9bfe1de8a042c5ddee82acf41b94adb28909a9c79dd6582e91c2\" => :yosemite\n  end\n\n  def pour_bottle?\n    brewed_python?\n  end\n\n  head \"https://github.com/qgis/QGIS.git\", :branch => \"release-2_8\"\n\n  option \"enable-isolation\", \"Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs\"\n  option \"with-debug\", \"Enable debug build, which outputs info to system.log or console\"\n  option \"without-server\", \"Build without QGIS Server (qgis_mapserv.fcgi)\"\n  option \"without-postgresql\", \"Build without current PostgreSQL client\"\n  option \"with-globe\", \"Build with Globe plugin, based upon osgEarth\"\n  option \"without-postgis\", \"Build without extra PostGIS geospatial database extender\"\n  option \"without-grass\", \"Build without GRASS 6 integration plugin and Processing plugin support\"\n  option \"with-grass7\", \"Build with GRASS 7 for Processing plugin\"\n  option \"with-oracle\", \"Build extra Oracle geospatial database and raster support\"\n  option \"with-orfeo\", \"Build extra Orfeo Toolbox for Processing plugin\"\n  option \"with-r\", \"Build extra R for Processing plugin\"\n  option \"with-saga-gis\", \"Build extra Saga GIS for Processing plugin\"\n  option \"with-qt-mysql\", \"Build extra Qt MySQL plugin for eVis plugin\"\n  option \"with-api-docs\", \"Build the API documentation with Doxygen and Graphviz\"\n\n  depends_on UnlinkedQGIS28\n\n  # core qgis\n  depends_on \"cmake\" => :build\n  depends_on \"bison\" => :build\n  if build.with? \"api-docs\"\n    depends_on \"graphviz\" => [:build, \"with-freetype\"]\n    depends_on \"doxygen\" => [:build, \"with-dot\"] # with graphviz support\n  end\n  depends_on (build.include? \"enable-isolation\" || MacOS.version < :lion ) ? \"python\" : :python\n  depends_on \"qt\"\n  depends_on \"pyqt\"\n  depends_on SipBinary\n  depends_on PyQtConfig\n  depends_on \"qscintilla2\" # will probably be a C++ lib deps in near future\n  depends_on \"qwt\"\n  depends_on \"qwtpolar\"\n  depends_on \"gsl\"\n  depends_on \"sqlite\" # keg_only\n  depends_on \"expat\" # keg_only\n  depends_on \"proj\"\n  depends_on \"spatialindex\"\n  depends_on \"fcgi\" if build.with? \"server\"\n  # use newer postgresql client than Apple's, also needed by `psycopg2`\n  depends_on \"postgresql\" => :recommended\n\n  # core providers\n  depends_on \"gdal\"\n  depends_on \"postgis\" => :recommended\n  depends_on \"oracle-client-sdk\" if build.with? \"oracle\"\n  # TODO: add MSSQL third-party support formula?, :optional\n\n  # core plugins (c++ and python)\n  if build.with? \"grass\"\n    depends_on \"grass-64\"\n    depends_on \"gdal-grass64\"\n    depends_on \"gettext\"\n  end\n\n  if build.with? \"globe\"\n    depends_on \"open-scene-graph\" => [\"with-qt\"]\n    depends_on \"homebrew/science/osgearth\"\n  end\n  depends_on \"gpsbabel\" => [:recommended, \"with-libusb\"]\n  # TODO: remove \"pyspatialite\" when PyPi package supports spatialite 4.x\n  #       or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite)\n  depends_on \"pyspatialite\" # for DB Manager\n  depends_on \"qt-mysql\" => :optional # for eVis plugin (non-functional in 2.x?)\n\n  # core processing plugin extras\n  # see `postgis` and `grass` above\n  depends_on \"grass-70\" if build.with? \"grass7\"\n  depends_on \"orfeo-42\" if build.with? \"orfeo\"\n  depends_on \"homebrew/science/r\" => :optional\n  depends_on \"saga-gis\" => :optional\n  # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools)\n  # TODO: Fusion from USFS (via `wine`?)\n\n  resource \"pyqgis-startup\" do\n    url \"https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py\"\n    sha256 \"3d0adca0c8684f3d907c626fc86d93d73165e184960d16ae883fca665ecc32e6\"\n    version \"2.0.0\"\n  end\n\n  # patches that represent all backports to release-2_8 branch\n  # see: https://github.com/qgis/QGIS/commits/release-2_8\n  # stable do\n  #   patch do\n  #     # since 2.8.9 tag thru ---, minus windows-formatted patches\n  #     url \"\"\n  #     sha256 \"\"\n  #   end\n  # end\n\n  def install\n    # Set bundling level back to 0 (the default in all versions prior to 1.8.0)\n    # so that no time and energy is wasted copying the Qt frameworks into QGIS.\n    qwt_fw = Formula[\"qwt\"].opt_lib/\"qwt.framework\"\n    qwtpolar_fw = Formula[\"qwtpolar\"].opt_lib/\"qwtpolar.framework\"\n    dev_fw = lib/\"qgis-dev\"\n    dev_fw.mkpath\n    qsci_opt = Formula[\"qscintilla2\"].opt_prefix\n    args = std_cmake_args\n    args << \"-DCMAKE_BUILD_TYPE=RelWithDebInfo\" if build.with? \"debug\" # override\n    args += %W[\n      -DBISON_EXECUTABLE=#{Formula[\"bison\"].opt_bin}/bison\n      -DENABLE_TESTS=FALSE\n      -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers\n      -DQWT_LIBRARY=#{qwt_fw}/qwt\n      -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers\n      -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar\n      -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include\n      -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib\n      -DQSCI_SIP_DIR=#{qsci_opt}/share/sip\n      -DWITH_INTERNAL_QWTPOLAR=FALSE\n      -DQGIS_MACAPP_BUNDLE=0\n      -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}'\n      -DQGIS_MACAPP_INSTALL_DEV=TRUE\n      -DWITH_QSCIAPI=FALSE\n      -DWITH_STAGED_PLUGINS=FALSE\n    ]\n\n    args << \"-DPYTHON_EXECUTABLE='#{python_exec}'\"\n    # brewed python is used if installed\n    if brewed_python?\n      args << \"-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'\"\n    end\n\n    # find git revision for HEAD build\n    if build.head? && File.exists?(\"#{cached_download}/.git/index\")\n      args << \"-DGITCOMMAND=#{Formula[\"git\"].opt_bin}/git\"\n      args << \"-DGIT_MARKER=#{cached_download}/.git/index\"\n    else\n      args << \"-DGIT_MARKER=''\" # if git clone borked, or release tarball, ends up defined as 'exported'\n    end\n\n    args << \"-DWITH_SERVER=#{build.with?(\"server\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"server\"\n      fcgi_opt = Formula[\"fcgi\"].opt_prefix\n      args << \"-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include\"\n      args << \"-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib\"\n    end\n\n    args << \"-DPOSTGRES_CONFIG=#{Formula[\"postgresql\"].opt_bin}/pg_config\" if build.with? \"postgresql\"\n\n    args << \"-DWITH_GRASS=#{build.with?(\"grass\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"grass\"\n      # this is to build the GRASS Plugin, not for Processing plugin support\n      grass = Formula[\"grass-64\"]\n      args << \"-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version.to_s}'\"\n      # So that `libintl.h` can be found\n      ENV.append \"CXXFLAGS\", \"-I'#{Formula[\"gettext\"].opt_include}'\"\n    end\n\n    args << \"-DWITH_GLOBE=#{build.with?(\"globe\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"globe\"\n      osg = Formula[\"open-scene-graph\"]\n      opoo \"`open-scene-graph` formula's keg not linked.\" unless osg.linked_keg.exist?\n      # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there\n      args << \"-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}\"\n    end\n\n    args << \"-DWITH_ORACLE=#{build.with?(\"oracle\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"oracle\"\n      oracle_opt = Formula[\"oracle-client-sdk\"].opt_prefix\n      args << \"-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include\"\n      args << \"-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib\"\n    end\n\n    args << \"-DWITH_APIDOC=#{build.with?(\"api-docs\") ? \"TRUE\" : \"FALSE\"}\"\n\n    # Avoid ld: framework not found QtSql\n    # (https://github.com/Homebrew/homebrew-science/issues/23)\n    ENV.append \"CXXFLAGS\", \"-F#{Formula[\"qt\"].opt_lib}\"\n\n    # if using Homebrew's Python, make sure its components are always found first\n    # see: https://github.com/Homebrew/homebrew/pull/28597\n    ENV[\"PYTHONHOME\"] = \"#{brewed_python_framework}\" if brewed_python?\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      #system \"bbedit\", \"CMakeCache.txt\"\n      #raise\n      system \"make\", \"install\"\n    end\n\n    # Update .app's bundle identifier, so Kyngchaos.com installer doesn't get confused\n    inreplace prefix/\"QGIS.app/Contents/Info.plist\",\n              \"org.qgis.qgis2\", \"org.qgis.qgis2-hb#{build.head? ? \"-dev\" : \"\"}\"\n\n    py_lib = lib/\"python2.7/site-packages\"\n    py_lib.mkpath\n    ln_s \"../../../QGIS.app/Contents/Resources/python/qgis\", py_lib/\"qgis\"\n\n    ln_s \"QGIS.app/Contents/MacOS/fcgi-bin\", prefix/\"fcgi-bin\" if build.with? \"server\"\n\n    doc.mkpath\n    mv prefix/\"QGIS.app/Contents/Resources/doc/api\", doc/\"api\" if build.with? \"api-docs\"\n    ln_s \"../../../QGIS.app/Contents/Resources/doc\", doc/\"doc\"\n\n    # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped)\n    # only works with QGIS > 2.0.1\n    # doesn't need executable bit set, loaded by Python runner in QGIS\n    libexec.install resource(\"pyqgis-startup\")\n\n    bin.mkdir\n    touch \"#{bin}/qgis\" # so it will be linked into HOMEBREW_PREFIX\n    post_install\n  end\n\n  def post_install\n    # configure environment variables for .app and launching binary directly.\n    # having this in `post_intsall` allows it to be individually run *after* installation with:\n    #    `brew postinstall -v qgis-XX` <-- where XX is formula version\n\n    app = prefix/\"QGIS.app\"\n    tab = Tab.for_formula(self)\n    opts = tab.used_options\n    bottle_poured = tab.poured_from_bottle\n\n    # define default isolation env vars\n    pthsep = File::PATH_SEPARATOR\n    pypth = \"#{python_site_packages}\"\n    pths = %W[#{HOMEBREW_PREFIX/\"bin\"} /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin].join(pthsep)\n\n    unless opts.include? \"enable-isolation\"\n      pths = ORIGINAL_PATHS.join(pthsep)\n      unless pths.include? HOMEBREW_PREFIX/\"bin\"\n        pths = HOMEBREW_PREFIX/\"bin\" + pthsep + pths\n      end\n      pyenv = ENV[\"PYTHONPATH\"]\n      if pyenv\n        pypth = (pyenv.include?(pypth)) ? pyenv : pypth + pthsep + pyenv\n      end\n    end\n\n    # set install's lib/python2.7/site-packages first, so app will work if unlinked\n    pypth = \"#{lib}/python2.7/site-packages\" + pthsep + pypth\n\n    envars = {\n      :PATH => \"#{pths}\",\n      :PYTHONPATH => \"#{pypth}\",\n      :GDAL_DRIVER_PATH => \"#{HOMEBREW_PREFIX}/lib/gdalplugins\"\n    }\n\n    proc_algs = \"Contents/Resources/python/plugins/processing/algs\"\n    unless opts.include? \"without-grass\"\n      grass = Formula[\"grass-64\"]\n      envars[:GRASS_PREFIX] = \"#{grass.opt_prefix}/grass-#{grass.version.to_s}\"\n      begin\n        inreplace app/\"#{proc_algs}/grass/GrassUtils.py\",\n                  \"/Applications/GRASS-6.4.app/Contents/MacOS\",\n                  HOMEBREW_PREFIX/\"opt/grass-64/grass-base\" unless bottle_poured\n      rescue Utils::InreplaceError\n        puts \"GRASS 6 GrassUtils already updated\"\n      end\n\n    end\n\n    if opts.include? \"with-grass7\"\n      begin\n        inreplace app/\"#{proc_algs}/grass7/Grass7Utils.py\",\n                  \"/Applications/GRASS-7.0.app/Contents/MacOS\",\n                  HOMEBREW_PREFIX/\"opt/grass-70/grass-base\"\n      rescue Utils::InreplaceError\n        puts \"GRASS 7 GrassUtils already updated\"\n      end\n    end\n\n    unless opts.include? \"without-globe\"\n      osg = Formula[\"open-scene-graph\"]\n      envars[:OSG_LIBRARY_PATH] = \"#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}\"\n    end\n\n    if opts.include? \"enable-isolation\"\n      envars[:DYLD_FRAMEWORK_PATH] = \"#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks\"\n      versioned = %W[\n        #{Formula[\"sqlite\"].opt_lib}\n        #{Formula[\"expat\"].opt_lib}\n        #{Formula[\"libxml2\"].opt_lib}\n        #{HOMEBREW_PREFIX}/lib\n      ]\n      envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep)\n    end\n    if opts.include? \"enable-isolation\" or File.exist?(\"/Library/Frameworks/GDAL.framework\")\n      envars[:PYQGIS_STARTUP] = opt_libexec/\"pyqgis_startup.py\"\n    end\n\n    #envars.each { |key, value| puts \"#{key.to_s}=#{value}\" }\n    #exit\n\n    # add env vars to QGIS.app's Info.plist, in LSEnvironment section\n    plst = app/\"Contents/Info.plist\"\n    # first delete any LSEnvironment setting, ignoring errors\n    # CAUTION!: may not be what you want, if .app already has LSEnvironment settings\n    dflt = quiet_system \"defaults read-type \\\"#{plst}\\\" LSEnvironment\"\n    system \"defaults delete \\\"#{plst}\\\" LSEnvironment\" if dflt\n    kv = \"{ \"\n    envars.each { |key, value| kv += \"'#{key.to_s}' = '#{value}'; \" }\n    kv += \"}\"\n    system \"defaults write \\\"#{plst}\\\" LSEnvironment \\\"#{kv}\\\"\"\n    # leave the plist readable; convert from binary to XML format\n    system \"plutil -convert xml1 -- \\\"#{plst}\\\"\"\n    # update modification date on app bundle, or changes won't take effect\n    touch \"#{app}\"\n\n    # add env vars to launch script for QGIS app's binary\n    qgis_bin = bin/\"qgis\"\n    rm_f qgis_bin if File.exists?(qgis_bin) # install generates empty file\n    bin_cmds = %W[#!/bin/sh\\n]\n    # setup shell-prepended env vars (may result in duplication of paths)\n    envars[:PATH] = \"#{HOMEBREW_PREFIX}/bin\" + pthsep + \"$PATH\"\n    envars[:PYTHONPATH] = \"#{python_site_packages}\" + pthsep + \"$PYTHONPATH\"\n    envars.each { |key, value| bin_cmds << \"export #{key.to_s}=#{value}\" }\n    bin_cmds << opt_prefix/\"QGIS.app/Contents/MacOS/QGIS \\\"$@\\\"\"\n    qgis_bin.write(bin_cmds.join(\"\\n\"))\n    qgis_bin.chmod 0755\n  end\n\n  def caveats\n    s = <<~EOS\n      Bottles support only Homebrew's Python\n\n      QGIS is built as an application bundle. Environment variables for the\n      Homebrew prefix are embedded in QGIS.app:\n        #{opt_prefix}/QGIS.app\n\n      You may also symlink QGIS.app into /Applications or ~/Applications:\n        brew linkapps [--local]\n\n      To directly run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper\n      script pre-defined with Homebrew prefix environment variables:\n        #{opt_bin}/qgis\n\n      NOTE: Your current PATH and PYTHONPATH environment variables are honored\n            when launching via the wrapper script, while launching QGIS.app\n            bundle they are not.\n\n      For standalone Python development, set the following environment variable:\n        export PYTHONPATH=#{python_site_packages}:$PYTHONPATH\n\n      Developer frameworks are installed in:\n        #{opt_lib}/qgis-dev\n        NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation.\n              Use dyld -F option in CPPFLAGS/LDFLAGS when building other software.\n\n    EOS\n\n    if build.include? \"enable-isolation\"\n      s += <<~EOS\n        QGIS built with isolation enabled. This allows it to coexist with other\n        types of installations of QGIS on your Mac. However, on versions >= 2.0.1,\n        this also means Python modules installed in the *system* Python will NOT\n        be available to Python processes within QGIS.app.\n\n      EOS\n    end\n\n    # check for required run-time Python module dependencies\n    # TODO: add \"pyspatialite\" when PyPi package supports spatialite 4.x\n    xm = []\n    %w[psycopg2 matplotlib pyparsing].each {\n        |m| xm << m unless module_importable? m\n    }\n    unless xm.empty?\n      s += <<~EOS\n        The following Python modules are needed by QGIS during run-time:\n\n            #{xm.join(\", \")}\n\n        You can install manually, via installer package or with `pip` (if availble):\n\n            pip install <module>  OR  pip-2.7 install <module>\n\n      EOS\n    end\n    # TODO: remove this when libqscintilla.dylib becomes core build dependency?\n    unless module_importable? \"PyQt4.Qsci\"\n      s += <<~EOS\n        QScintilla Python module is needed by QGIS during run-time.\n        Ensure `qscintilla2` formula is linked.\n\n      EOS\n    end\n\n    s += <<~EOS\n      If you have built GRASS 6.4.x or 7.0.x support for the Processing plugin set\n      the following in QGIS:\n        Processing->Options: Providers->GRASS commands->GRASS folder to:\n           #{HOMEBREW_PREFIX}/opt/grass-64/grass-base\n        Processing->Options: Providers->GRASS GIS 7 commands->GRASS 7 folder to:\n           #{HOMEBREW_PREFIX}/opt/grass-70/grass-base\n\n    EOS\n\n    s\n  end\n\n  private\n\n  def brewed_python_framework\n    HOMEBREW_PREFIX/\"Frameworks/Python.framework/Versions/2.7\"\n  end\n\n  def brewed_python_framework?\n    brewed_python_framework.exist?\n  end\n\n  def brewed_python?\n    Formula[\"python\"].linked_keg.exist? and brewed_python_framework?\n  end\n\n  def python_exec\n    if brewed_python?\n      brewed_python_framework/\"bin/python\"\n    else\n      which(\"python\")\n    end\n  end\n\n  def python_incdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_python_inc())\"`.strip)\n  end\n\n  def python_libdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))\"`.strip)\n  end\n\n  def python_site_packages\n    HOMEBREW_PREFIX/\"lib/python2.7/site-packages\"\n  end\n\n  def module_importable?(mod)\n    quiet_system python_exec, \"-c\", \"import #{mod}\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qgis-ltr@2.rb",
    "content": "class QgisLtrAT2 < Formula\n  include Language::Python::Virtualenv\n  desc \"Open Source Geographic Information System\"\n  homepage \"https://www.qgis.org\"\n\n  revision 1\n\n  head \"https://github.com/qgis/QGIS.git\", :branch => \"release-2_18\"\n\n  stable do\n    url \"https://github.com/qgis/QGIS/archive/final-2_18_28.tar.gz\"\n    sha256 \"977380578a1dfd80861d25324fd841adab97647a15cb8582f748946dbd23277c\"\n  end\n  bottle do\n    root_url \"https://dl.bintray.com/homebrew-osgeo/osgeo-bottles\"\n    sha256 \"78a60f8a233aeec26ce7393f0d5af7124ff1b5fffe598a02f259e6a9e041c978\" => :mojave\n    sha256 \"78a60f8a233aeec26ce7393f0d5af7124ff1b5fffe598a02f259e6a9e041c978\" => :high_sierra\n    sha256 \"78a60f8a233aeec26ce7393f0d5af7124ff1b5fffe598a02f259e6a9e041c978\" => :sierra\n  end\n\n\n  def pour_bottle?\n    brewed_python?\n  end\n\n  option \"with-isolation\", \"Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs\"\n  option \"without-debug\", \"Disable debug build, which outputs info to system.log or console\"\n  option \"without-server\", \"Build without QGIS Server (qgis_mapserv.fcgi)\"\n  option \"without-postgresql\", \"Build without current PostgreSQL client\"\n  option \"with-gdal-1\", \"Build with GDAL/OGR v1.x instead of v2.x\"\n  option \"with-globe\", \"Build with Globe plugin, based upon osgEarth\"\n  option \"with-grass\", \"Build with GRASS 7 integration plugin and Processing plugin support (or install grass-7x first)\"\n  option \"with-grass6\", \"Build extra GRASS 6 for Processing plugin\"\n  option \"with-oracle\", \"Build extra Oracle geospatial database and raster support\"\n  option \"with-orfeo5\", \"Build extra Orfeo Toolbox for Processing plugin\"\n  option \"with-r\", \"Build extra R for Processing plugin\"\n  option \"with-saga-gis-lts\", \"Build extra Saga GIS for Processing plugin\"\n  option \"with-qspatialite\", \"Build QSpatialite Qt database driver\"\n  option \"with-api-docs\", \"Build the API documentation with Doxygen and Graphviz\"\n  # option \"with-qt-mysql\", \"Build extra Qt MySQL plugin for eVis plugin\"\n\n  # core qgis\n  depends_on \"cmake\" => :build\n  depends_on \"bison\" => :build\n  depends_on \"flex\" => :build\n  if build.with? \"api-docs\"\n    depends_on \"graphviz\" => :build\n    depends_on \"doxygen\" => :build\n  end\n  depends_on \"python@2\"\n  depends_on \"qt-4\"\n  depends_on \"sip-qt4\"\n  depends_on \"pyqt-qt4\"\n  depends_on \"qca-qt4\"\n  depends_on \"qscintilla2-qt4\"\n  depends_on \"qwt-qt4\"\n  depends_on \"qwtpolar-qt4\"\n  depends_on \"qjson-qt4\"\n  depends_on \"gsl\"\n  depends_on \"sqlite\" # keg_only\n  depends_on \"expat\" # keg_only\n  depends_on \"osgeo-proj\"\n  depends_on \"spatialindex\"\n  depends_on \"fcgi\" if build.with? \"server\"\n  # use newer postgresql client than Apple's, also needed by `psycopg2`\n  depends_on \"osgeo-postgresql\" => :recommended\n\n  # core providers\n  if build.with? \"gdal-1\"\n    depends_on \"gdal\"\n  else\n    depends_on \"gdal2\"\n    depends_on \"gdal2-python\"\n  end\n  depends_on \"oracle-client-sdk\" if build.with? \"oracle\"\n  # TODO: add MSSQL third-party support formula?, :optional\n\n  # core plugins (c++ and python)\n  if build.with?(\"grass\") || (HOMEBREW_PREFIX/\"opt/grass7\").exist?\n    depends_on \"osgeo-grass\"\n    depends_on \"gettext\"\n  end\n\n  if build.with? \"globe\"\n    # this is pretty borked with OS X >= 10.10+\n    # depends on \"open-scene-graph\" => [\"with-qt\"]\n    depends_on \"open-scene-graph\"\n    depends_on \"brewsci/science/osgearth\"\n  end\n  depends_on \"gpsbabel-qt4\" => :optional\n  # TODO: remove \"pyspatialite\" when PyPi package supports spatialite 4.x\n  #       or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite)\n  depends_on \"pyspatialite\" # for DB Manager\n  # depends on \"qt-mysql\" => :optional # for eVis plugin (non-functional in 2.x?)\n\n  # core processing plugin extras\n  # see `grass` above\n  depends_on \"grass6\" => :optional\n  depends_on \"orfeo5\" => :optional\n  depends_on \"r\" => :optional\n  depends_on \"osgeo-saga-lts\" => :optional\n  # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools)\n  # TODO: Fusion from USFS (via `wine`?)\n\n  resource \"pyqgis-startup\" do\n    url \"https://gist.githubusercontent.com/dakcarto/11385561/raw/e49f75ecec96ed7d6d3950f45ad3f30fe94d4fb2/pyqgis_startup.py\"\n    sha256 \"385dce925fc2d29f05afd6508bc1f46ec84c0bc607cc0c8dfce78a4bb93b9c4e\"\n    version \"2.14.0\"\n  end\n\n  resource \"certifi\" do\n    url \"https://files.pythonhosted.org/packages/55/54/3ce77783acba5979ce16674fc98b1920d00b01d337cfaaf5db22543505ed/certifi-2018.11.29.tar.gz\"\n    sha256 \"47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7\"\n  end\n\n  resource \"chardet\" do\n    url \"https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz\"\n    sha256 \"84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae\"\n  end\n\n  resource \"idna\" do\n    url \"https://files.pythonhosted.org/packages/ad/13/eb56951b6f7950cadb579ca166e448ba77f9d24efc03edd7e55fa57d04b7/idna-2.8.tar.gz\"\n    sha256 \"c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407\"\n  end\n\n  # MetaSearch plugin\n  resource \"OWSLib\" do\n    url \"https://files.pythonhosted.org/packages/07/15/9609cbb31c9f7ce729d444c04319c1e68a1ae3fd377a93c7615392c0b1e0/OWSLib-0.17.1.tar.gz\"\n    sha256 \"b2e7fd694d3cffcee79317bad492d60c0aa887aea6916517c051c3247b33b5a5\"\n  end\n\n  resource \"cython\" do\n    url \"https://files.pythonhosted.org/packages/e0/31/4a166556f92c469d8291d4b03a187f325c773c330fffc1e798bf83d947f2/Cython-0.29.5.tar.gz\"\n    sha256 \"9d5290d749099a8e446422adfb0aa2142c711284800fb1eb70f595101e32cbf1\"\n  end\n\n  resource \"pyproj\" do\n    url \"https://files.pythonhosted.org/packages/26/8c/1da0580f334718e04f8bbf74f0515a7fb8185ff96b2560ce080c11aa145b/pyproj-1.9.6.tar.gz\"\n    sha256 \"e0c02b1554b20c710d16d673817b2a89ff94738b0b537aead8ecb2edc4c4487b\"\n  end\n\n  resource \"python-dateutil\" do\n    url \"https://files.pythonhosted.org/packages/ad/99/5b2e99737edeb28c71bcbec5b5dda19d0d9ef3ca3e92e3e925e7c0bb364c/python-dateutil-2.8.0.tar.gz\"\n    sha256 \"c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e\"\n  end\n\n  resource \"pytz\" do\n    url \"https://files.pythonhosted.org/packages/af/be/6c59e30e208a5f28da85751b93ec7b97e4612268bb054d0dff396e758a90/pytz-2018.9.tar.gz\"\n    sha256 \"d5f05e487007e29e03409f9398d074e158d920d36eb82eaf66fb1136b0c5374c\"\n  end\n\n  resource \"requests\" do\n    url \"https://files.pythonhosted.org/packages/52/2c/514e4ac25da2b08ca5a464c50463682126385c4272c18193876e91f4bc38/requests-2.21.0.tar.gz\"\n    sha256 \"502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e\"\n  end\n\n  resource \"six\" do\n    url \"https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz\"\n    sha256 \"d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73\"\n  end\n\n  resource \"urllib3\" do\n    url \"https://files.pythonhosted.org/packages/b1/53/37d82ab391393565f2f831b8eedbffd57db5a718216f82f1a8b4d381a1c1/urllib3-1.24.1.tar.gz\"\n    sha256 \"de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22\"\n  end\n\n  resource \"coverage\" do\n    url \"https://files.pythonhosted.org/packages/fb/af/ce7b0fe063ee0142786ee53ad6197979491ce0785567b6d8be751d2069e8/coverage-4.5.2.tar.gz\"\n    sha256 \"ab235d9fe64833f12d1334d29b558aacedfbca2356dfb9691f2d0d38a8a7bfb4\"\n  end\n\n  resource \"funcsigs\" do\n    url \"https://files.pythonhosted.org/packages/94/4a/db842e7a0545de1cdb0439bb80e6e42dfe82aaeaadd4072f2263a4fbed23/funcsigs-1.0.2.tar.gz\"\n    sha256 \"a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50\"\n  end\n\n  resource \"future\" do\n    url \"https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz\"\n    sha256 \"67045236dcfd6816dc439556d009594abf643e5eb48992e36beac09c2ca659b8\"\n  end\n\n  resource \"mock\" do\n    url \"https://files.pythonhosted.org/packages/0c/53/014354fc93c591ccc4abff12c473ad565a2eb24dcd82490fae33dbf2539f/mock-2.0.0.tar.gz\"\n    sha256 \"b158b6df76edd239b8208d481dc46b6afd45a846b7812ff0ce58971cf5bc8bba\"\n  end\n\n  resource \"nose2\" do\n    url \"https://files.pythonhosted.org/packages/1b/c5/d5fcd60f5bf8af1e320fde832d7965933581a9b21b0d1b29bbe2208f4403/nose2-0.8.0.tar.gz\"\n    sha256 \"9052f2b46807b63d9bdf68e0768da1f8386368889b50043fd5d0889c470258f3\"\n  end\n\n  resource \"pbr\" do\n    url \"https://files.pythonhosted.org/packages/4e/cc/691ba51448695510978855c07753344ca27af1d881a05f03b56dd8087570/pbr-5.1.2.tar.gz\"\n    sha256 \"d717573351cfe09f49df61906cd272abaa759b3e91744396b804965ff7bff38b\"\n  end\n\n  # DB Manager plugin and Processing plugin\n  resource \"psycopg2\" do\n    url \"https://files.pythonhosted.org/packages/63/54/c039eb0f46f9a9406b59a638415c2012ad7be9b4b97bfddb1f48c280df3a/psycopg2-2.7.7.tar.gz\"\n    sha256 \"f4526d078aedd5187d0508aa5f9a01eae6a48a470ed678406da94b4cd6524b7e\"\n  end\n\n  # Processing plugin\n  resource \"PyYAML\" do\n    url \"https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz\"\n    sha256 \"3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf\"\n  end\n\n  # MetaSearch plugin\n  resource \"Jinja2\" do\n    url \"https://files.pythonhosted.org/packages/56/e6/332789f295cf22308386cf5bbd1f4e00ed11484299c5d7383378cf48ba47/Jinja2-2.10.tar.gz\"\n    sha256 \"f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4\"\n  end\n\n  resource \"MarkupSafe\" do\n    url \"https://files.pythonhosted.org/packages/ac/7e/1b4c2e05809a4414ebce0892fe1e32c14ace86ca7d50c70f00979ca9b3a3/MarkupSafe-1.1.0.tar.gz\"\n    sha256 \"4e97332c9ce444b0c2c38dd22ddc61c743eb208d916e4265a2a3b575bdccb1d3\"\n  end\n\n  # MetaSearch plugin\n  resource \"Pygments\" do\n    url \"https://files.pythonhosted.org/packages/64/69/413708eaf3a64a6abb8972644e0f20891a55e621c6759e2c3f3891e05d63/Pygments-2.3.1.tar.gz\"\n    sha256 \"5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a\"\n  end\n\n  def install\n\n    # Install python dependencies\n    venv = virtualenv_create(libexec/'vendor')\n    venv.pip_install resources.reject { |r| r.name == \"pyqgis-startup\" }\n\n    # Set bundling level back to 0 (the default in all versions prior to 1.8.0)\n    # so that no time and energy is wasted copying the Qt frameworks into QGIS.\n\n    # Install custom widgets Designer plugin to local qt-4 plugins prefix\n    inreplace \"src/customwidgets/CMakeLists.txt\",\n              \"${QT_PLUGINS_DIR}/designer\", lib_qt4/\"plugins/designer\".to_s\n\n    # Fix custom widgets Designer module install path\n    inreplace \"CMakeLists.txt\",\n              \"${PYQT4_MOD_DIR}\", lib_qt4/\"python2.7/site-packages/PyQt4\".to_s\n\n    # Install db plugins to local qt-4 plugins prefix\n    if build.with? \"qspatialite\"\n      inreplace \"src/providers/spatialite/qspatialite/CMakeLists.txt\",\n                \"${QT_PLUGINS_DIR}/sqldrivers\", lib_qt4/\"plugins/sqldrivers\".to_s\n    end\n    if build.with? \"oracle\"\n      inreplace \"src/providers/oracle/ocispatial/CMakeLists.txt\",\n                \"${QT_PLUGINS_DIR}/sqldrivers\", lib_qt4/\"plugins/sqldrivers\".to_s\n    end\n\n    qwt_fw = Formula[\"qwt-qt4\"].opt_lib/\"qwt.framework\"\n    qwtpolar_fw = Formula[\"qwtpolar-qt4\"].opt_lib/\"qwtpolar.framework\"\n    qsci_opt = Formula[\"qscintilla2-qt4\"].opt_prefix\n    args = std_cmake_args\n    args << \"-DCMAKE_BUILD_TYPE=RelWithDebInfo\" if build.with? \"debug\" # override\n    args += %W[\n      -DBISON_EXECUTABLE=#{Formula[\"bison\"].opt_bin}/bison\n      -DFLEX_EXECUTABLE=#{Formula[\"flex\"].opt_bin}/flex\n      -DENABLE_TESTS=FALSE\n      -DENABLE_MODELTEST=FALSE\n      -DSUPPRESS_QT_WARNINGS=TRUE\n      -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers\n      -DQWT_LIBRARY=#{qwt_fw}/qwt\n      -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers\n      -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar\n      -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/libexec/include\n      -DQSCINTILLA_LIBRARY=#{qsci_opt}/libexec/lib/libqscintilla2.dylib\n      -DQSCI_SIP_DIR=#{qsci_opt}/share/sip-qt4\n      -DWITH_QWTPOLAR=TRUE\n      -DWITH_INTERNAL_QWTPOLAR=FALSE\n      -DQGIS_MACAPP_BUNDLE=0\n      -DQGIS_MACAPP_INSTALL_DEV=FALSE\n      -DWITH_QSCIAPI=FALSE\n      -DWITH_STAGED_PLUGINS=TRUE\n      -DWITH_GRASS=FALSE\n      -DWITH_CUSTOM_WIDGETS=TRUE\n    ]\n\n    if build.without? \"gdal-1\"\n      args << \"-DGDAL_LIBRARY=#{Formula[\"gdal2\"].opt_lib}/libgdal.dylib\"\n      args << \"-DGDAL_INCLUDE_DIR=#{Formula[\"gdal2\"].opt_include}\"\n      # These specific includes help ensure any gdal v1 includes are not\n      # accidentally pulled from /usr/local/include\n      # In CMakeLists.txt throughout QGIS source tree these includes may come\n      # before opt/gdal2/include; 'fixing' many CMakeLists.txt may be unwise\n      args << \"-DGEOS_INCLUDE_DIR=#{Formula[\"geos\"].opt_include}\"\n      args << \"-DGSL_INCLUDE_DIR=#{Formula[\"gsl\"].opt_include}\"\n      args << \"-DPROJ_INCLUDE_DIR=#{Formula[\"proj\"].opt_include}\"\n      args << \"-DQCA_INCLUDE_DIR=#{Formula[\"qca-qt4\"].opt_lib}/qca.framework/Headers\"\n      args << \"-DSPATIALINDEX_INCLUDE_DIR=#{Formula[\"spatialindex\"].opt_include}/spatialindex\"\n      args << \"-DSPATIALITE_INCLUDE_DIR=#{Formula[\"libspatialite\"].opt_include}\"\n      args << \"-DSQLITE3_INCLUDE_DIR=#{Formula[\"sqlite\"].opt_include}\"\n    end\n\n    # Python Configuration\n     args << \"-DPYTHON_EXECUTABLE='#{`python2 -c \"import sys; print(sys.executable)\"`.chomp}'\"\n     args << \"-DPYTHON_CUSTOM_FRAMEWORK='#{`python2 -c \"import sys; print(sys.prefix)\"`.chomp}'\"\n    # Disable future, because we've installed it in the virtualenv and will provide it at runtime.\n    args << \"-DWITH_INTERNAL_FUTURE=FALSE\"\n\n    # if using Homebrew's Python, make sure its components are always found first\n    # see: https://github.com/Homebrew/homebrew/pull/28597\n    ENV[\"PYTHONHOME\"] = brewed_python_framework.to_s if brewed_python?\n\n    # handle custom site-packages for qt-4 keg-only modules and packages\n    ENV.prepend_path \"PYTHONPATH\", python_site_packages\n    ENV.append_path \"PYTHONPATH\", python_qt4_site_packages\n    ENV.prepend_path \"PATH\", libexec/'vendor/bin/'\n\n    # find git revision for HEAD build\n    if build.head? && File.exist?(\"#{cached_download}/.git/index\")\n      args << \"-DGITCOMMAND=#{Formula[\"git\"].opt_bin}/git\"\n      args << \"-DGIT_MARKER=#{cached_download}/.git/index\"\n    end\n\n    args << \"-DWITH_SERVER=#{build.with?(\"server\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"server\"\n      fcgi_opt = Formula[\"fcgi\"].opt_prefix\n      args << \"-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include\"\n      args << \"-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib\"\n    end\n\n    args << \"-DPOSTGRES_CONFIG=#{Formula[\"postgresql\"].opt_bin}/pg_config\" if build.with? \"postgresql\"\n\n    args << \"-DWITH_GRASS7=#{(build.with?(\"grass\") || brewed_grass7?) ? \"TRUE\" : \"FALSE\"}\"\n    if build.with?(\"grass\") || brewed_grass7?\n      # this is to build the GRASS Plugin, not for Processing plugin support\n      grass7 = Formula[\"grass7\"]\n      args << \"-DGRASS_PREFIX7='#{grass7.opt_prefix}/grass-base'\"\n      # Keep superenv from stripping (use Cellar prefix)\n      ENV.append \"CXXFLAGS\", \"-isystem #{grass7.prefix.resolved_path}/grass-base/include\"\n      # So that `libintl.h` can be found (use Cellar prefix)\n      ENV.append \"CXXFLAGS\", \"-isystem #{Formula[\"gettext\"].include.resolved_path}\"\n    end\n\n    args << \"-DWITH_GLOBE=#{build.with?(\"globe\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"globe\"\n      osg = Formula[\"open-scene-graph\"]\n      opoo \"`open-scene-graph` formula's keg not linked.\" unless osg.linked_keg.exist?\n      # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there\n      args << \"-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}\"\n    end\n\n    args << \"-DWITH_ORACLE=#{build.with?(\"oracle\") ? \"TRUE\" : \"FALSE\"}\"\n    if build.with? \"oracle\"\n      oracle_opt = Formula[\"oracle-client-sdk\"].opt_prefix\n      args << \"-DOCI_INCLUDE_DIR=#{oracle_opt}/include/oci\"\n      args << \"-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib\"\n    end\n\n    args << \"-DWITH_QSPATIALITE=#{build.with?(\"qspatialite\") ? \"TRUE\" : \"FALSE\"}\"\n\n    args << \"-DWITH_APIDOC=#{build.with?(\"api-docs\") ? \"TRUE\" : \"FALSE\"}\"\n\n    # Avoid ld: framework not found QtSql\n    # (https://github.com/Homebrew/homebrew-science/issues/23)\n    ENV.append \"CXXFLAGS\", \"-F#{Formula[\"qt-4\"].opt_lib}\"\n\n    # handle some compiler warnings\n    ENV[\"CXX_EXTRA_FLAGS\"] = \"-Wno-unused-private-field -Wno-deprecated-register\"\n    if ENV.compiler == :clang && (MacOS::Xcode.version >= \"7.0\" || MacOS::CLT.version >= \"7.0\")\n      ENV.append \"CXX_EXTRA_FLAGS\", \"-Wno-inconsistent-missing-override\"\n    end\n\n    mkdir \"build\" do\n      # bbedit = \"/usr/local/bin/bbedit\"\n      # cmake_config = Pathname(\"#{Dir.pwd}/#{name}_cmake-config.txt\")\n      # cmake_config.write [\"cmake ..\", *args].join(\" \\\\\\n\")\n      # system bbedit, cmake_config.to_s\n      # raise\n      system \"cmake\", \"..\", *args\n      # system bbedit, \"CMakeCache.txt\"\n      # raise\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    # Fixup some errant lib linking\n    # TODO: fix upstream in CMake\n    dy_libs = [lib_qt4/\"plugins/designer/libqgis_customwidgets.dylib\"]\n    dy_libs << lib_qt4/\"plugins/sqldrivers/libqsqlspatialite.dylib\" if build.with? \"qspatialite\"\n    dy_libs.each do |dy_lib|\n      MachO::Tools.dylibs(dy_lib.to_s).each do |i_n|\n        %w[core gui].each do |f_n|\n          sufx = i_n[/(qgis_#{f_n}\\.framework.*)/, 1]\n          next if sufx.nil?\n          i_n_to = \"#{opt_prefix}/QGIS.app/Contents/Frameworks/#{sufx}\"\n          puts \"Changing install name #{i_n} to #{i_n_to} in #{dy_lib}\" if ARGV.debug?\n          dy_lib.ensure_writable do\n            MachO::Tools.change_install_name(dy_lib.to_s, i_n.to_s, i_n_to, :strict => false)\n          end\n        end\n      end\n    end\n\n    # Update .app's bundle identifier, so Kyngchaos.com installer doesn't get confused\n    inreplace prefix/\"QGIS.app/Contents/Info.plist\",\n              \"org.qgis.qgis2\", \"org.qgis.qgis2-hb#{build.head? ? \"-dev\" : \"\"}\"\n\n    py_lib = python_site_packages\n    ln_s \"../../../QGIS.app/Contents/Resources/python/qgis\", py_lib/\"qgis\"\n\n    ln_s \"QGIS.app/Contents/MacOS/fcgi-bin\", prefix/\"fcgi-bin\" if build.with? \"server\"\n\n    doc.mkpath\n    mv prefix/\"QGIS.app/Contents/Resources/doc/api\", doc/\"api\" if build.with? \"api-docs\"\n    ln_s \"../../../QGIS.app/Contents/Resources/doc\", doc/\"doc\"\n\n    # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped)\n    # only works with QGIS > 2.0.1\n    # doesn't need executable bit set, loaded by Python runner in QGIS\n    libexec.install resource(\"pyqgis-startup\")\n\n    bin.mkdir\n    qgis_bin = bin/name.to_s\n    touch qgis_bin.to_s # so it will be linked into HOMEBREW_PREFIX\n    qgis_bin.chmod 0755\n    post_install\n  end\n\n  def post_install\n    # configure environment variables for .app and launching binary directly.\n    # having this in `post_intsall` allows it to be individually run *after* installation with:\n    #    `brew postinstall -v <formula-name>`\n\n    app = prefix/\"QGIS.app\"\n    tab = Tab.for_formula(self)\n    opts = tab.used_options\n    # bottle_poured = tab.poured_from_bottle\n\n    # define default isolation env vars\n    pthsep = File::PATH_SEPARATOR\n    pypth = python_site_packages.to_s\n    pths = %w[/usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin]\n\n    unless opts.include?(\"with-isolation\")\n      pths = ORIGINAL_PATHS.dup\n      pyenv = ENV[\"PYTHONPATH\"]\n      if pyenv\n        pypth = pyenv.include?(pypth) ? pyenv : pypth + pthsep + pyenv\n      end\n    end\n\n    unless pths.include?(HOMEBREW_PREFIX/\"bin\")\n      pths = pths.insert(0, HOMEBREW_PREFIX/\"bin\")\n    end\n\n    # set qt-4's then install's libexec/python2.7/site-packages first, so app will work if unlinked\n    pypths = %W[#{python_qt4_site_packages} #{opt_libexec}/python2.7/site-packages #{pypth}]\n\n    unless opts.include?(\"with-gdal-1\")\n      pths.insert(0, Formula[\"gdal2\"].opt_bin.to_s)\n      pths.insert(0, Formula[\"gdal2-python\"].opt_bin.to_s)\n      pypths.insert(0, \"#{Formula[\"gdal2-python\"].opt_lib}/python2.7/site-packages\")\n    end\n\n    # prepend qt-4 based utils to PATH (reverse order)\n    pths.insert(0, Formula[\"qca-qt4\"].opt_bin.to_s)\n    pths.insert(0, Formula[\"pyqt-qt4\"].opt_bin.to_s)\n    pths.insert(0, \"#{Formula[\"sip-qt4\"].opt_libexec}/bin\")\n    pths.insert(0, Formula[\"qt-4\"].opt_bin.to_s)\n\n    if opts.include?(\"with-gpsbabel-qt4\")\n      pths.insert(0, Formula[\"gpsbabel-qt4\"].opt_bin.to_s)\n    end\n\n    # We need to manually add the saga lts path, since it's keg only\n    if build.with? \"saga-gis-lts\"\n      pths.insert(0, Formula[\"saga-gis-lts\"].opt_bin.to_s)\n    end\n\n    envars = {\n      :PATH => pths.join(pthsep),\n      :PYTHONPATH => pypths.join(pthsep),\n      :GDAL_DRIVER_PATH => \"#{HOMEBREW_PREFIX}/lib/gdalplugins\",\n    }\n    envars[:GDAL_DATA] = \"#{Formula[opts.include?(\"with-gdal-1\") ? \"gdal\": \"gdal2\"].opt_share}/gdal\"\n\n    # handle multiple Qt plugins directories\n    qtplgpths = %W[\n      #{opt_lib}/qt-4/plugins\n      #{hb_lib_qt4}/plugins\n      #{Formula[\"qt-4\"].opt_prefix}/plugins\n    ]\n    envars[:QT_PLUGIN_PATH] = qtplgpths.join(pthsep)\n\n    proc_algs = \"Contents/Resources/python/plugins/processing/algs\"\n    if opts.include?(\"with-grass\") || brewed_grass7?\n      grass7 = Formula[\"grass7\"]\n      # for core integration plugin support\n      envars[:GRASS_PREFIX] = \"#{grass7.opt_prefix}/grass-base\"\n      begin\n        inreplace app/\"#{proc_algs}/grass7/Grass7Utils.py\",\n                  \"/Applications/GRASS-7.0.app/Contents/MacOS\",\n                  \"#{grass7.opt_prefix}/grass-base\"\n        puts \"GRASS 7 GrassUtils.py has been updated\"\n      rescue Utils::InreplaceError\n        puts \"GRASS 7 GrassUtils.py already updated\"\n      end\n    end\n\n    grass6 = Formula[\"grass6\"]\n    grass6_rpl = (opts.include?(\"with-grass6\") || brewed_grass6?) ? \"#{grass6.opt_prefix}/grass-base\" : \"\"\n    begin\n      inreplace app/\"#{proc_algs}/grass/GrassUtils.py\",\n                \"/Applications/GRASS-6.4.app/Contents/MacOS\",\n                grass6_rpl\n      puts \"GRASS 6 GrassUtils.py has been updated\"\n    rescue Utils::InreplaceError\n      puts \"GRASS 6 GrassUtils.py already updated\"\n    end\n\n    if opts.include?(\"with-orfeo5\") || brewed_orfeo5?\n      orfeo5 = Formula[\"orfeo5\"]\n      begin\n        inreplace app/\"#{proc_algs}/otb/OTBUtils.py\" do |s|\n          # default geoid path\n          # try to replace first, so it fails (if already done) before global replaces\n          s.sub! \"OTB_GEOID_FILE) or ''\", \"OTB_GEOID_FILE) or '#{orfeo5.opt_libexec}/default_geoid/egm96.grd'\"\n          # default bin and lib path\n          s.gsub! \"/usr/local/bin\", orfeo5.opt_bin.to_s\n          s.gsub! \"/usr/local/lib\", orfeo5.opt_lib.to_s\n        end\n        puts \"ORFEO 5 OTBUtils.py has been updated\"\n      rescue Utils::InreplaceError\n        puts \"ORFEO 5 OTBUtils.py already updated\"\n      end\n    end\n\n    unless opts.include?(\"without-globe\")\n      osg = Formula[\"open-scene-graph\"]\n      envars[:OSG_LIBRARY_PATH] = \"#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}\"\n    end\n\n    if opts.include?(\"with-isolation\")\n      envars[:DYLD_FRAMEWORK_PATH] = \"#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks\"\n      versioned = %W[\n        #{Formula[\"sqlite\"].opt_lib}\n        #{Formula[\"expat\"].opt_lib}\n        #{Formula[\"libxml2\"].opt_lib}\n        #{HOMEBREW_PREFIX}/lib\n      ]\n      envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep)\n    end\n    if opts.include?(\"with-isolation\") || File.exist?(\"/Library/Frameworks/GDAL.framework\")\n      envars[:PYQGIS_STARTUP] = opt_libexec/\"pyqgis_startup.py\"\n    end\n\n    # envars.each { |key, value| puts \"#{key.to_s}=#{value}\" }\n    # exit\n\n    # add env vars to QGIS.app's Info.plist, in LSEnvironment section\n    plst = app/\"Contents/Info.plist\"\n    # first delete any LSEnvironment setting, ignoring errors\n    # CAUTION!: may not be what you want, if .app already has LSEnvironment settings\n    dflt = `defaults read-type \\\"#{plst}\\\" LSEnvironment 2> /dev/null`\n    `defaults delete \\\"#{plst}\\\" LSEnvironment` if dflt\n    kv = \"{ \"\n    envars.each { |key, value| kv += \"'#{key}' = '#{value}'; \" }\n    kv += \"}\"\n    `defaults write \\\"#{plst}\\\" LSEnvironment \\\"#{kv}\\\"`\n    # add ability to toggle high resolution in Get Info dialog for app\n    hrc = `defaults read-type \\\"#{plst}\\\" NSHighResolutionCapable 2> /dev/null`\n    `defaults delete \\\"#{plst}\\\" NSHighResolutionCapable` if hrc\n    `defaults write \\\"#{plst}\\\" NSHighResolutionCapable \\\"False\\\"`\n    # leave the plist readable; convert from binary to XML format\n    `plutil -convert xml1 -- \\\"#{plst}\\\"`\n    # make sure plist is readble by all users\n    plst.chmod 0644\n    # update modification date on app bundle, or changes won't take effect\n    touch app.to_s\n\n    # add env vars to launch script for QGIS app's binary\n    qgis_bin = bin/name.to_s\n    rm_f qgis_bin if File.exist?(qgis_bin) # install generates empty file\n    bin_cmds = %W[#!/bin/sh\\n]\n    # setup shell-prepended env vars (may result in duplication of paths)\n    unless pths.include? HOMEBREW_PREFIX/\"bin\"\n      pths.insert(0, HOMEBREW_PREFIX/\"bin\")\n    end\n    # even though this should be affected by with-isolation, allow local env override\n    pths << \"$PATH\"\n    pypths << \"$PYTHONPATH\"\n    envars[:PATH] = pths.join(pthsep)\n    envars[:PYTHONPATH] = pypths.join(pthsep)\n    envars.each { |key, value| bin_cmds << \"export #{key}=#{value}\" }\n    bin_cmds << opt_prefix/\"QGIS.app/Contents/MacOS/QGIS \\\"$@\\\"\"\n    qgis_bin.write(bin_cmds.join(\"\\n\"))\n    qgis_bin.chmod 0755\n  end\n\n  def caveats\n    s = <<~EOS\n      Bottles support only Homebrew's Python\n\n      QGIS is built as an application bundle. Environment variables for the\n      Homebrew prefix are embedded in QGIS.app:\n        #{opt_prefix}/QGIS.app\n\n      You may also symlink QGIS.app into /Applications or ~/Applications:\n        ln -Fs `find $(brew --prefix) -name \"QGIS.app\"` /Applications/QGIS.app\n\n      To directly run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper\n      script pre-defined with Homebrew prefix environment variables:\n        #{opt_bin}/#{name}\n\n      NOTE: Your current PATH and PYTHONPATH environment variables are honored\n            when launching via the wrapper script, while launching QGIS.app\n            bundle they are not.\n\n      For standalone Python development, set the following environment variable:\n        export PYTHONPATH=#{libexec/\"python2.7/site-packages\"}:#{python_qt4_site_packages}:#{python_site_packages}:$PYTHONPATH\n\n    EOS\n\n    if build.with? \"isolation\"\n      s += <<~EOS\n        QGIS built with isolation enabled. This allows it to coexist with other\n        types of installations of QGIS on your Mac. However, on versions >= 2.0.1,\n        this also means Python modules installed in the *system* Python will NOT\n        be available to Python processes within QGIS.app.\n\n      EOS\n    end\n\n    # check for required run-time Python module dependencies\n    # TODO: add \"pyspatialite\" when PyPi package supports spatialite 4.x\n    xm = []\n    %w[psycopg2 matplotlib pyparsing requests future jinja2 pygments].each do |m|\n      xm << m unless module_importable? m\n    end\n    unless xm.empty?\n      s += <<~EOS\n        #{Tty.red}\n        The following Python modules are needed by QGIS during run-time:\n\n            #{xm.join(\", \")}\n\n        You can install manually, via installer package or with `pip` (if availble):\n\n            pip install <module>  OR  pip-2.7 install <module>\n        #{Tty.red}\n        #{Tty.reset}\n      EOS\n    end\n    # TODO: remove this when libqscintilla.dylib becomes core build dependency?\n    unless module_importable? \"PyQt4.Qsci\"\n      s += <<~EOS\n        QScintilla Python module is needed by QGIS during run-time.\n        Ensure `qscintilla2-qt4` formula is linked.\n\n      EOS\n    end\n\n    s += <<~EOS\n      If you have built GRASS 6.4.x or 7.0.x support for the Processing plugin set\n      the following in QGIS:\n        Processing->Options: Providers->GRASS commands->GRASS folder to:\n           #{HOMEBREW_PREFIX}/opt/grass6/grass-base\n        Processing->Options: Providers->GRASS GIS 7 commands->GRASS 7 folder to:\n           #{HOMEBREW_PREFIX}/opt/grass7/grass-base\n\n    EOS\n\n    s\n  end\n\n  test do\n    output = `#{bin}/#{name.to_s} --help 2>&1` # why does help go to stderr?\n    assert_match /^QGIS is a user friendly/, output\n  end\n\n  private\n\n  def brewed_grass7?\n    Formula[\"grass7\"].opt_prefix.exist?\n  end\n\n  def brewed_grass6?\n    Formula[\"grass6\"].opt_prefix.exist?\n  end\n\n  def brewed_orfeo5?\n    Formula[\"orfeo5\"].opt_prefix.exist?\n  end\n\n  def brewed_python_framework\n    HOMEBREW_PREFIX/\"Frameworks/Python.framework/Versions/2.7\"\n  end\n\n  def brewed_python_framework?\n    brewed_python_framework.exist?\n  end\n\n  def brewed_python?\n    Formula[\"python\"].linked_keg.exist? && brewed_python_framework?\n  end\n\n  def python_exec\n    if brewed_python?\n      brewed_python_framework/\"bin/python2\"\n    else\n      which(\"python\")\n    end\n  end\n\n  def python_incdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_python_inc())\"`.strip)\n  end\n\n  def python_libdir\n    Pathname.new(`#{python_exec} -c \"from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))\"`.strip)\n  end\n\n  def python_site_packages\n    libexec/\"vendor/lib/python2.7/site-packages\"\n  end\n\n  def hb_lib_qt4\n    HOMEBREW_PREFIX/\"lib/qt-4\"\n  end\n\n  def python_qt4_site_packages\n    hb_lib_qt4/\"python2.7/site-packages\"\n  end\n\n  def lib_qt4\n    lib/\"qt-4\"\n  end\n\n  def opt_lib_qt4\n    opt_lib/\"qt-4\"\n  end\n\n  def module_importable?(mod)\n    quiet_system python_exec, \"-c\", \"import sys;sys.path.insert(1, '#{python_qt4_site_packages}'); import #{mod}\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qjson-qt4.rb",
    "content": "class QjsonQt4 < Formula\n  desc \"Map JSON to QVariant objects\"\n  homepage \"https://qjson.sourceforge.io/\"\n  url \"https://downloads.sourceforge.net/project/qjson/qjson/0.8.1/qjson-0.8.1.tar.bz2\"\n  mirror \"https://mirrors.kernel.org/debian/pool/main/q/qjson/qjson_0.8.1.orig.tar.bz2\"\n  sha256 \"cd4db5b956247c4991a9c3e95512da257cd2a6bd011357e363d02300afc814d9\"\n  head \"https://github.com/flavio/qjson.git\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    sha256 \"b1c454074eb32130bb2be41f9790f8d138437ee1cdc1c29c5cf1922e25e22f0c\" => :sierra\n    sha256 \"b1c454074eb32130bb2be41f9790f8d138437ee1cdc1c29c5cf1922e25e22f0c\" => :high_sierra\n  end\n\n  depends_on \"cmake\" => :build\n  depends_on \"qt-4\"\n\n  def install\n    system \"cmake\", \".\", *std_cmake_args\n    system \"make\", \"install\"\n  end\n\n  test do\n    (testpath/\"test.cpp\").write <<~EOS\n      #include <qjson/parser.h>\n      int main() {\n        QJson::Parser parser;\n        return 0;\n      }\n    EOS\n    system ENV.cxx, \"-I#{include}\", \"-I#{Formula[\"qt-4\"].opt_include}\",\n           \"-L#{lib}\", \"-lqjson\",\n           testpath/\"test.cpp\", \"-o\", testpath/\"test\"\n    system \"./test\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qscintilla2-qt4.rb",
    "content": "class Qscintilla2Qt4 < Formula\n  desc \"Port to Qt of the Scintilla editing component\"\n  homepage \"https://www.riverbankcomputing.com/software/qscintilla/intro\"\n  url \"https://downloads.sf.net/project/pyqt/QScintilla2/QScintilla-2.9.3/QScintilla_gpl-2.9.3.tar.gz\"\n  sha256 \"98aab93d73b05635867c2fc757acb383b5856a0b416e3fd7659f1879996ddb7e\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    cellar :any\n    rebuild 1\n    sha256 \"4901834123c98962f50c4fa4fd7c48b46c926e846cd0b4390a2cd79d45e93e2b\" => :high_sierra\n    sha256 \"4901834123c98962f50c4fa4fd7c48b46c926e846cd0b4390a2cd79d45e93e2b\" => :sierra\n  end\n\n  option \"without-plugin\", \"Skip building the Qt Designer plugin\"\n  option \"without-python@2\", \"Skip building the Python bindings\"\n\n  depends_on \"python@2\" => :recommended\n\n  if build.with? \"python@2\"\n    depends_on \"pyqt-qt4\"\n  else\n    depends_on \"qt-4\"\n  end\n\n  # Fix build with Xcode 8 \"error: implicit instantiation of undefined template\"\n  # Originally reported 7 Oct 2016 https://www.riverbankcomputing.com/pipermail/qscintilla/2016-October/001160.html\n  # Patch below posted 13 Oct 2016 https://www.riverbankcomputing.com/pipermail/qscintilla/2016-October/001167.html\n  # Same as Alan Garny's OpenCOR commit https://github.com/opencor/opencor/commit/70f3944e36b8b95b3ad92106aeae2f511b3f0e90\n  if DevelopmentTools.clang_build_version >= 800\n    patch do\n      url \"https://raw.githubusercontent.com/Homebrew/formula-patches/a651d71/qscintilla2/xcode-8.patch\"\n      sha256 \"1a88309fdfd421f4458550b710a562c622d72d6e6fdd697107e4a43161d69bc9\"\n    end\n  end\n\n  def install\n    # On Mavericks we want to target libc++, this requires an\n    # unsupported/macx-clang-libc++ flag.\n    if ENV.compiler == :clang && MacOS.version >= :mavericks\n      spec = \"unsupported/macx-clang-libc++\"\n    else\n      spec = \"macx-g++\"\n    end\n    args = %W[-config release -spec #{spec}]\n\n    cd \"Qt4Qt5\" do\n      inreplace \"qscintilla.pro\" do |s|\n        s.gsub! \"$$[QT_INSTALL_LIBS]\", libexec/\"lib\"\n        s.gsub! \"$$[QT_INSTALL_HEADERS]\", libexec/\"include\"\n        s.gsub! \"$$[QT_INSTALL_TRANSLATIONS]\", prefix/\"trans\"\n        s.gsub! \"$$[QT_INSTALL_DATA]\", prefix/\"data\"\n      end\n\n      inreplace \"features/qscintilla2.prf\" do |s|\n        s.gsub! \"$$[QT_INSTALL_LIBS]\", libexec/\"lib\"\n        s.gsub! \"$$[QT_INSTALL_HEADERS]\", libexec/\"include\"\n      end\n\n      system \"qmake\", \"qscintilla.pro\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    # Add qscintilla2 features search path, since it is not installed in Qt keg's mkspecs/features/\n    ENV[\"QMAKEFEATURES\"] = prefix/\"data/mkspecs/features\"\n\n    if build.with?(\"python@2\")\n      sip_f = Formula[\"sip-qt4\"]\n      ENV.prepend_path \"PATH\", \"#{sip_f.opt_libexec}/bin\"\n      sip_dir = sip_f.name\n      cd \"Python\" do\n        Language::Python.each_python(build) do |python, version|\n          lib.mkpath\n          (share/sip_dir).mkpath\n          ENV[\"PYTHONPATH\"] = \"#{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages\"\n          system python, \"configure.py\", \"-o\", libexec/\"lib\", \"-n\", libexec/\"include\",\n                           \"--apidir=#{prefix}/qsci\",\n                           \"--destdir=#{lib}/qt-4/python#{version}/site-packages/PyQt4\",\n                           \"--stubsdir=#{lib}/qt-4/python#{version}/site-packages/PyQt4\",\n                           \"--sip-incdir=#{sip_f.opt_libexec}/include\",\n                           \"--qsci-sipdir=#{share}/#{sip_dir}\",\n                           \"--pyqt-sipdir=#{Formula[\"pyqt-qt4\"].opt_share}/#{sip_dir}\",\n                           \"--spec=#{spec}\"\n          system \"make\"\n          system \"make\", \"install\"\n          system \"make\", \"clean\"\n        end\n      end\n    end\n\n    if build.with? \"plugin\"\n      mkpath prefix/\"plugins/designer\"\n      cd \"designer-Qt4Qt5\" do\n        inreplace \"designer.pro\" do |s|\n          s.sub! \"$$[QT_INSTALL_PLUGINS]\", \"#{lib}/qt-4/plugins\"\n          s.sub! \"$$[QT_INSTALL_LIBS]\", libexec/\"lib\"\n        end\n        system \"qmake\", \"designer.pro\", *args\n        system \"make\"\n        system \"make\", \"install\"\n      end\n    end\n  end\n\n  def caveats\n    s = \"Libraries installed in #{opt_libexec}/lib\\n\\n\"\n    s += \"Headers installed in #{opt_libexec}/include\\n\\n\"\n    s += \"Python modules installed in:\\n\"\n    Language::Python.each_python(build) do |_python, version|\n      s += \"  #{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages/PyQt4\"\n    end\n    s\n  end\n\n  test do\n    Language::Python.each_python(build) do |python, version|\n      ENV[\"PYTHONPATH\"] = \"#{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages\"\n      Pathname(\"test.py\").write <<~EOS\n      import PyQt4.Qsci\n      assert(\"QsciLexer\" in dir(PyQt4.Qsci))\n      EOS\n      system python, \"test.py\"\n    end\n  end\nend\n"
  },
  {
    "path": "boneyard/qscintilla2.rb",
    "content": "require 'formula'\n\nclass Qscintilla2 < Formula\n  homepage 'http://www.riverbankcomputing.co.uk/software/qscintilla/intro'\n  url 'http://downloads.sf.net/project/pyqt/QScintilla2/QScintilla-2.8/QScintilla-gpl-2.8.tar.gz'\n  sha1 '3edf9d476d4e6af0706a4d33401667a38e3a697e'\n\n  depends_on 'pyqt'\n  depends_on 'sip'\n\n  def install\n\n    args = %W[-config release -spec]\n    # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag\n    if ENV.compiler == :clang and MacOS.version >= :mavericks\n      args << \"unsupported/macx-clang-libc++\"\n    else\n      args << \"macx-g++\"\n    end\n\n    cd 'Qt4Qt5' do\n      inreplace 'qscintilla.pro' do |s|\n        s.gsub! '$$[QT_INSTALL_LIBS]', lib\n        s.gsub! \"$$[QT_INSTALL_HEADERS]\", include\n        s.gsub! \"$$[QT_INSTALL_TRANSLATIONS]\", \"#{prefix}/trans\"\n        s.gsub! \"$$[QT_INSTALL_DATA]\", \"#{prefix}/data\"\n      end\n\n      system \"qmake\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n\n    cd 'Python' do\n      (share/\"sip\").mkpath\n      system 'python', 'configure.py', \"-o\", lib, \"-n\", include,\n                       \"--apidir=#{prefix}/qsci\",\n                       \"--destdir=#{lib}/python2.7/site-packages/PyQt4\",\n                       \"--qsci-sipdir=#{share}/sip\",\n                       \"--pyqt-sipdir=#{HOMEBREW_PREFIX}/share/sip\"\n      system 'make'\n      system 'make', 'install'\n    end\n\n    libexec.mkpath\n    cd \"designer-Qt4Qt5\" do\n      args << %Q[\"INCLUDEPATH+=#{include}\"]\n      inreplace \"designer.pro\" do |s|\n        s.gsub! \"$$[QT_INSTALL_LIBS]\", lib\n        s.gsub! \"$$[QT_INSTALL_PLUGINS]\", libexec\n      end\n\n      system \"qmake\", *args\n      system \"make\"\n      system \"make\", \"install\"\n    end\n    # symlink QT Designer plugin (note: not removed on formula uninstall)\n      ln_sf libexec/\"designer/libqscintillaplugin.dylib\",\n            \"#{Formula.factory('qt').opt_prefix}/plugins/designer/\"\n  end\n\n  test do\n    system \"python\", \"-c\", \"import PyQt4\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qt-4.rb",
    "content": "class Qt4 < Formula\n  desc \"Cross-platform application and UI framework\"\n  homepage \"https://www.qt.io/\"\n  url \"https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz\"\n  mirror \"http://qt.mirror.constant.com/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz\"\n  sha256 \"e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0\"\n\n  bottle do\n    root_url \"https://dl.bintray.com/homebrew-osgeo/osgeo-bottles\"\n    rebuild 1\n    sha256 \"b144bc04f10d95c1855ab79d69e0a2905694eb0165907846c8b153fa64ff1f67\" => :high_sierra\n    sha256 \"b144bc04f10d95c1855ab79d69e0a2905694eb0165907846c8b153fa64ff1f67\" => :sierra\n  end\n\n  # Backport of Qt5 commit to fix the fatal build error with Xcode 7, SDK 10.11.\n  # https://code.qt.io/cgit/qt/qtbase.git/commit/?id=b06304e164ba47351fa292662c1e6383c081b5ca\n  if MacOS.version >= :el_capitan\n    patch do\n      url \"https://raw.githubusercontent.com/Homebrew/formula-patches/480b7142c4e2ae07de6028f672695eb927a34875/qt/el-capitan.patch\"\n      sha256 \"c8a0fa819c8012a7cb70e902abb7133fc05235881ce230235d93719c47650c4e\"\n    end\n  end\n\n  keg_only \"deprecated in homebrew-core for macOS >= Sierra (10.12)\"\n\n  option \"with-qt3support\", \"Build with deprecated Qt3Support module support\"\n  option \"with-docs\", \"Build documentation\"\n  option \"without-webkit\", \"Build without QtWebKit module\"\n\n  depends_on \"openssl\"\n  depends_on \"dbus\" => :optional\n  depends_on \"mysql\" => :optional\n  depends_on \"osgeo-postgresql\" => :optional\n\n  # Qt4 is dead upstream. We backported a build fix for 10.11 but do not\n  # intend to keep rescuing it forever, including for macOS 10.12. Homebrew will\n  # be migrating to Qt5 as widely as possible, which remains supported upstream.\n  # depends on MaximumMacOSRequirement => :el_capitan\n\n  deprecated_option \"qtdbus\" => \"with-dbus\"\n  deprecated_option \"with-d-bus\" => \"with-dbus\"\n\n  resource \"test-project\" do\n    url \"https://gist.github.com/tdsmith/f55e7e69ae174b5b5a03.git\",\n        :revision => \"6f565390395a0259fa85fdd3a4f1968ebcd1cc7d\"\n  end\n\n  def install\n    if ENV.compiler == :clang && (MacOS::Xcode.version >= \"9.0\" || MacOS::CLT.version >= \"9.0\")\n      odie <<~EOS\n        Compilation not supported with Xcode/CLT 9.0 or higher.\n        Use no formula or source-build options and install available bottle.\n      EOS\n    end\n\n    args = %W[\n      -prefix #{prefix}\n      -release\n      -opensource\n      -confirm-license\n      -fast\n      -system-zlib\n      -qt-libtiff\n      -qt-libpng\n      -qt-libjpeg\n      -nomake demos\n      -nomake examples\n      -cocoa\n    ]\n\n    if ENV.compiler == :clang\n      args << \"-platform\"\n\n      if MacOS.version >= :mavericks\n        args << \"unsupported/macx-clang-libc++\"\n      else\n        args << \"unsupported/macx-clang\"\n      end\n    end\n\n    # Phonon is broken on macOS 10.12+ and Xcode 8+ due to QTKit.framework\n    # being removed.\n    args << \"-no-phonon\" if MacOS.version >= :sierra || MacOS::Xcode.version >= \"8.0\"\n\n    args << \"-openssl-linked\"\n    args << \"-I\" << Formula[\"openssl\"].opt_include\n    args << \"-L\" << Formula[\"openssl\"].opt_lib\n\n    args << \"-plugin-sql-mysql\" if build.with? \"mysql\"\n    args << \"-plugin-sql-psql\" if build.with? \"postgresql\"\n\n    if build.with? \"dbus\"\n      dbus_opt = Formula[\"dbus\"].opt_prefix\n      args << \"-I#{dbus_opt}/lib/dbus-1.0/include\"\n      args << \"-I#{dbus_opt}/include/dbus-1.0\"\n      args << \"-L#{dbus_opt}/lib\"\n      args << \"-ldbus-1\"\n      args << \"-dbus-linked\"\n    end\n\n    if build.with? \"qt3support\"\n      args << \"-qt3support\"\n    else\n      args << \"-no-qt3support\"\n    end\n\n    args << \"-nomake\" << \"docs\" if build.without? \"docs\"\n\n    if MacOS.prefer_64_bit?\n      args << \"-arch\" << \"x86_64\"\n    else\n      args << \"-arch\" << \"x86\"\n    end\n\n    args << \"-no-webkit\" if build.without? \"webkit\"\n\n    system \"./configure\", *args\n    system \"make\"\n    ENV.deparallelize\n    system \"make\", \"install\"\n\n    # what are these anyway?\n    (bin+\"pixeltool.app\").rmtree\n    (bin+\"qhelpconverter.app\").rmtree\n    # remove porting file for non-humans\n    (prefix+\"q3porting.xml\").unlink if build.without? \"qt3support\"\n\n    # Some config scripts will only find Qt in a \"Frameworks\" folder\n    frameworks.install_symlink Dir[\"#{lib}/*.framework\"]\n\n    # The pkg-config files installed suggest that headers can be found in the\n    # `include` directory. Make this so by creating symlinks from `include` to\n    # the Frameworks' Headers folders.\n    Pathname.glob(\"#{lib}/*.framework/Headers\") do |path|\n      include.install_symlink path => path.parent.basename(\".framework\")\n    end\n\n    # Make `HOMEBREW_PREFIX/lib/qt-4/plugins` an additional plug-in search path\n    # for Qt Designer to support formulae that provide Qt Designer plug-ins.\n    system \"/usr/libexec/PlistBuddy\",\n            \"-c\", \"Add :LSEnvironment:QT_PLUGIN_PATH string \\\"#{HOMEBREW_PREFIX}/lib/qt-4/plugins\\\"\",\n           \"#{bin}/Designer.app/Contents/Info.plist\"\n\n    Pathname.glob(\"#{bin}/*.app\") { |app| mv app, prefix }\n  end\n\n  def post_install\n    (HOMEBREW_PREFIX/\"lib/qt-4/plugins/designer\").mkpath\n  end\n\n  def caveats; <<~EOS\n    We agreed to the Qt opensource license for you.\n    If this is unacceptable you should uninstall.\n\n    Qt Designer no longer picks up changes to the QT_PLUGIN_PATH environment\n    variable as it was tweaked to search for plug-ins provided by formulae in\n      #{HOMEBREW_PREFIX}/lib/qt-4/plugins\n\n    Phonon is not supported on macOS Sierra or with Xcode 8.\n    EOS\n  end\n\n  test do\n    Encoding.default_external = \"UTF-8\" unless RUBY_VERSION.start_with? \"1.\"\n    resource(\"test-project\").stage testpath\n    system bin/\"qmake\"\n    system \"make\"\n    assert_match(/GitHub/, pipe_output(testpath/\"qtnetwork-test 2>&1\", nil, 0))\n  end\nend\n"
  },
  {
    "path": "boneyard/qt4-mysql.rb",
    "content": "class NoQt4MysqlAlreadyRequirement < Requirement\n  fatal true\n  satisfy(:build_env => false) { !(Formula[\"qt-4\"].prefix/\"plugins/sqldrivers/libqsqlmysql.dylib\").exist? }\n\n  def message; <<~EOS\n    Qt5 formula already has QtWebKit installed (e.g. built `--with-webkit`)\n  EOS\n  end\nend\n\nclass Qt4Mysql < Formula\n  desc \"MySQL database plugin for Qt 4\"\n  homepage \"http://qt-project.org/\"\n  # stripped down archive of just what's needed to compile driver\n  url \"https://osgeo4mac.s3.amazonaws.com/src/qt-4.8.7-mysql-driver.tar.gz\"\n  sha256 \"fd542bb8502308e615aef68c76727091786cdd02f298e5b6e0c168d2ee49be85\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    sha256 \"a32644c5b499c448eb426d19bcc9276f33f377cd199010946b1f85fa83dcb788\" => :sierra\n    sha256 \"a32644c5b499c448eb426d19bcc9276f33f377cd199010946b1f85fa83dcb788\" => :high_sierra\n  end\n\n  depends_on NoQt4MysqlAlreadyRequirement\n\n  depends_on \"mysql\" => :build # just needs static client lib and headers\n  depends_on \"qt-4\"\n  depends_on \"openssl\"\n\n  def install\n    ENV.deparallelize\n\n    qt_plugins = lib/\"qt-4/plugins\"\n    (qt_plugins/\"sqldrivers\").mkpath\n    inreplace \"src/plugins/sqldrivers/qsqldriverbase.pri\", \"$$[QT_INSTALL_PLUGINS]\", qt_plugins.to_s\n\n    cd \"src/plugins/sqldrivers/mysql\" do\n      args = %w[-spec]\n      # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag\n      if ENV.compiler == :clang && MacOS.version >= :mavericks\n        args << \"unsupported/macx-clang-libc++\"\n      else\n        args << \"macx-g++\"\n      end\n      mysql = Formula[\"mysql\"]\n      args << %Q(INCLUDEPATH+=\"#{mysql.include}/mysql\")\n      args << %Q(LIBS+=\"#{mysql.lib}/libmysqlclient.a\")\n      args << %Q(LIBS+=\"-L#{Formula[\"openssl\"].opt_lib}\")\n      args << 'LIBS+=\"-lssl\"'\n      args << 'LIBS+=\"-lcrypto\"'\n      args << \"mysql.pro\"\n\n      system \"#{Formula[\"qt-4\"].opt_bin}/qmake\", *args\n      system \"make\", \"release\"\n      system \"make\", \"release-install\"\n    end\n  end\n\n  test do\n    (testpath/\"hello.pro\").write <<~EOS\n      QT        += core sql\n      QT        -= gui\n      TARGET     = hello\n      CONFIG    += console\n      CONFIG    -= app_bundle\n      TEMPLATE   = app\n      HEADERS    = client.h\n      SOURCES   += client.cpp main.cpp\n    EOS\n\n    (testpath/\"client.h\").write <<~EOS\n    #ifndef CLIENT_H\n    #define CLIENT_H\n    #include <QObject>\n    #include <QSqlDatabase>\n    #include <QString>\n\n    class Client : public QObject\n    {\n      Q_OBJECT\n\n    public:\n      Client(QObject *parent = 0);\n\n    public slots:\n      void checkSqlDriver();\n    };\n    #endif // CLIENT_H\n    EOS\n\n    (testpath/\"client.cpp\").write <<~EOS\n    #include \"client.h\"\n    #include <QCoreApplication>\n    #include <QDebug>\n    #include <QSqlDatabase>\n    #include <QStringList>\n\n    Client::Client(QObject *parent)\n      : QObject(parent)\n    {\n    }\n\n    void Client::checkSqlDriver()\n    {\n      QCoreApplication::addLibraryPath(\"#{HOMEBREW_PREFIX}/lib/qt-4/plugins\");\n      QCoreApplication::addLibraryPath(\"#{lib}/qt-4/plugins\");\n      qDebug() << \"QSqlDatabase::drivers(): \" << QSqlDatabase::drivers().join(\" \");\n      QCoreApplication::exit(!QSqlDatabase::isDriverAvailable(\"QMYSQL\"));\n    }\n    EOS\n\n    (testpath/\"main.cpp\").write <<~EOS\n      #include <QCoreApplication>\n      #include <QDebug>\n      #include <QTimer>\n      #include \"client.h\"\n\n      int main(int argc, char *argv[])\n      {\n        QCoreApplication app(argc, argv);\n        Client c(app.instance());\n        qDebug() << \"Running application\";\n        QTimer::singleShot(1000, &c, SLOT(checkSqlDriver()));\n        return app.exec();\n      }\n    EOS\n\n    cd testpath do\n      system Formula[\"qt-4\"].bin/\"qmake\", \"hello.pro\"\n      system \"make\"\n      assert_predicate testpath/\"client.o\", :exist?\n      assert_predicate testpath/\"moc_client.o\", :exist?\n      assert_predicate testpath/\"main.o\", :exist?\n      assert_predicate testpath/\"hello\", :exist?\n      system \"./hello\"\n    end\n  end\nend\n"
  },
  {
    "path": "boneyard/qt4-oracle.rb",
    "content": "class Qt4Oracle < Formula\n  desc \"Oracle database plugin for Qt 4\"\n  homepage \"http://qt-project.org/\"\n  # stripped down archive of just what's needed to compile driver\n  url \"https://osgeo4mac.s3.amazonaws.com/src/qt-4.8.7-oracle-driver.tar.gz\"\n  sha256 \"72714836bebc58c7d0944110fef956ba085c714c7e81f00da287cdeedcbc231b\"\n\n  depends_on \"qt-4\"\n  depends_on \"oracle-client-sdk\"\n\n  def oracle_env_vars\n    oci = Formula[\"oracle-client-sdk\"]\n    tab = Tab.for_formula(self)\n    opts = tab.used_options\n    oci_env_vars = {\n      :ORACLE_HOME => oci.opt_prefix,\n      :OCI_LIB => oci.opt_lib,\n      :TNS_ADMIN => oci.opt_prefix/\"network/admin\",\n    }\n    oci_env_vars[:NLS_LANG] = \"AMERICAN_AMERICA.UTF8\" unless opts.include?(\"with-basic\")\n    oci_env_vars\n  end\n\n  def install\n    ENV.deparallelize\n\n    qt_plugins = lib/\"qt-4/plugins\"\n    (qt_plugins/\"sqldrivers\").mkpath\n    inreplace \"src/plugins/sqldrivers/qsqldriverbase.pri\", \"$$[QT_INSTALL_PLUGINS]\", qt_plugins.to_s\n\n    sql_drivers = \"#{buildpath}/src/sql/drivers\"\n    inreplace \"#{sql_drivers}/oci/qsql_oci.h\", \"<QtSql/private/qsqlcachedresult_p.h>\", '\"qsqlcachedresult_p.h\"'\n\n    cd \"src/plugins/sqldrivers/oci\" do\n      args = %w[-spec]\n      # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag\n      if ENV.compiler == :clang && MacOS.version >= :mavericks\n        args << \"unsupported/macx-clang-libc++\"\n      else\n        args << \"macx-g++\"\n      end\n      args << %Q(INCLUDEPATH+=\"#{sql_drivers}/kernel\")\n      oci = Formula[\"oracle-client-sdk\"]\n      args << %Q(INCLUDEPATH+=\"#{oci.include}/oci\")\n      args << %Q(LIBS+=\"-L#{oci.opt_lib}\")\n      args << \"oci.pro\"\n\n      # args << %Q(QMAKE_LFLAGS+=\"-Wl,-flat_namespace,-U,_environ\")\n      system \"#{Formula[\"qt-4\"].opt_bin}/qmake\", *args\n      system \"make\", \"release\"\n      system \"make\", \"release-install\"\n    end\n  end\n\n  def caveats\n    s = <<~EOS\n    Oracle client SDK environ:\n    EOS\n    oracle_env_vars.each { |k, v| s += \"  #{k}=#{v}\\n\" }\n    s += \"\\n\"\n  end\n\n  test do\n    (testpath/\"hello.pro\").write <<~EOS\n      QT        += core sql\n      QT        -= gui\n      TARGET     = hello\n      CONFIG    += console\n      CONFIG    -= app_bundle\n      TEMPLATE   = app\n      HEADERS    = client.h\n      SOURCES   += client.cpp main.cpp\n    EOS\n\n    (testpath/\"client.h\").write <<~EOS\n    #ifndef CLIENT_H\n    #define CLIENT_H\n    #include <QObject>\n    #include <QSqlDatabase>\n    #include <QString>\n\n    class Client : public QObject\n    {\n      Q_OBJECT\n\n    public:\n      Client(QObject *parent = 0);\n\n    public slots:\n      void checkSqlDriver();\n    };\n    #endif // CLIENT_H\n    EOS\n\n    (testpath/\"client.cpp\").write <<~EOS\n    #include \"client.h\"\n    #include <QCoreApplication>\n    #include <QDebug>\n    #include <QSqlDatabase>\n    #include <QStringList>\n\n    Client::Client(QObject *parent)\n      : QObject(parent)\n    {\n    }\n\n    void Client::checkSqlDriver()\n    {\n      QCoreApplication::addLibraryPath(\"#{HOMEBREW_PREFIX}/lib/qt-4/plugins\");\n      QCoreApplication::addLibraryPath(\"#{lib}/qt-4/plugins\");\n      qDebug() << \"QSqlDatabase::drivers(): \" << QSqlDatabase::drivers().join(\" \");\n      QCoreApplication::exit(!QSqlDatabase::isDriverAvailable(\"QOCI\"));\n    }\n    EOS\n\n    (testpath/\"main.cpp\").write <<~EOS\n      #include <QCoreApplication>\n      #include <QDebug>\n      #include <QTimer>\n      #include \"client.h\"\n\n      int main(int argc, char *argv[])\n      {\n        QCoreApplication app(argc, argv);\n        Client c(app.instance());\n        qDebug() << \"Running application\";\n        QTimer::singleShot(1000, &c, SLOT(checkSqlDriver()));\n        return app.exec();\n      }\n    EOS\n\n    cd testpath do\n      system Formula[\"qt-4\"].bin/\"qmake\", \"hello.pro\"\n      system \"make\"\n      assert_predicate testpath/\"client.o\", :exist?\n      assert_predicate testpath/\"moc_client.o\", :exist?\n      assert_predicate testpath/\"main.o\", :exist?\n      assert_predicate testpath/\"hello\", :exist?\n      system \"./hello\"\n    end\n  end\nend\n"
  },
  {
    "path": "boneyard/qtkeychain-qt4.rb",
    "content": "class QtkeychainQt4 < Formula\n  desc \"Platform-independent Qt API for storing passwords securely\"\n  homepage \"https://github.com/frankosterfeld/qtkeychain\"\n  url \"https://github.com/frankosterfeld/qtkeychain/archive/d077333d7c4bb2846b9de9f3b8631a0b58f70a7e.tar.gz\"\n  version \"0.7.90\"\n  sha256 \"fe766d6189ffd89f5c8303833b43b832b13e14481970466ac09821e28d103f08\"\n\n  head \"https://github.com/frankosterfeld/qtkeychain.git\", :using => :git\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    sha256 \"1baa17282d8777f0b6bd66cd5486a7c397d686cff51116cae7671401f2a4ece6\" => :sierra\n    sha256 \"1baa17282d8777f0b6bd66cd5486a7c397d686cff51116cae7671401f2a4ece6\" => :high_sierra\n  end\n\n  keg_only \"newer Qt5-only version in homebrew-core\"\n\n  option \"with-static\", \"Build static in addition to shared library\"\n  option \"with-translations\", \"Generate Qt translation (.ts) files\"\n\n  depends_on \"cmake\" => :build\n  depends_on \"qt-4\"\n\n  def install\n    args = std_cmake_args\n    args << \"-DQTKEYCHAIN_STATIC=OFF\"\n    args << \"-DBUILD_WITH_QT4=ON\"\n    args << \"-DBUILD_TRANSLATIONS=#{build.with?(\"translations\") ? \"ON\" : \"OFF\"}\"\n\n    mkdir \"build\" do\n      system \"cmake\", \"..\", *args\n      system \"make\", \"install\"\n      (libexec/\"bin\").install \"testclient\"\n      # Deprecated: Using MachO::Tools\n#      system \"install_name_tool\", \"-change\", \"@rpath/libqtkeychain.1.dylib\",\n#             \"#{opt_lib}/libqtkeychain.1.dylib\",\n#             \"#{libexec}/bin/testclient\"\n      MachO::Tools.change_dylib_name(\"@rpath/libqtkeychain.1.dylib\",\n             \"#{opt_lib}/libqtkeychain.1.dylib\",\n             \"#{libexec}/bin/testclient\")\n\n      if build.with? \"static\"\n        args << \"-DQTKEYCHAIN_STATIC=ON\"\n        system \"cmake\", \"..\", *args\n        system \"make\"\n        mv \"libqtkeychain.a\", lib/\"libqtkeychain_static.a\"\n      end\n    end\n  end\n\n  def caveats\n    if build.with? \"static\"\n      <<~EOS\n        Static library is available at:\n          #{opt_lib}/libqtkeychain_static.a\n      EOS\n    end\n  end\n\n  test do\n    assert_match \"Password deleted successfully\",\n                 shell_output(libexec/\"bin/testclient delete something\")\n  end\nend\n"
  },
  {
    "path": "boneyard/quazip.rb",
    "content": "require \"formula\"\n\nclass Quazip < Formula\n  homepage \"http://quazip.sourceforge.net/\"\n  url \"https://downloads.sourceforge.net/project/quazip/quazip/0.6.2/quazip-0.6.2.tar.gz\"\n  sha1 \"2fdcd063df645f94f047374d7d540b102fc683dc\"\n\n  depends_on \"qt\"\n\n  def install\n    # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag\n    if ENV.compiler == :clang and MacOS.version >= :mavericks\n      spec = \"unsupported/macx-clang-libc++\"\n    else\n      spec = \"macx-g++\"\n    end\n\n    args = %W[\n      -config release -spec #{spec}\n      PREFIX=#{prefix}\n      LIBS+=-L/usr/lib LIBS+=-lz\n      INCLUDEPATH+=/usr/include\n    ]\n\n    system \"qmake\", \"quazip.pro\", *args\n    system \"make\", \"install\"\n\n    cd \"qztest\" do\n      args = %W[-config release -spec #{spec}]\n      system \"qmake\", *args\n      system \"make\"\n      libexec.install \"qztest\"\n    end\n  end\n\n  test do\n    ENV[\"DYLD_LIBRARY_PATH\"] = \"#{lib}\"\n    system \"#{libexec}/qztest\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qutepart.rb",
    "content": "require \"formula\"\n\nclass Qutepart < Formula\n  homepage \"https://github.com/hlamer/qutepart\"\n  url \"https://github.com/hlamer/qutepart/archive/v1.1.1.tar.gz\"\n  sha1 \"0be6bd7dd4d0d770046b038d0e630bd6c42016ce\"\n\n  depends_on :python\n  depends_on \"pyqt\"\n  depends_on \"pcre\"\n\n  def install\n    ENV.deparallelize\n    args = %W[\n        --prefix=#{prefix}\n        --lib-dir=#{HOMEBREW_PREFIX/\"lib\"}\n        --include-dir=#{HOMEBREW_PREFIX/\"include\"}\n    ]\n    system \"python\", \"setup.py\", \"install\", *args\n    prefix.install \"editor.py\"\n    rm \"todo.txt\"\n  end\n\n  test do\n    assert_equal \"(#{version.to_s.gsub(\".\", \", \")})\",\n                 %x(python -c 'import qutepart;print qutepart.VERSION').strip\n  end\nend\n"
  },
  {
    "path": "boneyard/qwt-qt4.rb",
    "content": "class QwtQt4 < Formula\n  desc \"Qt Widgets for Technical Applications\"\n  homepage \"https://qwt.sourceforge.io/\"\n  url \"https://downloads.sourceforge.net/project/qwt/qwt/6.1.3/qwt-6.1.3.tar.bz2\"\n  sha256 \"f3ecd34e72a9a2b08422fb6c8e909ca76f4ce5fa77acad7a2883b701f4309733\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    sha256 \"f1103a619ff0d1fc5df8708238185b2028ae645bc888f7be6ad017001a8a60f4\" => :sierra\n    sha256 \"f1103a619ff0d1fc5df8708238185b2028ae645bc888f7be6ad017001a8a60f4\" => :high_sierra\n  end\n\n  keg_only \"newer Qt5-only version in homebrew-core\"\n\n  option \"with-qwtmathml\", \"Build the qwtmathml library\"\n  option \"without-plugin\", \"Skip building the Qt Designer plugin\"\n\n  depends_on \"qt-4\"\n\n  # Update designer plugin linking back to qwt framework/lib after install\n  # See: https://sourceforge.net/p/qwt/patches/45/\n  patch :DATA\n\n  def install\n    inreplace \"qwtconfig.pri\" do |s|\n      s.gsub! /^\\s*QWT_INSTALL_PREFIX\\s*=(.*)$/, \"QWT_INSTALL_PREFIX=#{prefix}\"\n      s.sub! /\\+(=\\s*QwtDesigner)/, \"-\\\\1\" if build.without? \"plugin\"\n\n      # Install Qt plugin in `lib/qt-4/plugins/designer`, not `plugins/designer`.\n      s.sub! %r{(= \\$\\$\\{QWT_INSTALL_PREFIX\\})/(plugins/designer)$},\n             \"\\\\1/lib/qt-4/\\\\2\"\n    end\n\n    args = [\"-config\", \"release\", \"-spec\"]\n    # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag\n    if ENV.compiler == :clang && MacOS.version >= :mavericks\n      args << \"unsupported/macx-clang-libc++\"\n    else\n      args << \"macx-g++\"\n    end\n\n    if build.with? \"qwtmathml\"\n      args << \"QWT_CONFIG+=QwtMathML\"\n      prefix.install \"textengines/mathml/qtmmlwidget-license\"\n    end\n\n    system \"qmake\", *args\n    system \"make\"\n    system \"make\", \"install\"\n  end\n\n  def caveats\n    s = \"\"\n\n    if build.with? \"qwtmathml\"\n      s += <<~EOS\n        The qwtmathml library contains code of the MML Widget from the Qt solutions package.\n        Beside the Qwt license you also have to take care of its license:\n          #{opt_prefix}/qtmmlwidget-license\n      EOS\n    end\n\n    if build.with? \"plugin\"\n      s += <<~EOS\n        Qt Designer plugin is not installed, but available at:\n          #{opt_lib}/qt-4/plugins/designer/libqwt_designer_plugin.dylib\n      EOS\n    end\n\n    s\n  end\n\n  test do\n    (testpath/\"test.cpp\").write <<~EOS\n      #include <qwt_plot_curve.h>\n      int main() {\n        QwtPlotCurve *curve1 = new QwtPlotCurve(\"Curve 1\");\n        return (curve1 == NULL);\n      }\n    EOS\n    system ENV.cxx, \"test.cpp\", \"-o\", \"out\",\n      \"-framework\", \"qwt\", \"-framework\", \"QtCore\",\n      \"-F#{Formula[\"qt-4\"].opt_lib}\", \"-F#{lib}\",\n      \"-I#{lib}/qwt.framework/Headers\",\n      \"-I#{Formula[\"qt-4\"].opt_lib}/QtCore.framework/Headers\",\n      \"-I#{Formula[\"qt-4\"].opt_lib}/QtGui.framework/Headers\"\n    system \"./out\"\n  end\nend\n\n__END__\ndiff --git a/designer/designer.pro b/designer/designer.pro\nindex c269e9d..c2e07ae 100644\n--- a/designer/designer.pro\n+++ b/designer/designer.pro\n@@ -126,6 +126,16 @@ contains(QWT_CONFIG, QwtDesigner) {\n\n     target.path = $${QWT_INSTALL_PLUGINS}\n     INSTALLS += target\n+\n+    macx {\n+        contains(QWT_CONFIG, QwtFramework) {\n+            QWT_LIB = qwt.framework/Versions/$${QWT_VER_MAJ}/qwt\n+        }\n+        else {\n+            QWT_LIB = libqwt.$${QWT_VER_MAJ}.dylib\n+        }\n+        QMAKE_POST_LINK = install_name_tool -change $${QWT_LIB} $${QWT_INSTALL_LIBS}/$${QWT_LIB} $(DESTDIR)$(TARGET)\n+    }\n }\n else {\n     TEMPLATE        = subdirs # do nothing\n"
  },
  {
    "path": "boneyard/qwt-qt4@5.2.rb",
    "content": "class QwtQt4AT52 < Formula\n  desc \"Qt Widgets for Technical Applications\"\n  homepage \"https://qwt.sourceforge.io/\"\n  url \"https://downloads.sourceforge.net/project/qwt/qwt/5.2.3/qwt-5.2.3.tar.bz2\"\n  sha256 \"37feaf306753230b0d8538b4ff9b255c6fddaa3d6609ec5a5cc39a5a4d020ab7\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    sha256 \"735c1d81cdf7b4192967e3923e15c07fbb1c06200c63cadd232b573fa022a2f2\" => :sierra\n  end\n\n  keg_only \"to avoid conflicts with newer versions\"\n\n  depends_on \"qt-4\"\n\n  def install\n    # redefine install prefix to Cellar\n    inreplace \"qwtconfig.pri\", /^(\\s*)INSTALLBASE\\s*=(.*)$/, \"\\\\1INSTALLBASE=#{prefix}\"\n\n    args = [\"-config\", \"release\", \"-spec\"]\n    # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag\n    if ENV.compiler == :clang && MacOS.version >= :mavericks\n      args << \"unsupported/macx-clang-libc++\"\n    else\n      args << \"macx-g++\"\n    end\n\n    system \"qmake\", *args\n    system \"make\"\n    system \"make\", \"install\"\n  end\n\n  test do\n    (testpath/\"test.cpp\").write <<~EOS\n      #include <qwt_plot_curve.h>\n      int main() {\n        QwtPlotCurve *curve1 = new QwtPlotCurve(\"Curve 1\");\n        return (curve1 == NULL);\n      }\n    EOS\n    system ENV.cxx, \"test.cpp\", \"-o\", \"out\",\n      \"-framework\", \"QtCore\", \"-F#{Formula[\"qt-4\"].opt_lib}\",\n      \"-L#{lib}\", \"-lqwt\",\n      \"-I#{include}\",\n      \"-I#{Formula[\"qt-4\"].opt_lib}/QtCore.framework/Headers\",\n      \"-I#{Formula[\"qt-4\"].opt_lib}/QtGui.framework/Headers\"\n    system \"./out\"\n  end\nend\n"
  },
  {
    "path": "boneyard/qwt60.rb",
    "content": "require 'formula'\n\nclass Qwt60 < Formula\n  homepage 'http://qwt.sourceforge.net/'\n  url 'http://downloads.sourceforge.net/project/qwt/qwt/6.0.2/qwt-6.0.2.tar.bz2'\n  sha1 'cbdd00b29521987c9e7bc6aa51092f0474b9428d'\n\n  keg_only 'Conflicts with Qwt in main repository.'\n\n  depends_on 'qt'\n\n  def install\n    inreplace 'qwtconfig.pri' do |s|\n      # change_make_var won't work because there are leading spaces\n      s.gsub! /^\\s*QWT_INSTALL_PREFIX\\s*=(.*)$/, \"QWT_INSTALL_PREFIX=#{prefix}\"\n      # ensure frameworks aren't built, or qwtmathml linking fails to find -lqwt\n      s << \"\\n\" << 'QWT_CONFIG -= QwtFramework'\n    end\n\n    # see https://github.com/mxcl/homebrew/commit/e4df2f545a037c250f723981d65d59b08a37af44\n    args = %w[-config release -spec]\n    # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag\n    if ENV.compiler == :clang and MacOS.version >= :mavericks\n      args << 'unsupported/macx-clang-libc++'\n    else\n      args << 'macx-g++'\n    end\n    system 'qmake', *args\n    system 'make'\n    system 'make install'\n  end\n\n  def caveats; <<~EOS\n      The qwtmathml library contains code of the MML Widget from the Qt solutions package.\n      Beside the Qwt license you also have to take care of its license.\n    EOS\n  end\nend\n"
  },
  {
    "path": "boneyard/qwtpolar-qt4.rb",
    "content": "class QwtpolarQt4 < Formula\n  desc \"Library for displaying values on a polar coordinate system\"\n  homepage \"https://qwtpolar.sourceforge.io/\"\n  url \"https://downloads.sf.net/project/qwtpolar/qwtpolar/1.1.0/qwtpolar-1.1.0.tar.bz2\"\n  sha256 \"e45a1019b481f52a63483c536c5ef3225f1cced04abf45d7d0ff8e06d30e2355\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    sha256 \"1e98ef9094e4e88737ebee0b1ab1c1a2c2a569f84b432c5bf9242ef9a0866b20\" => :sierra\n    sha256 \"1e98ef9094e4e88737ebee0b1ab1c1a2c2a569f84b432c5bf9242ef9a0866b20\" => :high_sierra\n  end\n\n  keg_only \"newer Qt5-only version in homebrew-core\"\n\n  option \"with-examples\", \"Install source code for example apps\"\n  option \"without-plugin\", \"Skip building the Qt Designer plugin\"\n\n  depends_on \"qt-4\"\n  depends_on \"qwt-qt4\"\n\n  # Update designer plugin linking back to qwtpolar framework/lib after install\n  # See: https://sourceforge.net/p/qwtpolar/patches/2/\n  patch :DATA\n\n  def install\n    cd \"doc\" do\n      doc.install \"html\"\n      man3.install Dir[\"man/man3/{q,Q}wt*\"]\n    end\n    # Remove leftover doxygen files, so they don't get installed\n    rm_r \"doc\"\n\n    libexec.install Dir[\"examples/*\"] if build.with? \"examples\"\n\n    inreplace \"qwtpolarconfig.pri\" do |s|\n      s.gsub! /^(\\s*)QWT_POLAR_INSTALL_PREFIX\\s*=\\s*(.*)$/,\n              \"\\\\1QWT_POLAR_INSTALL_PREFIX=#{prefix}\"\n      s.sub! /\\+(=\\s*QwtPolarDesigner)/, \"-\\\\1\" if build.without? \"plugin\"\n      # Don't build examples now, since linking flawed until qwtpolar installed\n      s.sub! /\\+(=\\s*QwtPolarExamples)/, \"-\\\\1\"\n\n      # Install Qt plugin in `lib/qt-4/plugins/designer`, not `plugins/designer`.\n      s.sub! %r{(= \\$\\$\\{QWT_POLAR_INSTALL_PREFIX\\})/(plugins/designer)$},\n             \"\\\\1/lib/qt-4/\\\\2\"\n    end\n\n    args = %w[-config release -spec]\n    # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag\n    if ENV.compiler == :clang && MacOS.version >= :mavericks\n      args << \"unsupported/macx-clang-libc++\"\n    else\n      args << \"macx-g++\"\n    end\n\n    ENV[\"QMAKEFEATURES\"] = \"#{Formula[\"qwt-qt4\"].opt_prefix}/features\"\n    system \"qmake\", *args\n    system \"make\"\n    system \"make\", \"install\"\n  end\n\n  def caveats\n    s = \"\"\n    if build.with? \"plugin\"\n      s += <<~EOS\n        Qt Designer plugin is not installed, but available at:\n          #{opt_lib}/qt-4/plugins/designer/libqwt_polar_designer_plugin.dylib\n      EOS\n    end\n    s\n  end\n\n  test do\n    (testpath/\"test.cpp\").write <<~EOS\n      #include <qwt_polar_renderer.h>\n      int main() {\n        QwtPolarRenderer *curve1 = new QwtPolarRenderer();\n        return (curve1 == NULL);\n      }\n    EOS\n    system ENV.cxx, \"test.cpp\", \"-o\", \"out\",\n           \"-framework\", \"qwtpolar\", \"-framework\", \"qwt\", \"-framework\", \"QtCore\",\n           \"-F#{Formula[\"qt-4\"].opt_lib}\", \"-F#{Formula[\"qwt-qt4\"].opt_lib}\", \"-F#{lib}\",\n           \"-I#{lib}/qwtpolar.framework/Headers\",\n           \"-I#{Formula[\"qwt-qt4\"].opt_lib}/qwt.framework/Headers\",\n           \"-I#{Formula[\"qt-4\"].opt_lib}/QtCore.framework/Headers\",\n           \"-I#{Formula[\"qt-4\"].opt_lib}/QtGui.framework/Headers\"\n    system \"./out\"\n  end\nend\n\n__END__\ndiff --git a/designer/designer.pro b/designer/designer.pro\nindex 24770fd..3ff0761 100644\n--- a/designer/designer.pro\n+++ b/designer/designer.pro\n@@ -75,6 +75,16 @@ contains(QWT_POLAR_CONFIG, QwtPolarDesigner) {\n\n     target.path = $${QWT_POLAR_INSTALL_PLUGINS}\n     INSTALLS += target\n+\n+    macx {\n+        contains(QWT_POLAR_CONFIG, QwtPolarFramework) {\n+            QWTP_LIB = qwtpolar.framework/Versions/$${QWT_POLAR_VER_MAJ}/qwtpolar\n+        }\n+        else {\n+            QWTP_LIB = libqwtpolar.$${QWT_POLAR_VER_MAJ}.dylib\n+        }\n+        QMAKE_POST_LINK = install_name_tool -change $${QWTP_LIB} $${QWT_POLAR_INSTALL_LIBS}/$${QWTP_LIB} $(DESTDIR)$(TARGET)\n+    }\n }\n else {\n     TEMPLATE        = subdirs # do nothing\n"
  },
  {
    "path": "boneyard/qwtpolar.rb",
    "content": "require \"formula\"\n\nclass Qwtpolar < Formula\n  homepage \"http://qwtpolar.sourceforge.net/\"\n  url \"http://downloads.sf.net/project/qwtpolar/qwtpolar/1.1.0/qwtpolar-1.1.0.tar.bz2\"\n  sha1 \"94d5f897e75e37f32c910e3bdf2a1ffbaaf76621\"\n\n  option \"with-examples\", \"Install source code for example apps\"\n\n  depends_on \"qt\"\n  depends_on \"qwt\"\n\n  def install\n    cd \"doc\" do\n      doc.install \"html\"\n      man3.install Dir[\"man/man3/{q,Q}wt*\"]\n    end\n    rm_r \"doc\"\n\n    libexec.install Dir[\"examples/*\"] if build.with? \"examples\"\n\n    inreplace \"qwtpolarconfig.pri\" do |s|\n      # change_make_var won't work because there are leading spaces\n      s.gsub! /^(\\s*)QWT_POLAR_INSTALL_PREFIX\\s*=\\s*(.*)$/,\n              \"\\\\1QWT_POLAR_INSTALL_PREFIX=#{prefix}\"\n      # don't build examples now, since linking flawed until qwtpolar installed\n      s.sub! /\\+(=\\s*QwtPolarExamples)/, \"-\\\\1\"\n    end\n\n    # update designer plugin linking back to qwtpolar framework/lib\n    inreplace \"designer/designer.pro\" do |s|\n      s.sub! /(INSTALLS \\+= target)/, \"\\\\1\\n\" + <<~EOS\n        macx {\n            contains(QWT_POLAR_CONFIG, QwtPolarFramework) {\n                QWTP_LIB = qwtpolar.framework/Versions/$${QWT_POLAR_VER_MAJ}/qwtpolar\n            }\n            else {\n                QWTP_LIB = libqwtpolar.$${QWT_POLAR_VER_MAJ}.dylib\n            }\n            QMAKE_POST_LINK = install_name_tool -change $${QWTP_LIB} #{opt_prefix}/lib/$${QWTP_LIB} ${DESTDIR}/$(TARGET)\n        }\n      EOS\n    end\n\n    args = %W[-config release -spec]\n    # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag\n    if ENV.compiler == :clang and MacOS.version >= :mavericks\n      args << \"unsupported/macx-clang-libc++\"\n    else\n      args << \"macx-g++\"\n    end\n\n    ENV[\"QMAKEFEATURES\"] = \"#{Formula[\"qwt\"].opt_prefix}/features\"\n    system \"qmake\", *args\n    system \"make\"\n    system \"make\", \"install\"\n\n    # symlink Qt Designer plugin (note: not removed on qwtpolar formula uninstall)\n    cd Formula[\"qt\"].opt_prefix/\"plugins/designer\" do\n      ln_sf prefix/\"plugins/designer/libqwt_polar_designer_plugin.dylib\", \".\"\n    end\n  end\n\nend\n"
  },
  {
    "path": "boneyard/sip-qt4.rb",
    "content": "class SipQt4 < Formula\n  desc \"Tool to create Python bindings for C and C++ libraries\"\n  homepage \"https://www.riverbankcomputing.com/software/sip/intro\"\n  url \"https://downloads.sourceforge.net/project/pyqt/sip/sip-4.18.1/sip-4.18.1.tar.gz\"\n  sha256 \"9bce7a2dbf7f105bf68ad1bab58eebc0ce33087ec40396da756463f086ffa290\"\n\n  bottle do\n    root_url \"https://osgeo4mac.s3.amazonaws.com/bottles\"\n    cellar :any_skip_relocation\n    sha256 \"4c95142a42599fb0b6668e50e49913f19d0462ee05590aa9844cbc41cba6e350\" => :high_sierra\n    sha256 \"4c95142a42599fb0b6668e50e49913f19d0462ee05590aa9844cbc41cba6e350\" => :sierra\n  end\n\n  depends_on \"python@2\" => :recommended\n\n  def install\n    if build.without? \"python@2\"\n      # this is a flaw in Homebrew, where `depends on :python` alone does not work\n      odie \"Must be built with Python2\"\n    end\n\n    Language::Python.each_python(build) do |python, version|\n      # Note the binary `sip` is the same for python 2.x and 3.x\n      system python, \"configure.py\",\n                     \"--deployment-target=#{MacOS.version}\",\n                     \"--destdir=#{lib}/qt-4/python#{version}/site-packages\",\n                     \"--bindir=#{libexec}/bin\",\n                     \"--incdir=#{libexec}/include\",\n                     \"--sipdir=#{HOMEBREW_PREFIX}/share/#{name}\"\n      system \"make\"\n      system \"make\", \"install\"\n      system \"make\", \"clean\"\n    end\n  end\n\n  def post_install\n    (HOMEBREW_PREFIX/\"share/#{name}\").mkpath\n  end\n\n  def caveats\n    s = \"sip executable installed in #{opt_libexec}/bin\\n\\n\"\n    s += \"sip headers installed in #{opt_libexec}/include\\n\\n\"\n    s += \"sip-dir for Python installed at #{HOMEBREW_PREFIX}/share/#{name}\\n\\n\"\n    s += \"Python modules installed in:\\n\"\n    Language::Python.each_python(build) do |_python, version|\n      s += \"  #{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages/PyQt4\"\n    end\n    s\n  end\n\n  test do\n    (testpath/\"test.h\").write <<~EOS\n      #pragma once\n      class Test {\n      public:\n        Test();\n        void test();\n      };\n    EOS\n    (testpath/\"test.cpp\").write <<~EOS\n      #include \"test.h\"\n      #include <iostream>\n      Test::Test() {}\n      void Test::test()\n      {\n        std::cout << \"Hello World!\" << std::endl;\n      }\n    EOS\n    (testpath/\"test.sip\").write <<~EOS\n      %Module test\n      class Test {\n      %TypeHeaderCode\n      #include \"test.h\"\n      %End\n      public:\n        Test();\n        void test();\n      };\n    EOS\n    (testpath/\"generate.py\").write <<~EOS\n      from sipconfig import SIPModuleMakefile, Configuration\n      m = SIPModuleMakefile(Configuration(), \"test.build\")\n      m.extra_libs = [\"test\"]\n      m.extra_lib_dirs = [\".\"]\n      m.generate()\n    EOS\n    (testpath/\"run.py\").write <<~EOS\n      from test import Test\n      t = Test()\n      t.test()\n    EOS\n    system ENV.cxx, \"-shared\", \"-Wl,-install_name,#{testpath}/libtest.dylib\",\n                    \"-o\", \"libtest.dylib\", \"test.cpp\"\n    system libexec/\"bin/sip\", \"-b\", \"test.build\", \"-c\", \".\", \"test.sip\"\n    Language::Python.each_python(build) do |python, version|\n      ENV[\"PYTHONPATH\"] = lib/\"qt-4/python#{version}/site-packages\"\n      system python, \"generate.py\"\n      system \"make\", \"-j1\", \"clean\", \"all\"\n      system python, \"run.py\"\n    end\n  end\nend\n"
  },
  {
    "path": "boneyard/spatialite-gui-17.rb",
    "content": "require 'formula'\n\nclass SpatialiteGui17 < Formula\n  homepage 'https://www.gaia-gis.it/fossil/spatialite_gui/index'\n  url 'http://www.gaia-gis.it/gaia-sins/spatialite-gui-sources/spatialite_gui-1.7.1.tar.gz'\n  sha1 '3b9d88e84ffa5a4f913cf74b098532c2cd15398f'\n\n  conflicts_with 'spatialite-gui', :because => 'spatialite-gui in main tap'\n\n  depends_on 'pkg-config' => :build\n  depends_on 'libxml2'\n  depends_on 'libspatialite'\n  depends_on 'libgaiagraphics'\n  depends_on 'wxmac-29'\n  depends_on 'geos'\n  depends_on 'proj'\n  depends_on 'freexl'\n  depends_on 'sqlite'\n\n  patch :p1, :DATA\n\n  def install\n    system \"./configure\", \"--prefix=#{prefix}\"\n    system \"make install\"\n  end\nend\n\n__END__\n\nFor some strange reason, wxWidgets does not take the required steps to register\nprograms as GUI apps like other toolkits do. This necessitates the creation of\nan app bundle on OS X.\n\nThis clever hack sidesteps the headache of packing simple programs into app\nbundles:\n\n  http://www.miscdebris.net/blog/2010/03/30/\n    solution-for-my-mac-os-x-gui-program-doesnt-get-focus-if-its-outside-an-application-bundle\n---\n Main.cpp |   21 +++++++++++++++++++++\n 1 files changed, 21 insertions(+), 0 deletions(-)\n\ndiff --git a/Main.cpp b/Main.cpp\nindex a857e8a..9c90afb 100644\n--- a/Main.cpp\n+++ b/Main.cpp\n@@ -71,6 +71,12 @@\n #define unlink\t_unlink\n #endif\n\n+#ifdef __WXMAC__\n+// Allow the program to run and recieve focus without creating an app bundle.\n+#include <Carbon/Carbon.h>\n+extern \"C\" { void CPSEnableForegroundOperation(ProcessSerialNumber* psn); }\n+#endif\n+\n IMPLEMENT_APP(MyApp)\n      bool MyApp::OnInit()\n {\n@@ -86,6 +92,21 @@ IMPLEMENT_APP(MyApp)\n   frame->Show(true);\n   SetTopWindow(frame);\n   frame->LoadConfig(path);\n+\n+#ifdef __WXMAC__\n+  // Acquire the necessary resources to run as a GUI app without being inside\n+  // an app bundle.\n+  //\n+  // Credit for this hack goes to:\n+  //\n+  //   http://www.miscdebris.net/blog/2010/03/30/solution-for-my-mac-os-x-gui-program-doesnt-get-focus-if-its-outside-an-application-bundle\n+  ProcessSerialNumber psn;\n+\n+  GetCurrentProcess( &psn );\n+  CPSEnableForegroundOperation( &psn );\n+  SetFrontProcess( &psn );\n+#endif\n+\n   return true;\n }\n\n--\n1.7.9\n"
  },
  {
    "path": "boneyard/v8318.rb",
    "content": "require 'formula'\n\n# Use the official github mirror, it is easier to find tags there\n# .even versions are stable, .odd releases are devel. Kind of:\n# https://code.google.com/p/v8/issues/detail?id=2545\n# http://omahaproxy.appspot.com/\n\nclass V8318 < Formula\n  homepage 'http://code.google.com/p/v8/'\n  url 'https://github.com/v8/v8/archive/3.18.5.tar.gz'\n  sha1 'd11c925898c5a0480aa947b1ed03b8f039d7e5d2'\n\n  keg_only 'Conflicts with v8 in main repository.'\n\n  # gyp currently depends on a full xcode install\n  # https://code.google.com/p/gyp/issues/detail?id=292\n  depends_on \"xcode\"\n\n  def install\n    system 'make dependencies'\n    system 'make', 'native',\n                   \"-j#{ENV.make_jobs}\",\n                   \"library=shared\",\n                   \"snapshot=on\",\n                   \"console=readline\"\n\n    prefix.install 'include'\n    cd 'out/native' do\n      lib.install Dir['lib*']\n      bin.install 'd8', 'lineprocessor', 'preparser', 'process', 'shell' => 'v8'\n      bin.install Dir['mksnapshot.*']\n    end\n  end\nend\n"
  },
  {
    "path": "boneyard/wxmac-28.rb",
    "content": "require 'formula'\n\nclass Wxpython28 < Formula\n  # For 2.8, we use this separate formula for wxPython. For 2.9 we use the combined one.\n  url 'https://downloads.sourceforge.net/wxpython/wxPython-src-2.8.12.1.tar.bz2'\n  sha1 '05688dc03d61631750f5904273122bb40a2115f5'\n  head 'http://svn.wxwidgets.org/svn/wx/wxPython/trunk/', :using => StrictSubversionDownloadStrategy\n  homepage 'http://www.wxpython.org'\nend\n\nclass Wxmac28 < Formula\n  url 'https://downloads.sourceforge.net/project/wxwindows/2.8.12/wxMac-2.8.12.tar.bz2'\n  sha1 'cb7b7e76bb88ec4a23346cf0d99e361101b17737'\n\n  homepage 'http://www.wxwidgets.org'\n\n  option 'python', 'Build Python bindings'\n\n  def test_python_arch\n    # wxPython 2.8 does not yet support 64bit.\n    begin\n      system \"arch -i386 python --version\"\n    rescue\n      onoe \"No python on path or default python does not support 32-bit.\"\n      puts <<~EOS\n        Your default python (if any) does not support 32-bit execution, which is\n        required for the wxmac python bindings. You can install the Homebrew\n        python with 32-bit support by running:\n\n        brew install python --universal --framework\n\n      EOS\n      exit 99\n    end\n  end\n\n  def install_wx_python\n    opts = %W[\n      # Reference our wx-config\n      WX_CONFIG=#{bin}/wx-config\n      # At this time Wxmac is installed Unicode only\n      UNICODE=1\n      # And thus we have no need for multiversion support\n      INSTALL_MULTIVERSION=0\n      # OpenGL and stuff\n      BUILD_GLCANVAS=1\n      BUILD_GIZMOS=1\n      BUILD_STC=\n    ]\n    cd \"wxPython\" do\n      # for wx 2.8 force 32-bit install with the 10.6 sdk:\n      ENV.append_to_cflags '-arch i386'\n\n      system \"arch\",   \"-i386\",\n                       \"python\",\n                       \"setup.py\",\n                       \"build_ext\",\n                       *opts\n\n      system \"arch\",   \"-i386\",\n                       \"python\",\n                       \"setup.py\",\n                       \"install\",\n                       \"--prefix=#{prefix}\",\n                       *opts\n    end\n  end\n\n  def install\n    test_python_arch if build.include? \"python\"\n\n    args = %W[\n      --disable-debug\n      --prefix=#{prefix}\n      --enable-unicode\n      --enable-std_string\n      --enable-display\n      --with-opengl\n    ]\n\n    # Force i386 for wx 2.8\n    ENV.m32\n\n    # build will fail on Lion unless we use the 10.6 sdk (note wx 2.9 does fine)\n    ENV.append_to_cflags '-isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6' if MacOS.version == :lion\n\n    system \"./configure\", *args\n    system \"make install\"\n\n    # erlang needs contrib/stc during configure phase.\n    %w{ gizmos stc ogl }.each do |c|\n     system \"make\", \"-C\", \"contrib/src/#{c}\", \"install\"\n    end\n\n    if build.include? \"python\"\n      ENV['WXWIN'] = Dir.getwd\n      # We need to download wxPython separately (see formula at top)\n      Wxpython28.new.brew { install_wx_python }\n    end\n  end\n\n  def caveats\n    s = ''\n    s += <<~EOS\n      wxWidgets 2.8.x builds 32-bit only, so you probably won't be able to use it\n      for other Homebrew-installed software. You can try to build with --devel to\n      get the wxWidgets 2.9.x (unstable) for 64-bit and cocoa support.\n\n    EOS\n    if build.include? 'python'\n      s += <<~EOS\n        You will also need run python in 32-bit mode for wx. If you are on a 64-bit\n        platform, you will need to run Python in 32-bit mode:\n\n        arch -i386 python [args]\n\n        Homebrew Python does not support this by default. So, homebrew Python must\n        be built with --universal --framework.\n        Alternative, you can try brew wxmac --python --devel for wx 2.9 in 64-bit.\n\n      EOS\n    end\n\n    if build.include? 'python'\n      s += <<~EOS\n        Python bindings require that Python be built as a Framework; this is the\n        default for Mac OS provided Python but not (yet) for Homebrew Python.\n        Build python with `--framework`.\n\n      EOS\n    end\n\n    return s\n  end\nend\n"
  },
  {
    "path": "boneyard/wxmac-29.rb",
    "content": "require 'formula'\n\nclass FrameworkPython < Requirement\n  fatal true\n\n  satisfy do\n    q = `python -c \"import distutils.sysconfig as c; print(c.get_config_var('PYTHONFRAMEWORK'))\"`\n    not q.chomp.empty?\n  end\n\n  def message\n    \"Python needs to be built as a framework.\"\n  end\nend\n\nclass Wxmac29 < Formula\n  homepage 'http://www.wxwidgets.org'\n  url 'https://downloads.sourceforge.net/project/wxpython/wxPython/2.9.5.0/wxPython-src-2.9.5.0.tar.bz2'\n  sha1 '9183b2ffc6631cb2551c51b655a9d08904aa7b52'\n\n  keg_only \"Conflicts with `wxmac` in main tap\"\n\n  option 'disable-monolithic', \"Build a non-monolithic library (split into multiple files)\"\n  depends_on :python => :recommended\n  depends_on FrameworkPython if build.with? \"python\"\n\n  def install_wx_python\n    args = [\n      # Reference our wx-config\n      \"WX_CONFIG=#{bin}/wx-config\",\n      # At this time Wxmac is installed Unicode only\n      \"UNICODE=1\",\n      # Some scripts (e.g. matplotlib) expect to `import wxversion`, which is\n      # only available on a multiversion build. Besides that `import wx` still works.\n      \"INSTALL_MULTIVERSION=1\",\n      # OpenGL and stuff\n      \"BUILD_GLCANVAS=1\",\n      \"BUILD_GIZMOS=1\",\n      \"BUILD_STC=1\"\n    ]\n    cd \"wxPython\" do\n      ENV.append_to_cflags \"-arch #{MacOS.preferred_arch}\"\n\n      system \"python\", \"setup.py\",\n                      \"build_ext\",\n                      \"WXPORT=osx_cocoa\",\n                      *args\n      system \"python\", \"setup.py\",\n                      \"install\",\n                      \"--prefix=#{prefix}\",\n                      \"WXPORT=osx_cocoa\",\n                      *args\n    end\n  end\n\n  def install\n    # need to set with-macosx-version-min to avoid configure defaulting to 10.5\n    # need to enable universal binary build in order to build all x86_64 headers\n    # need to specify x86_64 and i386 or will try to build for ppc arch and fail on newer OSes\n    # https://trac.macports.org/browser/trunk/dports/graphics/wxWidgets30/Portfile#L80\n    ENV.universal_binary\n    args = [\n      \"--disable-debug\",\n      \"--prefix=#{prefix}\",\n      \"--enable-shared\",\n      \"--enable-unicode\",\n      \"--enable-std_string\",\n      \"--enable-display\",\n      \"--with-opengl\",\n      \"--with-osx_cocoa\",\n      \"--with-libjpeg\",\n      \"--with-libtiff\",\n      # Otherwise, even in superenv, the internal libtiff can pick\n      # up on a nonuniversal xz and fail\n      # https://github.com/Homebrew/homebrew/issues/22732\n      \"--without-liblzma\",\n      \"--with-libpng\",\n      \"--with-zlib\",\n      \"--enable-dnd\",\n      \"--enable-clipboard\",\n      \"--enable-webkit\",\n      \"--enable-svg\",\n      \"--with-expat\",\n      \"--with-macosx-version-min=#{MacOS.version}\",\n      \"--with-macosx-sdk=#{MacOS.sdk_path}\",\n      \"--enable-universal_binary=#{Hardware::CPU.universal_archs.join(',')}\",\n      \"--disable-precomp-headers\"\n    ]\n    args << \"--enable-monolithic\" unless build.include? 'disable-monolithic'\n\n    system \"./configure\", *args\n    system \"make install\"\n\n    if build.with? \"python\"\n      ENV['WXWIN'] = Dir.getwd\n      # We have already downloaded wxPython in a bundle with wxWidgets\n      install_wx_python\n    end\n  end\n\n  def caveats\n    s = ''\n    fp = FrameworkPython.new\n    unless build.without? 'python' or fp.satisfied?\n      s += fp.message\n    end\n\n    return s\n  end\nend\n"
  },
  {
    "path": "boneyard/wxmac-mono.rb",
    "content": "class WxmacMono < Formula\n  homepage \"http://www.wxwidgets.org\"\n  url \"https://downloads.sourceforge.net/project/wxwindows/3.0.2/wxWidgets-3.0.2.tar.bz2\"\n  sha256 \"346879dc554f3ab8d6da2704f651ecb504a22e9d31c17ef5449b129ed711585d\"\n\n  bottle do\n    root_url \"http://qgis.dakotacarto.com/osgeo4mac/bottles\"\n    sha256 \"5631995d76eedb6ebc6d6aa00d546415faf03aad8a6aa74b37aff9f9a097a0b7\" => :mavericks\n    sha256 \"ebb6a36167ab21cc957ee1cbb79fe7844b6eab52730f06fbb2dbc499a5fa0a7d\" => :yosemite\n  end\n\n  keg_only \"because wxmac (non-monolithic) is in main tap\"\n\n  depends_on \"jpeg\"\n  depends_on \"libpng\"\n  depends_on \"libtiff\"\n\n  # Various fixes related to Yosemite. Revisit in next stable release.\n  # Please keep an eye on http://trac.wxwidgets.org/ticket/16329 as well\n  # Theoretically the above linked patch should still be needed, but it isn't. Try to find out why.\n  patch :DATA\n\n  def install\n    # need to set with-macosx-version-min to avoid configure defaulting to 10.5\n    # need to enable universal binary build in order to build all x86_64\n    # Jack - I don't believe this is the whole story, surely this can be fixed\n    # without building universal for users who don't need it.\n    # headers need to specify x86_64 and i386 or will try to build for ppc arch\n    # and fail on newer OSes\n    # DomT4 - MacPorts seems to have stopped building universal by default? Can we do the same?\n    # https://trac.macports.org/browser/trunk/dports/graphics/wxWidgets-3.0/Portfile#L210\n    ENV.universal_binary\n    args = [\n      \"--disable-debug\",\n      \"--prefix=#{prefix}\",\n      \"--enable-shared\",\n      \"--enable-unicode\",\n      \"--enable-std_string\",\n      \"--enable-display\",\n      \"--with-opengl\",\n      \"--with-osx_cocoa\",\n      \"--with-libjpeg\",\n      \"--with-libtiff\",\n      # Otherwise, even in superenv, the internal libtiff can pick\n      # up on a nonuniversal xz and fail\n      # https://github.com/Homebrew/homebrew/issues/22732\n      \"--without-liblzma\",\n      \"--with-libpng\",\n      \"--with-zlib\",\n      \"--enable-dnd\",\n      \"--enable-clipboard\",\n      \"--enable-webkit\",\n      \"--enable-svg\",\n      \"--enable-mediactrl\",\n      \"--enable-graphics_ctx\",\n      \"--enable-controls\",\n      \"--enable-dataviewctrl\",\n      \"--with-expat\",\n      \"--with-macosx-version-min=#{MacOS.version}\",\n      \"--enable-universal_binary=#{Hardware::CPU.universal_archs.join(',')}\",\n      \"--disable-precomp-headers\",\n      \"--enable-monolithic\"\n    ]\n\n    system \"./configure\", *args\n    system \"make\", \"install\"\n  end\nend\n\n__END__\n\ndiff --git a/include/wx/defs.h b/include/wx/defs.h\nindex 397ddd7..d128083 100644\n--- a/include/wx/defs.h\n+++ b/include/wx/defs.h\n@@ -3169,12 +3169,20 @@ DECLARE_WXCOCOA_OBJC_CLASS(UIImage);\n DECLARE_WXCOCOA_OBJC_CLASS(UIEvent);\n DECLARE_WXCOCOA_OBJC_CLASS(NSSet);\n DECLARE_WXCOCOA_OBJC_CLASS(EAGLContext);\n+DECLARE_WXCOCOA_OBJC_CLASS(UIWebView);\n \n typedef WX_UIWindow WXWindow;\n typedef WX_UIView WXWidget;\n typedef WX_EAGLContext WXGLContext;\n typedef WX_NSString* WXGLPixelFormat;\n \n+typedef WX_UIWebView OSXWebViewPtr;\n+\n+#endif\n+\n+#if wxOSX_USE_COCOA_OR_CARBON\n+DECLARE_WXCOCOA_OBJC_CLASS(WebView);\n+typedef WX_WebView OSXWebViewPtr;\n #endif\n \n #endif /* __WXMAC__ */\ndiff --git a/include/wx/html/webkit.h b/include/wx/html/webkit.h\nindex 8700367..f805099 100644\n--- a/include/wx/html/webkit.h\n+++ b/include/wx/html/webkit.h\n@@ -18,7 +18,6 @@\n #endif\n \n #include \"wx/control.h\"\n-DECLARE_WXCOCOA_OBJC_CLASS(WebView); \n \n // ----------------------------------------------------------------------------\n // Web Kit Control\n@@ -107,7 +106,7 @@ private:\n     wxString m_currentURL;\n     wxString m_pageTitle;\n \n-    WX_WebView m_webView;\n+    OSXWebViewPtr m_webView;\n \n     // we may use this later to setup our own mouse events,\n     // so leave it in for now.\ndiff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h\nindex 803f8b0..438e532 100644\n--- a/include/wx/osx/webview_webkit.h\n+++ b/include/wx/osx/webview_webkit.h\n@@ -158,7 +158,7 @@ private:\n     wxWindowID m_windowID;\n     wxString m_pageTitle;\n \n-    wxObjCID m_webView;\n+    OSXWebViewPtr m_webView;\n \n     // we may use this later to setup our own mouse events,\n     // so leave it in for now.\n"
  },
  {
    "path": "commit-msg.sh",
    "content": "#!/usr/bin/env bash\n\nif [[ ! -a .ciignore ]]; then\n\texit # If .ciignore doesn't exists, just quit this Git hook\nfi\n\n# Load in every file that will be changed via this commit into an array\nchanges=( `git diff --name-only --cached` )\n\n# Load the patterns we want to skip into an array\nmapfile -t blacklist < .ciignore\n\nfor i in \"${blacklist[@]}\"\ndo\n\t# Remove the current pattern from the list of changes\n\tchanges=( ${changes[@]/$i/} )\n\n\tif [[ ${#changes[@]} -eq 0 ]]; then\n\t\t# If we've exhausted the list of changes before we've finished going \n\t\t# through patterns, that's okay, just quit the loop\n\t\tbreak\n\tfi\ndone\n\nif [[ ${#changes[@]} -gt 0 ]]; then\n\t# If there's still changes left, then we have stuff to build, leave the commit alone.\n\texit\nfi\n\n# Prefix the commit message with \"[skip ci]\"\nsed -i '1s/^/[skip ci] /' \"$1\"\n\n"
  },
  {
    "path": "docs/404.html",
    "content": "---\nlayout: default\ntitle: Page not found\npermalink: /404\nnav_exclude: true\nsearch_exclude: true\n---\n\n<h1>Page not found</h1>\n\n<p>The page you requested could not be found. Try using the navigation {% if site.search_enabled %}or search {% endif %}to find what you're looking for or go to this <a href=\"{{ site.url }}{{ site.baseurl }}\">site's home page</a>.</p>\n"
  },
  {
    "path": "docs/Gemfile",
    "content": "source \"https://rubygems.org\"\ngemspec\n\ngem \"jemoji\"\ngem \"jekyll-include-cache\"\n"
  },
  {
    "path": "docs/Rakefile",
    "content": "Dir.glob('lib/tasks/*.rake').each {|r| import r}\n"
  },
  {
    "path": "docs/_config.yml",
    "content": "# Welcome to Jekyll!\n#\n# This config file is meant for settings that affect your whole site, values\n# which you are expected to set up once and rarely edit after that. If you find\n# yourself editing these this file very often, consider using Jekyll's data files\n# feature for the data you need to update frequently.\n#\n# For technical reasons, this file is *NOT* reloaded automatically when you use\n# 'jekyll serve'. If you change this file, please restart the server process.\n\n# Site settings\n# These are used to personalize your new site. If you look in the HTML files,\n# you will see them accessed via {{ site.title }}, {{ site.github_repo }}, and so on.\n# You can create any custom variable you would like, and they will be accessible\n# in the templates via {{ site.myvariable }}.\ntitle: Homebrew OSGeo4mac Docs\ndescription: This is the doc's page for the Homebrew's OSGeo4mac tap\nbaseurl: \"/homebrew-osgeo4mac/\" # the subpath of your site, e.g. /blog\nurl: \"https://osgeo.github.io\" # the base hostname & protocol for your site, e.g. http://example.com\n\npermalink: pretty\nexclude: \n  - node_modules/\n  - \"*.gemspec\"\n  - \"*.gem\"\n  - Gemfile\n  - Gemfile.lock\n  - package.json\n  - package-lock.json\n  - script/\n  - LICENSE.txt\n  - lib/\t\n  - bin/\t\n  - README.md\n  - Rakefile\n\nplugins: \n  - jemoji\n  - jekyll-include-cache\n\n# Enable or disable the site search\nsearch_enabled: true\n\n# Aux links for the upper right navigation\naux_links:\n  \"Homebrew's OSGeo4mac on GitHub\":\n    - \"//github.com/OSGeo/homebrew-osgeo4mac/\"\n\nfooter_text: \"If you have any question or problem please open an \n[issue](https://github.com/OSGeo/homebrew-osgeo4mac/issues/new/choose) to contact the maintainers.\"\n\n# Color scheme currently only supports \"dark\" or nil (default)\ncolor_scheme: nil\n\n# Google Analytics Tracking (optional)\n# e.g, UA-1234567-89\n# ga_tracking: UA-2709176-10\n"
  },
  {
    "path": "docs/_includes/head.html",
    "content": "<head>\n  <meta charset=\"UTF-8\">\n  <meta http-equiv=\"X-UA-Compatible\" content=\"IE=Edge\">\n  {% if page.description %}\n  <meta name=\"Description\" content=\"{{ page.description }}\">\n  {% endif %}\n\n  <title>{{ page.title }} - {{ site.title }}</title>\n  <link rel=\"stylesheet\" href=\"{{ \"/assets/css/just-the-docs.css\" | absolute_url }}\">\n  <link rel=\"shortcut icon\" type=\"image/png\" href=\"{{ \"/assets/images/favicon.png\" | absolute_url }}\">\n  <base href=\"{{ site.url }}{{ site.baseurl }}\">\n\n  {% if site.ga_tracking != nil %}\n    <script>\n      window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;\n      ga('create', '{{ site.ga_tracking }}', '{{ site.url }}');\n      ga('send', 'pageview');\n    </script>\n    <script async src=\"https://www.google-analytics.com/analytics.js\"></script>\n  {% endif %}\n\n  {% if site.search_enabled != nil %}\n    <script type=\"text/javascript\" src=\"{{ \"/assets/js/vendor/lunr.min.js\" | absolute_url }}\"></script>\n  {% endif %}\n  <script type=\"text/javascript\" src=\"{{ \"/assets/js/just-the-docs.js\" | absolute_url }}\"></script>\n\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n</head>\n"
  },
  {
    "path": "docs/_includes/nav.html",
    "content": "<nav role=\"navigation\" aria-label=\"Main navigation\">\n  <ul class=\"navigation-list\">\n    {% assign pages_list = site.html_pages | sort:\"nav_order\" %}\n    {% for node in pages_list %}\n      {% unless node.nav_exclude %}\n        {% if node.parent == nil %}\n          <li class=\"navigation-list-item{% if page.url == node.url or page.parent == node.title or page.grand_parent == node.title %} active{% endif %}\">\n            {% if page.parent == node.title or page.grand_parent == node.title %}\n              {% assign first_level_url = node.url | absolute_url %}\n            {% endif %}\n            <a href=\"{{ node.url | absolute_url }}\" class=\"navigation-list-link{% if page.url == node.url %} active{% endif %}\">- {{ node.title }}</a>\n            {% if node.has_children %}\n              {% assign children_list = site.html_pages | sort:\"nav_order\" %}\n              <ul class=\"navigation-list-child-list \">\n                {% for child in children_list %}\n                  {% if child.parent == node.title %}\n                    <li class=\"navigation-list-item {% if page.url == child.url or page.parent == child.title %} active{% endif %}\">\n                      {% if page.url == child.url or page.parent == child.title %}\n                        {% assign second_level_url = child.url | absolute_url %}\n                      {% endif %}\n                      <a href=\"{{ child.url | absolute_url }}\" class=\"navigation-list-link{% if page.url == child.url %} active{% endif %}\">{{ child.title }}</a>\n                      {% if child.has_children %}\n                        {% assign grand_children_list = site.html_pages | sort:\"nav_order\" %}\n                        <ul class=\"navigation-list-child-list\">\n                          {% for grand_child in grand_children_list %}\n                            {% if grand_child.parent == child.title %}\n                              <li class=\"navigation-list-item {% if page.url == grand_child.url %} active{% endif %}\">\n                                <a href=\"{{ grand_child.url | absolute_url }}\" class=\"navigation-list-link{% if page.url == grand_child.url %} active{% endif %}\">{{ grand_child.title }}</a>\n                              </li>\n                            {% endif %}\n                          {% endfor %}\n                        </ul>\n                      {% endif %}\n                    </li>\n                  {% endif %}\n                {% endfor %}\n              </ul>\n            {% endif %}\n          </li>\n        {% endif %}\n      {% endunless %}\n    {% endfor %}\n  </ul>\n</nav>\n"
  },
  {
    "path": "docs/_includes/new-window-fix.html",
    "content": "<script>\n//open external links in a new window\nfunction external_new_window() {\n    for(var c = document.getElementsByTagName(\"a\"), a = 0;a < c.length;a++) {\n    var b = c[a];\n    b.getAttribute(\"href\") && b.hostname !== location.hostname && (b.target = \"_blank\")\n    }\n}\n//open PDF links in a new window\nfunction pdf_new_window ()\n{\n    if (!document.getElementsByTagName) return false;\n    var links = document.getElementsByTagName(\"a\");\n    for (var eleLink=0; eleLink < links.length; eleLink ++) {\n    if ((links[eleLink].href.indexOf('.pdf') !== -1)||(links[eleLink].href.indexOf('.doc') !== -1)||(links[eleLink].href.indexOf('.docx') !== -1)) {\n        links[eleLink].onclick =\n        function() {\n            window.open(this.href);\n            return false;\n        }\n    }\n    }\n} \npdf_new_window()\nexternal_new_window();\n</script>"
  },
  {
    "path": "docs/_includes/open-embed.html",
    "content": "<style>\n.videoWrapper {\n\tposition: relative;\n\tpadding-bottom: 56.333%;\n\theight: 0;\n    background: black;\n}\n.videoWrapper iframe {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n    border: 0;\n}    \n</style>\n\n<script>\nfunction get_youtube_id(url) {\n    var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n    return (url.match(p)) ? RegExp.$1 : false;\n}\nfunction vimeo_embed(url,el) {\n    var id = false;\n    $.ajax({\n      url: 'https://vimeo.com/api/oembed.json?url='+url,\n      async: true,\n      success: function(response) {\n        if(response.video_id) {\n          id = response.video_id;\n          if(url.indexOf('autoplay=1') !== -1) var autoplay=1; else var autoplay=0;\n          if(url.indexOf('loop=1') !== -1) var loop=1; else var loop=0;\n          var theInnerHTML = '<div class=\"videoWrapper\"><iframe src=\"https://player.vimeo.com/video/'+id+'/?byline=0&title=0&portrait=0';\n          if(autoplay==1) theInnerHTML += '&autoplay=1';\n          if(loop==1) theInnerHTML += '&loop=1';\n          theInnerHTML += '\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div>'; \n          el.innerHTML = theInnerHTML;\n        }\n      }\n    });\n}\nfunction video_embed() {\n    var p = document.getElementsByTagName('p');\n    for(var i = 0; i < p.length; i++) {\n        //check if this is an external url (that starts with https:// or http://\n        if (p[i].innerHTML.indexOf(\"http://\") == 0 ||\n            p[i].innerHTML.indexOf(\"https://\") == 0) {\n            var youtube_id = get_youtube_id(p[i].innerHTML);\n            if(youtube_id) {\n                if(p[i].innerHTML.indexOf('autoplay=1') !== -1) var autoplay=1; else var autoplay=0;\n                if(p[i].innerHTML.indexOf('loop=1') !== -1) var loop=1; else var loop=0;\n                var theInnerHTML = '<div class=\"videoWrapper\"><iframe width=\"720\" height=\"420\" src=\"https://www.youtube.com/embed/' + youtube_id + '?rel=0&showinfo=0';\n                if(autoplay==1) theInnerHTML += '&autoplay=1';\n                if(loop==1) theInnerHTML += '&loop=1&playlist='+youtube_id+'&version=3';\n                theInnerHTML += '\" frameborder=\"0\" allowfullscreen></iframe></div>';\n                p[i].innerHTML = theInnerHTML;\n            }\n            if(p[i].innerHTML.indexOf('vimeo.com') !== -1) {\n                //ask vimeo for the id and place the embed\n                vimeo_embed(p[i].innerHTML,p[i]);\n            }\n        }\n    }\n}\nvideo_embed();\n\nfunction mp3_embed() {\n    var p = document.getElementsByTagName('p');\n    for(var i = 0; i < p.length; i++) {\n        if(p[i].innerHTML.indexOf('.mp3') !== -1) {\n            var str = p[i].innerHTML.split('?');\n            if(str.length == 1) str[1] = '';\n            var str1 = str[1];\n            str1 = str1.replace('&','').replace('&','');\n            str1 = str1.replace('autoplay=1','').replace('autoplay=0','');\n            str1 = str1.replace('loop=1','').replace('loop=0','');\n            str1 = str1.replace('controls=0','').replace('controls=1','');\n\n            if (str[0].lastIndexOf('.mp3', str[0].length - 4) === str[0].length - 4 && str1.length == 0) {\n                if(str[1].indexOf('autoplay=1') !== -1) var autoplay=1; else var autoplay=0;\n                if(str[1].indexOf('loop=1') !== -1) var loop=1; else var loop=0;\n                if(str[1].indexOf('controls=0') !== -1) var controls=0; else var controls=1;\n                var newInnerHTML = '<audio';\n                if(autoplay==1) newInnerHTML += ' autoplay';\n                if(loop==1) newInnerHTML += ' loop';\n                if(controls==1) newInnerHTML += ' controls';\n                newInnerHTML += '><source src=\"'+str[0]+'\" type=\"audio/mpeg\">Your browser does not support the audio element.</audio>';\n                p[i].innerHTML = newInnerHTML;\n            }\n        }\n    }\n}\nmp3_embed();\n</script>"
  },
  {
    "path": "docs/_includes/scripts.html",
    "content": "<script src=\"/assets/js/vendor/anchor.min.js\"></script>\n<script>\n\tanchors.add()\n</script>"
  },
  {
    "path": "docs/_layouts/about.html",
    "content": "---\nlayout: default\n---\n\n{{ content }}\n"
  },
  {
    "path": "docs/_layouts/default.html",
    "content": "<!DOCTYPE html>\n\n<html lang=\"en-us\">\n{% include head.html %}\n<body>\n\n  <div class=\"page-wrap\">\n    <div class=\"side-bar\">\n      <a href=\"{{ site.url }}{{ site.baseurl }}\" class=\"site-title fs-6 lh-tight\"><img src=\"{{ site.url }}{{ site.baseurl }}/assets/images/osgeo-logo-brew-rgb.png\"></a>\n      <span class=\"fs-3\"><button class=\"js-main-nav-trigger navigation-list-toggle btn btn-outline\" type=\"button\" data-text-toggle=\"Hide\">Menu</button></span>\n      <div class=\"navigation main-nav js-main-nav\">\n        {% include nav.html %}\n      </div>\n      <footer role=\"contentinfo\" class=\"site-footer\">\n        <span class=\"text-small text-grey-dk-000 mb-0\">{{ site.footer_text | markdownify }}</span>\n      </footer>\n    </div>\n    <div class=\"main-content-wrap js-main-content\" tabindex=\"0\">\n      <div class=\"page-header\">\n        <div class=\"main-content\">\n          {% if site.search_enabled != nil %}\n          <div class=\"search js-search\">\n            <div class=\"search-input-wrap\">\n              <input type=\"text\" class=\"js-search-input search-input\" tabindex=\"0\" placeholder=\"Search {{ site.title }}\" aria-label=\"Search {{ site.title }}\" autocomplete=\"off\">\n              <svg width=\"14\" height=\"14\" viewBox=\"0 0 28 28\" xmlns=\"http://www.w3.org/2000/svg\" class=\"search-icon\"><title>Search</title><g fill-rule=\"nonzero\"><path d=\"M17.332 20.735c-5.537 0-10-4.6-10-10.247 0-5.646 4.463-10.247 10-10.247 5.536 0 10 4.601 10 10.247s-4.464 10.247-10 10.247zm0-4c3.3 0 6-2.783 6-6.247 0-3.463-2.7-6.247-6-6.247s-6 2.784-6 6.247c0 3.464 2.7 6.247 6 6.247z\"/><path d=\"M11.672 13.791L.192 25.271 3.02 28.1 14.5 16.62z\"/></g></svg>\n            </div>\n            <div class=\"js-search-results search-results-wrap\"></div>\n          </div>\n          {% endif %}\n          {% if site.aux_links != nil %}\n            <ul class=\"list-style-none text-small mt-md-1 mb-md-1 pb-4 pb-md-0 js-aux-nav aux-nav\">\n              {% for link in site.aux_links %}\n                <li class=\"d-inline-block my-0{% unless forloop.last %} mr-2{% endunless %}\"><a href=\"{{ link.last }}\">{{ link.first }}</a></li>\n              {% endfor %}\n            </ul>\n          {% endif %}\n        </div>\n      </div>\n      <div class=\"main-content\">\n        {% unless page.url == \"/\" %}\n          {% if page.parent %}\n            <nav class=\"breadcrumb-nav\">\n              <ol class=\"breadcrumb-nav-list\">\n                {% if page.grand_parent %}\n                  <li class=\"breadcrumb-nav-list-item\"><a href=\"{{ first_level_url }}\">{{ page.grand_parent }}</a></li>\n                  <li class=\"breadcrumb-nav-list-item\"><a href=\"{{ second_level_url }}\">{{ page.parent }}</a></li>\n                {% else %}\n                  <li class=\"breadcrumb-nav-list-item\"><a href=\"{{ first_level_url }}\">{{ page.parent }}</a></li>\n                {% endif %}\n                <li class=\"breadcrumb-nav-list-item\"><span>{{ page.title }}</span></li>\n              </ol>\n            </nav>\n          {% endif %}\n        {% endunless %}\n        <div id=\"main-content\" class=\"page-content\" role=\"main\">\n          {{ content }}\n\n          {% if page.has_children == true and page.has_toc != false %}\n          <hr>\n          <h2 class=\"text-delta\">Table of contents</h2>\n          {% assign children_list = site.pages | sort:\"nav_order\" %}\n          <ul>\n            {% for child in children_list %}\n              {% if child.parent == page.title and child.title != page.title %}\n              <li>\n                <a href=\"{{ child.url | absolute_url }}\">{{ child.title }}</a>\n              </li>\n              {% endif %}\n            {% endfor %}\n          </ul>\n          {% endif %}\n        </div>\n      </div>\n    </div>\n  </div>\n\n  {% include scripts.html %}\n  {% include_cached new-window-fix.html %}\n  {% include_cached open-embed.html %}\n\n</body>\n</html>\n"
  },
  {
    "path": "docs/_layouts/home.html",
    "content": "---\nlayout: default\n---\n\n{{ content }}\n"
  },
  {
    "path": "docs/_layouts/page.html",
    "content": "---\nlayout: default\n---\n\n{{ content }}\n"
  },
  {
    "path": "docs/_layouts/post.html",
    "content": "---\nlayout: default\n---\n\n{{ content }}\n"
  },
  {
    "path": "docs/_sass/base.scss",
    "content": "//\n// Base element style overrides\n//\n// stylelint-disable selector-no-type, selector-max-type\n\n* {\n  box-sizing: border-box;\n}\n\n::selection {\n  color: $white;\n  background: $link-color;\n}\n\nhtml {\n  @include fs-4;\n}\n\nbody {\n  font-family: $body-font-family;\n  font-size: inherit;\n  line-height: $body-line-height;\n  color: $body-text-color;\n  background-color: $body-background-color;\n}\n\np,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nol,\nul,\npre,\naddress,\nblockquote,\ndl,\ndiv,\nfieldset,\nform,\nhr,\nnoscript,\ntable {\n  margin-top: 0;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n  margin-top: 1.2em;\n  margin-bottom: 0.8em;\n  font-weight: 500;\n  line-height: $body-heading-line-height;\n  color: $body-heading-color;\n}\n\np {\n  margin-bottom: 1em;\n}\n\na {\n  color: $link-color;\n  text-decoration: none;\n}\n\na:not([class]) {\n  text-decoration: none;\n  background-image: linear-gradient($border-color 0%, $border-color 100%);\n  background-repeat: repeat-x;\n  background-position: 0 100%;\n  background-size: 1px 1px;\n\n  &:hover {\n    background-image: linear-gradient(rgba($link-color, 0.45) 0%, rgba($link-color, 0.45) 100%);\n    background-size: 1px 1px;\n\n  }\n}\n\ncode {\n  font-family: $mono-font-family;\n  font-size: 12px;\n  line-height: $body-line-height;\n}\n\nfigure {\n  margin: 0;\n}\n\nli {\n  margin: 0.25em 0;\n}\n\nimg {\n  max-width: 100%;\n  height: auto;\n}\n\nhr {\n  height: 1px;\n  padding: 0;\n  margin: $sp-6 0;\n  background-color: $border-color;\n  border: 0;\n}\n"
  },
  {
    "path": "docs/_sass/buttons.scss",
    "content": "//\n// Buttons and things that look like buttons\n//\n// stylelint-disable color-named\n\n.btn {\n  display: inline-block;\n  box-sizing: border-box;\n  padding-top: 0.3em;\n  padding-right: 1em;\n  padding-bottom: 0.3em;\n  padding-left: 1em;\n  margin: 0;\n  font-family: inherit;\n  font-size: inherit;\n  font-weight: 500;\n  line-height: 1.5;\n  color: $link-color;\n  text-decoration: none;\n  vertical-align: baseline;\n  cursor: pointer;\n  background-color: $base-button-color;\n  border-width: 0;\n  border-radius: 3px;\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08);\n  appearance: none;\n\n  &:focus {\n    text-decoration: none;\n    outline: none;\n    box-shadow: 0 0 0 3px rgba(blue, 0.25);\n  }\n\n  &:focus:hover,\n  &.selected:focus {\n    box-shadow: 0 0 0 3px rgba(blue, 0.25);\n  }\n\n  &:hover,\n  &.zeroclipboard-is-hover {\n    color: darken($link-color, 2%);\n  }\n\n  &:hover,\n  &:active,\n  &.zeroclipboard-is-hover,\n  &.zeroclipboard-is-active {\n    text-decoration: none;\n    background-color: darken($base-button-color, 1%);\n  }\n\n  &:active,\n  &.selected,\n  &.zeroclipboard-is-active {\n    background-color: darken($base-button-color, 3%);\n    background-image: none;\n    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);\n  }\n\n  &.selected:hover {\n    background-color: darken(#dcdcdc, 5%);\n  }\n\n  &:disabled,\n  &.disabled {\n    &,\n    &:hover {\n      color: rgba(102, 102, 102, 0.5);\n      cursor: default;\n      background-color: rgba(229, 229, 229, 0.5);\n      background-image: none;\n      box-shadow: none;\n    }\n  }\n}\n\n.btn-outline {\n  color: $link-color;\n  background: transparent;\n  box-shadow: inset 0 0 0 2px $grey-lt-300;\n\n  &:hover,\n  &:active,\n  &.zeroclipboard-is-hover,\n  &.zeroclipboard-is-active {\n    color: darken($link-color, 4%);\n    text-decoration: none;\n    background-color: transparent;\n    box-shadow: inset 0 0 0 3px $grey-lt-300;\n  }\n\n  &:focus {\n    text-decoration: none;\n    outline: none;\n    box-shadow: inset 0 0 0 2px $grey-dk-100, 0 0 0 3px rgba(blue, 0.25);\n  }\n\n  &:focus:hover,\n  &.selected:focus {\n    box-shadow: inset 0 0 0 2px $grey-dk-100;\n  }\n}\n\n.btn-primary {\n  @include btn-color($white, $btn-primary-color);\n}\n\n.btn-purple {\n  @include btn-color($white, $purple-100);\n}\n\n.btn-blue {\n  @include btn-color($white, $blue-000);\n}\n\n.btn-green {\n  @include btn-color($white, $green-100);\n}\n"
  },
  {
    "path": "docs/_sass/code.scss",
    "content": "//\n// Code and syntax highlighting\n//\n// stylelint-disable selector-no-qualifying-type, declaration-block-semicolon-newline-after,declaration-block-single-line-max-declarations, selector-no-type, selector-max-type\n\ncode {\n  padding: 0.2em 0.15em;\n  font-weight: 400;\n  background-color: $code-background-color;\n  border: $border $border-color;\n  border-radius: $border-radius;\n}\n\npre.highlight {\n  padding: $sp-3;\n  margin-bottom: 0;\n  -webkit-overflow-scrolling: touch;\n  background-color: $code-background-color;\n\n  code {\n    padding: 0;\n    border: 0;\n  }\n}\n\n.highlighter-rouge {\n  margin-bottom: $sp-3;\n  overflow: hidden;\n  border-radius: $border-radius;\n}\n\n.highlight .c { color: #586e75; } // comment //\n.highlight .err { color: #93a1a1; } // error //\n.highlight .g { color: #93a1a1; } // generic //\n.highlight .k { color: #859900; } // keyword //\n.highlight .l { color: #93a1a1; } // literal //\n.highlight .n { color: #93a1a1; } // name //\n.highlight .o { color: #859900; } // operator //\n.highlight .x { color: #cb4b16; } // other //\n.highlight .p { color: #93a1a1; } // punctuation //\n.highlight .cm { color: #586e75; } // comment.multiline //\n.highlight .cp { color: #859900; } // comment.preproc //\n.highlight .c1 { color: #586e75; } // comment.single //\n.highlight .cs { color: #859900; } // comment.special //\n.highlight .gd { color: #2aa198; } // generic.deleted //\n.highlight .ge { font-style: italic; color: #93a1a1; } // generic.emph //\n.highlight .gr { color: #dc322f; } // generic.error //\n.highlight .gh { color: #cb4b16; } // generic.heading //\n.highlight .gi { color: #859900; } // generic.inserted //\n.highlight .go { color: #93a1a1; } // generic.output //\n.highlight .gp { color: #93a1a1; } // generic.prompt //\n.highlight .gs { font-weight: bold; color: #93a1a1; } // generic.strong //\n.highlight .gu { color: #cb4b16; } // generic.subheading //\n.highlight .gt { color: #93a1a1; } // generic.traceback //\n.highlight .kc { color: #cb4b16; } // keyword.constant //\n.highlight .kd { color: #268bd2; } // keyword.declaration //\n.highlight .kn { color: #859900; } // keyword.namespace //\n.highlight .kp { color: #859900; } // keyword.pseudo //\n.highlight .kr { color: #268bd2; } // keyword.reserved //\n.highlight .kt { color: #dc322f; } // keyword.type //\n.highlight .ld { color: #93a1a1; } // literal.date //\n.highlight .m { color: #2aa198; } // literal.number //\n.highlight .s { color: #2aa198; } // literal.string //\n.highlight .na { color: #93a1a1; } // name.attribute //\n.highlight .nb { color: #b58900; } // name.builtin //\n.highlight .nc { color: #268bd2; } // name.class //\n.highlight .no { color: #cb4b16; } // name.constant //\n.highlight .nd { color: #268bd2; } // name.decorator //\n.highlight .ni { color: #cb4b16; } // name.entity //\n.highlight .ne { color: #cb4b16; } // name.exception //\n.highlight .nf { color: #268bd2; } // name.function //\n.highlight .nl { color: #93a1a1; } // name.label //\n.highlight .nn { color: #93a1a1; } // name.namespace //\n.highlight .nx { color: #555; } // name.other //\n.highlight .py { color: #93a1a1; } // name.property //\n.highlight .nt { color: #268bd2; } // name.tag //\n.highlight .nv { color: #268bd2; } // name.variable //\n.highlight .ow { color: #859900; } // operator.word //\n.highlight .w { color: #93a1a1; } // text.whitespace //\n.highlight .mf { color: #2aa198; } // literal.number.float //\n.highlight .mh { color: #2aa198; } // literal.number.hex //\n.highlight .mi { color: #2aa198; } // literal.number.integer //\n.highlight .mo { color: #2aa198; } // literal.number.oct //\n.highlight .sb { color: #586e75; } // literal.string.backtick //\n.highlight .sc { color: #2aa198; } // literal.string.char //\n.highlight .sd { color: #93a1a1; } // literal.string.doc //\n.highlight .s2 { color: #2aa198; } // literal.string.double //\n.highlight .se { color: #cb4b16; } // literal.string.escape //\n.highlight .sh { color: #93a1a1; } // literal.string.heredoc //\n.highlight .si { color: #2aa198; } // literal.string.interpol //\n.highlight .sx { color: #2aa198; } // literal.string.other //\n.highlight .sr { color: #dc322f; } // literal.string.regex //\n.highlight .s1 { color: #2aa198; } // literal.string.single //\n.highlight .ss { color: #2aa198; } // literal.string.symbol //\n.highlight .bp { color: #268bd2; } // name.builtin.pseudo //\n.highlight .vc { color: #268bd2; } // name.variable.class //\n.highlight .vg { color: #268bd2; } // name.variable.global //\n.highlight .vi { color: #268bd2; } // name.variable.instance //\n.highlight .il { color: #2aa198; } // literal.number.integer.long //\n\n//\n// Code examples (rendered)\n//\n\n.code-example {\n  padding: $sp-3;\n  margin-bottom: $sp-3;\n  overflow: auto;\n  border: 1px solid $border-color;\n  border-radius: $border-radius;\n\n  + .highlighter-rouge,\n  + figure.highlight {\n    position: relative;\n    margin-top: -$sp-4;\n    border-right: 1px solid $border-color;\n    border-bottom: 1px solid $border-color;\n    border-left: 1px solid $border-color;\n    border-top-left-radius: 0;\n    border-top-right-radius: 0;\n  }\n}\n"
  },
  {
    "path": "docs/_sass/color_schemes/dark.scss",
    "content": "\n$body-background-color: $grey-dk-300;\n$sidebar-color: $grey-dk-300;\n$border-color: $grey-dk-200;\n\n$body-text-color: $grey-lt-300;\n$body-heading-color: $grey-lt-000;\n$nav-child-link-color: $grey-dk-000;\n\n$link-color: $blue-000;\n$btn-primary-color: $blue-200;\n$base-button-color: $grey-dk-250;\n\n$code-background-color: $grey-dk-250;\n"
  },
  {
    "path": "docs/_sass/content.scss",
    "content": "@charset \"UTF-8\";\n\n//\n// Styles for rendered markdown in the .main-content container\n//\n// stylelint-disable selector-no-type, max-nesting-depth, selector-max-compound-selectors, selector-max-type\n\n.page-content {\n  a {\n    overflow: hidden;\n    text-overflow: ellipsis;\n    white-space: nowrap;\n  }\n\n  ul,\n  ol {\n    padding-left: 1.5em;\n  }\n\n  ol {\n    list-style-type: none;\n    counter-reset: step-counter;\n\n    > li {\n      position: relative;\n\n      &::before {\n        position: absolute;\n        top: 0.2em;\n        left: -1.6em;\n        color: $grey-dk-000;\n        content: counter(step-counter);\n        counter-increment: step-counter;\n        @include fs-3;\n\n        @include mq(sm) {\n          top: 0.11em;\n        }\n      }\n\n      ol {\n        counter-reset: sub-counter;\n\n        li {\n          &::before {\n            content: counter(sub-counter, lower-alpha);\n            counter-increment: sub-counter;\n          }\n        }\n      }\n    }\n  }\n\n  ul {\n    list-style: none;\n\n    > li {\n      &::before {\n        position: absolute;\n        margin-left: -1.4em;\n        color: $grey-dk-000;\n        content: \"•\";\n      }\n    }\n  }\n\n  .task-list {\n    padding-left: 0;\n  }\n\n  .task-list-item {\n    display: flex;\n    align-items: center;\n\n    &::before {\n      content: \"\";\n    }\n  }\n\n  .task-list-item-checkbox {\n    margin-right: 0.6em;\n  }\n\n  hr + * {\n    margin-top: 0;\n  }\n\n  h1:first-of-type {\n    margin-top: 0.5em;\n  }\n\n  dl {\n    display: grid;\n    grid-template-columns: max-content 1fr;\n  }\n\n  dt,\n  dd {\n    margin: 0.25em 0;\n  }\n\n  dt {\n    text-align: right;\n\n    &::after {\n      content: \":\";\n    }\n  }\n\n  dd {\n    margin-left: 1em;\n    font-weight: 500;\n  }\n}\n"
  },
  {
    "path": "docs/_sass/custom/custom.scss",
    "content": "// //\n// // Typography\n// //\n//\n// $body-font-family: -apple-system, BlinkMacSystemFont, \"helvetica neue\", helvetica, roboto, noto, \"segoe ui\", arial, sans-serif;\n// $mono-font-family: \"SFMono-Regular\", Menlo, Consolas, Monospace;\n// $root-font-size: 16px;         // Base font-size for rems\n// $body-line-height: 1.4;\n// $body-heading-line-height: 1.15;\n//\n// //\n// // Colors\n// //\n//\n// $white: #fff;\n//\n// $grey-dk-000: #959396;\n// $grey-dk-100: #5c5962;\n// $grey-dk-200: #44434d;\n// $grey-dk-250: #302d36 !default;\n// $grey-dk-300: #27262b;\n//\n// $grey-lt-000: #f5f6fa;\n// $grey-lt-100: #eeebee;\n// $grey-lt-200: #ecebed;\n// $grey-lt-300: #e6e1e8;\n//\n// $purple-000: #7253ed;\n// $purple-100: #5e41d0;\n// $purple-200: #4e26af;\n// $purple-300: #381885;\n//\n// $blue-000: #2c84fa;\n// $blue-100: #2869e6;\n// $blue-200: #264caf;\n// $blue-300: #183385;\n//\n// $green-000: #41d693;\n// $green-100: #11b584;\n// $green-200: #009c7b;\n// $green-300: #026e57;\n//\n// $body-background-color: $white !default;\n// $sidebar-color: $grey-lt-000 !default;\n// $code-background-color: $grey-lt-000 !default;\n\n// $body-text-color: $grey-dk-100 !default;\n// $body-heading-color: $grey-dk-300 !default;\n// $nav-child-link-color: $grey-dk-100 !default;\n// $link-color: $purple-000 !default;\n// $btn-primary-color: $purple-100 !default;\n// $base-button-color: #f7f7f7 !default;\n//\n// //\n// // Media queries in pixels\n// //\n//\n// $media-queries: (\n//   xs: 320px,\n//   sm: 500px,\n//   md: 740px,\n//   lg: 1120px,\n//   xl: 1400px\n// );\n//\n// //\n// // Spacing\n// //\n//\n// $spacing-unit: 1rem; // 1rem == 16px\n//\n// $spacers: (\n//   sp-0: 0,\n//   sp-1: $spacing-unit * 0.25,\n//   sp-2: $spacing-unit * 0.5,\n//   sp-3: $spacing-unit * 0.75,\n//   sp-4: $spacing-unit,\n//   sp-5: $spacing-unit * 1.5,\n//   sp-6: $spacing-unit * 2,\n//   sp-7: $spacing-unit * 2.5,\n//   sp-8: $spacing-unit * 3,\n//   sp-9: $spacing-unit * 3.5,\n//   sp-10: $spacing-unit * 4\n// );\n//\n// $sp-1: map-get($spacers, sp-1); // 0.25 rem == 4px\n// $sp-2: map-get($spacers, sp-2); // 0.5  rem == 8px\n// $sp-3: map-get($spacers, sp-3); // 0.75 rem == 12px\n// $sp-4: map-get($spacers, sp-4); // 1    rem == 16px\n// $sp-5: map-get($spacers, sp-5); // 1.5  rem == 24px\n// $sp-6: map-get($spacers, sp-6); // 2    rem == 32px\n// $sp-7: map-get($spacers, sp-7); // 2.5  rem == 40px\n// $sp-8: map-get($spacers, sp-8); // 3    rem == 48px\n// $sp-9: map-get($spacers, sp-9); // 4    rem == 48px\n// $sp-10: map-get($spacers, sp-10); // 4.5  rem == 48px\n//\n// //\n// // Borders\n// //\n//\n// $border: 1px solid;\n// $border-radius: 4px;\n// $border-color: $grey-lt-100;\n//\n// //\n// // Grid system\n// //\n//\n// $gutter-spacing: $sp-6;\n// $gutter-spacing-sm: $sp-4;\n// $nav-width: 232px;\n// $content-width: 800px;\n//\n// $media-queries: (\n//   xs: 320px,\n//   sm: 500px,\n//   md: 740px,\n//   lg: 800px,\n//   xl: 1316px\n// );\n"
  },
  {
    "path": "docs/_sass/labels.scss",
    "content": "//\n// Labels (not the form kind)\n//\n\n.label,\n.label-blue {\n  display: inline-block;\n  padding-top: 0.16em;\n  padding-right: 0.42em;\n  padding-bottom: 0.16em;\n  padding-left: 0.42em;\n  margin-right: $sp-1;\n  margin-left: $sp-1;\n  color: $white;\n  text-transform: uppercase;\n  vertical-align: middle;\n  background-color: $blue-100;\n  @include fs-2;\n}\n\n.label-green {\n  background-color: $green-200;\n}\n\n.label-purple {\n  background-color: $purple-100;\n}\n\n.label-red {\n  background-color: $red-200;\n}\n\n.label-yellow {\n  color: $grey-dk-200;\n  background-color: $yellow-200;\n}\n"
  },
  {
    "path": "docs/_sass/layout.scss",
    "content": "//\n// The basic two column layout\n//\n\n.page-wrap {\n  @include mq(md) {\n    position: absolute;\n    top: 0;\n    left: 0;\n    display: flex;\n    width: 100%;\n    height: 100%;\n    overflow-x: hidden;\n    overflow-y: hidden;\n  }\n}\n\n.side-bar {\n  z-index: 100;\n  display: flex;\n  flex-wrap: wrap;\n  padding-top: $gutter-spacing-sm;\n  padding-bottom: $gutter-spacing-sm;\n  background-color: $sidebar-color;\n\n  @include mq(md) {\n    flex-wrap: nowrap;\n    position: absolute;\n    width: $nav-width + 16px;\n    height: 100%;\n    padding-top: $gutter-spacing * 2;\n    padding-bottom: 0;\n    flex-direction: column;\n    border-right: $border $border-color;\n    align-items: flex-end;\n  }\n\n  @include mq(lg) {\n    width: calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width});\n    min-width: $nav-width;\n  }\n}\n\n.main-content-wrap {\n  @include mq(md) {\n    position: absolute;\n    top: 0;\n    left: 0;\n    width: 100%;\n    height: 100%;\n    min-height: 600px;\n    -webkit-overflow-scrolling: touch;\n    overflow-x: hidden;\n    overflow-y: scroll;\n  }\n}\n\n.main-content {\n  padding-top: $gutter-spacing-sm;\n  @include container;\n\n  @include mq(md) {\n    position: relative;\n    max-width: $content-width;\n    padding-top: $gutter-spacing;\n    padding-bottom: $gutter-spacing;\n    padding-left: $gutter-spacing * 1.5;\n    margin-left: $nav-width;\n  }\n\n  @include mq(lg) {\n    padding-left: $gutter-spacing;\n    margin-left: calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width});\n  }\n}\n\n.js-main-content:focus {\n  outline: none;\n}\n\n.page-header {\n  background-color: $sidebar-color;\n\n  @include mq(md) {\n    background-color: $body-background-color;\n  }\n\n  .main-content {\n    padding-top: 0;\n\n    @include mq(md) {\n      display: flex;\n      justify-content: flex-end;\n      height: 60px;\n      padding-top: $sp-4;\n      padding-bottom: $sp-4;\n      border-bottom: $border $border-color;\n    }\n  }\n}\n\n.navigation,\n.site-title,\n.site-footer {\n\n  @include container;\n\n  width: 100%;\n\n  @include mq(lg) {\n    width: $nav-width + 32px;\n  }\n}\n\n.navigation {\n  @include mq(md) {\n    padding-top: $sp-8;\n    overflow-y: auto;\n    flex: 1 1 auto;\n  }\n}\n\n// stylelint-disable selector-no-type\nbody {\n  position: relative;\n  padding-bottom: $sp-10;\n\n  @include mq(md) {\n    position: static;\n    padding-bottom: 0;\n  }\n}\n// stylelint-enable selector-no-type\n\n.site-footer {\n  position: absolute;\n  bottom: 0;\n  padding-top: $sp-4;\n  padding-bottom: $sp-4;\n\n  @include mq(md) {\n    position: static;\n    align-self: flex-end;\n    justify-self: end;\n    background-color: $sidebar-color;\n  }\n}\n"
  },
  {
    "path": "docs/_sass/navigation.scss",
    "content": "//\n// Main nav, breadcrumb, etc...\n//\n\n.site-title {\n  display: block;\n  flex: 1 1 auto;\n  color: $body-heading-color;\n  background-color: $sidebar-color;\n\n  @include mq(md) {\n    position: absolute;\n    top: 0;\n    right: 0;\n    z-index: 101;\n    height: 60px;\n    padding-top: $sp-4;\n    // border-bottom: $border $border-color;\n  }\n}\n\n.navigation-list {\n  padding: 0;\n  margin-top: $sp-4;\n  margin-bottom: 0;\n  list-style: none;\n\n  @include mq(md) {\n    margin-top: 0;\n  }\n}\n\n.navigation-list-child-list {\n  padding-left: $sp-3;\n  list-style: none;\n\n  .navigation-list-link {\n    color: $nav-child-link-color;\n  }\n\n  .navigation-list-item {\n    position: relative;\n\n    &::before {\n      position: absolute;\n      margin-top: 0.3em;\n      margin-left: -0.8em;\n      color: rgba($body-text-color, 0.3);\n      content: \"- \";\n    }\n\n    &.active {\n      &::before {\n        color: $body-text-color;\n      }\n    }\n  }\n}\n\n.navigation-list-item {\n  @include fs-4;\n  margin: 0;\n\n  @include mq(md) {\n    @include fs-3;\n  }\n\n  .navigation-list-child-list {\n    display: none;\n  }\n\n  &.active {\n    .navigation-list-child-list {\n      display: block;\n    }\n  }\n}\n\n.navigation-list-link {\n  display: block;\n  padding-top: $sp-1;\n  padding-bottom: $sp-1;\n\n  &.active {\n    font-weight: 600;\n    color: $body-heading-color;\n    text-decoration: none;\n  }\n}\n\n// Small screen nav\n\n.main-nav,\n.aux-nav {\n  display: none;\n\n  &.nav-open {\n    display: block;\n  }\n  @include mq(md) {\n    display: block;\n  }\n}\n\n.navigation-list-toggle {\n  position: absolute;\n  right: $sp-4;\n\n  @include mq(md) {\n    display: none !important;\n  }\n}\n\n// Breadcrumb nav\n.breadcrumb-nav {\n  @include mq(md) {\n    margin-top: -$sp-4;\n  }\n}\n\n.breadcrumb-nav-list {\n  padding-left: 0;\n  margin-bottom: $sp-3;\n  list-style: none;\n}\n\n.breadcrumb-nav-list-item {\n  display: table-cell;\n  @include fs-2;\n\n  &::before {\n    display: none;\n  }\n\n  &::after {\n    display: inline-block;\n    margin-right: $sp-2;\n    margin-left: $sp-2;\n    color: $grey-dk-000;\n    content: \"/\";\n  }\n\n  &:last-child {\n    &::after {\n      content: \"\";\n    }\n  }\n}\n"
  },
  {
    "path": "docs/_sass/search.scss",
    "content": "//\n// Search input and autocomplete\n//\n\n.search {\n  position: relative;\n  z-index: 99;\n  display: none;\n  flex-grow: 1;\n  padding: $sp-2;\n  margin-bottom: $sp-3;\n  background-color: $white;\n  border-radius: 3px;\n  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07), 0 3px 10px rgba(0, 0, 0, 0.05);\n\n  @include mq(md) {\n    display: block;\n    padding-top: $sp-1;\n    padding-right: 0;\n    padding-bottom: 0;\n    padding-left: 0;\n    margin-bottom: 0;\n    background-color: transparent;\n    box-shadow: none;\n  }\n\n  &.nav-open {\n    display: block;\n  }\n}\n\n.search-results-wrap {\n  display: none;\n\n  &.active {\n    position: absolute;\n    top: $sp-1;\n    z-index: 100;\n    display: block;\n    width: 300px;\n    margin-top: $gutter-spacing;\n    background: lighten($body-background-color, 1%);\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 14px rgba(0, 0, 0, 0.05);\n  }\n}\n\n.search-input-wrap {\n  display: flex;\n  background-color: $body-background-color;\n}\n\n.search-input {\n  width: 100%;\n  padding-top: $sp-1;\n  padding-bottom: $sp-1;\n  background-color: $body-background-color;\n  border-top: 0;\n  border-right: 0;\n  border-bottom: 0;\n  border-left: 0;\n  order: 2;\n\n  &:focus {\n    outline: 0;\n    box-shadow: none;\n\n    + .search-icon {\n      fill: $link-color;\n    }\n  }\n\n  @include fs-5;\n\n  @include mq(sm) {\n    @include fs-3;\n  }\n\n  @include mq(md) {\n    @include fs-2;\n  }\n}\n\n.search-icon {\n  align-self: center;\n  margin-right: $sp-2;\n  fill: $grey-dk-000;\n  order: 1;\n}\n\n.search-results-list {\n  padding-left: 0;\n  margin-top: $sp-1;\n  margin-bottom: $sp-1;\n  list-style: none;\n  @include fs-3;\n}\n\n.search-results-list-item {\n  padding: 0;\n  margin: 0;\n}\n\n.search-results-link {\n  display: block;\n  padding-top: $sp-1;\n  padding-right: $sp-3;\n  padding-bottom: $sp-1;\n  padding-left: $sp-3;\n\n  &:hover {\n    color: $body-heading-color;\n    background-color: darken($body-background-color, 2%);\n  }\n}\n"
  },
  {
    "path": "docs/_sass/support/_functions.scss",
    "content": "@function rem($size, $unit:\"\") {\n  $remSize: $size / $root-font-size;\n\n  @if ($unit == false) {\n    @return #{$remSize};\n  }\n  @else {\n    @return #{$remSize}rem;\n  }\n}\n"
  },
  {
    "path": "docs/_sass/support/_variables.scss",
    "content": "//\n// Typography\n//\n\n$body-font-family: -apple-system, BlinkMacSystemFont, \"helvetica neue\", helvetica, roboto, noto, \"segoe ui\", arial, sans-serif !default;\n$mono-font-family: \"SFMono-Regular\", Menlo, Consolas, Monospace !default;\n$root-font-size: 16px !default;         // Base font-size for rems\n$body-line-height: 1.4 !default;\n$body-heading-line-height: 1.15 !default !default;\n\n//\n// Colors\n//\n\n$white: #fff !default;\n\n$grey-dk-000: #959396 !default;\n$grey-dk-100: #5c5962 !default;\n$grey-dk-200: #44434d !default;\n$grey-dk-250: #302d36 !default;\n$grey-dk-300: #27262b !default;\n\n$grey-lt-000: #f5f6fa !default;\n$grey-lt-100: #eeebee !default;\n$grey-lt-200: #ecebed !default;\n$grey-lt-300: #e6e1e8 !default;\n\n$purple-000: #7253ed !default;\n$purple-100: #5e41d0 !default;\n$purple-200: #4e26af !default;\n$purple-300: #381885 !default;\n\n$blue-000: #2c84fa !default;\n$blue-100: #2869e6 !default;\n$blue-200: #264caf !default;\n$blue-300: #183385 !default;\n\n$green-000: #41d693 !default;\n$green-100: #11b584 !default;\n$green-200: #009c7b !default;\n$green-300: #026e57 !default;\n\n$yellow-000: #ffeb82 !default;\n$yellow-100: #fadf50 !default;\n$yellow-200: #f7d12e !default;\n$yellow-300: #e7af06 !default;\n\n$red-000: #f77e7e !default;\n$red-100: #f96e65 !default;\n$red-200: #e94c4c !default;\n$red-300: #dd2e2e !default;\n\n$osgeo: #66AA64 !default;\n\n$body-background-color: $white !default;\n$sidebar-color: $grey-lt-000 !default;\n$code-background-color: $grey-lt-000 !default;\n\n$body-text-color: $grey-dk-100 !default;\n$body-heading-color: $grey-dk-300 !default;\n$nav-child-link-color: $grey-dk-100 !default;\n$link-color: $osgeo !default;\n$btn-primary-color: $purple-100 !default;\n$base-button-color: #f7f7f7 !default;\n\n//\n// Media queries in pixels\n//\n\n$media-queries: (\n  xs: 320px,\n  sm: 500px,\n  md: 740px,\n  lg: 1120px,\n  xl: 1400px\n) !default;\n\n//\n// Spacing\n//\n\n$spacing-unit: 1rem; // 1rem == 16px\n\n$spacers: (\n  sp-0: 0,\n  sp-1: $spacing-unit * 0.25,\n  sp-2: $spacing-unit * 0.5,\n  sp-3: $spacing-unit * 0.75,\n  sp-4: $spacing-unit,\n  sp-5: $spacing-unit * 1.5,\n  sp-6: $spacing-unit * 2,\n  sp-7: $spacing-unit * 2.5,\n  sp-8: $spacing-unit * 3,\n  sp-9: $spacing-unit * 3.5,\n  sp-10: $spacing-unit * 4\n) !default;\n\n$sp-1: map-get($spacers, sp-1) !default; // 0.25 rem == 4px\n$sp-2: map-get($spacers, sp-2) !default; // 0.5  rem == 8px\n$sp-3: map-get($spacers, sp-3) !default; // 0.75 rem == 12px\n$sp-4: map-get($spacers, sp-4) !default; // 1    rem == 16px\n$sp-5: map-get($spacers, sp-5) !default; // 1.5  rem == 24px\n$sp-6: map-get($spacers, sp-6) !default; // 2    rem == 32px\n$sp-7: map-get($spacers, sp-7) !default; // 2.5  rem == 40px\n$sp-8: map-get($spacers, sp-8) !default; // 3    rem == 48px\n$sp-9: map-get($spacers, sp-9) !default; // 4    rem == 48px\n$sp-10: map-get($spacers, sp-10) !default; // 4.5  rem == 48px\n\n//\n// Borders\n//\n\n$border: 1px solid !default;\n$border-radius: 4px !default;\n$border-color: $grey-lt-100 !default;\n\n//\n// Grid system\n//\n\n$gutter-spacing: $sp-6 !default;\n$gutter-spacing-sm: $sp-4 !default;\n$nav-width: 232px !default;\n$content-width: 800px !default;\n\n$media-queries: (\n  xs: 320px,\n  sm: 500px,\n  md: 740px,\n  lg: 800px,\n  xl: 1316px\n) !default;\n"
  },
  {
    "path": "docs/_sass/support/mixins/_buttons.scss",
    "content": "// Colored button\n\n@mixin btn-color($fg, $bg) {\n  color: $fg;\n  background-color: darken($bg, 2%);\n  background-image: linear-gradient(lighten($bg, 5%), darken($bg, 2%));\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 4px 10px rgba(0, 0, 0, 0.12);\n\n  &:hover,\n  &.zeroclipboard-is-hover {\n    color: $fg;\n    background-color: darken($bg, 4%);\n    background-image: linear-gradient((lighten($bg, 2%), darken($bg, 4%)));\n  }\n\n  &:active,\n  &.selected,\n  &.zeroclipboard-is-active {\n    background-color: darken($bg, 5%);\n    background-image: none;\n    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);\n  }\n\n  &.selected:hover {\n    background-color: darken($bg, 10%);\n  }\n}\n"
  },
  {
    "path": "docs/_sass/support/mixins/_layout.scss",
    "content": "// Media query\n\n// Media query mixin\n// Usage:\n// @include mq(md) {\n//   ..medium and up styles\n// }\n@mixin mq($name) {\n  // Retrieves the value from the key\n  $value: map-get($media-queries, $name);\n\n  // If the key exists in the map\n  @if $value != null {\n    // Prints a media query based on the value\n    @media (min-width: rem($value)) {\n      @content;\n    }\n  }\n\n  @else {\n    @warn \"No value could be retrieved from `#{$media-query}`. \"\n      + \"Please make sure it is defined in `$media-queries` map.\";\n  }\n}\n\n// Responsive container\n\n@mixin container {\n  padding-right: $gutter-spacing-sm;\n  padding-left: $gutter-spacing-sm;\n\n  @include mq(md) {\n    padding-right: $gutter-spacing;\n    padding-left: $gutter-spacing;\n  }\n}\n"
  },
  {
    "path": "docs/_sass/support/mixins/_typography.scss",
    "content": "// Font size\n\n@mixin fs-1 {\n  font-size: 9px !important;\n\n  @include mq(sm) {\n    font-size: 10px !important;\n  }\n}\n\n@mixin fs-2 {\n  font-size: 11px !important;\n\n  @include mq(sm) {\n    font-size: 12px !important;\n  }\n}\n\n@mixin fs-3 {\n  font-size: 12px !important;\n\n  @include mq(sm) {\n    font-size: 14px !important;\n  }\n}\n\n@mixin fs-4 {\n  font-size: 14px !important;\n\n  @include mq(sm) {\n    font-size: 16px !important;\n  }\n}\n\n@mixin fs-5 {\n  font-size: 16px !important;\n\n  @include mq(sm) {\n    font-size: 18px !important;\n  }\n}\n\n@mixin fs-6 {\n  font-size: 18px !important;\n\n  @include mq(sm) {\n    font-size: 24px !important;\n  }\n}\n\n@mixin fs-7 {\n  font-size: 24px !important;\n\n  @include mq(sm) {\n    font-size: 32px !important;\n  }\n}\n\n@mixin fs-8 {\n  font-size: 32px !important;\n\n  @include mq(sm) {\n    font-size: 36px !important;\n  }\n}\n\n@mixin fs-9 {\n  font-size: 36px !important;\n\n  @include mq(sm) {\n    font-size: 42px !important;\n  }\n}\n\n@mixin fs-10 {\n  font-size: 42px !important;\n\n  @include mq(sm) {\n    font-size: 48px !important;\n  }\n}\n"
  },
  {
    "path": "docs/_sass/support/mixins/mixins.scss",
    "content": "@import \"./layout\";\n@import \"./buttons\";\n@import \"./typography\";\n"
  },
  {
    "path": "docs/_sass/support/support.scss",
    "content": "@import \"./variables\";\n@import \"./functions\";\n@import \"./mixins/mixins\";\n"
  },
  {
    "path": "docs/_sass/tables.scss",
    "content": "//\n// Tables\n//\n// stylelint-disable max-nesting-depth, selector-no-type, selector-max-type\n\ntable {\n  display: block;\n  width: 100%;\n  max-width: 100%;\n  margin-bottom: $sp-5;\n  overflow-x: auto;\n  border-collapse: separate;\n  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 14px rgba(0, 0, 0, 0.05);\n\n  @include mq(sm) {\n    display: table;\n  }\n}\n\nth,\ntd {\n  @include fs-3;\n  min-width: 120px;\n  padding-top: $sp-2;\n  padding-right: $sp-3;\n  padding-bottom: $sp-2;\n  padding-left: $sp-3;\n  background-color: lighten($body-background-color, 2%);\n  border-bottom: $border rgba($border-color, 0.5);\n  border-left: $border $border-color;\n\n  &:first-of-type {\n    border-left: 0;\n  }\n}\n\nthead,\ntbody:first-child {\n  tr {\n    &:first-of-type {\n      th,\n      td {\n        &:first-of-type {\n          border-top-left-radius: $border-radius;\n        }\n\n        &:last-of-type {\n          border-top-right-radius: $border-radius;\n        }\n      }\n    }\n  }\n}\n\ntbody {\n  tr {\n    &:last-of-type {\n      th,\n      td {\n        border-bottom: 0;\n\n        &:first-of-type {\n          border-bottom-left-radius: $border-radius;\n        }\n\n        &:last-of-type {\n          border-bottom-right-radius: $border-radius;\n        }\n      }\n    }\n  }\n}\n\nthead {\n  th {\n    border-bottom: 1px solid $border-color;\n  }\n}\n"
  },
  {
    "path": "docs/_sass/typography.scss",
    "content": "//\n// Typography\n//\n// stylelint-disable primer/selector-no-utility, selector-no-type, selector-max-type\n\nh1,\n.text-alpha {\n  @include fs-8;\n  font-weight: 300;\n}\n\nh2,\n.text-beta {\n  @include fs-6;\n}\n\nh3,\n.text-gamma {\n  @include fs-5;\n}\n\nh4,\n.text-delta {\n  @include fs-2;\n  font-weight: 300;\n  text-transform: uppercase;\n  letter-spacing: 0.1em;\n}\n\nh5,\n.text-epsilon {\n  @include fs-3;\n  color: $grey-dk-200;\n}\n\nh6,\n.text-zeta {\n  @include fs-2;\n  color: $grey-dk-200;\n}\n\nli {\n  .highlight {\n    margin-top: $sp-2;\n  }\n}\n\n.text-small {\n  @include fs-2;\n}\n\n.text-mono {\n  font-family: $mono-font-family !important;\n}\n\n.text-center {\n  text-align: center !important;\n}\n"
  },
  {
    "path": "docs/_sass/utilities/_colors.scss",
    "content": "//\n// Utility classes for colors\n//\n\n// Text colors\n\n.text-grey-dk-000 {\n  color: $grey-dk-000 !important;\n}\n\n.text-grey-dk-100 {\n  color: $grey-dk-100 !important;\n}\n\n.text-grey-dk-200 {\n  color: $grey-dk-200 !important;\n}\n\n.text-grey-dk-250 {\n  color: $grey-dk-250 !important;\n}\n\n.text-grey-dk-300 {\n  color: $grey-dk-300 !important;\n}\n\n.text-grey-lt-000 {\n  color: $grey-lt-000 !important;\n}\n\n.text-grey-lt-100 {\n  color: $grey-lt-100 !important;\n}\n\n.text-grey-lt-200 {\n  color: $grey-lt-200 !important;\n}\n\n.text-grey-lt-300 {\n  color: $grey-lt-300 !important;\n}\n\n.text-blue-000 {\n  color: $blue-000 !important;\n}\n\n.text-blue-100 {\n  color: $blue-100 !important;\n}\n\n.text-blue-200 {\n  color: $blue-200 !important;\n}\n\n.text-blue-300 {\n  color: $blue-300 !important;\n}\n\n.text-green-000 {\n  color: $green-000 !important;\n}\n\n.text-green-100 {\n  color: $green-100 !important;\n}\n\n.text-green-200 {\n  color: $green-200 !important;\n}\n\n.text-green-300 {\n  color: $green-300 !important;\n}\n\n.text-purple-000 {\n  color: $purple-000 !important;\n}\n\n.text-purple-100 {\n  color: $purple-100 !important;\n}\n\n.text-purple-200 {\n  color: $purple-200 !important;\n}\n\n.text-purple-300 {\n  color: $purple-300 !important;\n}\n\n.text-yellow-000 {\n  color: $yellow-000 !important;\n}\n\n.text-yellow-100 {\n  color: $yellow-100 !important;\n}\n\n.text-yellow-200 {\n  color: $yellow-200 !important;\n}\n\n.text-yellow-300 {\n  color: $yellow-300 !important;\n}\n\n.text-red-000 {\n  color: $red-000 !important;\n}\n\n.text-red-100 {\n  color: $red-100 !important;\n}\n\n.text-red-200 {\n  color: $red-200 !important;\n}\n\n.text-red-300 {\n  color: $red-300 !important;\n}\n\n// Background colors\n\n.bg-grey-dk-000 {\n  background-color: $grey-dk-000 !important;\n}\n\n.bg-grey-dk-100 {\n  background-color: $grey-dk-100 !important;\n}\n\n.bg-grey-dk-200 {\n  background-color: $grey-dk-200 !important;\n}\n\n.bg-grey-dk-250 {\n  background-color: $grey-dk-250 !important;\n}\n\n.bg-grey-dk-300 {\n  background-color: $grey-dk-300 !important;\n}\n\n.bg-grey-lt-000 {\n  background-color: $grey-lt-000 !important;\n}\n\n.bg-grey-lt-100 {\n  background-color: $grey-lt-100 !important;\n}\n\n.bg-grey-lt-200 {\n  background-color: $grey-lt-200 !important;\n}\n\n.bg-grey-lt-300 {\n  background-color: $grey-lt-300 !important;\n}\n\n.bg-blue-000 {\n  background-color: $blue-000 !important;\n}\n\n.bg-blue-100 {\n  background-color: $blue-100 !important;\n}\n\n.bg-blue-200 {\n  background-color: $blue-200 !important;\n}\n\n.bg-blue-300 {\n  background-color: $blue-300 !important;\n}\n\n.bg-green-000 {\n  background-color: $green-000 !important;\n}\n\n.bg-green-100 {\n  background-color: $green-100 !important;\n}\n\n.bg-green-200 {\n  background-color: $green-200 !important;\n}\n\n.bg-green-300 {\n  background-color: $green-300 !important;\n}\n\n.bg-purple-000 {\n  background-color: $purple-000 !important;\n}\n\n.bg-purple-100 {\n  background-color: $purple-100 !important;\n}\n\n.bg-purple-200 {\n  background-color: $purple-200 !important;\n}\n\n.bg-purple-300 {\n  background-color: $purple-300 !important;\n}\n\n.bg-yellow-000 {\n  background-color: $yellow-000 !important;\n}\n\n.bg-yellow-100 {\n  background-color: $yellow-100 !important;\n}\n\n.bg-yellow-200 {\n  background-color: $yellow-200 !important;\n}\n\n.bg-yellow-300 {\n  background-color: $yellow-300 !important;\n}\n\n.bg-red-000 {\n  background-color: $red-000 !important;\n}\n\n.bg-red-100 {\n  background-color: $red-100 !important;\n}\n\n.bg-red-200 {\n  background-color: $red-200 !important;\n}\n\n.bg-red-300 {\n  background-color: $red-300 !important;\n}\n"
  },
  {
    "path": "docs/_sass/utilities/_layout.scss",
    "content": "// stylelint-disable primer/selector-no-utility\n//\n// Utility classes for layout\n//\n\n// Display\n\n.d-block { display: block !important; }\n.d-flex { display: flex !important; }\n.d-inline { display: inline !important; }\n.d-inline-block { display: inline-block !important; }\n.d-none { display: none !important; }\n\n@each $media-query in map-keys($media-queries) {\n  @for $i from 1 through length($spacers) {\n    @include mq($media-query) {\n      $size: #{map-get($spacers, sp-#{$i - 1})};\n      $scale: #{$i - 1};\n\n      // .d-sm-block, .d-md-none, .d-lg-inline\n      .d-#{$media-query}-block { display: block !important; }\n      .d-#{$media-query}-flex { display: flex !important; }\n      .d-#{$media-query}-inline { display: inline !important; }\n      .d-#{$media-query}-inline-block { display: inline-block !important; }\n      .d-#{$media-query}-none { display: none !important; }\n\n    }\n  }\n}\n\n// Vertical alignment\n\n.v-align-baseline { vertical-align: baseline !important; }\n.v-align-bottom { vertical-align: bottom !important; }\n.v-align-middle { vertical-align: middle !important; }\n.v-align-text-bottom { vertical-align: text-bottom !important; }\n.v-align-text-top { vertical-align: text-top !important; }\n.v-align-top { vertical-align: top !important; }\n"
  },
  {
    "path": "docs/_sass/utilities/_lists.scss",
    "content": "//\n// Utility classes for lists\n//\n\n// stylelint-disable primer/selector-no-utility\n\n.list-style-none {\n  padding: 0 !important;\n  margin: 0 !important;\n  list-style: none !important;\n}\n"
  },
  {
    "path": "docs/_sass/utilities/_spacing.scss",
    "content": "//\n// Utility classes for margins and padding\n//\n\n// scss-lint:disable SpaceAfterPropertyName\n// stylelint-disable block-opening-brace-space-after, block-opening-brace-space-before, primer/selector-no-utility\n\n// Margin spacer utilities\n\n@for $i from 1 through length($spacers) {\n  $size: #{map-get($spacers, sp-#{$i - 1})};\n  $scale: #{$i - 1};\n\n  // .m-0, .m-1, .m-2...\n  .m-#{$scale}  { margin: #{$size} !important; }\n  .mt-#{$scale} { margin-top: #{$size} !important; }\n  .mr-#{$scale} { margin-right: #{$size} !important; }\n  .mb-#{$scale} { margin-bottom: #{$size} !important; }\n  .ml-#{$scale} { margin-left: #{$size} !important; }\n\n  .mx-#{$scale} {\n    margin-right: #{$size} !important;\n    margin-left: #{$size} !important;\n  }\n\n  .my-#{$scale} {\n    margin-top: #{$size} !important;\n    margin-bottom: #{$size} !important;\n  }\n\n  .mxn-#{$scale} {\n    margin-right: -#{$size} !important;\n    margin-left: -#{$size} !important;\n  }\n}\n\n.mx-auto {\n  margin-right: auto !important;\n  margin-left: auto !important;\n}\n\n@each $media-query in map-keys($media-queries) {\n  @for $i from 1 through length($spacers) {\n    @include mq($media-query) {\n      $size: #{map-get($spacers, sp-#{$i - 1})};\n      $scale: #{$i - 1};\n\n      // .m-sm-0, .m-md-1, .m-lg-2...\n      .m-#{$media-query}-#{$scale}  { margin: #{$size} !important; }\n      .mt-#{$media-query}-#{$scale} { margin-top: #{$size} !important; }\n      .mr-#{$media-query}-#{$scale} { margin-right: #{$size} !important; }\n      .mb-#{$media-query}-#{$scale} { margin-bottom: #{$size} !important; }\n      .ml-#{$media-query}-#{$scale} { margin-left: #{$size} !important; }\n\n      .mx-#{$media-query}-#{$scale} {\n        margin-right: #{$size} !important;\n        margin-left: #{$size} !important;\n      }\n\n      .my-#{$media-query}-#{$scale} {\n        margin-top: #{$size} !important;\n        margin-bottom: #{$size} !important;\n      }\n\n      .mxn-#{$media-query}-#{$scale} {\n        margin-right: -#{$size} !important;\n        margin-left: -#{$size} !important;\n      }\n    }\n  }\n}\n\n// Padding spacer utilities\n\n@for $i from 1 through length($spacers) {\n  $size: #{map-get($spacers, sp-#{$i - 1})};\n  $scale: #{$i - 1};\n\n  // .p-0, .p-1, .p-2...\n  .p-#{$scale}  { padding: #{$size} !important; }\n  .pt-#{$scale} { padding-top: #{$size} !important; }\n  .pr-#{$scale} { padding-right: #{$size} !important; }\n  .pb-#{$scale} { padding-bottom: #{$size} !important; }\n  .pl-#{$scale} { padding-left: #{$size} !important; }\n\n  .px-#{$scale} {\n    padding-right: #{$size} !important;\n    padding-left: #{$size} !important;\n  }\n\n  .py-#{$scale} {\n    padding-top: #{$size} !important;\n    padding-bottom: #{$size} !important;\n  }\n}\n\n@each $media-query in map-keys($media-queries) {\n  @include mq($media-query) {\n    @for $i from 1 through length($spacers) {\n      $size: #{map-get($spacers, sp-#{$i - 1})};\n      $scale: #{$i - 1};\n\n      // .p-sm-0, .p-md-1, .p-lg-2...\n      .p-#{$media-query}-#{$scale}  { padding: #{$size} !important; }\n      .pt-#{$media-query}-#{$scale} { padding-top: #{$size} !important; }\n      .pr-#{$media-query}-#{$scale} { padding-right: #{$size} !important; }\n      .pb-#{$media-query}-#{$scale} { padding-bottom: #{$size} !important; }\n      .pl-#{$media-query}-#{$scale} { padding-left: #{$size} !important; }\n\n      .px-#{$media-query}-#{$scale} {\n        padding-right: #{$size} !important;\n        padding-left: #{$size} !important;\n      }\n\n      .py-#{$media-query}-#{$scale} {\n        padding-top: #{$size} !important;\n        padding-bottom: #{$size} !important;\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "docs/_sass/utilities/_typography.scss",
    "content": "//\n// Utility classes for typography\n//\n\n// stylelint-disable primer/selector-no-utility\n\n.fs-1 {\n  @include fs-1;\n}\n\n.fs-2 {\n  @include fs-2;\n}\n\n.fs-3 {\n  @include fs-3;\n}\n\n.fs-4 {\n  @include fs-4;\n}\n\n.fs-5 {\n  @include fs-5;\n}\n\n.fs-6 {\n  @include fs-6;\n}\n\n.fs-7 {\n  @include fs-7;\n}\n\n.fs-8 {\n  @include fs-8;\n}\n\n.fs-9 {\n  @include fs-9;\n}\n\n.fs-10 {\n  @include fs-10;\n}\n\n.fw-300 {\n  font-weight: 300 !important;\n}\n\n.fw-400 {\n  font-weight: 400 !important;\n}\n\n.fw-500 {\n  font-weight: 500 !important;\n}\n\n.fw-700 {\n  font-weight: 700 !important;\n}\n\n.lh-0 {\n  line-height: 0 !important;\n}\n\n.lh-default {\n  line-height: $body-line-height;\n}\n\n.lh-tight {\n  line-height: $body-heading-line-height;\n}\n\n.ls-5 {\n  letter-spacing: 0.05em !important;\n}\n\n.ls-10 {\n  letter-spacing: 0.1em !important;\n}\n\n.ls-0 {\n  letter-spacing: 0 !important;\n}\n\n.text-uppercase {\n  text-transform: uppercase !important;\n}\n\n// stylelint-enable primer/selector-no-utility\n"
  },
  {
    "path": "docs/_sass/utilities/utilities.scss",
    "content": "@import \"./colors\";\n@import \"./layout\";\n@import \"./typography\";\n@import \"./lists\";\n@import \"./spacing\";\n"
  },
  {
    "path": "docs/_sass/vendor/normalize.scss/README.md",
    "content": "# normalize.scss v0.1.0\n\nNormalize.scss is the SCSS version of [normalize.css](http://necolas.github.io/normalize.css), a customisable CSS file that makes browsers render all elements more consistently and in line with modern standards.\n\n[View the normalize.css test file](http://necolas.github.io/normalize.css/latest/test.html)\n\n## Install\n\n* [npm](http://npmjs.org/): `npm install --save normalize.scss`\n* [Component(1)](https://github.com/component/component/): `component install guerrero/normalize.scss`\n* [Bower](http://bower.io/): `bower install --save normalize.scss`\n* Download: Go to [this link](https://raw.githubusercontent.com/guerrero/normalize.scss/master/normalize.scss), press right-click on the page and choose \"Save as...\"\n\nNo other styles should come before Normalize.scss.\n\nIt's recommendable to modify `normalize.scss` to suit it to your project\n\n## What does it do?\n\n* Preserves useful defaults, unlike many CSS resets.\n* Normalizes styles for a wide range of elements.\n* Corrects bugs and common browser inconsistencies.\n* Improves usability with subtle improvements.\n* Explains what code does using detailed comments.\n\n## Browser support\n\n* Google Chrome (latest)\n* Mozilla Firefox (latest)\n* Mozilla Firefox 4\n* Opera (latest)\n* Apple Safari 6+\n* Internet Explorer 8+\n\n[Normalize.css v1 provides legacy browser\nsupport](https://github.com/necolas/normalize.css/tree/v1) (IE 6+, Safari 4+),\nbut is no longer actively developed.\n\n## Extended details\n\nAdditional detail and explanation of the esoteric parts of normalize.css.\n\n#### `pre, code, kbd, samp`\n\nThe `font-family: monospace, monospace` hack fixes the inheritance and scaling\nof font-size for preformated text. The duplication of `monospace` is\nintentional.  [Source](http://en.wikipedia.org/wiki/User:Davidgothberg/Test59).\n\n#### `sub, sup`\n\nNormally, using `sub` or `sup` affects the line-box height of text in all\nbrowsers. [Source](http://gist.github.com/413930).\n\n#### `svg:not(:root)`\n\nAdding `overflow: hidden` fixes IE9's SVG rendering. Earlier versions of IE\ndon't support SVG, so we can safely use the `:not()` and `:root` selectors that\nmodern browsers use in the default UA stylesheets to apply this style. [SVG\nMailing List discussion](http://lists.w3.org/Archives/Public/public-svg-wg/2008JulSep/0339.html)\n\n#### `input[type=\"search\"]`\n\nThe search input is not fully stylable by default. In Chrome and Safari on\nOSX/iOS you can't control `font`, `padding`, `border`, or `background`. In\nChrome and Safari on Windows you can't control `border` properly. It will apply\n`border-width` but will only show a border color (which cannot be controlled)\nfor the outer 1px of that border. Applying `-webkit-appearance: textfield`\naddresses these issues without removing the benefits of search inputs (e.g.\nshowing past searches).\n\n#### `legend`\n\nAdding `border: 0` corrects an IE 8–11 bug where `color` (yes, `color`) is not\ninherited by `legend`.\n\n## Acknowledgements\n\nNormalize.scss is a project by [Alex Guerrero](https://github.com/guerrero) based on [normalize.css](http://necolas.github.io/normalize.css) from [Nicolas Gallagher](https://github.com/necolas), co-created with [Jonathan Neal](https://github.com/jonathantneal).\n"
  },
  {
    "path": "docs/_sass/vendor/normalize.scss/normalize.scss",
    "content": "/*! normalize.scss v0.1.0 | MIT License | based on git.io/normalize */\n\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS text size adjust after orientation change, without disabling\n *    user zoom.\n */\n\nhtml {\n  font-family: sans-serif; /* 1 */\n  -ms-text-size-adjust: 100%; /* 2 */\n  -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/**\n * Remove default margin.\n */\n\nbody {\n  margin: 0;\n}\n\n/* HTML5 display definitions\n   ========================================================================== */\n\n/**\n * Correct `block` display not defined for any HTML5 element in IE 8/9.\n * Correct `block` display not defined for `details` or `summary` in IE 10/11\n * and Firefox.\n * Correct `block` display not defined for `main` in IE 11.\n */\n\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nmenu,\nnav,\nsection,\nsummary {\n  display: block;\n}\n\n/**\n * 1. Correct `inline-block` display not defined in IE 8/9.\n * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.\n */\n\naudio,\ncanvas,\nprogress,\nvideo {\n  display: inline-block; /* 1 */\n  vertical-align: baseline; /* 2 */\n}\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n\naudio:not([controls]) {\n  display: none;\n  height: 0;\n}\n\n/**\n * Address `[hidden]` styling not present in IE 8/9/10.\n * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.\n */\n\n[hidden],\ntemplate {\n  display: none;\n}\n\n/* Links\n   ========================================================================== */\n\n/**\n * Remove the gray background color from active links in IE 10.\n */\n\na {\n  background-color: transparent;\n}\n\n/**\n * Improve readability when focused and also mouse hovered in all browsers.\n */\n\na:active,\na:hover {\n  outline: 0;\n}\n\n/* Text-level semantics\n   ========================================================================== */\n\n/**\n * Address styling not present in IE 8/9/10/11, Safari, and Chrome.\n */\n\nabbr[title] {\n  border-bottom: 1px dotted;\n}\n\n/**\n * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.\n */\n\nb,\nstrong {\n  font-weight: bold;\n}\n\n/**\n * Address styling not present in Safari and Chrome.\n */\n\ndfn {\n  font-style: italic;\n}\n\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari, and Chrome.\n */\n\nh1 {\n  font-size: 2em;\n  margin: 0.67em 0;\n}\n\n/**\n * Address styling not present in IE 8/9.\n */\n\nmark {\n  background: #ff0;\n  color: #000;\n}\n\n/**\n * Address inconsistent and variable font size in all browsers.\n */\n\nsmall {\n  font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\n\nsub,\nsup {\n  font-size: 75%;\n  line-height: 0;\n  position: relative;\n  vertical-align: baseline;\n}\n\nsup {\n  top: -0.5em;\n}\n\nsub {\n  bottom: -0.25em;\n}\n\n/* Embedded content\n   ========================================================================== */\n\n/**\n * Remove border when inside `a` element in IE 8/9/10.\n */\n\nimg {\n  border: 0;\n}\n\n/**\n * Correct overflow not hidden in IE 9/10/11.\n */\n\nsvg:not(:root) {\n  overflow: hidden;\n}\n\n/* Grouping content\n   ========================================================================== */\n\n/**\n * Address margin not present in IE 8/9 and Safari.\n */\n\nfigure {\n  margin: 1em 40px;\n}\n\n/**\n * Address differences between Firefox and other browsers.\n */\n\nhr {\n  -moz-box-sizing: content-box;\n  box-sizing: content-box;\n  height: 0;\n}\n\n/**\n * Contain overflow in all browsers.\n */\n\npre {\n  overflow: auto;\n}\n\n/**\n * Address odd `em`-unit font size rendering in all browsers.\n */\n\ncode,\nkbd,\npre,\nsamp {\n  font-family: monospace, monospace;\n  font-size: 1em;\n}\n\n/* Forms\n   ========================================================================== */\n\n/**\n * Known limitation: by default, Chrome and Safari on OS X allow very limited\n * styling of `select`, unless a `border` property is set.\n */\n\n/**\n * 1. Correct color not being inherited.\n *    Known issue: affects color of disabled elements.\n * 2. Correct font properties not being inherited.\n * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n  color: inherit; /* 1 */\n  font: inherit; /* 2 */\n  margin: 0; /* 3 */\n}\n\n/**\n * Address `overflow` set to `hidden` in IE 8/9/10/11.\n */\n\nbutton {\n  overflow: visible;\n}\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.\n * Correct `select` style inheritance in Firefox.\n */\n\nbutton,\nselect {\n  text-transform: none;\n}\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n *    and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n *    `input` and others.\n */\n\nbutton,\nhtml input[type=\"button\"], /* 1 */\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n  -webkit-appearance: button; /* 2 */\n  cursor: pointer; /* 3 */\n}\n\n/**\n * Re-set default cursor for disabled elements.\n */\n\nbutton[disabled],\nhtml input[disabled] {\n  cursor: default;\n}\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n  border: 0;\n  padding: 0;\n}\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\n\ninput {\n  line-height: normal;\n}\n\n/**\n * It's recommended that you don't attempt to style these elements.\n * Firefox's implementation doesn't respect box-sizing, padding, or width.\n *\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n  box-sizing: border-box; /* 1 */\n  padding: 0; /* 2 */\n}\n\n/**\n * Fix the cursor style for Chrome's increment/decrement buttons. For certain\n * `font-size` values of the `input`, it causes the cursor style of the\n * decrement button to change from `default` to `text`.\n */\n\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n  height: auto;\n}\n\n/**\n * 1. Address `appearance` set to `searchfield` in Safari and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari and Chrome\n *    (include `-moz` to future-proof).\n */\n\ninput[type=\"search\"] {\n  -webkit-appearance: textfield; /* 1 */\n  -moz-box-sizing: content-box;\n  -webkit-box-sizing: content-box; /* 2 */\n  box-sizing: content-box;\n}\n\n/**\n * Remove inner padding and search cancel button in Safari and Chrome on OS X.\n * Safari (but not Chrome) clips the cancel button when the search input has\n * padding (and `textfield` appearance).\n */\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n  -webkit-appearance: none;\n}\n\n/**\n * Define consistent border, margin, and padding.\n */\n\nfieldset {\n  border: 1px solid #c0c0c0;\n  margin: 0 2px;\n  padding: 0.35em 0.625em 0.75em;\n}\n\n/**\n * 1. Correct `color` not being inherited in IE 8/9/10/11.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\n\nlegend {\n  border: 0; /* 1 */\n  padding: 0; /* 2 */\n}\n\n/**\n * Remove default vertical scrollbar in IE 8/9/10/11.\n */\n\ntextarea {\n  overflow: auto;\n}\n\n/**\n * Don't inherit the `font-weight` (applied by a rule above).\n * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.\n */\n\noptgroup {\n  font-weight: bold;\n}\n\n/* Tables\n   ========================================================================== */\n\n/**\n * Remove most spacing between table cells.\n */\n\ntable {\n  border-collapse: collapse;\n  border-spacing: 0;\n}\n\ntd,\nth {\n  padding: 0;\n}\n"
  },
  {
    "path": "docs/_sass/vendor/normalize.scss/package.json",
    "content": "{\n  \"_args\": [\n    [\n      \"normalize.scss\",\n      \"/Users/pmarsceill/_projects/just-the-docs\"\n    ]\n  ],\n  \"_from\": \"normalize.scss@*\",\n  \"_id\": \"normalize.scss@0.1.0\",\n  \"_inCache\": true,\n  \"_installable\": true,\n  \"_location\": \"/normalize.scss\",\n  \"_nodeVersion\": \"0.10.32\",\n  \"_npmUser\": {\n    \"email\": \"alexguerrero1092@gmail.com\",\n    \"name\": \"alexguerrero\"\n  },\n  \"_npmVersion\": \"2.0.2\",\n  \"_phantomChildren\": {},\n  \"_requested\": {\n    \"name\": \"normalize.scss\",\n    \"raw\": \"normalize.scss\",\n    \"rawSpec\": \"\",\n    \"scope\": null,\n    \"spec\": \"*\",\n    \"type\": \"range\"\n  },\n  \"_requiredBy\": [\n    \"#DEV:/\"\n  ],\n  \"_resolved\": \"https://registry.npmjs.org/normalize.scss/-/normalize.scss-0.1.0.tgz\",\n  \"_shasum\": \"4a21dc25bd4c019c857785f829b658aba2a8f9ab\",\n  \"_shrinkwrap\": null,\n  \"_spec\": \"normalize.scss\",\n  \"_where\": \"/Users/pmarsceill/_projects/just-the-docs\",\n  \"author\": \"\",\n  \"bugs\": {\n    \"url\": \"https://github.com/guerrero/normalize.scss/issues\"\n  },\n  \"dependencies\": {},\n  \"description\": \"Normalize.scss as a node packaged module\",\n  \"devDependencies\": {},\n  \"directories\": {},\n  \"dist\": {\n    \"shasum\": \"4a21dc25bd4c019c857785f829b658aba2a8f9ab\",\n    \"tarball\": \"https://registry.npmjs.org/normalize.scss/-/normalize.scss-0.1.0.tgz\"\n  },\n  \"files\": [\n    \"normalize.scss\"\n  ],\n  \"gitHead\": \"d67d517e28615a873066438af1d4845c157c9baf\",\n  \"homepage\": \"https://github.com/guerrero/normalize.scss\",\n  \"license\": \"MIT\",\n  \"maintainers\": [\n    {\n      \"name\": \"alexguerrero\",\n      \"email\": \"alexguerrero1092@gmail.com\"\n    }\n  ],\n  \"name\": \"normalize.scss\",\n  \"optionalDependencies\": {},\n  \"readme\": \"ERROR: No README data found!\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/guerrero/normalize.scss.git\"\n  },\n  \"scripts\": {},\n  \"style\": \"normalize.scss\",\n  \"version\": \"0.1.0\"\n}\n"
  },
  {
    "path": "docs/assets/css/dark-mode-preview.scss",
    "content": "---\n# this ensures Jekyll reads the file to be transformed into CSS later\n# only Main files contain this front matter, not partials.\n---\n\n//\n// Import external dependencies\n//\n\n@import \"./vendor/normalize.scss/normalize.scss\";\n\n//\n// Import Just the Docs scss\n//\n\n// Support\n@import \"./support/support\";\n\n//\n// Import custom color scheme scss\n//\n\n@import \"./color_schemes/dark.scss\";\n\n// Modules\n@import \"./base\";\n@import \"./layout\";\n@import \"./content\";\n@import \"./navigation\";\n@import \"./typography\";\n@import \"./labels\";\n@import \"./buttons\";\n@import \"./search\";\n@import \"./tables\";\n@import \"./code\";\n@import \"./utilities/utilities\";\n\n//\n// Import custom overrides\n//\n@import \"./custom/custom\";\n"
  },
  {
    "path": "docs/assets/css/just-the-docs.scss",
    "content": "---\n# this ensures Jekyll reads the file to be transformed into CSS later\n# only Main files contain this front matter, not partials.\n---\n\n//\n// Import external dependencies\n//\n\n@import \"./vendor/normalize.scss/normalize.scss\";\n\n//\n// Import Just the Docs scss\n//\n\n// Support\n@import \"./support/support\";\n\n//\n// Import custom color scheme scss\n//\n\n{% if site.color_scheme == \"dark\" %}\n@import \"./color_schemes/dark.scss\";\n{% endif %}\n\n// Modules\n@import \"./base\";\n@import \"./layout\";\n@import \"./content\";\n@import \"./navigation\";\n@import \"./typography\";\n@import \"./labels\";\n@import \"./buttons\";\n@import \"./search\";\n@import \"./tables\";\n@import \"./code\";\n@import \"./utilities/utilities\";\n\n//\n// Import custom overrides\n//\n@import \"./custom/custom\";\n"
  },
  {
    "path": "docs/assets/js/just-the-docs.js",
    "content": "// Event handling\n\nfunction addEvent(el, type, handler) {\n    if (el.attachEvent) el.attachEvent('on'+type, handler); else el.addEventListener(type, handler);\n}\nfunction removeEvent(el, type, handler) {\n    if (el.detachEvent) el.detachEvent('on'+type, handler); else el.removeEventListener(type, handler);\n}\n\n// Show/hide mobile menu\n\nfunction toggleNav(){\n  const nav = document.querySelector('.js-main-nav');\n  const auxNav = document.querySelector('.js-aux-nav');\n  const navTrigger = document.querySelector('.js-main-nav-trigger');\n  const search = document.querySelector('.js-search');\n\n  addEvent(navTrigger, 'click', function(){\n    var text = navTrigger.innerText;\n    var textToggle = navTrigger.getAttribute('data-text-toggle');\n\n    nav.classList.toggle('nav-open');\n    auxNav.classList.toggle('nav-open');\n    navTrigger.classList.toggle('nav-open');\n    search.classList.toggle('nav-open');\n    navTrigger.innerText = textToggle;\n    navTrigger.setAttribute('data-text-toggle', text);\n    textToggle = text;\n  })\n}\n\n// Site search\n\nfunction initSearch() {\n  var index = lunr(function () {\n    this.ref('id');\n    this.field('title', { boost: 20 });\n    this.field('content', { boost: 10 });\n    this.field('url');\n  });\n\n  // Get the generated search_data.json file so lunr.js can search it locally.\n\n  sc = document.getElementsByTagName(\"script\");\n  source = '';\n\n  for(idx = 0; idx < sc.length; idx++)\n  {\n    s = sc.item(idx);\n\n    if(s.src && s.src.match(/just-the-docs\\.js$/))\n    { source = s.src; }\n  }\n\n  jsPath = source.replace('just-the-docs.js', '');\n\n  jsonPath = jsPath + 'search-data.json';\n\n  var request = new XMLHttpRequest();\n  request.open('GET', jsonPath, true);\n\n  request.onload = function() {\n    if (request.status >= 200 && request.status < 400) {\n      // Success!\n      var data = JSON.parse(request.responseText);\n      var keys = Object.keys(data);\n\n      for(var i in data) {\n        index.add({\n          id: data[i].id,\n          title: data[i].title,\n          content: data[i].content,\n          url: data[i].url\n        });\n      }\n      searchResults(data);\n    } else {\n      // We reached our target server, but it returned an error\n      console.log('Error loading ajax request. Request status:' + request.status);\n    }\n  };\n\n  request.onerror = function() {\n    // There was a connection error of some sort\n    console.log('There was a connection error');\n  };\n\n  request.send();\n\n  function searchResults(dataStore) {\n    var searchInput = document.querySelector('.js-search-input');\n    var searchResults = document.querySelector('.js-search-results');\n    var store = dataStore;\n\n    function hideResults() {\n      searchResults.innerHTML = '';\n      searchResults.classList.remove('active');\n    }\n\n    addEvent(searchInput, 'keyup', function(e){\n      var query = this.value;\n\n      searchResults.innerHTML = '';\n      searchResults.classList.remove('active');\n\n      if (query === '') {\n        hideResults();\n      } else {\n        var results = index.search(query);\n\n        if (results.length > 0) {\n          searchResults.classList.add('active');\n          var resultsList = document.createElement('ul');\n          searchResults.appendChild(resultsList);\n\n          for (var i in results) {\n            var resultsListItem = document.createElement('li');\n            var resultsLink = document.createElement('a');\n            var resultsUrlDesc = document.createElement('span');\n            var resultsUrl = store[results[i].ref].url;\n            var resultsRelUrl = store[results[i].ref].relUrl;\n            var resultsTitle = store[results[i].ref].title;\n\n            resultsLink.setAttribute('href', resultsUrl);\n            resultsLink.innerText = resultsTitle;\n            resultsUrlDesc.innerText = resultsRelUrl;\n\n            resultsList.classList.add('search-results-list');\n            resultsListItem.classList.add('search-results-list-item');\n            resultsLink.classList.add('search-results-link');\n            resultsUrlDesc.classList.add('fs-2','text-grey-dk-000','d-block');\n\n            resultsList.appendChild(resultsListItem);\n            resultsListItem.appendChild(resultsLink);\n            resultsLink.appendChild(resultsUrlDesc);\n          }\n        }\n\n        // When esc key is pressed, hide the results and clear the field\n        if (e.keyCode == 27) {\n          hideResults();\n          searchInput.value = '';\n        }\n      }\n    });\n\n    addEvent(searchInput, 'blur', function(){\n      setTimeout(function(){ hideResults() }, 300);\n    });\n  }\n}\n\nfunction pageFocus() {\n  var mainContent = document.querySelector('.js-main-content');\n  mainContent.focus();\n  console.log(mainContent)\n}\n\n\n// Document ready\n\nfunction ready(){\n  toggleNav();\n  pageFocus();\n  if (typeof lunr !== 'undefined') {\n    initSearch();\n  }\n}\n\n// in case the document is already rendered\nif (document.readyState!='loading') ready();\n// modern browsers\nelse if (document.addEventListener) document.addEventListener('DOMContentLoaded', ready);\n// IE <= 8\nelse document.attachEvent('onreadystatechange', function(){\n    if (document.readyState=='complete') ready();\n});\n"
  },
  {
    "path": "docs/assets/js/search-data.json",
    "content": "---\n---\n{\n  {% for page in site.html_pages %}{% if page.search_exclude != true %}\"{{ forloop.index0 }}\": {\n    \"id\": \"{{ forloop.index0 }}\",\n    \"title\": \"{{ page.title | replace: '&amp;', '&' }}\",\n    \"content\": \"{{ page.content | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```'  | remove: '---' | replace: '\\', ' ' | normalize_whitespace }}\",\n    \"url\": \"{{ page.url | absolute_url }}\",\n    \"relUrl\": \"{{ page.url }}\"\n  }{% unless forloop.last %},{% endunless %}\n  {% endif %}{% endfor %}\n}\n"
  },
  {
    "path": "docs/bin/just-the-docs",
    "content": "#!/usr/bin/env ruby\n\ngem_dir = File.expand_path(\"..\",File.dirname(__FILE__))\n$LOAD_PATH.unshift gem_dir # Look in gem directory for resources first.\nexec_type = ARGV[0]\n\nif exec_type == 'rake' then\n    require 'rake'\n    require 'pp'\n    pwd=Dir.pwd\n    Dir.chdir(gem_dir) # We'll load rakefile from the gem's dir.\n    Rake.application.init\n    Rake.application.load_rakefile\n    Dir.chdir(pwd) # Revert to original pwd for any path args passed to task.\n    Rake.application.invoke_task(ARGV[1])\nend\n"
  },
  {
    "path": "docs/docs/developing-on-QGIS-using-OSGeo4Mac.md",
    "content": "---\nlayout: default\ntitle: Developing on QGIS using OSGeo4Mac\nnav_order: 4\n---\n\n# Developing on QGIS using OSGeo4Mac\n\nIn addition to using this tap to install a [QGIS stable formula](https://github.com/OSGeo/homebrew-osgeo4mac/tree/master/Formula), you can also use it to fully set up a development environment for an externally built QGIS from a clone of the current [development (master) branch](https://github.com/qgis/QGIS) of the source code tree.\n\n> Note: This setup, though heavily tested, is currently _experimental_ and may change. A more stable and time-tested setup is outlined in the QGIS [INSTALL](https://github.com/qgis/QGIS/blob/master/INSTALL) document.\n\n## Development Tools\n\nThis tutorial is based upon using the following open source software:\n* [Qt Creator](http://qt-project.org/downloads) for CMake/C++ development ([core source](https://github.com/qgis/QGIS/tree/master/src) and [plugins](https://github.com/qgis/QGIS/tree/master/src/plugins))\n* [PyCharm Community Edition](http://www.jetbrains.com/pycharm/download/) for Python development ([PyQGIS plugins/apps](http://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/), [Python unit tests](https://github.com/qgis/QGIS/tree/master/tests/src/python), [reStructuredText for documentation](https://github.com/qgis/QGIS-Documentation)).\n\nMac OS X [XCode](https://developer.apple.com/xcode/downloads/) and [Command Line Tools](http://stackoverflow.com/questions/9329243), for Homebrew and building QGIS source. QGIS's [CMake](http://www.cmake.org) build process uses generated Makefiles for building QGIS source directly with `clang`, _not via Xcode project files_, i.e. Xcode.app is not needed for compiling.\n\n## Install Homebrew\n\nSee http://brew.sh and [homebrew/wiki/Installation](https://github.com/Homebrew/homebrew/wiki/Installation)\n\nDefault install method:\n```sh\nruby -e \"$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)\"\nbrew update\n\nbrew doctor # <-- and fix everything that it mentions, if you can\n```\n\n### Homebrew Prefix\n\nWhile all of the formulae and scripts support building QGIS using a Homebrew non-standard prefix, e.g. `/opt/osgeo4mac`, do yourself a favor (especially if new to Homebrew) and [install in the default directory of `/usr/local`](https://github.com/Homebrew/homebrew/wiki/Installation). QGIS has many dependencies which are available as [\"bottles\"](https://github.com/Homebrew/homebrew/wiki/Bottles) (pre-built binary installs) from the Homebrew project. Installing Homebrew to a non-standard prefix will force many of the bottled formulae to be built from source, since many of the available bottles are built specific to `/usr/local`. Such unnecessary building can comparatively take hours and hours more, depending upon your available CPU cores.\n\nIf desired, this setup supports builds where the OSGeo4Mac deps are in a non-standard Homebrew location, e.g. `/usr/local/osgeo4mac` or `/opt/osgeo4mac`, instead of `/usr/local`. This allows for multiple build scenarios, including placing the dependencies on an external drive, though that requires building all deps with special 'bottle' parameters (see advanced utility [`brew stack`](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/cmd/brew-stack.rb) and its [command line completion](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/etc/bash_completion.d/brew_stack_completion.sh)).\n\n### Install Some Basic Formulae\n\n```\nbrew install bash-completion\nbrew install git\n```\n\n## Install Python Dependencies\n\nThe first important decision to make is regarding whether to use Homebrew's or the OS X system Python. QGIS currently only supports Python 2.5-2.7. Newer Mac system's (>= 10.7) have a version of Python 2.7 installed, so using Homebrew's is unnecessary. However, the more formulae you install, the higher likelihood you will end up running into a formulae that requires installing Homebrew's Python.\n\n> **Important Note:** If you intend to also have the latest [stable version of QGIS and its supporting frameworks from Kyngchaos.com](http://www.kyngchaos.com/software/qgis) installed concurrently with a separate master build of QGIS, it is _highly recommended_ you use Homebrew's Python, since it will allow you to isolate some Python dependencies that may cause crashes, namely modules that link to different supporting libraries. For example, the `osgeo.gdal` and `osgeo.ogr` modules referenced by `/Library/Python/2.7/site-packages/gdal-py2.7.pth` will link to `/Library/Frameworks/GDAL.framework` components instead of to Homebrew's `gdal` formula install.\n\nIf using Homebrew Python 2.7, install with:\n\n```sh\nbrew info python # review options\nbrew install python # [--with-option ...]\n```\n\nInstall required Python modules:\n\n* [numpy](https://pypi.python.org/pypi/numpy), [psycopg2](https://pypi.python.org/pypi/psycopg2), [matplotlib](https://pypi.python.org/pypi/matplotlib), [pyparsing](https://pypi.python.org/pypi/pyparsing)\n\nUse [pip](https://pypi.python.org/pypi/pip/1.5.6) with OS X system Python or Homebrew's pip, installed with its Python. You can also tap [homebrew/python](https://github.com/Homebrew/homebrew-python) for some more complex module installs.\n\n_Note:_ a version of NumPy is also vendored (installed internally to keg) by [gdal](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/gdal.rb), if building `--with-python` option, which is the default. You will also want to install a copy to the base `site-packages` for your Python.\n\nOther Python modules installed automatically by Homebrew in next step:\n\n* [sip](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/sip.rb), [PyQt4](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/pyqt.rb), [QScintilla2](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/qscintilla2.rb), [pyspatialite](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/Formula/pyspatialite.rb) (supports libspatialite 4.x), [`osgeo.gdal` and `osgeo.ogr`, etc.](https://github.com/Homebrew/homebrew/blob/master/Library/Formula/gdal.rb)\n\n## Install Build and Linked Library Dependencies\n\n> Note: substitute **`qgis-xx`** for whatever is the [latest stable version of QGIS's formula](https://github.com/OSGeo/homebrew-osgeo4mac/tree/master/Formula), e.g. `qgis-24`.\n\n```sh\nbrew tap homebrew/science\nbrew tap osgeo/osgeo4mac\nbrew info qgis-xx # review options\nbrew deps --tree qgis-xx --with-grass --with-globe [--with-some-option ...] # to see what dependencies will be included\nbrew install qgis-xx --only-dependencies --with-grass --with-globe [--with-some-option ...]\n```\n\nYou do not have to actually do `brew install qgis-xx` unless you also want the stable version installed. If you do have other QGIS formulae installed, and are planning on _installing_ your development build (not just running from the build directory), you should unlink the formula(e) installs, e.g.:\n\n```sh\nbrew unlink qgis-xx\n```\nThis will ensure the `qgis.core`, etc. Python modules of the formula(e) installs are not overwritten by the development build upon `make install`. All `qgis-xx` formulae QGIS applications will run just fine from their Cellar keg install directory. _Careful_, though, as multiple QGIS installs will probably all share the same application preference files; so, don't run them concurrently.\n\nThe `--enable-isolation` option is specific to the `qgis-xx` formulae install, but will have the effect of forcing the use of Homebrew's Python. If you intend to isolate your development build, you can just add `--enable-isolation` when building dependencies, then install the noted required Python modules after the dependencies are built.\n\n### Optional External Dependencies\n\nThe [Processing framework](http://docs.qgis.org/testing/en/docs/user_manual/processing/index.html) of QGIS can leverage many external geospatial applications and utilities, which _do not_ need to be built as dependencies prior to building QGIS:\n\n* [`grass-70`](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/Formula/grass-70.rb) (`--with-grass7` option) - [GRASS 7](http://grass.osgeo.org), which is not used by the current GRASS toolbar utility in QGIS (that's GRASS 6)\n* [`orfeo-40`](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/Formula/orfeo-40.rb) (`--with-orfeo` option) - [Orfeo Toolbox](http://orfeo-toolbox.org/otb/)\n* [`r`](http://www.r-project.org/) (`--with-r` option) - [R Project](http://www.r-project.org/)\n* [`saga-gis`](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/Formula/saga-gis.rb) (`--with-saga-gis` option) - [System for Automated Geoscientific Analyses](http://www.saga-gis.org)\n* [`taudem`](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/Formula/taudem.rb) - [Terrain Analysis Using Digital Elevation Models](http://hydrology.usu.edu/taudem/taudem5/index.html).\n\nThe `gpsbabel` formula is installed as a dependency, though you may have to define the path to its binary when using QGIS's [GPS Tools](http://docs.qgis.org/testing/en/docs/user_manual/working_with_gps/plugins_gps.html).\n\n## Clone QGIS Source\n\nSee the QGIS [INSTALL](https://github.com/qgis/QGIS/blob/master/INSTALL) document for information on using git to clone the source tree.\n\nQGIS's build setup uses CMake, which supports 'out-of-source' build directories. It is recommended to create a separate build directory, either within the source tree, or outside it. Since the (re)build process can generate _many_ files, consider creating a separate partition on which to place the build directory. Such a setup can significantly reduce fragmentation on your main startup drive.\n\n## Customize Build Scripts\n\nThis tap offers several convenience scripts for use in Qt Creator, or wrapper build scripts, to aid in building/installing QGIS, located at:\n\n```\nHOMEBREW_PREFIX/Library/Taps/osgeo/homebrew-osgeo4mac/scripts\n```\n\n> Note: **Copy the directory elsewhere** and use it from there. It's important to not edit the scripts where they are located, in the tap, because it is a git repo. You should keep that working tree clean so that `brew update` always works.\n\nThe scripts will be used when configuring the QGIS project in Qt Creator.\n\n### Open and review scripts:\n\n> Note: scripts expect the HOMEBREW_PREFIX environment variable to be set, e.g. in your .bash_profile:\n\n  ```bash\n  export HOMEBREW_PREFIX=/usr/local\n  ```\n\n* [qgis-cmake-options.py](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/scripts/qgis-cmake-options.py) - For generating CMake option string for use in Qt Creator (or build scripts) when built off dependencies from `homebrew-osgeo4mac` tap. Edit CMake options to suit your build needs. Note, the current script usually has CMake options for building QGIS with *all* options that the current `qgis-xx` Homebrew formula supports, which can include things like Oracle support, etc. You will probably want to edit it and comment out such lines for an initial build.\n\n* [qgis-set-app-env.py](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/scripts/qgis-set-app-env.py) - For setting env vars in dev build and installed QGIS.app, to ensure they are available on double-click run. _Needs to stay in the same directory as the next scripts._\n\n* [qgis-creator-build.sh](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/scripts/qgis-creator-build.sh) - Sets up the build environ and ensures the QGIS.app in the build directory can find resources, so it can run from there.\n\n* [qgis-creator-install.sh](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/scripts/qgis-creator-install.sh) - Installs the app and ensures QGIS.app has proper environment variables, so it can be moved around on the filesystem. Currently, QGIS.app bundling beyond [QGIS_MACAPP_BUNDLE=0](https://github.com/qgis/QGIS/tree/master/mac) is not supported. Since all dependencies are in your `HOMEBREW_PREFIX`, no complex bundling is necessary, unless you intend to relocate the built app to another Mac.\n\n### Other Scripts\n\n* [enviro/python_startup.py](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/enviro/python_startup.py) - Strips from Python's `sys.path` any entry that starts with `/Library`, which ensures a Homebrew Python or concurrent install with Kyngchaos's stable is not pulling in conflicting modules from `/Library/Python/2.7/site-packages` or `/Library/Frameworks`. It is not intended to be edited or copied outside of the tap's path, but can be, if you also update the build scripts.\n\n* [enviro/osgeo4mac.env](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/enviro/osgeo4mac.env) - Is a file intended to be sourced in your bash shell to set up an environment for working with a OSGeo4Mac-enabled Homebrew install. Read the comments at the beginning of the file, and consider adding a custom `~/.osgeo4mac.env` to set things like EDITOR, HOMEBREW_GITHUB_API_TOKEN, and other HOMEBREW_* variables.\n\n## Configure \"Build and Run\" Preferences in Qt Creator\n\n* Define Homebrew's Qt as an available version:\n\n* Define a new Kit that uses Homebrew's Qt\n\n  If the Xcode Command Line Tools are installed properly, and on Mac OS X 10.9, the LLDB debugger should be found. If not, you may have to locate it.\n\n  If using `clang` and on Mac OS X 10.9, with Qt 4.8.6, you may need to set the Qt mkspec to `unsupported/macx-clang-libc++` due to [changes in the underlying standard C++ libraries](https://github.com/Homebrew/homebrew/wiki/C++-Standard-Libraries). This is not necessary for building QGIS, since it uses CMake. It is important for projects that use the same kit, but build using `qmake`.\n\n* If you installed to a non-standard HOMEBREW_PREFIX, you may have to browse and set the path to the `cmake` executable.\n\n## Open QGIS Source Code as Project in Qt Creator\n\n* Select `File -> Open File or Project...` and browse/open `/path/to/source/of/QGIS/CMakeLists.txt` which opens the CMake Wizard:\n\n* Run `qgis-cmake-options.py` (ensure HOMEBREW_PREFIX environment variable is set) and paste the result in the **Arguments:** field.\n\n* Generate the Unix Makefiles. If there are errors, they will have to be resolved, or the project can not be initialized and opened.\n\n## Configure Project in Qt Creator\n\nOnce the project has been initialized, you need to set up the build steps for the QGIS source. While the scripts are not necessary, they reduce the number of build steps needed and simplify building QGIS outside of Qt Creator as well. If you forgo the scripts, you will need to investigate them in order to help set up your own custom build steps.\n\n* Configure project with environment variables and to use the build and install scripts:\n\n  The `make staged-plugins-pyc` (`-j #` is the number of available CPU cores) command stages/installs the core Python plugins to the build directory, so you can run QGIS.app directly from there, without having to run `make install`. It is a separate step to limit what needs rebuilt when editing on core files, which only require rebuilding with the build script once the core plugins have been staged. There is no need to re-stage the core plugins unless something about them has changed.\n\n  * Environment variables\n\n    * **`HOMEBREW_PREFIX`** is referenced and required by the build scripts.\n    * **`PATH`** is manually prepended with your `HOMEBREW_PREFIX` (Qt Creator doesn't expand user-set variables). Allows the build process to find required executables, like `sip`.\n    * **`PYTHONHOME`**, if using Homebrew's Python, is set to the Current Python framework, manually prepended with your `HOMEBREW_PREFIX`. This keeps Homebrew from importing Python modules located in `/Library/Python/2.7/site-packages` before similar modules in Homebrew's `site-packages`.\n\n## Build QGIS\n\nSelect the `all` target and click **Build Project \"qgis-x.x.x\"**. (Showing the **Compile Output** tab allows log output of the build.)\n\nUnless the source code is unstable, you do not have to `make install`. If the core plugins are staged with `make staged-plugins` or `make staged-plugins-pyc` after the build, you should be able to run the QGIS.app directly from the build directory.\n\n## Run Unit Tests\n\nOpen a Terminal.app session and issue the following to run all tests:\n\n```bash\nexport QGIS_BUILD=\"/path/to/QGIS/build/dir\"\nexport DYLD_LIBRARY_PATH=${QGIS_BUILD}/output/lib:${QGIS_BUILD}/PlugIns/qgis\nexport PATH=${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin::/usr/X11/bin\nexport PYTHONHOME=${HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/2.7\nexport PYTHONPATH=${HOMEBREW_PREFIX}/lib/python2.7/site-packages\nexport PYQGIS_STARTUP=${HOMEBREW_PREFIX}/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/python_startup.py\nexport GDAL_DRIVER_PATH=${HOMEBREW_PREFIX}/lib/gdalplugins\n\necho \"Homebrew:          $HOMEBREW_PREFIX\"\necho \"DYLD_LIBRARY_PATH: $DYLD_LIBRARY_PATH\"\necho \"PATH:              $PATH\"\necho \"PYTHONHOME:        $PYTHONHOME\"\necho \"PYTHONPATH:        $PYTHONPATH\"\necho \"PYQGIS_STARTUP:    $PYQGIS_STARTUP\"\necho \"GDAL_DRIVER_PATH:  $GDAL_DRIVER_PATH\"\n\ncd ${QGIS_BUILD}\nmake test\n```\n\nThe unit tests do not have a complete success rate across all platforms. See [QGIS CDash reporting site](http://dash.orfeo-toolbox.org/index.php?project=QGIS) for confirmation that any failing tests are, or are not, isolated to your build.\n\n## External Qt Creator Tools\n\n* Consider adding `qgis-cmake-options.py` as an external tool in Qt Creator:\n\n* Consider adding `prepare-commit.sh` as an external tool in Qt Creator:\n\n  If you have done an initial build using CMake option `-D WITH_ASTYLE=TRUE` (default for `qgis-cmake-options.py`) then a `qgisstyle` utility was built and installed to `/path/to/source/of/QGIS/scripts` and the `prepare-commit.sh` script can be used to clean up staged changes _prior_ to committing to locally cloned repository. This fixes up your code and makes it meet syntax guidelines. It is highly recommended you do this prior to your commits that will comprise pull requests to the QGIS project.\n\n## PyCharm Configuration\n\nYou can add the `qgis.core`, `qgis.gui`, etc. modules' parent path to the `sys.path` of your PyCharm project's Python interpreter (here using Homebrew's Python):\n\nYou will need to add the following `/path/to/QGIS/build/dir/output/python` to access the `qgis` modules.\n\n> Note: Homebrew's Python, by default, includes modules from `/Library/Python/2.7/site-packages` or `/Library/Frameworks`, which can cause conflicts with similar ones from Homebrew. You should consider removing them from `/Library/...` if such a conflict exists.\n"
  },
  {
    "path": "docs/docs/installing-QGIS-3.md",
    "content": "---\nlayout: default\ntitle: Installing QGIS 3\nnav_order: 1\n---\n\n# Installing QGIS 3\n\nTo install the last version of QGIS 3 you just have to run in your terminal `brew install qgis`. Running this command in your terminal you download and install a precompiled [bottle](https://docs.brew.sh/Bottles) of QGIS 3 build with most of the available options. Check below the options with the bottle is build.\n\n- `--with-3d`: Build with 3D Map View panel\n- `--with-gpsbabel`: Build with GPSBabel. Read, write and manipulate GPS waypoints in a variety of formats\n- `--with-grass`: Build with GRASS 7 integration plugin and Processing plugin support (or install grass-7x first)\n- `--with-lastools`: Build with LAStools, efficient tools for LiDAR processing. Contains LASlib, a C++ programming API for reading / writing LIDAR data stored in standard LAS format.\n- `--with-orfeo`: Build extra Orfeo Toolbox for Processing plugin\n- `--with-qspatialite`: Build QSpatialite Qt database driver\n- `--with-r`: Build extra R for Processing plugin\n- `--with-saga`: Build extra Saga GIS (LTS) for Processing plugin\n- `--with-server`: Build with QGIS Server (qgis_mapserv.fcgi)\n- `--with-taudem`: Build with TauDEM, Terrain Analysis Using Digital Elevation Models for hydrology\n- `--with-whitebox`: Build with Whitebox Tools, an advanced geospatial data analysis platform\n\nThe options `--with-mssql`\nand `--with-oracle`\naren't implemented at the moment because the user needs to accept licenses before building with them and it would complicate too much the building process of the bottle. `--with-postgresql10`, `--with-api-docs` and `--with-isolation` are left to the end user consideration because we consider seldom used options or features.\n\nAnyhow, if you are interested in any of those options to be included or dropped from the default build of QGIS 3, please let us know **why** opening an [issue](https://github.com/OSGeo/homebrew-osgeo4mac/issues).\n\n## qgis-res\n\nWe are using this formula to speed-up the QGIS's installation and update processes and, in consequence, is one of the main dependencies of QGIS. This way you can have more Python modules available to use with QGIS and since this modules are seldom updated it saves installation and updating time.\n\nWhen `qgis-res` formula is installed or updated, and since QGIS is build now by default `--with-r`, it will install R from Homebrew-core.\n\n## R from core vs R from other taps\n\nIf you have installed R from other tap —from [sethrfore/r-srf](https://github.com/sethrfore/homebrew-r-srf) for instance— instead of R from core the install will ask you to uninstall it to continue. You have two options.\n\n1. You can just uninstall your version of R and continue with QGIS 3 install. When the QGIS 3 install finish you just rever. You uninstall R from core and install again your preferred version.\n\n2. You just can rename the keg in your cellar before you start the install or update of QGIS 3 and when it finish you rever your changes and relink the formula. Something like the bellow code will do the trick.\n\n   ```shell\n   # Before you install or update QGIS\n   $ brew unlink R\n   $ mv /usr/local/cellar/r /usr/local/cellar/r-backup\n\n   # After the QGIS install finish\n   $ rm -r /usr/local/cellar/r\n   $ mv /usr/local/cellar/r-backup /usr/local/cellar/r\n   $ brew link r\n   ```\n\n\nPlease note that you have to do this even if you have your preferred tap pinned, since the pinned tap formulae only take preference when the formula is called by you, not when it's installed as dependency.\n\n## Recommendations, issues, caveats and headaches :face_with_head_bandage:\n\nYou can come across the following problems.\n\n### Formulae renaming & tap pinning\n\nWe are [pondering](https://github.com/OSGeo/homebrew-osgeo4mac/issues/769) renaming some formulae to take the same name of their counterpart on core. The main rationale behind this is to avoid to have two versions or kegs of the same software in your machine. However, this could bring problems in, since Homebrew take precedence other core formulae when installing dependencies, even when the tap is pin with `brew tap-pin <tap-name>`. Formulae from pinned taps only take precedence when you install those formulae from terminal.\n\nAnyhow we recommend you to pin this tap, while we try to figure out this conundrum. We encourage you to give your opinion.\n\n```shell\n$ brew tap-pin osgeo/osgeo4mac\n```\n\n### The maximum number of open file descriptors\n\nSince the build of QGIS 3 has a lot of dependencies you perhaps could run into an error related to the lack of resources allocated to the shell. Luckily you can change that using the command [`ulimit`](https://ss64.com/osx/ulimit.html). Check if `ulimit -n` is bigger than 1024 and it it's not set it `ulimit -n 1024` . It's up to you if you want to reset to you previous limit after you build or install QGIS.\n\n### Post-install could not finish\n\nIt seems that there was a small change in OTB, I will correct it in the next release of QGIS.\nYou can solve this by temporarily renaming `OtbUtils` file.\n\n```\n$ mv /usr/local/Cellar/qgis/3.6.0_4/QGIS.app/Contents/Resources/python/plugins/otb/OTBUtils.py /usr/local/Cellar/qgis/3.6.0_4/QGIS.app/Contents/Resources/python/plugins/otb/OtbUtils.py\n```\n\n### Fixing dependencies\n\nSometimes errors installing or building are related to incorrect installed or linked dependencies. We recommend you to do the following and try to build or install again:\n\nRemove the cache\n\n```shell\n$ rm -rf $(brew --cache)\n```\n\nand the temporary files in `/tmp` related to the build if any.\n\nA failed installation perhaps has build `qgis_customwidgets.py` you need to delete it.\n\n```shell\n$ rm /usr/local/lib/python3.7/site-packages/PyQt5/uic/widget-plugins/qgis_customwidgets.py\n```\n\nReinstall a relink some dependencies:\n\n```shell\n$ brew reinstall ninja gsl python qt sip-qt5 pyqt-qt5 pyqt5-webkit qscintilla2-qt5 six bison flex pkg-config\n$ brew link --overwrite pyqt-qt5\n$ brew unlink gettext python && brew link --force gettext python\n```\n\n## Mind the CI\n\n**Build status**: [![CircleCI](https://circleci.com/gh/OSGeo/homebrew-osgeo4mac.svg?style=svg)](https://circleci.com/gh/OSGeo/homebrew-osgeo4mac)\n\nYou have to keep in mind that if the bottle is able to build in our building server —aka CI— and it isn't able to to build or install in your machine, the problem is probably related to your local environment. We can help, but we don't promise anything. You can check the state of the build on the readme file, but you have to keep in mind, also, that some times the state is marked as failed by an error unrelated to the build, but to the deployment. Usually it can't upload the bottles to the bottle server and we upload them manually.\n"
  },
  {
    "path": "docs/docs/reporting-issues.md",
    "content": "---\nlayout: default\ntitle: Reporting issues\nnav_order: 2\n---\n\n# Reporting Issues\n\n**Run `brew update` twice and `brew doctor` *before* creating an issue!**\n\nThis document will help you check for common issues and make sure your issue has not already been reported.\n\n## Check for common issues\n\nFollow these steps to fix common problems:\n\n* Run `brew update` twice.\n\n* Run `brew doctor` and fix all the warnings (**outdated Xcode/CLT and unbrewed dylibs are very likely to cause problems**).\n\n* Check that **Command Line Tools for Xcode (CLT)** and **Xcode** are up to date.\n\n* If commands fail with permissions errors, check the permissions of `/usr/local`'s subdirectories. If you’re unsure what to do, you can run: \n\n  ```shell\n  $ cd /usr/local \n  $ sudo chown -R $(whoami) bin etc include lib sbin share var opt Cellar Caskroom Frameworks\n  ```\n\n* Read through the [[Troubleshooting]].\n\n## Check to see if the issue has been reported\n\n* Search the [issue tracker](https://github.com/OSGeo/homebrew-osgeo4mac/issues) to see if someone else has already reported the same issue.\n* Make sure you issue is specific to this tap and it's not part of other formula or dependency part of [core](https://github.com/Homebrew/homebrew-core/issues), [cask](https://github.com/Homebrew/homebrew-cask/issues) or other tap. \n\n## Create an issue\n\nIf your problem hasn't been solved or reported, then create an issue:\n\n1. Upload debugging information to a [Gist](https://gist.github.com):\n  * If you had a formula-related problem: run `brew gist-logs <formula>` (where `<formula>` is the name of the formula).\n  * If you encountered a non-formula problem: upload the output of `brew config` and `brew doctor` to a new [Gist](https://gist.github.com).\n\n2. [Create a new issue](https://github.com/Homebrew/homebrew-core/issues/new/choose).\n  * Give your issue a descriptive title which includes the formula name (if applicable) and the version of macOS you are using. For example, if a formula fails to build, title your issue \"\\<formula> failed to build on \\<10.x>\", where \"\\<formula>\" is the name of the formula that failed to build, and \"\\<10.x>\" is the version of macOS you are using.\n  * Include the URL output by `brew gist-logs <formula>` (if applicable). Please check [how to get the building logs](#how-to-get-the-building-logs) for more info. \n  * Include links to any additional Gists you may have created (such as for the output of `brew config`,  `brew doctor` or the output of your terminal). \n  * Please make, one problem one error. Don't mix up things because it isn't going to have any sense. \n  * Don't dumb in the description of the issue a incredible amount of code, use a [Gist](https://gist.github.com) instead.   \n  **What is an incredible amount of code?** Well, you'll know it when you'll see it. Scrolling down endlessly to be able some meaningful text doesn't usually have any sense. \n  * Try to be as descriptive as possible, without being redundant, in other words **be concise**. This is not a chat or a forum, but informal style is encourage. Please follow the [Code of Conduct.](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/CODE_OF_CONDUCT.md#specific-guidelines). \n\n## How to get the building logs?\n\nOne of the things you can provide us with is the building logs. You have to take into account that when doing parallel-job (multi-core) compilations, any final error is generally not the actual error that caused the build to fail. When posting log output from a multi-core build, that last error notice is _usually_ preceded by completely unrelated output from other parallel jobs that are finishing up first, with the actual in-line error much further up in the log. This is the case for the ubiquitous Make tool, though sequential log output may be created by other compilation tools, e.g. Ninja.\n\nIn other, and more simple, words, if you just post the output of your terminal chances are that the actual and real problem isn't showing there, so you have to search for the building logs. \n\nHomebrew comes already with a tool that allow you to fetch and upload those logs in just one command `brew gist-logs`. You just have to run `brew gist-logs qgis` and the tool will upload those logs to the github gist platform. If you add the flag `-n` it will even open an issue in our repo with the gist linked. You can check other options running in your terminal `brew gist-logs -h`. \n\nUnfortunately, the `brew gist-logs` command can truncate large log files before uploading, indicated by a `[...snip...]` in the uploaded log. In which case, the actual in-line error _may_ have been removed. In that case you have to do the job manually yourself. You have to search in `~/Library/Logs/Homebrew/<formula>/<log>` or `~/Library/Logs/Homebrew/<formula>/0#.make` (for Make builds) and search in those logs for **`error:`** or maybe **`fatal error:`** (note case and colon).\n\nWhen reporting issues, post the actual error and the matching compilation command(s) preceding it (again, may be further up in the log), or update the github gist page of the `brew gist-logs` output with the full log file that was truncated (gists are micro code repos, so you can update individual files).\n"
  },
  {
    "path": "docs/docs/troubleshooting.md",
    "content": "---\nlayout: default\ntitle: Troubleshooting\nnav_order: 3\n---\n\n# Troubleshooting\n\n* Run `brew update` twice.\n\n* Run `brew doctor` and fix all the warnings (**outdated Xcode/CLT and unbrewed dylibs are very likely to cause problems**).\n\n* Check that **Command Line Tools for Xcode (CLT)** and **Xcode** are up to date.\n\n* If commands fail with permissions errors, check the permissions of `/usr/local`'s subdirectories. If you’re unsure what to do, you can run: \n\n  ```shell\n  $ cd /usr/local \n  $ sudo chown -R $(whoami) bin etc include lib sbin share var opt Cellar Caskroom Frameworks\n  ```\n\n## QGIS 3 Specific Problems\n\n### The maximum number of open file descriptors\n\nSince the build of QGIS 3 has a lot of dependencies you perhaps could run into an error related to the lack of resources allocated to the shell. Luckily you can change that using the command [`ulimit`](https://ss64.com/osx/ulimit.html). Check if `ulimit -n` is bigger than 1024 and it it's not set it `ulimit -n 1024` . It's up to you if you want to reset to you previous limit after you build or install QGIS. \n\n### Post-install could not finish\n\nIt seems that there was a small change in OTB, I will correct it in the next release of QGIS.\nYou can solve this by temporarily renaming `OtbUtils` file. \n\n```shell\n$ mv /usr/local/Cellar/qgis/3.6.0_4/QGIS.app/Contents/Resources/python/plugins/otb/OTBUtils.py /usr/local/Cellar/qgis/3.6.0_4/QGIS.app/Contents/Resources/python/plugins/otb/OtbUtils.py\n```\n\n### Fixing dependencies\n\nSometimes errors installing or building are related to incorrect installed or linked dependencies. We recommend you to do the following and try to build or install again: \n\nRemove the cache\n\n```shell \n$ rm -rf $(brew --cache)\n```\n\nand the temporary files in `/tmp` related to the build if any. \n\nA failed installation perhaps has build `qgis_customwidgets.py` you need to delete it.\n\n```shell\n$ rm /usr/local/lib/python3.7/site-packages/PyQt5/uic/widget-plugins/qgis_customwidgets.py\n```\n\nReinstall a relink some dependencies: \n\n```shell\n$ brew reinstall ninja gsl python qt sip-qt5 pyqt-qt5 pyqt5-webkit qscintilla2-qt5 six bison flex pkg-config\n$ brew link --overwrite pyqt-qt5\n$ brew unlink gettext python && brew link --force gettext python\n```\n\n"
  },
  {
    "path": "docs/index.md",
    "content": "---\nlayout: default\ntitle: Home\ndescription: \"This is the homebrew's tap for the stable versions of the OSGeo geospatial toolset.\"\npermalink: /\n---\n\n<p class=\"fs-8 text-center\"><b>Homebrew OSGeo documentation page</b></p>\n\n<div markdown=\"1\">\nimportant\n{: .label .label-red }\n\nnotice\n{: .label .label-yellow }\n\nWe are currently doing reforms in the tap trying to improve and make it easier to use it. Right now, our main aim is to create a QGIS formula to generate a bottle on the server that will install a complete QGIS version with all the standard plugins, plus some nice additions. All without the need by the end user to build QGIS  in their local machine. \n\nNot to mention that we are running into some trouble at the moment and we are probably going to make you run in some too. We apologize for all the problems and we hope in the following weeks everything go to normal.\n</div>\n\n------\n\n## :sos: Help wanted\n\nIf you are interested in collaborating more close with us in the repo maintenance, formula development or just have an idea to take this tap further, please tell us. Any help, idea or suggestion is really welcomed because we want this top to be useful to people that are interested into use QGIS and the rest of the OSGeo toolset on macOS. \n\nIn addition to the normal communication over the issue tracker in this repo we also have a have a [![](/assets/images/slack-icon-24px.png)slack workplace](https://homebrew-osgeo4mac.slack.com/) were we discuss repo matters in a more dynamic way. If you want to join us, because you are interested into collaborate in the discussion please tell us. \n\n**Thanks!** 🙏\n"
  },
  {
    "path": "docs/just-the-docs.gemspec",
    "content": "# coding: utf-8\n\nGem::Specification.new do |spec|\n  spec.name          = \"just-the-docs\"\n  spec.version       = \"0.2.3\"\n  spec.authors       = [\"Patrick Marsceill\"]\n  spec.email         = [\"patrick.marsceill@gmail.com\"]\n\n  spec.summary       = %q{A modern, high customizable, responsive Jekyll theme for documention with built-in search.}\n  spec.homepage      = \"https://github.com/pmarsceill/just-the-docs\"\n  spec.license       = \"MIT\"\n\n  spec.files         = `git ls-files -z`.split(\"\\x0\").select { |f| f.match(%r{^(assets|bin|_layouts|_includes|lib|Rakefile|_sass|LICENSE|README)}i) }\n  spec.executables   << 'just-the-docs'\n\n  spec.add_runtime_dependency \"jekyll\", \"~> 3.8.5\"\n  spec.add_runtime_dependency \"rake\", \"~> 12.3.1\"\n\n  spec.add_development_dependency \"bundler\", \"~> 2.0.1\"\nend\n"
  },
  {
    "path": "docs/lib/tasks/search.rake",
    "content": "namespace :search do\n  desc 'Generate the files needed for search functionality'\n  task :init do\n    puts 'Creating search data json file...'\n    mkdir_p '/assets/js'\n    touch '/assets/js/search-data.json'\n    content = %Q[{{ page.content | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```'  | remove: '---' | replace: '\\\\', ' ' | normalize_whitespace }}]\n    puts 'Done.'\n    puts 'Generating content...'\n\n    File.open('/assets/js/search-data.json', 'w') do |f|\n      f.puts '---\n---\n{\n  {% for page in site.html_pages %}{% if page.search_exclude != true %}\"{{ forloop.index0 }}\": {\n    \"id\": \"{{ forloop.index0 }}\",\n    \"title\": \"{{ page.title | replace: \\'&amp;\\', \\'&\\' }}\",\n    \"content\": \"'+content+'\",\n    \"url\": \"{{ page.url | absolute_url }}\",\n    \"relUrl\": \"{{ page.url }}\"\n  }{% unless forloop.last %},{% endunless %}\n  {% endif %}{% endfor %}\n}'\n    end\n    puts 'Done.'\n  end\nend\n"
  },
  {
    "path": "docs/package.json",
    "content": "{\n  \"name\": \"just-the-docs\",\n  \"version\": \"0.2.3\",\n  \"description\": \"A modern Jekyll theme for documentation\",\n  \"repository\": \"pmarsceill/just-the-docs\",\n  \"license\": \"MIT\",\n  \"bugs\": \"https://github.com/pmarsceill/just-the-docs/issues\",\n  \"devDependencies\": {\n    \"stylelint\": \"^9.10.1\",\n    \"stylelint-config-primer\": \"^3.0.1\"\n  },\n  \"dependencies\": {},\n  \"scripts\": {\n    \"test\": \"stylelint '**/*.scss'\"\n  }\n}\n"
  },
  {
    "path": "docs/script/build",
    "content": "#!/bin/sh\n\necho \"Packaging gem... \\n\"\ngem build just-the-docs.gemspec\n\necho \"Cleaning up... \\n\"\ngit add *.gem\ngit commit -m 'Bump just-the-docs gem package'\n"
  },
  {
    "path": "enviro/osgeo4mac-qt4.env",
    "content": "# Example usage, in .bash_profile, etc.:\n#   # non-standard homebrew prefix\n#   alias osgeo4mac-env='source /usr/local/osgeo4mac/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/osgeo4mac.env'\n#   OR, standard homebrew /usr/local prefix\n#   alias osgeo4mac-env=\"source $(brew --prefix)/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/osgeo4mac.env\"\n\n# Use this variable to differentiate between custom and normal prefix in downstream environs.\n# For example, in your .bash_profile, which gets sourced when doing `brew sh` you can:\n#   if [ ${HOMEBREW_BREW_FILE+x} ] && [ ${OSGEO4MAC+x} ] ; then\n#     # HOMEBREW_BREW_FILE is set, and using osgeo4mac setup: fix bloated PATH\n#     export PATH=/new/prepended/paths:/usr/X11/bin:/usr/bin:/bin:/usr/sbin\n#   fi\nexport OSGEO4MAC=1\n\n# Alternative method for finding 'sourced' file path\n# CMD=\"import os, sys; print os.path.realpath(\\\"${BASH_SOURCE[0]}\\\")\"\n# SCRIPT_PATH=\"$(/usr/bin/python -c \"$CMD\" )\"\n\n# Starting from within homebrew tapped directory\nENVIRO_DIR=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\"; pwd -P)\n\nBREW_TAP=$(dirname $ENVIRO_DIR)\nif ! [ -d \"$BREW_TAP\" ]; then\n  echo \"Homebrew tap not found: $BREW_TAP\"\n  exit 1\nfi\n\nBREW_PREFIX=$(dirname $(dirname $(dirname $(dirname $(dirname $BREW_TAP ) ) ) ) )\nif ! [ -d \"$BREW_PREFIX\" ]; then\n  echo \"Homebrew prefix not found: $BREW_PREFIX\"\n  exit 1\nfi\n\necho \"Homebrew prefix: $BREW_PREFIX\"\necho \"Homebrew tap is: $BREW_TAP\"\necho \"osgeo4mac enviro: $ENVIRO_DIR\"\n\nexport MANPATH=$BREW_PREFIX/share/man:$MANPATH\nexport PATH=$BREW_PREFIX/bin:$BREW_PREFIX/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11/bin\n# Setting PYTHONHOME tends to break some builds when using `brew sh`\n# export PYTHONHOME=$BREW_PREFIX/Frameworks/Python.framework/Versions/2.7\nexport PYTHONPATH=$BREW_PREFIX/lib/qt-4/python2.7/site-packages:$BREW_PREFIX/lib/python2.7/site-packages\nexport PYTHONSTARTUP=$ENVIRO_DIR/python_startup.py\nexport GDAL_DRIVER_PATH=$BREW_PREFIX/lib/gdalplugins\nexport OSG_LIBRARY_PATH=$BREW_PREFIX/lib/osgPlugins-3.4.0\n\n# Doesn't work very well for GDAL PGeo driver, use Java-based Access MDB driver instead\n# export ODBCSYSINI=$BREW_PREFIX/etc/\n# export MDBDRIVER_PATH=$BREW_PREFIX/lib\n\nif [ -d $BREW_PREFIX/etc/bash_completion ]; then\n  source $BREW_PREFIX/etc/bash_completion\nfi\n\n# Append any user env settings\nif [ -f $HOME/.osgeo4mac.env ]; then\n  source $HOME/.osgeo4mac.env\nfi\n\ncd $BREW_PREFIX\n"
  },
  {
    "path": "enviro/osgeo4mac.env",
    "content": "# Example usage, in .bash_profile, etc.:\n#   # non-standard homebrew prefix\n#   alias osgeo4mac-env='source /usr/local/osgeo4mac/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/osgeo4mac.env'\n#   OR, standard homebrew /usr/local prefix\n#   alias osgeo4mac-env=\"source $(brew --prefix)/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/osgeo4mac.env\"\n\n# Use this variable to differentiate between custom and normal prefix in downstream environs.\n# For example, in your .bash_profile, which gets sourced when doing `brew sh` you can:\n#   if [ ${HOMEBREW_BREW_FILE+x} ] && [ ${OSGEO4MAC+x} ] ; then\n#     # HOMEBREW_BREW_FILE is set, and using osgeo4mac setup: fix bloated PATH\n#     export PATH=/new/prepended/paths:/usr/X11/bin:/usr/bin:/bin:/usr/sbin\n#   fi\nexport OSGEO4MAC=1\n\n# Alternative method for finding 'sourced' file path\n# CMD=\"import os, sys; print os.path.realpath(\\\"${BASH_SOURCE[0]}\\\")\"\n# SCRIPT_PATH=\"$(/usr/bin/python -c \"$CMD\" )\"\n\n# Starting from within homebrew tapped directory\nENVIRO_DIR=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\"; pwd -P)\n\nBREW_TAP=$(dirname $ENVIRO_DIR)\nif ! [ -d \"$BREW_TAP\" ]; then\n  echo \"Homebrew tap not found: $BREW_TAP\"\n  exit 1\nfi\n\nBREW_PREFIX=$(dirname $(dirname $(dirname $(dirname $(dirname $BREW_TAP ) ) ) ) )\nif ! [ -d \"$BREW_PREFIX\" ]; then\n  echo \"Homebrew prefix not found: $BREW_PREFIX\"\n  exit 1\nfi\n\necho \"Homebrew prefix: $BREW_PREFIX\"\necho \"Homebrew tap is: $BREW_TAP\"\necho \"osgeo4mac enviro: $ENVIRO_DIR\"\n\nexport MANPATH=$BREW_PREFIX/share/man:$MANPATH\nexport PATH=$BREW_PREFIX/bin:$BREW_PREFIX/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11/bin\n# Setting PYTHONHOME tends to break some builds when using `brew sh`\n# export PYTHONHOME=$BREW_PREFIX/Frameworks/Python.framework/Versions/2.7\nexport PYTHONPATH=$BREW_PREFIX/lib/python2.7/site-packages\nexport PYTHONSTARTUP=$ENVIRO_DIR/python_startup.py\nexport GDAL_DRIVER_PATH=$BREW_PREFIX/lib/gdalplugins\nexport OSG_LIBRARY_PATH=$BREW_PREFIX/lib/osgPlugins-3.4.0\n\n# Doesn't work very well for GDAL PGeo driver, use Java-based Access MDB driver instead\n# export ODBCSYSINI=$BREW_PREFIX/etc/\n# export MDBDRIVER_PATH=$BREW_PREFIX/lib\n\nif [ -d $BREW_PREFIX/etc/bash_completion ]; then\n  source $BREW_PREFIX/etc/bash_completion\nfi\n\n# Append any user env settings\nif [ -f $HOME/.osgeo4mac.env ]; then\n  source $HOME/.osgeo4mac.env\nfi\n\ncd $BREW_PREFIX\n"
  },
  {
    "path": "enviro/python_startup.py",
    "content": "# -*- coding: utf-8 -*-\n\"\"\"\n/***************************************************************************\n OSGeo4Mac Python startup script to strip /Library/Frameworks\n and /Library/Python site-packages\n                              -------------------\n        begin    : 2013-09-20\n        copyright: (C) 2013 Larry Shaffer\n        email    : larrys@dakotacarto.com\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU General Public License as published by  *\n *   the Free Software Foundation; either version 2 of the License, or     *\n *   (at your option) any later version.                                   *\n *                                                                         *\n ***************************************************************************/\n\"\"\"\nimport sys\n\nsys.path[:] = (pth for pth in sys.path if not pth.startswith('/Library'))\n"
  },
  {
    "path": "enviro/qgis-osgeo4mac-ctest-env.sh",
    "content": "export DYLD_LIBRARY_PATH=${QGIS_BUILD}/output/lib:${QGIS_BUILD}/PlugIns/qgis\nexport PATH=${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin\nexport PYTHONHOME=${HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/2.7\nexport PYTHONPATH=${HOMEBREW_PREFIX}/lib/python2.7/site-packages\nexport PYQGIS_STARTUP=${HOMEBREW_PREFIX}/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/python_startup.py\nexport GDAL_DRIVER_PATH=${HOMEBREW_PREFIX}/lib/gdalplugins\n\ncd ${QGIS_BUILD}\n\necho \"Homebrew:          $HOMEBREW_PREFIX\"\necho \"DYLD_LIBRARY_PATH: $DYLD_LIBRARY_PATH\"\necho \"PATH:              $PATH\"\necho \"PYTHONHOME:        $PYTHONHOME\"\necho \"PYTHONPATH:        $PYTHONPATH\"\necho \"PYQGIS_STARTUP:    $PYQGIS_STARTUP\"\necho \"GDAL_DRIVER_PATH:  $GDAL_DRIVER_PATH\"\n"
  },
  {
    "path": "formula_renames.json",
    "content": "{\n  \"qgis3\": \"osgeo-qgis\",\n  \"qgis2\": \"qgis-ltr@2\",\n  \"libkml-dev\": \"osgeo-libkml\",\n  \"hdf4\": \"osgeo-hdf4\",\n  \"fyba\": \"osgeo-fyba\",\n  \"ogdi\": \"osgeo-ogdi\",\n  \"filegdb-api\": \"osgeo-filegdb-api\",\n  \"oracle-client-sdk\": \"osgeo-oracle-client-sdk\",\n  \"pdfium-gdal2\": \"osgeo-pdfium\",\n  \"ecwjp2-sdk\": \"osgeo-ecwjp2-sdk\",\n  \"mrsid-sdk\": \"osgeo-mrsid-sdk\",\n  \"gdal2\": \"osgeo-gdal\",\n  \"gdal2-sosi\": \"osgeo-gdal-sosi\",\n  \"gdal2-ecwjp2\": \"osgeo-gdal-ecwjp2\",\n  \"gdal2-filegdb\": \"osgeo-gdal-filegdb\",\n  \"gdal2-mdb\": \"osgeo-gdal-mdb\",\n  \"gdal2-mrsid\": \"osgeo-gdal-mrsid\",\n  \"gdal2-mysql\": \"osgeo-gdal-mysql\",\n  \"gdal2-ogdi\": \"osgeo-gdal-ogdi\",\n  \"gdal2-oracle\": \"osgeo-gdal-oracle\",\n  \"gdal2-pdf\": \"osgeo-gdal-pdf\",\n  \"gdal2-python\": \"osgeo-gdal-python\",\n  \"gdal2-grass7\": \"osgeo-gdal-grass\",\n  \"gdal2-mongodb\": \"osgeo-gdal-mongodb\",\n  \"laszip@2.2\": \"osgeo-laszip@2\",\n  \"liblas-gdal2\": \"osgeo-liblas\",\n  \"grass7\": \"osgeo-grass\",\n  \"mongo-cxx-driver-legacy\": \"osgeo-mongo-cxx-driver-legacy\",\n  \"vigra\": \"osgeo-vigra\",\n  \"saga-gis-lts\": \"osgeo-saga-lts\",\n  \"saga-gis\": \"osgeo-saga\",\n  \"sip-qt5\": \"osgeo-sip\",\n  \"pyqt-qt5\": \"osgeo-pyqt\",\n  \"qscintilla2-qt5\": \"osgeo-qscintilla2\",\n  \"qt5-webkit\": \"osgeo-qt-webkit\",\n  \"pyqt5-webkit\": \"osgeo-pyqt-webkit\",\n  \"qpsql\": \"osgeo-qt-psql\",\n  \"qmysql\": \"osgeo-qt-mysql\",\n  \"qodbc\": \"osgeo-qt-odbc\",\n  \"qtkeychain\": \"osgeo-qtkeychain\",\n  \"pyspatialite\": \"osgeo-pyspatialite\",\n  \"six\": \"osgeo-six\",\n  \"taudem\": \"osgeo-taudem\",\n  \"shark\": \"osgeo-shark\",\n  \"whitebox-tools\": \"osgeo-whitebox-tools\",\n  \"whitebox\": \"osgeo-whitebox\",\n  \"insighttoolkit\": \"osgeo-insighttoolkit\",\n  \"hexer\": \"osgeo-hexer\",\n  \"opencollada\": \"osgeo-opencollada\",\n  \"lastools\": \"osgeo-lastools\",\n  \"nitro\": \"osgeo-nitro\",\n  \"libnoise\": \"osgeo-libnoise\",\n  \"libght\": \"osgeo-libght\",\n  \"marble\": \"osgeo-marble\",\n  \"fcgi-debug\": \"osgeo-fcgi-debug\",\n  \"gpkgtools\": \"osgeo-gpkgtools\",\n  \"pointcloud\": \"osgeo-pointcloud\",\n  \"postgis2\": \"osgeo-postgis\",\n  \"openscenegraph-qt5\": \"osgeo-openscenegraph\",\n  \"osgqt\": \"osgeo-osgqt\",\n  \"ossim\": \"osgeo-ossim\",\n  \"orfeo6\": \"osgeo-orfeo\",\n  \"qgis-res\": \"osgeo-qgis-res\",\n  \"qgis\": \"osgeo-qgis\",\n  \"qgis-ltr\": \"osgeo-qgis-ltr\",\n  \"pgsql-ogr-fdw\": \"osgeo-pgsql-ogr-fdw\",\n  \"iipsrv\": \"osgeo-iipsrv\",\n  \"osm2po\": \"osgeo-osm2po\"\n}\n"
  },
  {
    "path": "scripts/Mac/find_all-installed_w-options.sh",
    "content": "#!/bin/bash\n\n# assign env var, if set\nHB=\"${HOMEBREW_PREFIX:=/usr/local}\"\n\nfind -L \"${HB}/opt\" -name 'INSTALL_RECEIPT.json' -maxdepth 2 -print > /tmp/homebrew-installed.txt\n\nprintf '' > /tmp/homebrew-installed-w-options.txt\n\nNAME=''\nOPTIONS=''\nNAMES=''\nNAME_OPTS=''\nwhile IFS= read -r file\ndo\n  # get the formula name\n  NAME=$(printf \"$file\" | sed -E \"s|^${HB}/opt/([^/]+)/INSTALL_RECEIPT.json$|\\1|\")\n    \n  # get, cleanup and append used options\n  OPTIONS=$(grep -l -v \"\\\"used_options\\\":\\[\\]\" \"$file\")\n  \n  if [ -z \"$OPTIONS\" ]; then\n    NAMES+=\"${NAME}\n\"\n  else\n    OPTIONS=$(sed -E -e 's/^.+\"used_options\":\\[([^]]+)\\].*$/\\1/' -e 's/\"//g' -e \"s/,/ /g\" \"$file\")\n    NAME_OPTS+=\"${NAME} ${OPTIONS}\n\"\n  fi\n  \ndone < /tmp/homebrew-installed.txt\n\nprintf \"${NAME_OPTS}\" >> /tmp/homebrew-installed-w-options.txt\nprintf \"${NAMES}\" >> /tmp/homebrew-installed-w-options.txt\n\necho \"Opening /tmp/homebrew-installed-w-options.txt\"\nnano /tmp/homebrew-installed-w-options.txt\n"
  },
  {
    "path": "scripts/Mac/find_non-bottle-builds_w-options.sh",
    "content": "#!/bin/bash\n\n# assign env var, if set\nHB=\"${HOMEBREW_PREFIX:=/usr/local}\"\n\nfind -L \"${HB}/opt\" -name 'INSTALL_RECEIPT.json' -maxdepth 2 -print0 | xargs -0 -n 200 grep -l \"\\\"built_as_bottle\\\":false\" > /tmp/not-built-bottles.txt.bkup\n\n# cat /tmp/not-built-bottles.txt.bkup | xargs -n 200 grep -l -v \"\\\"used_options\\\":\\[\\]\" > /tmp/not-built-bottles_w-options.txt.bkup\n\n[ -f /tmp/not-built-bottles_w-options.txt ] && rm /tmp/not-built-bottles_w-options.txt\ntouch /tmp/not-built-bottles_w-options.txt\n\nNAME=''\nOPTIONS=''\nwhile IFS= read -r file\ndo\n  # get the formula name\n  NAME=$(echo -n \"$file\" | sed -E \"s|^${HB}/opt/([^/]+)/INSTALL_RECEIPT.json$|\\1|\")\n\n  # get, cleanup and append used options\n  OPTIONS=$(grep -l -v \"\\\"used_options\\\":\\[\\]\" \"$file\")\n\n  if [ -z \"$OPTIONS\" ]; then\n    NAME_OPTS=\"${NAME}\"\n  else\n    OPTIONS=$(sed -E -e 's/^.+\"used_options\":\\[([^]]+)\\].*$/\\1/' -e 's/\"//g' -e \"s/,/ /g\" \"$file\")\n    NAME_OPTS=\"${NAME} ${OPTIONS}\"\n  fi\n\n  echo \"${NAME_OPTS}\" >> /tmp/not-built-bottles_w-options.txt\n\ndone < /tmp/not-built-bottles.txt.bkup\n\necho \"Opening /tmp/not-built-bottles_w-options.txt\"\nnano /tmp/not-built-bottles_w-options.txt\n"
  },
  {
    "path": "scripts/qgis2-cmake-options.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n/***************************************************************************\n OSGeo4Mac Python script for generating CMake option string for use in Qt\n Creator with dev builds and installs of QGIS when built off dependencies\n from homebrew-osgeo4mac tap\n                              -------------------\n        begin    : January 2014\n        copyright: (C) 2014 Larry Shaffer\n        email    : larrys at dakotacarto dot com\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU General Public License as published by  *\n *   the Free Software Foundation; either version 2 of the License, or     *\n *   (at your option) any later version.                                   *\n *                                                                         *\n ***************************************************************************/\n\"\"\"\n\nimport os\nimport re\nimport sys\nfrom collections import OrderedDict\nimport argparse\n\nOSG_VERSION = '3.4.0'\nHOMEBREW_PREFIX = '/usr/local'  # default for Homebrew\n\n\ndef cmake_opts(qi, hb, ver):\n    # define versions of CMake option changes\n    lt27 = int(ver[0]) <= 2 and int(ver[1]) < 7\n    w_server = 'WITH_MAPSERVER' if lt27 else 'WITH_SERVER'\n\n    # ensure libintl.h can be found in gettext for grass\n    cxx_flags = \"-I{hb}/opt/gettext/include\"\n    if 'CXXFLAGS' in os.environ:\n        cxx_flags += \" \" + os.environ['CXXFLAGS']\n\n    # search Homebrew's Frameworks directory before those in /Library or /System\n    ld_flags = \"-F{hb}/Frameworks\"\n    if 'LDFLAGS' in os.environ:\n        ld_flags += \" \" + os.environ['LDFLAGS']\n\n    # IMPORTANT: mulit-path options need the CMake list semicolon (;) delimiter,\n    #            NOT the environment variable path list colon (:) separator\n\n    # set CMAKE_PREFIX_PATH for keg-only installs, and HOMEBREW_PREFIX\n\n    cm_opts = OrderedDict([\n        ('CMAKE_INSTALL_PREFIX', qi),\n        ('CMAKE_PREFIX_PATH', '\"{hb}/opt/libxml2;{hb}/opt/expat;'\n                              '{hb}/opt/gettext;{hb}/opt/sqlite;'\n                              '{hb}/opt/gdal2;'\n                              '{hb}/opt/sip-qt4;'\n                              '{hb}/opt/pyqt-qt4;'\n                              '{hb}/opt/qwt-qt4;'\n                              '{hb}/opt/qwtpolar-qt4;'\n                              '{hb}/opt/qscintilla2-qt4;'\n                              '{hb}\"'),\n        ('CMAKE_FRAMEWORK_PATH', '\"{hb}/opt/qwt-qt4/lib;{hb}/opt/qwtpolar-qt4/lib\"'),\n        ('CMAKE_BUILD_TYPE', 'RelWithDebInfo'),\n        ('CMAKE_FIND_FRAMEWORK', 'LAST'),\n        ('CMAKE_CXX_FLAGS', '\"' + cxx_flags + '\"'),\n        ('CMAKE_EXE_LINKER_FLAGS', '\"' + ld_flags + '\"'),\n        ('CMAKE_MODULE_LINKER_FLAGS', '\"' + ld_flags + '\"'),\n        ('CMAKE_SHARED_LINKER_FLAGS', '\"' + ld_flags + '\"'),\n        ('CXX_EXTRA_FLAGS', '\"-Wno-inconsistent-missing-override '\n                            '-Wno-unused-private-field '\n                            '-Wno-deprecated-register\"'),\n        ('BISON_EXECUTABLE', '{hb}/opt/bison/bin/bison'),\n        ('FLEX_EXECUTABLE', '{hb}/opt/flex/bin/flex'),\n        ('QT_QMAKE_EXECUTABLE', '{hb}/opt/qt-4/bin/qmake'),\n        ('SUPPRESS_QT_WARNINGS', 'TRUE'),\n        ('GITCOMMAND', '{hb}/bin/git'),\n        ('ENABLE_TESTS', 'TRUE'),\n        ('ENABLE_MODELTEST', 'TRUE'),\n        ('WITH_ASTYLE', 'TRUE'),\n        ('WITH_PYSPATIALITE', 'FALSE'),\n        ('WITH_QWTPOLAR', 'TRUE'),\n        ('WITH_INTERNAL_QWTPOLAR', 'FALSE'),\n        (w_server, 'TRUE'),\n        ('WITH_STAGED_PLUGINS', 'FALSE'),\n        ('WITH_PY_COMPILE', 'TRUE'),\n        ('WITH_APIDOC', 'FALSE'),\n        ('WITH_QSCIAPI', 'FALSE'),\n        ('QSCI_SIP_DIR', '{hb}/opt/qscintilla2-qt4/share/sip'),\n        ('GDAL_CONFIG', '{hb}/opt/gdal2/bin/gdal-config'),\n        ('POSTGRES_CONFIG', '{hb}/bin/pg_config'),\n        ('WITH_QSPATIALITE', 'TRUE'),\n        ('WITH_GRASS', 'FALSE'),\n        ('WITH_GRASS7', 'TRUE'),\n        ('GRASS_PREFIX7', '{hb}/opt/grass7/grass-base'),\n        ('WITH_GLOBE', 'FALSE'),\n        ('WITH_ORACLE', 'FALSE'),\n        ('FCGI_INCLUDE_DIR', '{hb}/opt/fcgi/include'),\n        ('GEOS_INCLUDE_DIR', '{hb}/opt/geos/include'),\n        ('GSL_INCLUDE_DIR', '{hb}/opt/gsl/include'),\n        ('PROJ_INCLUDE_DIR', '{hb}/opt/proj/include'),\n        ('QCA_INCLUDE_DIR', '{hb}/opt/qca-qt4/lib/qca.framework/Headers'),\n        ('QSCINTILLA_INCLUDE_DIR', '{hb}/opt/qscintilla2-qt4/include'),\n        ('QWT_INCLUDE_DIR', '{hb}/opt/qwt-qt4/lib/qwt.framework/Headers'),\n        ('QWTPOLAR_LIBRARY', '{hb}/opt/qwtpolar/lib/qwtpolar-qt4.framework/qwt'),\n        ('QWTPOLAR_INCLUDE_DIR', '{hb}/opt/qwtpolar/lib/qwtpolar-qt4.framework/Headers'),\n        ('SPATIALINDEX_INCLUDE_DIR', '{hb}/opt/spatialindex/include/spatialindex'),\n        ('SPATIALITE_INCLUDE_DIR', '{hb}/opt/libspatialite/include'),\n        ('SQLITE3_INCLUDE_DIR', '{hb}/opt/sqlite/include'),\n        ('QGIS_MACAPP_BUNDLE', '0')\n    ])\n\n    # ('CMAKE_FRAMEWORK_PATH', '\"\"')\n\n    # Supplemental\n\n    # ('OSG_DIR', '{hb}'),\n    # ('OSGEARTH_DIR', '{hb}'),\n    # ('OSG_PLUGINS_PATH', '{hb}/lib/osgPlugins-' + OSG_VERSION),\n\n    # ('GRASS_PREFIX', '{hb}/opt/grass6/grass-base'),\n\n    # ('OCI_INCLUDE_DIR', '{hb}/opt/oracle-client-sdk/sdk/include'),\n    # ('OCI_LIBRARY', '{hb}/lib/libclntsh.dylib'),\n\n    # These should be found automatically now...\n    # ('SQLITE3_INCLUDE_DIR', '{hb}/opt/sqlite/include'),\n    # ('SQLITE3_LIBRARY', '{hb}/opt/sqlite/lib/libsqlite3.dylib'),\n    # ('QSCINTILLA_INCLUDE_DIR', '{hb}/opt/qscintilla2-qt4/include/Qsci'),\n    # ('QSCINTILLA_LIBRARY', '{hb}/opt/qscintilla2-qt4/lib/libqscintilla2.dylib'),\n    # ('QWT_LIBRARY', '{hb}/opt/qwt-qt4/lib/qwt.framework/qwt'),\n    # ('QWT_INCLUDE_DIR', '{hb}/opt/qwt-qt4/lib/qwt.framework/Headers'),\n    # ('QWTPOLAR_LIBRARY',\n    #  '{hb}/opt/qwtpolar/lib/qwtpolar-qt4.framework/qwt'),\n    # ('QWTPOLAR_INCLUDE_DIR',\n    #  '{hb}/opt/qwtpolar/lib/qwtpolar-qt4.framework/Headers'),\n    # ('WITH_INTERNAL_SPATIALITE', 'FALSE'),\n\n    if os.path.exists(hb + '/Frameworks/Python.framework/Versions/2.7'):\n        cm_opts['PYTHON_EXECUTABLE'] = '{hb}/bin/python'\n        cm_opts['PYTHON_CUSTOM_FRAMEWORK'] = \\\n            '{hb}/Frameworks/Python.framework/Versions/2.7'\n\n    return cm_opts\n\n\ndef arg_parser():\n    parser = argparse.ArgumentParser(\n        description=\"\"\"\\\n            Script for generating CMake option string for use in Qt Creator with\n            dev builds and installs of QGIS when built off dependencies from\n            homebrew-osgeo4mac tap.\n            \"\"\"\n    )\n    parser.add_argument(\n        '-p', '--homebrew-prefix', dest='hb',\n        metavar='homebrew_prefix',\n        help='homebrew prefix path, or set HOMEBREW_PREFIX (/usr/local default)'\n    )\n    parser.add_argument(\n        'qs', metavar='qgis-src-dir',\n        help='QGIS source directory'\n    )\n    parser.add_argument(\n        'qi', metavar='qgis-install-dir',\n        help='QGIS install directory'\n    )\n    return parser\n\n\ndef main():\n    # get defined args\n    args = arg_parser().parse_args()\n\n    qs = os.path.realpath(args.qs)\n    if not os.path.isabs(qs) or not os.path.exists(qs):\n        print 'QGIS source directory not resolved to existing absolute path.'\n        sys.exit(1)\n\n    # get QGIS version\n    s = ''\n    with file(os.path.join(qs, 'CMakeLists.txt')) as f:\n        for _ in range(5):\n            s += f.readline()\n    # print s\n    p = re.compile(r'CPACK_PACKAGE_VERSION_..... \"(..?)\"')\n    ver = p.findall(s)\n    print ver\n\n    if not ver:\n        print 'QGIS version could not be resolved.'\n        sys.exit(1)\n\n    if len(ver) != 3:\n        print 'QGIS version\\'s major.minor.patch could not be resolved.'\n        sys.exit(1)\n\n    qi = os.path.realpath(args.qi)\n    if not os.path.isabs(qi) or not os.path.exists(qi):\n        print 'QGIS install directory not resolved to existing absolute path.'\n        sys.exit(1)\n\n    # generate list of environment variables\n    hb_prefix = HOMEBREW_PREFIX\n    if 'HOMEBREW_PREFIX' in os.environ:\n        hb_prefix = os.environ['HOMEBREW_PREFIX']\n    hb = os.path.realpath(args.hb) if args.hb else hb_prefix\n    if not os.path.isabs(hb) or not os.path.exists(hb):\n        print 'HOMEBREW_PREFIX not resolved to existing absolute path.'\n        sys.exit(1)\n\n    # generate cmake options\n    cm_opts = cmake_opts(qi, hb, ver)\n\n    cm_opts_s = args.qs\n    for k, v in cm_opts.iteritems():\n        cm_opts_s += ' -D{0}={1}'.format(k, v.format(hb=hb))\n\n    os.system(\"echo '{0}' | pbcopy\".format(cm_opts_s))\n    print \"\\nThe following has been copied to the clipboard:\\n\"\n    print cm_opts_s\n\n\nif __name__ == '__main__':\n    main()\n    sys.exit(0)\n"
  },
  {
    "path": "scripts/qgis2-creator-build.sh",
    "content": "#!/bin/bash\n\nBUILD_DIR=\"$1\"\n\nif ! [[ \"$BUILD_DIR\" = /* ]] || ! [ -d \"$BUILD_DIR\" ]; then\n  echo \"usage: <script> 'absolute path to QGIS CMake build directory'\"\n  exit 1\nfi\n\n# parent directory of script\nSCRIPT_DIR=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\"; pwd -P)\n\n# use maximum number of available cores\nCPUCORES=$(/usr/sbin/sysctl -n hw.ncpu)\n\n# if HOMEBREW_PREFIX undefined in env, then set to standard prefix\nif [ -z \"$HOMEBREW_PREFIX\" ]; then\n  HOMEBREW_PREFIX='/usr/local'\nfi\n\n# set up environment\nexport PATH=${HOMEBREW_PREFIX}/opt/gdal2/bin:${HOMEBREW_PREFIX}/opt/gdal2-python/bin:${HOMEBREW_PREFIX}/opt/sip-qt4/bin:${HOMEBREW_PREFIX}/opt/qt-4/bin:${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:${PATH}\nexport PYTHONPATH=${HOMEBREW_PREFIX}/lib/qt-4/python2.7/site-packages:${HOMEBREW_PREFIX}/opt/gdal2-python/lib/python2.7/site-packages:${HOMEBREW_PREFIX}/lib/python2.7/site-packages:${PYTHONPATH}\n\necho \"PATH set to: ${PATH}\"\necho \"PYTHONPATH set to: ${PYTHONPATH}\"\necho \"BUILD_DIR set to: ${BUILD_DIR}\"\n\necho \"Building QGIS...\"\nmake -j ${CPUCORES}\nif [ $? -gt 0 ]; then\n    echo -e \"\\nERROR building QGIS\"\n    exit 1\nfi\n\n# # stage/compile plugins so they are available when running from build directory\n# echo \"Staging plugins to QGIS build directory...\"\n# make -j ${CPUCORES} staged-plugins-pyc\n# if [ $? -gt 0 ]; then\n#     echo -e \"\\nERROR staging plugins to QGIS build directory\"\n#     exit 1\n# fi\n\n# write LSEnvironment entity to app's Info.plist\nif [ -d \"${BUILD_DIR}/output/bin/QGIS.app\" ]; then\n  # this differs from LSEnvironment in bundled app; see set-qgis-app-env.py\n  echo \"Setting QGIS.app environment variables...\"\n  ${SCRIPT_DIR}/qgis2-set-app-env.py -p ${HOMEBREW_PREFIX} -b ${BUILD_DIR} \"${BUILD_DIR}/output/bin/QGIS.app\"\n  if [ $? -gt 0 ]; then\n      echo -e \"\\nERROR setting QGIS.app environment variables\"\n      exit 1\n  fi\nfi\n\nif [ -d \"${BUILD_DIR}/output/bin/QGIS Browser.app\" ]; then\n  echo \"Setting QGIS Browser.app environment variables...\"\n  ${SCRIPT_DIR}/qgis2-set-app-env.py -p ${HOMEBREW_PREFIX} -b ${BUILD_DIR} \"${BUILD_DIR}/output/bin/QGIS Browser.app\"\n  if [ $? -gt 0 ]; then\n      echo -e \"\\nERROR setting QGIS Browser.app environment variables\"\n      exit 1\n  fi\nfi\n\nexit 0\n"
  },
  {
    "path": "scripts/qgis2-creator-install.sh",
    "content": "#!/bin/bash\n\nOUTPUT_DIR=\"$1\"\n\nif ! [[ \"$OUTPUT_DIR\" = /* ]] || ! [ -d \"$OUTPUT_DIR\" ]; then\n  echo \"usage: <script> 'absolute path to QGIS.app's install directory'\"\n  exit 1\nfi\n\n# parent directory of script\nSCRIPT_DIR=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\"; pwd -P)\n\n# use maximum number of available cores\nCPUCORES=$(/usr/sbin/sysctl -n hw.ncpu)\n\nQGIS=\"$OUTPUT_DIR/QGIS.app\"\n\n# if HOMEBREW_PREFIX undefined in env, then set to standard prefix\nif [ -z \"$HOMEBREW_PREFIX\" ]; then\n  HOMEBREW_PREFIX='/usr/local'\nfi\n\n# ensure we can delete previous QGIS.app, then delete it\nif [ -d \"${QGIS}\" ]; then\n  echo \"Removing existing QGIS.app...\"\n  /bin/chmod -R u+w \"${QGIS}\"\n  /bin/rm -fdR \"${QGIS}\"\nfi\n\n# set up environment\nexport PATH=${HOMEBREW_PREFIX}/opt/sip-qt4/bin:${HOMEBREW_PREFIX}/opt/qt-4/bin:${HOMEBREW_PREFIX}/opt/qca-qt4/bin:${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:${PATH}\necho \"PATH set to: ${PATH}\"\n\necho \"Installing QGIS...\"\nmake -j ${CPUCORES} install\nif [ $? -gt 0 ]; then\n    echo -e \"\\nERROR installing QGIS\"\n    exit 1\nfi\n\nif [ -d \"${QGIS}\" ]; then\n\n  # ensure we can write to QGIS.app bundle components\n  # NOTE: Homebrew's binaries are built as non-writable\n  echo \"Making QGIS.app user-writable...\"\n  /bin/chmod -R u+w \"${QGIS}\"\n\n  # write LSEnvironment entity to app's Info.plist\n  # this differs from LSEnvironment in app run from build directory; see set-qgis-app-env.py\n  echo \"Setting QGIS.app environment variables...\"\n  ${SCRIPT_DIR}/qgis2-set-app-env.py -p ${HOMEBREW_PREFIX} \"${QGIS}\"\n  if [ $? -gt 0 ]; then\n      echo -e \"\\nERROR setting installed QGIS.app environment variables\"\n      exit 1\n  fi\n\n  echo \"Setting QGIS Browser.app environment variables...\"\n  ${SCRIPT_DIR}/qgis2-set-app-env.py -p ${HOMEBREW_PREFIX} \"${QGIS}/Contents/MacOS/bin/QGIS Browser.app\"\n  if [ $? -gt 0 ]; then\n      echo -e \"\\nERROR setting installed QGIS Browser.app environment variables\"\n      exit 1\n  fi\n\nfi\n\nexit 0\n"
  },
  {
    "path": "scripts/qgis2-set-app-env.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"\n/***************************************************************************\n OSGeo4Mac Python startup script for setting env vars in dev builds and\n installs of QGIS when built off dependencies from homebrew-osgeo4mac tap\n                              -------------------\n        begin    : January 2014\n        copyright: (C) 2014 Larry Shaffer\n        email    : larrys at dakotacarto dot com\n ***************************************************************************/\n\n/***************************************************************************\n *                                                                         *\n *   This program is free software; you can redistribute it and/or modify  *\n *   it under the terms of the GNU General Public License as published by  *\n *   the Free Software Foundation; either version 2 of the License, or     *\n *   (at your option) any later version.                                   *\n *                                                                         *\n ***************************************************************************/\n\"\"\"\n\nimport os\nimport stat\nimport sys\nimport argparse\nimport subprocess\nfrom collections import OrderedDict\n\nHOME = os.path.expanduser('~')\nOSG_VERSION = '3.4.0'\nHOMEBREW_PREFIX = '/usr/local'\nQGIS_LOG_DIR = HOME + '/Library/Logs/QGIS'\nQGIS_LOG_FILE = QGIS_LOG_DIR + '/qgis-dev.log'\n\n\ndef env_vars(ap, hb, qb='', ql=''):\n    options = OrderedDict()\n    options['PATH'] = '{hb}/opt/gdal2/bin:{hb}/opt/gdal2-python/bin:{hb}/bin:{hb}/sbin:' + os.environ['PATH']\n\n    dyld_path = '{hb}/opt/gdal2/lib:{hb}/opt/sqlite/lib:{hb}/opt/libxml2/lib:{hb}/lib'\n    run_from_build = False\n    if qb:\n        qbr = os.path.realpath(qb)\n        if qbr in ap:\n            run_from_build = True\n            dyld_path = '{0}/output/lib:{0}/PlugIns/qgis:'.format(qbr) + \\\n                        dyld_path\n\n    # if QGIS_MACAPP_BUNDLE == 0, or running from build directory, find the\n    # right frameworks and libs first\n    if (run_from_build or\n            not os.path.exists(ap + '/Contents/Frameworks/QtCore.framework')):\n        options['DYLD_FRAMEWORK_PATH'] = \\\n            '{hb}/Frameworks:/System/Library/Frameworks'\n        options['DYLD_VERSIONED_LIBRARY_PATH'] = dyld_path\n\n    # isolate Python setup if Kyngchaos frameworks exist (they bogart sys.path)\n    # this keeps /Library/Python/2.7/site-packages from being searched\n    if (os.path.exists(hb + '/Frameworks/Python.framework') and\n            os.path.exists('/Library/Frameworks/GDAL.framework')):\n        options['PYQGIS_STARTUP'] = '{hb}/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac' \\\n                                    '/enviro/python_startup.py'\n        options['PYTHONHOME'] = '{hb}/Frameworks/Python.framework/Versions/2.7'\n\n    options['PYTHONPATH'] = '{hb}/lib/qt-4/python2.7/site-packages:' \\\n                            '{hb}/opt/gdal2-python/lib/python2.7/site-packages:' \\\n                            '{hb}/lib/python2.7/site-packages'\n    options['GDAL_DRIVER_PATH'] = '{hb}/lib/gdalplugins'\n    options['GDAL_DATA'] = '{hb}/opt/gdal2/share/gdal'\n    options['GRASS_PREFIX'] = '{hb}/opt/grass7/grass-base'\n    options['OSG_LIBRARY_PATH'] = '{hb}/lib/osgPlugins-' + OSG_VERSION\n    options['QGIS_LOG_FILE'] = ql\n    if run_from_build:\n        options['QT_PLUGIN_PATH'] = '{hb}﻿/opt/qt-4/plugins:{hb}/lib/qt-4/plugins'\n\n    for k, v in options.iteritems():\n        options[k] = v.format(hb=hb)\n\n    return options\n\n\ndef plist_bud(cmd, plist, quiet=False):\n    out = open(os.devnull, 'w') if quiet else None\n    subprocess.call(['/usr/libexec/PlistBuddy', '-c', cmd, plist],\n                    stdout=out, stderr=out)\n\n\ndef arg_parser():\n    parser = argparse.ArgumentParser(\n        description=\"\"\"\\\n            Script embeds Homebrew-prefix-relative environment variables in a\n            development QGIS.app bundle in the LSEnvironment entity of the app's\n            Info.plist. Running on app bundle from build or install directory,\n            or whether Kyngchaos.com or Qt development package installers have\n            been used, yeilds different results. QGIS_LOG_FILE is at (unless\n            defined in env var or command option): {0}\n            \"\"\".format(QGIS_LOG_FILE)\n    )\n    parser.add_argument('qgis_app_path',\n                        help='path to app bundle (relative or absolute)')\n    parser.add_argument(\n        '-p', '--homebrew-prefix', dest='hb',\n        metavar='homebrew_prefix',\n        help='homebrew prefix path, or set HOMEBREW_PREFIX (/usr/local default)'\n    )\n    parser.add_argument(\n        '-b', '--build-dir', dest='qb',\n        metavar='qgis_build_dir',\n        help='QGIS build directory'\n    )\n    parser.add_argument(\n        '-l', '--qgis-log', dest='ql',\n        metavar='qgis_log_file',\n        help='QGIS debug output log file'\n    )\n    return parser\n\n\ndef main():\n    # get defined args\n    args = arg_parser().parse_args()\n\n    ap = os.path.realpath(args.qgis_app_path)\n    if not os.path.isabs(ap) or not os.path.exists(ap):\n        print 'Application can not be resolved to an existing absolute path.'\n        sys.exit(1)\n\n    # QGIS Browser.app?\n    browser = 'Browser.' in ap\n\n    plist = ap + '/Contents/Info.plist'\n    if not os.path.exists(plist):\n        print 'Application Info.plist not found.'\n        sys.exit(1)\n\n    # generate list of environment variables\n    hb_prefix = HOMEBREW_PREFIX\n    if 'HOMEBREW_PREFIX' in os.environ:\n        hb_prefix = os.environ['HOMEBREW_PREFIX']\n    hb = os.path.realpath(args.hb) if args.hb else hb_prefix\n    if not os.path.isabs(hb) or not os.path.exists(hb):\n        print 'HOMEBREW_PREFIX not resolved to existing absolute path.'\n        sys.exit(1)\n\n    q_log = QGIS_LOG_FILE\n    if 'QGIS_LOG_FILE' in os.environ:\n        q_log = os.environ['QGIS_LOG_FILE']\n    ql = os.path.realpath(args.ql) if args.ql else q_log\n    try:\n        if not os.path.exists(ql):\n            if ql == os.path.realpath(QGIS_LOG_FILE):\n                # ok to auto-create log's parent directories\n                p_dir = os.path.dirname(ql)\n                if not os.path.exists(p_dir):\n                    os.makedirs(p_dir)\n            subprocess.call(['/usr/bin/touch', ql])\n    except OSError, e:\n        print 'Could not create QGIS log file at: {0}'.format(ql)\n        print 'Create an empty file at the indicated path for logging to work.'\n        print >>sys.stderr, \"Warning:\", e\n\n    qb = os.path.realpath(args.qb) if args.qb else ''\n    if qb and (not os.path.isabs(qb) or not os.path.exists(qb)):\n        print 'QGIS build directory not resolved to existing absolute path.'\n        sys.exit(1)\n\n    # write variables to Info.plist\n    evars = env_vars(ap, hb, qb, ql)\n\n    # opts_s = ''\n    # for k, v in evars.iteritems():\n    #     opts_s += '{0}={1}\\n'.format(k, v)\n    # print opts_s + '\\n'\n\n    # first delete any LSEnvironment setting, ignoring errors\n    # CAUTION!: this may not be what you want, if the .app already has\n    #           LSEnvironment settings\n    plist_bud('Delete :LSEnvironment', plist, quiet=True)\n\n    # re-add the LSEnvironment entry\n    plist_bud('Add :LSEnvironment dict', plist)\n\n    # add the variables\n    for k, v in evars.iteritems():\n        plist_bud(\"Add :LSEnvironment:{0} string '{1}'\".format(k, v), plist)\n\n    # set bundle identifier, so package installers don't accidentally install\n    # updates into dev bundles\n    app_id = 'qgis'\n    app_name = 'QGIS'\n    if browser:\n        app_id += '-browser'\n        app_name += ' Browser'\n    plist_bud('Set :CFBundleIdentifier org.qgis.{0}-dev'.format(app_id), plist)\n\n    # update modification date on app bundle, or changes won't take effect\n    subprocess.call(['/usr/bin/touch', ap])\n\n    # add environment-wrapped launcher shell script\n    wrp_scr = ap + '/Contents/MacOS/{0}.sh'.format(app_id)\n\n    # override vars that need to prepend existing vars\n    evars['PATH'] = '{hb}/opt/gdal2/bin:{hb}/opt/gdal2-python/bin:{hb}/bin:{hb}/sbin:$PATH'.format(hb=hb)\n    evars['PYTHONPATH'] = \\\n        '{hb}/lib/qt-4/python2.7/site-packages:' \\\n        '{hb}/opt/gdal2-python/lib/python2.7/site-packages:' \\\n        '{hb}/lib/python2.7/site-packages:$PYTHONPATH'.format(hb=hb)\n\n    if os.path.exists(wrp_scr):\n        os.remove(wrp_scr)\n\n    with open(wrp_scr, 'a') as f:\n        f.write('#!/bin/bash\\n\\n')\n\n        # get runtime parent directory\n        f.write('DIR=$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\"; pwd -P)\\n\\n')\n\n        # add the variables\n        for k, v in evars.iteritems():\n            f.write('export {0}={1}\\n'.format(k, v))\n\n        f.write('\\n\"$DIR/{0}\" \"$@\"\\n'.format(app_name))\n\n    os.chmod(wrp_scr, stat.S_IRUSR | stat.S_IWUSR | stat.S_IEXEC)\n\n    print 'Done setting variables'\n\nif __name__ == '__main__':\n    main()\n    sys.exit(0)\n"
  },
  {
    "path": "scripts/update-gdal.sh",
    "content": "#!/usr/bin/env bash\n\nVERSION=$1\n\nGDAL_URL=http://download.osgeo.org/gdal/${VERSION}/gdal-${VERSION}.tar.gz\nGDAL_GRASS_URL=http://download.osgeo.org/gdal/${VERSION}/gdal-grass-${VERSION}.tar.gz\nGDAL_AUTOTEST_URL=http://download.osgeo.org/gdal/${VERSION}/gdalautotest-${VERSION}.tar.gz\n\nwget $GDAL_URL\nwget $GDAL_GRASS_URL\nwget $GDAL_AUTOTEST_URL\n\nGDAL_SHA=$(shasum -a 256 gdal-${VERSION}.tar.gz | cut -f 1 -d \" \")\nGDAL_GRASS_SHA=$(shasum -a 256 gdal-grass-${VERSION}.tar.gz | cut -f 1 -d \" \")\nGDAL_AUTOTEST_SHA=$(shasum -a 256 gdalautotest-${VERSION}.tar.gz | cut -f 1 -d \" \")\n\nfind Formula -type f -iname \"gdal2*\" -exec perl -i -0pe \"s@url \\\"http://download.osgeo.org/gdal/[0-9.]+/gdal-[0-9.]+.tar.gz\\\"(\\n\\s*sha256 )\\\"\\w+\\\"@url \\\"${GDAL_URL}\\\"\\1\\\"${GDAL_SHA}\\\"@igs\" {} \\;\nfind Formula -type f -iname \"gdal2*\" -exec perl -i -0pe \"s@url \\\"http://download.osgeo.org/gdal/[0-9.]+/gdal-grass-[0-9.]+.tar.gz\\\"(\\n\\s*sha256 )\\\"\\w+\\\"@url \\\"${GDAL_GRASS_URL}\\\"\\1\\\"${GDAL_GRASS_SHA}\\\"@igs\" {} \\;\nfind Formula -type f -iname \"gdal2*\" -exec perl -i -0pe \"s@url \\\"http://download.osgeo.org/gdal/[0-9.]+/gdalautotest-[0-9.]+.tar.gz\\\"(\\n\\s*sha256 )\\\"\\w+\\\"@url \\\"${GDAL_AUTOTEST_URL}\\\"\\1\\\"${GDAL_AUTOTEST_SHA}\\\"@igs\" {} \\;\n\nrm gdal-${VERSION}.tar.gz\nrm gdal-grass-${VERSION}.tar.gz\nrm gdalautotest-${VERSION}.tar.gz\n"
  },
  {
    "path": "travis/after_script.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac travis ci - after_script.sh\n#    ---------------------\n#    Date                 : Dec 2016\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\n# ccache -s\n"
  },
  {
    "path": "travis/before_cache.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac travis ci - before_cache.sh\n#    ---------------------\n#    Date                 : Aug 2017\n#    Copyright            : (C) 2017 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\nrm -Rf $HOME/Library/Caches/Homebrew/*\n\n# Remove unneeded formula for cache, e.g. occasional build-only packages\nnix_f=\"\ngcc\n\"\n\nfor f in ${nix_f}; do\n  echo \"Uninstalling formula ${f}...\"\n  brew uninstall --force --ignore-dependencies ${f} || true\ndone\n\n# Remove large or unnecessary formulae, so they are not cached\nun_f=\"\ngdal2-\ngdal1-\ngrass\nmapserver\nmarble\nmonteverdi\npdfium\nqgis\nqt5\norfeo\nsaga-gis\ntaudem\n\"\n\nbl=\" $(brew list)\"\n# echo -n ${bl}\nnon_dep_f=''\nfor f in ${un_f};do\n  non_dep_f+=\"$(echo -n ${bl} | egrep -o \" ${f}\\S*\") \"\ndone\n\nfor f in ${non_dep_f};do\n  echo \"Uninstalling non-dependency formula ${f}...\"\n  brew uninstall --force --ignore-dependencies ${f} || true\ndone\n\nbrew cleanup\n\n# Let's see what's actually being cached\nbrew list --versions\n"
  },
  {
    "path": "travis/before_deploy.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac travis ci - before_deploy.sh\n#    ---------------------\n#    Date                 : Dec 2016\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\nset -e\n\ncd ${TRAVIS_BUILD_DIR}\n# Setup Git configuration\nCOMMIT_USER=$(git log --format='%an' ${TRAVIS_COMMIT}^\\!)\nCOMMIT_EMAIL=$(git log --format='%ae' ${TRAVIS_COMMIT}^\\!)\ngit config user.name \"Geo Ninja\"\ngit config user.email \"qgisninja@gmail.com\"\nREPO=$(git config remote.origin.url)\nSSH_REPO=${REPO/https:\\/\\/github.com\\//git@github.com:}\n\n# Checkout on the proper branch\n# see https://gist.github.com/mitchellkrogza/a296ab5102d7e7142cc3599fca634203\nhead_ref=$(git rev-parse HEAD)\nif [[ $? -ne 0 || ! $head_ref ]]; then\n    err \"failed to get HEAD reference\"\n    return 1\nfi\nbranch_ref=$(git rev-parse \"$TRAVIS_BRANCH\")\nif [[ $? -ne 0 || ! $branch_ref ]]; then\n    err \"failed to get $TRAVIS_BRANCH reference\"\n    return 1\nfi\nif [[ $head_ref != $branch_ref ]]; then\n    msg \"HEAD ref ($head_ref) does not match $TRAVIS_BRANCH ref ($branch_ref)\"\n    err \"someone may have pushed new commits before this build cloned the repo\"\n    return 1\nfi\nif ! git checkout \"$TRAVIS_BRANCH\"; then\n    err \"failed to checkout $TRAVIS_BRANCH\"\n    return 1\nfi\n\n\n# Build the bottles\nBUILT_BOTTLES=\nmkdir -p bottles\n\npushd bottles\n  # S3 bucket isn't currently working for the Travis pro repo, so we're switching to Bintray, for now.\n  # BOTTLE_ROOT=https://osgeo4mac.s3.amazonaws.com/bottles\n  BOTTLE_ROOT=https://dl.bintray.com/homebrew-osgeo/osgeo-bottles\n  for f in ${CHANGED_FORMULAE};do\n    echo \"Bottling changed formula ${f}...\"\n    brew bottle --verbose --json --root-url=${BOTTLE_ROOT} ${TRAVIS_REPO_SLUG}/${f}\n\n    # temporary duplication of 10.2-Xcode-8.x-built bottles to 10.3 bottles\n    # Do the bottle duplication per formula, so we can merge the changes\n    for art in ${f}*.sierra.bottle.*; do\n      new_name=${art/.sierra./.high_sierra.}\n      # Remove double dashes introduced by the latest changes to Homebrew bottling.\n      # This may need to be reverted later, but this at least normalizes the bottle names with what's in the json files.\n      cp -a ${art} ${new_name/--/-}\n      # Move the sierra bottle and json file\n      mv ${art} ${art/--/-}\n    done\n    for json in ${f}*.high_sierra.bottle*.json; do\n      sed -i '' s@sierra@high_sierra@g ${json}\n    done\n\n    # temporary duplication of 10.2-Xcode-8.x-built bottles to 10.4 bottles\n    # Do the bottle duplication per formula, so we can merge the changes\n    for art in ${f}*.sierra.bottle.*; do\n      new_name=${art/.sierra./.mojave.}\n      # Remove double dashes introduced by the latest changes to Homebrew bottling.\n      # This may need to be reverted later, but this at least normalizes the bottle names with what's in the json files.\n      cp -a ${art} ${new_name/--/-}\n      # Move the sierra bottle and json file\n      mv ${art} ${art/--/-}\n    done\n    for json in ${f}*.mojave.bottle*.json; do\n      sed -i '' s@sierra@mojave@g ${json}\n    done\n\n    # Do Merge bottles with the formula\n    # Don't commit anything, we'll do that after updating all the formulae\n    # Catch the eror and store it to a variable\n    if result=$(brew bottle --merge --write --no-commit ${f}*.json 2>&1); then\n      BUILT_BOTTLES=\"$BUILT_BOTTLES ${f}\"\n    else\n      # If there's an error, remove the json and bottle files, we don't want them anymore.\n      echo \"Unable to bottle ${f}\"\n      echo $result\n      rm ${f}*.json\n      rm ${f}*.tar.gz\n    fi\n  done\npopd\n\n# Now do the commit and push\n\ngit add -vA Formula/*.rb\ngit commit -m \"Updated bottles for: ${BUILT_BOTTLES}\n\nCommitted for ${COMMIT_USER}<${COMMIT_EMAIL}>\n[ci skip]\"\n\n# Now that we're all set up, we can push.\ngit push ${SSH_REPO} $TRAVIS_BRANCH\n"
  },
  {
    "path": "travis/before_install.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac travis ci - before_install.sh\n#    ---------------------\n#    Date                 : Dec 2016\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\n\nif [ -n \"${DEBUG_TRAVIS}\" ];then\n  brew list --versions\nfi\n\n# Forcibly remove all versions of unneeded default formula provided by travis or pre-cached\nnix_f=\"\ngdal\npostgis\nsip\npyqt\nqscintilla2\n\"\n\nfor f in ${nix_f}; do\n  brew uninstall --force --ignore-dependencies ${f} || true\ndone\n\n# Add taps\n# brew tap brewsci/science || true\n# brew tap brewsci/bio || true\n# brew tap caskroom/cask || true\n\n# Keeps gcc from being linked\nbrew cask reinstall oclint || true\nbrew cask uninstall oclint || true\n\n# brew update || brew update\n# brew update - slow\nbrew update-reset\n\n# Set up ccache (doesn't work with `brew install <formula>`)\n#brew install ccache\n#export PATH=\"/usr/local/opt/ccache/libexec:$PATH\"\n#\n#ccache -M 500M\n#ccache -z\n\nfor f in ${CHANGED_FORMULAE};do\n  echo \"Homebrew setup for changed formula ${f}...\"\n  deps=$(brew deps --include-build ${f})\n  echo \"${f} dependencies:\"\n  echo \"travis_fold:start:deps\"\n  echo \"${deps}\"\n  echo \"travis_fold:end:deps\"\n\n  # Upgrade Python3 to the latest version, before installing Python2. Per the discussion here\n  # https://discourse.brew.sh/t/brew-install-python3-fails/1756/3\n  if [ \"$(echo ${deps} | grep -c '[python|python3]')\" != \"0\" ];then\n    echo \"Installing and configuring Homebrew Python3\"\n    brew outdated python || brew upgrade python\n\n    # Set up Python .pth files\n    # get python short version (major.minor)\n    PY_VER=$(${HOMEBREW_PREFIX}/bin/python3 -c \"import sys;print('{0}.{1}'.format(sys.version_info[0],sys.version_info[1]).strip())\")\n    if [ -n \"${DEBUG_TRAVIS}\" ];then\n      echo $PY_VER\n    fi\n    mkdir -p ${HOME}/Library/Python/${PY_VER}/lib/python/site-packages\n    echo 'import site; site.addsitedir(\"${HOMEBREW_PREFIX}/lib/python${PY_VER}/site-packages\")' \\\n      >> ${HOME}/Library/Python/${PY_VER}/lib/python/site-packages/homebrew.pth\n    echo 'import site; site.addsitedir(\"${HOMEBREW_PREFIX}/opt/osgeo-gdal/lib/python${PY_VER}/site-packages\")' \\\n      >> ${HOME}/Library/Python/${PY_VER}/lib/python/site-packages/gdal2.pth\n\n    if [[ \"${f}\" =~ \"osgeo-gdal\" ]];then\n      echo \"Installing GDAL 2 Python3 dependencies\"\n      ${HOMEBREW_PREFIX}/bin/pip3 install numpy\n    fi\n  fi\n\n  if [ \"$(echo ${deps} | grep -c 'python@2')\" != \"0\" ];then\n    echo \"Installing and configuring Homebrew Python2\"\n    # If we just upgraded to Python3, install python2, otherwise, update it\n    if [ \"$(echo ${deps} | grep -c '[python3|python]')\" != \"0\" ];then\n      brew install python@2\n    else\n      brew outdated python@2 || brew upgrade python@2\n\n    fi\n    # Set up Python .pth files\n    # get python short version (major.minor)\n    PY_VER=$(${HOMEBREW_PREFIX}/bin/python2 -c \"import sys;print('{0}.{1}'.format(sys.version_info[0],sys.version_info[1]).strip())\")\n    if [ -n \"${DEBUG_TRAVIS}\" ];then\n      echo $PY_VER\n    fi\n    mkdir -p ${HOME}/Library/Python/${PY_VER}/lib/python/site-packages\n    echo 'import site; site.addsitedir(\"${HOMEBREW_PREFIX}/lib/python${PY_VER}/site-packages\")' \\\n      >> ${HOME}/Library/Python/${PY_VER}/lib/python/site-packages/homebrew.pth\n    echo 'import site; site.addsitedir(\"${HOMEBREW_PREFIX}/opt/osgeo-gdal/lib/python${PY_VER}/site-packages\")' \\\n      >> ${HOME}/Library/Python/${PY_VER}/lib/python/site-packages/gdal2.pth\n\n    if [[ \"${f}\" =~ \"osgeo-gdal\" ]];then\n      echo \"Installing GDAL 2 Python2 dependencies\"\n      ${HOMEBREW_PREFIX}/bin/pip2 install numpy\n    fi\n  fi\n  # Special handling of grass7, because it needs to be unlinked\n  if [ \"$(echo ${deps} | grep -c 'osgeo-grass')\" != \"0\" ];then\n    echo \"Installing and unlinking grass7\"\n    # GDAL gets its numpy installed via pip, but grass also has a dependency, so we need to force it.\n    brew install numpy || brew link --overwrite numpy\n    brew install osgeo-grass\n    brew unlink osgeo-grass\n  fi\n\ndone\n"
  },
  {
    "path": "travis/before_script.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac travis ci - before_script.sh\n#    ---------------------\n#    Date                 : Dec 2016\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n"
  },
  {
    "path": "travis/bintray-upload.json",
    "content": "{\n  \"package\": {\n    \"name\": \"bottles\",\n    \"repo\": \"osgeo-bottles\",\n    \"subject\": \"homebrew-osgeo\",\n    \"issue_tracker_url\": \"https://github.com/OSGeo/homebrew-osgeo4mac/issues\",\n    \"vcs_url\": \"https://github.com/OSGeo/homebrew-osgeo4mac.git\",\n    \"licenses\": [\n      \"MIT\"\n    ],\n    \"public_download_numbers\": true,\n    \"public_stats\": true\n  },\n  \"version\": {\n    \"name\": \"0.1\"\n  },\n  \"files\": [\n    {\n      \"includePattern\": \"bottles/(.*)\",\n      \"uploadPattern\": \"$1\"\n    }\n  ],\n  \"publish\": true\n}"
  },
  {
    "path": "travis/changed_formulas.sh",
    "content": "#!/usr/bin/env bash\nset -e\n\n\n# manually added by env var. Will not be filtered by skip-formulas.txt\n# If manual formulae are specified, changed files will be ignored\n# This avoids rebuilding bottles when triggered against master\nif [[ -n ${TRAVIS_MANUAL_FORMULAE} ]]; then\n\techo \"${TRAVIS_MANUAL_FORMULAE}\"\nelse\n\n\tif [[ ! -z  $TRAVIS_PULL_REQUEST_BRANCH  ]]; then\n\t\t# if on a PR, just analyze the changed files\n\t\tFILES=$(git diff --diff-filter=AM --name-only $(git merge-base HEAD ${TRAVIS_BRANCH} ) )\n\telif [[ ! -z  $TRAVIS_COMMIT_RANGE  ]]; then\n\t\tFILES=$(git diff --diff-filter=AM --name-only ${TRAVIS_COMMIT_RANGE/.../..} )\n\telse\n\t\tFILES=\n\tfi\n\n\tFORMULAS=\n\tfor f in $FILES;do\n\t\tFORMULAS=\"$FORMULAS $(echo $f | sed -n -E 's#^Formula/(.+)\\.rb$#\\1#p')\"\n\tdone\n\n\t# keep formulas only\n\t# FORMULAS=$(sed -n -E 's#^Formula/(.+)\\.rb$#\\1#p' <<< $FILES)\n\t# skip formulas\n  comm -1 -3 <(cat travis/skip-formulas.txt | sort -u ) <(echo ${FORMULAS} | tr ' ' '\\n' | sort -u )\nfi\n"
  },
  {
    "path": "travis/install.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac travis ci - install.sh\n#    ---------------------\n#    Date                 : Dec 2016\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\nset -e\n\nfor f in ${CHANGED_FORMULAE};do\n  echo \"Installing dependencies for changed formula ${f}...\"\n  FLAGS=\"--only-dependencies --build-bottle\"\n\n  brew install ${FLAGS} ${TRAVIS_REPO_SLUG}/${f}&\n  PID=$!\n  # add progress to ensure Travis doesn't complain about no output\n  while true; do\n    sleep 30\n    if jobs -rp | grep ${PID} >/dev/null; then\n      echo \".\"\n    else\n      echo\n      break\n    fi\n  done\ndone\n"
  },
  {
    "path": "travis/script.sh",
    "content": "#!/usr/bin/env bash\n###########################################################################\n#    homebrew-osgeo4mac travis ci - script.sh\n#    ---------------------\n#    Date                 : Dec 2016\n#    Copyright            : (C) 2016 by Boundless Spatial, Inc.\n#    Author               : Larry Shaffer\n#    Email                : lshaffer at boundlessgeo dot com\n###########################################################################\n#                                                                         #\n#   This program is free software; you can redistribute it and/or modify  #\n#   it under the terms of the GNU General Public License as published by  #\n#   the Free Software Foundation; either version 2 of the License, or     #\n#   (at your option) any later version.                                   #\n#                                                                         #\n###########################################################################\n\nset -e\n\nfor f in ${CHANGED_FORMULAE};do\n  deps=$(brew deps --include-build ${f})\n\n  # fix error: Unable to import PyQt5.QtCore\n  # build qscintilla2\n  if [ \"$(echo ${deps} | grep -c 'osgeo-pyqt')\" != \"0\" ];then\n    brew reinstall ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/osgeo-pyqt\n    brew unlink osgeo-pyqt && brew link osgeo-pyqt --force\n    /usr/local/bin/pip2 install enum34\n    /usr/local/bin/python2 -c \"import PyQt5.QtCore\"\n    /usr/local/bin/python3 -c \"import PyQt5.QtCore\"\n  fi\n\n  # fix error: 'libintl.h' file not found\n  # build qgis with grass\n  if [ \"$(echo ${deps} | grep -c 'osgeo-grass')\" != \"0\" ];then\n    brew reinstall gettext\n    brew unlink gettext && brew link --force gettext\n  fi\n\n  # if [[ $(brew list --versions ${f}) ]]; then\n  #   echo \"Clearing previously installed/cached formula ${f}...\"\n  #   brew uninstall --force --ignore-dependencies ${f} || true\n  # fi\n\n  echo \"Installing changed formula ${f}...\"\n  # Default installation flag set\n  FLAGS=\"--build-bottle\"\n\n  brew install ${FLAGS} ${TRAVIS_REPO_SLUG}/${f}&\n  PID=$!\n  # add progress to ensure Travis doesn't complain about no output\n  while true; do\n    sleep 30\n    if jobs -rp | grep ${PID} >/dev/null; then\n      echo \".\"\n    else\n      echo\n      break\n    fi\n  done\n\n  echo \"Testing changed formula ${f}...\"\n  # does running postinstall mess up the bottle?\n  # (mentioned that it is skipped if installing with --build-bottle)\n  # brew postinstall ${f}\n  brew test ${TRAVIS_REPO_SLUG}/${f}\ndone\n"
  },
  {
    "path": "travis/skip-formulas.txt",
    "content": "ossgeo-gdal-ecwjp2\nosgeo-gdal-oracle\nosgeo-gdal-mrsid\ngpkgtools\n"
  }
]