Repository: OSGeo/homebrew-osgeo4mac Branch: master Commit: 22c43a0ea87e Files: 272 Total size: 1.2 MB Directory structure: gitextract_dhh04ofh/ ├── .ciignore ├── .circleci/ │ ├── after_script.sh │ ├── before_deploy.sh │ ├── before_install.sh │ ├── changed_formulas.sh │ ├── config.yml │ ├── install.sh │ ├── script.sh │ ├── set_env.sh │ └── skip-formulas.txt ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ ├── PULL_REQUEST_TEMPLATE.md │ └── stale.yml ├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Formula/ │ ├── mapcache.rb │ ├── mapserver6.rb │ ├── osgeo-ecwjp2-sdk.rb │ ├── osgeo-fcgi-debug.rb │ ├── osgeo-filegdb-api.rb │ ├── osgeo-fyba.rb │ ├── osgeo-gdal-ecwjp2.rb │ ├── osgeo-gdal-filegdb.rb │ ├── osgeo-gdal-grass.rb │ ├── osgeo-gdal-mdb.rb │ ├── osgeo-gdal-mongodb.rb │ ├── osgeo-gdal-mrsid.rb │ ├── osgeo-gdal-mysql.rb │ ├── osgeo-gdal-ogdi.rb │ ├── osgeo-gdal-oracle.rb │ ├── osgeo-gdal-pdf.rb │ ├── osgeo-gdal-python.rb │ ├── osgeo-gdal-sosi.rb │ ├── osgeo-gdal.rb │ ├── osgeo-gmt.rb │ ├── osgeo-gpkgtools.rb │ ├── osgeo-grass.rb │ ├── osgeo-hdf4.rb │ ├── osgeo-hexer.rb │ ├── osgeo-iipsrv.rb │ ├── osgeo-insighttoolkit.rb │ ├── osgeo-insighttoolkit@4.rb │ ├── osgeo-lastools.rb │ ├── osgeo-laszip@2.rb │ ├── osgeo-laz-perf.rb │ ├── osgeo-libgeotiff.rb │ ├── osgeo-libght.rb │ ├── osgeo-libkml.rb │ ├── osgeo-liblas.rb │ ├── osgeo-libnoise.rb │ ├── osgeo-libpqxx.rb │ ├── osgeo-libspatialite.rb │ ├── osgeo-mapnik.rb │ ├── osgeo-marble.rb │ ├── osgeo-matplotlib.rb │ ├── osgeo-mongo-cxx-driver-legacy.rb │ ├── osgeo-mrsid-sdk.rb │ ├── osgeo-muparserx.rb │ ├── osgeo-netcdf.rb │ ├── osgeo-nitro.rb │ ├── osgeo-ogdi.rb │ ├── osgeo-opencollada.rb │ ├── osgeo-openscenegraph.rb │ ├── osgeo-oracle-client-sdk.rb │ ├── osgeo-orfeo.rb │ ├── osgeo-osgearth.rb │ ├── osgeo-osgqt.rb │ ├── osgeo-osm2po.rb │ ├── osgeo-ossim.rb │ ├── osgeo-pcl.rb │ ├── osgeo-pdal.rb │ ├── osgeo-pdfium.rb │ ├── osgeo-pgadmin3-lts.rb │ ├── osgeo-pgsql-ogr-fdw.rb │ ├── osgeo-pointcloud.rb │ ├── osgeo-points2grid.rb │ ├── osgeo-postgis.rb │ ├── osgeo-postgis@2.4.rb │ ├── osgeo-postgis@2.5.rb │ ├── osgeo-postgresql.rb │ ├── osgeo-postgresql@10.rb │ ├── osgeo-postgresql@11.rb │ ├── osgeo-proj.rb │ ├── osgeo-psqlodbc.rb │ ├── osgeo-pyqt-webkit.rb │ ├── osgeo-pyspatialite.rb │ ├── osgeo-qscintilla2.rb │ ├── osgeo-qt-mysql.rb │ ├── osgeo-qt-odbc.rb │ ├── osgeo-qt-psql.rb │ ├── osgeo-qt-webkit.rb │ ├── osgeo-qtkeychain.rb │ ├── osgeo-saga-lts.rb │ ├── osgeo-saga.rb │ ├── osgeo-shark.rb │ ├── osgeo-simple-tiles.rb │ ├── osgeo-six.rb │ ├── osgeo-taudem.rb │ ├── osgeo-vigra.rb │ ├── osgeo-vtk.rb │ ├── osgeo-whitebox-tools.rb │ ├── osgeo-whitebox.rb │ ├── prepair.rb │ ├── qca-qt@5.7.rb │ ├── qt-ifw-qt5.rb │ ├── qt-ifw.rb │ ├── qt5-webkit-qt@5.7.rb │ ├── qtkeychain-qt@5.7.rb │ └── travis-cache-seed.rb ├── LICENSE ├── README.md ├── Requirements/ │ ├── gdal_third_party.rb │ ├── grass_requirements.rb │ └── qgis_requirements.rb ├── Strategies/ │ └── cache-download.rb ├── boneyard/ │ ├── brew-stack.rb │ ├── enki.rb │ ├── gdal-110.rb │ ├── gdal-19.rb │ ├── gdal-20.rb │ ├── gdal-ecwjp2.rb │ ├── gdal-filegdb.rb │ ├── gdal-grass64.rb │ ├── gdal-mrsid.rb │ ├── gdal-oracle.rb │ ├── gdal-sosi.rb │ ├── gdal1-ecwjp2.rb │ ├── gdal1-filegdb.rb │ ├── gdal1-grass6.rb │ ├── gdal1-mrsid.rb │ ├── gdal1-mysql.rb │ ├── gdal1-oracle.rb │ ├── gpsbabel-qt4.rb │ ├── grass-64.rb │ ├── grass-70.rb │ ├── grass6.rb │ ├── grass7-lts.rb │ ├── libgpkg.rb │ ├── mapcache-12.rb │ ├── mapserver-64.rb │ ├── minizip.rb │ ├── openjpeg20.rb │ ├── orfeo-32.rb │ ├── orfeo-40.rb │ ├── orfeo-42.rb │ ├── orfeo-54.rb │ ├── orfeo5.rb │ ├── orfeo5@5.4.rb │ ├── osgearth-qt4.rb │ ├── osgearth.rb │ ├── osgeo-proj@5.rb │ ├── osgeo-pyqt.rb │ ├── osgeo-qgis-ltr.rb │ ├── osgeo-qgis-res.rb │ ├── osgeo-qgis.rb │ ├── osgeo-sip.rb │ ├── ossim@2.1.rb │ ├── pdfium.rb │ ├── points2grid.rb │ ├── pyqt-qt4.rb │ ├── qca-qt4.rb │ ├── qgis-18.rb │ ├── qgis-20.rb │ ├── qgis-214.rb │ ├── qgis-22.rb │ ├── qgis-24.rb │ ├── qgis-26.rb │ ├── qgis-28.rb │ ├── qgis-ltr@2.rb │ ├── qjson-qt4.rb │ ├── qscintilla2-qt4.rb │ ├── qscintilla2.rb │ ├── qt-4.rb │ ├── qt4-mysql.rb │ ├── qt4-oracle.rb │ ├── qtkeychain-qt4.rb │ ├── quazip.rb │ ├── qutepart.rb │ ├── qwt-qt4.rb │ ├── qwt-qt4@5.2.rb │ ├── qwt60.rb │ ├── qwtpolar-qt4.rb │ ├── qwtpolar.rb │ ├── sip-qt4.rb │ ├── spatialite-gui-17.rb │ ├── v8318.rb │ ├── wxmac-28.rb │ ├── wxmac-29.rb │ └── wxmac-mono.rb ├── commit-msg.sh ├── docs/ │ ├── 404.html │ ├── Gemfile │ ├── Rakefile │ ├── _config.yml │ ├── _includes/ │ │ ├── head.html │ │ ├── nav.html │ │ ├── new-window-fix.html │ │ ├── open-embed.html │ │ └── scripts.html │ ├── _layouts/ │ │ ├── about.html │ │ ├── default.html │ │ ├── home.html │ │ ├── page.html │ │ └── post.html │ ├── _sass/ │ │ ├── base.scss │ │ ├── buttons.scss │ │ ├── code.scss │ │ ├── color_schemes/ │ │ │ └── dark.scss │ │ ├── content.scss │ │ ├── custom/ │ │ │ └── custom.scss │ │ ├── labels.scss │ │ ├── layout.scss │ │ ├── navigation.scss │ │ ├── search.scss │ │ ├── support/ │ │ │ ├── _functions.scss │ │ │ ├── _variables.scss │ │ │ ├── mixins/ │ │ │ │ ├── _buttons.scss │ │ │ │ ├── _layout.scss │ │ │ │ ├── _typography.scss │ │ │ │ └── mixins.scss │ │ │ └── support.scss │ │ ├── tables.scss │ │ ├── typography.scss │ │ ├── utilities/ │ │ │ ├── _colors.scss │ │ │ ├── _layout.scss │ │ │ ├── _lists.scss │ │ │ ├── _spacing.scss │ │ │ ├── _typography.scss │ │ │ └── utilities.scss │ │ └── vendor/ │ │ └── normalize.scss/ │ │ ├── README.md │ │ ├── normalize.scss │ │ └── package.json │ ├── assets/ │ │ ├── css/ │ │ │ ├── dark-mode-preview.scss │ │ │ └── just-the-docs.scss │ │ └── js/ │ │ ├── just-the-docs.js │ │ └── search-data.json │ ├── bin/ │ │ └── just-the-docs │ ├── docs/ │ │ ├── developing-on-QGIS-using-OSGeo4Mac.md │ │ ├── installing-QGIS-3.md │ │ ├── reporting-issues.md │ │ └── troubleshooting.md │ ├── index.md │ ├── just-the-docs.gemspec │ ├── lib/ │ │ └── tasks/ │ │ └── search.rake │ ├── package.json │ └── script/ │ └── build ├── enviro/ │ ├── osgeo4mac-qt4.env │ ├── osgeo4mac.env │ ├── python_startup.py │ └── qgis-osgeo4mac-ctest-env.sh ├── formula_renames.json ├── scripts/ │ ├── Mac/ │ │ ├── find_all-installed_w-options.sh │ │ └── find_non-bottle-builds_w-options.sh │ ├── qgis2-cmake-options.py │ ├── qgis2-creator-build.sh │ ├── qgis2-creator-install.sh │ ├── qgis2-set-app-env.py │ └── update-gdal.sh ├── travis/ │ ├── after_script.sh │ ├── before_cache.sh │ ├── before_deploy.sh │ ├── before_install.sh │ ├── before_script.sh │ ├── bintray-upload.json │ ├── changed_formulas.sh │ ├── install.sh │ ├── script.sh │ └── skip-formulas.txt └── travis_deploy_key.enc ================================================ FILE CONTENTS ================================================ ================================================ FILE: .ciignore ================================================ Aliases/* boneyard/* enviro/* Requirements/* scripts/* Strategies/* travis/* .circleci/* LICENSE .ciignore .gitignore .git *.sh *.enc *.md *.yml *.json *.txt *.py *.env ================================================ FILE: .circleci/after_script.sh ================================================ #!/usr/bin/env bash ########################################################################### # homebrew-osgeo4mac circle ci - after_script.sh # --------------------- # Date : Dec 2019 # Copyright : (C) 2016 by Boundless Spatial, Inc. # Author : Larry Shaffer - FJ Perini # Email : lshaffer at boundlessgeo dot com ########################################################################### # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # ########################################################################### # OS X version # sw_vers -productVersion # sw_vers -productVersion | cut -d '.' -f 1,2 # MAJOR_MAC_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $1 "." $2}') # system_profiler SPSoftwareDataType # Build the actual bottles # In Travis, this used to be part of the deploy phase, but now it needs # to run as part of the original build process, but only on master. mkdir /tmp/bottles if [ "$CIRCLE_BRANCH" != "master" ]; then pushd /tmp/bottles # BOTTLE_ROOT=https://dl.bintray.com/homebrew-osgeo/osgeo-bottles BOTTLE_ROOT=https://bottle.download.osgeo.org for f in ${CHANGED_FORMULAE};do echo "Bottling changed formula ${f}..." brew bottle --verbose --json --root-url=${BOTTLE_ROOT} osgeo/osgeo4mac/${f} # for art in ${f}*.sierra.bottle.*; do # Remove double dashes introduced by the latest changes to Homebrew bottling. # This may need to be reverted later, but this at least normalizes the bottle names with what's in the json files. # Move the sierra bottle and json file # mv ${art} ${art/--/-} # done # temporary duplication of 10.3-Xcode-10.x-built bottles to 10.4 bottles # Do the bottle duplication per formula, so we can merge the changes for art in ${f}*.high_sierra.bottle.*; do new_name=${art/.high_sierra./.mojave.} # Remove double dashes introduced by the latest changes to Homebrew bottling. # This may need to be reverted later, but this at least normalizes the bottle names with what's in the json files. cp -a ${art} ${new_name/--/-} # Move the high_sierra bottle and json file mv ${art} ${art/--/-} done for json in ${f}*.mojave.bottle*.json; do sed -i '' s@high_sierra@mojave@g ${json} done # temporary duplication # Do the bottle duplication per formula, so we can merge the changes for art in ${f}*.high_sierra.bottle.*; do new_name=${art/.high_sierra./.catalina.} # Remove double dashes introduced by the latest changes to Homebrew bottling. # This may need to be reverted later, but this at least normalizes the bottle names with what's in the json files. cp -a ${art} ${new_name/--/-} # Move the high_sierra bottle and json file mv ${art} ${art/--/-} done for json in ${f}*.catalina.bottle*.json; do sed -i '' s@high_sierra@catalina@g ${json} done done ls popd fi ================================================ FILE: .circleci/before_deploy.sh ================================================ #!/usr/bin/env bash ########################################################################### # homebrew-osgeo4mac circle ci - before_deploy.sh # --------------------- # Date : Dec 2019 # Copyright : (C) 2016 by Boundless Spatial, Inc. # Author : Larry Shaffer - FJ Perini # Email : lshaffer at boundlessgeo dot com ########################################################################### # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # ########################################################################### set -e if [ "$CIRCLE_BRANCH" == "bottles" ] && [ "$CHANGED_FORMULAE" != "" ]; then # Setup Git configuration COMMIT_USER=$(git log --format='%an' ${CIRCLE_SHA1}^\!) COMMIT_EMAIL=$(git log --format='%ae' ${CIRCLE_SHA1}^\!) git config user.name "geo-ninja" git config user.email "qgisninja@gmail.com" REPO=$(git config remote.origin.url) SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} # Checkout on the proper branch # see https://gist.github.com/mitchellkrogza/a296ab5102d7e7142cc3599fca634203 head_ref=$(git rev-parse HEAD) if [[ $? -ne 0 || ! $head_ref ]]; then err "failed to get HEAD reference" return 1 fi branch_ref=$(git rev-parse "$CIRCLE_BRANCH") if [[ $? -ne 0 || ! $branch_ref ]]; then err "failed to get $CIRCLE_BRANCH reference" return 1 fi if [[ $head_ref != $branch_ref ]]; then msg "HEAD ref ($head_ref) does not match $CIRCLE_BRANCH ref ($branch_ref)" err "someone may have pushed new commits before this build cloned the repo" return 1 fi if ! git checkout "$CIRCLE_BRANCH"; then err "failed to checkout $CIRCLE_BRANCH" return 1 fi BUILT_BOTTLES= pushd /tmp/workspace/bottles/ for f in ${CHANGED_FORMULAE};do echo "Updating changed formula ${f} with new bottles..." # Do Merge bottles with the formula # Don't commit anything, we'll do that after updating all the formulae # Catch the eror and store it to a variable if result=$(brew bottle --merge --write --no-commit ${f}*.json 2>&1); then BUILT_BOTTLES="$BUILT_BOTTLES ${f}" else # If there's an error, remove the json and bottle files, we don't want them anymore. echo "Unable to bottle ${f}" echo $result rm ${f}*.json rm ${f}*.tar.gz fi done popd # Now do the commit and push echo "Commit and push..." git add -vA Formula/*.rb git commit -m "Updated bottles for: ${BUILT_BOTTLES} Committed for ${COMMIT_USER}<${COMMIT_EMAIL}> [ci skip]" # fix if there is a new commit in master echo "Pull rebase..." # git checkout $CIRCLE_BRANCH # git merge master # git pull # git branch --set-upstream-to=origin/ bottles git checkout bottles git rebase bottles git checkout bottles git merge bottles git pull ${SSH_REPO} $CIRCLE_BRANCH git branch --set-upstream-to=origin/bottles bottles git pull --rebase # Now that we're all set up, we can push. git push ${SSH_REPO} $CIRCLE_BRANCH # echo "Upload to Bintray..." cd /tmp/workspace/bottles/ # files=$(echo *.tar.gz | tr ' ' ',') # 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/ echo "Upload Bottles..." # use ssh # ssh-add -l # echo -e "\nIdentityFile ~/.ssh/id_rsa" >> ~/.ssh/config # cat ~/.ssh/config # ls ~/.ssh # brew install https://raw.githubusercontent.com/hudochenkov/homebrew-sshpass/master/sshpass.rb # sshpass -e scp -P 50023 -o stricthostkeychecking=no -r ./*.tar.gz fjperini@bottle.download.osgeo.org:/osgeo/bottle scp -P 50023 -o stricthostkeychecking=no -r ./*.tar.gz fjperini@bottle.download.osgeo.org:/osgeo/bottle fi ================================================ FILE: .circleci/before_install.sh ================================================ #!/usr/bin/env bash ########################################################################### # homebrew-osgeo4mac circle ci - before_install.sh # --------------------- # Date : Dec 2019 # Copyright : (C) 2016 by Boundless Spatial, Inc. # Author : Larry Shaffer - FJ Perini # Email : lshaffer at boundlessgeo dot com ########################################################################### # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # ########################################################################### set -o errexit set -o xtrace if [ "$CIRCLE_BRANCH" != "master" ]; then for f in ${CHANGED_FORMULAE};do echo 'Setting up, before install' if [ -n "${DEBUG_CI}" ];then brew list --versions fi # Forcibly remove all versions of unneeded default formula provided by travis or pre-cached nix_f=" gdal sip pyqt qscintilla2 postgresql@10 postgis " for nf in ${nix_f}; do brew uninstall --force --ignore-dependencies ${nf} || true done # brew update > /dev/null # brew update - slow # brew update-reset # fix: Permission Denied When Creating Directory or Writing a File # https://support.circleci.com/hc/en-us/articles/360003649774-Permission-Denied-When-Creating-Directory-or-Writing-a-File # chown -R $USER:$USER /Users/distiller # rm -rf /Users/distiller/.viminf* # chown -R $USER: /Users/distiller echo "Homebrew setup for changed formula ${f}..." deps=$(brew deps --include-build ${f}) echo "${f} dependencies:" echo "${deps}" # Install XQuartz if [ "$(echo ${deps} | grep -c 'osgeo-grass')" != "0" ] || [ "$(echo ${deps} | grep -c 'osgeo-openscenegraph')" != "0" ];then echo "one of the dependencies requires XQuartz, installing..." brew cask install xquartz fi if [ "${f}" == "osgeo-grass" ] || [ "${f}" == "osgeo-openscenegraph" ];then echo "${f} require of XQuartz, installing..." brew cask install xquartz fi if [ "$(echo ${deps} | grep -c '[python|python]')" != "0" ];then echo "Installing and configuring Homebrew Python 3" brew reinstall python echo "Link Python 3" # which python3 brew unlink python && brew link --overwrite --force python # ls -l /usr/local/bin/python* # rm /usr/local/bin/python* # rm /usr/local/bin/pip* # rm -Rf /Library/Frameworks/Python.framework/Versions/* # export PATH=/usr/local/bin:/usr/local/sbin:$PATH # export PATH="/usr/local/opt/python/libexec/bin:$PATH" # /usr/local/bin/python -V # /usr/local/bin/pip -V # cd /usr/local/bin # ln -s python3 python # ln -s pip3 pip # Set up Python .pth files # get python short version (major.minor) PY_VER=$(/usr/local/opt/python/bin/python3 -c 'import sys;print("{0}.{1}".format(sys.version_info[0],sys.version_info[1]))') if [ -n "${DEBUG_CI}" ];then echo $PY_VER fi mkdir -p ${CIRCLE_WORKING_DIRECTORY}/Library/Python/${PY_VER}/lib/python/site-packages echo 'import site; site.addsitedir("/usr/local/lib/python${PY_VER}/site-packages")' \ >> ${CIRCLE_WORKING_DIRECTORY}/Library/Python/${PY_VER}/lib/python/site-packages/homebrew.pth echo 'import site; site.addsitedir("/usr/local/opt/osgeo-gdal/lib/python${PY_VER}/site-packages")' \ >> ${CIRCLE_WORKING_DIRECTORY}/Library/Python/${PY_VER}/lib/python/site-packages/gdal2.pth if [[ "${f}" =~ "osgeo-gdal" ]];then echo "Installing GDAL 2 Python 3 dependencies" /usr/local/opt/python/bin/pip3 install numpy fi fi # Special handling of osgeo-grass, because it needs to be unlinked if [ "$(echo ${deps} | grep -c 'osgeo-grass')" != "0" ];then echo "Installing and unlinking grass7" # GDAL gets its numpy installed via pip, but grass also has a dependency, so we need to force it. brew install numpy || brew link --overwrite numpy brew install osgeo-grass brew unlink osgeo-grass fi if [ "${f}" == "osgeo-vtk" ] || [ "${f}" == "osgeo-insighttoolkit" ] || [ "${f}" == "osgeo-insighttoolkit@4" ] || [ "${f}" == "osgeo-pcl" ] || [ "${f}" == "osgeo-pdal" ] || [ "${f}" == "osgeo-ossim" ] || [ "${f}" == "osgeo-orfeo" ];then echo "Installing jpeg-turbo" # osgeo-vtk: Java 1.8 is required to install this formula. # Install AdoptOpenJDK 8 with Homebrew Cask: # brew cask install homebrew/cask-versions/adoptopenjdk8 brew install jpeg-turbo brew unlink jpeg-turbo && brew link --force jpeg-turbo fi done fi ================================================ FILE: .circleci/changed_formulas.sh ================================================ #!/usr/bin/env bash set -e if [ "$CIRCLE_BRANCH" != "master" ]; then # manually added by env var. Will not be filtered by skip-formulas.txt # If manual formulae are specified, changed files will be ignored # This avoids rebuilding bottles when triggered against master if [[ -n ${CI_MANUAL_FORMULAE} ]]; then echo "${CI_MANUAL_FORMULAE}" else if [[ ! -z $CIRCLE_PULL_REQUEST ]]; then # if on a PR, just analyze the changed files FILES=$(git diff --diff-filter=AM --name-only $(git merge-base origin/master ${CIRCLE_BRANCH} ) ) else # Get the commit range for the build # For workflows, we can't use the CIRCLE_COMPARE_URL feature, so we do it by manualy diffing the branch # COMMIT_RANGE=$(echo "${CIRCLE_COMPARE_URL}" | cut -d/ -f7) # if [[ $COMMIT_RANGE != *"..."* ]]; then # COMMIT_RANGE="${COMMIT_RANGE}...${COMMIT_RANGE}" # fi # 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. # This means we always needs to rebase or squash and merge, which is mostly what we do anyways. #FILES=$(git diff --diff-filter=AM --name-only master...${CIRCLE_BRANCH} ) FILES=$(git diff --diff-filter=AM --name-only master^1 ) fi FORMULAS= for f in $FILES;do FORMULAS="$FORMULAS $(echo $f | sed -n -E 's#^Formula/(.+)\.rb$#\1#p')" done # keep formulas only #FORMULAS=$(sed -n -E 's#^Formula/(.+)\.rb$#\1#p' <<< $FILES) # skip formulas comm -1 -3 <(cat .circleci/skip-formulas.txt | sort -u ) <(echo ${FORMULAS} | tr ' ' '\n' | sort -u ) fi fi ================================================ FILE: .circleci/config.yml ================================================ # Supported Xcode Versions # https://circleci.com/docs/2.0/testing-ios/ # 10.15 - 11.3.0 - Catalina # 10.14 - 11.1.0 - Mojave # 10.13 - 10.1.0 - HS # 10.12 - 9.0.1 - Sierra build_steps: &build_steps steps: - run: name: Homebrew config command: | brew --version brew remove $(brew list) rm -rf /usr/local/Homebrew/Library/Taps/ brew update-reset brew --env brew config - checkout - run: name: Git config command: | git checkout $CIRCLE_BRANCH git remote set-url origin $CIRCLE_REPOSITORY_URL git fetch origin git config --global user.name "geo-ninja" git config --global user.email "qgisninja@gmail.com" repo=$(brew --repo $CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME) mkdir -p $repo cp -a ./ $repo/ - run: name: Update environment variables command: .circleci/set_env.sh - run: name: Before install command: .circleci/before_install.sh - run: name: Install dependencies command: .circleci/install.sh - run: name: Install changed formulae command: .circleci/script.sh - run: name: Build bottles no_output_timeout: 30m command: | .circleci/after_script.sh # fix if the formula does not change or if a file is updated/uploaded # echo "${CIRCLE_BUILD_NUM}" > /tmp/bottles/build-num-${CIRCLE_BUILD_NUM}.txt echo "FIX" > /tmp/bottles/fix.txt - persist_to_workspace: root: /tmp paths: - bottles/* - store_test_results: path: /tmp/bottles workflow_filter: &filter filters: branches: ignore: - master only: - bottles - /^(?!pull\/).*$/ version: 2 jobs: update-homebrew: macos: xcode: "10.1.0" steps: - restore_cache: keys: - homebrew-v1-{{ .Branch }}-{{ .Revision }} - homebrew-v1-{{ .Branch }}- - homebrew-v1- - run: name: "Update homebrew" command: | brew update-reset - save_cache: key: homebrew-v1-{{ .Branch }}-{{ .Revision }} paths: - /usr/local/Homebrew/Library/Taps/homebrew # catalina-build: # <<: *build_steps # <<: *filter # macos: # xcode: "11.3.0" # mojave-build: # <<: *build_steps # <<: *filter # macos: # xcode: "11.1.0" high_sierra-build: <<: *build_steps <<: *filter macos: xcode: "10.1.0" # sierra-build: # <<: *build_steps # <<: *filter # macos: # xcode: "9.0.1" collect-bottles: macos: xcode: "10.1.0" steps: - attach_workspace: at: /tmp/workspace - checkout - run: name: Update environment variables command: | .circleci/set_env.sh - run: name: Git config command: | git config --global user.name "geo-ninja" git config --global user.email "qgisninja@gmail.com" # fix for ERROR: The key you are authenticating with has been marked as read only. # is using the first key that is found, the one assigned in Checkout keys # not Add deploy key (Checkout keys) # Add deployment key fingerprint (SSH Permissions) for CircleCI to use for a push # ssh-keygen -l -E md5 -f key.pub - add_ssh_keys: fingerprints: - "${KEY_FINGERPRINT_OSGEO}" - "${KEY_FINGERPRINT}" - run: name: Avoid hosts unknown for github command: | echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config - run: name: Commit for new bottles and upload to bintray command: .circleci/before_deploy.sh - store_artifacts: path: /tmp/workspace/bottles destination: bottles # deploy: # macos: # xcode: "10.1.0" # steps: # - checkout # - run: # name: Deploy - Upload to bintray # command: | # cd /tmp/workspace/bottles # brew install jfrog-cli-go # jfrog bt config --user=${BINTRAY_USER} --key=${BINTRAY_API} --licenses=MIT # echo "jfrog" > jfrog-deploy.txt # jfrog bt upload --publish=true "jfrog-deploy.txt" homebrew-osgeo/osgeo-bottles/bottles/0.1/ # # jfrog bt upload --publish=true "/tmp/workspace/bottles/*" homebrew-osgeo/osgeo-bottles/bottles/0.1/ # - store_artifacts: # path: /tmp/workspace/bottles # destination: bottles workflows: version: 2 build-deploy: jobs: - update-homebrew: filters: branches: ignore: - master only: - bottles - /^(?!pull\/).*$/ # - catalina-build: # requires: # - update-homebrew # - mojave-build: # requires: #  - update-homebrew - high_sierra-build: requires: - update-homebrew filters: branches: ignore: - master only: - bottles - /^(?!pull\/).*$/ # - sierra-build: #  requires: # - update-homebrew - collect-bottles: # - catalina-build # - mojave-build requires: - high_sierra-build filters: branches: ignore: - master only: - bottles - /^(?!pull\/).*$/ # - sierra-build # - deploy: # requires: # - collect-bottles # filters: # branches: # only: master ================================================ FILE: .circleci/install.sh ================================================ #!/usr/bin/env bash ########################################################################### # homebrew-osgeo4mac circle ci - install.sh # --------------------- # Date : Dec 2019 # Copyright : (C) 2016 by Boundless Spatial, Inc. # Author : Larry Shaffer - FJ Perini # Email : lshaffer at boundlessgeo dot com ########################################################################### # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # ########################################################################### set -e ulimit -n 1024 if [ "$CIRCLE_BRANCH" != "master" ]; then git checkout bottles for f in ${CHANGED_FORMULAE};do echo "Installing dependencies for changed formula ${f}..." FLAGS="--only-dependencies --build-bottle" brew install ${FLAGS} ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/${f}& PID=$! # add progress to ensure Travis doesn't complain about no output while true; do sleep 30 if jobs -rp | grep ${PID} >/dev/null; then echo "." else echo break fi done done fi ================================================ FILE: .circleci/script.sh ================================================ #!/usr/bin/env bash ########################################################################### # homebrew-osgeo4mac circle ci - script.sh # --------------------- # Date : Dec 2019 # Copyright : (C) 2016 by Boundless Spatial, Inc. # Author : Larry Shaffer - FJ Perini # Email : lshaffer at boundlessgeo dot com ########################################################################### # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # ########################################################################### set -e ulimit -n 1024 if [ "$CIRCLE_BRANCH" != "master" ]; then git checkout bottles echo ${CHANGED_FORMULAE} for f in ${CHANGED_FORMULAE};do deps=$(brew deps --include-build ${f}) # fix error: Unable to import PyQt5.QtCore # build qscintilla2 if [ "$(echo ${deps} | grep -c 'osgeo-pyqt')" != "0" ];then brew reinstall ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/osgeo-pyqt brew unlink osgeo-pyqt && brew link osgeo-pyqt --force /usr/local/opt/python/bin/python3 -c "import PyQt5.QtCore" fi # fix error: 'libintl.h' file not found # build qgis with grass if [ "$(echo ${deps} | grep -c 'osgeo-grass')" != "0" ] || [ "${f}" == "osgeo-grass" ];then brew reinstall gettext brew unlink gettext && brew link --force gettext fi if [ "${f}" == "osgeo-grass" ];then brew unlink osgeo-liblas && brew link osgeo-liblas --force fi # Error: The `brew link` step did not complete successfully # The formula built, but is not symlinked into /usr/local # Could not symlink lib/pkgconfig/libopenjp2.pc # Target /usr/local/lib/pkgconfig/libopenjp2.pc # is a symlink belonging to openjpeg if [ "$(echo ${deps} | grep -c 'osgeo-insighttoolkit')" != "0" ] || [ "${f}" == "osgeo-insighttoolkit" ];then brew unlink openjpeg fi if [ "$(echo ${deps} | grep -c 'osgeo-insighttoolkit@4')" != "0" ] || [ "${f}" == "osgeo-insighttoolkit@4" ];then brew unlink openjpeg fi # fix test # initdb: could not create directory "/usr/local/var/postgresql": Operation not permitted if [ "${f}" == "osgeo-libpqxx" ];then initdb /usr/local/var/postgresql -E utf8 --locale=en_US.UTF-8 # pg_ctl -D /usr/local/var/postgresql -l logfile start brew services start osgeo/osgeo4mac/osgeo-postgresql # system "psql", "-h", "localhost", "-d", "postgres" # createdb template1 fi # mapnik - error high_sierra-build # Exiting... the following required dependencies were not found: # - boost regex (more info see: https://github.com/mapnik/mapnik/wiki/Mapnik-Installation & http://www.boost.org) # Also, these OPTIONAL dependencies were not found: # - boost program_options (more info see: https://github.com/mapnik/mapnik/wiki/Mapnik-Installation & http://www.boost.org) # - boost_regex_icu (libboost_regex built with optional ICU unicode support is needed for unicode regex support in mapnik.) # - gdal (GDAL C++ library | configured using gdal-config program | try setting GDAL_CONFIG SCons option | more info: https://github.com/mapnik/mapnik/wiki/GDAL) if [ "${f}" == "osgeo-mapnik" ];then brew unlink boost && brew link boost --force fi # if SVG2PNG=True # Error: Failed changing install name in /usr/local/Cellar/osgeo-mapnik/3.0.22_2/bin/svg2png # from /usr/local/opt/boost/lib/libboost_system.dylib # to @@HOMEBREW_PREFIX@@/opt/boost/lib/libboost_system.dylib # Error: Updated load commands do not fit in the header of # /usr/local/Cellar/osgeo-mapnik/3.0.22_2/bin/svg2png. /usr/local/Cellar/osgeo-mapnik/3.0.22_2/bin/svg2png # needs to be relinked, possibly with -headerpad or -headerpad_max_install_names # if [[ $(brew list --versions ${f}) ]]; then # echo "Clearing previously installed/cached formula ${f}..." # brew uninstall --force --ignore-dependencies ${f} || true # fi echo "Installing changed formula ${f}..." # Default installation flag set FLAGS="--build-bottle" brew install -v ${FLAGS} ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/${f}& PID=$! # add progress to ensure Travis doesn't complain about no output while true; do sleep 30 if jobs -rp | grep ${PID} >/dev/null; then echo "." else echo break fi done echo "Testing changed formula ${f}..." # does running postinstall mess up the bottle? # (mentioned that it is skipped if installing with --build-bottle) # brew postinstall ${f} brew test ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/${f} done fi ================================================ FILE: .circleci/set_env.sh ================================================ #!/usr/bin/env bash ########################################################################### # homebrew-osgeo4mac circle ci - script.sh # --------------------- # Date : Dec 2019 # Copyright : (C) 2016 by Boundless Spatial, Inc. # Author : Larry Shaffer - FJ Perini # Email : lshaffer at boundlessgeo dot com ########################################################################### # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # ########################################################################### set -e if [ "$CIRCLE_BRANCH" != "master" ]; then ulimit -c unlimited ulimit -n 2048 export CHANGED_FORMULAE=$(.circleci/changed_formulas.sh) if [ "$CHANGED_FORMULAE" == "" ]; then echo "Skipping CI, no changed formulae found"; exit 0; else echo "Changed formulae are ${CHANGED_FORMULAE}"; fi export HOMEBREW_REPOSITORY=$(brew --repo) git -C "${HOMEBREW_REPOSITORY}" fetch git -C "${HOMEBREW_REPOSITORY}" reset --hard origin/master mkdir -p "${HOMEBREW_REPOSITORY}/Library/Taps/${CIRCLE_PROJECT_USERNAME}" echo "Linking ${CIRCLE_WORKING_DIRECTORY}" to "${HOMEBREW_REPOSITORY}/Library/Taps/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" ln -s "${HOME}/project" "${HOMEBREW_REPOSITORY}/Library/Taps/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" echo "export CHANGED_FORMULAE=${CHANGED_FORMULAE}" >> $BASH_ENV echo "export HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY" >> $BASH_ENV echo 'export HOMEBREW_DEVELOPER=1' >> $BASH_ENV echo 'export HOMEBREW_NO_AUTO_UPDATE=1' >> $BASH_ENV echo 'export HOMEBREW_PREFIX=/usr/local' >> $BASH_ENV echo 'export CIRCLE_REPOSITORY_URL=https://github.com/OSGeo/homebrew-osgeo4mac' >> $BASH_ENV echo 'export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)' >> $BASH_ENV fi ================================================ FILE: .circleci/skip-formulas.txt ================================================ ossgeo-gdal-ecwjp2 osgeo-gdal-oracle osgeo-gdal-mrsid gpkgtools ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Create a report about a problem you've come across title: '' labels: '' assignees: '' --- **Please answers the following** I've... - I read - [ ] the [reporting issues](https://osgeo.github.io/homebrew-osgeo4mac/docs/reporting-issues/) - [ ] the [troubleshooting](https://osgeo.github.io/homebrew-osgeo4mac/docs/troubleshooting/) - [ ] I checked the documentation and found no answer - [ ] I tried to install after following the suggestions - [ ] I am running the latest version (`brew update` twice?) - [ ] I checked to make sure that this issue has not already been filed - [ ] I uploaded logs: `brew gist-logs formula` **Describe the bug** **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** **Screenshots** **Additional context** `brew doctor` output: ```shell # paste here the output of your brew doctor output. Delete this line please. ``` **Logs** ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: Feature request about: Suggest an idea for this project title: '' labels: '' assignees: '' --- **Is your feature request related to a problem? Please describe.** **Describe the solution you'd like** **Describe alternatives you've considered** **Additional context** ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ # Description Please 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. Fixes # (issue) ## Type of change Please delete options that are not relevant. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update # How Has This Been Tested? Please 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 - [ ] Test A - [ ] Test B **Test Configuration**: * Hardware: * Operating System: # Checklist: - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules ================================================ FILE: .github/stale.yml ================================================ # Configuration for probot-stale - https://github.com/probot/stale # Number of days of inactivity before an Issue or Pull Request becomes stale daysUntilStale: 30 # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. daysUntilClose: 7 # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable exemptLabels: - "pinned :pushpin:" - "security :lock:" - "maybe later :hourglass_flowing_sand:" # Set to true to ignore issues in a project (defaults to false) exemptProjects: false # Set to true to ignore issues in a milestone (defaults to false) exemptMilestones: false # Set to true to ignore issues with an assignee (defaults to false) exemptAssignees: false # Label to use when marking as stale staleLabel: "stale :zzz:" # Comment to post when marking as stale. Set to `false` to disable markComment: > This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want to keep the issue open, please comment or update the info here. Thank you for your contributions. # Comment to post when removing the stale label. # unmarkComment: > # Your comment here. # Comment to post when closing a stale Issue or Pull Request. closeComment: > This issue or pull request has been automatically closed because it has not had recent activity. Thank you for your contributions. # Limit the number of actions per hour, from 1-30. Default is 30 limitPerRun: 30 # Limit to only `issues` or `pulls` # only: issues # Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': # pulls: # daysUntilStale: 30 # markComment: > # This pull request has been automatically marked as stale because it has not had # recent activity. It will be closed if no further activity occurs. Thank you # for your contributions. # issues: # exemptLabels: # - confirmed ================================================ FILE: .gitignore ================================================ *.orig .idea/ **/*.iml /docs/_site /docs/.jekyll-metadata /docs/.sass-cache /docs/Gemfile.lock ================================================ FILE: .travis.yml ================================================ language: ruby rvm: - 2.3.7 # language: python # python: # - "2.7" os: osx env: OSX=10.12 osx_image: xcode8.3 sudo: required branches: except: - circleci # /usr/local subdirs are Homebrew components # cache: # directories: # - $HOME/Library/Caches/pip # - /usr/local/Cellar # - /usr/local/Frameworks # - /usr/local/Homebrew # - /usr/local/bin # - /usr/local/etc # - /usr/local/include # - /usr/local/lib # - /usr/local/opt # - /usr/local/share # - /usr/local/var # timeout: 900 # before_cache: # - ./travis/before_cache.sh addons: ssh_known_hosts: github.com before_install: - gem update --system - gem install bundler - export GH_USER=$(echo -n "${TRAVIS_REPO_SLUG}" | egrep -o '^[^/]+' | tr -d '\n') - export TRAVIS_COMMIT="$(git rev-parse --verify -q HEAD)" - export CHANGED_FORMULAE=$(./travis/changed_formulas.sh) - if [ "${CHANGED_FORMULAE}" == "" ]; then echo "Skipping CI; no changed formulae found in $TRAVIS_BUILD_DIR"; exit 0 || true; travis_terminate 0; exit 1; else echo "Changed formulae are ${CHANGED_FORMULAE}"; fi - if [ "${CHANGED_FORMULAE}" == "osgeo-qt-webkit" ] || [ "${CHANGED_FORMULAE}" == "osgeo-qgis" ] || [ "${CHANGED_FORMULAE}" == "osgeo-qgis-ltr" ]|| [ "${CHANGED_FORMULAE}" == "osgeo-vtk" ]|| [ "${CHANGED_FORMULAE}" == "osgeo-insighttoolkit" ]; then echo "Skipping CI; These formulas exceed the time limit in Travis CI."; exit 0 || true; travis_terminate 0; exit 1; fi - export HOMEBREW_REPOSITORY="$(brew --repo)" - sudo chown -R "$USER":admin "${HOMEBREW_REPOSITORY}" - git -C "${HOMEBREW_REPOSITORY}" reset --hard origin/master - mkdir -p "${HOMEBREW_REPOSITORY}/Library/Taps/${GH_USER}" - ln -s "$TRAVIS_BUILD_DIR" "${HOMEBREW_REPOSITORY}/Library/Taps/${TRAVIS_REPO_SLUG}" - cd "${HOMEBREW_REPOSITORY}/Library/Taps/${TRAVIS_REPO_SLUG}" - chmod -f 0644 ${HOMEBREW_REPOSITORY}/Library/Taps/${TRAVIS_REPO_SLUG}/Formula/*.rb - export TRAVIS_BUILD_DIR="${HOMEBREW_REPOSITORY}/Library/Taps/${TRAVIS_REPO_SLUG}" - export HOMEBREW_DEVELOPER=1 - export HOMEBREW_NO_AUTO_UPDATE=1 - export HOMEBREW_PREFIX=$(brew --prefix) - ulimit -n 1024 - ./travis/before_install.sh install: ./travis/install.sh # before_script: ./travis/before_script.sh script: ./travis/script.sh after_script: ./travis/after_script.sh before_deploy: # Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc # Decrypt the travis_deploy_key.enc key into /tmp/travis_deploy_key - openssl aes-256-cbc -K $encrypted_key -iv $encrypted_iv -in travis_deploy_key.enc -out /tmp/travis_deploy_key -d # Make sure only the current user can read the private key - chmod 600 /tmp/travis_deploy_key # Create a script to return the passphrase environment variable to ssh-add - echo 'echo ${SSH_PASSPHRASE}' > /tmp/askpass && chmod +x /tmp/askpass # Start the authentication agent - eval "$(ssh-agent -s)" # Add the key to the authentication agent - brew install util-linux # for setsid - DISPLAY=":0.0" SSH_ASKPASS="/tmp/askpass" setsid ssh-add /tmp/travis_deploy_key :high_sierra sha256 "48db39a4b97d78a01b20b5458fb7bed8e3eb2550f2d191ba6d08a30b1760662b" => :sierra end option "with-tiff-cache", "Build with TIFFs as a cache backend" option "without-apache-module", "Build without Apache2 module" depends_on "cmake" => :build depends_on "pkg-config" => :build depends_on "apr-util" => :build if build.with? "apache-module" depends_on "libpng" depends_on "jpeg" depends_on "pcre" => :recommended depends_on "pixman" depends_on "fcgi" depends_on "sqlite" depends_on "gdal" depends_on "geos" if build.with? "tiff-cache" depends_on "osgeo-libgeotiff" depends_on "libtiff" end depends_on "berkeley-db" => :optional depends_on "memcached" => :optional depends_on "mapserver" => :optional def lib_name "libmapcache" end def install args = std_cmake_args # option(WITH_SQLITE "Use sqlite as a cache backend" ON) # option(WITH_GEOS "Choose if GEOS geometry operations support should be built in" ON) # option(WITH_OGR "Choose if OGR/GDAL input vector support should be built in" ON) # option(WITH_CGI "Choose if CGI executable should be built" ON) # option(WITH_FCGI "Choose if CGI executable should support FastCGI" ON) # Fix up .fcgi install path args << "-DCMAKE_INSTALL_CGIBINDIR=#{libexec}" # option(WITH_VERSION_STRING "Show MapCache in server version string" ON) # option(WITH_APACHE "Build Apache Module" ON) if build.with? "apache-module" args << "-DCMAKE_PREFIX_PATH=#{Formula["apr"].opt_libexec}:#{Formula["apr-util"].opt_libexec}" args << "-DAPACHE_MODULE_DIR=#{libexec}" else args << "-DWITH_APACHE=OFF" end # option(WITH_PIXMAN "Use pixman for SSE optimized image manipulations" ON) # args << "-DWWITH_PIXMAN=" + (build.with?("pixman") ? "ON" : "OFF") # option(WITH_BERKELEY_DB "Use Berkeley DB as a cache backend" OFF) args << "-DWITH_BERKELEY_DB=" + (build.with?("berkeley-db") ? "ON" : "OFF") # option(WITH_MEMCACHE "Use memcache as a cache backend (requires recent apr-util)" OFF) args << "-DWITH_MEMCACHE=" + (build.with?("memcached") ? "ON" : "OFF") # option(WITH_PCRE "Use PCRE for regex tests" OFF) args << "-DWITH_PCRE=" + (build.with?("pcre") ? "ON" : "OFF") # option(WITH_MAPSERVER "Enable (experimental) support for the mapserver library" OFF) args << "-DWITH_MAPSERVER=" + (build.with?("mapserver") ? "ON" : "OFF") # option(WITH_TIFF "Use TIFFs as a cache backend" OFF) # option(WITH_TIFF_WRITE_SUPPORT "Enable (experimental) support for writable TIFF cache backends" OFF) # option(WITH_GEOTIFF "Allow GeoTIFF metadata creation for TIFF cache backends" OFF) args << "-DWITH_TIFF=" + (build.with?("tiff-cache") ? "ON" : "OFF") args << "-DWITH_GEOTIFF=" + (build.with?("tiff-cache") ? "ON" : "OFF") mkdir "build" do system "cmake", "..", *args # system "/usr/local/bin/bbedit", "CMakeCache.txt" # raise system "make" system "make", "install" end # update Apache module linking so_ver = 1 lib_name_ver = "#{lib_name}.#{so_ver}" MachO::Tools.change_install_name("#{libexec}/mod_mapcache.so", "@rpath/#{lib_name_ver}.dylib", "#{opt_lib}/#{lib_name_ver}.dylib") # Add config examples (prefix/"config").mkpath cp Dir["mapcache.xml*"], prefix/"config" end def caveats; <<~EOS The MapCache FCGI executable and Apache module are located in: #{libexec}/ Configuration examples are located in: #{prefix}/ EOS end test do out = `#{opt_bin}/mapcache_seed -h` assert_match "tileset to seed", out end end ================================================ FILE: Formula/mapserver6.rb ================================================ class JavaJDK < Requirement fatal true def self.home [ `/usr/libexec/java_home`.chomp!, ENV["JAVA_HOME"], ].find do |dir| dir && File.exist?("#{dir}/bin/javac") && (File.exist?("#{dir}/include") || File.exist?("#{dir}/bundle")) end end satisfy :build_env => false do self.class.home end def message; <<~EOS Could not find a JDK (i.e. not a JRE) Do one of the following: - install a JDK that is detected with /usr/libexec/java_home - set the JAVA_HOME environment variable - specify --without-java EOS end end class Mapserver6 < Formula desc "Publish spatial data and interactive mapping apps to the web" homepage "http://mapserver.org/" url "http://download.osgeo.org/mapserver/mapserver-6.4.5.tar.gz" sha256 "b62c5c0cce2ea7da1d70553197926c14ef46bfb030a736e588367fc881b01a9a" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" rebuild 2 sha256 "d49321a497cc7b0826ff2febf8147dfd9428a991a45cdb1e3f2f81e0e1634d44" => :high_sierra sha256 "d49321a497cc7b0826ff2febf8147dfd9428a991a45cdb1e3f2f81e0e1634d44" => :sierra end # Backport patch to support compiling with gif_lib >= 5.1: https://github.com/mapserver/mapserver/pull/5144 # Also applies a patch to build on versions of PHP5 > 5.6.25: https://github.com/mapserver/mapserver/pull/5318 patch :DATA conflicts_with "mapserver", :because => "Homebrew core includes newer version of mapserver" option "without-php", "Build PHP MapScript module" option "with-rpath", "Don't embed rpath to installed libmapserver in modules" option "without-geos", "Build without GEOS spatial operations support" option "without-postgresql", "Build without PostgreSQL data source support" option "without-xml-mapfile", "Build with native XML mapfile support" option "with-java", "Build Java MapScript module" option "with-librsvg", "Build with SVG symbology support" option "with-docs", "Download and generate HTML documentation" option "with-unit-tests", "Download and install full unit test suite" depends_on "cmake" => :build depends_on "freetype" depends_on "libpng" depends_on "python@2" depends_on "swig" => :build depends_on "openjdk" => :optional depends_on "giflib" depends_on "osgeo-proj" depends_on "geos" => :recommended depends_on "gdal" depends_on "osgeo-postgresql" => :recommended depends_on "mysql" => :optional depends_on "fcgi" => :recommended depends_on "cairo" => :recommended depends_on "libxml2" if build.with?("xml-mapfile") || MacOS.version < :mountain_lion depends_on "libxslt" if build.with? "xml-mapfile" depends_on "librsvg" => :optional depends_on "fribidi" depends_on "python@2" => %w[sphinx] if build.with? "docs" depends_on "php@5.6" if build.with? "php" depends_on "perl" resource "sphinx" do url "https://files.pythonhosted.org/packages/source/S/Sphinx/Sphinx-1.2.2.tar.gz" sha256 "2d3415f5b3e6b7535877f4c84fe228bdb802a8993c239b2d02c23169d67349bd" end resource "docs" do # NOTE: seems to be no tagged releases for `docs`, just active branches url "https://github.com/mapserver/docs.git", :branch => "branch-6-4" version "6.4" end resource "unittests" do url "https://github.com/mapserver/msautotest.git", :revision => "b0ba5ccbfb6b0395820f492eb5a190cf643b5ed8" version "6.4" end def png_prefix png = Formula["libpng"] (png.installed? || MacOS.version >= :mountain_lion) ? png.opt_prefix : MacOS::X11.prefix end def freetype_prefix ft = Formula["freetype"] (ft.installed? || MacOS.version >= :mountain_lion) ? ft.opt_prefix : MacOS::X11.prefix end def install # install unit tests (prefix/"msautotest").install resource("unittests") if build.with? "unit-tests" ENV.prepend_path "CMAKE_PREFIX_PATH", freetype_prefix ENV.prepend_path "CMAKE_PREFIX_PATH", png_prefix args = std_cmake_args if MacOS.prefer_64_bit? args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}" else args << "-DCMAKE_OSX_ARCHITECTURES=i386" end # defaults different than CMakeLists.txt (they don't incur extra dependencies) args.concat %w[ -DWITH_KML=ON -DWITH_CURL=ON -DWITH_CLIENT_WMS=ON -DWITH_CLIENT_WFS=ON -DWITH_SOS=ON ] args << "-DWITH_XMLMAPFILE=ON" if build.with? "xml-mapfile" args << "-DWITH_MYSQL=ON" if build.with? "mysql" args << "-DWITH_RSVG=ON" if build.with? "librsvg" glib = Formula["glib"] fribidi = Formula["fribidi"] args << "-DFRIBIDI_INCLUDE_DIR=#{glib.opt_include}/glib-2.0;#{glib.opt_lib}/glib-2.0/include;#{fribidi.opt_include}" mapscr_dir = prefix/"mapscript" mapscr_dir.mkpath rpath = %Q(-Wl,-rpath,"#{opt_prefix/"lib"}") use_rpath = build.with? "rpath" cd "mapscript" do args << "-DWITH_PYTHON=ON" inreplace "python/CMakeLists.txt" do |s| s.gsub! "${PYTHON_SITE_PACKAGES}", lib/"python2.7/site-packages" s.gsub! "${PYTHON_LIBRARIES}", "-Wl,-undefined,dynamic_lookup" s.sub! "${MAPSERVER_LIBMAPSERVER}", "#{rpath} ${MAPSERVER_LIBMAPSERVER}" if use_rpath end # override language extension install locations, e.g. install to prefix/"mapscript/lang" args << "-DWITH_RUBY=ON" (mapscr_dir/"ruby").mkpath inreplace "ruby/CMakeLists.txt" do |s| s.gsub! "${RUBY_SITEARCHDIR}", %Q("#{mapscr_dir}/ruby") s.sub! "${MAPSERVER_LIBMAPSERVER}", "#{rpath} ${MAPSERVER_LIBMAPSERVER}" if use_rpath end if build.with? "php" args << "-DWITH_PHP=ON" (mapscr_dir/"php").mkpath inreplace "php/CMakeLists.txt" do |s| s.gsub! "${PHP5_EXTENSION_DIR}", %Q("#{mapscr_dir}/php") s.sub! "${MAPSERVER_LIBMAPSERVER}", "#{rpath} ${MAPSERVER_LIBMAPSERVER}" if use_rpath end end args << "-DWITH_PERL=ON" (mapscr_dir/"perl").mkpath args << "-DCUSTOM_PERL_SITE_ARCH_DIR=#{mapscr_dir}/perl" inreplace "perl/CMakeLists.txt", "${MAPSERVER_LIBMAPSERVER}", "#{rpath} ${MAPSERVER_LIBMAPSERVER}" if use_rpath if build.with? "java" args << "-DWITH_JAVA=ON" ENV["JAVA_HOME"] = JavaJDK.home (mapscr_dir/"java").mkpath inreplace "java/CMakeLists.txt" do |s| s.gsub! "DESTINATION ${CMAKE_INSTALL_LIBDIR}", %Q(${CMAKE_CURRENT_BINARY_DIR}/mapscript.jar DESTINATION "#{mapscr_dir}/java") s.sub! "${MAPSERVER_LIBMAPSERVER}", "#{rpath} ${MAPSERVER_LIBMAPSERVER}" if use_rpath end end end mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end # MachO::Tools.change_install_name(lib/"python2.7/site-packages/_mapscript.so", # "@rpath/libmapserver.1.dylib", opt_lib/"libmapserver.1.dylib") # system "install_name_tool", "-change", # "@rpath/libmapserver.1.dylib", opt_lib/"libmapserver.1.dylib", # lib/"python2.7/site-packages/_mapscript.so" # install devel headers (include/"mapserver").install Dir["*.h"] prefix.install "tests" (mapscr_dir/"python").install "mapscript/python/tests" cd "mapscript" do %w[python ruby perl].each { |x| (mapscr_dir/x.to_s).install "#{x}/examples" } (mapscr_dir/"php").install "php/examples" if build.with? "php" (mapscr_dir/"java").install "java/examples" if build.with? "java" end # write install instructions for modules s = "" mapscr_opt_dir = opt_prefix/"mapscript" if build.with? "php" s += <<~EOS Using the built PHP module: * Add the following line to php.ini: extension="#{mapscr_opt_dir}/php/php_mapscript.so" * Execute "php -m" * You should see MapScript in the module list EOS end %w[ruby perl java].each do |m| next if build.without?(m) cmd = [] case m when "ruby" ruby_site = `ruby -r rbconfig -e 'puts RbConfig::CONFIG["sitearchdir"]'`.chomp cmd << "sudo cp -f mapscript.bundle #{ruby_site}/" when "perl" perl_site = `perl -MConfig -e 'print $Config{"sitearch"};'`.chomp cmd << "sudo cp -f mapscript.pm #{perl_site}/" cmd << "sudo cp -fR auto/mapscript #{perl_site}/auto/" else cmd << "sudo cp -f libjavamapscript.jnilib mapscript.jar /Library/Java/Extensions/" end s += <<~EOS Install the built #{m.upcase} module with: cd #{mapscr_opt_dir}/#{m} #{cmd[0]} #{cmd[1] + "\n" if cmd[1]} EOS end (mapscr_dir/"Install_Modules.txt").write s if build.with? "docs" unless which("sphinx-build") # vendor a local sphinx install sphinx_site = libexec/"lib/python2.7/site-packages" ENV.prepend_create_path "PYTHONPATH", sphinx_site resource("sphinx").stage { quiet_system "python2.7", "setup.py", "install", "--prefix=#{libexec}" } ENV.prepend_path "PATH", libexec/"bin" end resource("docs").stage do # just build the en docs inreplace "Makefile", "$(TRANSLATIONS_I18N) $(TRANSLATIONS_STATIC)", "" system "make", "html" doc.install "build/html" => "html" end end end def caveats; <<~EOS The Mapserver CGI executable is #{opt_prefix}/bin/mapserv Instructions for installing any built, but uninstalled, mapscript modules: #{opt_prefix}/mapscript/Install_Modules.txt EOS end test do mapscr_opt_dir = opt_prefix/"mapscript" system "#{bin}/mapserv", "-v" system "python2.7", "-c", '"import mapscript"' system "ruby", "-e", "\"require '#{mapscr_opt_dir}/ruby/mapscript'\"" system "perl", "-I#{mapscr_opt_dir}/perl", "-e", '"use mapscript;"' cd "#{mapscr_opt_dir}/java/examples" do system "#{JavaJDK.home}/bin/javac", "-classpath", "../", "-Djava.ext.dirs=../", "RFC24.java" system "#{JavaJDK.home}/bin/java", "-classpath", "../", "-Djava.library.path=../", "-Djava.ext.dirs=../", "RFC24", "../../../tests/test.map" end if build.with? "java" end end __END__ diff --git a/mapimageio.c b/mapimageio.c index 35d134f..eb63aa3 100644 --- a/mapimageio.c +++ b/mapimageio.c @@ -1307,6 +1307,12 @@ int readGIF(char *path, rasterBufferObj *rb) } while (recordType != TERMINATE_RECORD_TYPE); +#if defined GIFLIB_MAJOR && GIFLIB_MINOR && ((GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1) || (GIFLIB_MAJOR > 5)) + if (DGifCloseFile(image, &errcode) == GIF_ERROR) { + msSetError(MS_MISCERR,"failed to close gif after loading: %s","readGIF()", gif_error_msg(errcode)); + return MS_FAILURE; + } +#else if (DGifCloseFile(image) == GIF_ERROR) { #if defined GIFLIB_MAJOR && GIFLIB_MAJOR >= 5 msSetError(MS_MISCERR,"failed to close gif after loading: %s","readGIF()", gif_error_msg(image->Error)); @@ -1315,6 +1321,7 @@ int readGIF(char *path, rasterBufferObj *rb) #endif return MS_FAILURE; } +#endif return MS_SUCCESS; } diff --git a/mapscript/php/error.c b/mapscript/php/error.c index a13de647f..2e96eea27 100644 --- a/mapscript/php/error.c +++ b/mapscript/php/error.c @@ -31,6 +31,17 @@ #include "php_mapscript.h" +#if PHP_VERSION_ID >= 50625 +#undef ZVAL_STRING +#define ZVAL_STRING(z, s, duplicate) do { \ + const char *__s=(s); \ + zval *__z = (z); \ + Z_STRLEN_P(__z) = strlen(__s); \ + Z_STRVAL_P(__z) = (duplicate?estrndup(__s, Z_STRLEN_P(__z)):(char*)__s);\ + Z_TYPE_P(__z) = IS_STRING; \ +} while (0) +#endif + zend_class_entry *mapscript_ce_error; ZEND_BEGIN_ARG_INFO_EX(error___get_args, 0, 0, 1) ================================================ FILE: Formula/osgeo-ecwjp2-sdk.rb ================================================ require File.expand_path("../../Strategies/cache-download", Pathname.new(__FILE__).realpath) ECWJP2_SDK = "/Hexagon/ERDASEcwJpeg2000SDK5.5.0/Desktop_Read-Only/".freeze class EcwJpeg2000SDK < Requirement fatal true satisfy(:build_env => false) { File.exist? ECWJP2_SDK } def message; <<~EOS ERDAS ECW/JP2 SDK was not found at: #{ECWJP2_SDK} Download SDK and install 'Desktop Read-Only' to default location from: http://download.intergraph.com/?ProductName=ERDAS%20ECW/JPEG2000%20SDK EOS end end class OsgeoEcwjp2Sdk < Formula desc "Decompression library for ECW- and JPEG2000-compressed imagery" homepage "http://www.hexagongeospatial.com/products/provider-suite/erdas-ecw-jp2-sdk" url "https://osgeo4mac.s3.amazonaws.com/src/dummy.tar.gz" version "5.5.0" sha256 "e7776e2ff278d6460300bd69a26d7383e6c5e2fbeb17ff12998255e7fc4c9511" # revision 1 # depends_on :macos => :lion # as per SDK docs unknown version :lion depends_on EcwJpeg2000SDK def install lib.mkpath (include/"ECWJP2").mkpath cd ECWJP2_SDK do # vendor Desktop Read-Only libs, etc # suffix only the older stdc++ cp "redistributable/libc++/libNCSEcw.dylib", "#{lib}/" # libstdc++ is not longer bundled in the distribution # cp "redistributable/libstdc++/libNCSEcw.dylib", "#{lib}/libNCSEcw-stdcxx.dylib" # Calling install_name_tool is deprecated, so we're switching to using the MachO tools # system "install_name_tool", "-id", opt_lib/"libNCSEcw-stdcxx.dylib", lib/"libNCSEcw-stdcxx.dylib" # MachO::Tools.change_dylib_id(opt_lib/"libNCSEcw-stdcxx.dylib", lib/"libNCSEcw-stdcxx.dylib") %w[etc Licenses].each { |f| cp_r f.to_s, "#{prefix}/" } cp_r Dir["include/*"], "#{include}/ECWJP2/" # for test (prefix/"test").mkpath cp "Examples/decompression/example1/dexample1.c", prefix/"test/" %w[ecw jp2].each { |f| cp "TestData/RGB_8bit.#{f}", prefix/"test/" } end end def caveats; <<~EOS Once formula is installed, the ERDAS ECW/JP2 SDK can be deleted from its default install location of: #{Pathname.new(ECWJP2_SDK).dirname} Headers installed to: #{opt_include}/ECWJP2 EOS end test do cp prefix/"test/dexample1.c", testpath system ENV.cc, "-I#{opt_include}/ECWJP2", "-L#{opt_lib}", "-lNCSEcw", "-o", "test", "dexample1.c" %w[ecw jp2].each do |f| out = `./test #{prefix}/test/RGB_8bit.#{f}` assert_match "Region 99", out assert_match "Region 0", out assert_match "ALL time", out end end end ================================================ FILE: Formula/osgeo-fcgi-debug.rb ================================================ class OsgeoFcgiDebug < Formula desc "Helps trace FastCGI programs without having to strace them" homepage "http://redmine.lighttpd.net/projects/fcgi-debug/wiki" url "https://github.com/lighttpd/fcgi-debug/archive/fcgi-debug-0.9.3.tar.gz" sha256 "b63f89c563c05c2a8beb0d2dbace893928291f8f7a7ae651ff7a328a8be64725" revision 1 head "https://github.com/lighttpd/fcgi-debug.git", branch: "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "674bace0a4d665e202d85b1179a60e2dd6987ca6540b16b2b5fc89656175b6a4" => :mojave sha256 "674bace0a4d665e202d85b1179a60e2dd6987ca6540b16b2b5fc89656175b6a4" => :high_sierra sha256 "2533dc7a2c288f6638e3996c64506543fb495cf8cffd27b165ff8d79b15d4065" => :sierra end depends_on "cmake" => :build depends_on "pkg-config" => :build depends_on "libev" depends_on "glib" def install man1.install "fcgi-debug.1" args = std_cmake_args mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end end test do # TODO end end ================================================ FILE: Formula/osgeo-filegdb-api.rb ================================================ class OsgeoFilegdbApi < Formula desc "ESRI File Geodatabase C++ API libraries" homepage "https://github.com/Esri/file-geodatabase-api" url "https://github.com/Esri/file-geodatabase-api/raw/master/FileGDB_API_1.5.1/FileGDB_API_1_5_1-64clang.zip" sha256 "78b52650b3be72eacb985fd744f6766e8d57f60a3317055c5a23b1d181ae8ab2" version "1.5.1" revision 1 head "https://github.com/Esri/file-geodatabase-api.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "5d0737d480cacb6d13b5cb5883ba8daeb197ae99ef3cc7d7f4bcfc87aa242ebd" => :mojave sha256 "5d0737d480cacb6d13b5cb5883ba8daeb197ae99ef3cc7d7f4bcfc87aa242ebd" => :high_sierra sha256 "39854ee9fc01e80f14a5cafdbbf868c349d612955820d3407c588ff099f28e4d" => :sierra end option "with-docs", "Intall API documentation and sample code" def install prefix.install %w[lib license] # update libs cd lib do install_change "libFileGDBAPI.dylib", "@rpath/libfgdbunixrtl.dylib", "@loader_path/libfgdbunixrtl.dylib" set_install_name("libFileGDBAPI.dylib", opt_lib) end # build a sample for testing libs # Note: Editing sample failed in test sandbox; worked in Terminal mkdir_p libexec/"test/bin" mkdir libexec/"test/data" cp_r "samples/data/Querying.gdb", libexec/"test/data/" cd "samples/Querying" do inreplace "Makefile", "../../lib", lib inreplace "Makefile", "../bin", "#{libexec}/test/bin" system "make" end # install headers (after building test binary) rm_f "include/make.include" include.install "include" => "filegdb" if build.with? "docs" pkgshare.install %w[samples xmlResources] pkgshare.install "doc/html" => "html" end end def install_change(dylib, old, new) quiet_system "install_name_tool", "-change", old, new, dylib end def set_install_name(dylib, dir) quiet_system "install_name_tool", "-id", "#{dir}/#{dylib}", dylib end def caveats; <<~EOS To build software with the File GDB API, add to the following environment variable to find headers: CPPFLAGS: -I#{opt_prefix}/include/filegdb EOS end test do cd libexec/"test/bin" do system "./Querying" end end end ================================================ FILE: Formula/osgeo-fyba.rb ================================================ class OsgeoFyba < Formula desc "Library to read/write Norwegian National geodata standard (SOSI) files" homepage "https://github.com/kartverket/fyba" url "https://github.com/kartverket/fyba/archive/4.1.1.tar.gz" sha256 "99f658d52e8fd8997118bb6207b9c121500700996d9481a736683474e2534179" revision 1 head "https://github.com/kartverket/fyba.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "9966047d61d968941f24082a9bd7a9bcef59bd3df81bc864a35fd44287991909" => :mojave sha256 "9966047d61d968941f24082a9bd7a9bcef59bd3df81bc864a35fd44287991909" => :high_sierra sha256 "4a2c603626d62a08824f5739d831967fea36c09d5c1150b0923f8c804063f56c" => :sierra end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build def install # fixup some includes: https://github.com/kartverket/fyba/issues/12 # done with inreplace due to CRLF endings in src/UT files # REMOVE ON NEXT RELEASE %w[configure configure.ac src/UT/DISKINFO.cpp src/UT/INQSIZE.cpp src/UT/INQTID.cpp].each do |s| inreplace s, "sys/vfs.h", "sys/mount.h" end # fixup UT_INT64 type in include: https://github.com/kartverket/fyba/pull/19 # done with inreplace due to CRLF endings in files inreplace "src/UT/fyut.h", %r{(/\* For UNIX \*/)}, "\\1\r\n# ifdef __APPLE__\r\n# include \r\n# define UT_INT64 int64_t\r\n# endif\r\n" system "autoreconf", "-vfi" system "./configure", "--prefix=#{prefix}" system "make" system "make", "install" end test do (testpath/"fyba_test.cpp").write <<-EOS #include "fyba.h" int main() { SK_EntPnt_FYBA char *LC_InqVer(void); return 0; } EOS system ENV.cxx, "-I#{include}/fyba", "-L#{lib}", "-lfyba", "-lfygm", "-lfyut", "-o", "fyba_test", "fyba_test.cpp" system "./fyba_test" end end ================================================ FILE: Formula/osgeo-gdal-ecwjp2.rb ================================================ class OsgeoGdalEcwjp2 < Formula desc "GDAL/OGR 3.x plugin for ECW driver" homepage "http://www.gdal.org/frmt_ecw.html" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" # revision 1 head "https://github.com/OSGeo/gdal.git", :branch => "master" # bottle do # never # end depends_on "osgeo-ecwjp2-sdk" depends_on "osgeo-gdal" def gdal_majmin_ver gdal_ver_list = Formula["osgeo-gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install ENV.cxx11 ecwjp2_opt = Formula["osgeo-ecwjp2-sdk"].opt_prefix ecwjp2_opt_include = ecwjp2_opt/"include/ECWJP2" gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath # cxx flags args = %W[-Iport -Igcore -Ifrmts -DFRMT_ecw -DECWSDK_VERSION=53 -Ifrmts/ecw -DDO_NOT_USE_DEBUG_BOOL -I#{ecwjp2_opt_include} -I#{ecwjp2_opt_include}/NCSEcw/API -I#{ecwjp2_opt_include}/NCSEcw/ECW -I#{ecwjp2_opt_include}/NCSEcw/JP2] # source files Dir["frmts/ecw/*.cpp"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "gdal_ECW_JP2ECW.dylib" args.concat %W[ -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{ecwjp2_opt}/lib -lNCSEcw] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["osgeo-gdal"].opt_bin out = shell_output("#{gdal_opt_bin}/gdalinfo --formats") assert_match "ECW -raster- (rov)", out assert_match "JP2ECW -raster,vector- (rov)", out ecwjp2_test = Formula["osgeo-ecwjp2-sdk"].opt_prefix/"test" out = shell_output("#{gdal_opt_bin}/gdalinfo #{ecwjp2_test}/RGB_8bit.ecw") assert_match "Driver: ECW/ERDAS Compressed Wavelets", out assert_match "Size is 4320, 2160", out out = shell_output("#{gdal_opt_bin}/gdalinfo #{ecwjp2_test}/RGB_8bit.jp2") assert_match "Driver: JP2ECW/ERDAS JPEG2000", out assert_match "Size is 4320, 2160", out end end ================================================ FILE: Formula/osgeo-gdal-filegdb.rb ================================================ class OsgeoGdalFilegdb < Formula desc "GDAL/OGR 3.x plugin for ESRI FileGDB driver" homepage "http://www.gdal.org/drv_filegdb.html" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" #revision 1 head "https://github.com/OSGeo/gdal.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "a1becbb7db6c1b00d7c74ae4cc19734537760f0156855218c4e97d0c17d32c65" => :catalina sha256 "a1becbb7db6c1b00d7c74ae4cc19734537760f0156855218c4e97d0c17d32c65" => :mojave sha256 "a1becbb7db6c1b00d7c74ae4cc19734537760f0156855218c4e97d0c17d32c65" => :high_sierra end depends_on "osgeo-filegdb-api" depends_on "osgeo-gdal" def gdal_majmin_ver gdal_ver_list = Formula["osgeo-gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install ENV.cxx11 filegdb_opt = Formula["osgeo-filegdb-api"].opt_prefix gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath # cxx flags args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/filegdb -I#{filegdb_opt}/include/filegdb] # source files Dir["ogr/ogrsf_frmts/filegdb/*.c*"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "ogr_FileGDB.dylib" args.concat %W[ -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{filegdb_opt}/lib -lFileGDBAPI] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["osgeo-gdal"].opt_bin out = shell_output("#{gdal_opt_bin}/ogrinfo --formats") assert_match "FileGDB -vector- (rw+)", out end end ================================================ FILE: Formula/osgeo-gdal-grass.rb ================================================ class OsgeoGdalGrass < Formula desc "GDAL/OGR 3.x plugin for GRASS 7" homepage "https://www.gdal.org" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" #revision 1 #bottle do # root_url "https://bottle.download.osgeo.org" # cellar :any # sha256 "24d80b0a8250aee06a5af69277371f582b24e87036c091f0b174268a898b2ae0" => :mojave # sha256 "24d80b0a8250aee06a5af69277371f582b24e87036c091f0b174268a898b2ae0" => :high_sierra # sha256 "736afd0da344f3b221bc0b4e58019970b50552d40e2472b00ff8872248f5a977" => :sierra #end depends_on "osgeo-gdal" depends_on "osgeo-grass" def gdal_majmin_ver gdal_ver_list = Formula["osgeo-gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install ENV.cxx11 gdal = Formula["osgeo-gdal"] gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath grass = Formula["osgeo-grass"] # due to DYLD_LIBRARY_PATH no longer being setable, strictly define extension inreplace "Makefile.in", ".so", ".dylib" system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking", "--with-gdal=#{gdal.opt_bin}/gdal-config", "--with-grass=#{grass.prefix}/grass-base", "--with-autoload=#{gdal_plugins}" # inreplace "Makefile", "mkdir", "mkdir -p" system "make", "install" end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["osgeo-gdal"].opt_bin out = shell_output("#{gdal_opt_bin}/gdalinfo --formats") assert_match "GRASS -raster- (ro)", out out = shell_output("#{gdal_opt_bin}/ogrinfo --formats") assert_match "OGR_GRASS -vector- (ro)", out end end ================================================ FILE: Formula/osgeo-gdal-mdb.rb ================================================ class OsgeoGdalMdb < Formula desc "GDAL/OGR 3.x plugin for MDB driver" homepage "http://www.gdal.org/drv_mdb.html" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" #revision 1 head "https://github.com/OSGeo/gdal.git", :branch => "master" # bottle do # never (runtime JAVA version may change too much, or be different from Travis CI) # end depends_on "openjdk" depends_on "osgeo-gdal" depends_on "libtiff" depends_on "osgeo-libgeotiff" # various deps needed for configuring depends_on "json-c" resource "jackcess-jar" do url "https://downloads.sf.net/project/jackcess/jackcess/1.2.14.3/jackcess-1.2.14.3.jar" sha256 "a6fab0c4b5daf23dcf7fd309ee4ffc6df12ff982510c094e45442adf88712787" end resource "logging-jars" do # lib/commons*.jar url "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/mdb-sqlite/mdb-sqlite-1.0.2.tar.bz2" sha256 "43a584903f4c820b97104758a0d8f15731c70cee5d3d88d96669b1d91e902520" end resource "test-mdb" do url "https://osgeo4mac.s3.amazonaws.com/src/NJ-Streets_Atlantic.zip" sha256 "811ea90c55be918d8c3a2a5c75105e224c7a37fafb7f6154f67ec8eb9d8b86ef" end def gdal_majmin_ver gdal_ver_list = Formula["osgeo-gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def configure_args args = [ # Base configuration. "--prefix=#{prefix}", "--mandir=#{man}", "--disable-debug", "--with-local=#{prefix}", "--with-threads", "--with-libtool", # various deps needed for configuring "--with-libjson-c=#{Formula["json-c"].opt_prefix}", # force correction of dylib setup, even though we are not building framework here "--with-macosx-framework", ] cmd = Language::Java.java_home_cmd("1.8") ENV["JAVA_HOME"] = Utils.popen_read(cmd).chomp args << "--with-java=yes" args << "--with-jvm-lib=#{ENV["JAVA_HOME"]}/jre/lib/server" # args << "--with-jvm-lib=dlopen" # doesn't seem to work on macOS # The rpath is only embedded for Oracle Java (non-framework) installs, # though it does not work here as we are just compiling a plugin directly args << "--with-jvm-lib-add-rpath=yes" args << "--with-mdb=yes" # nix all other configure tests, i.e. minimal base gdal build without_pkgs = %w[ armadillo bsb cfitsio cryptopp curl dds dods-root ecw epsilon expat fgdb fme freexl geos gif gnm grass grib gta hdf4 hdf5 idb ingres j2lura jasper jp2mrsid jpeg jpeg12 kakadu kea libgrass libkml liblzma libz mongocxx mrf mrsid_lidar mrsid msg mysql netcdf oci odbc ogdi opencl openjpeg pam pcidsk pcraster pcre perl pg php png python qhull rasdaman rasterlite2 sde sfcgal sosi spatialite sqlite3 static-proj4 teigha webp xerces xml2 ] args.concat without_pkgs.map { |b| "--without-" + b } args end def install gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath ENV.cxx11 # configure GDAL/OGR with minimal drivers system "./configure", *configure_args # cxx flags args = %W[-DLINUX -DUNIX -Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/mdb -I#{ENV["JAVA_HOME"]}/include/darwin -I#{ENV["JAVA_HOME"]}/include] # source files Dir["ogr/ogrsf_frmts/mdb/ogrmdb*.c*"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "ogr_MDB.dylib" args.concat %W[ -std=c++11 -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{ENV["JAVA_HOME"]}/jre/lib/server -ljvm] # build and install shared plugin system ENV.cxx, *args dylib = lib/gdal_plugins_subdirectory/dylib_name dylib.ensure_writable do # manually add the libjvm.dylib rpath directory entry to the plugin MachO::Tools.add_rpath(dylib.to_s, "#{ENV["JAVA_HOME"]}/jre/lib/server", :strict => false) end libexec.install resource("jackcess-jar") resource("logging-jars").stage do libexec.install Dir["lib/commons*.jar"] end end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins To have a functional MDB driver, install supporting .jar files in: /Library/Java/Extensions/ from: #{opt_libexec}/*.jar (However, this can affect other JAVA software) Optionally, set the following JAVA environment variable, per session: export CLASSPATH=#{Dir[libexec/"*.jar"].join(":")} See: http://www.gdal.org/ogr/drv_mdb.html !!!!!!!!! IMPORTANT !!!!!!!!! You may need to adjust your JAVA JRE or JDK install to allow JNI usage: see: https://oliverdowling.com.au/2015/10/09/oracles-jdk-8-on-mac-os-x-el-capitan/ EOS end test do # cmd = Language::Java.java_home_cmd("1.8+") # ENV["JAVA_HOME"] = Utils.popen_read(cmd).chomp ENV["CLASSPATH"] = Dir[libexec/"*.jar"].join(":") # puts "JAVA_HOME=#{ENV["JAVA_HOME"]}" # puts "CLASSPATH=#{ENV["CLASSPATH"]}" ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["odgeo-gdal"].opt_bin system "#{gdal_opt_bin}/ogrinfo", "--format", "MDB" resource("test-mdb").stage testpath system "#{gdal_opt_bin}/ogrinfo", "-ro", testpath/"Atlantic.mdb".to_s end end ================================================ FILE: Formula/osgeo-gdal-mongodb.rb ================================================ class OsgeoGdalMongodb < Formula desc "GDAL/OGR 3.x plugin for MongoDB driver" homepage "http://www.gdal.org/drv_mongodb.html" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" #revision 1 head "https://github.com/OSGeo/gdal.git", :branch => "master" #bottle do # root_url "https://bottle.download.osgeo.org" # cellar :any # sha256 "1bd81d777302cee99d33b444746f9451374cf354b64a07fdd44fb0cb51574293" => :catalina # sha256 "1bd81d777302cee99d33b444746f9451374cf354b64a07fdd44fb0cb51574293" => :mojave # sha256 "1bd81d777302cee99d33b444746f9451374cf354b64a07fdd44fb0cb51574293" => :high_sierra #end depends_on "boost" depends_on "libtiff" depends_on "osgeo-libgeotiff" depends_on "osgeo-gdal" depends_on "osgeo-mongo-cxx-driver-legacy" def gdal_majmin_ver gdal_ver_list = Formula["osgeo-gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def configure_args args = [ # Base configuration. "--prefix=#{prefix}", "--mandir=#{man}", "--disable-debug", "--with-local=#{prefix}", "--with-threads", "--with-libtool", # force correction of dylib setup, even though we are not building framework here "--with-macosx-framework", ] args << "--with-mongocxx=#{Formula["osgeo-mongo-cxx-driver-legacy"].opt_prefix}" # nix all other configure tests, i.e. minimal base gdal build without_pkgs = %w[ armadillo bsb cfitsio cryptopp curl dds dods-root ecw epsilon expat fgdb fme freexl geos gif gnm grass grib gta hdf4 hdf5 idb ingres jasper jp2mrsid jpeg jpeg12 kakadu kea libgrass libkml liblzma libz mdb mrf mrsid_lidar mrsid msg mysql netcdf oci odbc ogdi opencl openjpeg pam pcidsk pcraster pcre perl pg php png python qhull rasdaman rasterlite2 sde sfcgal sosi spatialite sqlite3 static-proj4 teigha webp xerces xml2 ] args.concat without_pkgs.map { |b| "--without-" + b } args end def install gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath ENV.cxx11 # configure GDAL/OGR with minimal drivers system "./configure", *configure_args # cxx flags args = %W[-DLINUX -DUNIX -Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/mongodb] # source files Dir["ogr/ogrsf_frmts/mongodb/ogrmongodb*.c*"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "ogr_MongoDB.dylib" args.concat %W[ -std=c++11 -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # Add the Mongo lib args.concat %W[-L#{Formula["osgeo-mongo-cxx-driver-legacy"].opt_lib} -lmongoclient] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["osgeo-gdal"].opt_bin system "#{gdal_opt_bin}/ogrinfo", "--format", "MongoDB" end end ================================================ FILE: Formula/osgeo-gdal-mrsid.rb ================================================ class OsgeoGdalMrsid < Formula desc "GDAL/OGR 3.x plugin for MrSID raster and LiDAR drivers" homepage "http://www.gdal.org/frmt_mrsid.html" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" # revision 1 head "https://github.com/OSGeo/gdal.git", :branch => "master" # bottle do # never # end depends_on "osgeo-mrsid-sdk" depends_on "osgeo-gdal" def gdal_majmin_ver gdal_ver_list = Formula["osgeo-gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install ENV.cxx11 mrsid_sdk_opt = Formula["osgeo-mrsid-sdk"].opt_prefix gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath plugins = {} lidar_args = [] mrsid_args = [] # source files & cxx/ld flags # gdal_MG4Lidar.dylib Dir["frmts/mrsid_lidar/*.c*"].each { |src| lidar_args.concat %W[#{src}] } lidar_args.concat %W[ -Iport -Igcore -Ifrmts -Ifrmts/mrsid_lidar -I#{mrsid_sdk_opt}/include/mrsid ] lidar_args.concat %W[-L#{mrsid_sdk_opt}/lib -llti_lidar_dsdk] plugins[:gdal_MG4Lidar] = lidar_args # gdal_MrSID.dylib Dir["frmts/mrsid/*.c*"].each { |src| mrsid_args.concat %W[#{src}] } mrsid_args.concat %W[ -DMRSID_J2K=1 -Iport -Igcore -Ifrmts -Ifrmts/mrsid -Ifrmts/gtiff/libgeotiff -I#{mrsid_sdk_opt}/include/mrsid ] mrsid_args.concat %W[-L#{mrsid_sdk_opt}/lib -lltidsdk] plugins[:gdal_MrSID] = mrsid_args # plugin dylib plugins.each do |key, args| args.concat %W[ -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{key}.dylib -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{key}.dylib -undefined dynamic_lookup ] # build and install shared plugin system ENV.cxx, *args end end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["osgeo-gdal"].opt_bin out = shell_output("#{gdal_opt_bin}/gdalinfo --formats") assert_match "MG4Lidar -raster- (ro)", out assert_match "MrSID -raster- (rov)", out assert_match "JP2MrSID -raster- (rov)", out end end ================================================ FILE: Formula/osgeo-gdal-mysql.rb ================================================ class OsgeoGdalMysql < Formula desc "GDAL/OGR 3.x plugin for MySQL driver" homepage "http://www.gdal.org/drv_mysql.html" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" #revision 1 head "https://github.com/OSGeo/gdal.git", :branch => "master" #bottle do # root_url "https://bottle.download.osgeo.org" # sha256 "82e4ae8e22b01017f8be53a735bf19d5120fa8b80e6c561406cf73bae0a62506" => :catalina # sha256 "82e4ae8e22b01017f8be53a735bf19d5120fa8b80e6c561406cf73bae0a62506" => :mojave # sha256 "82e4ae8e22b01017f8be53a735bf19d5120fa8b80e6c561406cf73bae0a62506" => :high_sierra #end depends_on "mysql" => :build # adds openssl depends_on "osgeo-gdal" def gdal_majmin_ver gdal_ver_list = Formula["osgeo-gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install ENV.cxx11 mysql = Formula["mysql"] gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath # cxx flags args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/mysql -I#{mysql.opt_include}/mysql] # source files Dir["ogr/ogrsf_frmts/mysql/*.c*"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "ogr_MySQL.dylib" args.concat %W[ -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # ld flags args.concat %W[ #{mysql.opt_lib}/libmysqlclient.a -L#{Formula["openssl"].opt_lib} -lssl -lcrypto ] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["osgeo-gdal"].opt_bin out = shell_output("#{gdal_opt_bin}/ogrinfo --formats") assert_match "MySQL -vector- (rw+)", out end end ================================================ FILE: Formula/osgeo-gdal-ogdi.rb ================================================ class OsgeoGdalOgdi < Formula desc "GDAL/OGR 3.x plugin for OGDI driver" homepage "http://www.gdal.org/drv_ogdi.html" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" #revision 1 head "https://github.com/OSGeo/gdal.git", :branch => "master" #bottle do # root_url "https://bottle.download.osgeo.org" # cellar :any # sha256 "33c1448189416e6812f3d05af2f0751daf604d4be188363707bc2a7d6b24f5e8" => :catalina # sha256 "33c1448189416e6812f3d05af2f0751daf604d4be188363707bc2a7d6b24f5e8" => :mojave # sha256 "33c1448189416e6812f3d05af2f0751daf604d4be188363707bc2a7d6b24f5e8" => :high_sierra #end depends_on "osgeo-ogdi" depends_on "osgeo-gdal" def gdal_majmin_ver gdal_ver_list = Formula["osgeo-gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install ENV.cxx11 ogdi_opt = Formula["osgeo-ogdi"].opt_prefix gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath # (HOMEBREW_PREFIX/"lib/#{gdal_plugins_subdirectory}").mkpath # add external plugin registration inreplace "#{Dir.pwd}/ogr/ogrsf_frmts/ogdi/ogrogdi.h", %r{(#endif /\* OGDOGDI_H_INCLUDED \*/)}, <<~EOS CPL_C_START void CPL_DLL RegisterOGROGDI(); CPL_C_END \\1 EOS # cxx flags args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/ogdi -I#{ogdi_opt}/include/ogdi] # source files Dir["ogr/ogrsf_frmts/ogdi/*.c*"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "ogr_OGDI.dylib" args.concat %W[ -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{ogdi_opt}/lib/ogdi -logdi] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["osgeo-gdal"].opt_bin out = shell_output("#{gdal_opt_bin}/ogrinfo --formats") assert_match "OGR_OGDI -vector- (ro): OGDI Vectors (VPF, VMAP, DCW)", out end end ================================================ FILE: Formula/osgeo-gdal-oracle.rb ================================================ class OsgeoGdalOracle < Formula desc "GDAL/OGR 3.x plugin for Oracle Spatial driver" homepage "http://www.gdal.org/drv_oci.html" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" # revision 1 head "https://github.com/OSGeo/gdal.git", :branch => "master" # bottle do # never # end depends_on "osgeo-oracle-client-sdk" depends_on "osgeo-gdal" def gdal_majmin_ver gdal_ver_list = Formula["osgeo-gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install oracle_opt = Formula["osgeo-oracle-client-sdk"].opt_prefix gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath # cxx flags args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/oci -I#{oracle_opt}/include/oci] # source files Dir["ogr/ogrsf_frmts/oci/oci_utils.cpp", "ogr/ogrsf_frmts/oci/ogr*.c*"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "ogr_OCI.dylib" args.concat %W[ -std=c++11 -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{oracle_opt}/lib -lclntsh] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["osgeo-gdal"].opt_bin out = shell_output("#{gdal_opt_bin}/ogrinfo --formats") assert_match "OCI -vector- (rw+)", out end end ================================================ FILE: Formula/osgeo-gdal-pdf.rb ================================================ class OsgeoGdalPdf < Formula desc "GDAL/OGR 3.x plugin for PDF driver" homepage "http://www.gdal.org/frmt_pdf.html" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" #revision 1 head "https://github.com/OSGeo/gdal.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" sha256 "3daada45817c48da90738d7b8052e2bd5fb25117e2c25c35bed2030f2b96517a" => :catalina sha256 "3daada45817c48da90738d7b8052e2bd5fb25117e2c25c35bed2030f2b96517a" => :mojave sha256 "3daada45817c48da90738d7b8052e2bd5fb25117e2c25c35bed2030f2b96517a" => :high_sierra end depends_on "pkg-config" => :build depends_on "cairo" depends_on "fontconfig" depends_on "freetype" depends_on "gettext" depends_on "glib" depends_on "gobject-introspection" depends_on "jpeg" depends_on "libpng" depends_on "libtiff" depends_on "osgeo-libgeotiff" depends_on "openjpeg" depends_on "podofo" # TODO: new code for GDAL >3.1 from: # https://github.com/rouault/pdfium_build_gdal_3_1 #depends_on "osgeo-pdfium" depends_on "osgeo-gdal" # various deps needed for configuring depends_on "json-c" # upstream poppler 0.59.0 incompatibility resource "poppler" do url "https://poppler.freedesktop.org/poppler-0.57.0.tar.xz" sha256 "0ea37de71b7db78212ebc79df59f99b66409a29c2eac4d882dae9f2397fe44d8" end resource "poppler-data" do url "https://poppler.freedesktop.org/poppler-data-0.4.8.tar.gz" sha256 "1096a18161f263cccdc6d8a2eb5548c41ff8fcf9a3609243f1b6296abdf72872" end def gdal_majmin_ver gdal_ver_list = Formula["osgeo-gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def configure_args args = [ # Base configuration. "--prefix=#{prefix}", "--mandir=#{man}", "--disable-debug", "--with-local=#{prefix}", "--with-threads", # various deps needed for configuring "--with-libjson-c=#{Formula["json-c"].opt_prefix}", # force correction of dylib setup, even though we are not building framework here "--with-macosx-framework", "--enable-pdf-plugin", "--without-libtool" ] # PDF-supporting backends for writing # args << "--with-pdfium=#{Formula["osgeo-pdfium"].opt_prefix}" # poppler is locally vendored args << "--with-poppler=#{libexec}/poppler" args << "--with-podofo=#{Formula["podofo"].opt_prefix}" # nix all other configure tests, i.e. minimal base gdal build without_pkgs = %w[ armadillo bsb cfitsio cryptopp curl dds dods-root ecw epsilon expat fgdb fme freexl geos gif gnm grass grib gta hdf4 hdf5 idb ingres j2lura jasper java jp2mrsid jpeg jpeg12 kakadu kea libgrass libkml liblzma libz mdb mongocxx mrf mrsid_lidar mrsid msg mysql netcdf oci odbc ogdi opencl openjpeg pam pcidsk pcraster pcre perl pg php png python qhull rasdaman rasterlite2 sde sfcgal sosi spatialite sqlite3 static-proj4 teigha webp xerces xml2 ] args.concat without_pkgs.map { |b| "--without-" + b } args end def install gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath # ENV.cxx11 needs :cxx11 if MacOS.version < :mavericks # ENV.libstdcxx # set ARCHFLAGS to match how we build ENV["ARCHFLAGS"] = "-arch #{Hardware::CPU.arch}" # ENV.append_to_cflags "-mmacosx-version-min=10.8" # ENV["CXXFLAGS"] = "-mmacosx-version-min=10.8" # ENV["MACOSX_DEPLOYMENT_TARGET"] = "10.8" # locally vendor dependency resource("poppler").stage do # Temp fix for supporting new OpenJPEG 2.x version, which is API/ABI compatible with OpenJPEG 2.2 opj_ver_list = Formula["openjpeg"].version.to_s.split(".") opj_ver = "#{opj_ver_list[0]}.#{opj_ver_list[1]}" ENV["LIBOPENJPEG_CFLAGS"] = "-I#{Formula["openjpeg"].opt_include}/openjpeg-#{opj_ver}" inreplace "poppler.pc.in", "Cflags: -I${includedir}/poppler", "Cflags: -I${includedir}/poppler -I${includedir}" system "./configure", "--disable-dependency-tracking", "--prefix=#{libexec}/poppler", "--enable-xpdf-headers", "--enable-poppler-glib", "--disable-gtk-test", "--enable-introspection=no", "--disable-poppler-qt4" system "make", "install" resource("poppler-data").stage do system "make", "install", "prefix=#{libexec}/poppler" end end ENV.deparallelize inreplace "configure", "stdlib=libstdc", "stdlib=libc" inreplace "configure", "-std=c++0x", "" # inreplace "port/cpl_string.h", /#ifndef HAVE_CXX11([^#]+)#endif/, "\\1" # configure GDAL/OGR with minimal drivers system "./configure", *configure_args # PDF driver needs memory driver object files cd "ogr/ogrsf_frmts/mem" do system "make" end cd "frmts/pdf" do system "make", "plugin" mv "gdal_PDF.dylib", "#{gdal_plugins}/" end end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["osgeo-gdal"].opt_bin out = shell_output("#{gdal_opt_bin}/gdalinfo --formats") assert_match "PDF -raster,vector- (rw+s): Geospatial PDF", out end end ================================================ FILE: Formula/osgeo-gdal-python.rb ================================================ class OsgeoGdalPython < Formula def self.gdal Formula["osgeo-gdal"] end def gdal self.class.gdal end def self.gdal_opts tab = Tab.for_formula(gdal) tab.used_options end def gdal_opts self.class.gdal_opts end def self.gdal_python(python) py_ver = Language::Python.major_minor_version(python) gdal.opt_lib/"python#{py_ver}" end def self.gdal_py3_exist? gdal_python("python").exist? end desc "Python bindings for GDAL: Geospatial Data Abstraction Library" homepage "https://pypi.python.org/pypi/GDAL" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" #revision 2 head "https://github.com/OSGeo/gdal.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "8e2ddaec0874f61df018c622cbf465985ae4dde2171d280464d15d02c72af192" => :catalina sha256 "8e2ddaec0874f61df018c622cbf465985ae4dde2171d280464d15d02c72af192" => :mojave sha256 "8e2ddaec0874f61df018c622cbf465985ae4dde2171d280464d15d02c72af192" => :high_sierra end keg_only "older version of gdal is in main tap and installs similar components" depends_on "swig" => :build depends_on "python" => :recommended depends_on "numpy" depends_on "osgeo-gdal" resource "autotest" do url "https://download.osgeo.org/gdal/3.1.2/gdalautotest-3.1.2.tar.gz" sha256 "bf2b87acc8db0d59a3e44302a0e3b749dcd50ee642843f96c3db35b7e9ccb215" end def install cd "swig/python" do # Customize to gdal install opt_prefix inreplace "setup.cfg" do |s| s.sub! "../../apps/gdal-config", "#{gdal.opt_bin}/gdal-config" end ENV.prepend "LDFLAGS", "-L#{gdal.opt_lib}" # or gdal1 lib will be found # Check for GNM support (Pathname.pwd/"setup_vars.ini").write "GNM_ENABLED=yes\n" unless gdal_opts.include? "without-gnm" python_version = Language::Python.major_minor_version "python3" system "python3", *Language::Python.setup_install_args(prefix) system "echo", "#{opt_prefix}/lib/python#{python_version}/site-packages", ">", "#{lib}/python#{python_version}/site-packages/#{name}.pth" # Scripts compatible with Python3? Appear to be... bin.install Dir["scripts/*"] # Clean up any stray doxygen files. Dir.glob("#{bin}/*.dox") { |p| rm p } # Add sample Python scripts (libexec/"bin").install Dir["samples/*"] chmod 0555, Dir[libexec/"bin/*.py"] # some randomly have no exec bit set end end def caveats; <<~EOS Sample Python scripts installed to: #{opt_libexec}/bin To run full test suite use: `brew test -v #{name} --with-autotest` EOS end test do python_version = Language::Python.major_minor_version "python3" next unless (lib/"python#{python_version}/site-packages").exist? ENV["PYTHONPATH"] = lib/"python#{python_version}/site-packages" pkgs = %w[gdal ogr osr gdal_array gdalconst] pkgs << "gnm" unless gdal_opts.include? "without-gnm" system "python3", "-c", "from osgeo import #{pkgs.join ","}" if ENV["GDAL_AUTOTEST"] ENV.prepend_path "PATH", gdal.opt_bin.to_s ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" ENV["GDAL_DATA"] = "#{gdal.opt_share}/gdal" ENV["GDAL_DOWNLOAD_TEST_DATA"] = "YES" # These driver tests cause hard failures, stopping test output ENV["GDAL_SKIP"] = "GRASS" ENV["OGR_SKIP"] = "ElasticSearch,GFT,OGR_GRASS" Language::Python.each_python(build) do |python, python_version| ENV["PYTHONPATH"] = opt_lib/"python#{python_version}/site-packages" resource("autotest").stage do # Split up tests, to reduce chance of execution expiration # ogr gcore gdrivers osr alg gnm utilities pyscripts %w[ogr gcore gdrivers osr alg gnm utilities pyscripts].each do |t| begin system "python3", "run_all.py", t.to_s rescue next end end end # Run autotest just once, with first found binding break end else ohai "To run full test suite use:\n\n `GDAL_AUTOTEST=1 brew test -v #{name}`\n" end end end ================================================ FILE: Formula/osgeo-gdal-sosi.rb ================================================ class OsgeoGdalSosi < Formula desc "GDAL/OGR 3.x plugin for SOSI driver" homepage "https://trac.osgeo.org/gdal/wiki/SOSI" url "https://download.osgeo.org/gdal/3.1.1/gdal-3.1.1.tar.xz" sha256 "97154a606339a6c1d87c80fb354d7456fe49828b2ef9a3bc9ed91771a03d2a04" #revision 1 head "https://github.com/OSGeo/gdal.git", :branch => "master" #bottle do # root_url "https://bottle.download.osgeo.org" # cellar :any # sha256 "15712928f08930894519dbb44294fd3747c4504ce99b5d3f3498ea1771bebfb8" => :catalina # sha256 "15712928f08930894519dbb44294fd3747c4504ce99b5d3f3498ea1771bebfb8" => :mojave # sha256 "15712928f08930894519dbb44294fd3747c4504ce99b5d3f3498ea1771bebfb8" => :high_sierra #end depends_on "osgeo-fyba" depends_on "osgeo-gdal" def gdal_majmin_ver gdal_ver_list = Formula["osgeo-gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install ENV.cxx11 fyba_opt = Formula["osgeo-fyba"].opt_prefix gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath # cxx flags args = %W[-DLINUX -DUNIX -Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/sosi -I#{fyba_opt}/include/fyba] # source files Dir["ogr/ogrsf_frmts/sosi/ogrsosi*.c*"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "ogr_SOSI.dylib" args.concat %W[ -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{fyba_opt}/lib -lfyba -lfygm -lfyut] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["osgeo-gdal"].opt_bin out = shell_output("#{gdal_opt_bin}/ogrinfo --formats") assert_match "SOSI -vector- (ro)", out end end ================================================ FILE: Formula/osgeo-gdal.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_gdal_linked } def core_gdal_linked Formula["gdal"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoGdal < Formula desc "GDAL: Geospatial Data Abstraction Library" homepage "https://www.gdal.org/" url "https://download.osgeo.org/gdal/3.1.2/gdal-3.1.2.tar.xz" sha256 "767c8d0dfa20ba3283de05d23a1d1c03a7e805d0ce2936beaff0bb7d11450641" #url "https://github.com/OSGeo/gdal.git", # :branch => "release/3.1", # :commit => "a9e385e76d8f4e7891d10adf1fc99fe3a4a89602" #version "3.1.2" revision 2 head do url "https://github.com/OSGeo/gdal.git", :branch => "master" depends_on "doxygen" => :build end bottle do root_url "https://bottle.download.osgeo.org" rebuild 1 sha256 "5c0cfe587fff624ed20d33db5ffbf2c7f9bc9af026a9bcecf795b1a07193925d" => :catalina sha256 "5c0cfe587fff624ed20d33db5ffbf2c7f9bc9af026a9bcecf795b1a07193925d" => :mojave sha256 "5c0cfe587fff624ed20d33db5ffbf2c7f9bc9af026a9bcecf795b1a07193925d" => :high_sierra end # keg_only "gdal is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked option "with-pg10", "Build with PostgreSQL 10 client" option "with-pg11", "Build with PostgreSQL 11 client" #deprecated_option "with-postgresql10" => "with-pg10" depends_on "pkg-config" => :build depends_on "armadillo" depends_on "ant" #depends_on "cryptopp" depends_on "curl-openssl" depends_on "expat" depends_on "freexl" depends_on "geos" depends_on "giflib" depends_on "json-c" depends_on "mdbtools" depends_on "numpy" depends_on "libiconv" depends_on "osgeo-libkml" depends_on "libpq" depends_on "osgeo-libspatialite" depends_on "libzip" depends_on "pcre" # for REGEXP operator in SQLite/Spatialite driver depends_on "openssl" depends_on "qhull" depends_on "sfcgal" depends_on "sqlite" # To ensure compatibility with SpatiaLite. depends_on "swig" depends_on "zlib" depends_on "openjdk" => :build # Raster libraries depends_on "cfitsio" depends_on "epsilon" depends_on "osgeo-hdf4" depends_on "hdf5" #depends_on "jpeg" depends_on "jpeg-turbo" depends_on "jasper" depends_on "libdap" #depends_on "osgeo-libgeotiff" depends_on "libpng" #depends_on "libtiff" depends_on "libxml2" depends_on "osgeo-netcdf" # Also brings in HDF5 depends_on "openjpeg" depends_on "webp" depends_on "zstd" # Vector libraries depends_on "unixodbc" # OS X version is not complete enough depends_on "xerces-c" # Other libraries depends_on "xz" # get liblzma compression algorithm library from XZutils # depends_on "charls" # cask depends_on "osgeo-proj" if build.with?("pg10") depends_on "osgeo-postgresql@10" elsif build.with?("pg11") depends_on "osgeo-postgresql@11" else depends_on "osgeo-postgresql" end # use: osgeo-gdal-pdf # depends_on "poppler" # use: osgeo-gdal-python # depends_on "python" # depends_on "python@2" # - Base configuration # - GDAL native backends # - Supported backends: optional Homebrew packages supporting additional formats. # - Unsupported backends: The libraries are either proprietary, not available for public # download or have no stable version in the Homebrew core that is # compatible with GDAL. Interested users will have to install such software # manually and most likely have to tweak the install routine. # - GRASS backend explicitly disabled. Creates a chicken-and-egg problem. # Should be installed separately after GRASS installation using the # official GDAL GRASS plugin. # - Python is installed manually to ensure everything is properly sandboxed # - All PDF driver functionality moved to gdal2-pdf plugin # Older pdfium (for gdal driver) is still built against libstdc++ and # causes the base build to be built like that as well. # See: https://github.com/rouault/pdfium # - Database support # Fix build with Jasper. # Remove on next release. # https://github.com/OSGeo/gdal/issues/2844 patch :p2 do url "https://github.com/OSGeo/gdal/commit/ab72c4893e6d14d488dfed25745d79f11bee45b9.patch?full_index=1" sha256 "54e10575646666f31fb2a87b7fc5b2831282fe2fa08642231e94fdee1fee8374" end patch :p2 do url "https://github.com/OSGeo/gdal/commit/e236eeaed1be45a4af457565085e3db1f2fc489f.patch?full_index=1" sha256 "5b582258a556d96712761932bf94dbd3343a7a0ac61bb53c6c83a7ba4c962fe5" end def configure_args args = [ "--prefix=#{prefix}", "--disable-debug", "--with-local=#{prefix}", "--with-proj=#{Formula["osgeo-proj"].opt_prefix}", "--with-dods-root=#{Formula["libdap"].opt_prefix}", # #{HOMEBREW_PREFIX} "--with-libtool", "--with-bsb", "--with-grib", "--with-pam", "--with-opencl", "--with-pcre", "--with-threads=yes", "--with-java=yes", "--with-liblzma=yes", "--with-pcidsk=internal", "--with-pcraster=internal", "--with-qhull=internal", "--with-libz=#{Formula["libzip"].opt_prefix}", "--with-png=#{Formula["libpng"].opt_prefix}", "--with-libtiff=internal", # #{Formula["libtiff"].opt_prefix} "--with-geotiff=internal", # #{Formula["osgeo-libgeotiff"].opt_prefix} "--with-jpeg=#{Formula["jpeg-turbo"].opt_prefix}", "--with-gif=#{Formula["giflib"].opt_prefix}", "--with-libjson-c=#{Formula["json-c"].opt_prefix}", "--with-libiconv-prefix=#{Formula["libiconv"].opt_prefix}", "--with-zstd=#{Formula["zstd"].opt_prefix}", "--with-cfitsio=#{Formula["cfitsio"].opt_prefix}", "--with-hdf4=#{Formula["osgeo-hdf4"].opt_prefix}", "--with-hdf5=#{Formula["hdf5"].opt_prefix}", "--with-netcdf=#{Formula["osgeo-netcdf"].opt_prefix}", "--with-jasper=#{Formula["jasper"].opt_prefix}", # or GDAL_SKIP="Jasper" "--with-openjpeg=#{Formula["openjpeg"].opt_prefix}", "--with-expat=#{Formula["expat"].opt_prefix}", "--with-odbc=#{Formula["unixodbc"].opt_prefix}", "--with-curl=#{Formula["curl-openssl"].opt_bin}/curl-config", "--with-xml2=yes", "--with-spatialite=#{Formula["osgeo-libspatialite"].opt_prefix}", "--with-sqlite3=#{Formula["sqlite"].opt_prefix}", "--with-webp=#{Formula["webp"].opt_prefix}", "--with-geos=#{Formula["geos"].opt_bin}/geos-config", "--with-freexl=#{Formula["freexl"].opt_prefix}", "--with-xerces=#{Formula["xerces-c"].opt_prefix}", "--with-libkml=#{Formula["osgeo-libkml"].opt_prefix}", "--with-epsilon=#{Formula["epsilon"].opt_prefix}", "--with-sfcgal=#{Formula["sfcgal"].opt_bin}/sfcgal-config", "--with-armadillo=#{Formula["armadillo"].opt_prefix}", "--with-cryptopp=no", "--with-crypto=yes", "--with-grass=no", "--with-libgrass=no", "--with-fme=no", "--with-ecw=no", "--with-kakadu=no", "--with-mrsid=no", "--with-jp2mrsid=no", "--with-msg=no", "--with-oci=no", "--with-ingres=no", "--with-idb=no", "--with-sde=no", "--with-perl=no", "--with-python=no", "--with-gta=no", "--with-ogdi=no", "--with-sosi=no", "--with-mongocxx=no", "--with-fgdb=no", "--with-mrsid_lidar=no", "--with-gnm", "--with-mysql=no", "--with-pg=yes", "--with-poppler=no", "--with-podofo=no", "--with-pdfium=no", "--with-kea=no", "--with-teigha=no", "--with-mdb=no", "--with-dds=no", "--with-hdfs=no", "--with-j2lura=no", "--with-rasterlite2=no", "--with-rasdaman=no", # "--with-charls", # "--with-boost-lib-path", # "--with-mongocxxv3", # "--with-teigha-plt", # "--with-jvm-lib", # "--with-jvm-lib-add-rpath", # "--with-cpp14", # "--with-pic", # "--with-aix-soname", # "--with-gnu-ld", # "--with-sysroot", # "--with-unix-stdio-64", # "--with-sse", # "--with-ssse3", # "--with-avx", # "--with-hide-internal-symbols", # "--with-rename-internal-libtiff-symbols", # "--with-rename-internal-libgeotiff-symbols", # "--with-rename-internal-shapelib-symbols", # "--with-gnu-ld", # "--with-spatialite-soname", # "--with-sde-version", # "--with-gdal-ver", # "--with-macosx-framework", # "--with-null", # "--with-podofo-lib", # "--with-podofo-extra-lib-for-test", # "--with-pdfium-lib", # "--with-pdfium-extra-lib-for-test", # "--with-xerces-inc", # "--with-xerces-lib", # "--with-expat-inc", # "--with-expat-lib", # "--with-libkml-inc", # "--with-libkml-lib", # "--with-oci-include", # "--with-oci-lib", # "--with-opencl-include", # "--with-opencl-lib", "--without-jpeg12", # Needs specially configured JPEG and TIFF libraries # "--without-lerc", # "--without-libtool", # "--without-ld-shared", # "--without-libiconv-prefix", # "--without-pam", # "--without-php", # "--without-dwgdirect", # "--without-ruby", ] args end def plugins_subdirectory gdal_ver_list = version.to_s.split(".") "gdalplugins/#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def install # Temporary fix for Xcode/CLT 9.0.x issue of missing header files # See: https://github.com/OSGeo/homebrew-osgeo4mac/issues/276 # Work around "error: no member named 'signbit' in the global namespace" if DevelopmentTools.clang_build_version >= 900 ENV.delete "SDKROOT" ENV.delete "HOMEBREW_SDKROOT" end # Linking flags for SQLite are not added at a critical moment when the GDAL # library is being assembled. This causes the build to fail due to missing # symbols. Also, ensure Homebrew SQLite is used so that Spatialite is # functional # Fortunately, this can be remedied using LDFLAGS sqlite = Formula["sqlite"] ENV.append "LDFLAGS", "-L#{sqlite.opt_lib} -lsqlite3" ENV.append "CFLAGS", "-I#{sqlite.opt_include}" # Reset ARCHFLAGS to match how we build ENV["ARCHFLAGS"] = "-arch #{Hardware::CPU.arch}" # chdir "gdal" do # GDAL looks for the renamed hdf4 library, which is an artifact of old builds, so we need to repoint it inreplace "configure", "-ldf", "-lhdf" # These libs are statically linked in libkml-dev and libkml formula inreplace "configure", " -lminizip -luriparser", "" # All PDF driver functionality moved to osgeo-gdal-pdf plugin, # so nix default internal-built PDF w+ driver, which keeps plugin from loading. # Just using --enable-pdf-plugin isn't enough (we don't want the plugin built here) # inreplace "GDALmake.opt.in", "PDF_PLUGIN),yes", "PDF_PLUGIN),no" # https://github.com/OSGeo/gdal/commit/20716436ce5debca66cbbe0396304e09b79bc3aa#diff-adc90aa0203327969e0048718b911252 args = configure_args system "./configure", *args system "make" system "make", "install" # Add GNM headers for osgeo-gdal-python swig wrapping include.install Dir["gnm/**/*.h"] cd "swig/java" do inreplace "java.opt", "linux", "darwin" inreplace "java.opt", "#JAVA_HOME = /usr/lib/jvm/java-6-openjdk/", "JAVA_HOME=#{ENV["JAVA_HOME"]}" system "make" system "make", "install" # Install the jar that complements the native JNI bindings lib.install "gdal.jar" end system "make", "man" if build.head? system "make", "install-man" # Clean up any stray doxygen files. Dir.glob("#{bin}/*.dox") { |p| rm p } # end end def post_install # Create versioned plugins path for other formulae (HOMEBREW_PREFIX/"lib/#{plugins_subdirectory}").mkpath end def caveats s = <<~EOS Plugins for this version of GDAL/OGR, generated by other formulae, should be symlinked to the following directory: #{HOMEBREW_PREFIX}/lib/#{plugins_subdirectory} You may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins PYTHON BINDINGS are now built in a separate formula: osgeo-gdal-python EOS s end test do # basic tests to see if third-party dylibs are loading OK system "#{bin}/gdalinfo", "--formats" system "#{bin}/ogrinfo", "--formats" end end ================================================ FILE: Formula/osgeo-gmt.rb ================================================ class OsgeoGmt < Formula include Language::Python::Virtualenv desc "Tools for processing and displaying xy and xyz datasets" homepage "https://gmt.soest.hawaii.edu/" url "ftp://ftp.soest.hawaii.edu/gmt/gmt-5.4.5-src.tar.gz" mirror "https://mirrors.ustc.edu.cn/gmt/gmt-5.4.5-src.tar.xz" mirror "https://fossies.org/linux/misc/GMT/gmt-5.4.5-src.tar.xz" sha256 "225629c7869e204d5f9f1a384c4ada43e243f83e1ed28bdca4f7c2896bf39ef6" revision 2 bottle do root_url "https://bottle.download.osgeo.org" rebuild 1 sha256 "ecf434fbf0e700d50f8d5b304d0ff9d963b94c7f8b66ef65664108bc1676d66e" => :mojave sha256 "ecf434fbf0e700d50f8d5b304d0ff9d963b94c7f8b66ef65664108bc1676d66e" => :high_sierra sha256 "2dd8acb9ce1d0415001851bc6d24cb63be8f74a75196d3d7d7b611a38dbd1103" => :sierra end depends_on "cmake" => :build depends_on "fftw" depends_on "hdf5" depends_on "osgeo-netcdf" depends_on "pcre" depends_on "osgeo-gdal" depends_on "zlib" depends_on "curl" depends_on "openblas" depends_on "sphinx" depends_on "ghostscript" depends_on "graphicsmagick" depends_on "subversion" depends_on "lapack" # depends_on "texlive" # Using CFLAGS = -I/Library/Java/JavaVirtualMachines/.. depends_on "openjdk" => :build # OpenMP support: disabled resource "gshhg" do url "ftp://ftp.soest.hawaii.edu/gmt/gshhg-gmt-2.3.7.tar.gz" mirror "https://mirrors.ustc.edu.cn/gmt/gshhg-gmt-2.3.7.tar.gz" mirror "https://fossies.org/linux/misc/GMT/gshhg-gmt-2.3.7.tar.gz" sha256 "9bb1a956fca0718c083bef842e625797535a00ce81f175df08b042c2a92cfe7f" end # digital chart of the world polygon map resource "dcw" do url "ftp://ftp.soest.hawaii.edu/gmt/dcw-gmt-1.1.4.tar.gz" mirror "https://mirrors.ustc.edu.cn/gmt/dcw-gmt-1.1.4.tar.gz" mirror "https://fossies.org/linux/misc/GMT/dcw-gmt-1.1.4.tar.gz" sha256 "8d47402abcd7f54a0f711365cd022e4eaea7da324edac83611ca035ea443aad3" end # gmt-coast (optional) – coastlines resource "Sphinx" do url "https://files.pythonhosted.org/packages/2a/86/8e1e8400bb6eca5ed960917952600fce90599e1cb0d20ddedd81ba163370/Sphinx-1.8.5.tar.gz" sha256 "c7658aab75c920288a8cf6f09f244c6cfdae30d82d803ac1634d9f223a80ca08" end def install # install python modules venv = virtualenv_create(libexec/'vendor', "#{HOMEBREW_PREFIX}/opt/python/bin/python3") # venv.pip_install "Sphinx" res = resources.map(&:name).to_set - %w[gshhg dcw] res.each do |r| venv.pip_install resource(r) end (buildpath/"gshhg").install resource("gshhg") (buildpath/"dcw").install resource("dcw") args = std_cmake_args.concat %W[ -DCMAKE_INSTALL_PREFIX=#{prefix} -DGSHHG_ROOT=#{buildpath}/gshhg -DCOPY_GSHHG:BOOL=TRUE -DDCW_ROOT=#{buildpath}/dcw -DCOPY_DCW:BOOL=TRUE -DFFTW3_ROOT=#{Formula["fftw"].opt_prefix} -DGMT_INSTALL_MODULE_LINKS:BOOL=TRUE -DGMT_INSTALL_TRADITIONAL_FOLDERNAMES:BOOL=FALSE -DLICENSE_RESTRICTED:BOOL=FALSE ] # args << "-DFLOCK:BOOL=TRUE" # not used by the project # args << "-DCMAKE_CXX_FLAGS_RELEASE" args << "-DGMT_DOCDIR=#{share}/doc/gmt" args << "-DGMT_MANDIR=#{man}" # args << "-DGMT_DATADIR=#{share}/gmt" args << "-DPCRE_ROOT=#{Formula["pcre"].opt_prefix}" # PCRE_DIR args << "-DGDAL_ROOT=#{Formula["osgeo-gdal"].opt_prefix}" # GDAL_DIR args << "-DNETCDF_ROOT=#{Formula["osgeo-netcdf"].opt_prefix}" # NETCDF_DIR # SPHINX_DIR or SPHINX_ROOT # args << "-DSPHINX_EXECUTABLE=#{Formula["sphinx"].opt_bin}" # sphinx-build args << "-DSPHINX_EXECUTABLE=#{libexec}/vendor/bin/sphinx-build" mkdir "build" do system "cmake", "..", *args system "make", "install" end end test do system "#{bin}/pscoast -R0/360/-70/70 -Jm1.2e-2i -Ba60f30/a30f15 -Dc -G240 -W1/0 -P > test.ps" assert_predicate testpath/"test.ps", :exist? end end ================================================ FILE: Formula/osgeo-gpkgtools.rb ================================================ require 'formula' class OsgeoGpkgtools < Formula desc "Some tools for the GeoPackage mapping (vector, tiles and raster) container" homepage 'https://launchpad.net/gpkgtools' revision 1 head "lp:gpkgtools", :using => :bzr depends_on 'osgeo-libspatialite' depends_on "python@2" resource "Pillow" do url "https://files.pythonhosted.org/packages/81/1a/6b2971adc1bca55b9a53ed1efa372acff7e8b9913982a396f3fa046efaf8/Pillow-6.0.0.tar.gz" sha256 "809c0a2ce9032cbcd7b5313f71af4bdc5c8c771cb86eb7559afd954cab82ebb5" end def install head_ext = "#{HOMEBREW_PREFIX}/Cellar/osgeo-libspatialite/HEAD/lib/spatialite.dylib" unless File.exist? head_ext odie <<~EOS No osgeo-libspatialite HEAD build or SQLite3 extension 'spatialite.dylib' exists. Install osgeo-libspatialite using --HEAD and --with-geopackage options'. NOTE: To experiment with the HEAD build, but already have osgeo-libspatialite installed, do the following: `brew upgrade osgeo-libspatialite --HEAD --with-geopackage` `brew list --versions osgeo-libspatialite` (note non-HEAD version) `brew switch osgeo-libspatialite ` EOS end resource("Pillow").stage { system "python", *Language::Python.setup_install_args(libexec/"vendor") } cd 'gpkgtools' do inreplace %w[util_sqlite.py GeoPackage.py] do |s| s.sub! 'from pysqlite2', '#from pysqlite2' s.sub! '#import sqlite3', 'import sqlite3' s.sub! /load_extension\(.*spatialite"\)/, "load_extension('#{head_ext}')" end end (lib/python.xy/'site-packages').install 'gpkgtools' bin.install Dir['*gpkg*'] prefix.install %w[tests testdata] end test do cd "#{opt_prefix}" do system 'python', 'tests/geonames.py' end end end ================================================ FILE: Formula/osgeo-grass.rb ================================================ class OsgeoGrass < Formula include Language::Python::Virtualenv desc "Geographic Resources Analysis Support System" homepage "https://grass.osgeo.org/" revision 7 # svn: E230001: Server SSL certificate verification failed: issuer is not trusted # head "https://svn.osgeo.org/grass/grass/trunk", :using => :svn # head "svn://svn.osgeo.org/grass/grass/trunk" # head "https://github.com/GRASS-GIS/grass-ci.git", :branch => "master" head "https://github.com/OSGeo/grass.git", :branch => "master" stable do #url "https://github.com/OSGeo/grass/archive/7.8.2.tar.gz" #sha256 "07b69e2fe0678bca29d9303a90eaf4a29dddcfa97fa92e056e214f0415629b6d" url "https://github.com/OSGeo/grass.git", :branch => "releasebranch_7_8", :commit => "8bcecc9a609bff0184519b124df17fb38e1195a5" version "7.8.3" # Patches to keep files from being installed outside of the prefix. # Remove lines from Makefile that try to install to /Library/Documentation. # no_symbolic_links patch :DATA end bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "a7f144c886435ab9c4fab9f3096882709f00b319d476648f42a145b3531de1a7" => :catalina sha256 "a7f144c886435ab9c4fab9f3096882709f00b319d476648f42a145b3531de1a7" => :mojave sha256 "a7f144c886435ab9c4fab9f3096882709f00b319d476648f42a145b3531de1a7" => :high_sierra end option "without-gui", "Build without WxPython interface. Command line tools still available" option "with-aqua", "Build with experimental Aqua GUI backend" option "with-app", "Build GRASS.app Package" option "with-avce00", "Build with AVCE00 support: Make Arc/Info (binary) Vector Coverages appear as E00" option "with-pg11", "Build with PostgreSQL 11 client" option "with-mysql", "Build with MySQL client" option "with-others", "Build with other optional dependencies" # option "with-openmp", "Build with openmp support" # option "with-opendwg", "Build with OpenDWG support" # option "with-pdal", "Build with PDAL support" # Build - Error: /vector/v.in.pdal depends_on "autoconf" => :build depends_on "automake" => :build depends_on "pkg-config" => :build depends_on "fftw" => :recommended depends_on "tcl-tk" => :recommended depends_on "python" depends_on "boost" depends_on "libiconv" depends_on "bison" depends_on "cairo" depends_on "flex" depends_on "freetype" depends_on "gettext" depends_on "ghostscript" depends_on "libtiff" depends_on "libpng" depends_on "sqlite" depends_on "regex-opt" depends_on "geos" depends_on "readline" depends_on "lapack" depends_on "openblas" depends_on "bzip2" depends_on "zlib" depends_on "unixodbc" depends_on "wxmac" depends_on "wxpython" depends_on "zstd" depends_on "lbzip2" depends_on "xz" depends_on "byacc" # yacc depends_on "subversion" # for g.extension depends_on "openjpeg" # for Pillow depends_on "osgeo-netcdf" depends_on "osgeo-proj" depends_on "osgeo-gdal" depends_on "osgeo-gdal-python" depends_on "osgeo-libgeotiff" # matplotlib depends_on "py3cairo" depends_on "pygobject3" # depends_on "pygobject" # Does not support Python 3, and needs pygtk which has been removed. depends_on "pyqt" depends_on "osgeo-six" depends_on "numpy" depends_on "scipy" depends_on "osgeo-matplotlib" # optional dependencies #depends_on "osgeo-liblas" depends_on "mysql" if build.with? "mysql" #depends_on "r" depends_on "avce00" => :optional # avcimport # depends_on "libomp" if build.with? "openmp" # depends_on "osgeo-pdal" if build.with?("pg11") depends_on "osgeo-postgresql@11" else depends_on "osgeo-postgresql" end depends_on :x11 if build.without? "aqua" # needs to find at least X11/include/GL/gl.h # other dependencies if build.with? "others" depends_on "gpsbabel" depends_on "netpbm" # mpeg_encode or ppmtompeg depends_on "openssl" depends_on "swig" depends_on "ffmpeg" depends_on "ffmpeg2theora" depends_on "ffmpegthumbnailer" depends_on "libav" depends_on "jasper" depends_on "wget" depends_on "dateutils" depends_on "gsl" depends_on "ncurses" depends_on "gdbm" depends_on "mesa" depends_on "mesalib-glw" depends_on "desktop-file-utils" depends_on "fontconfig" depends_on "openmotif" # or lesstif depends_on "libjpeg-turbo" depends_on "cfitsio" depends_on "imagemagick" depends_on "gd" # depends_on "mariadb-connector-c" # depends_on "mariadb" end def headless? # The GRASS GUI is based on WxPython. build.without? "gui" end def majmin_ver ver_split = version.to_s.split(".") ver_split[0] + ver_split[1] end resource "setuptools" do url "https://files.pythonhosted.org/packages/42/3e/2464120172859e5d103e5500315fb5555b1e908c0dacc73d80d35a9480ca/setuptools-45.1.0.zip" sha256 "91f72d83602a6e5e4a9e4fe296e27185854038d7cbda49dcd7006c4d3b3b89d5" end resource "pip" do url "https://files.pythonhosted.org/packages/8e/76/66066b7bc71817238924c7e4b448abdb17eb0c92d645769c223f9ace478f/pip-20.0.2.tar.gz" sha256 "7db0c8ea4c7ea51c8049640e8e6e7fde949de672bfa4949920675563a5a6967f" end resource "wheel" do url "https://files.pythonhosted.org/packages/75/28/521c6dc7fef23a68368efefdcd682f5b3d1d58c2b90b06dc1d0b805b51ae/wheel-0.34.2.tar.gz" sha256 "8788e9155fe14f54164c1b9eb0a319d98ef02c160725587ad60f14ddc57b6f96" end resource "Pillow" do url "https://files.pythonhosted.org/packages/39/47/f28067b187dd664d205f75b07dcc6e0e95703e134008a14814827eebcaab/Pillow-7.0.0.tar.gz" sha256 "4d9ed9a64095e031435af120d3c910148067087541131e82b3e8db302f4c8946" end resource "ply" do url "https://files.pythonhosted.org/packages/e5/69/882ee5c9d017149285cab114ebeab373308ef0f874fcdac9beb90e0ac4da/ply-3.11.tar.gz" sha256 "00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3" end resource "argparse" do url "https://files.pythonhosted.org/packages/18/dd/e617cfc3f6210ae183374cd9f6a26b20514bbb5a792af97949c5aacddf0f/argparse-1.4.0.tar.gz" sha256 "62b089a55be1d8949cd2bc7e0df0bddb9e028faefc8c32038cc84862aefdd6e4" end resource "python-dateutil" do url "https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz" sha256 "73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c" end # resource "six" do # url "https://files.pythonhosted.org/packages/21/9f/b251f7f8a76dec1d6651be194dfba8fb8d7781d10ab3987190de8391d08e/six-1.14.0.tar.gz" # sha256 "236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a" # end resource "PyOpenGL" do url "https://files.pythonhosted.org/packages/b8/73/31c8177f3d236e9a5424f7267659c70ccea604dab0585bfcd55828397746/PyOpenGL-3.1.5.tar.gz" sha256 "4107ba0d0390da5766a08c242cf0cf3404c377ed293c5f6d701e457c57ba3424" end resource "psycopg2" do url "https://files.pythonhosted.org/packages/84/d7/6a93c99b5ba4d4d22daa3928b983cec66df4536ca50b22ce5dcac65e4e71/psycopg2-2.8.4.tar.gz" sha256 "f898e5cc0a662a9e12bde6f931263a1bbd350cfb18e1d5336a12927851825bb6" end resource "termcolor" do url "https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz" sha256 "1d6d69ce66211143803fbc56652b41d73b4a400a2891d7bf7a1cdf4c02de613b" end # for matplotlib resource "cycler" do url "https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz" sha256 "cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8" end resource "kiwisolver" do url "https://files.pythonhosted.org/packages/16/e7/df58eb8868d183223692d2a62529a594f6414964a3ae93548467b146a24d/kiwisolver-1.1.0.tar.gz" sha256 "53eaed412477c836e1b9522c19858a8557d6e595077830146182225613b11a75" end resource "pyparsing" do url "https://files.pythonhosted.org/packages/a2/56/0404c03c83cfcca229071d3c921d7d79ed385060bbe969fde3fd8f774ebd/pyparsing-2.4.6.tar.gz" sha256 "4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f" end resource "pytz" do url "https://files.pythonhosted.org/packages/82/c3/534ddba230bd4fbbd3b7a3d35f3341d014cca213f369a9940925e7e5f691/pytz-2019.3.tar.gz" sha256 "b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be" end # resource "tornado" do #  url "https://files.pythonhosted.org/packages/e6/78/6e7b5af12c12bdf38ca9bfe863fcaf53dc10430a312d0324e76c1e5ca426/tornado-5.1.1.tar.gz" # sha256 "4e5158d97583502a7e2739951553cbd88a72076f152b4b11b64b9a10c4c49409" # end resource "tornado" do url "https://files.pythonhosted.org/packages/30/78/2d2823598496127b21423baffaa186b668f73cd91887fcef78b6eade136b/tornado-6.0.3.tar.gz" sha256 "c845db36ba616912074c5b1ee897f8e0124df269468f25e4fe21fe72f6edd7a9" end resource "cairocffi" do url "https://files.pythonhosted.org/packages/f7/99/b3a2c6393563ccbe081ffcceb359ec27a6227792c5169604c1bd8128031a/cairocffi-1.1.0.tar.gz" sha256 "f1c0c5878f74ac9ccb5d48b2601fcc75390c881ce476e79f4cfedd288b1b05db" end resource "subprocess32" do url "https://files.pythonhosted.org/packages/32/c8/564be4d12629b912ea431f1a50eb8b3b9d00f1a0b1ceff17f266be190007/subprocess32-3.5.4.tar.gz" sha256 "eb2937c80497978d181efa1b839ec2d9622cf9600a039a79d0e108d1f9aec79d" end resource "backports.functools_lru_cache" do url "https://files.pythonhosted.org/packages/ad/2e/aa84668861c3de458c5bcbfb9813f0e26434e2232d3e294469e96efac884/backports.functools_lru_cache-1.6.1.tar.gz" sha256 "8fde5f188da2d593bd5bc0be98d9abc46c95bb8a9dde93429570192ee6cc2d4a" end # resource "numpy" do #  url "https://files.pythonhosted.org/packages/40/de/0ea5092b8bfd2e3aa6fdbb2e499a9f9adf810992884d414defc1573dca3f/numpy-1.18.1.zip" #  sha256 "b6ff59cee96b454516e47e7721098e6ceebef435e3e21ac2d6c3b8b02628eb77" # end # python version >= 3.5 required # resource "scipy" do #  url "https://files.pythonhosted.org/packages/04/ab/e2eb3e3f90b9363040a3d885ccc5c79fe20c5b8a3caa8fe3bf47ff653260/scipy-1.4.1.tar.gz" #  sha256 "dee1bbf3a6c8f73b6b218cb28eed8dd13347ea2f87d572ce19b289d6fd3fbc59" # end # "error: no member named 'signbit' in the global namespace" # resource "matplotlib" do # url "https://github.com/matplotlib/matplotlib/archive/v2.2.5.tar.gz" # sha256 "75e9de4e4e47ae4cb23393e9df9431424d5034da77771d598ff14363d6a51dd1" # end # resource "matplotlib" do # url "https://github.com/matplotlib/matplotlib/archive/v3.1.3.tar.gz" # sha256 "6edfe021671fcad1bd6081c980c380cb3d66d00895eb8c3450fa3842c441d1d1" # end # resource "wxPython" do # url "https://files.pythonhosted.org/packages/b9/8b/31267dd6d026a082faed35ec8d97522c0236f2e083bf15aff64d982215e1/wxPython-4.0.7.post2.tar.gz" # sha256 "5a229e695b64f9864d30a5315e0c1e4ff5e02effede0a07f16e8d856737a0c4e" # end def install # Work around "error: no member named 'signbit' in the global namespace" # encountered when trying to detect boost regex in configure if DevelopmentTools.clang_build_version >= 900 ENV.delete "SDKROOT" ENV.delete "HOMEBREW_SDKROOT" end # ENV.append "CPPFLAGS", "" # ENV.append "LDFLAGS", "-framework OpenCL" # ENV.append "CFLAGS", "-O2 -Werror=implicit-function-declaration" if build.with?("mysql") ENV["MYSQLD_CONFIG"] = "#{Formula["mysql"].opt_bin}/mysql_config" end # install python modules venv = virtualenv_create(libexec/'vendor', "#{Formula["python"].opt_bin}/python3") res = resources.map(&:name).to_set # - %w[python-dateutil] # fix pip._vendor.pep517.wrappers.BackendUnavailable # system libexec/"vendor/bin/pip3", "install", "--upgrade", "-v", "setuptools", "pip<19.0.0", "wheel" # venv.pip_install_and_link "python-dateutil" res.each do |r| venv.pip_install resource(r) end # noinspection RubyLiteralArrayInspection args = [ "--with-cxx", "--enable-shared", "--enable-largefile", "--with-nls", "--with-includes=#{HOMEBREW_PREFIX}/include", "--with-libs=#{HOMEBREW_PREFIX}/LIB", "--with-python=#{libexec}/vendor/bin/python-config", "--with-tcltk", "--with-netcdf=#{Formula["osgeo-netcdf"].opt_bin}/nc-config", "--with-zstd", "--with-zstd-includes=#{Formula["zstd"].opt_include}", "--with-zstd-libs=#{Formula["zstd"].opt_lib}", "--with-readline", "--with-readline-includes=#{Formula["readline"].opt_include}", "--with-readline-libs=#{Formula["readline"].opt_lib}", "--with-blas", "--with-blas-includes=#{Formula["openblas"].opt_include}", "--with-blas-libs=#{Formula["openblas"].opt_lib}", "--with-lapack", "--with-lapack-includes=#{Formula["lapack"].opt_include}", "--with-lapack-libs=#{Formula["lapack"].opt_lib}", "--with-geos=#{Formula["geos"].opt_bin}/geos-config", "--with-geos-includes=#{Formula["geos"].opt_include}", "--with-geos-libs=#{Formula["geos"].opt_lib}", "--with-odbc", "--with-odbc-includes=#{Formula["unixodbc"].opt_include}", "--with-odbc-libs=#{Formula["unixodbc"].opt_lib}", "--with-gdal=#{Formula["osgeo-gdal"].opt_bin}/gdal-config", "--with-zlib-includes=#{Formula["zlib"].opt_include}", "--with-zlib-libs=#{Formula["zlib"].opt_lib}", "--with-bzlib", "--with-bzlib-includes=#{Formula["bzip2"].opt_include}", "--with-bzlib-libs=#{Formula["bzip2"].opt_lib}", "--with-cairo", "--with-cairo-includes=#{Formula["cairo"].opt_include}/cairo", "--with-cairo-libs=#{Formula["cairo"].opt_lib}", "--with-cairo-ldflags=-lfontconfig", "--with-freetype", "--with-freetype-includes=#{Formula["freetype"].opt_include}/freetype2", "--with-freetype-libs=#{Formula["freetype"].opt_lib}", # "--with-proj", "--with-proj-includes=#{Formula["osgeo-proj"].opt_include}", "--with-proj-libs=#{Formula["osgeo-proj"].opt_lib}", "--with-proj-share=#{Formula["osgeo-proj"].opt_share}/proj", "--with-tiff", "--with-tiff-includes=#{Formula["libtiff"].opt_include}", "--with-tiff-libs=#{Formula["libtiff"].opt_lib}", "--with-png", "--with-png-includes=#{Formula["libpng"].opt_include}", "--with-png-libs=#{Formula["libpng"].opt_lib}", "--with-regex", # "--with-regex-includes=#{Formula["regex-opt"].opt_lib}", # "--with-regex-libs=#{Formula["regex-opt"].opt_lib}", "--with-fftw", "--with-fftw-includes=#{Formula["fftw"].opt_include}", "--with-fftw-libs=#{Formula["fftw"].opt_lib}", "--with-sqlite", "--with-sqlite-includes=#{Formula["sqlite"].opt_include}", "--with-sqlite-libs=#{Formula["sqlite"].opt_lib}" ] # Disable some dependencies that don't build correctly on older version of MacOS args << "--without-fftw" if build.without? "fftw" #args << "--with-liblas=#{Formula["osgeo-liblas"].opt_bin}/liblas-config" # if build.with? "liblas" args << "--with-postgres" if build.with?("pg11") args << "--with-postgres-includes=#{Formula["osgeo-postgresql@11"].opt_include}" args << "--with-postgres-libs=#{Formula["osgeo-postgresql@11"].opt_lib}" else args << "--with-postgres-includes=#{Formula["osgeo-postgresql"].opt_include}" args << "--with-postgres-libs=#{Formula["osgeo-postgresql"].opt_lib}" end if build.with?("mysql") args << "--with-mysql" args << "--with-mysql-includes=#{Formula["mysql"].opt_include}/mysql" args << "--with-mysql-libs=#{Formula["mysql"].opt_lib}" end args << "--with-pthread" args << "--with-pthread-includes=#{Formula["boost"].opt_include}/boost/thread" args << "--with-pthread-libs=#{Formula["boost"].opt_lib}" # if build.with? "pdal" # args << "--with-pdal=#{Formula["osgeo-pdal"].opt_bin}/pdal-config" # end # if build.with? "opendwg" # args << "--with-opendwg" # args << "--with-opendwg-includes=" # args << "--with-opendwg-libs=" # end # if build.with? "openmp" # # install openblas --with-openmp # args << "--with-openmp" # args << "--with-openmp-includes=#{Formula["libomp"].opt_include}" # args << "--with-openmp-libs=#{Formula["libomp"].opt_lib}" # end # if build.with? "opencl" # args << "--with-opencl" # args << "--with-opencl-includes=" # args << "--with-opencl-libs=" # end if MacOS.version >= :el_capitan # handle stripping of DYLD_* env vars by SIP when passed to utilities; # HOME env var is .brew_home during build, so it is still checked for lib ln_sf "#{buildpath}/dist.x86_64-apple-darwin#{`uname -r`.strip}/lib", ".brew_home/lib" end # NoMethodError: undefined method `prefer_64_bit?' for OS::Mac:Module # MacOS.prefer_64_bit? is deprecated! There is no replacement. # args << "--enable-64bit" if MacOS.prefer_64_bit? # args << "--with-macos-archs=#{MacOS.preferred_arch}" # unless MacOS::CLT.installed? # On Xcode-only systems (without the CLT), we have to help: args << "--with-macosx-sdk=#{MacOS.sdk_path}" args << "--with-macosx-archs=#{Hardware::CPU.arch}" # Hardware::CPU.universal_archs args << "--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers" # args << "--with-opengl-libs=" # GL # args << "--with-opengl-framework=" # end # Enable Aqua GUI, instead of X11 if build.with? "aqua" args.concat [ "--with-opengl=aqua", "--without-glw", "--without-motif" ] end if headless? args << "--without-wxwidgets" else wx_paths = formula_site_packages "wxpython" ENV.prepend("PYTHONPATH", wx_paths, File::PATH_SEPARATOR) if wx_paths args << "--with-wxwidgets=#{Formula["wxmac"].opt_bin}/wx-config" end system "./configure", "--prefix=#{prefix}", *args system "make", "-j", Hardware::CPU.cores, "GDAL_DYNAMIC=" # make and make install must be separate steps. system "make", "-j", Hardware::CPU.cores, "GDAL_DYNAMIC=", "install" # GDAL_DYNAMIC set to blank for r.external compatability end def post_install # ensure QGIS's Processing plugin recognizes install # 2.14.8+ and other newer QGIS versions may reference just grass.sh bin_grass = "#{bin}/grass#{majmin_ver}" ln_sf "#{bin_grass}", "#{prefix}/grass#{majmin_ver}/grass#{majmin_ver}.sh" ln_sf "#{bin_grass}", "#{prefix}/grass#{majmin_ver}/grass.sh" # link so settings in external apps don't need updated on grass version bump # in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass7/grass-base ln_sf "grass#{majmin_ver}", "#{prefix}/grass-base" # Writes a wrapper env script and moves all files to the dst # ensure python3 is used # for some reason, in this build (v7.6.1_1), the script is not created. # bin.env_script_all_files("#{libexec}/bin", :GRASS_PYTHON => "python3") # for this reason we move the binary and create another that will call # this with the requirements mentioned above. mkdir "#{libexec}/bin" mv "#{bin}/grass#{majmin_ver}", "#{libexec}/bin/grass#{majmin_ver}" # And fix "ValueError: unknown locale: UTF-8" # if exist: rm "#{bin}/grass#{majmin_ver}" File.open("#{bin}/grass#{majmin_ver}", "w") { |file| file << '#!/bin/bash' file << "\n" file << "export LANG=en_US.UTF-8" file << "\n" file << "export LC_CTYPE=en_US.UTF-8" file << "\n" file << "export LC_ALL=en_US.UTF-8" file << "\n" file << "export GRASS_PREFIX=#{prefix}/grass-base" file << "\n" file << "export GRASS_SH=/bin/sh" file << "\n" file << "export GRASS_PROJSHARE=#{Formula["osgeo-proj"].opt_share}" file << "\n" file << "export GRASS_VERSION=#{version}" file << "\n" file << "export GRASS_LD_LIBRARY_PATH=#{prefix}/grass#{majmin_ver}/lib" file << "\n" # file << "export GRASS_PERL=#{Formula["perl"].opt_bin}/perl" # file << "\n" file << "export PROJ_LIB=#{Formula["osgeo-proj"].opt_lib}" file << "\n" file << "export GEOTIFF_CSV=#{Formula["osgeo-libgeotiff"].opt_share}/epsg_csv" file << "\n" file << "export GDAL_DATA=#{Formula["osgeo-gdal"].opt_share}/gdal" # file << "\n" # file << "export PYTHONHOME=#{Formula["python"].opt_frameworks}/Python.framework/Versions/#{py_ver}:$PYTHONHOME" # file << "export R_HOME=#{Formula["r"].opt_bin}/R:$R_HOME" # file << "export R_HOME=/Applications/RStudio.app/Contents/MacOS/RStudio:$R_HOME" # file << "export R_USER=USER_PROFILE/Documents" file << "\n" file << "GRASS_PYTHON=python3 exec #{libexec}/bin/grass#{majmin_ver} $@" # file << "GISBASE=#{HOMEBREW_PREFIX}/osgeo-grass" # file << "PATH=#{PATH}:#{GISBASE}/bin:#{GISBASE}/scripts" # file << "MANPATH=#{MANPATH}:#{GISBASE}/man" } chmod("+x", "#{bin}/grass#{majmin_ver}") chmod("+x", "#{libexec}/bin/grass#{majmin_ver}") # for "--enable-macosx-app" # mkdir - permission denied: /Library/GRASS if build.with? "app" ("#{prefix}/GRASS7.app/Contents/PkgInfo").write "APPLGRASS" mkdir "#{prefix}/GRASS7.app/Contents/Resources" cp_r "#{buildpath}/macosx/app/app.icns", "#{prefix}/GRASS7.app/Contents/Resources" config = <<~EOS CFBundleDevelopmentRegion English CFBundleExecutable grass#{majmin_ver} CFBundleGetInfoString GRASS GIS #{version} CFBundleIconFile app.icns CFBundleIdentifier https://grass.osgeo.org/grass#{majmin_ver}/source/ CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType APPL CFBundleShortVersionString GRASS GIS #{version} CFBundleSignature ???? CFBundleVersion #{version} NSMainNibFile MainMenu.nib NSPrincipalClass NSApplication CFBundleDocumentTypes CFBundleTypeExtensions **** CFBundleTypeName FolderType CFBundleTypeOSTypes fold CFBundleTypeRole Editor EOS ("#{prefix}/GRASS7.app/Contents/Info.plist").write config chdir "#{prefix}/GRASS7.app/Contents" do mkdir "MacOS" do ln_s "#{bin}/grass#{majmin_ver}", "grass#{majmin_ver}" end end end end def formula_site_packages(f) `#{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 end def caveats s = <<~EOS If it is the case that you can change the shebang at the beginning of the script to enforce Python 3 usage. \e[32m#!/usr/bin/env python\e[0m Should be changed into \e[32m#!/usr/bin/env python3\e[0m EOS if headless? s += <<~EOS This build of GRASS has been compiled without the WxPython GUI. The command line tools remain fully functional. EOS end if build.with? "app" s += <<~EOS You may also symlink \e[32mGRASS.app\e[0m into \e[32m/Applications\e[0m or \e[32m~/Applications\e[0m: \e[32mln -Fs `find $(brew --prefix) -name "GRASS.app"` /Applications/GRASS.app\e[0m EOS end s end test do system bin/"grass#{majmin_ver}", "--version" end end __END__ --- a/configure +++ b/configure @@ -6894,7 +6894,7 @@ ac_save_cflags="$CFLAGS" ac_save_cppflags="$CPPFLAGS" LIBS="$LIBS $LIBLAS_LIBS" - CFLAGS="$CFLAGS $LIBLAS_CFLAGS" + CFLAGS="$CFLAGS $LIBLAS_CFLAGS $LIBLAS_INC" CPPFLAGS="$CPPFLAGS $LIBLAS_INC" for ac_hdr in liblas/capi/liblas.h do --- a/include/Make/Install.make +++ b/include/Make/Install.make @@ -114,11 +114,6 @@ real-install: | $(INST_DIR) $(UNIX_BIN) -$(INSTALL) config.status $(INST_DIR)/config.status -$(CHMOD) -R a+rX $(INST_DIR) 2>/dev/null -ifneq ($(findstring darwin,$(ARCH)),) - @# enable OSX Help Viewer - @/bin/ln -sfh "$(INST_DIR)/docs/html" /Library/Documentation/Help/GRASS-$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR) -endif - $(INST_DIR) $(UNIX_BIN): $(MAKE_DIR_CMD) $@ --- a/macosx/app/build_html_user_index.sh +++ b/macosx/app/build_html_user_index.sh @@ -140,7 +140,6 @@ else # echo "$BASENAME $SHORTDESC" >> $FULLINDEX # make them local to user to simplify page links echo "$BASENAME $SHORTDESC" >> $FULLINDEX - ln -sf "$HTMLDIRG/$i" global_$i done done fi @@ -183,8 +182,3 @@ echo " " > $i.html done -# add Help Viewer links in user docs folder - -mkdir -p $HOME/Library/Documentation/Help/ -ln -sfh ../../GRASS/$GRASS_MMVER/Modules/docs/html $HOME/Library/Documentation/Help/GRASS-$GRASS_MMVER-addon -ln -sfh $GISBASE/docs/html $HOME/Library/Documentation/Help/GRASS-$GRASS_MMVER ================================================ FILE: Formula/osgeo-hdf4.rb ================================================ class OsgeoHdf4 < Formula homepage "http://www.hdfgroup.org" url "https://support.hdfgroup.org/ftp/HDF/releases/HDF4.2.14/src/hdf-4.2.14.tar.gz" sha256 "2d383e87c8a0ca6a5352adbd1d5546e6cc43dc21ff7d90f93efa644d85c0b14a" option "with-fortran", "Build Fortran interface." option "with-tests", "Run the test suite (may fail)" depends_on "cmake" => :build depends_on "pkg-config" => :build depends_on "szip" => :recommended depends_on "jpeg" depends_on "gcc" if build.with? "fortran" bottle do root_url "https://bottle.download.osgeo.org" cellar :any rebuild 1 sha256 "e9c44564bd0f3be8a6c7bb0d6f103fd64865a927a16f8ae5fc2b6a8a6e3221d7" => :mojave sha256 "e9c44564bd0f3be8a6c7bb0d6f103fd64865a927a16f8ae5fc2b6a8a6e3221d7" => :high_sierra sha256 "a7d7759edd6ef51195fe94a77d20a76531c83f1460139acccad37791483ca135" => :sierra end resource "test_file" do url "https://gamma.hdfgroup.org/ftp/pub/outgoing/h4map/data/CT01_Rank6ArraysTablesAttributesGroups.hdf" sha256 "e4a610c95ddd1f2247038adf46de354fe902e72b5b72757322d19c362c0d415a" end def install ENV.O0 # Per the release notes, -O2 can cause memory corruption ENV["SZIP_INSTALL"] = HOMEBREW_PREFIX args = std_cmake_args args.concat [ "-DBUILD_SHARED_LIBS=ON", "-DHDF4_BUILD_TOOLS=ON", "-DHDF4_BUILD_UTILS=ON", "-DHDF4_BUILD_WITH_INSTALL_NAME=ON", "-DHDF4_ENABLE_JPEG_LIB_SUPPORT=ON", "-DHDF4_ENABLE_NETCDF=OFF", # Conflict. Just install NetCDF for this. "-DHDF4_ENABLE_Z_LIB_SUPPORT=ON" ] # szip has been reported to break linking with GDAL, so it may need to be disabled if you run into errors. if build.with? "szip" args.concat %W[-DHDF4_ENABLE_SZIP_ENCODING=ON -DHDF4_ENABLE_SZIP_SUPPORT=ON] else args << "-DHDF4_ENABLE_SZIP_SUPPORT=OFF" end if build.with? "fortran" args.concat %W[-DHDF4_BUILD_FORTRAN=ON -DCMAKE_Fortran_MODULE_DIRECTORY=#{include}] else args << "-DHDF4_BUILD_FORTRAN=OFF" end args << "-DBUILD_TESTING=OFF" if build.without? "tests" mkdir "build" do system "cmake", "..", *args system "make", "install" system "make", "test" if build.with? "tests" # Remove stray nc* artifacts which conflict with NetCDF. rm (bin+"ncdump") rm (bin+"ncgen") # rm (include+"netcdf.inc") end end def caveats; <<~EOS HDF4 has been superseeded by HDF5. However, the API changed substantially and some programs still require the HDF4 libraries in order to function. EOS end test do resource("test_file").stage do system "#{opt_prefix}/bin/vshow", "CT01_Rank6ArraysTablesAttributesGroups.hdf" end end end ================================================ FILE: Formula/osgeo-hexer.rb ================================================ class OsgeoHexer < Formula desc "LAS and OGR hexagonal density and boundary surface generation" homepage "https://github.com/hobu/hexer" url "https://github.com/hobu/hexer/archive/1.4.0.tar.gz" sha256 "886134fcdd75da2c50aa48624de19f5ae09231d5290812ec05f09f50319242cb" revision 5 head "https://github.com/hobu/hexer.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "949ebcb075de3dca10041016a155d53cc130e797b985c4c9a84e3ba817727762" => :catalina sha256 "949ebcb075de3dca10041016a155d53cc130e797b985c4c9a84e3ba817727762" => :mojave sha256 "949ebcb075de3dca10041016a155d53cc130e797b985c4c9a84e3ba817727762" => :high_sierra end # Add cmath and limits headers to utils # Link with dl for curse on non-win32 patch :DATA option "with-drawing", "Build Cairo-based SVG drawing" depends_on "cmake" => :build depends_on "osgeo-gdal" => :recommended depends_on "cairo" # if build.with? "drawing" def install args = std_cmake_args args << "-DWITH_DRAWING=TRUE" # if build.with? "drawing" mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end end test do # TODO # system "curse", "--version" end end __END__ --- a/include/hexer/Utils.hpp +++ b/include/hexer/Utils.hpp @@ -15,6 +15,9 @@ #pragma once +#include +#include + namespace hexer { From e06d361eec613ed046592d378a01bf0a0694a6f8 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 25 Apr 2017 16:08:24 +0000 Subject: [PATCH 2/2] Link with dl for curse on non-win32 --- apps/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -17,6 +17,9 @@ endif() if(CURSE) 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 ) target_link_libraries(${CURSE} ${HEXER_LIB_NAME} ${HEXERBOOST_LIB_NAME}) + if(NOT WIN32) + target_link_libraries(${CURSE} dl) + endif() endif() install(TARGETS ${HEXER_UTILITIES} ================================================ FILE: Formula/osgeo-iipsrv.rb ================================================ class OsgeoIipsrv < Formula desc "Publish spatial data and interactive mapping apps to the web" homepage "https://github.com/ruven/iipsrv" url "https://github.com/ruven/iipsrv/archive/f68b225013c54dd08badcd55d0819d29eb4fc5f8.tar.gz" sha256 "9d9e90cdc1f4588f1cb14b004c17a07ffa3ad88cd2c3e69582b660483dc5114b" version "1.1-dev" revision 1 head "https://github.com/ruven/iipsrv.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "4e6c8c55f45543b26eaa7b031c87a4e00b3cfcbf037aa33c6e62fbef2cf22b6d" => :mojave sha256 "4e6c8c55f45543b26eaa7b031c87a4e00b3cfcbf037aa33c6e62fbef2cf22b6d" => :high_sierra sha256 "8ce2d0857dcf778a32aef8298b42e2a94d845526c87158fa3c88b24e58612ff3" => :sierra end option "with-lighttpd", "Install lighttpd and iipsrv configuration file" option "with-nginx", "Install nginx and iipsrv configuration file" option "without-tests", "Do not run test suite" depends_on "autoconf" depends_on "automake" depends_on "libtool" depends_on "pkg-config" depends_on "fcgi" depends_on "jpeg" depends_on "libtiff" depends_on "little-cms2" depends_on "libmemcached" # NOTE: PNG support is currently turned off in configure.in depends_on "spawn-fcgi" depends_on "lighttpd" => :optional depends_on "nginx" => :optional depends_on "vips" # for creating Tiled Pyramidal TIFFs depends_on "imagemagick" # for creating Tiled Pyramidal TIFFs resource "iipmooviewer" do url "https://github.com/ruven/iipmooviewer/archive/cbcbe75b1af7d2fcf75c62d8fc650060c8081e13.tar.gz" sha256 "0c84fd68b9d295c37d3afd9b659442c0d5ba67ebe3f9c3fe10160d6aca5d9126" version "2.0-dev" end resource "palaisuulouvre" do url "http://merovingio.c2rmf.cnrs.fr/iipimage/PalaisDuLouvre.tif" sha256 "e76b75c0b16609aa85e02c13b1ccd4c85ff4b452811e7878442422ce8b23ce6b" end def install system "./autogen.sh" system "./configure", "--disable-dependency-tracking" system "make" system "make", "check" if build.with? "tests" (prefix/"fcgi-bin").install "src/iipsrv.fcgi" man1.install "man/iipsrv.8" # Out-of-htdocs directory for images iipimage = var/"iipimage" iipimage.install resource("palaisuulouvre") # sample image # Copy of iipmooviewer resource("iipmooviewer").stage do inreplace "index.html", "/path/to/image.tif", "#{iipimage}/PalaisDuLouvre.tif" (prefix/"iipmooviewer").install Dir["*"] end # Set up log # touch iipsrv_log # fix for: No such file or directory @ rb_sysopen - /usr/local/var/log/iipsrv.log config = <<~EOS # iipsrv_log EOS (var/"log/iipsrv.log").write config # Spawn-fcgi utility (bin/"iipsrv-spawn").write(spawn_script) end def spawn_script; <<~EOS #!/bin/bash export LOGFILE=#{iipsrv_log} export VERBOSITY=5 export MAX_IMAGE_CACHE_SIZE=10 export FILENAME_PATTERN=_pyr_ export JPEG_QUALITY=50 export MAX_CVT=3000 exec 2>&1 exec #{Formula["spawn-fcgi"].opt_bin}/spawn-fcgi -n -s #{iipsrv_sock} -- #{opt_prefix}/fcgi-bin/iipsrv.fcgi & EOS end plist_options :manual => "iipsrv-spawn" def plist; <<~EOS Label #{plist_name} RunAtLoad KeepAlive WorkingDirectory #{HOMEBREW_PREFIX} ProgramArguments #{Formula["spawn-fcgi"].opt_bin}/spawn-fcgi -n -s #{iipsrv_sock} -- #{opt_prefix}/fcgi-bin/iipsrv.fcgi EnvironmentVariables LOGFILE #{iipsrv_log} VERBOSITY 5 MAX_IMAGE_CACHE_SIZE 10 FILENAME_PATTERN _pyr_ JPEG_QUALITY 50 MAX_CVT 3000 UserName #{`whoami`.chomp} EOS end def iipsrv_log "#{var}/log/iipsrv.log" end def iipsrv_sock "#{var}/run/iipsrv.sock" end def post_install conf_dir = prefix/"config" opts = Tab.for_formula(self).used_options conf_s = conf_dir/"lighttpd_iipsrv_spawn.conf.sample" rm_f conf_s conf_s.write <<~EOS server.modules += ( "mod_fastcgi" ) fastcgi.server = ( "/fcgi-bin/iipsrv.fcgi" => (( "socket" => "#{iipsrv_sock}", "check-local" => "disable" )) ) EOS conf_s = conf_dir/"lighttpd_iipsrv.conf.sample" rm_f conf_s conf_s.write <<~EOS server.modules += ( "mod_fastcgi" ) fastcgi.server = ( "/fcgi-bin/iipsrv.fcgi" => (( "socket" => "#{iipsrv_sock}", "check-local" => "disable", "min-procs" => 1, "max-procs" => 2, "bin-path" => "#{opt_prefix}/fcgi-bin/iipsrv.fcgi", "bin-environment" => ( "LOGFILE" => "#{iipsrv_log}", "VERBOSITY" => "5", "MAX_IMAGE_CACHE_SIZE" => "10", "FILENAME_PATTERN" => "_pyr_", "JPEG_QUALITY" => "50", "MAX_CVT" => "3000" ) )) ) EOS if opts.include? "with-lighttpd" conf = etc/"lighttpd/conf.d/iipsrv.conf" rm conf if File.exist? conf cp conf_s, conf # Make sure iipsrv.conf will be loaded inc_conf = 'include "conf.d/iipsrv.conf"' mod_conf = etc/"lighttpd/modules.conf" unless File.readlines(mod_conf).grep(/#{Regexp.escape inc_conf}/).any? mod_conf.open("a") { |f| f.write("\n" + inc_conf) } end end conf_s = conf_dir/"apache_iipsrv.conf.sample" rm_f conf_s conf_s.write <<~EOS # Set the options on that directory AllowOverride None Options None Order allow,deny Allow from all # Set the handler AddHandler fastcgi-script fcgi # Initialise the FCGI server - set some default values FastCgiServer #{opt_prefix}/fcgi-bin/iipsrv.fcgi \ -initial-env LOGFILE=#{iipsrv_log} \ -initial-env VERBOSITY=2 \ -initial-env JPEG_QUALITY=50 \ -initial-env MAX_IMAGE_CACHE_SIZE=10 \ -initial-env MAX_CVT=3000 \ -processes 2 EOS conf_s = conf_dir/"nginx_iipsrv.conf.sample" rm_f conf_s conf_s.write <<~EOS location /fcgi-bin/iipsrv.fcgi { include fastcgi_params; fastcgi_pass unix:#{iipsrv_sock}; } EOS if opts.include? "with-nginx" conf = etc/"nginx/iipsrv.conf" rm conf if File.exist? conf cp conf_s, conf end end def caveats; <<~EOS When IIPImage Server is launched from its plist or iipsrv-spawn script, the FastCGI process with be available at: #{iipsrv_sock} Tiled TIFF images can be stored in #{var}/iipimage (outside the www tree). There is a sample already installed there: PalaisDuLouvre.tif. There are configuration scripts in #{opt_prefix}/config for the following web servers (copy the whatever.sample to iipsrv.conf accordingly): * Lighttpd - can spawn the FastCGI process (no external spawning needed), or connect externally to the spawned FastCGI process config: #{etc}/lighttpd/conf.d/iipsrv.conf include: include "conf.d/iipsrv.conf" in: #{etc}/lighttpd/modules.conf www root: #{var}/www/htdocs * Nginx - connects to the externally spawned FastCGI process config: #{etc}/nginx/iipsrv.conf include: include iipsrv.conf; in: #{etc}/nginx/nginx.conf <-- (or other .conf's) 'server' block www root: #{var}/www * Apache - can spawn the FastCGI process (no external spawning needed), or connect externally to the spawned FastCGI process homebrew/apache/mod_fastcgi REQUIRED config: /etc/apache2/other/iipsrv.conf www root: /Library/WebServer/Documents Upon successful server configuration test at: http://localhost[:port]/fcgi-bin/iipsrv.fcgi An install of 'iipmooviewer' is in #{opt_prefix}. Copy the 'iipmooviewer' directory to your server's www root. Test viewer, with sample image, at: http://localhost[:port]/iipmooviewer EOS end test do end end ================================================ FILE: Formula/osgeo-insighttoolkit.rb ================================================ class OsgeoInsighttoolkit < Formula desc "ITK is a toolkit for performing registration and segmentation" homepage "https://www.itk.org" url "https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.0.1/InsightToolkit-5.0.1.tar.gz" sha256 "613b125cbf58481e8d1e36bdeacf7e21aba4b129b4e524b112f70c4d4e6d15a6" revision 1 bottle do root_url "https://bottle.download.osgeo.org" sha256 "cc31b55d65c9b587c5b86ccc21414054baa5af82ee22dadf21fdbf609bab1f0b" => :catalina sha256 "cc31b55d65c9b587c5b86ccc21414054baa5af82ee22dadf21fdbf609bab1f0b" => :mojave sha256 "cc31b55d65c9b587c5b86ccc21414054baa5af82ee22dadf21fdbf609bab1f0b" => :high_sierra end head "https://github.com/InsightSoftwareConsortium/ITK.git", :branch => "master" option "with-examples", "Compile and install various examples" option "with-itkv3-compatibility", "Include ITKv3 compatibility" option "with-remove-legacy", "Disable legacy APIs" deprecated_option "examples" => "with-examples" deprecated_option "remove-legacy" => "with-remove-legacy" depends_on "cmake" => :build depends_on "opencv@2" => :recommended depends_on "python" => :recommended depends_on "fftw" => :recommended depends_on "hdf5" => :recommended # depends_on "jpeg" => :recommended depends_on "libjpeg-turbo" => :recommended depends_on "libpng" => :recommended depends_on "libtiff" => :recommended depends_on "gdcm" => :optional depends_on "expat" unless OS.mac? depends_on "osgeo-vtk" => :build # JAVA_VERSION = "1.8" # "1.10+" depends_on "openjdk" => :build # JAVA_VERSION depends_on "zlib" depends_on "bison" depends_on "libpng" depends_on "tcl-tk" depends_on "pcre" depends_on "swig" depends_on "castxml" depends_on "git" # depends_on "ruby" # depends_on "perl" def install ENV.cxx11 # error: 'auto' not allowed in function return type # Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h ENV.append "CXXFLAGS", "-std=c++11" # Temporary fix for Xcode/CLT 9.0.x issue of missing header files # See: https://github.com/OSGeo/homebrew-osgeo4mac/issues/276 # Work around "error: no member named 'signbit' in the global namespace" if DevelopmentTools.clang_build_version >= 900 ENV.delete "SDKROOT" ENV.delete "HOMEBREW_SDKROOT" end # Warning: python modules have explicit framework links # These python extension modules were linked directly to a Python # framework binary. They should be linked with -undefined dynamic_lookup # instead of -lpython or -framework Python # ENV["PYTHON_LIBS"] = "-undefined dynamic_lookup" # PYTHON_LDFLAGS=-undefined dynamic_lookup # PYTHON_EXTRA_LIBS=-undefined dynamic_lookup # PYTHON_EXTRA_LDFLAGS=-undefined dynamic_lookup # cmd = Language::Java.java_home_cmd("1.8") # JAVA_VERSION # ENV["JAVA_HOME"] = Utils.popen_read(cmd).chomp dylib = OS.mac? ? "dylib" : "so" args = std_cmake_args + %W[ -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DITK_USE_64BITS_IDS=ON -DITK_USE_STRICT_CONCEPT_CHECKING=ON -DITK_USE_SYSTEM_ZLIB=ON -DITK_USE_SYSTEM_EXPAT=ON -DCMAKE_INSTALL_RPATH:STRING=#{lib} -DCMAKE_INSTALL_NAME_DIR:STRING=#{lib} -DModule_SCIFIO=ON ] args << ".." args << "-DBUILD_EXAMPLES=" + (build.include?("examples") ? "ON" : "OFF") args << "-DModule_ITKVideoBridgeOpenCV=" + (build.with?("opencv") ? "ON" : "OFF") args << "-DITKV3_COMPATIBILITY:BOOL=" + (build.with?("itkv3-compatibility") ? "ON" : "OFF") args << "-DITK_USE_SYSTEM_FFTW=ON" << "-DITK_USE_FFTWF=ON" << "-DITK_USE_FFTWD=ON" if build.with? "fftw" args << "-DITK_USE_SYSTEM_HDF5=ON" if build.with? "hdf5" args << "-DITK_USE_SYSTEM_JPEG=ON" if build.with? "libjpeg-turbo" # jpeg args << "-DITK_USE_SYSTEM_PNG=ON" if build.with? :libpng args << "-DITK_USE_SYSTEM_TIFF=ON" if build.with? "libtiff" args << "-DITK_USE_SYSTEM_GDCM=ON" if build.with? "gdcm" args << "-DITK_LEGACY_REMOVE=ON" if build.include? "remove-legacy" args << "-DModule_ITKLevelSetsv4Visualization=ON" args << "-DModule_ITKReview=ON" args << "-DModule_ITKVtkGlue=ON" args << "-DITK_USE_GPU=" + (OS.mac? ? "ON" : "OFF") args << "-DVCL_INCLUDE_CXX_0X=ON" # for cxx11 args << "-DITK_USE_SYSTEM_LIBRARIES=ON" args << "-DITK_USE_SYSTEM_SWIG=ON" args << "-DITK_USE_SYSTEM_CASTXML=ON" args << "-DITK_LEGACY_SILENT=ON" args << "-DModule_ITKIOMINC=ON" args << "-DModule_ITKIOTransformMINC=ON" # args << "-DITK_WRAP_TCL=ON" # args << "-DITK_WRAP_JAVA=ON" # args << "-DITK_WRAP_RUBY=ON" # args << "-DITK_WRAP_PERL=ON" # Could NOT find GTest # it is not installed args << "-DITK_USE_SYSTEM_GOOGLETEST=OFF" mkdir "itk-build" do python_executable = `which python3`.strip python_prefix = `#{python_executable} -c 'import sys;print(sys.prefix)'`.chomp python_include = `#{python_executable} -c 'from distutils import sysconfig;print(sysconfig.get_python_inc(True))'`.chomp python_version = "python" + `#{python_executable} -c 'import sys;print(sys.version[:3])'`.chomp args << "-DITK_WRAP_PYTHON=ON" args << "-DPYTHON_EXECUTABLE='#{python_executable}'" args << "-DPYTHON_INCLUDE_DIR='#{python_include}'" # if PYTHON_EXECUTABLE # does not match Python's prefix # Python site-packages directory to install Python bindings # PY_SITE_PACKAGES_PATH # CMake picks up the system's python dylib, even if we have a brewed one. if File.exist? "#{python_prefix}/Python" args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'" elsif File.exist? "#{python_prefix}/lib/lib#{python_version}.a" args << "-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.a'" elsif File.exist? "#{python_prefix}/lib/lib#{python_version}.#{dylib}" args << "-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.#{dylib}'" elsif File.exist? "#{python_prefix}/lib/x86_64-linux-gnu/lib#{python_version}.#{dylib}" args << "-DPYTHON_LIBRARY='#{python_prefix}/lib/x86_64-linux-gnu/lib#{python_version}.#{dylib}'" else odie "No libpythonX.Y.{dylib|so|a} file found!" end system "cmake", *args system "make", "install" end end test do (testpath/"test.cxx").write <<-EOS #include "itkImage.h" int main(int argc, char* argv[]) { typedef itk::Image< unsigned short, 3 > ImageType; ImageType::Pointer image = ImageType::New(); image->Update(); return EXIT_SUCCESS; } EOS dylib = OS.mac? ? "1.dylib" : "so.1" v=version.to_s.split(".")[0..1].join(".") # Build step system ENV.cxx, "-std=c++11", "-isystem", "#{include}/ITK-#{v}", "-o", "test.cxx.o", "-c", "test.cxx" # Linking step system ENV.cxx, "-std=c++11", "test.cxx.o", "-o", "test", "#{lib}/libITKCommon-#{v}.#{dylib}", "#{lib}/libITKVNLInstantiation-#{v}.#{dylib}", "#{lib}/libitkvnl_algo-#{v}.#{dylib}", "#{lib}/libitkvnl-#{v}.#{dylib}" system "./test" end end ================================================ FILE: Formula/osgeo-insighttoolkit@4.rb ================================================ class OsgeoInsighttoolkitAT4 < Formula desc "ITK is a toolkit for performing registration and segmentation" homepage "https://www.itk.org" url "https://downloads.sourceforge.net/project/itk/itk/4.13/InsightToolkit-4.13.2.tar.gz" sha256 "d8760b279de20497c432e7cdf97ed349277da1ae435be1f6f0f00fbe8d4938c1" revision 3 bottle do root_url "https://bottle.download.osgeo.org" sha256 "1ddb7fb9794d353994d388e8e4e4408442fa2d3eef38dda01fadd6b42fb8d92a" => :catalina sha256 "1ddb7fb9794d353994d388e8e4e4408442fa2d3eef38dda01fadd6b42fb8d92a" => :mojave sha256 "1ddb7fb9794d353994d388e8e4e4408442fa2d3eef38dda01fadd6b42fb8d92a" => :high_sierra end head "https://github.com/InsightSoftwareConsortium/ITK.git", :branch => "master" # keg_only "Testing ITK - is not linked" option "with-examples", "Compile and install various examples" option "with-itkv3-compatibility", "Include ITKv3 compatibility" option "with-remove-legacy", "Disable legacy APIs" deprecated_option "examples" => "with-examples" deprecated_option "remove-legacy" => "with-remove-legacy" depends_on "cmake" => :build depends_on "opencv@2" => :recommended depends_on "python" => :recommended depends_on "fftw" => :recommended depends_on "hdf5" => :recommended # depends_on "jpeg" => :recommended depends_on "libjpeg-turbo" => :recommended depends_on "libpng" => :recommended depends_on "libtiff" => :recommended depends_on "gdcm" => :optional depends_on "expat" unless OS.mac? depends_on "osgeo-vtk" => :build # JAVA_VERSION = "1.8" # "1.10+" depends_on "openjdk" => :build # JAVA_VERSION depends_on "zlib" depends_on "bison" depends_on "libpng" depends_on "tcl-tk" depends_on "pcre" depends_on "swig" depends_on "castxml" depends_on "git" # depends_on "ruby" # depends_on "perl" def install ENV.cxx11 # error: 'auto' not allowed in function return type # Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_math.h ENV.append "CXXFLAGS", "-std=c++11" # Temporary fix for Xcode/CLT 9.0.x issue of missing header files # See: https://github.com/OSGeo/homebrew-osgeo4mac/issues/276 # Work around "error: no member named 'signbit' in the global namespace" if DevelopmentTools.clang_build_version >= 900 ENV.delete "SDKROOT" ENV.delete "HOMEBREW_SDKROOT" end # Warning: python modules have explicit framework links # These python extension modules were linked directly to a Python # framework binary. They should be linked with -undefined dynamic_lookup # instead of -lpython or -framework Python # ENV["PYTHON_LIBS"] = "-undefined dynamic_lookup" # PYTHON_LDFLAGS=-undefined dynamic_lookup # PYTHON_EXTRA_LIBS=-undefined dynamic_lookup # PYTHON_EXTRA_LDFLAGS=-undefined dynamic_lookup # cmd = Language::Java.java_home_cmd("1.8") # JAVA_VERSION # ENV["JAVA_HOME"] = Utils.popen_read(cmd).chomp dylib = OS.mac? ? "dylib" : "so" args = std_cmake_args + %W[ -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DITK_USE_64BITS_IDS=ON -DITK_USE_STRICT_CONCEPT_CHECKING=ON -DITK_USE_SYSTEM_ZLIB=ON -DITK_USE_SYSTEM_EXPAT=ON -DCMAKE_INSTALL_RPATH:STRING=#{lib} -DCMAKE_INSTALL_NAME_DIR:STRING=#{lib} -DModule_SCIFIO=ON ] args << ".." args << "-DBUILD_EXAMPLES=" + (build.include?("examples") ? "ON" : "OFF") args << "-DModule_ITKVideoBridgeOpenCV=" + (build.with?("opencv") ? "ON" : "OFF") args << "-DITKV3_COMPATIBILITY:BOOL=" + (build.with?("itkv3-compatibility") ? "ON" : "OFF") args << "-DITK_USE_SYSTEM_FFTW=ON" << "-DITK_USE_FFTWF=ON" << "-DITK_USE_FFTWD=ON" if build.with? "fftw" args << "-DITK_USE_SYSTEM_HDF5=ON" if build.with? "hdf5" args << "-DITK_USE_SYSTEM_JPEG=ON" if build.with? "libjpeg-turbo" # jpeg args << "-DITK_USE_SYSTEM_PNG=ON" if build.with? :libpng args << "-DITK_USE_SYSTEM_TIFF=ON" if build.with? "libtiff" args << "-DITK_USE_SYSTEM_GDCM=ON" if build.with? "gdcm" args << "-DITK_LEGACY_REMOVE=ON" if build.include? "remove-legacy" args << "-DModule_ITKLevelSetsv4Visualization=ON" args << "-DModule_ITKReview=ON" args << "-DModule_ITKVtkGlue=ON" args << "-DITK_USE_GPU=" + (OS.mac? ? "ON" : "OFF") args << "-DVCL_INCLUDE_CXX_0X=ON" # for cxx11 args << "-DITK_USE_SYSTEM_LIBRARIES=ON" args << "-DITK_USE_SYSTEM_SWIG=ON" args << "-DITK_USE_SYSTEM_CASTXML=ON" args << "-DITK_LEGACY_SILENT=ON" args << "-DModule_ITKIOMINC=ON" args << "-DModule_ITKIOTransformMINC=ON" # args << "-DITK_WRAP_TCL=ON" # args << "-DITK_WRAP_JAVA=ON" # args << "-DITK_WRAP_RUBY=ON" # args << "-DITK_WRAP_PERL=ON" # Could NOT find GTest # it is not installed args << "-DITK_USE_SYSTEM_GOOGLETEST=OFF" mkdir "itk-build" do python_executable = `which python3`.strip python_prefix = `#{python_executable} -c 'import sys;print(sys.prefix)'`.chomp python_include = `#{python_executable} -c 'from distutils import sysconfig;print(sysconfig.get_python_inc(True))'`.chomp python_version = "python" + `#{python_executable} -c 'import sys;print(sys.version[:3])'`.chomp args << "-DITK_WRAP_PYTHON=ON" args << "-DPYTHON_EXECUTABLE='#{python_executable}'" args << "-DPYTHON_INCLUDE_DIR='#{python_include}'" # if PYTHON_EXECUTABLE # does not match Python's prefix # Python site-packages directory to install Python bindings # PY_SITE_PACKAGES_PATH # CMake picks up the system's python dylib, even if we have a brewed one. if File.exist? "#{python_prefix}/Python" args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'" elsif File.exist? "#{python_prefix}/lib/lib#{python_version}.a" args << "-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.a'" elsif File.exist? "#{python_prefix}/lib/lib#{python_version}.#{dylib}" args << "-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.#{dylib}'" elsif File.exist? "#{python_prefix}/lib/x86_64-linux-gnu/lib#{python_version}.#{dylib}" args << "-DPYTHON_LIBRARY='#{python_prefix}/lib/x86_64-linux-gnu/lib#{python_version}.#{dylib}'" else odie "No libpythonX.Y.{dylib|so|a} file found!" end system "cmake", *args system "make", "install" end end test do (testpath/"test.cxx").write <<-EOS #include "itkImage.h" int main(int argc, char* argv[]) { typedef itk::Image< unsigned short, 3 > ImageType; ImageType::Pointer image = ImageType::New(); image->Update(); return EXIT_SUCCESS; } EOS dylib = OS.mac? ? "1.dylib" : "so.1" v=version.to_s.split(".")[0..1].join(".") # Build step system ENV.cxx, "-std=c++11", "-isystem", "#{include}/ITK-#{v}", "-o", "test.cxx.o", "-c", "test.cxx" # Linking step system ENV.cxx, "-std=c++11", "test.cxx.o", "-o", "test", "#{lib}/libITKCommon-#{v}.#{dylib}", "#{lib}/libITKVNLInstantiation-#{v}.#{dylib}", "#{lib}/libitkvnl_algo-#{v}.#{dylib}", "#{lib}/libitkvnl-#{v}.#{dylib}" system "./test" end end ================================================ FILE: Formula/osgeo-lastools.rb ================================================ class OsgeoLastools < Formula desc "Efficient tools for LiDAR processing. Contains LASlib, a C++ programming API for reading / writing LIDAR data stored in standard LAS format" homepage "https://rapidlasso.com/lastools" url "https://github.com/LAStools/LAStools/archive/25fe552719970baf15b5c1b233174cc70190eb67.tar.gz" sha256 "1718456d7a8d223877498d4fcee6f7b2dd9b1ce203c9fb5ace5f33088c478d1f" version "19.05.10" # evision 1 head "https://github.com/LAStools/LAStools.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any_skip_relocation rebuild 1 sha256 "d716dda8ec8ede2cf07517190456e6e3f5407d7ff5e5dbf190e6b7b310eaf1a2" => :mojave sha256 "d716dda8ec8ede2cf07517190456e6e3f5407d7ff5e5dbf190e6b7b310eaf1a2" => :high_sierra sha256 "d6c319e04e9c03e3ce7dfaf110e187164e8f6398c82dd71f63ed892792328a19" => :sierra end option "with-wine", "Use Wine to have more support" depends_on "cmake" => :build if build.with? "wine" depends_on "wine" depends_on :x11 end def install mkdir "build" do system "cmake", "..", *std_cmake_args system "make", "install" end ln_s "#{bin}/las2las64", "#{bin}/las2las" ln_s "#{bin}/las2txt64", "#{bin}/las2txt" ln_s "#{bin}/lasdiff64", "#{bin}/lasdiff" ln_s "#{bin}/lasindex64", "#{bin}/lasindex" ln_s "#{bin}/lasinfo64", "#{bin}/lasinfo" ln_s "#{bin}/lasmerge64", "#{bin}/lasmerge" ln_s "#{bin}/lasprecision64", "#{bin}/lasprecision" ln_s "#{bin}/laszip64", "#{bin}/laszip" ln_s "#{bin}/txt2las64", "#{bin}/txt2las" # Pkg-Config file mkdir "#{lib}/pkgconfig" File.open("#{lib}/pkgconfig/laslib.pc", "w") { |file| file << "Name: laslib\n" file << "Description: C++ programming API for reading / writing LIDAR data\n" file << "Version: #{version}\n" file << "Libs: -L\${libdir} -llas\n" file << "Cflags: -I${includedir}\n" } end def caveats if build.with? "wine" <<~EOS \n1 - Download \e[32mhttp://lastools.org/download/LAStools.zip\e[0m and unzip LASTools.\n Remember where you unzipped it.\n 2 - Start QGIS. Select \e[32mProcessing/Options.\e[0m\n In the Providers section scroll to “LASTools”. Fill out the blanks:\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 EOS else <<~EOS You can use the \e[32m--with-wine\e[0m version for more support.\n EOS end end test do # TODO end end ================================================ FILE: Formula/osgeo-laszip@2.rb ================================================ class OsgeoLaszipAT2 < Formula desc "Lossless LiDAR compression" homepage "https://www.laszip.org/" url "https://github.com/LASzip/LASzip/archive/v2.2.0.tar.gz" sha256 "b8e8cc295f764b9d402bc587f3aac67c83ed8b39f1cb686b07c168579c61fbb2" revision 1 head "https://github.com/LASzip/LASzip.git", :tag => "v2.2.0" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "a785cd4b90dc00fb0454badb64aecab0ad033c7bae47e40afaa77fbd548c1f11" => :mojave sha256 "a785cd4b90dc00fb0454badb64aecab0ad033c7bae47e40afaa77fbd548c1f11" => :high_sierra sha256 "03096e03a39bd9605f8efc66d43299a794b5596ab58d56ca6b8a72b0498d6e8a" => :sierra end keg_only :versioned_formula depends_on "cmake" => :build def install system "cmake", ".", *std_cmake_args system "make", "install" end test do system bin/"laszippertest" end end ================================================ FILE: Formula/osgeo-laz-perf.rb ================================================ class OsgeoLazPerf < Formula desc "Alternative LAZ implementation for C++ and JavaScript" homepage "https://github.com/hobu/laz-perf" url "https://github.com/hobu/laz-perf/archive/1.4.4.zip" sha256 "9801e671ac7122bfa67436d8ed3b202323c4f05f467882fe54ae1f20c4f0df88" #url "https://github.com/hobu/laz-perf.git", # :branch => "master", # :commit => "834629e362d8ff90669dcec60bef5cf555d197e2" #version "1.4.4" bottle do root_url "https://bottle.download.osgeo.org" cellar :any_skip_relocation sha256 "f2251ec963bfe2db4fcfba2e67a44e28f0c9184a102fdb280ba4185afeb92b83" => :catalina sha256 "f2251ec963bfe2db4fcfba2e67a44e28f0c9184a102fdb280ba4185afeb92b83" => :mojave sha256 "f2251ec963bfe2db4fcfba2e67a44e28f0c9184a102fdb280ba4185afeb92b83" => :high_sierra end #revision 1 head "https://github.com/hobu/laz-perf.git", :branch => "master" depends_on "cmake" => :build def install ENV.cxx11 system "cmake", ".", *std_cmake_args system "make", "install" end test do # TODO end end ================================================ FILE: Formula/osgeo-libgeotiff.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_libgeotiff_linked } def core_libgeotiff_linked Formula["libgeotiff"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoLibgeotiff < Formula desc "Library and tools for dealing with GeoTIFF" homepage "https://geotiff.osgeo.org/" # url "https://github.com/OSGeo/libgeotiff/releases/download/1.6.0/libgeotiff-1.6.0.tar.gz" # sha256 "9311017e5284cffb86f2c7b7a9df1fb5ebcdc61c30468fb2e6bca36e4272ebca" url "https://github.com/OSGeo/libgeotiff.git", :branch => "master", :commit => "8b1a8f52bc909f86e04ceadd699db102208074a2" version "1.6.0" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "bcaf0e372b3a5c3875d695f34660d2efd90a728ade4960e1c7b4d9669bb29177" => :catalina sha256 "bcaf0e372b3a5c3875d695f34660d2efd90a728ade4960e1c7b4d9669bb29177" => :mojave sha256 "bcaf0e372b3a5c3875d695f34660d2efd90a728ade4960e1c7b4d9669bb29177" => :high_sierra end #revision 3 head "https://github.com/OSGeo/libgeotiff.git", :branch => "master" # keg_only "libgeotiff is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "gettext" => :build depends_on "pkgconfig" => :build depends_on "jpeg" depends_on "zlib" depends_on "libtiff" depends_on "osgeo-proj" def install cd "libgeotiff" do # autoreconf -fvi system "./autogen.sh" system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--with-jpeg", "--with-zlib" system "make" # Separate steps or install fails system "make", "install" end end test do (testpath/"test.c").write <<~EOS #include "geotiffio.h" #include "xtiffio.h" #include #include int main(int argc, char* argv[]) { TIFF *tif = XTIFFOpen(argv[1], "w"); GTIF *gtif = GTIFNew(tif); TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, (uint32) 10); GTIFKeySet(gtif, GeogInvFlatteningGeoKey, TYPE_DOUBLE, 1, (double)123.456); int i; char buffer[20L]; memset(buffer,0,(size_t)20L); for (i=0;i<20L;i++){ TIFFWriteScanline(tif, buffer, i, 0); } GTIFWriteKeys(gtif); GTIFFree(gtif); XTIFFClose(tif); return 0; } EOS system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lgeotiff", "-L#{Formula["libtiff"].opt_lib}", "-ltiff", "-o", "test" system "./test", "test.tif" output = shell_output("#{bin}/listgeo test.tif") assert_match /GeogInvFlatteningGeoKey.*123.456/, output end end ================================================ FILE: Formula/osgeo-libght.rb ================================================ class OsgeoLibght < Formula desc "GeoHashTree for storing and accessing multi-dimensional point clouds" homepage "https://github.com/pramsey/libght" url "https://github.com/pramsey/libght/archive/e323c506b4180bb6de825c5d637f21f569da4cb4.tar.gz" sha256 "43a5b2909234fecdba17ecfc93ab6d254b14cdf0dac48d17d1481ac2d8e398b4" version "0.1.1" revision 3 head "https://github.com/pramsey/libght.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" sha256 "c9ee3b2d00ad53ec24ae6d670c03e53a3c5229875d3ae0797edd8c6fea9ea9b0" => :mojave sha256 "c9ee3b2d00ad53ec24ae6d670c03e53a3c5229875d3ae0797edd8c6fea9ea9b0" => :high_sierra sha256 "af246921f6cb0e3fcb594eaae4d298b9caf21a5f77c1235dda36ed7350cb4623" => :sierra end depends_on "cmake" => :build depends_on "osgeo-proj" depends_on "osgeo-liblas" depends_on "cunit" def install # support for PROJ 6 # ENV.append_to_cflags "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" mkdir "build" do system "cmake", "..", *std_cmake_args system "make" system "make", "install" end end test do assert_match "version #{version.to_s[0, 3]}", `#{bin}/"las2ght"` end end ================================================ FILE: Formula/osgeo-libkml.rb ================================================ class OsgeoLibkml < Formula desc "Library to parse, generate and operate on KML (development version)" homepage "https://code.google.com/archive/p/libkml/" url "https://github.com/google/libkml/archive/8609edf7c8d13ae2ddb6eac2bca7c8e49c67a5f8.tar.gz" sha256 "667cd86b7e66e38c71c054526e49c6ee9558b506c9ddec9e6de14b87e18c0072" version "1.3" revision 1 head "https://github.com/google/libkml.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "3fabac80a848cec660adbba3aa0c9965bd03eb3e70e23e464b6706f897b5ccfb" => :mojave sha256 "3fabac80a848cec660adbba3aa0c9965bd03eb3e70e23e464b6706f897b5ccfb" => :high_sierra sha256 "d142c373ff382e20f8113a3490a595a4b5732d809ad06a95e46539766df3fdc5" => :sierra end keg_only "older version is in main tap and installs similar components" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build def install # See main `libkml` formula for info on patches inreplace "configure.ac", "-Werror", "" inreplace "third_party/Makefile.am" do |s| s.sub! /(lib_LTLIBRARIES =) libminizip.la liburiparser.la/, "\\1" s.sub! /(noinst_LTLIBRARIES = libgtest.la libgtest_main.la)/, "\\1 libminizip.la liburiparser.la" s.sub! /(libminizip_la_LDFLAGS =)/, "\\1 -static" s.sub! /(liburiparser_la_LDFLAGS =)/, "\\1 -static" end system "./autogen.sh" system "./configure", "--prefix=#{prefix}" system "make", "install" end test do # TODO end end ================================================ FILE: Formula/osgeo-liblas.rb ================================================ class OsgeoLiblas < Formula desc "C/C++ library for reading and writing the LAS LiDAR format" homepage "https://liblas.org/" url "https://github.com/libLAS/libLAS/archive/bd157f25b3de9747fa3146f9dcf2323bc275b254.tar.gz" sha256 "9e056b8f973cdfc0e772290a16af8a2c895d997e25677332fe70ae60420913b5" version "1.8.1" #url "https://github.com/libLAS/libLAS.git", # :branch => "master", # :commit => "11a9435cc90ec40c4abbc498cbb1412dd8c33588" #version "1.8.1" revision 9 # gt_wkt_srs_cpp patch :DATA head "https://github.com/libLAS/libLAS.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" sha256 "5df647f195369ccdcfa3199344a772ba656f66195228b7ac2bba4a3a0a116faa" => :catalina sha256 "5df647f195369ccdcfa3199344a772ba656f66195228b7ac2bba4a3a0a116faa" => :mojave sha256 "5df647f195369ccdcfa3199344a772ba656f66195228b7ac2bba4a3a0a116faa" => :high_sierra end keg_only "other version built against older gdal is in main tap" option "with-test", "Verify during install with `make test`" option "with-laszip", "Build with laszip support" depends_on "cmake" => :build depends_on "boost" depends_on "zlib" depends_on "jpeg" depends_on "libtiff" depends_on "libxml2" depends_on "osgeo-libgeotiff" depends_on "osgeo-proj" depends_on "osgeo-gdal" depends_on "osgeo-laszip@2" if build.with? "laszip" # depends_on "pkgconfig" # other: oracle # for laszip 3.2.9 # Failed to open /laszip/include/laszip/laszip.hpp file # is built from a more recent commit, the patches are already applied # See: https://github.com/libLAS/libLAS/issues/140 # Fix ambiguous method error when building against GDAL 2.3 # patch do # url "https://github.com/nickrobison/libLAS/commit/ec10e274ee765aa54e7c71c8b44d2c7494e63804.patch?full_index=1" # sha256 "3f8aefa1073aa32de01175cd217773020d93e5fb44a4592d76644a242bb89a3c" # end # Fix build for Xcode 9 with upstream commit # Remove in next version # patch do # url "https://github.com/libLAS/libLAS/commit/49606470.patch?full_index=1" # sha256 "5590aef61a58768160051997ae9753c2ae6fc5b7da8549707dfd9a682ce439c8" # end def install ENV.cxx11 # ENV.append "CXXFLAGS", "-std=c++11" mkdir "macbuild" do # CMake finds boost, but variables like this were set in the last # version of this formula. Now using the variables listed here: # https://liblas.org/compilation.html ENV["Boost_INCLUDE_DIR"] = "#{HOMEBREW_PREFIX}/include" ENV["Boost_LIBRARY_DIRS"] = "#{HOMEBREW_PREFIX}/lib" args = ["-DWITH_GEOTIFF=ON", "-DWITH_GDAL=ON"] + std_cmake_args if build.with? "laszip" args << "-DWITH_LASZIP=ON" args << "-DLASZIP_INCLUDE_DIR=#{Formula['osgeo-laszip@2'].opt_include}" args << "-DLASZIP_LIBRARY=#{Formula['osgeo-laszip@2'].opt_lib}/liblaszip.dylib" rgs << "-DWITH_STATIC_LASZIP=ON" end args << "-DPROJ4_INCLUDE_DIR=#{Formula['osgeo-proj'].opt_include}" args << "-DPROJ4_LIBRARY=#{Formula['osgeo-proj'].opt_lib}" # args << "-DWITH_PKGCONFIG=ON" args << "-DWITH_UTILITIES=ON" system "cmake", "..", *args system "make" system "make", "test" if build.with?("test") # || build.bottle? system "make", "install" # fix for liblas-config # for some reason it does not build # bin.install resource("liblas-config") end # Fix rpath value, to ensure grass7 grabs the correct dylib MachO::Tools.change_install_name("#{lib}/liblas_c.3.dylib", "@rpath/liblas.3.dylib", "#{opt_lib}/liblas.3.dylib") end def post_install # fix liblas-conf config = <<~EOS #!/bin/sh # prefix=#{prefix} # exec_prefix=#{bin} # libdir=#{lib} INCLUDES="-I#{prefix}/include " 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" GDAL_INCLUDE="#{Formula['osgeo-gdal'].opt_include}" if test -n "$GDAL_INCLUDE" ; then INCLUDES="$INCLUDES -I$GDAL_INCLUDE" fi GDAL_LIBRARY="#{Formula['osgeo-gdal'].opt_lib}/libgdal.dylib" if test -n "$GDAL_LIBRARY" ; then LIBS="$LIBS $GDAL_LIBRARY" fi GEOTIFF_INCLUDE="#{Formula['osgeo-libgeotiff'].opt_include}" if test -n "$GEOTIFF_INCLUDE" ; then INCLUDES="$INCLUDES -I$GEOTIFF_INCLUDE" fi GEOTIFF_LIBRARY="#{Formula['osgeo-libgeotiff'].opt_lib}/libgeotiff.dylib" if test -n "$GEOTIFF_LIBRARY" ; then LIBS="$LIBS $GEOTIFF_LIBRARY" fi ORACLE_INCLUDE="" if test -n "$ORACLE_INCLUDE" ; then INCLUDES="$INCLUDES -I$ORACLE_INCLUDE" fi ORACLE_OCI_LIBRARY="" if test -n "$ORACLE_OCI_LIBRARY" ; then LIBS="$LIBS $ORACLE_OCI_LIBRARY " fi TIFF_INCLUDE="#{Formula['libtiff'].opt_include}" if test -n "$TIFF_INCLUDE" ; then INCLUDES="$INCLUDES -I$TIFF_INCLUDE" fi TIFF_LIBRARY="#{Formula['libtiff'].opt_lib}/libtiff.dylib" if test -n "$TIFF_LIBRARY" ; then LIBS="$LIBS $TIFF_LIBRARY" fi LIBXML2_INCLUDE_DIR="#{Formula['libxml2'].opt_include}" if test -n "$LIBXML2_INCLUDE_DIR" ; then INCLUDES="$INCLUDES -I$LIBXML2_INCLUDE_DIR" fi LIBXML2_LIBRARIES="#{Formula['libxml2'].opt_lib}/libxml2.dylib" if test -n "$LIBXML2_LIBRARIES" ; then LIBS="$LIBS $LIBXML2_LIBRARIES" fi LASZIP_INCLUDE_DIR="#{Formula['osgeo-laszip@2'].opt_include}" if test -n "$LASZIP_INCLUDE_DIR" ; then INCLUDES="$INCLUDES -I$LASZIP_INCLUDE_DIR" fi LASZIP_LIBRARY="#{Formula['osgeo-laszip@2'].opt_lib}/liblaszip.dylib" if test -n "$LASZIP_LIBRARY" ; then LIBS="$LIBS $LASZIP_LIBRARY" fi usage() { cat <&2 fi case $1 in --libs) echo $LIBS ;; --prefix) echo ${prefix} ;; --ldflags) echo -L${libdir} ;; --defines) echo -DHAVE_GDAL=1 -DHAVE_LIBGEOTIFF=1 ;; --includes) echo ${INCLUDES} ;; --cflags) echo ${INCLUDES}/liblas ;; --cxxflags) echo -Wextra -Wall -Wno-unused-parameter -Wno-unused-variable -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long ;; --version) echo 1.8.1 ;; *) usage 1 1>&2 ;; esac EOS (bin/"liblas-config").write config chmod("+x", "#{bin}/liblas-config") # fix liblas.pc rm "#{lib}/pkgconfig/liblas.pc" File.open("#{lib}/pkgconfig/liblas.pc", "w") { |file| file << "Name: libLAS\n" file << "Description: Library (C/C++) and tools for the LAS LiDAR format\n" file << "Requires: geotiff\n" file << "Version: #{version}\n" file << "Libs: -L#{lib} -llas -llas_c\n" file << "Cflags: -I#{include}/liblas" } end test do # for some reason it fails in CI, but this works # system bin/"liblas-config", "--version" end end __END__ --- /src/gt_wkt_srs.cpp +++ /src/gt_wkt_srs.cpp @@ -299,7 +299,7 @@ oSRS.SetFromUserInput(pszWKT); oSRS.SetExtension( "PROJCS", "PROJ4", "+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" ); - oSRS.FixupOrdering(); + //oSRS.FixupOrdering(); CPLFree(pszWKT); pszWKT = NULL; oSRS.exportToWkt(&pszWKT); @@ -505,7 +505,7 @@ { char *pszWKT; oSRS.morphFromESRI(); - oSRS.FixupOrdering(); + //oSRS.FixupOrdering(); if( oSRS.exportToWkt( &pszWKT ) == OGRERR_NONE ) return pszWKT; } @@ -1107,7 +1107,7 @@ /* ==================================================================== */ char *pszWKT; - oSRS.FixupOrdering(); + //oSRS.FixupOrdering(); if( oSRS.exportToWkt( &pszWKT ) == OGRERR_NONE ) return pszWKT; ================================================ FILE: Formula/osgeo-libnoise.rb ================================================ class OsgeoLibnoise < Formula desc "Portable, open-source, coherent noise-generating library for C++" homepage "https://github.com/qknight/libnoise" url "https://github.com/qknight/libnoise/archive/2fb16f638aac6868d550c735898f217cdefa3559.zip" sha256 "6f19ddf41682a716713b12507215a0639f15cf12d94d3ae56256ae63aeb2c22b" version "1.0.0-cmake" revision 1 bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "c9cc8d283d929be6fc8a13b0a71bfc9c3bd47d3c0350ed344a45cbe98f1de2a9" => :mojave sha256 "c9cc8d283d929be6fc8a13b0a71bfc9c3bd47d3c0350ed344a45cbe98f1de2a9" => :high_sierra sha256 "1e1f0f9842717772ca813a2c58993551af582c04103bf1fc81bec718aa945d7b" => :sierra end option "with-docs", "Install documentation" depends_on "cmake" => :build depends_on "doxygen" => :build if build.with? "docs" resource "examples" do url "http://libnoise.sourceforge.net/downloads/examples.zip" sha256 "d6b0d36e0938a2a60d6c9d74a3fd0b7fae5cac3d8f66ffc738a215e856b4702b" end resource "noiseutils" do url "http://libnoise.sourceforge.net/downloads/noiseutils.zip" sha256 "2c3d7adf288020b22b42d76d047b676f4e3ef33485808a3334ca062f4b52a7db" end def install inreplace "doc/CMakeLists.txt", "/usr/share", share if build.with? "docs" args = std_cmake_args args << "-DBUILD_LIBNOISE_DOCUMENTATION=ON" if build.with? "docs" mkdir "build" do system "cmake", "..", *args system "make", "install" end (prefix/"examples").install resource("examples") resource("noiseutils").stage do (Pathname.pwd/"CMakeLists.txt").write <<~EOS set( PROJECT_NAME libnoiseutils ) include_directories( "${CMAKE_INSTALL_PREFIX}/include" ) add_library( noiseutils SHARED noiseutils.cpp ) set_target_properties( noiseutils PROPERTIES LIBNOISE_VERSION 2 ) target_link_libraries( noiseutils ${CMAKE_INSTALL_PREFIX}/lib/libnoise.dylib ) add_definitions( "-Wall -ansi -pedantic -O3" ) install( FILES "${PROJECT_SOURCE_DIR}/noiseutils.h" DESTINATION "${CMAKE_INSTALL_PREFIX}/include" ) install( TARGETS noiseutils DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) EOS mkdir "build" do system "cmake", "..", *std_cmake_args system "make", "install" end end end def caveats; <<~EOS This formula is installed from a fork of the main project, which offers a a CMake-based install. Original project is located here: `http://libnoise.sourceforge.net` EOS end test do system ENV.cxx, "#{prefix}/examples/texturejade.cpp", "-o", "test", "-I#{include}", "-L#{lib}", "-lnoise", "-lnoiseutils" system "./test" outputs = %w[textureplane.bmp textureseamless.bmp texturesphere.bmp] outputs.each_with_index do |f,i| f_size = FileTest.size(f) assert f_size && f_size > 102400 # > 100 KiB puts "#{f} (#{i+1}/#{outputs.length}) is #{f_size/1024} KiB" if ARGV.verbose? end end end ================================================ FILE: Formula/osgeo-libpqxx.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_libpqxx_linked } def core_libpqxx_linked Formula["libpqxx"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoLibpqxx < Formula desc "C++ connector for PostgreSQL" homepage "http://pqxx.org/development/libpqxx" url "https://github.com/jtv/libpqxx/archive/6.4.4.tar.gz" sha256 "6ae3a0113a242db6bb9d998943b7cc23699652d843dab702aa06a8b9330c171a" bottle do root_url "https://bottle.download.osgeo.org" cellar :any rebuild 1 sha256 "b6f75cdea345d394ccc7edb3c217165da4882506349720ff6a2e924376e72584" => :mojave sha256 "b6f75cdea345d394ccc7edb3c217165da4882506349720ff6a2e924376e72584" => :high_sierra sha256 "126e17a143e629fc588831651c54207c964adc6ae2e22c8ca060037e1646f952" => :sierra end # revision 1 head "https://github.com/jtv/libpqxx.git", :branch => "master" option "with-pg10", "Build with PostgreSQL 10 client" # keg_only "libpqxx is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "pkg-config" => :build depends_on "xmlto" => :build depends_on "python@2" depends_on "doxygen" depends_on "graphviz" if build.with?("pg10") depends_on "osgeo-postgresql@10" else depends_on "osgeo-postgresql" end def install ENV.cxx11 ENV.append "CXXFLAGS", "-std=c++11" inreplace "tools/splitconfig", "python", "python2" system "./configure", "--prefix=#{prefix}", "--enable-shared" system "make", "install" end test do (testpath/"test.cpp").write <<~EOS #include int main(int argc, char** argv) { pqxx::connection con; return 0; } EOS # system "initdb", "/usr/local/var/postgresql", "-E", "utf8", "--locale=en_US.UTF-8" # system "psql", "-h", "localhost", "-d", "postgres" # system "createdb", "circleci" system ENV.cxx, "-std=c++11", "test.cpp", "-L#{lib}", "-lpqxx", "-I#{include}", "-o", "test" # Running ./test will fail because there is no runnning postgresql server # system "./test" # `pg_config` uses Cellar paths not opt paths # postgresql_include = Formula["osgeo-postgresql"].opt_include.realpath.to_s # assert_match postgresql_include, (lib/"pkgconfig/libpqxx.pc").read, # "Please revision bump libpqxx." end end ================================================ FILE: Formula/osgeo-libspatialite.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_libspatialite_linked } def core_libspatialite_linked Formula["libspatialite"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoLibspatialite < Formula desc "Adds spatial SQL capabilities to SQLite" homepage "https://www.gaia-gis.it/fossil/libspatialite/index" revision 9 stable do url "https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-4.3.0a.tar.gz" mirror "https://ftp.netbsd.org/pub/pkgsrc/distfiles/libspatialite-4.3.0a.tar.gz" mirror "https://www.mirrorservice.org/sites/ftp.netbsd.org/pub/pkgsrc/distfiles/libspatialite-4.3.0a.tar.gz" sha256 "88900030a4762904a7880273f292e5e8ca6b15b7c6c3fb88ffa9e67ee8a5a499" patch do url "https://raw.githubusercontent.com/Homebrew/formula-patches/27a0e51936e01829d0a6f3c75a7fbcaf92bb133f/libspatialite/sqlite310.patch" sha256 "459434f5e6658d6f63d403a7795aa5b198b87fc9f55944c714180e7de662fce2" end end bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "bdf1b153bb5387bcf429f55a83758855da42b7e8f1e5488c7af19aece19ef5eb" => :catalina sha256 "bdf1b153bb5387bcf429f55a83758855da42b7e8f1e5488c7af19aece19ef5eb" => :mojave sha256 "bdf1b153bb5387bcf429f55a83758855da42b7e8f1e5488c7af19aece19ef5eb" => :high_sierra end head do url "https://www.gaia-gis.it/fossil/libspatialite", :using => :fossil depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end # keg_only "libspatialite" is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "pkg-config" => :build depends_on "freexl" depends_on "geos" depends_on "libxml2" depends_on "osgeo-proj" # Needs SQLite > 3.7.3 which rules out system SQLite on Snow Leopard and # below. Also needs dynamic extension support which rules out system SQLite # on Lion. Finally, RTree index support is required as well. depends_on "sqlite" def install system "autoreconf", "-fi" if build.head? # New SQLite3 extension won't load via SELECT load_extension("mod_spatialite"); # unless named mod_spatialite.dylib (should actually be mod_spatialite.bundle) # See: https://groups.google.com/forum/#!topic/spatialite-users/EqJAB8FYRdI # needs upstream fixes in both SQLite and libtool inreplace "configure", "shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'", "shrext_cmds='.dylib'" chmod 0755, "configure" # Ensure Homebrew's libsqlite is found before the system version. sqlite = Formula["sqlite"] ENV.append "LDFLAGS", "-L#{sqlite.opt_lib}" ENV.append "CFLAGS", "-I#{sqlite.opt_include}" # Use Proj 6.0.0 compatibility headers. # Remove in libspatialite 5.0.0 ENV.append_to_cflags "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" args = %W[ --disable-dependency-tracking --prefix=#{prefix} --with-sysroot=#{HOMEBREW_PREFIX} --enable-geocallbacks ] system "./configure", *args system "make", "install" end test do # Verify mod_spatialite extension can be loaded using Homebrew's SQLite pipe_output("#{Formula["sqlite"].opt_bin}/sqlite3", "SELECT load_extension('#{opt_lib}/mod_spatialite');") end end ================================================ FILE: Formula/osgeo-mapnik.rb ================================================ class OsgeoMapnik < Formula include Language::Python::Virtualenv desc "Toolkit for developing mapping applications" homepage "https://mapnik.org/" url "https://github.com/mapnik/mapnik/releases/download/v3.0.22/mapnik-v3.0.22.tar.bz2" sha256 "930612ad9e604b6a29b9cea1bc1de85cf7cf2b2b8211f57ec8b6b94463128ab9" # url "https://github.com/mapnik/mapnik.git", # :branch => "v3.0.x", # :commit => "2ab8602f71809303ca180d495ecb89dfc27ba20d" # version "3.0.22" # https://github.com/mapnik/mapnik/wiki/MacInstallation_Homebrew revision 2 bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "c05902125ce684e762a19af922d553b3aa100206977ab14464de61438dbfca7d" => :mojave sha256 "c05902125ce684e762a19af922d553b3aa100206977ab14464de61438dbfca7d" => :high_sierra sha256 "c05902125ce684e762a19af922d553b3aa100206977ab14464de61438dbfca7d" => :sierra end head "https://github.com/mapnik/mapnik.git", :branch => "master" option "with-pg10", "Build with PostgreSQL 10 client" depends_on "pkg-config" => :build depends_on "scons" => :build depends_on "boost" depends_on "boost-python" depends_on "freetype" depends_on "harfbuzz" depends_on "icu4c" depends_on "jpeg" depends_on "libpng" depends_on "libtiff" depends_on "osgeo-proj" depends_on "webp" depends_on "libjpeg-turbo" depends_on "libxml2" depends_on "python" # depends_on "python@2" depends_on "osgeo-postgis" depends_on "curl" depends_on "libtool" depends_on "libxslt" depends_on "httpd" # => :optional depends_on "fcgi" # => :optional depends_on "cairo" # --without-x --without-glib depends_on "cairomm" depends_on "py2cairo" depends_on "sqlite" depends_on "zlib" depends_on "geos" depends_on "osgeo-gdal" depends_on "ossp-uuid" depends_on "libagg" depends_on "openjpeg" # for Pillow depends_on "git" depends_on "json-c" if build.with?("pg10") depends_on "osgeo-postgresql@10" else depends_on "osgeo-postgresql" end resource "Pillow" do url "https://files.pythonhosted.org/packages/81/1a/6b2971adc1bca55b9a53ed1efa372acff7e8b9913982a396f3fa046efaf8/Pillow-6.0.0.tar.gz" sha256 "809c0a2ce9032cbcd7b5313f71af4bdc5c8c771cb86eb7559afd954cab82ebb5" end resource "lxml" do url "https://files.pythonhosted.org/packages/7d/29/174d70f303016c58bd790c6c86e6e86a9d18239fac314d55a9b7be501943/lxml-4.3.3.tar.gz" sha256 "4a03dd682f8e35a10234904e0b9508d705ff98cf962c5851ed052e9340df3d90" end resource "nose" do url "https://files.pythonhosted.org/packages/58/a5/0dc93c3ec33f4e281849523a5a913fa1eea9a3068acfa754d44d88107a44/nose-1.3.7.tar.gz" sha256 "f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98" end resource "geometry" do url "https://github.com/mapbox/geometry.hpp.git", :branch => "master", :commit => "c83a2ab18a225254f128b6f5115aa39d04f2de21" version "1.1.5" end resource "polylabel" do url "https://github.com/mapbox/polylabel.git", :branch => "master", :commit => "23f6a762ef2873519b86d46b625dd80f340e3dc3" version "1.1.5" end resource "protozero" do url "https://github.com/mapbox/protozero.git", :branch => "master", :commit => "3ef46ba780cad2caaf56a31fe35d102b069cdf0d" version "1.1.5" end resource "variant" do url "https://github.com/mapbox/variant.git", :branch => "master", :commit => "0f734f01e685a298e3756d30044a4164786c58c5" version "1.1.5" end # Use pkg-config to find FreeType2 if available # patch do # url "https://github.com/mapnik/mapnik/pull/3892.patch" # sha256 "774a8590b698e9dc2a483e6ff48781ed0400ba06b901f12a1ed50c9114833d47" # end def install ENV.cxx11 # Work around "error: no member named 'signbit' in the global namespace" # encountered when trying to detect boost regex in configure ENV.delete("SDKROOT") if DevelopmentTools.clang_build_version >= 900 # ENV.append "CPPPATH", "#{HOMEBREW_PREFIX}/include" # ENV.append "LIBPATH", "#{HOMEBREW_PREFIX}/lib" # install python modules venv = virtualenv_create(libexec/'vendor', "#{Formula["python"].opt_bin}/python3") res = resources.map(&:name).to_set - %w[geometry polylabel protozero variant] res.each do |r| venv.pip_install resource(r) end # fix error: use of undeclared identifier 'sqlite3_enable_load_extension' # https://github.com/mapnik/mapnik-support/issues/119 # ENV.append "PATH", "#{Formula["sqlite"].opt_bin}:$PATH" ENV.append "CUSTOM_CXXFLAGS", "-I#{Formula["sqlite"].opt_include}" ENV.append "CUSTOM_LDFLAGS", "-L#{Formula["sqlite"].opt_lib} -lsqlite3" args = %W[ CC=#{ENV.cc} CXX=#{ENV.cxx} PREFIX=#{prefix} CPP_TESTS=FALSE INPUT_PLUGINS=all NIK2IMG=FALSE ] # support for PROJ 6 # https://github.com/mapnik/mapnik/issues/4036 # ENV.append_to_cflags "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" # args << "CUSTOM_DEFINES=-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" # http://site.icu-project.org/download/61#TOC-Migration-Issues # ENV.append "CXXFLAGS", "-DU_USING_ICU_NAMESPACE=1" # https://github.com/mapnik/mapnik/issues/3961 # ENV.append "CUSTOM_CXXFLAGS", "-DU_USING_ICU_NAMESPACE=1" # mapnik compiles can take ~1.5 GB per job for some .cpp files # so lets be cautious by limiting to CPUS/2 # jobs = sysctl -n hw.ncpu jobs = ENV.make_jobs.to_i jobs /= 2 if jobs > 2 args << "JOBS=#{jobs}" args << "CUSTOM_CXXFLAGS=#{ENV["CUSTOM_CXXFLAGS"]}" args << "CUSTOM_LDFLAGS=#{ENV["CUSTOM_LDFLAGS"]}" # args << "CUSTOM_CFLAGS=#{ENV["CUSTOM_CFLAGS"]}" # SYSTEM_FONTS=/usr/share/fonts # args << "PYTHON_PREFIX=#{prefix}" # Install to Homebrew's site-packages // OLD args << "LINKING=shared" args << "RUNTIME_LINK=shared" args << "THREADING=multi" args << "INTERNAL_LIBAGG=False" args << "BENCHMARK=FALSE" # args << "DEMO=False" args << "BOOST_INCLUDES=#{Formula["boost"].opt_include}" args << "BOOST_LIBS=#{Formula["boost"].opt_lib}" args << "FREETYPE_CONFIG=#{Formula["freetype"].opt_bin}/freetype-config" args << "FREETYPE_INCLUDES=#{Formula["freetype"].opt_include}/freetype2" args << "FREETYPE_LIBS=#{Formula["freetype"].opt_lib}" # fails if defined # args << "ICU_INCLUDES=#{Formula["icu4c"].opt_include}/unicode" # args << "ICU_LIBS=#{Formula["icu4c"].opt_lib}" # args << "ICU_LIB_NAME=#{Formula["icu4c"].opt_lib}" args << "CAIRO=TRUE" args << "CAIRO_INCLUDES=#{Formula["cairo"].opt_include}" args << "CAIRO_LIBS=#{Formula["cairo"].opt_lib}" args << "PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/X11/lib/pkgconfig" args << "GRID_RENDERER=TRUE" # args << "SVG2PNG=True" # Error: Failed changing install name in /bin/svg2png args << "SVG_RENDERER=TRUE" args << "PNG=TRUE" args << "PNG_INCLUDES=#{Formula["libpng"].opt_include}" args << "PNG_LIBS=#{Formula["libpng"].opt_lib}" args << "JPEG=TRUE" args << "JPEG_INCLUDES=#{Formula["jpeg"].opt_include}" args << "JPEG_LIBS=#{Formula["jpeg"].opt_lib}" args << "TIFF=TRUE" args << "TIFF_INCLUDES=#{Formula["libtiff"].opt_include}" args << "TIFF_LIBS=#{Formula["libtiff"].opt_lib}" args << "WEBP=TRUE" args << "WEBP_INCLUDES=#{Formula["webp"].opt_include}" args << "WEBP_LIBS=#{Formula["webp"].opt_lib}" args << "GEOS_CONFIG=#{Formula["geos"].opt_bin}/geos-config" args << "GDAL_CONFIG=#{Formula["osgeo-gdal"].opt_bin}/gdal-config" args << "OCCI_INCLUDES=#{Formula["osgeo-gdal"].opt_include}" args << "OCCI_LIBS=#{Formula["osgeo-gdal"].opt_lib}" args << "RASTERLITE_INCLUDES=#{Formula["osgeo-gdal"].opt_include}" args << "RASTERLITE_LIBS=#{Formula["osgeo-gdal"].opt_lib}" args << "XML2_CONFIG=#{Formula["libxml2"].opt_bin}/xml2-config" args << "XML2_INCLUDES=#{Formula["libxml2"].opt_include}" args << "XML2_LIBS=#{Formula["libxml2"].opt_lib}" # fails if defined # args << "XMLPARSER=libxml2" # args << "OPTIONAL_LIBSHEADERS=#{Formula["libxml2"].opt_include}" args << "HB_INCLUDES=#{Formula["harfbuzz"].opt_include}" args << "HB_LIBS=#{Formula["harfbuzz"].opt_lib}" args << "PROJ=TRUE" args << "PROJ_INCLUDES=#{Formula["osgeo-proj"].opt_include}" args << "PROJ_LIBS=#{Formula["osgeo-proj"].opt_lib}" # fails if defined # args << "SQLITE_INCLUDES=#{Formula["sqlite"].opt_include}" # args << "SQLITE_LIBS=#{Formula["sqlite"].opt_lib}" if build.with?("pg10") args << "PG_CONFIG=#{Formula["osgeo-postgresql@10"].opt_bin}/pg_config" args << "PG_INCLUDES=#{Formula["osgeo-postgresql@10"].opt_include}" args << "PG_LIBS=#{Formula["osgeo-postgresql@10"].opt_lib}" else args << "PG_CONFIG=#{Formula["osgeo-postgresql"].opt_bin}/pg_config" args << "PG_INCLUDES=#{Formula["osgeo-postgresql"].opt_include}" args << "PG_LIBS=#{Formula["osgeo-postgresql"].opt_lib}" end args << "PGSQL2SQLITE=True" # link variant as submodules are missing from source tarball # https://github.com/mapnik/mapnik/issues/3246#issuecomment-279646631 # this is faster than doing "git submodule update..." # rm_r "#{buildpath}/deps/mapbox/geometry" # rm_r "#{buildpath}/deps/mapbox/polylabel" # rm_r "#{buildpath}/deps/mapbox/protozero" rm_r "#{buildpath}/deps/mapbox/variant" # rm_r "#{buildpath}/demo" (buildpath/"deps/mapbox/geometry").install resource("geometry") (buildpath/"deps/mapbox/polylabel").install resource("polylabel") (buildpath/"deps/mapbox/protozero").install resource("protozero") (buildpath/"deps/mapbox/variant").install resource("variant") # git submodule update --init # system "git submodule update --init --recursive" # rm_r ".sconf_temp" system "./configure", *args # system "./configure", 'CUSTOM_CXXFLAGS="-DU_USING_ICU_NAMESPACE=1"', *args # ./configure CXX="clang++" JOBS=`sysctl -n hw.ncpu` # To use a Python interpreter that is not named python for your build, # do something like the following instead: # PYTHON=python2 ./configure # make PYTHON=python2 system "make" system "make", "install" # system "#{Formula["python"].opt_bin}/python3", "scons/scons.py", "./configure", "--config=cache", "--implicit-cache", "--max-drift=1", *args # "--jobs=${jobs} # system "#{Formula["python"].opt_bin}/python3", "scons/scons.py" # system "#{Formula["python"].opt_bin}/python3", "scons/scons.py", "install" end # def post_install # Boost-Python Link Problems # After you install mapnik, you may try to import it and get Fatal Python # error: Interpreter not initialized (version mismatch?). If so, you likely # have boost linked with the wrong version of python. # otool -L `brew list boost | grep python-mt.dylib` | grep -i python # It's likely that your copy of boost was linked against the system python, # but you're trying to use a homebrew python. To fix, uninstall boost, # and reinstall with --build-from-source: # brew uninstall boost # brew install --build-from-source boost # Mapbox Variant not found problem # After git clone of mapnik, execute the following to pull down additional dependencies # system "git submodule update --init deps/mapbox/variant" # end # def caveats; <<-EOS # For non-homebrew Python, you need to amend your PYTHONPATH like so: # export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages:$PYTHONPATH # EOS # end test do output = shell_output("#{bin}/mapnik-config --prefix").chomp assert_equal prefix.to_s, output end # private # def which_python # "python" + `python -c 'import sys;print(sys.version[:3])'`.strip # end end ================================================ FILE: Formula/osgeo-marble.rb ================================================ class OsgeoMarble < Formula homepage "http://marble.kde.org/" url "https://download.kde.org/stable/applications/19.04.1/src/marble-19.04.1.tar.xz" sha256 "acd9c15c4758684f6eff6c2318fc4dd88fd68dd41336de9458cad4d5f6832c61" version "19.04.1" # revision 1 head "git://anongit.kde.org/marble" bottle do root_url "https://bottle.download.osgeo.org" rebuild 1 sha256 "b9b28fdf6d0fbf2894f6103abffa263f05727f7b1c7ac7b5a830725a6e9243f4" => :mojave sha256 "b9b28fdf6d0fbf2894f6103abffa263f05727f7b1c7ac7b5a830725a6e9243f4" => :high_sierra sha256 "0e556ae04c4a72d7b5e2b486d1a3298ab81ec9d1cd3d06e056cf3820f7bdd1db" => :sierra end option "with-debug", "Enable debug build type" option "without-tools", "Build without extra Marble Tools" option "with-examples", "Build Marble library C++ examples" option "with-tests", "Build and run unit tests" depends_on "cmake" => :build depends_on "qt" depends_on "quazip" => :recommended depends_on "shapelib" => :recommended depends_on "gpsd" => :recommended depends_on "protobuf" if build.with? "tools" def install # basic std_cmake_args args = %W[ -DCMAKE_INSTALL_PREFIX=#{prefix} -DCMAKE_BUILD_TYPE=#{(build.with?('debug')) ? 'Debug' : 'Release' } -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=TRUE -Wno-dev ] # args << "-DCMAKE_INSTALL_LIBDIR=#{lib}" # args << "-DCMAKE_INSTALL_SYSCONFDIR=#{etc}" args << "-DQT_PLUGINS_DIR=#{HOMEBREW_PREFIX}/lib/qt/plugins" args << "-DBUILD_TESTING=OFF" # app build args.concat %W[ -DBUILD_MARBLE_TESTS=#{((build.with? "tests") ? "ON" : "OFF")} -DMOBILE=OFF -DWITH_libgps=OFF -DWITH_libwlocate=OFF -DWITH_DESIGNER_PLUGIN=OFF -DBUILD_MARBLE_TOOLS=#{((build.with? "tools") ? "ON" : "OFF")} -DBUILD_MARBLE_EXAMPLES=#{((build.with? "examples") ? "ON" : "OFF")} ] # not used by the project # args << "-DQTONLY=ON" # args << "-DWITH_KF5" # args << "-DWITH_Phonon=OFF" # args << "-DWITH_QextSerialPort=OFF" # args << "-DWITH_QtLocation=OFF" # args << "-DWITH_liblocation=OFF" mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end end test do end end ================================================ FILE: Formula/osgeo-matplotlib.rb ================================================ class NoExternalPyCXXPackage < Requirement fatal false satisfy do !quiet_system "python3", "-c", "import CXX" end def message; <<~EOS *** Warning, PyCXX detected! *** On your system, there is already a PyCXX version installed, that will probably make the build of Matplotlib fail. In python you can test if that package is available with `import CXX`. To get a hint where that package is installed, you can: python3 -c "import os; import CXX; print(os.path.dirname(CXX.__file__))" See also: https://github.com/Homebrew/homebrew-python/issues/56 EOS end end class OsgeoMatplotlib < Formula desc "Python 2D plotting library" homepage "https://matplotlib.org" url "https://github.com/matplotlib/matplotlib/archive/v3.2.1.tar.gz" sha256 "5462728ed3be60af21bd8a6b33f5f1632dabdb3c1b3cc279cffb05926a48255c" #revision 8 head "https://github.com/matplotlib/matplotlib.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "c262dcc51a2b1bfc8ac7878ea28d09c869de81ca677208844cdd6bcedfc6bc44" => :catalina sha256 "c262dcc51a2b1bfc8ac7878ea28d09c869de81ca677208844cdd6bcedfc6bc44" => :mojave sha256 "c262dcc51a2b1bfc8ac7878ea28d09c869de81ca677208844cdd6bcedfc6bc44" => :high_sierra end depends_on NoExternalPyCXXPackage => :build depends_on "pkg-config" => :build depends_on "gcc" => :build # for gfortran depends_on "python" => :build depends_on "swig" => :build depends_on "libagg" depends_on "freetype" depends_on "libpng" depends_on "qhull" depends_on "tcl-tk" depends_on "zlib" depends_on "openblas" depends_on "numpy" depends_on "scipy" depends_on "osgeo-six" depends_on "cairo" depends_on "py3cairo" depends_on "gtk+3" depends_on "pygobject3" # depends_on "pygtk" # pygtk has been deprecated since a very long time, and does not support Python 3. # depends_on "pygobject" # Does not support Python 3, and needs pygtk which has been removed. #depends_on "osgeo-pyqt" depends_on "pyqt" depends_on "wxpython" depends_on "rsync" depends_on "git" depends_on "ffmpeg" depends_on "imagemagick" depends_on "ghostscript" # depends_on "inkscape" => :optional depends_on "openjpeg" # for Pillow resource "setuptools" do url "https://files.pythonhosted.org/packages/42/3e/2464120172859e5d103e5500315fb5555b1e908c0dacc73d80d35a9480ca/setuptools-45.1.0.zip" sha256 "91f72d83602a6e5e4a9e4fe296e27185854038d7cbda49dcd7006c4d3b3b89d5" end resource "Pillow" do url "https://files.pythonhosted.org/packages/39/47/f28067b187dd664d205f75b07dcc6e0e95703e134008a14814827eebcaab/Pillow-7.0.0.tar.gz" sha256 "4d9ed9a64095e031435af120d3c910148067087541131e82b3e8db302f4c8946" end resource "cycler" do url "https://files.pythonhosted.org/packages/c2/4b/137dea450d6e1e3d474e1d873cd1d4f7d3beed7e0dc973b06e8e10d32488/cycler-0.10.0.tar.gz" sha256 "cd7b2d1018258d7247a71425e9f26463dfb444d411c39569972f4ce586b0c9d8" end resource "kiwisolver" do url "https://files.pythonhosted.org/packages/16/e7/df58eb8868d183223692d2a62529a594f6414964a3ae93548467b146a24d/kiwisolver-1.1.0.tar.gz" sha256 "53eaed412477c836e1b9522c19858a8557d6e595077830146182225613b11a75" end resource "pyparsing" do url "https://files.pythonhosted.org/packages/a2/56/0404c03c83cfcca229071d3c921d7d79ed385060bbe969fde3fd8f774ebd/pyparsing-2.4.6.tar.gz" sha256 "4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f" end resource "python-dateutil" do url "https://files.pythonhosted.org/packages/be/ed/5bbc91f03fa4c839c4c7360375da77f9659af5f7086b7a7bdda65771c8e0/python-dateutil-2.8.1.tar.gz" sha256 "73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c" end resource "pytz" do url "https://files.pythonhosted.org/packages/82/c3/534ddba230bd4fbbd3b7a3d35f3341d014cca213f369a9940925e7e5f691/pytz-2019.3.tar.gz" sha256 "b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be" end resource "cairocffi" do url "https://files.pythonhosted.org/packages/f7/99/b3a2c6393563ccbe081ffcceb359ec27a6227792c5169604c1bd8128031a/cairocffi-1.1.0.tar.gz" sha256 "f1c0c5878f74ac9ccb5d48b2601fcc75390c881ce476e79f4cfedd288b1b05db" end # resource "six" do # url "https://files.pythonhosted.org/packages/21/9f/b251f7f8a76dec1d6651be194dfba8fb8d7781d10ab3987190de8391d08e/six-1.14.0.tar.gz" #  sha256 "236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a" # end # resource "tornado" do #  url "https://files.pythonhosted.org/packages/e6/78/6e7b5af12c12bdf38ca9bfe863fcaf53dc10430a312d0324e76c1e5ca426/tornado-5.1.1.tar.gz" # sha256 "4e5158d97583502a7e2739951553cbd88a72076f152b4b11b64b9a10c4c49409" # end resource "tornado" do url "https://files.pythonhosted.org/packages/30/78/2d2823598496127b21423baffaa186b668f73cd91887fcef78b6eade136b/tornado-6.0.3.tar.gz" sha256 "c845db36ba616912074c5b1ee897f8e0124df269468f25e4fe21fe72f6edd7a9" end # python version >= 3.5 required # resource "scipy" do #  url "https://files.pythonhosted.org/packages/04/ab/e2eb3e3f90b9363040a3d885ccc5c79fe20c5b8a3caa8fe3bf47ff653260/scipy-1.4.1.tar.gz" # sha256 "dee1bbf3a6c8f73b6b218cb28eed8dd13347ea2f87d572ce19b289d6fd3fbc59" # end # resource "numpy" do # url "https://files.pythonhosted.org/packages/40/de/0ea5092b8bfd2e3aa6fdbb2e499a9f9adf810992884d414defc1573dca3f/numpy-1.18.1.zip" # sha256 "b6ff59cee96b454516e47e7721098e6ceebef435e3e21ac2d6c3b8b02628eb77" # end def install if DevelopmentTools.clang_build_version >= 900 ENV.delete "SDKROOT" ENV.delete "HOMEBREW_SDKROOT" end # inreplace "setupext.py", #  "'darwin': ['/usr/local/'", #  "'darwin': ['#{HOMEBREW_PREFIX}'" xy = Language::Python.major_minor_version "python3" site_packages = libexec/"lib/python#{xy}/site-packages" ENV.prepend_create_path "PYTHONPATH", site_packages resources.each do |r| r.stage do system "python3", *Language::Python.setup_install_args(libexec) end end (lib/"python#{xy}/site-packages/homebrew-matplotlib.pth").write "#{site_packages}\n" system "python3", *Language::Python.setup_install_args(prefix) end test do ENV["PYTHONDONTWRITEBYTECODE"] = "1" system "echo", "0" #"python3", "-c", "import matplotlib" end end ================================================ FILE: Formula/osgeo-mongo-cxx-driver-legacy.rb ================================================ class OsgeoMongoCxxDriverLegacy < Formula desc "C++ driver for MongoDB" homepage "https://github.com/mongodb/mongo-cxx-driver" url "https://github.com/mongodb/mongo-cxx-driver/archive/legacy-1.1.3.tar.gz" sha256 "50304162f706c2c73e04f200cdac767cb2c55d47cf724811cbfc8bb34a0fd6bc" revision 3 head "https://github.com/mongodb/mongo-cxx-driver.git", :branch => "releases/legacy" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "eba1f1faf4e7aa27700f0daf65ac89711162244583a609e0bafc6e88060c8056" => :catalina sha256 "eba1f1faf4e7aa27700f0daf65ac89711162244583a609e0bafc6e88060c8056" => :mojave sha256 "eba1f1faf4e7aa27700f0daf65ac89711162244583a609e0bafc6e88060c8056" => :high_sierra end keg_only "Newer driver in homebrew core" # src/.../ssl_manager.cpp:631:23: error: BIO_s_file_internal was not declared in this scope # https://bugs.gentoo.org/676066 # https://patch-diff.githubusercontent.com/raw/mongodb/mongo-cxx-driver/pull/615.patch patch :DATA depends_on "scons" => :build depends_on "boost" depends_on "openssl" # depends_on "openssl@1.1" resource "connect_test" do url "https://raw.githubusercontent.com/mongodb/mongo-cxx-driver/legacy/src/mongo/client/examples/tutorial.cpp" sha256 "39ad991cf07722312398cd9dbfefb2b8df00729c2224bdf0b644475b95a240dc" end resource "bson_test" do url "https://raw.githubusercontent.com/mongodb/mongo-cxx-driver/legacy/src/mongo/bson/bsondemo/bsondemo.cpp" sha256 "299c87b57f11e3ff9ac0fd2e8ac3f8eb174b64c673951199831a0ba176292164" end def install args = [ "--prefix=#{prefix}", "--c++11=on", "--libc++", "--osx-version-min=10.9", "--extrapath=#{Formula["boost"].opt_prefix}", "--sharedclient", "--use-sasl-client", "--ssl", "--disable-warnings-as-errors", "--cpppath=#{Formula["openssl"].opt_include}", "--libpath=#{Formula["openssl"].opt_lib}", "install" ] system "scons", *args end test do # TODO # resource("connect_test").stage do # system ENV.cxx, "-o", "test", "tutorial.cpp", # "-I#{include}/", # "-L#{lib}", "-lmongoclient", "-pthread", "-lboost_thread-mt", "-lboost_system", "-lboost_regex", "-std=c++11", "-stdlib=libc++" # 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", # shell_output("./test mongodb://0.0.0.0 2>&1", 1) # end # resource("bson_test").stage do # system ENV.cxx, "-o", "test", "bsondemo.cpp", # "-I#{include}", # "-L#{lib}", "-lmongoclient", "-lboost_thread-mt", "-lboost_system", "-lboost_regex", "-std=c++11", "-stdlib=libc++" # system "./test" # end end end __END__ --- a/src/mongo/client/command_writer.h +++ b/src/mongo/client/command_writer.h @@ -17,6 +17,11 @@ #include "mongo/client/dbclient_writer.h" +#include +#if BOOST_VERSION >= 106700 +#include +#endif + namespace mongo { class DBClientBase; --- a/src/mongo/client/wire_protocol_writer.h +++ b/src/mongo/client/wire_protocol_writer.h @@ -16,6 +16,10 @@ #pragma once #include "mongo/client/dbclient_writer.h" +#include +#if BOOST_VERSION >= 106700 +#include +#endif namespace mongo { --- a/src/mongo/crypto/crypto_openssl.cpp +++ b/src/mongo/crypto/crypto_openssl.cpp @@ -34,19 +34,27 @@ namespace crypto { * Computes a SHA-1 hash of 'input'. */ bool sha1(const unsigned char* input, const size_t inputLen, unsigned char* output) { - EVP_MD_CTX digestCtx; - EVP_MD_CTX_init(&digestCtx); - ON_BLOCK_EXIT(EVP_MD_CTX_cleanup, &digestCtx); + EVP_MD_CTX *digestCtx = EVP_MD_CTX_create(); + if (!digestCtx) { + return false; + } + + EVP_MD_CTX_init(digestCtx); + #if OPENSSL_VERSION_NUMBER < 0x10100000L + ON_BLOCK_EXIT(EVP_MD_CTX_destroy, digestCtx); + #else + ON_BLOCK_EXIT(EVP_MD_CTX_free, digestCtx); + #endif - if (1 != EVP_DigestInit_ex(&digestCtx, EVP_sha1(), NULL)) { + if (1 != EVP_DigestInit_ex(digestCtx, EVP_sha1(), NULL)) { return false; } - if (1 != EVP_DigestUpdate(&digestCtx, input, inputLen)) { + if (1 != EVP_DigestUpdate(digestCtx, input, inputLen)) { return false; } - return (1 == EVP_DigestFinal_ex(&digestCtx, output, NULL)); + return (1 == EVP_DigestFinal_ex(digestCtx, output, NULL)); } /* --- a/src/mongo/util/net/ssl_manager.cpp +++ b/src/mongo/util/net/ssl_manager.cpp @@ -628,7 +628,12 @@ bool SSLManager::_initSSLContext(SSL_CTX** context, const Params& params) { bool SSLManager::_setSubjectName(const std::string& keyFile, std::string& subjectName) { // Read the certificate subject name and store it - BIO* in = BIO_new(BIO_s_file_internal()); + BIO* in; + #if OPENSSL_VERSION_NUMBER < 0x10100000L + in = BIO_new(BIO_s_file_internal()); + #else + in = BIO_new(BIO_s_file()); + #endif if (NULL == in) { error() << "failed to allocate BIO object: " << getSSLErrorMessage(ERR_get_error()) << endl; return false; ================================================ FILE: Formula/osgeo-mrsid-sdk.rb ================================================ require File.expand_path("../../Strategies/cache-download", Pathname.new(__FILE__).realpath) class OsgeoMrsidSdk < Formula desc "MrSID format decoder libs for MG4 (raster and LiDAR), MG3, MG2, JP2" homepage "https://www.lizardtech.com/developer/" url "file://#{HOMEBREW_CACHE}/MrSID_DSDK-9.5.1.4427-darwin14.universal.clang60.tar.gz", :using => CacheDownloadStrategy version "9.5.1.4427" sha256 "286843f4a22845835a06626327eed67216e403a54e17d8b10a675663d41b9829" revision 2 option "with-bindings", "Include Lidar Python and Ruby bindings" option "with-docs", "Intall documentation and examples for SDKs" # this is an odd one: only needs the share/gdal components depends_on "osgeo-gdal" => :build def install # first strip unnecessary installs rm_r "Raster_DSDK/3rd-party" # already part of gdal install if build.without? "docs" rm_r "examples" cd "Lidar_DSDK" do %w[doc examples].each { |f| rm_r f } end cd "Raster_DSDK" do %w[doc examples].each { |f| rm_r f } end end rm_r "Lidar_DSDK/contributions" if build.without? "bindings" prefix.install Dir["*"] lidar_dsdk = prefix/"Lidar_DSDK" raster_dsdk = prefix/"Raster_DSDK" libtbb_old_name = "@rpath/libtbb.dylib" libtbb_new_name = opt_libexec/"libtbb.dylib" # vendor to libexec possibly version-specific common supporting libs liblas_old_name = "/data/builds/buildbot/darwin14/darwin14/build/"\ "xt_lib_lastools/lib/darwin14.universal.clang60/"\ "Release/liblaslib.dylib" liblas_new_name = opt_libexec/"liblaslib.dylib" libgeos_c_old_name = "@rpath/libgeos_c.1.dylib" libgeos_c_new_name = opt_libexec/"libgeos_c.1.dylib" libgeos_old_name = "@rpath/libgeos.2.dylib" libgeos_new_name = opt_libexec/"libgeos.2.dylib" # install binary executables [lidar_dsdk, raster_dsdk].each { |f| bin.install Dir[f/"bin/*"] } # install headers include.install lidar_dsdk/"include/lidar" # Raster into subdirectory (some headers are too commonly named) (include/"mrsid").install Dir[raster_dsdk/"include/*"] # update libs cd lidar_dsdk/"lib" do # reset vendored lib ids set_install_name("liblaslib.dylib", opt_libexec) # reset install lib ids set_install_name("liblti_lidar_dsdk.1.dylib", opt_lib) # reset install lib names install_change("liblti_lidar_dsdk.1.dylib", libtbb_old_name, libtbb_new_name) # install vendored; libtbb.dylib installed with raster libs libexec.install "liblaslib.dylib" # install SDK lib lib.install Dir["liblti*"] end cd raster_dsdk/"lib" do # reset vendored lib ids %w[libgeos_c.1.dylib libgeos.2.dylib libtbb.dylib].each do |f| set_install_name(f, opt_libexec) end # reset install lib ids set_install_name("libltidsdk.dylib", opt_lib) # reset vendored lib names install_change("libgeos_c.1.dylib", libgeos_old_name, libgeos_new_name) # reset install lib names install_change("libltidsdk.dylib", libtbb_old_name, libtbb_new_name) # install vendored libexec.install "libtbb.dylib", Dir["libgeos*"] # install SDK lib lib.install Dir["liblti*"] end # cleanup rm_r lidar_dsdk/"lib" rm_r raster_dsdk/"lib" # update executables cd bin do Dir["*"].each do |exe| install_change(exe, libtbb_old_name, libtbb_new_name) install_change(exe, libgeos_c_old_name, libgeos_c_new_name) install_change(exe, liblas_old_name, liblas_new_name) end end end def install_change(dylib, old, new) if MachO::Tools.dylibs(dylib).include?(old) puts "install_change: from #{old} to #{new} in #{dylib}" if ARGV.debug? MachO::Tools.change_install_name(dylib.to_s, old.to_s, new.to_s, :strict => false) elsif ARGV.debug? puts "install_change: #{old} name not found in #{dylib}" end end def set_install_name(dylib, dir) puts "set_install_name to #{dir}/#{dylib}" if ARGV.debug? MachO::Tools.change_dylib_id(dylib.to_s, "#{dir}/#{dylib}", :strict => false) end def caveats; <<~EOS To build software with the Raster and LiDAR SDKs, add to the following environment variables to find the headers: CPPFLAGS: -I#{opt_prefix}/include/mrsid CPPFLAGS: -I#{opt_prefix}/include/lidar EOS end test do # end end ================================================ FILE: Formula/osgeo-muparserx.rb ================================================ class OsgeoMuparserx < Formula desc "the muparserx math parser library" homepage "http://articles.beltoforion.de/article.php?a=muparserx" url "https://github.com/beltoforion/muparserx/archive/v4.0.8.tar.gz" sha256 "5913e0a4ca29a097baad1b78a4674963bc7a06e39ff63df3c73fbad6fadb34e1" bottle do root_url "https://bottle.download.osgeo.org" cellar :any_skip_relocation sha256 "dc5c03f4beda885437d5a80aa3b582ec7dc24b3c3425f2e04cbb635e78c88e46" => :catalina sha256 "dc5c03f4beda885437d5a80aa3b582ec7dc24b3c3425f2e04cbb635e78c88e46" => :mojave sha256 "dc5c03f4beda885437d5a80aa3b582ec7dc24b3c3425f2e04cbb635e78c88e46" => :high_sierra end revision 1 head "https://github.com/beltoforion/muparserx.git", :branch => "master" depends_on "cmake" => :build def install args = std_cmake_args + %W[ -DBUILD_SHARED_LIBS=ON -DBUILD_EXAMPLES=OFF ] # args << "-DCMAKE_SKIP_RPATH=ON" mkdir "builddir" do system "cmake", "..", *std_cmake_args system "make", "install" end end test do # TODO end end ================================================ FILE: Formula/osgeo-netcdf.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_netcdf_linked } def core_netcdf_linked Formula["netcdf"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoNetcdf < Formula desc "Libraries and data formats for array-oriented scientific data" homepage "https://www.unidata.ucar.edu/software/netcdf" url "https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-c-4.7.4.tar.gz" mirror "https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-c-4.7.4.tar.gz" sha256 "0e476f00aeed95af8771ff2727b7a15b2de353fb7bb3074a0d340b55c2bd4ea8" # revision 1 bottle do root_url "https://bottle.download.osgeo.org" sha256 "57ab2d6562197db772ca5a21fbeb74f2a3e68a374771b536110387ae5ecb3383" => :catalina sha256 "57ab2d6562197db772ca5a21fbeb74f2a3e68a374771b536110387ae5ecb3383" => :mojave sha256 "57ab2d6562197db772ca5a21fbeb74f2a3e68a374771b536110387ae5ecb3383" => :high_sierra end # keg_only "netcdf is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "cmake" => :build depends_on "gcc" # for gfortran depends_on "hdf5" uses_from_macos "curl" resource "cxx" do url "https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx4-4.3.1.tar.gz" mirror "https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-cxx4-4.3.1.tar.gz" sha256 "6a1189a181eed043b5859e15d5c080c30d0e107406fbb212c8fb9814e90f3445" end resource "cxx-compat" do url "https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-cxx-4.2.tar.gz" mirror "https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-cxx-4.2.tar.gz" sha256 "95ed6ab49a0ee001255eac4e44aacb5ca4ea96ba850c08337a3e4c9a0872ccd1" end resource "fortran" do url "https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-fortran-4.5.2.tar.gz" mirror "https://www.gfd-dennou.org/arch/netcdf/unidata-mirror/netcdf-fortran-4.5.2.tar.gz" sha256 "b959937d7d9045184e9d2040a915d94a7f4d0185f4a9dceb8f08c94b0c3304aa" end def install ENV.deparallelize common_args = std_cmake_args << "-DBUILD_TESTING=OFF" mkdir "build" do args = common_args.dup args << "-DNC_EXTRA_DEPS=-lmpi" if Tab.for_name("hdf5").with? "mpi" args << "-DENABLE_TESTS=OFF" << "-DENABLE_NETCDF_4=ON" << "-DENABLE_DOXYGEN=OFF" system "cmake", "..", "-DBUILD_SHARED_LIBS=ON", *args system "make", "install" system "make", "clean" system "cmake", "..", "-DBUILD_SHARED_LIBS=OFF", *args system "make" lib.install "liblib/libnetcdf.a" end # Add newly created installation to paths so that binding libraries can # find the core libs. args = common_args.dup << "-DNETCDF_C_LIBRARY=#{lib}/libnetcdf.dylib" cxx_args = args.dup cxx_args << "-DNCXX_ENABLE_TESTS=OFF" resource("cxx").stage do mkdir "build-cxx" do system "cmake", "..", "-DBUILD_SHARED_LIBS=ON", *cxx_args system "make", "install" system "make", "clean" system "cmake", "..", "-DBUILD_SHARED_LIBS=OFF", *cxx_args system "make" lib.install "cxx4/libnetcdf-cxx4.a" end end fortran_args = args.dup fortran_args << "-DENABLE_TESTS=OFF" resource("fortran").stage do mkdir "build-fortran" do system "cmake", "..", "-DBUILD_SHARED_LIBS=ON", *fortran_args system "make", "install" system "make", "clean" system "cmake", "..", "-DBUILD_SHARED_LIBS=OFF", *fortran_args system "make" lib.install "fortran/libnetcdff.a" end end ENV.prepend "CPPFLAGS", "-I#{include}" ENV.prepend "LDFLAGS", "-L#{lib}" resource("cxx-compat").stage do system "./configure", "--disable-dependency-tracking", "--enable-shared", "--enable-static", "--prefix=#{prefix}" system "make" system "make", "install" end # SIP causes system Python not to play nicely with @rpath libnetcdf = (lib/"libnetcdf.dylib").readlink %w[libnetcdf-cxx4.dylib libnetcdf_c++.dylib].each do |f| macho = MachO.open("#{lib}/#{f}") macho.change_dylib("@rpath/#{libnetcdf}", "#{lib}/#{libnetcdf}") macho.write! end end test do (testpath/"test.c").write <<~EOS #include #include "netcdf_meta.h" int main() { printf(NC_VERSION); return 0; } EOS system ENV.cc, "test.c", "-L#{lib}", "-I#{include}", "-lnetcdf", "-o", "test" if head? assert_match /^\d+(?:\.\d+)+/, `./test` else assert_equal version.to_s, `./test` end (testpath/"test.f90").write <<~EOS program test use netcdf integer :: ncid, varid, dimids(2) integer :: dat(2,2) = reshape([1, 2, 3, 4], [2, 2]) call check( nf90_create("test.nc", NF90_CLOBBER, ncid) ) call check( nf90_def_dim(ncid, "x", 2, dimids(2)) ) call check( nf90_def_dim(ncid, "y", 2, dimids(1)) ) call check( nf90_def_var(ncid, "data", NF90_INT, dimids, varid) ) call check( nf90_enddef(ncid) ) call check( nf90_put_var(ncid, varid, dat) ) call check( nf90_close(ncid) ) contains subroutine check(status) integer, intent(in) :: status if (status /= nf90_noerr) call abort end subroutine check end program test EOS system "gfortran", "test.f90", "-L#{lib}", "-I#{include}", "-lnetcdff", "-o", "testf" system "./testf" end end ================================================ FILE: Formula/osgeo-nitro.rb ================================================ class OsgeoNitro < Formula desc "Library reading/writing the National Imagery Transmission Format (NITF)." homepage "https://github.com/hobu/nitro" url "https://github.com/hobu/nitro/archive/2.7dev-5.tar.gz" version "2.7dev-5" sha256 "836433f8937e1598310d53f285c79784c63bd54677e8973b276c4ce9f5251b94" revision 1 head "https://github.com/hobu/nitro.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "2cfb9d67e88078462f73c812e7bdf66ea02d20349b6fd2ebf2af132a7346a60c" => :mojave sha256 "2cfb9d67e88078462f73c812e7bdf66ea02d20349b6fd2ebf2af132a7346a60c" => :high_sierra sha256 "5cc9c36fae4c7d1310cf74aed0d02e8e950884a37aba5c9d4e072623199d73d3" => :sierra end depends_on "cmake" => :build depends_on "llvm" => :build def install mkdir "build" do system "cmake", "..", *std_cmake_args system "make" system "make", "install" end end test do # installs just a lib end end ================================================ FILE: Formula/osgeo-ogdi.rb ================================================ class OsgeoOgdi < Formula desc "Open Geographic Datastore Interface - client/server API for GIS" homepage "https://ogdi.sourceforge.io/" url "https://github.com/libogdi/ogdi/archive/ogdi_4_1_0.tar.gz" sha256 "e0b9c6ca37f983f21b45116126d153c0b5609954568fddc306568e204a10e41c" revision 3 head "https://github.com/libogdi/ogdi.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "ababf3d3d5a8cd1e511352707ccae78de4adb5cd16cdd6a85e1239d187b2c49d" => :catalina sha256 "ababf3d3d5a8cd1e511352707ccae78de4adb5cd16cdd6a85e1239d187b2c49d" => :mojave sha256 "ababf3d3d5a8cd1e511352707ccae78de4adb5cd16cdd6a85e1239d187b2c49d" => :high_sierra end # depends_on "autoconf" => :build # depends_on "automake" => :build # depends_on "libtool" => :build depends_on "osgeo-proj" depends_on "zlib" depends_on "expat" # resource "ogdits-suite" do # url "https://downloads.sourceforge.net/project/ogdi/OGDI_Test_Suite/3.1/ogdits-3.1.0.tar.gz" # sha256 "55fcf3793ce80858cb02a94d78c7a95990e12197404bfd2178c0100a4f79f4a3" # end def install # --with-proj=ARG Utilize external PROJ.4 support # --with-projlib=path Select PROJ.4 library # --with-projinc=path Select PROJ.4 include directory # --with-zlib=ARG Utilize external ZLIB support # --with-zliblib=path Select ZLIB library # --with-zlibinc=path Select ZLIB include directory # --with-expat=ARG Utilize external Expat library, or disable Expat. # --with-expatlib=path Select Expat library # --with-expatinc=path Select Expat include directory # --with-pkgconfigdir Use the specified pkgconfig dir (default is # libdir/pkgconfig) args = %W[ --prefix=#{prefix} --with-proj=#{Formula["osgeo-proj"].opt_prefix} --with-zlib=#{Formula["zlib"].opt_prefix} --with-expat=#{Formula["expat"].opt_prefix} --with-zlib=#{Formula["zlib"].opt_prefix} ] # Reset ARCHFLAGS to match how we build. # ENV["ARCHFLAGS"] = "-arch #{MacOS.preferred_arch}" ENV.deparallelize ENV["TOPDIR"] = Dir.pwd # FIXME: ./configure fails on ogdi test compilation due to missing rpc/types.h include # use: https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Present-But-Cannot-Be-Compiled.html # then, run autoconf # see below fixes for rpc/types.h (does the same for ./configure) # rename overridden rules, to avoid copius warnings inreplace "#{Dir.pwd}/config/unix.mak" do |s| s.sub! /ARCHGEN/, "BLAH_\\1" s.sub! /DYNAGEN/, "BLAH_\\1" end # rename included makefile, otherwise overwritten by `uname`.mak output cp "#{Dir.pwd}/config/darwin.mak", "#{Dir.pwd}/config/macos.mak" # force overwriting of default makefile to macOS-specific inreplace "#{Dir.pwd}/config/generic.mak.in", "unix.mak", "macos.mak" # stub 'bool' typedef reassignment, otherwise get following error... # # ../rpf.h:77:24: error: cannot combine with previous 'char' declaration specifier # typedef unsigned char bool; # ^ # lib/clang/8.0.0/include/stdbool.h:31:14: note: expanded from macro 'bool' # #define bool _Bool # inreplace "#{Dir.pwd}/ogdi/driver/rpf/rpf.h" do |s| s.sub! /(typedef unsigned char +bool;)/, "// \\1" end # add rpc/types.h prior to other rpc includes that are missing it natively # note: referenced rpc headers are in /usr/include/, so can't "fix" them due to SIP inreplace "#{Dir.pwd}/ogdi/gltpd/asyncsvr.c" do |s| s.sub! %r{(#( +)include )}, "#\\2include \n\\1" end inreplace "#{Dir.pwd}/include/Linux/ogdi_macro.h" do |s| s.sub! "", "" s.sub! %r{(#include )}, "#include \n\\1" end ENV.append_to_cflags "-I#{Dir.pwd}/include/Linux" # FIXME: .dylibs need built for macOS # .dylib files are not versioned, with unversioned symlinks pointing to them # .dylib files have no compatibility or current version embedded # raise # system "autoreconf", "-fvi" system "./configure", *args system "make" system "make", "install" # TODO: fix up for test suite: # 'ogdi_info'; use install_name_tool to add rpath to opt_lib/ogdi (OR, link all .dylibs directly?) # create symlinks from .so to .dylib files # (ogdi_info and libs dynamically finds only .so files) Pathname.glob("#{lib}/ogdi/*.dylib") do |dl| (lib/"ogdi").install_symlink dl.basename => "#{dl.basename(".dylib")}.so" end # FIXME: ogdi_info crashes with: # ogdi_info(52269,0x...) malloc: *** error for object 0x...: pointer being freed was not allocated # something needds changed in its src code # NOTE: GDAL/OGR driver still seems to work, just not this ogdi_info utility end test do # resource("ogdits-suite").stage do # # TODO: customize setup.sh # # add: TEST_DATA=$(dirname $(pwd -P))/data # # cd "scripts" do # system "full_test.sh" # end # end end end ================================================ FILE: Formula/osgeo-opencollada.rb ================================================ class OsgeoOpencollada < Formula desc "Stream based reader and writer library for COLLADA files" homepage "http://www.opencollada.org" url "https://github.com/KhronosGroup/OpenCOLLADA/archive/v1.6.68.tar.gz" sha256 "d9db0c0a518aa6ac0359626f222707c6ca1b63a83cbf229d97a5999c9cde347b" revision 3 head "https://github.com/KhronosGroup/OpenCOLLADA.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "7a4c9941364bfb7b76d0162356740be685797317c2d3b02cd4975f8167b0e57d" => :catalina sha256 "7a4c9941364bfb7b76d0162356740be685797317c2d3b02cd4975f8167b0e57d" => :mojave sha256 "7a4c9941364bfb7b76d0162356740be685797317c2d3b02cd4975f8167b0e57d" => :high_sierra end depends_on "cmake" => :build #unless OS.mac? depends_on "libxml2" depends_on "pcre" # end depends_on :xcode => :build # fixed PCRE usage patch do url "https://patch-diff.githubusercontent.com/raw/KhronosGroup/OpenCOLLADA/pull/615.diff" sha256 "cf45702543aaabb443111781285f95db95b2fbda71f56458dafc73387ebab78b" end # detecting isnan patch do url "https://patch-diff.githubusercontent.com/raw/KhronosGroup/OpenCOLLADA/pull/576.diff" sha256 "346eb47bf4f0d77284a59b566cba8d9edd97c2a89cac1da71f7c272bd5c40b8c" end # use C++ Headers for C++ Files patch do url "https://patch-diff.githubusercontent.com/raw/KhronosGroup/OpenCOLLADA/pull/614.diff" sha256 "3ec9f8331c1f046e95b8a81585065804c537ea2bf0a37d4011dfa919243f8830" end def install args = std_cmake_args args << "-DUSE_LIBXML=ON" args << "-DUSE_STATIC=OFF" args << "-DUSE_SHARED=ON" # args << "USE_EXPAT=OFF" # Use expat parser. Unsupported currently. Do not use. # args << "-DWITH_IN_SOURCE_BUILD=ON" mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" prefix.install "bin" Dir.glob("#{bin}/*.xsd") { |p| rm p } end end test do # system "#{bin}/OpenCOLLADAValidator" end end ================================================ FILE: Formula/osgeo-openscenegraph.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !osgeo_openscenegraph_linked && !core_openscenegraph_linked } def osgeo_openscenegraph_linked Formula["osgeo-openscenegraph@3.4"].linked_keg.exist? rescue return false end def core_openscenegraph_linked Formula["open-scene-graph"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 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 s end end class OsgeoOpenscenegraph < Formula desc "High performance 3D graphics toolkit" homepage "http://www.openscenegraph.org/" url "https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-3.6.5.tar.gz" sha256 "aea196550f02974d6d09291c5d83b51ca6a03b3767e234a8c0e21322927d1e12" revision 1 head "https://github.com/openscenegraph/OpenSceneGraph.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" sha256 "dc93f928689f846af65943a1a62b1381528c9429e05f8a43489a589aceddfd3f" => :catalina sha256 "dc93f928689f846af65943a1a62b1381528c9429e05f8a43489a589aceddfd3f" => :mojave sha256 "dc93f928689f846af65943a1a62b1381528c9429e05f8a43489a589aceddfd3f" => :high_sierra end # keg_only # we will verify that other versions are not linked depends_on Unlinked depends_on "cmake" => :build depends_on "doxygen" => :build depends_on "graphviz" => :build depends_on "pkg-config" => :build depends_on "boost" depends_on "curl" depends_on "dcmtk" depends_on "ffmpeg" depends_on "freetype" depends_on "giflib" depends_on "gnuplot" depends_on "gtkglext" depends_on "jasper" # depends_on "jpeg" depends_on "jpeg-turbo" depends_on "librsvg" depends_on "libtiff" depends_on "mesa" depends_on "openexr" depends_on "perl" depends_on "poppler" depends_on "pth" depends_on "qt" depends_on "sdl" depends_on "wget" depends_on "zlib" depends_on "libxml2" depends_on "cairo" depends_on "gtk+" depends_on "osgeo-gdal" depends_on "osgeo-opencollada" depends_on "ilmbase" depends_on "v8" depends_on "llvm" depends_on "gstreamer" depends_on :x11 # https://gentoobrowse.randomdan.homeip.net/packages/dev-games/openscenegraph # https://bugs.gentoo.org/698866 # depends_on "asio" # patch necessary to ensure support for gtkglext-quartz # filed as an issue to the developers https://github.com/openscenegraph/osg/issues/34 patch :DATA def install # Fix "fatal error: 'os/availability.h' file not found" on 10.11 and # "error: expected function body after function declarator" on 10.12 if MacOS.version == :sierra || MacOS.version == :el_capitan ENV["SDKROOT"] = MacOS.sdk_path end ENV.cxx11 ENV.append "CXXFLAGS", "-std=c++11" args = std_cmake_args args << "-DCMAKE_PREFIX_PATH=#{Formula["qt"].opt_lib}/cmake" args << "-DCMAKE_CXX_FLAGS=-Wno-error=narrowing" args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}" args << "-DEGL_LIBRARY=#{Formula["mesa"].opt_lib}" args << "-DEGL_INCLUDE_DIR=#{Formula["mesa"].opt_include}/GLES/egl.h" # http://www.openscenegraph.org/index.php/community/maintainers-corner/packaging-openscenegraph args << "-DBUILD_DOCUMENTATION=ON" # disable unwanted optional dependencies to avoid opportunistic configuration # TODO: add some of these back either directly or as variants after testing args << "-DCMAKE_DISABLE_FIND_PACKAGE_GTA=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_Inventor=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_COLLADA=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_FBX=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_OpenVRML=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_LibVNCServer=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_SDL2=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_SDL=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_GtkGl=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_DirectInput=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_NVTT=1" args << "-DCMAKE_DISABLE_FIND_PACKAGE_Asio=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_ZeroConf=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_OpenCascade=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_LIBLAS=1" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_cairo=ON" # not used by the project # args << "-DCMAKE_DISABLE_FIND_PACKAGE_FFmpeg=ON" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_GDAL=ON" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_TIFF=ON" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_Jasper=ON" # args << "-DCMAKE_DISABLE_FIND_PACKAGE_OpenEXR=ON" args << "-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio" args << "-DOSG_WINDOWING_SYSTEM=Cocoa" args << "-DOSG_CONFIG_HAS_BEEN_RUN_BEFORE=YES" mkdir "build" do system "cmake", "..", *args system "make" system "make", "doc_openscenegraph" system "make", "install" doc.install Dir["#{prefix}/doc/OpenSceneGraphReferenceDocs/*"] end end test do (testpath/"test.cpp").write <<~EOS #include #include using namespace std; int main() { cout << osgGetVersion() << endl; return 0; } EOS system ENV.cxx, "test.cpp", "-I#{include}", "-L#{lib}", "-losg", "-o", "test" assert_equal `./test`.chomp, version.to_s end end __END__ --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1021,7 +1021,7 @@ #C4706 assignment within conditional expression #C4589: Constructor of abstract class 'osgGA::CameraManipulator' ignores initializer for virtual base class 'osg::Object' SET(OSG_AGGRESSIVE_WARNING_FLAGS /W4 /wd4589 /wd4706 /wd4127 /wd4100) -ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +ELSEIF(CMAKE_CXX_COMPILER_ID MATCHES "Clang") SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -Wno-overloaded-virtual) # CMake lacks an elseif, so other non-gcc, non-VS compilers need @@ -1032,25 +1032,17 @@ SET(OSG_CXX_LANGUAGE_STANDARD "C++11" CACHE STRING "set the c++ language standard (C++98 / GNU++98 / C++11) for OSG" ) MARK_AS_ADVANCED(OSG_CXX_LANGUAGE_STANDARD) # remove existing flags - REMOVE_CXX_FLAG(-std=c++98) - REMOVE_CXX_FLAG(-std=gnu++98) - REMOVE_CXX_FLAG(-std=c++11) - REMOVE_CXX_FLAG(-stdlib=libstdc++) - REMOVE_CXX_FLAG(-stdlib=libc++) IF(${OSG_CXX_LANGUAGE_STANDARD} STREQUAL "c++98" OR ${OSG_CXX_LANGUAGE_STANDARD} STREQUAL "C++98") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++98") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -stdlib=libstdc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") ELSE() IF(${OSG_CXX_LANGUAGE_STANDARD} STREQUAL "gnu++98" OR ${OSG_CXX_LANGUAGE_STANDARD} STREQUAL "GNU++98") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "gnu++98") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98 -stdlib=libstdc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98") ELSE() set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") ENDIF() ENDIF() --- a/CMakeModules/FindGtkGl.cmake +++ b/CMakeModules/FindGtkGl.cmake @@ -10,7 +10,7 @@ IF(PKG_CONFIG_FOUND) IF(WIN32) PKG_CHECK_MODULES(GTKGL gtkglext-win32-1.0) ELSE() - PKG_CHECK_MODULES(GTKGL gtkglext-x11-1.0) + PKG_CHECK_MODULES(GTKGL gtkglext-quartz-1.0) ENDIF() ENDIF() ================================================ FILE: Formula/osgeo-oracle-client-sdk.rb ================================================ require File.expand_path("../../Strategies/cache-download", Pathname.new(__FILE__).realpath) class OsgeoOracleClientSdk < Formula desc "Oracle database C/C++ client libs, command-line tools and SDK" homepage "https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html" url "https://osgeo4mac.s3.amazonaws.com/src/dummy.tar.gz" version (MacOS.version < :el_capitan) ? "12.1.0.2.0-2" : "12.2.0.1.0-2" sha256 "e7776e2ff278d6460300bd69a26d7383e6c5e2fbeb17ff12998255e7fc4c9511" # revision 1 option "with-basic", "Install Oracle's Basic client, instead of Basic Lite" resource "basic" do if MacOS.version < :el_capitan url "file://#{HOMEBREW_CACHE}/instantclient-basic-macos.x64-12.1.0.2.0.zip", :using => CacheDownloadStrategy sha256 "71aa366c961166fb070eb6ee9e5905358c61d5ede9dffd5fb073301d32cbd20c" version "12.1.0.2.0-2" else url "file://#{HOMEBREW_CACHE}/instantclient-basic-macos.x64-12.2.0.1.0-2.zip", :using => CacheDownloadStrategy sha256 "04a84542b5bd0a04bc45445e220a67c959a8826ce987000270705f9a1d553157" end end resource "basic-lite" do if MacOS.version < :el_capitan url "file://#{HOMEBREW_CACHE}/instantclient-basiclite-macos.x64-12.1.0.2.0.zip", :using => CacheDownloadStrategy sha256 "c39d498fa6eb08d46014283a3a79bcaf63060cdbd0f58f97322da012350d4c39" version "12.1.0.2.0-2" else url "file://#{HOMEBREW_CACHE}/instantclient-basiclite-macos.x64-12.2.0.1.0-2.zip", :using => CacheDownloadStrategy sha256 "2997f753b61f8b445a241e99412c132feb76cf246dcca2e7837fe82b15c1efb8" end end resource "sdk" do if MacOS.version < :el_capitan url "file://#{HOMEBREW_CACHE}/instantclient-sdk-macos.x64-12.1.0.2.0.zip", :using => CacheDownloadStrategy sha256 "950153e53e1c163c51ef34eb8eb9b60b7f0da21120a86f7070c0baff44ef4ab9" version "12.1.0.2.0-2" else url "file://#{HOMEBREW_CACHE}/instantclient-sdk-macos.x64-12.2.0.1.0-2.zip", :using => CacheDownloadStrategy sha256 "e0befca9c4e71ebc9f444957ffa70f01aeeec5976ea27c40406471b04c34848b" end end resource "sqlplus" do if MacOS.version < :el_capitan url "file://#{HOMEBREW_CACHE}/instantclient-sqlplus-macos.x64-12.1.0.2.0.zip", :using => CacheDownloadStrategy sha256 "a663937e2e32c237bb03df1bda835f2a29bc311683087f2d82eac3a8ea569f81" version "12.1.0.2.0-2" else url "file://#{HOMEBREW_CACHE}/instantclient-sqlplus-macos.x64-12.2.0.1.0-2.zip", :using => CacheDownloadStrategy sha256 "d147cbb5b2a954fdcb4b642df4f0bd1153fd56e0f56e7fa301601b4f7e2abe0e" end end def fixup_rpaths(mach_bins) # mach_bins as [Pathname] mach_bins.each do |m| m = Pathname.new(m) if m.is_a?(String) next if m.symlink? m.ensure_writable do MachO::Tools.add_rpath(m.to_s, opt_lib.to_s, :strict => false) # will only affect dylibs MachO::Tools.change_dylib_id(m.to_s, (opt_lib/m.basename).to_s) end end end def oracle_env_vars { :ORACLE_HOME => opt_prefix, :OCI_LIB => opt_lib, :TNS_ADMIN => opt_prefix/"network/admin", } end def install resource(build.with?("basic") ? "basic" : "basic-lite").stage do oracle_exes = %w[adrci genezi uidrvci] ver_split = version.to_s.split(".") maj_ver = ver_split[0] min_ver = ver_split[1] # fix permissions chmod 0644, Dir["*"] chmod 0755, oracle_exes # fixup lib naming to macOS style with some symlinks if MacOS.version < :el_capitan %w[libclntsh libclntshcore libocci].each do |f| ln_sf "#{f}.dylib.#{maj_ver}.#{min_ver}", "#{f}.dylib" end end # install fixed-up libs and exes lib.install Dir["*.dylib*"] bin.install oracle_exes end # install headers in a logical subdirectory (since some are too generally named) resource("sdk").stage do cd "sdk" do Dir["**/*", "."].each do |f| chmod (File.directory?(f.to_s) ? 0755 : 0644), f end (include/"oci").install Dir["include/*"] rmdir "include" ln_sf "../include", "./" end prefix.install "sdk" end resource("sqlplus").stage do # fix permissions chmod 0644, Dir["*"] chmod 0755, "sqlplus" lib.install Dir["*.dylib"] bin.install "sqlplus" # Site Profile goes in $ORACLE_HOME/sqlplus/admin/glogin.sql (prefix/"sqlplus/admin").install "glogin.sql" end # fixup @rpath locations # update install names to opt_prefix (probably done by Homebrew as well) fixup_rpaths Dir[lib/"lib*", bin/"*"] # make any extra client paths (prefix/"network/admin").mkpath # wrap cmd line tools with Oracle env vars envvars = oracle_env_vars envvars[:NLS_LANG] = "AMERICAN_AMERICA.UTF8" if build.without? "basic" bin.env_script_all_files(libexec/"bin", envvars) end def caveats s = <<~EOS To build software with the Instant Client SDK, add to the following environment variable to find headers: [CFLAGS|CPPFLAGS]: -I#{opt_include}/oci Executables are wrapped with environ: EOS envvars = oracle_env_vars envvars[:NLS_LANG] = "AMERICAN_AMERICA.UTF8" if build.without? "basic" envvars.each { |k, v| s += " #{k}=#{v}\n" } s += "\n" end test do # From GDAL 2.1.2's configure test (testpath/"test.cpp").write <<~EOS #include int main () { OCIEnv* envh = 0; OCIEnvCreate(&envh, OCI_DEFAULT, 0, 0, 0, 0, 0, 0); if (envh) OCIHandleFree(envh, OCI_HTYPE_ENV); return 0; } EOS system ENV.cxx, "test.cpp", "-I#{opt_include}/oci", "-L#{opt_lib}", "-lclntsh", "-o", "test" system "./test" end end ================================================ FILE: Formula/osgeo-orfeo.rb ================================================ class OsgeoOrfeo < Formula desc "Library of image processing algorithms" homepage "https://www.orfeo-toolbox.org/otb" url "https://github.com/orfeotoolbox/OTB/archive/7.0.0.tar.gz" sha256 "cd81a538cda6420e06a921bb575f5c25e204f9c382aac23e161d91e583aaf22a" revision 2 bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "b2d8e36b3f822fbfc8b7036bed3e6e0db9df8dbeb1630f287b1cce828b7fd7fc" => :catalina sha256 "b2d8e36b3f822fbfc8b7036bed3e6e0db9df8dbeb1630f287b1cce828b7fd7fc" => :mojave sha256 "b2d8e36b3f822fbfc8b7036bed3e6e0db9df8dbeb1630f287b1cce828b7fd7fc" => :high_sierra end head "https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb.git", :branch => "master" # Errors found when using ITK 5 # https://github.com/InsightSoftwareConsortium/ITKNeuralNetworks/issues/13 # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/merge_requests/194 ################### # CMake Error at /usr/local/opt/osgeo-insighttoolkit/lib/cmake/ITK-5.0/ITKModuleAPI.cmake #  No such module: "ITKNeuralNetworks" # Modules/ThirdParty/ITK/otb-module-init.cmake # CMake/OTBModuleEnablement.cmake # CMakeLists.txt ################### # /Modules/Core/Common/src/otbConfigurationManager.cxx: fatal error: 'itkMultiThreader.h' file not found # /Modules/Core/Metadata/src/otbImageMetadataInterfaceFactory.cxx: fatal error: 'itkMutexLock.h' file not found # Modules/Core/Metadata/src/otbImageMetadataInterfaceFactory.cxx: fatal error: 'ITKDeprecatedExport.h' file not found ################### # MPIConfig::Pointer MPIConfig::m_Singleton = NULL; # /usr/local/include/ITK-5.0/itkSmartPointer.h: note: candidate constructor # constexpr SmartPointer (std::nullptr_t p) noexcept # /usr/local/include/ITK-5.0/itkSmartPointer.h: note: candidate constructor # SmartPointer (ObjectType *p) noexcept # otbenv.profile patch :DATA option "without-monteverdi", "Build without Monteverdi and Mapla applications (Qt required)" option "without-python", "Build without Python support" option "with-patented", "Build with Patented Examples" option "with-examples", "Compile and install various examples" option "with-mpi", "Build with Open MPI, a High Performance Message Passing Library" # option "with-mapnik", "Build with Mapnik, toolkit for developing mapping applications" # option "with-shark", "Build with Machine learning library" # option "with-openjpeg", "Build with OpenJPEG, an open source JPEG 2000 codec" depends_on "cmake" => :build depends_on "boost" depends_on "pkg-config" depends_on "libpng" depends_on "pcre" depends_on "openssl" depends_on "sqlite" depends_on "tinyxml" depends_on "zlib" depends_on "expat" depends_on "gsl" depends_on "curl" depends_on "icu4c" depends_on "freetype" depends_on "perl" depends_on "libtool" # libltdl depends_on "jpeg" depends_on "libtiff" depends_on "geos" depends_on "openjpeg" depends_on "hdf5" depends_on "opencv@2" depends_on "python" depends_on "swig" depends_on "numpy" depends_on "fftw" # restricts built binaries to GPL license depends_on "libsvm" => :recommended depends_on "minizip" => :recommended depends_on "muparser" => :recommended depends_on "osgeo-libgeotiff" depends_on "osgeo-proj" depends_on "osgeo-hdf4" depends_on "osgeo-netcdf" depends_on "osgeo-muparserx" => :recommended depends_on "osgeo-libkml" => :recommended depends_on "osgeo-vtk" depends_on "osgeo-ossim" # depends_on "osgeo-insighttoolkit" depends_on "osgeo-insighttoolkit@4" depends_on "osgeo-openscenegraph" # (for libOpenThreads, now internal to osg) # ICE Viewer: needs X11 support # apparently, GLUT is not needed by Monteverdi, which uses ICE non-gui module, # but is needed for the ICE Viewer depends_on "freeglut" # Monteverdi: required deps and required/optionals shared with OTB depends_on "osgeo-gdal" depends_on "glew" depends_on "glfw" depends_on "qt" depends_on "qwt" # Need libagg if building mapnik # if build.with? "mapnik" # depends_on "osgeo-mapnik" # depends_on "libagg" # end # if build.with? "shark" # depends_on "osgeo-shark" # end depends_on "open-mpi" if build.with? "mpi" resource "geoid" do # geoid to use in elevation calculations, if no DEM defined or avialable url "https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-data/raw/master/Input/DEM/egm96.grd" sha256 "2babe341e8e04db11447e823ac0dfe4b17f37fd24c7966bb6aeab85a30d9a733" version "5.0.0" end # resource "GKSVM" do # url "https://github.com/jmichel-otb/GKSVM.git", # :branch => "master", # :commit => "553dc8e40ab1538c46de6596ec323627dac5fea5" # version "0.0.1" # end def install ENV.cxx11 # Module for monteverdi build # if build.with? "monteverdi" # (buildpath/"Modules/Remote").install resource("GKSVM") # end (libexec/"default_geoid").install resource("geoid") args = std_cmake_args + %W[ -DOTB_BUILD_DEFAULT_MODULES=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_MACOSX_RPATH=OFF -DCMAKE_CXX_STANDARD=11 -DQWT_LIBRARY=#{Formula["qwt"].lib}/qwt.framework -DQWT_INCLUDE_DIR=#{Formula["qwt"].lib}/qwt.framework/Headers -DOTB_USE_GSL=ON ] # fix error: no member named 'createRpcProjection' in 'ossimRpcSolver' # args << "-DOSSIM_VERSION=#{Formula["osgeo-ossim"].version}" args << "-DOSSIM_LIBRARY=#{Formula["osgeo-ossim"].opt_prefix}/Frameworks/ossim.framework" args << "-DOSSIM_INCLUDE_DIR=#{Formula["osgeo-ossim"].opt_include}" # args << "-DOSSIM_INCLUDE_DIR=#{Formula["osgeo-ossim"].opt_prefix}/Frameworks/ossim.framework/Headers" # find_path( OSSIM_INCLUDE_DIR NAMES ossim/init/ossimInit.h ) # Simple Parallel Tiff Writer # args << "-DOTB_USE_SPTW=OFF" # Option to activate deprecated classes # Turn on the use and test of deprecated classes # args << "-DOTB_USE_DEPRECATED=OFF" # Add openmp compiler and linker flags # args << "-DOTB_USE_OPENMP=OFF" # Enable SIMD optimizations (hardware dependent) # args << "-DOTB_USE_SSE_FLAGS=ON" # Enable module 6S # args << "-DOTB_USE_6S=ON" # Enable module Curl # args << "-DOTB_USE_CURL=ON" # Build with static libraries # args << "-DBUILD_STATIC_LIBS=OFF" # Build with specific list of remote modules # args << "-DWITH_REMOTE_MODULES=OFF" # -DCMAKE_CXX_FLAGS="$CXXFLAGS -fPIC" # -DCMAKE_C_FLAGS="$CFLAGS -fPIC" args << "-DOTB_DATA_USE_LARGEINPUT=ON" args << "-DOPENTHREADS_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libOpenThreads.dylib" args << "-DOPENTHREADS_INCLUDE_DIR=#{Formula["osgeo-openscenegraph"].opt_include}" args << "-DOTB_WRAP_JAVA=ON" # python args << "-DOTB_WRAP_PYTHON=OFF" if build.without? "python" args << "-DOTB_WRAP_PYTHON=ON" args << "-DPYTHON_EXECUTABLE=#{HOMEBREW_PREFIX}/opt/python/bin/python3" py_ver= `#{HOMEBREW_PREFIX}/opt/python/bin/python3 -c 'import sys;print("{0}.{1}".format(sys.version_info[0],sys.version_info[1]))'`.strip args << "-DPYTHON_LIBRARY=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/lib/libpython#{py_ver}m.dylib" args << "-DPYTHON_LIBRARY_RELEASE=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/lib/libpython#{py_ver}m.dylib" # args << "-DPYTHON3_LIBRARY_DEBUG=" args << "-DPYTHON_INCLUDE_DIR=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/include/python#{py_ver}m" # args << "-DNUMPY_PYTHON3_INCLUDE_DIR=" args << "-DOTB_INSTALL_PYTHON_DIR=#{lib}/python#{py_ver}/site-packages/otb" args << "-DNUMPY_INCLUDE_DIR=#{Formula["numpy"].opt_lib}/python#{py_ver}/site-packages/numpy/core/include" # numpy/arrayobject.h args << "-DITK_DIR=#{Formula["cmake"].share}/cmake/Modules" # iceviewer fg = Formula["freeglut"] args << "-DGLUT_INCLUDE_DIR=#{fg.opt_include}" args << "-DGLUT_glut_LIBRARY=#{fg.opt_lib}/libglut.dylib" args << "-DOTB_USE_OPENCV=ON" args << "-Dopencv_INCLUDE_DIR=#{Formula['opencv@2'].include}" args << "-DOPENCV_core_LIBRARY=#{Formula['opencv@2'].lib}/libopencv_core.dylib" args << "-DBUILD_EXAMPLES=" + (build.with?("examples") ? "ON" : "OFF") args << "-DITK_USE_FFTWF=ON" args << "-DITK_USE_FFTWD=ON" args << "-DITK_USE_SYSTEM_FFTW=ON" args << "-DOTB_USE_CURL=ON" args << "-DOTB_USE_GLEW=ON" args << "-DOTB_USE_GLFW=ON" args << "-DOTB_USE_GLUT=ON" args << "-DOTB_USE_LIBKML=ON" args << "-DOTB_USE_LIBSVM=ON" args << "-DOTB_USE_MPI=ON" args << "-DOTB_USE_QT=ON" args << "-DOTB_USE_QWT=ON" args << "-DOTB_USE_SIFTFAST=ON" args << "-DOTB_USE_MUPARSER=ON" args << "-DOTB_USE_MUPARSERX=ON" # if build.with? "mapnik" # args << "-DOTB_USE_MAPNIK=ON" # args << "-DMAPNIK_LIBRARY=#{Formula["osgeo-mapnik"].opt_lib}/libmapnik.dylib" # args << "-DMAPNIK_INCLUDE_DIR=#{Formula["osgeo-mapnik"].opt_include}/mapnik" # args << "-DAGG_INCLUDE_DIR=#{Formula['libagg'].include}" # end # if build.with? "shark" # args << "-DOTB_USE_SHARK=ON" # end args << "-DOTB_USE_OPENGL=ON" args << "-DOPENGL_INCLUDE_DIR=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers" # args << "-DOTB_USE_PATENTED=" + (build.with?("patented") ? "ON" : "OFF") # not used by the project # args << "-DOTB_USE_OPENJPEG=" + (build.with?("openjpeg") ? "ON" : "OFF") # not used by the project mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end # A script to initialize the environment for OTB executables cp_r "#{buildpath}/Packaging/Files/otbenv.profile", "#{prefix}" # clean up any unneeded otbgui script wrappers rm_f Dir["#{bin}/otbgui*"] unless (bin/"otbgui").exist? # make env-wrapped command line utility launcher scripts envars = { :GDAL_DATA => "#{Formula["osgeo-gdal"].opt_share}/gdal", :OTB_APPLICATION_PATH => "#{opt_lib}/otb/applications", :OTB_FOLDER => "#{opt_prefix}", :OTB_GEOID_FILE => "#{opt_libexec}/default_geoid/egm96.grd", } bin.env_script_all_files(libexec/"bin", envars) end def caveats; <<~EOS The default geoid to use in elevation calculations is available in: #{opt_libexec}/default_geoid/egm96.grd EOS end test do puts "Testing CLI wrapper" out = `#{opt_bin}/otbcli 2>&1` assert_match "module_name [MODULEPATH] [arguments]", out puts "Testing Rescale CLI app" out = `#{opt_bin}/otbcli_Rescale 2>&1` assert_match "Rescale the image between two given values", out if (opt_bin/"otbgui").exist? puts "Testing Qt GUI wrapper" out = `#{opt_bin}/otbgui 2>&1` assert_match "module_name [module_path]", out end end end __END__ --- a/Packaging/Files/otbenv.profile +++ b/Packaging/Files/otbenv.profile @@ -49,18 +49,18 @@ PATH=$(cat_path "OUT_DIR/bin" "$PATH") # export PYTHONPATH to import otbApplication.py -PYTHONPATH=$(cat_path "OUT_DIR/lib/python" "$PYTHONPATH") +PYTHONPATH=OUT_DIR/lib/python3.7/site-packages:$PYTHONPATH # set numeric locale to C LC_NUMERIC=C # set GDAL_DATA variable used by otb application -GDAL_DATA=OUT_DIR/share/gdal +GDAL_DATA=HOMEBREW_PREFIX/opt/osgeo-gdal/share/gdal export GDAL_DRIVER_PATH=disable # set GEOTIFF_CSV variable used by otb application -GEOTIFF_CSV=OUT_DIR/share/epsg_csv +GEOTIFF_CSV=HOMEBREW_PREFIX/opt/osgeo-libgeotiff/share/epsg_csv # export variables export LC_NUMERIC # --- a/CMakeLists.txt # +++ b/CMakeLists.txt # @@ -100,6 +100,12 @@ # reset_qt_i18n_sources() # # repository_status(${PROJECT_SOURCE_DIR} OTB_GIT_STATUS_MESSAGE) # + # +#if ITK_VERSION_MAJOR < 5 # +#define OTB_DISABLE_DYNAMIC_MT # +#else # +#define OTB_DISABLE_DYNAMIC_MT this->DynamicMultiThreadingOff(); # +#endif # Find python stuff # Version 3 is preferred before 2 # --- a/SuperBuild/CMake/External_itk.cmake # +++ b/SuperBuild/CMake/External_itk.cmake # @@ -84,7 +84,7 @@ # Eigen # #FEM # NarrowBand # - NeuralNetworks # + #NeuralNetworks # Optimizers # Optimizersv4 # Polynomials # --- a/Modules/ThirdParty/ITK/otb-module-init.cmake # +++ b/Modules/ThirdParty/ITK/otb-module-init.cmake # @@ -71,7 +71,7 @@ # ITKEigen # #ITKFEM # ITKNarrowBand # - ITKNeuralNetworks # + #ITKNeuralNetworks # ITKOptimizers # ITKOptimizersv4 # ITKPolynomials ================================================ FILE: Formula/osgeo-osgearth.rb ================================================ class OsgeoOsgearth < Formula desc "Geospatial SDK and terrain engine for OpenSceneGraph" homepage "http://osgearth.org" url "https://github.com/gwaldron/osgearth.git", :branch => "master", :commit => "1faf43af681e22b0d3b4d0a1ada7e138cf3aac46" version "2.10.1" bottle do root_url "https://dl.bintray.com/homebrew-osgeo/osgeo-bottles" cellar :any rebuild 1 sha256 "0784fecac54032d20b907ff013b6d7fa23faf083981ac9d26340d61e4fe45845" => :mojave sha256 "0784fecac54032d20b907ff013b6d7fa23faf083981ac9d26340d61e4fe45845" => :high_sierra sha256 "0784fecac54032d20b907ff013b6d7fa23faf083981ac9d26340d61e4fe45845" => :sierra end # revision 2 head "https://github.com/gwaldron/osgearth.git", :branch => "master" option "without-minizip", "Build without Google KMZ file access support" option "with-docs-examples", "Build and install html documentation and examples" option "with-v8", "Build with Google's V8 JavaScript engine support" option "with-rocksdb", "Build with Rocksdb an Embedded key-value store for fast storage" # option "with-tinyxml", "Use external libtinyxml, instead of internal" # option "with-duktape", "Build with Duktape an Embeddable Javascript engine" #depends_on :macos => :mavericks depends_on "cmake" => :build depends_on "boost" depends_on "curl" depends_on "expat" depends_on "geos" depends_on "glslang" depends_on "leveldb" depends_on "libzip" depends_on "osgeo-gdal" depends_on "osgeo-openscenegraph" depends_on "osgeo-osgqt" depends_on "poco" depends_on "protobuf" depends_on "python" # for sphinx depends_on "qt" depends_on "sqlite" depends_on :x11 depends_on "minizip" => :recommended depends_on "rocksdb" => :optional depends_on "v8" => :optional # depends_on "duktape" => :optional # depends_on "triton-sdk" => :optional # Triton Ocean SDK resource "Sphinx" do url "https://files.pythonhosted.org/packages/4d/ed/4595274b5c9ce53a768cc0804ef65fd6282c956b93919a969e98d53894e4/Sphinx-1.8.3.tar.gz" sha256 "c4cb17ba44acffae3d3209646b6baec1e215cad3065e852c68cc569d4df1b9f8" end # fix error: unknown type name 'GLDEBUGPROC' # restore osgEarthQt: osgEarthQt5 # https://github.com/gwaldron/osgearth/commit/c7f9d22b60bd1bb969b853b34b7f3955141e8b07 # qgis3: libosgEarthQt5.dylib needed by PlugIns/qgis/libglobeplugin.dylib patch :DATA def install ENV.cxx11 if (build.with? "docs-examples") && (!which("sphinx-build")) # temporarily vendor a local sphinx install sphinx_dir = prefix/"sphinx" sphinx_site = sphinx_dir/"lib/python#{py_ver}/site-packages" sphinx_site.mkpath ENV.prepend_create_path "PYTHONPATH", sphinx_site resource("Sphinx").stage { quiet_system "python#{py_ver}", "setup.py", "install", "--prefix=#{sphinx_dir}" } ENV.prepend_path "PATH", sphinx_dir/"bin" end args = std_cmake_args args << "-DOSGEARTH_QT_BUILD=ON" args << "-DOSGEARTH_QT_BUILD_LEGACY_WIDGETS=ON" args << "-DDYNAMIC_OSGEARTH=ON" args << "-DOSGQT_LIBRARY=#{Formula["osgqt"].opt_lib}/libosgQt5.dylib" args << "-DCMAKE_PREFIX_PATH=#{Formula["qt"].opt_lib}/cmake" args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}" args << "-DGDAL_LIBRARY=#{Formula["gdal2"].opt_lib}/libgdal.dylib" args << "-DGDAL_INCLUDE_DIR=#{Formula["gdal2"].opt_include}" args << "-DGEOS_LIBRARY=#{Formula["geos"].opt_lib}/libgeos.dylib" args << "-DGEOS_INCLUDE_DIR=#{Formula["geos"].opt_include}" args << "-DLEVELDB_LIBRARY=#{Formula["leveldb"].opt_lib}/libleveldb.dylib" args << "-DLEVELDB_INCLUDE_DIR=#{Formula["leveldb"].opt_include}" args << "-DOSG_DIR=#{Formula["osgeo-openscenegraph"].opt_prefix}" args << "-DOSG_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosg.dylib" args << "-DOSGUTIL_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgUtil.dylib" args << "-DOSGDB_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgDB.dylib" args << "-DOSGTEXT_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgText.dylib" args << "-DOSGTERRAIN_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgTerrain.dylib" args << "-DOSGFX_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgFX.dylib" args << "-DOSGSIM_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgSim.dylib" args << "-DOSGVIEWER_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgViewer.dylib" args << "-DOSGGA_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgGA.dylib" args << "-DOSGWIDGET_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgWidget.dylib" args << "-DOSGSHADOW_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgShadow.dylib" args << "-DOSGMANIPULATOR_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgManipulator.dylib" args << "-DOSGPARTICLE_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libosgParticle.dylib" args << "-DOPENTHREADS_LIBRARY=#{Formula["osgeo-openscenegraph"].opt_lib}/libOpenThreads.dylib" args << "-DOSG_INCLUDE_DIR=#{Formula["osgeo-openscenegraph"].opt_include}" args << "-DOSG_GEN_INCLUDE_DIR=#{Formula["osgeo-openscenegraph"].opt_include}" args << "-DPOCO_FOUNDATION_LIBRARY=#{Formula["poco"].opt_lib}/libPocoFoundation.dylib" args << "-DPOCO_NET_LIBRARY=#{Formula["poco"].opt_lib}/libPocoNet.dylib" args << "-DPOCO_UTIL_LIBRARY=#{Formula["poco"].opt_lib}/libPocoUtil.dylib" args << "-DPOCO_INCLUDE_DIR=#{Formula["poco"].opt_include}" args << "-DSQLITE3_LIBRARY=#{Formula["sqlite"].opt_lib}/libsqlite3.dylib" args << "-DSQLITE3_INCLUDE_DIR=#{Formula["sqlite"].opt_include}" if build.with? "rocksdb" args << "-DWITH_STATIC_ROCKSDB=ON" args << "-DROCKSDB_LIBRARY=#{Formula["rocksdb"].opt_lib}/librocksdb.dylib" args << "-DROCKSDB_INCLUDE_DIR=#{Formula["rocksdb"].opt_include}" end # v8 and minizip options should have empty values if not defined '--with' if build.without? "v8" args << "-DV8_INCLUDE_DIR=''" << "-DV8_BASE_LIBRARY=''" << "-DV8_SNAPSHOT_LIBRARY=''" args << "-DV8_ICUI18N_LIBRARY=''" << "-DV8_ICUUC_LIBRARY=''" end # if build.with? "triton" # args << "-DTRITON_LIBRARY=#{Formula["triton-sdk"].opt_lib}" # args << "-DTRITON_INCLUDE_DIR=#{Formula["triton-sdk"].opt_include}" # end # if build.with? "duktape" # args << "-DWITH_EXTERNAL_DUKTAPE=ON" # args << "-DDUKTAPE_LIBRARY=#{Formula["duktape"].opt_lib}/libduktaped.dylib" # args << "-DDUKTAPE_INCLUDE_DIR=#{Formula["duktape"].opt_include}" # end # Failure to build with external tinyxml # https://github.com/gwaldron/osgearth/issues/1002 # if build.with? "tinyxml" # args << "-DWITH_EXTERNAL_TINYXML=ON" # args << "-DTINYXML_LIBRARY=#{Formula["tinyxml"].opt_lib}/libtinyxml.dylib" # args << "-DTINYXML_INCLUDE_DIR=#{Formula["tinyxml"].opt_include}" # end mkdir "build" do system "cmake", "..", *args system "make", "install" end if build.with? "docs-examples" cd "docs" do system "make", "html" doc.install "build/html" => "html" end doc.install "data" doc.install "tests" => "examples" rm_r prefix/"sphinx" if File.exist?(prefix/"sphinx") end end def caveats osg = Formula["osgeo-openscenegraph"] osgver = (osg.linked_keg.exist?) ? osg.version : "#.#.# (version)" <<~EOS This formula installs Open Scene Graph plugins. To ensure access when using the osgEarth toolset, set the OSG_LIBRARY_PATH enviroment variable to: #{HOMEBREW_PREFIX}/lib/osgPlugins-#{osgver} EOS end test do system "#{bin}/osgearth_version" end private def py_ver `#{Formula["python"].opt_bin}/python3 -c 'import sys;print("{0}.{1}".format(sys.version_info[0],sys.version_info[1]))'`.strip end end __END__ --- /src/osgEarthSplat/LandUseTileSource.cpp +++ /src/osgEarthSplat/LandUseTileSource.cpp @@ -22,6 +22,8 @@ #include #include +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam); + using namespace osgEarth; using namespace osgEarth::Splat; --- /src/osgEarthQt/ViewerWidget.cpp +++ /src/osgEarthQt/ViewerWidget.cpp @@ -28,6 +28,8 @@ #include #include +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#include #include #include #include --- a/src/applications/osgearth_package_qt/PackageQtMainWindow +++ b/src/applications/osgearth_package_qt/PackageQtMainWindow @@ -35,6 +35,8 @@ #include +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +#include #include #include #include --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,6 +186,21 @@ FIND_LIBRARY(MATH_LIBRARY m) ENDIF(UNIX AND NOT ANDROID) + +IF(OSGEARTH_QT_BUILD) + OPTION(OSGEARTH_QT_BUILD "Enable to use Qt (build Qt-dependent libraries, plugins and examples)" ON) + OPTION(OSGEARTH_QT_BUILD_LEGACY_WIDGETS "Build the legacy Qt widgets" ON) + FIND_PACKAGE(Qt5Core REQUIRED) + FIND_PACKAGE(Qt5Gui REQUIRED) + FIND_PACKAGE(Qt5OpenGL REQUIRED) + FIND_PACKAGE(Qt5OpenGLExtensions REQUIRED) + FIND_PACKAGE(Qt5Widgets REQUIRED) + FIND_PACKAGE(Qt5MacExtras REQUIRED) + IF ( Qt5Core_FOUND AND Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND AND Qt5OpenGLExtensions_FOUND ) + SET(QT_INCLUDES ${Qt5Widgets_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5OpenGLExtensions_INCLUDE_DIRS}) + MESSAGE(STATUS "Found Qt version: ${Qt5Core_VERSION_STRING}") + ENDIF () +ENDIF() # Platform specific definitions --- a/CMakeModules/FindOSG.cmake +++ b/CMakeModules/FindOSG.cmake @@ -138,6 +138,19 @@ FIND_OSG_LIBRARY( OPENTHREADS_LIBRARY OpenThreads ) FIND_OSG_LIBRARY( OPENTHREADS_LIBRARY_DEBUG OpenThreadsd ) +IF(OPENSCENEGRAPH_VERSION VERSION_LESS "3.6.3") + FIND_OSG_LIBRARY( OSGQT_LIBRARY osgQt ) + FIND_OSG_LIBRARY( OSGQT_LIBRARY_DEBUG osgQtd ) +ELSE(OPENSCENEGRAPH_VERSION VERSION_LESS "3.6.3") + IF(Qt5Widgets_FOUND) + FIND_OSG_LIBRARY( OSGQT_LIBRARY osgQt5 ) + FIND_OSG_LIBRARY( OSGQT_LIBRARY_DEBUG osgQt5d ) + ELSE(Qt5Widgets_FOUND) + FIND_OSG_LIBRARY( OSGQT_LIBRARY osgQt ) + FIND_OSG_LIBRARY( OSGQT_LIBRARY_DEBUG osgQtd ) + ENDIF(Qt5Widgets_FOUND) +ENDIF(OPENSCENEGRAPH_VERSION VERSION_LESS "3.6.3") + SET( OSG_FOUND "NO" ) IF( OSG_LIBRARY AND OSG_INCLUDE_DIR ) SET( OSG_FOUND "YES" ) --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,6 +14,7 @@ FOREACH( lib + osgEarthQt osgEarthSplat osgEarthSilverLining osgEarthTriton ) --- a/src/applications/CMakeLists.txt +++ b/src/applications/CMakeLists.txt @@ -43,6 +43,9 @@ ADD_SUBDIRECTORY(osgearth_atlas) ADD_SUBDIRECTORY(osgearth_conv) ADD_SUBDIRECTORY(osgearth_3pv) +IF (Qt5Widgets_FOUND OR QT4_FOUND AND NOT ANDROID AND OSGEARTH_QT_BUILD AND OSGEARTH_QT_BUILD_LEGACY_WIDGETS) + ADD_SUBDIRECTORY(osgearth_package_qt) +ENDIF() ADD_SUBDIRECTORY(osgearth_featureinfo) IF(BUILD_OSGEARTH_EXAMPLES) @@ -94,6 +97,10 @@ ADD_SUBDIRECTORY(osgearth_drawables) ADD_SUBDIRECTORY(osgearth_magnify) ADD_SUBDIRECTORY(osgearth_eci) + IF (Qt5Widgets_FOUND OR QT4_FOUND AND NOT ANDROID AND OSGEARTH_QT_BUILD) + ADD_SUBDIRECTORY(osgearth_qt_simple) + ADD_SUBDIRECTORY(osgearth_qt_windows) + ENDIF() ADD_SUBDIRECTORY(osgearth_windows) IF(SILVERLINING_FOUND) ================================================ FILE: Formula/osgeo-osgqt.rb ================================================ class OsgeoOsgqt < Formula desc "3D graphics toolkit (osgQt)" homepage "https://github.com/openscenegraph/osgQt" url "https://github.com/openscenegraph/osgQt.git", :branch => "master", :commit => "8c6db61ef8ab650b972556142cceb11db057bda9" version "3.6.3" revision 2 head "https://github.com/openscenegraph/osgQt.git" bottle do root_url "https://bottle.download.osgeo.org" cellar :any rebuild 1 sha256 "6a35302754dd73e74eb3d94d9d8569c4f3c027350669ff6010acf1091651381e" => :mojave sha256 "6a35302754dd73e74eb3d94d9d8569c4f3c027350669ff6010acf1091651381e" => :high_sierra sha256 "ea0310e01f112a7ed1376164eee194dd94a420442aa332daef448bb535ac8c80" => :sierra end depends_on "cmake" => :build depends_on "pkg-config" => :build depends_on "osgeo-openscenegraph" depends_on "qt" # compatible with the new and old versions of OSG # QtWindowingSystem exist from OSG 3.5.3 # patch :DATA # for commit: 6d324db8a56feb7d1976e9fb3f1de9bf7d255646 def install # Fix "fatal error: 'os/availability.h' file not found" on 10.11 and # "error: expected function body after function declarator" on 10.12 if MacOS.version == :sierra || MacOS.version == :el_capitan ENV["SDKROOT"] = MacOS.sdk_path end args = std_cmake_args args << "-DCMAKE_PREFIX_PATH=#{Formula["qt"].opt_lib}/cmake" args << "-DCMAKE_CXX_FLAGS=-Wno-error=narrowing" # or: -Wno-c++11-narrowing args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}" args << "-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio" args << "-DOSG_WINDOWING_SYSTEM=Cocoa" mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end end test do (testpath/"test.cpp").write <<~EOS #include #include using namespace std; int main() { cout << osgGetVersion() << endl; return 0; } EOS system ENV.cxx, "test.cpp", "-I#{include}", "-L#{lib}", "-I#{Formula["osgeo-openscenegraph"].opt_include}", "-L#{Formula["osgeo-openscenegraph"].opt_lib}", "-losg", "-o", "test" assert_equal `./test`.chomp, version.to_s end end __END__ --- /CMakeLists.txt +++ /CMakeLists.txt @@ -127,7 +127,7 @@ PROJECT(osgQt) -FIND_PACKAGE(OpenSceneGraph 3.0.0 REQUIRED osgDB osgGA osgUtil osgText osgViewer osgWidget) +FIND_PACKAGE(OpenSceneGraph 3.6.3 REQUIRED osgDB osgGA osgUtil osgText osgViewer osgWidget) SET(OPENSCENEGRAPH_SOVERSION 145) SET(OSG_PLUGINS osgPlugins-${OPENSCENEGRAPH_VERSION}) --- /include/osgQt/GraphicsWindowQt +++ /include/osgQt/GraphicsWindowQt @@ -37,7 +37,7 @@ // forward declarations class GraphicsWindowQt; -#if OSG_VERSION_LESS_THAN(3, 5, 6) +#if OSG_VERSION_LESS_THAN(3, 6, 3) /// The function sets the WindowingSystem to Qt. void OSGQT_EXPORT initQtWindowingSystem(); #endif --- /src/osgQt/GraphicsWindowQt.cpp +++ /src/osgQt/GraphicsWindowQt.cpp @@ -945,7 +945,7 @@ QtWindowingSystem& operator=( const QtWindowingSystem& ); }; -#if OSG_VERSION_GREATER_OR_EQUAL(3, 5, 6) +#if OSG_VERSION_GREATER_OR_EQUAL(3, 6, 3) REGISTER_WINDOWINGSYSTEMINTERFACE(Qt, QtWindowingSystem) #else ================================================ FILE: Formula/osgeo-osm2po.rb ================================================ class CurlRefererDownloadStrategy < CurlDownloadStrategy def _fetch domain_url = @url.sub(/([^:]+:\/\/[^\/]+)(.*)/, "\\1") curl @url, "-e", domain_url, "-C", downloaded_size, "-o", temporary_path end end class OsgeoOsm2po < Formula desc "Openstreetmap converter and routing engine for java" homepage "https://osm2po.de" url "https://osm2po.de/releases/osm2po-5.2.127.zip" sha256 "607fc4c2007c713dd867fd51cc8b8f403aa8d6048f8eb7e15124d9786f39d165" revision 1 bottle do root_url "https://bottle.download.osgeo.org" cellar :any_skip_relocation rebuild 1 sha256 "b5721c5081b85ec5f045c631102c4e990818c42f50f56934712fa36f070d1546" => :mojave sha256 "b5721c5081b85ec5f045c631102c4e990818c42f50f56934712fa36f070d1546" => :high_sierra sha256 "b5721c5081b85ec5f045c631102c4e990818c42f50f56934712fa36f070d1546" => :sierra end def install doc.install Dir["osm2po-doc/*"] rm "demo.bat" libexec.install Dir["*"] bin.write_jar_script libexec/"osm2po-core-#{version.to_s}-signed.jar", "osm2po" (libexec/"demo.sh").chmod 0755 end def caveats; <<~EOS The generated executable: osm2po executes: exec java -jar EOS end test do system "#{bin}/osm2po", "--help" end end ================================================ FILE: Formula/osgeo-ossim.rb ================================================ class OsgeoOssim < Formula desc "Geospatial libs and apps to process imagery, terrain, and vector data" homepage "https://trac.osgeo.org/ossim/" url "https://github.com/ossimlabs/ossim/archive/OrchidIsland-2.11.1.tar.gz" sha256 "2823d132c8da3cb57c030f72ab4c0fbf493eccac6b34c1ec7192741312a839eb" bottle do root_url "https://bottle.download.osgeo.org" sha256 "2f9e74bcc0f1cc41b39279d707c168a028f8bdaeff5d4c53091d420f6a70251b" => :catalina sha256 "2f9e74bcc0f1cc41b39279d707c168a028f8bdaeff5d4c53091d420f6a70251b" => :mojave sha256 "2f9e74bcc0f1cc41b39279d707c168a028f8bdaeff5d4c53091d420f6a70251b" => :high_sierra end revision 1 head "https://github.com/ossimlabs/ossim.git", :branch => "master" option "with-curl-apps", "Build curl-dependent apps" option "with-pg10", "Build with PostgreSQL 10 client" depends_on "cmake" => :build depends_on "jpeg" depends_on "jsoncpp" depends_on "libtiff" depends_on "geos" depends_on "freetype" depends_on "zlib" depends_on "libpng" depends_on "opencv" depends_on "openjpeg" depends_on "doxygen" depends_on "minizip" depends_on "bzip2" depends_on "ffmpeg" depends_on "podofo" depends_on "qt" depends_on "jsoncpp" depends_on "potrace" depends_on "sqlite" depends_on "fftw" depends_on "expat" depends_on "curl" depends_on "jpeg-turbo" depends_on "osgeo-proj" depends_on "osgeo-libgeotiff" depends_on "osgeo-laszip@2" depends_on "osgeo-liblas" depends_on "osgeo-pdal" depends_on "osgeo-gdal" depends_on "osgeo-libkml" depends_on "osgeo-openscenegraph" # just for its OpenThreads lib # openthreads depends_on "cppunit" depends_on "regex-opt" # depends_on "subversion" # depends_on "git" depends_on "hdf5" => :optional depends_on "open-mpi" => :optional # GPSTk # Geotrans # MrSid depends_on "openjdk" => :optional # => ["1.8", :build] if build.with? "pg10" depends_on "osgeo-postgresql@10" else depends_on "osgeo-postgresql" end def install ENV.cxx11 ENV["OSSIM_DEV_HOME"] = buildpath.to_s ENV["OSSIM_BUILD_DIR"] = (buildpath/"build").to_s ENV["OSSIM_INSTALL_PREFIX"] = prefix.to_s # TODO: add options and deps for plugins args = std_cmake_args + %W[ -DOSSIM_DEV_HOME=#{ENV["OSSIM_DEV_HOME"]} -DINSTALL_LIBRARY_DIR=#{lib} -DINSTALL_ARCHIVE_DIR:PATH=#{lib} -DFREETYPE_INCLUDE_DIR_ft2build=#{Formula["freetype"].opt_include} -DBUILD_OSSIM_TESTS=ON -DBUILD_OSSIM_FREETYPE_SUPPORT=ON -DBUILD_OSSIM_ID_SUPPORT=ON -DBUILD_SHARED_LIBS=ON -DBUILD_OSSIM_APPS=ON -DBUILD_OMS=ON -DBUILD_OSSIM_VIDEO=ON -DBUILD_OSSIM_WMS=ON -DBUILD_OSSIM_PLANET=ON ] # not used by the project # args += %W[ # -DBUILD_CNES_PLUGIN=OFF # -DBUILD_GDAL_PLUGIN=ON # -DBUILD_GEOPDF_PLUGIN=ON # -DBUILD_KAKADU_PLUGIN=OFF # -DBUILD_KML_PLUGIN=ON # -DBUILD_MRSID_PLUGIN=OFF # -DBUILD_OPENCV_PLUGIN=ON # -DBUILD_OPENJPEG_PLUGIN=ON # -DBUILD_PDAL_PLUGIN=ON # -DBUILD_PNG_PLUGIN=ON # -DBUILD_POTRACE_PLUGIN=ON # -DBUILD_SQLITE_PLUGIN=ON # -DBUILD_WEB_PLUGIN=ON # -DMRSID_DIR= # -DOSSIM_BUILD_ADDITIONAL_DIRECTORIES= # -DOSSIM_PLUGIN_LINK_TYPE=SHARED # ] # error: no member named 'printError' in 'H5::Exception' args << "-DBUILD_OSSIM_HDF5_SUPPORT=" + (build.with?("hdf5") ? "ON" : "OFF") # generate library instead of framework args << "-DBUILD_OSSIM_FRAMEWORKS=ON" # build new ossimGui library and geocell application args << "-DBUILD_OSSIM_GUI=ON" args << "-DBUILD_OSSIM_MPI_SUPPORT=" + (build.with?("mpi") ? "ON" : "OFF") args << "-DBUILD_OSSIM_CURL_APPS=" + (build.with?("curl-apps") ? "ON" : "OFF") mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end # inreplace "#{buildpath}/share/ossim/templates/ossim_preferences_template" do |s| # s.sub! "epsg_database_file1: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_epsg_projections-v7_4.csv", # "epsg_database_file1: $(OSSIM_DATA)/projection/ossim_epsg_projections-v7_4.csv" # s.sub! "epsg_database_file2: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_harn_state_plane_epsg.csv", # "epsg_database_file2: $(OSSIM_DATA)/projection/ossim_harn_state_plane_epsg.csv" # s.sub! "epsg_database_file3: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_state_plane_spcs.csv", # "epsg_database_file3: $(OSSIM_DATA)/projection/ossim_state_plane_spcs.csv" # s.sub! "epsg_database_file4: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_harn_state_plane_esri.csv", # "epsg_database_file4: $(OSSIM_DATA)/projection/ossim_harn_state_plane_esri.csv" # s.sub! "wkt_database_file: $(OSSIM_DATA)/ossim/share/ossim/projection/ossim_wkt_pcs.csv", # "wkt_database_file: $(OSSIM_DATA)/projection/ossim_wkt_pcs.csv" # s.sub! "geoid_ngs_directory: $(OSSIM_DATA)/ear1/geoid/geoid99", # "geoid_ngs_directory: $(OSSIM_DATA)/geoids/geoid99" # s.sub! "geoid_egm_96_grid: $(OSSIM_DATA)/ele1/geoid/geoid96/egm96.grd", # "geoid_egm_96_grid: $(OSSIM_DATA)/geoids/geoid1996/egm96.grd" # end cp_r "#{buildpath}/share/ossim/templates", "#{share}/ossim/" cp_r "#{buildpath}/share/ossim/geoids", "#{share}/ossim/" end test do system bin/"ossim-cli", "--version" end end ================================================ FILE: Formula/osgeo-pcl.rb ================================================ class OsgeoPcl < Formula desc "Library for 2D/3D image and point cloud processing" homepage "http://www.pointclouds.org/" url "https://github.com/PointCloudLibrary/pcl/archive/pcl-1.11.0.tar.gz" sha256 "4255c3d3572e9774b5a1dccc235711b7a723197b79430ef539c2044e9ce65954" bottle do root_url "https://bottle.download.osgeo.org" sha256 "1c805512e41ce1c2b3414dba02c5bb8531b16caaa0ef97301d93a0f7fb4fac5b" => :catalina sha256 "1c805512e41ce1c2b3414dba02c5bb8531b16caaa0ef97301d93a0f7fb4fac5b" => :mojave sha256 "1c805512e41ce1c2b3414dba02c5bb8531b16caaa0ef97301d93a0f7fb4fac5b" => :high_sierra end #revision 3 head "https://github.com/PointCloudLibrary/pcl.git", :branch => "master" depends_on "cmake" => :build depends_on "pkg-config" => :build depends_on "boost" depends_on "cminpack" depends_on "eigen" depends_on "flann" depends_on "glew" # and glu depends_on "libusb" depends_on "qhull" depends_on "qt" depends_on "open-mpi" depends_on "libharu" depends_on "hdf5" depends_on "gl2ps" depends_on "python" depends_on "sphinx" depends_on "zlib" depends_on "libpng" depends_on "libpcap" depends_on "doxygen" depends_on "szip" depends_on "libxml2" depends_on "osgeo-proj" depends_on "osgeo-netcdf" depends_on "osgeo-vtk" depends_on "osgeo-qt-webkit" depends_on "openjdk" => :build # openni2 # cuda # FZAPI, Fotonic and ENSENSO # David Vision Systems SDK # DepthSense SDK # RealSense SDK # Mudule: metslib # apps - not building: # 3d_rec_framework: OpenNI # in_hand_scanner: OpenNI # cloud_composer: Qt4 # modeler: Qt4 # optronic_viewer: Qt # point_cloud_editor: Qt4 def install args = std_cmake_args + %w[ -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_apps=AUTO_OFF -DBUILD_apps_3d_rec_framework=AUTO_OFF -DBUILD_apps_cloud_composer=AUTO_OFF -DBUILD_apps_in_hand_scanner=AUTO_OFF -DBUILD_apps_optronic_viewer=AUTO_OFF -DBUILD_apps_point_cloud_editor=AUTO_OFF -DBUILD_examples:BOOL=OFF -DBUILD_global_tests:BOOL=OFF -DBUILD_outofcore:BOOL=AUTO_OFF -DBUILD_people:BOOL=AUTO_OFF -DBUILD_simulation:BOOL=AUTO_OFF -DWITH_CUDA:BOOL=OFF -DWITH_DOCS:BOOL=OFF -DWITH_QT:BOOL=FALSE -DWITH_TUTORIALS:BOOL=OFF ] # -DCUDA_HOST_COMPILER=/usr/local/bin/gcc if build.head? args << "-DBUILD_apps_modeler=AUTO_OFF" else args << "-DBUILD_apps_modeler:BOOL=OFF" end mkdir "build" do system "cmake", "..", *args system "make", "install" prefix.install Dir["#{bin}/*.app"] end end test do assert_match "tiff files", shell_output("#{bin}/pcl_tiff2pcd -h", 255) end end ================================================ FILE: Formula/osgeo-pdal.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_pdal_linked } def core_pdal_linked Formula["pdal"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoPdal < Formula include Language::Python::Virtualenv desc "Point data abstraction library" homepage "https://www.pdal.io/" url "https://github.com/PDAL/PDAL/archive/2.1.0.tar.gz" sha256 "43ed8ba8ef143e1ded67e96ef72bb73ee133723da0320c3e4f2f87d9bfc3737c" bottle do root_url "https://bottle.download.osgeo.org" sha256 "184ccc09667aec537a79e1541bc400a5ecfe8238fbfe46c9a0117ffb2a2cd9e9" => :catalina sha256 "184ccc09667aec537a79e1541bc400a5ecfe8238fbfe46c9a0117ffb2a2cd9e9" => :mojave sha256 "184ccc09667aec537a79e1541bc400a5ecfe8238fbfe46c9a0117ffb2a2cd9e9" => :high_sierra end #revision 1 head "https://github.com/PDAL/PDAL.git", :branch => "master" option "with-pg11", "Build with PostgreSQL 11 client" # keg_only "pdal is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "cmake" => :build depends_on "pkg-config" => :build depends_on "python" depends_on "numpy" depends_on "hdf5" depends_on "jsoncpp" depends_on "sqlite" depends_on "laszip" # >= 3.1 depends_on "geos" depends_on "zlib" depends_on "libxml2" depends_on "curl" depends_on "boost" depends_on "qt" depends_on "eigen" depends_on "flann" depends_on "libusb" depends_on "qhull" depends_on "glew" depends_on "osgeo-libgeotiff" depends_on "osgeo-gdal" depends_on "osgeo-laz-perf" depends_on "osgeo-vtk" depends_on "osgeo-pcl" depends_on "osgeo-hexer" if build.with?("pg11") depends_on "osgeo-postgresql@11" else depends_on "osgeo-postgresql" end # -- The following features have been disabled: # * Bash completion, completion for PDAL command line # * CPD plugin, Coherent Point Drift (CPD) computes rigid or nonrigid transformations between point sets # * Delaunay plugin, perform Delaunay triangulation of point cloud # * GeoWave plugin, Read and Write data using GeoWave # * I3S plugin, Read from a I3S server or from a SLPK file # * Matlab plugin, write data to a .mat file # * MrSID plugin, read data in the MrSID format # * NITF plugin, read/write LAS data wrapped in NITF # * OpenSceneGraph plugin, read/write OpenSceneGraph objects # * Oracle OCI plugin, Read/write point clould patches to Oracle # * RiVLib plugin, read data in the RXP format # * rdblib plugin, read data in the RDB format # * MBIO plugin, add features that depend on MBIO # * FBX plugin, add features that depend on FBX def install ENV.cxx11 args = std_cmake_args args += %W[ -DBUILD_PLUGIN_GREYHOUND=ON -DBUILD_PLUGIN_ICEBRIDGE=ON -DBUILD_PLUGIN_PCL=ON -DBUILD_PLUGIN_PGPOINTCLOUD=ON -DBUILD_PLUGIN_PYTHON=ON -DBUILD_PLUGIN_SQLITE=ON -DWITH_LASZIP=TRUE -DWITH_LAZPERF=TRUE" ] # args << "-DBUILD_PLUGIN_HEXBIN=ON" # not used by the project args << "-DLASZIP_LIBRARIES=#{Formula["laszip"].opt_lib}/liblaszip.dylib" args << "-DLASZIP_INCLUDE_DIR=#{Formula["laszip"].opt_include}" args << "-DPYTHON_EXECUTABLE=#{Formula["python"].opt_bin}/python#{py_ver}" args << "-DPYTHON_INCLUDE_DIR=#{Formula["python"].opt_frameworks}/Python.framework/Versions/#{py_ver}/Headers" args << "-DPYTHON_LIBRARY=#{Formula["python"].opt_frameworks}/Python.framework/Versions/#{py_ver}/lib/libpython#{py_ver}.dylib" if build.with?("pg10") args << "-DPG_CONFIG=#{Formula["osgeo-postgresql@11"].opt_bin}/pg_config" args << "-DPOSTGRESQL_INCLUDE_DIR=#{Formula["osgeo-postgresql@11"].opt_include}" args << "-DPOSTGRESQL_LIBRARIES=#{Formula["osgeo-postgresql@11"].opt_lib}/libpq.dylib" else args << "-DPG_CONFIG=#{Formula["osgeo-postgresql"].opt_bin}/pg_config" args << "-DPOSTGRESQL_INCLUDE_DIR=#{Formula["osgeo-postgresql"].opt_include}" args << "-DPOSTGRESQL_LIBRARIES=#{Formula["osgeo-postgresql"].opt_lib}/libpq.dylib" end system "cmake", ".", *args system "make", "install" doc.install "examples", "test" end test do system bin/"pdal", "info", doc/"test/data/las/interesting.las" end private def py_ver `#{Formula["python"].opt_bin}/python3 -c 'import sys;print("{0}.{1}".format(sys.version_info[0],sys.version_info[1]))'`.strip end end ================================================ FILE: Formula/osgeo-pdfium.rb ================================================ class OsgeoPdfium < Formula desc "Google-contributed PDF library (without V8 JavaScript engine)" homepage "https://pdfium.googlesource.com/pdfium/" url "https://github.com/rouault/pdfium.git", :branch => "master", :revision => "b5009c4df5aa4ff923ede1c5deba1aa4be43199b" version "0.0.1" revision 1 bottle do root_url "https://bottle.download.osgeo.org" cellar :any_skip_relocation rebuild 1 sha256 "c99e8ad04cda183ba17c53c5dee0c7bfc26ad36ab0ffb24ecbcea5b93f8e2686" => :catalina sha256 "c99e8ad04cda183ba17c53c5dee0c7bfc26ad36ab0ffb24ecbcea5b93f8e2686" => :mojave sha256 "c99e8ad04cda183ba17c53c5dee0c7bfc26ad36ab0ffb24ecbcea5b93f8e2686" => :high_sierra end keg_only "newer version of pdfium may be installed" depends_on "python" => :build # gyp doesn't run under 2.6 or lower depends_on :xcode => :build resource "depot_tools" do url "https://chromium.googlesource.com/chromium/tools/depot_tools.git" end resource "gyp" do url "https://chromium.googlesource.com/external/gyp.git" end def install #ENV.libstdcxx link_misc = "-arch x86_64 -mmacosx-version-min=10.9 -isysroot #{MacOS::Xcode.prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX#{MacOS.version}.sdk -lstdc++" ENV.append "LDFLAGS", "#{link_misc} -stdlib=libc++" ENV.append "CPATH", "#{MacOS::Xcode.prefix}/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1" # need to move git checkout into gclient solutions directory base_install = Dir[".*", "*"] - [".", "..", ".brew_home"] (buildpath/"pdfium/").mkpath base_install.each { |f| mv f, buildpath/"pdfium/" } # install chromium's build tools, includes ninja and gyp (buildpath/"pdfium_deps/depot_tools").install resource("depot_tools") ENV.prepend_path "PATH", buildpath/"pdfium_deps/depot_tools" ENV["GYP_DEFINES"] = "#{ENV.cc} mac_deployment_target=#{MacOS.version}" (buildpath/"pdfium_deps/gyp").install resource("gyp") ENV.prepend_path "PATH", buildpath/"pdfium_deps/gyp" ENV.prepend_create_path "PYTHONPATH", buildpath/"pdfium_deps/gyp/pylib" # raise cd "pdfium" do build_dir = "#{buildpath}/pdfium/build" system "./build/gyp_pdfium" xcodebuild "SDKROOT=#{MacOS.sdk_path}", "MACOSX_DEPLOYMENT_TARGET=10.9", "SYMROOT=#{build_dir}", "ONLY_ACTIVE_ARCH=YES", "-configuration", "Release", "-target", "pdfium", "-target", "fdrm", "-target", "fpdfdoc", "-target", "fpdfapi", "-target", "fpdftext", "-target", "fxcodec", "-target", "fxcrt", "-target", "fxge", "-target", "fxedit", "-target", "pdfwindow", "-target", "formfiller" cd "third_party" do xcodebuild "SDKROOT=#{MacOS.sdk_path}", "MACOSX_DEPLOYMENT_TARGET=10.9", "SYMROOT=#{build_dir}", "ONLY_ACTIVE_ARCH=YES", "-configuration", "Release", "-target", "bigint", "-target", "freetype", "-target", "fx_agg", "-target", "fx_lcms2", "-target", "fx_zlib", "-target", "pdfium_base", "-target", "fx_libjpeg", "-target", "fx_libopenjpeg" end cd "samples" do inreplace "pdfium_test.cc", /(delete platform;)/, "//\\1" xcodebuild "SDKROOT=#{MacOS.sdk_path}", "MACOSX_DEPLOYMENT_TARGET=10.9", "SYMROOT=#{build_dir}", "ONLY_ACTIVE_ARCH=YES", "-configuration", "Release", "-target", "pdfium_test", "-target", "pdfium_diff" end # raise # copy header files into a pdfium directory (include/"pdfium").install Dir["public/**/*.h"] (include/"pdfium/core/include").install Dir["core/include/*"] (include/"pdfium/fpdfsdk/include").install Dir["fpdfsdk/include/*"] # and 3rd party dependency headers (include/"pdfium/third_party/base/numerics").install Dir["third_party/base/numerics/*.h"] (include/"pdfium/third_party/base").install Dir["third_party/base/*.h"] # test data (libexec/"testing/resources").install Dir["testing/resources/*"] # fix public/*.h not found cd "#{include}/pdfium" do mkdir "public" mv "fpdf_progressive.h", "./public/fpdf_progressive.h" mv "fpdfview.h", "./public/fpdfview.h" ln_s "./public/fpdf_progressive.h", "./fpdf_progressive.h" ln_s "./public/fpdfview.h", "./fpdfview.h" end cd "build/Release" do (lib/"pdfium").install Dir["lib*.a"] (libexec/"bin").install "pdfium_test", "pdfium_diff" end end end def caveats; <<~EOS For building other software, static libs are located in #{opt_lib}/pdfium and includes in #{opt_include}/pdfium EOS end test do out = shell_output("#{libexec}/bin/pdfium_test 2>&1", 1) assert_match "No input files", out out = shell_output("#{libexec}/bin/pdfium_diff 2>&1", 2) assert_match "Compares two files on disk", out end end ================================================ FILE: Formula/osgeo-pgadmin3-lts.rb ================================================ class OsgeoPgadmin3Lts < Formula # include Language::Python::Virtualenv desc "Comprehensive design and management interface for PostgreSQL (LTS)" homepage "https://www.pgadmin.org" url "https://github.com/pgcentral/pgadmin3-lts/archive/7f3915ce4ccd5da7758ef6d2993cc8480e4aad3b.tar.gz" sha256 "65de9fb0d2bc43bfa0931832c344cfb894ae862acefefc64fbc8cd7d0f6cb7ff" version "1.22.3" revision 2 head "https://github.com/pgcentral/pgadmin3-lts.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any rebuild 1 sha256 "52a1ede0df8e5cadd152cb3066b7948d8a40a8ede53b9175b4c0e55f8445daaa" => :mojave sha256 "52a1ede0df8e5cadd152cb3066b7948d8a40a8ede53b9175b4c0e55f8445daaa" => :high_sierra sha256 "581f3d4725d6f45892ed4fb168340da23cf0b0078bb35ff9c14051174e96a1c8" => :sierra end patch :DATA option "with-app", "Build pgAdmin.app Package" option "with-pg10", "Build with PostgreSQL 10 client" depends_on "pkg-config" => :build depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "wxmac" depends_on "libxslt" depends_on "libxml2" depends_on "libgcrypt" depends_on "openssl" depends_on "libssh2" depends_on "zlib" depends_on "osgeo-libpqxx" depends_on "imagemagick" depends_on "krb5" # depends_on "python@2" # for Sphinx if build.with?("pg10") depends_on "osgeo-postgresql@10" else depends_on "osgeo-postgresql" end # resource "Sphinx" do # url "https://files.pythonhosted.org/packages/2a/86/8e1e8400bb6eca5ed960917952600fce90599e1cb0d20ddedd81ba163370/Sphinx-1.8.5.tar.gz" # sha256 "c7658aab75c920288a8cf6f09f244c6cfdae30d82d803ac1634d9f223a80ca08" # end if build.with?("pg10") # PG 10 support, adapted from: # https://bitbucket.org/openscg/pgadmin3-lts/commits/ea8a31af779b101248fc13242cb7a34e252cf49e/raw # https://bitbucket.org/openscg/pgadmin3-lts/commits/1d65e012f7bb88d3b6c5a08946a2456617213c35/raw resource "pg10" do url "https://gist.githubusercontent.com/fjperini/204ec325671a30e9ddb46d77ea8e1289/raw/f383173056b93731d3e2e8a90614373948274ca6/pgadmin3-pg10.diff" sha256 "74e127952d9674f4c09bbf8805f43f6a85821133fd9a84db094e8aab837c7d03" end else # PG 11 support, adapted from: # https://abdulyadi.wordpress.com/2018/11/03/pgadmin3-adjustment-for-postgresql-11-0/ resource "pg11" do url "https://gist.githubusercontent.com/fjperini/9b22ecd9bda767e51a446749472f8e94/raw/7bed1afe383d915c408c3cc735a25b192b3e0108/pgadmin3-pg11.diff" sha256 "7dc526b80eb61540e9bf6d46a329f45eac683646caaa68dec90f9743723dd7d3" end end # 1.14.2-cflags # resource "cflags" do # url "https://gist.githubusercontent.com/fjperini/5e9c519e88dd1aebd975edb89f2bd680/raw/03679e513f0ca67d5283d2560b0338d15730c0aa/pgadmin3-1.14.2-cflags.diff" # sha256 "1ab6db05896684cac42b4a29a422a3cd29d12b98f8f7d092c7f7647ea0fffc76" # end # Move this == null check to a static function. This works, but I opted # for the compiler flag since it "fixes" all cases, and pgadmin4 is on the # way. resource "nullthis" do url "https://gist.githubusercontent.com/fjperini/d5b129bad455a6d945ff80d17b91887a/raw/96531fd54ee7a67b7fd42eac97fedf6c8c27bb07/pgadmin3-nullthis.diff" sha256 "3b785ee8a2857f02b7d1983a3b8d699032494438096f3321576a8267c823b0c8" end # Fix failure to use EVP_CIPHER_CTX_new() # resource "ssh2" do # url "https://gist.githubusercontent.com/fjperini/2bc12464cc37c0c324cc2a6a61a1f3af/raw/b28e587dc265f0094f0ed23d7ff210bb24f77128/pgadmin3-ssh2.diff" # sha256 "71a7b90989ab35793b4435d6bc1ad54581f47649a5265021622fddb61ee83054" # end def install # venv = virtualenv_create(libexec, "#{Formula["python@2"].opt_bin}/python2") # res = resources.map(&:name).to_set - %w[pg11] # res.each do |r| # venv.pip_install resource(r) # end if build.with?("pg10") resource("pg10").stage do cp_r "./pgadmin3-pg10.diff", "#{buildpath}" end system "patch", "-p1", "-i", "#{buildpath}/pgadmin3-pg10.diff" else resource("pg11").stage do cp_r "./pgadmin3-pg11.diff", "#{buildpath}" end system "patch", "-p1", "-i", "#{buildpath}/pgadmin3-pg11.diff" end # resource("cflags").stage do # cp_r "./pgadmin3-1.14.2-cflags.diff", "#{buildpath}" # end # system "patch", "-p1", "-i", "#{buildpath}/pgadmin3-1.14.2-cflags.diff" resource("nullthis").stage do cp_r "./pgadmin3-nullthis.diff", "#{buildpath}" end # system "patch", "-p0", "-b", ".nullthis" system "patch", "-p1", "-i", "#{buildpath}/pgadmin3-nullthis.diff" # use the libssh2 embedded with pgadmin3 # global use_embedded 1 # remove embedded libssh2 # system "rm", "-rf", "#{buildpath}/pgadmin/libssh2", "#{buildpath}/pgadmin/include/libssh2" # resource("ssh2").stage do # cp_r "./pgadmin3-ssh2.diff", "#{buildpath}" # end # # system "patch", "-p0", "-b", ".ssh2f" # system "patch", "-p1", "-i", "#{buildpath}/pgadmin3-ssh2.diff" args = [ "--with-wx=#{Formula["wxmac"].opt_prefix}", # #{HOMEBREW_PREFIX} "--with-wx-version=3.0", # #{Formula["wxmac"].version} "--with-libxml2=#{Formula["libxml2"].opt_prefix}", "--with-libxslt=#{Formula["libxslt"].opt_prefix}", "--prefix=#{prefix}", "--with-libgcrypt", ] args << "--with-arch-x86_64" # building SSH Tunnel args << "--with-libssl-prefix=#{Formula["openssl"].opt_prefix}" # or --with-libgcrypt-prefix=PATH # build docs # args << "--with-sphinx-build=#{libexec}/bin/sphinx-build" # statically linking pgAdmin # wxWidgets installation cannot support pgAdmin in the selected configuration # args << "--enable-static" # building database designer args << "--enable-databasedesigner" # building a Mac OS X appbundle # pgAdmin3.rsrc: No such file or directory # args << "--enable-appbundle" ENV.append "CXXFLAGS", "-fno-delete-null-pointer-checks -Wno-unused-local-typedefs" if build.with?("pg10") args << "--with-pgsql=#{Formula["osgeo-postgresql@10"].opt_prefix}" else args << "--with-pgsql=#{Formula["osgeo-postgresql"].opt_prefix}" end ENV.append "CPPFLAGS", "-fno-delete-null-pointer-checks" system "./bootstrap" # [ -f Makefile ] || ./configure --prefix=/usr --with-wx-version=3.0 system "./configure", "--disable-debug", "--disable-dependency-tracking", *args system "make", "all" system "make", "install" if build.with? "app" (prefix/"pgAdmin3.app/Contents/PkgInfo").write "APPLPGADMIN3" mkdir "#{prefix}/pgAdmin3.app/Contents/Resources" cp_r "#{buildpath}/pkg/mac/pgAdmin3.icns", "#{prefix}/pgAdmin3.app/Contents/Resources/pgAdmin3.icns" cp_r "#{buildpath}/pkg/mac/sql.icns", "#{prefix}/pgAdmin3.app/Contents/Resources/sql.icns" config = <<~EOS CFBundleDevelopmentRegion English CFBundleDocumentTypes CFBundleTypeExtensions sql CFBundleTypeIconFile sql.icns CFBundleTypeName pgAdmin3 SQL Query CFBundleTypeRole Editor LSItemContentTypes org.postgresql.pgadmin.sql CFBundleExecutable pgadmin3 CFBundleGetInfoString pgAdmin3 #{version} CFBundleIconFile pgAdmin3.icns CFBundleIdentifier org.postgresql.pgadmin CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType APPL CFBundleShortVersionString #{version} CFBundleSignature ???? CFBundleVersion #{version} CSResourcesFileMapped UTExportedTypeDeclarations UTTypeConformsTo public.utf8-plain-text UTTypeDescription pgAdmin3 SQL Query UTTypeIconFile sql.icns UTTypeIdentifier org.postgresql.pgadmin.sql UTTypeTagSpecification public.filename-extension sql EOS (prefix/"pgAdmin3.app/Contents/Info.plist").write config chdir "#{prefix}/pgAdmin3.app/Contents" do mkdir "MacOS" do ln_s "#{bin}/pgadmin3", "pgadmin3" end end end end def caveats if build.with? "app" <<~EOS pgAdmin.app was installed in: #{prefix} You may also symlink pgAdmin3.app into /Applications or ~/Applications: ln -Fs `find $(brew --prefix) -name "pgAdmin3.app"` /Applications/pgAdmin3.app EOS end end test do # TODO end end __END__ --- a/pgadmin/frm/plugins.cpp +++ b/pgadmin/frm/plugins.cpp @@ -380,7 +380,7 @@ bool pluginUtilityFactory::CheckEnable(p { // If we need a specific server type, we can't enable unless // we have a connection. - if (!obj || !(obj->GetConnection()->GetStatus() == PGCONN_OK)) + if (!obj || !obj->GetConnection() || !(obj->GetConnection()->GetStatus() == PGCONN_OK)) return false; // Get the server type. ================================================ FILE: Formula/osgeo-pgsql-ogr-fdw.rb ================================================ class OsgeoPgsqlOgrFdw < Formula desc "PostgreSQL foreign data wrapper for OGR" homepage "https://github.com/pramsey/pgsql-ogr-fdw" #url "https://github.com/pramsey/pgsql-ogr-fdw/archive/v1.0.8.tar.gz" #sha256 "4ab0c303006bfd83dcd40af4d53c48e7d8ec7835bb98491bc6640686da788a8b" url "https://github.com/pramsey/pgsql-ogr-fdw.git", :branch => "master", :commit => "6b0f4690e49ef4e0203252b2a87d25a173afc1ad" version "1.0.12" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "329908858b691a160db41b1655641a865a831284193732520b462e9318086351" => :catalina sha256 "329908858b691a160db41b1655641a865a831284193732520b462e9318086351" => :mojave sha256 "329908858b691a160db41b1655641a865a831284193732520b462e9318086351" => :high_sierra end #revision 1 head "https://github.com/pramsey/pgsql-ogr-fdw.git", :branch => "master" def pour_bottle? # Postgres extensions must live in the Postgres prefix, which precludes # bottling: https://github.com/Homebrew/homebrew/issues/10247 # Overcoming this will likely require changes in Postgres itself. false end option "with-pg11", "Build with PostgreSQL 11 client" depends_on "osgeo-postgis" depends_on "osgeo-gdal" if build.with?("pg11") depends_on "osgeo-postgresql@11" else depends_on "osgeo-postgresql" end def install ENV.deparallelize ENV.append "CFLAGS", "-Wl,-z,relro,-z,now" # This includes PGXS makefiles and so will install __everything__ # into the Postgres keg instead of the this formula's keg. # Right now, no items installed to Postgres keg need to be installed to `prefix`. # In the future, if `make install` installs things that should be in `prefix` # consult postgis formula to see how to split it up. rm "#{buildpath}/Makefile" if build.with?("pg11") postgresql_ver = "#{Formula["osgeo-postgresql@11"].opt_bin}" else postgresql_ver = "#{Formula["osgeo-postgresql"].opt_bin}" end # Fix bin install path # Use CFLAGS from environment config = <<~EOS # ogr_fdw/Makefile MODULE_big = ogr_fdw OBJS = ogr_fdw.o ogr_fdw_deparse.o ogr_fdw_common.o stringbuffer_pg.o EXTENSION = ogr_fdw DATA = ogr_fdw--1.0.sql REGRESS = ogr_fdw EXTRA_CLEAN = sql/*.sql expected/*.out GDAL_CONFIG = #{Formula["osgeo-gdal"].opt_bin}/gdal-config GDAL_CFLAGS = $(shell $(GDAL_CONFIG) --cflags) GDAL_LIBS = $(shell $(GDAL_CONFIG) --libs) PG_CONFIG = #{postgresql_ver}/pg_config REGRESS_OPTS = --encoding=UTF8 PG_CPPFLAGS += $(GDAL_CFLAGS) LIBS += $(GDAL_LIBS) SHLIB_LINK := $(LIBS) PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) PG_VERSION_NUM = $(shell awk '/PG_VERSION_NUM/ { print $$3 }' $(shell $(PG_CONFIG) --includedir-server)/pg_config.h) HAS_IMPORT_SCHEMA = $(shell [ $(PG_VERSION_NUM) -ge 90500 ] && echo yes) # order matters, file first, import last REGRESS = file pgsql ifeq ($(HAS_IMPORT_SCHEMA),yes) REGRESS += import endif ############################################################### # Build the utility program after PGXS to override the # PGXS environment CFLAGS = $(GDAL_CFLAGS) $(CFLAGS) LIBS = $(GDAL_LIBS) ogr_fdw_info$(X): ogr_fdw_info.o ogr_fdw_common.o stringbuffer.o $(CC) $(CFLAGS) -o $@ $^ $(LIBS) clean-exe: rm -f ogr_fdw_info$(X) ogr_fdw_info.o stringbuffer.o install-exe: all # $(INSTALL_PROGRAM) ogr_fdw_info$(X) '$(DESTDIR)$(bindir)' # or $(INSTALL_PROGRAM) -D ogr_fdw_info$(X) '$(DESTDIR)$(bindir)/ogr_fdw_info$(X)' all: ogr_fdw_info$(X) clean: clean-exe install: install-exe EOS (buildpath/"Makefile").write config system "make" system "make", "DESTDIR=#{prefix}", "install" mv "#{prefix}/usr/local/lib", "#{lib}" mv "#{prefix}/usr/local/share", "#{share}" rm_f "#{prefix}/usr" bin.install "ogr_fdw_info" prefix.install "data" end def caveats; <<~EOS For info on using extension, read the included REAMDE.md or visit: https://github.com/pramsey/pgsql-ogr-fdw PostGIS plugin libraries installed to: /usr/local/lib/postgresql PostGIS extension modules installed to: /usr/local/share/postgresql/extension EOS end test do # test the sql generator for the extension data_sub = "data".upcase # or brew audit thinks there is a D A T A section sql_out = <<~EOS CREATE SERVER myserver FOREIGN #{data_sub} WRAPPER ogr_fdw OPTIONS ( datasource '#{prefix}/data', format 'ESRI Shapefile' ); CREATE FOREIGN TABLE pt_two ( fid bigint, geom Geometry(Point,4326), name varchar(50), age integer, height doubleprecision, birthdate date ) SERVER "myserver" OPTIONS (layer 'pt_two'); EOS result = shell_output("ogr_fdw_info -s #{prefix}/data -l pt_two") assert_equal sql_out.gsub(' ',''), result.gsub(' ','') end end ================================================ FILE: Formula/osgeo-pointcloud.rb ================================================ class OsgeoPointcloud < Formula desc "PostgreSQL extension for storing point cloud (LIDAR) data" homepage "https://github.com/pgpointcloud/pointcloud" url "https://github.com/pgpointcloud/pointcloud/archive/v1.2.0.tar.gz" sha256 "8542a4c714b4d0c67f10d092291a43b5650871b4ec8caf831e492810f25bb93c" bottle do root_url "https://bottle.download.osgeo.org" cellar :any rebuild 1 sha256 "0441c0f8dafa1e14e132feedecf64d587dd9f676517199a78f7c633d32c05da1" => :mojave sha256 "0441c0f8dafa1e14e132feedecf64d587dd9f676517199a78f7c633d32c05da1" => :high_sierra sha256 "39acb394587990363e8495770479e91af9f13edf5bcf157905c0762e667c24e3" => :sierra end # url "https://github.com/pgpointcloud/pointcloud/archive/v1.0.1.tar.gz" # sha256 "3fac2efe1263b0876c26fc77e28f3664b56aa1e142c92383f9eb5b828999d0e7" revision 2 head "https://github.com/pgpointcloud/pointcloud.git", :branch => "master" # for v1.0.1 # pc_access.c:318:46: error: AggState v1.0.1 # it was decided to use the updated lines from master # https://github.com/pgpointcloud/pointcloud/issues/174 # patch :DATA # depends_on "cmake" => :build # for v1.0.1 depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "libxml2" depends_on "osgeo-libght" depends_on "osgeo-laz-perf" # => :optional depends_on "cunit" # if build.with? "test" depends_on "llvm" => :build if build.with?("postgresql10") depends_on "osgeo-postgresql@10" else depends_on "osgeo-postgresql" end # Fix boolean case errors when compiling againt pg11 # https://github.com/pgpointcloud/pointcloud/pull/237 patch do url "https://patch-diff.githubusercontent.com/raw/pgpointcloud/pointcloud/pull/237.diff" sha256 "72b542ec7c8ad3a61186e5fb24e6555df3998361ee5f4a75034b61db514f16df" end def install if build.with?("postgresql10") args = "--with-pgconfig=#{Formula["osgeo-postgresql@10"].opt_bin}/pg_config" else args = "--with-pgconfig=#{Formula["osgeo-postgresql"].opt_bin}/pg_config" end mkdir lib/"postgresql" mkdir_p pkgshare/"postgresql/extension/" # for v1.0.1 # inreplace "pgsql/CMakeLists.txt", "${PGSQL_PKGLIBDIR}", "#{lib}/postgresql" # inreplace "pgsql/CMakeLists.txt", "${PGSQL_SHAREDIR}", "#{share}/postgresql" # inreplace "pgsql_postgis/CMakeLists.txt", "${PGSQL_SHAREDIR}", "#{share}/postgresql system "./autogen.sh" system "./configure", "--prefix=#{prefix}", "--with-lazperf=#{Formula["osgeo-laz-perf"].opt_prefix}", *args system "make" # system "make", "install" (lib/"postgresql").mkpath (share/"postgresql/extension").mkpath cp_r "#{buildpath}/pgsql/pointcloud-1.2.so", "#{lib}/postgresql/" # ln_s "#{lib}/postgresql/pointcloud-1.2.so", "#{lib}/postgresql/pointcloud.so" cp_r "#{buildpath}/pgsql/pointcloud--1.2.0.sql", "#{share}/postgresql/extension/" cp_r "#{buildpath}/pgsql/pointcloud.control", "#{share}/postgresql/extension/" cp_r "#{buildpath}/pgsql/pointcloud--1.1.0--1.2.0.sql", "#{share}/postgresql/extension/" cp_r "#{buildpath}/pgsql/pointcloud--1.1.1--1.2.0.sql", "#{share}/postgresql/extension/" cp_r "#{buildpath}/pgsql/pointcloud--1.2.0--1.2.0next.sql", "#{share}/postgresql/extension/" cp_r "#{buildpath}/pgsql/pointcloud--1.2.0next--1.2.0.sql", "#{share}/postgresql/extension/" cp_r "#{buildpath}/pgsql_postgis/pointcloud_postgis--1.2.0.sql", "#{share}/postgresql/extension/" cp_r "#{buildpath}/pgsql_postgis/pointcloud_postgis.control", "#{share}/postgresql/extension/" # nothing is installed here? rm_r "#{share}/osgeo-pointcloud" # for v1.0.1 # mkdir "build" do # system "cmake", "..", "-DCMAKE_PREFIX_PATH=#{Formula["osgeo-postgresql"].opt_prefix}", *std_cmake_args # system "make" # # system "/usr/local/bin/bbedit", "CMakeCache.txt" # # raise # # TODO: this fails with Segmentation fault: 11 # # puts `lib/cunit/cu_tester` if build.with? "test" # system "make", "install" # end end test do system "True" end end __END__ --- a/pgsql/pc_access.c +++ b/pgsql/pc_access.c @@ -310,18 +310,10 @@ if (arg1_typeid == InvalidOid) ereport(ERROR, - (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("could not determine input data type"))); - - if (fcinfo->context && IsA(fcinfo->context, AggState)) - { - aggcontext = ((AggState *) fcinfo->context)->aggcontext; - } - else if (fcinfo->context && IsA(fcinfo->context, WindowAggState)) - { - aggcontext = ((WindowAggState *) fcinfo->context)->aggcontext; - } - else + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("could not determine input data type"))); + + if ( ! AggCheckCallContext(fcinfo, &aggcontext) ) { /* cannot be called directly because of dummy-type argument */ elog(ERROR, "pointcloud_agg_transfn called in non-aggregate context"); @@ -551,9 +543,9 @@ if ( pc_bounds_intersects(&(serpa1->bounds), &(serpa2->bounds)) ) { - PG_RETURN_BOOL(TRUE); - } - PG_RETURN_BOOL(FALSE); + PG_RETURN_BOOL(true); + } + PG_RETURN_BOOL(false); } PG_FUNCTION_INFO_V1(pcpatch_size); --- a/pgsql/pc_inout.c +++ b/pgsql/pc_inout.c @@ -171,7 +171,7 @@ if ( ! err ) { - PG_RETURN_BOOL(FALSE); + PG_RETURN_BOOL(false); } valid = pc_schema_is_valid(schema); ================================================ FILE: Formula/osgeo-points2grid.rb ================================================ class OsgeoPoints2grid < Formula desc "Generate digital elevation models using local griding" homepage "https://github.com/CRREL/points2grid" url "https://github.com/CRREL/points2grid/archive/1.3.1.tar.gz" sha256 "6e2f2d3bbfd6f0f5c2d0c7d263cbd5453745a6fbe3113a3a2a630a997f4a1807" bottle do root_url "https://bottle.download.osgeo.org" cellar :any rebuild 1 sha256 "d9f1dac7dc33dc1112cb2625842fafcdb40d5e2d0f2e62c8afe22270fe9a1ccc" => :mojave sha256 "d9f1dac7dc33dc1112cb2625842fafcdb40d5e2d0f2e62c8afe22270fe9a1ccc" => :high_sierra sha256 "a6b053bac9a6e10d66752efc33209a3abe739ef4c61c8deccdd40dc49b467cb9" => :sierra end revision 1 head "https://github.com/CRREL/points2grid.git", :branch => "master" depends_on "cmake" => :build depends_on "boost" depends_on "curl" depends_on "osgeo-gdal" def install ENV.cxx11 args = std_cmake_args + %W[-DWITH_GDAL=ON -DWITH_TESTS=ON -DCMAKE_PREFIX_PATH=#{Formula["curl"].opt_prefix}] libexec.install "test/data/example.las" system "cmake", ".", *args system "make", "install" end test do system bin/"points2grid", "-i", libexec/"example.las", "-o", "example", "--max", "--output_format", "grid" assert_equal 13, File.read("example.max.grid").scan("423.820000").size end end ================================================ FILE: Formula/osgeo-postgis.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !osgeo_postgis_linked && !core_postgis_linked } def osgeo_postgis_linked Formula["osgeo-postgis@2.4"].linked_keg.exist? rescue return false end def core_postgis_linked Formula["postgis"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 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 s end end class OsgeoPostgis < Formula desc "Adds support for geographic objects to PostgreSQL" homepage "https://postgis.net/" url "https://github.com/postgis/postgis/archive/3.0.2.tar.gz" sha256 "2d4eb79ea9af1257320922a8a7d2663d37189c805746e975a5951ee6dc5ac4ef" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "1e7bd52b66279e1510b7cc700cb9f7e83b06f2b0f7a7348d99f140bb629e792b" => :catalina sha256 "1e7bd52b66279e1510b7cc700cb9f7e83b06f2b0f7a7348d99f140bb629e792b" => :mojave sha256 "1e7bd52b66279e1510b7cc700cb9f7e83b06f2b0f7a7348d99f140bb629e792b" => :high_sierra end #revision 8 head "https://github.com/postgis/postgis.git", :branch => "master" option "with-html-docs", "Generate multi-file HTML documentation" option "with-api-docs", "Generate developer API documentation (long process)" option "with-pg10", "Build with PostgreSQL 10 client" option "with-pg11", "Build with PostgreSQL 11 client" # keg_only "postgis is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "gpp" => :build depends_on "pkg-config" => :build depends_on "geos" depends_on "json-c" # for GeoJSON and raster handling depends_on "libiconv" depends_on "libxml2" depends_on "libxslt" depends_on "pcre" depends_on "osgeo-proj" depends_on "sfcgal" # for advanced 2D/3D functions depends_on "protobuf-c" # Geobuf and Mapbox Vector Tile support depends_on "osgeo-gdal" # for GeoJSON and raster handling # The latest supported version of PostgreSQL by PostGIS 3.0 is 12, # and thus it's the standard version. # https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS if build.with?("pg10") depends_on "osgeo-postgresql@10" elsif build.with?("pg11") depends_on "osgeo-postgresql@11" else depends_on "osgeo-postgresql" end depends_on "gtk+" # for gui if build.with? "html-docs" depends_on "imagemagick" depends_on "docbook-xsl" # docbook-xsl-nons end if build.with? "api-docs" depends_on "graphviz" depends_on "doxygen" end def install # Follow the PostgreSQL linked keg back to the active Postgres installation # as it is common for people to avoid upgrading Postgres. # postgres_realpath = Formula["postgresql"].opt_prefix.realpath ENV.append "CFLAGS", "-Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close" ENV.append "LDFLAGS", "-L#{Formula["libiconv"].opt_lib} -liconv" # ICONV_LDFLAGS ENV.deparallelize args = [ "--with-libiconv=#{Formula["libiconv"].opt_prefix}", "--with-xml2config=#{Formula["libxml2"].opt_bin}/xml2-config", "--with-geosconfig=#{Formula["geos"].opt_bin}/geos-config", "--with-sfcgal=#{Formula["sfcgal"].opt_bin}/sfcgal-config", "--with-projdir=#{Formula["osgeo-proj"].opt_prefix}", "--with-jsondir=#{Formula["json-c"].opt_prefix}", "--with-protobufdir=#{Formula["protobuf-c"].opt_prefix}", "--with-pcredir=#{Formula["pcre"].opt_prefix}", "--with-gdalconfig=#{Formula["osgeo-gdal"].opt_bin}/gdal-config", "--with-gui", "--with-raster", ] # By default PostGIS will try to detect gettext support and compile with it, # how ever if your un into incompatibility issues that cause breakage of loader, # you can disable it entirely with this command. Refer to ticket # http://trac.osgeo.org/postgis/ticket/748 for an example issue solved by # configuring with this. NOTE: that you aren’t missing much by turning this off. # This is used for international help/label support for the GUI loader which is not # yet documented and still experimental. args << "--with-gettext=no" # or PATH # Unfortunately, NLS support causes all kinds of headaches because # PostGIS gets all of its compiler flags from the PGXS makefiles. This # makes it nigh impossible to tell the buildsystem where our keg-only # gettext installations are. args << "--disable-nls" # Wagyu will only be necessary if protobuf is present to build MVTs # args << "--with-wagyu" # Disable topology support. # There is no corresponding library as all logic needed for # topology is in postgis- 3.0.2 library. # args << "--without-topology" # Disable the address_standardizer extension # args << "--without-address-standardizer" # specify the dtd path for mathml2.dtd # args << "--with-mathmldtd=PATH" args << "--with-xsldir=#{Formula["docbook-xsl"].opt_prefix}/docbook-xsl" if build.with? "html-docs" # /docbook-xsl-nons if build.with?("pg10") args << "--with-pgconfig=#{Formula["osgeo-postgresql@10"].opt_bin}/pg_config" elsif build.with?("pg11") args << "--with-pgconfig=#{Formula["osgeo-postgresql@11"].opt_bin}/pg_config" else args << "--with-pgconfig=#{Formula["osgeo-postgresql"].opt_bin}/pg_config" end system "./autogen.sh" system "./configure", *args system "make" if build.with? "html-docs" cd "doc" do ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" system "make", "chunked-html" doc.install "html" end end if build.with? "api-docs" cd "doc" do system "make", "doxygen" doc.install "doxygen/html" => "api" end end # PostGIS includes the PGXS makefiles and so will install __everything__ # into the Postgres keg instead of the PostGIS keg. Unfortunately, some # things have to be inside the Postgres keg in order to be function. So, we # install everything to a staging directory and manually move the pieces # into the appropriate prefixes. mkdir "stage" system "make", "install", "DESTDIR=#{buildpath}/stage" # Install PostGIS plugin libraries into the Postgres keg so that they can # be loaded and so PostGIS databases will continue to function even if # PostGIS is removed. # (postgres_realpath/"lib").install Dir["stage/**/*.so"] # Install extension scripts to the Postgres keg. # `CREATE EXTENSION postgis;` won't work if these are located elsewhere. # (postgres_realpath/"share/postgresql/extension").install Dir["stage/**/extension/*"] bin.install Dir["stage/**/bin/*"] lib.install Dir["stage/**/lib/*"] include.install Dir["stage/**/include/*"] pkgshare.install Dir["stage/**/contrib/postgis-*/*"] (share/"doc/postgresql/extension").install Dir["stage/**/share/doc/postgresql/extension/*"] (share/"postgresql/extension").install Dir["stage/**/share/postgresql/extension/*"] (share/"postgresql/contrib/postgis-3.0").install Dir["stage/**/contrib/postgis-*/*"] (share/"postgis_topology").install Dir["stage/**/contrib/postgis_topology-*/*"] # Extension scripts bin.install %w[ utils/create_undef.pl utils/postgis_proc_upgrade.pl utils/postgis_restore.pl utils/profile_intersects.pl utils/test_estimation.pl utils/test_geography_estimation.pl utils/test_geography_joinestimation.pl utils/test_joinestimation.pl ] man1.install Dir["doc/**/*.1"] end def caveats <<~EOS To create a spatially-enabled database, see the documentation: https://postgis.net/docs/manual-3.0/postgis_installation.html#create_new_db_extensions If you are currently using PostGIS 2.0+, you can go the soft upgrade path: ALTER EXTENSION postgis UPDATE TO "#{version}"; Users of 1.5 and below will need to go the hard-upgrade path, see here: https://postgis.net/docs/manual-3.0/postgis_installation.html#upgrading PostGIS SQL scripts installed to: #{HOMEBREW_PREFIX}/share/postgresql/contrib/postgis-3.0 PostGIS plugin libraries installed to: #{HOMEBREW_PREFIX}/lib PostGIS extension modules installed to: #{HOMEBREW_PREFIX}/share/postgresql/extension EOS end test do require "base64" (testpath/"brew.shp").write ::Base64.decode64 <<~EOS AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoOgDAAALAAAAAAAAAAAAAAAA AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAEAAAASCwAAAAAAAAAAAPA/AAAAAAAA8D8AAAAAAAAA AAAAAAAAAAAAAAAAAgAAABILAAAAAAAAAAAACEAAAAAAAADwPwAAAAAAAAAA AAAAAAAAAAAAAAADAAAAEgsAAAAAAAAAAAAQQAAAAAAAAAhAAAAAAAAAAAAA AAAAAAAAAAAAAAQAAAASCwAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAA AAAAAAAAAAAABQAAABILAAAAAAAAAAAAAAAAAAAAAAAUQAAAAAAAACJAAAAA AAAAAEA= EOS (testpath/"brew.dbf").write ::Base64.decode64 <<~EOS A3IJGgUAAABhAFsAAAAAAAAAAAAAAAAAAAAAAAAAAABGSVJTVF9GTEQAAEMA AAAAMgAAAAAAAAAAAAAAAAAAAFNFQ09ORF9GTEQAQwAAAAAoAAAAAAAAAAAA AAAAAAAADSBGaXJzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgU2Vjb25kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFRoaXJkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgUG9pbnQgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBGb3VydGggICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgQXBwZW5kZWQgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAg EOS (testpath/"brew.shx").write ::Base64.decode64 <<~EOS AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARugDAAALAAAAAAAAAAAAAAAA AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAADIAAAASAAAASAAAABIAAABeAAAAEgAAAHQAAAASAAAA igAAABI= EOS result = shell_output("#{bin}/shp2pgsql #{testpath}/brew.shp") assert_match(/Point/, result) assert_match(/AddGeometryColumn/, result) end end ================================================ FILE: Formula/osgeo-postgis@2.4.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !osgeo_postgis_linked && !core_postgis_linked } def osgeo_postgis_linked Formula["osgeo-postgis"].linked_keg.exist? rescue return false end def core_postgis_linked Formula["postgis"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 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 s end end class OsgeoPostgisAT24 < Formula desc "Adds support for geographic objects to PostgreSQL" homepage "https://postgis.net/" url "https://github.com/postgis/postgis/archive/2.4.9.tar.gz" sha256 "77ba24bf8fbbfa65881d7d24bd6379f2001fff781d6ff512590bfaf16e605288" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "4eac63ef452ab5bfa1035d680b4f17109c5b33df286c0c267f1b6c7283c2c74a" => :catalina sha256 "4eac63ef452ab5bfa1035d680b4f17109c5b33df286c0c267f1b6c7283c2c74a" => :mojave sha256 "4eac63ef452ab5bfa1035d680b4f17109c5b33df286c0c267f1b6c7283c2c74a" => :high_sierra end #revision 1 head "https://github.com/postgis/postgis.git", :branch => "svn-2.4" option "with-html-docs", "Generate multi-file HTML documentation" option "with-api-docs", "Generate developer API documentation (long process)" option "with-pg10", "Build with PostgreSQL 10 client" # keg_only :versioned_formula # we will verify that other versions are not linked depends_on Unlinked depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "gpp" => :build depends_on "pkg-config" => :build depends_on "geos" depends_on "json-c" # for GeoJSON and raster handling depends_on "libiconv" depends_on "libxml2" depends_on "libxslt" depends_on "pcre" depends_on "osgeo-proj" depends_on "sfcgal" # for advanced 2D/3D functions depends_on "protobuf-c" # Geobuf and Mapbox Vector Tile support depends_on "osgeo-gdal" # for GeoJSON and raster handling if build.with?("pg10") depends_on "osgeo-postgresql@10" else depends_on "osgeo-postgresql" end depends_on "gtk+" # for gui if build.with? "html-docs" depends_on "imagemagick" depends_on "docbook-xsl" # docbook-xsl-nons end if build.with? "api-docs" depends_on "graphviz" depends_on "doxygen" end def install # Follow the PostgreSQL linked keg back to the active Postgres installation # as it is common for people to avoid upgrading Postgres. # postgres_realpath = Formula["osgeo-postgresql@10"].opt_prefix.realpath ENV.append "CFLAGS", "-Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close" ENV.append "LDFLAGS", "-L#{Formula["libiconv"].opt_lib} -liconv" # ICONV_LDFLAGS ENV.deparallelize args = [ "--with-libiconv=#{Formula["libiconv"].opt_prefix}", "--with-xml2config=#{Formula["libxml2"].opt_bin}/xml2-config", "--with-geosconfig=#{Formula["geos"].opt_bin}/geos-config", "--with-sfcgal=#{Formula["sfcgal"].opt_bin}/sfcgal-config", "--with-projdir=#{Formula["osgeo-proj"].opt_prefix}", "--with-jsondir=#{Formula["json-c"].opt_prefix}", "--with-protobufdir=#{Formula["protobuf-c"].opt_prefix}", "--with-pcredir=#{Formula["pcre"].opt_prefix}", "--with-gdalconfig=#{Formula["osgeo-gdal"].opt_bin}/gdal-config", "--with-gui", "--with-raster", ] # By default PostGIS will try to detect gettext support and compile with it, # how ever if your un into incompatibility issues that cause breakage of loader, # you can disable it entirely with this command. Refer to ticket # http://trac.osgeo.org/postgis/ticket/748 for an example issue solved by # configuring with this. NOTE: that you aren’t missing much by turning this off. # This is used for international help/label support for the GUI loader which is not # yet documented and still experimental. args << "--with-gettext=no" # or PATH # Unfortunately, NLS support causes all kinds of headaches because # PostGIS gets all of its compiler flags from the PGXS makefiles. This # makes it nigh impossible to tell the buildsystem where our keg-only # gettext installations are. args << "--disable-nls" # Wagyu will only be necessary if protobuf is present to build MVTs # args << "--with-wagyu" # Disable topology support. # There is no corresponding library as all logic needed for # topology is in postgis- 2.4.8 library. # args << "--without-topology" # Disable the address_standardizer extension # args << "--without-address-standardizer" # specify the dtd path for mathml2.dtd # args << "--with-mathmldtd=PATH" args << "--with-xsldir=#{Formula["docbook-xsl"].opt_prefix}/docbook-xsl" if build.with? "html-docs" # /docbook-xsl-nons if build.with?("pg10") args << "--with-pgconfig=#{Formula["osgeo-postgresql@10"].opt_bin}/pg_config" else args << "--with-pgconfig=#{Formula["osgeo-postgresql"].opt_bin}/pg_config" end system "./autogen.sh" system "./configure", *args system "make" if build.with? "html-docs" cd "doc" do ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" system "make", "chunked-html" doc.install "html" end end if build.with? "api-docs" cd "doc" do system "make", "doxygen" doc.install "doxygen/html" => "api" end end # PostGIS includes the PGXS makefiles and so will install __everything__ # into the Postgres keg instead of the PostGIS keg. Unfortunately, some # things have to be inside the Postgres keg in order to be function. So, we # install everything to a staging directory and manually move the pieces # into the appropriate prefixes. mkdir "stage" system "make", "install", "DESTDIR=#{buildpath}/stage" # Install PostGIS plugin libraries into the Postgres keg so that they can # be loaded and so PostGIS databases will continue to function even if # PostGIS is removed. # (postgres_realpath/"lib").install Dir["stage/**/*.so"] # Install extension scripts to the Postgres keg. # `CREATE EXTENSION postgis;` won't work if these are located elsewhere. # (postgres_realpath/"share/postgresql/extension").install Dir["stage/**/extension/*"] bin.install Dir["stage/**/bin/*"] lib.install Dir["stage/**/lib/*"] include.install Dir["stage/**/include/*"] (share/"doc/postgresql/extension").install Dir["stage/**/share/doc/postgresql/extension/*"] (share/"postgresql/extension").install Dir["stage/**/share/postgresql/extension/*"] (share/"postgresql/contrib/postgis-2.4").install Dir["stage/**/contrib/postgis-*/*"] # Extension scripts bin.install %w[ utils/create_undef.pl utils/postgis_proc_upgrade.pl utils/postgis_restore.pl utils/profile_intersects.pl utils/test_estimation.pl utils/test_geography_estimation.pl utils/test_geography_joinestimation.pl utils/test_joinestimation.pl ] man1.install Dir["doc/**/*.1"] end def caveats <<~EOS To create a spatially-enabled database, see the documentation: https://postgis.net/docs/manual-2.4/postgis_installation.html#create_new_db_extensions If you are currently using PostGIS 2.0+, you can go the soft upgrade path: ALTER EXTENSION postgis UPDATE TO "#{version}"; Users of 1.5 and below will need to go the hard-upgrade path, see here: https://postgis.net/docs/manual-2.4/postgis_installation.html#upgrading PostGIS SQL scripts installed to: #{HOMEBREW_PREFIX}/share/postgresql/contrib/postgis-2.4 PostGIS plugin libraries installed to: #{HOMEBREW_PREFIX}/lib PostGIS extension modules installed to: #{HOMEBREW_PREFIX}/share/postgresql/extension EOS end test do require "base64" (testpath/"brew.shp").write ::Base64.decode64 <<~EOS AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoOgDAAALAAAAAAAAAAAAAAAA AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAEAAAASCwAAAAAAAAAAAPA/AAAAAAAA8D8AAAAAAAAA AAAAAAAAAAAAAAAAAgAAABILAAAAAAAAAAAACEAAAAAAAADwPwAAAAAAAAAA AAAAAAAAAAAAAAADAAAAEgsAAAAAAAAAAAAQQAAAAAAAAAhAAAAAAAAAAAAA AAAAAAAAAAAAAAQAAAASCwAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAA AAAAAAAAAAAABQAAABILAAAAAAAAAAAAAAAAAAAAAAAUQAAAAAAAACJAAAAA AAAAAEA= EOS (testpath/"brew.dbf").write ::Base64.decode64 <<~EOS A3IJGgUAAABhAFsAAAAAAAAAAAAAAAAAAAAAAAAAAABGSVJTVF9GTEQAAEMA AAAAMgAAAAAAAAAAAAAAAAAAAFNFQ09ORF9GTEQAQwAAAAAoAAAAAAAAAAAA AAAAAAAADSBGaXJzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgU2Vjb25kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFRoaXJkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgUG9pbnQgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBGb3VydGggICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgQXBwZW5kZWQgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAg EOS (testpath/"brew.shx").write ::Base64.decode64 <<~EOS AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARugDAAALAAAAAAAAAAAAAAAA AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAADIAAAASAAAASAAAABIAAABeAAAAEgAAAHQAAAASAAAA igAAABI= EOS result = shell_output("#{bin}/shp2pgsql #{testpath}/brew.shp") assert_match /Point/, result assert_match /AddGeometryColumn/, result end end ================================================ FILE: Formula/osgeo-postgis@2.5.rb ================================================ class OsgeoPostgisAT25 < Formula desc "Adds support for geographic objects to PostgreSQL" homepage "https://postgis.net/" url "https://github.com/postgis/postgis/archive/2.5.5.tar.gz" sha256 "24b15ee36f3af02015da0e92a18f9046ea0b4fd24896196c8e6c2aa8e4b56baa" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "9c33a980de9ef04d3c7f343ae48585e2b80ae62cfd89c3bb21ca57f352ecf685" => :catalina sha256 "9c33a980de9ef04d3c7f343ae48585e2b80ae62cfd89c3bb21ca57f352ecf685" => :mojave sha256 "9c33a980de9ef04d3c7f343ae48585e2b80ae62cfd89c3bb21ca57f352ecf685" => :high_sierra end #revision 5 head "https://github.com/postgis/postgis.git", :branch => "master" option "with-html-docs", "Generate multi-file HTML documentation" option "with-api-docs", "Generate developer API documentation (long process)" option "with-pg10", "Build with PostgreSQL 10 client" option "with-pg11", "Build with PostgreSQL 11 client" # keg_only "postgis is already provided by homebrew/core" # we will verify that other versions are not linked #depends_on Unlinked depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "gpp" => :build depends_on "pkg-config" => :build depends_on "geos" depends_on "json-c" # for GeoJSON and raster handling depends_on "libiconv" depends_on "libxml2" depends_on "libxslt" depends_on "pcre" depends_on "osgeo-proj" depends_on "sfcgal" # for advanced 2D/3D functions depends_on "protobuf-c" # Geobuf and Mapbox Vector Tile support depends_on "osgeo-gdal" # for GeoJSON and raster handling # The latest supported version of PostgreSQL by PostGIS 2.5 is 12, # and thus it's the standard version. # https://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQLPostGIS if build.with?("pg10") depends_on "osgeo-postgresql@10" elsif build.with?("pg11") depends_on "osgeo-postgresql@11" else depends_on "osgeo-postgresql" end depends_on "gtk+" # for gui if build.with? "html-docs" depends_on "imagemagick" depends_on "docbook-xsl" # docbook-xsl-nons end if build.with? "api-docs" depends_on "graphviz" depends_on "doxygen" end def install # Follow the PostgreSQL linked keg back to the active Postgres installation # as it is common for people to avoid upgrading Postgres. # postgres_realpath = Formula["postgresql"].opt_prefix.realpath ENV.append "CFLAGS", "-Diconv=libiconv -Diconv_open=libiconv_open -Diconv_close=libiconv_close" ENV.append "LDFLAGS", "-L#{Formula["libiconv"].opt_lib} -liconv" # ICONV_LDFLAGS ENV.deparallelize args = [ "--with-libiconv=#{Formula["libiconv"].opt_prefix}", "--with-xml2config=#{Formula["libxml2"].opt_bin}/xml2-config", "--with-geosconfig=#{Formula["geos"].opt_bin}/geos-config", "--with-sfcgal=#{Formula["sfcgal"].opt_bin}/sfcgal-config", "--with-projdir=#{Formula["osgeo-proj"].opt_prefix}", "--with-jsondir=#{Formula["json-c"].opt_prefix}", "--with-protobufdir=#{Formula["protobuf-c"].opt_prefix}", "--with-pcredir=#{Formula["pcre"].opt_prefix}", "--with-gdalconfig=#{Formula["osgeo-gdal"].opt_bin}/gdal-config", "--with-gui", "--with-raster", ] # By default PostGIS will try to detect gettext support and compile with it, # how ever if your un into incompatibility issues that cause breakage of loader, # you can disable it entirely with this command. Refer to ticket # http://trac.osgeo.org/postgis/ticket/748 for an example issue solved by # configuring with this. NOTE: that you aren’t missing much by turning this off. # This is used for international help/label support for the GUI loader which is not # yet documented and still experimental. args << "--with-gettext=no" # or PATH # Unfortunately, NLS support causes all kinds of headaches because # PostGIS gets all of its compiler flags from the PGXS makefiles. This # makes it nigh impossible to tell the buildsystem where our keg-only # gettext installations are. args << "--disable-nls" # Wagyu will only be necessary if protobuf is present to build MVTs # args << "--with-wagyu" # Disable topology support. # There is no corresponding library as all logic needed for # topology is in postgis- 3.0.2 library. # args << "--without-topology" # Disable the address_standardizer extension # args << "--without-address-standardizer" # specify the dtd path for mathml2.dtd # args << "--with-mathmldtd=PATH" args << "--with-xsldir=#{Formula["docbook-xsl"].opt_prefix}/docbook-xsl" if build.with? "html-docs" # /docbook-xsl-nons if build.with?("pg10") args << "--with-pgconfig=#{Formula["osgeo-postgresql@10"].opt_bin}/pg_config" elsif build.with?("pg11") args << "--with-pgconfig=#{Formula["osgeo-postgresql@11"].opt_bin}/pg_config" else args << "--with-pgconfig=#{Formula["osgeo-postgresql"].opt_bin}/pg_config" end system "./autogen.sh" system "./configure", *args system "make" if build.with? "html-docs" cd "doc" do ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" system "make", "chunked-html" doc.install "html" end end if build.with? "api-docs" cd "doc" do system "make", "doxygen" doc.install "doxygen/html" => "api" end end # PostGIS includes the PGXS makefiles and so will install __everything__ # into the Postgres keg instead of the PostGIS keg. Unfortunately, some # things have to be inside the Postgres keg in order to be function. So, we # install everything to a staging directory and manually move the pieces # into the appropriate prefixes. mkdir "stage" system "make", "install", "DESTDIR=#{buildpath}/stage" # Install PostGIS plugin libraries into the Postgres keg so that they can # be loaded and so PostGIS databases will continue to function even if # PostGIS is removed. # (postgres_realpath/"lib").install Dir["stage/**/*.so"] # Install extension scripts to the Postgres keg. # `CREATE EXTENSION postgis;` won't work if these are located elsewhere. # (postgres_realpath/"share/postgresql/extension").install Dir["stage/**/extension/*"] bin.install Dir["stage/**/bin/*"] lib.install Dir["stage/**/lib/*"] include.install Dir["stage/**/include/*"] pkgshare.install Dir["stage/**/contrib/postgis-*/*"] (share/"doc/postgresql/extension").install Dir["stage/**/share/doc/postgresql/extension/*"] (share/"postgresql/extension").install Dir["stage/**/share/postgresql/extension/*"] (share/"postgresql/contrib/postgis-2.5").install Dir["stage/**/contrib/postgis-*/*"] (share/"postgis_topology").install Dir["stage/**/contrib/postgis_topology-*/*"] # Extension scripts bin.install %w[ utils/create_undef.pl utils/postgis_proc_upgrade.pl utils/postgis_restore.pl utils/profile_intersects.pl utils/test_estimation.pl utils/test_geography_estimation.pl utils/test_geography_joinestimation.pl utils/test_joinestimation.pl ] man1.install Dir["doc/**/*.1"] end def caveats <<~EOS To create a spatially-enabled database, see the documentation: https://postgis.net/docs/manual-2.5/postgis_installation.html#create_new_db_extensions If you are currently using PostGIS 2.0+, you can go the soft upgrade path: ALTER EXTENSION postgis UPDATE TO "#{version}"; Users of 1.5 and below will need to go the hard-upgrade path, see here: https://postgis.net/docs/manual-2.5/postgis_installation.html#upgrading PostGIS SQL scripts installed to: #{HOMEBREW_PREFIX}/share/postgresql/contrib/postgis-2.5 PostGIS plugin libraries installed to: #{HOMEBREW_PREFIX}/lib PostGIS extension modules installed to: #{HOMEBREW_PREFIX}/share/postgresql/extension EOS end test do require "base64" (testpath/"brew.shp").write ::Base64.decode64 <<~EOS AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAoOgDAAALAAAAAAAAAAAAAAAA AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAEAAAASCwAAAAAAAAAAAPA/AAAAAAAA8D8AAAAAAAAA AAAAAAAAAAAAAAAAAgAAABILAAAAAAAAAAAACEAAAAAAAADwPwAAAAAAAAAA AAAAAAAAAAAAAAADAAAAEgsAAAAAAAAAAAAQQAAAAAAAAAhAAAAAAAAAAAAA AAAAAAAAAAAAAAQAAAASCwAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAA AAAAAAAAAAAABQAAABILAAAAAAAAAAAAAAAAAAAAAAAUQAAAAAAAACJAAAAA AAAAAEA= EOS (testpath/"brew.dbf").write ::Base64.decode64 <<~EOS A3IJGgUAAABhAFsAAAAAAAAAAAAAAAAAAAAAAAAAAABGSVJTVF9GTEQAAEMA AAAAMgAAAAAAAAAAAAAAAAAAAFNFQ09ORF9GTEQAQwAAAAAoAAAAAAAAAAAA AAAAAAAADSBGaXJzdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgU2Vjb25kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFRoaXJkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgUG9pbnQgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBGb3VydGggICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFBvaW50ICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgQXBwZW5kZWQgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBQb2ludCAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAg EOS (testpath/"brew.shx").write ::Base64.decode64 <<~EOS AAAnCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARugDAAALAAAAAAAAAAAAAAAA AAAAAADwPwAAAAAAABBAAAAAAAAAFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAADIAAAASAAAASAAAABIAAABeAAAAEgAAAHQAAAASAAAA igAAABI= EOS result = shell_output("#{bin}/shp2pgsql #{testpath}/brew.shp") assert_match(/Point/, result) assert_match(/AddGeometryColumn/, result) end end ================================================ FILE: Formula/osgeo-postgresql.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !osgeo_postgresql11_linked && !osgeo_postgresql10_linked && !core_postgresql_linked && !core_postgresql11_linked && !core_postgresql10_linked } def osgeo_postgresql11_linked Formula["osgeo-postgresql@11"].linked_keg.exist? rescue return false end def osgeo_postgresql10_linked Formula["osgeo-postgresql@10"].linked_keg.exist? rescue return false end def core_postgresql_linked Formula["postgresql"].linked_keg.exist? rescue return false end def core_postgresql11_linked Formula["postgresql@11"].linked_keg.exist? rescue return false end def core_postgresql10_linked Formula["postgresql@10"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 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 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 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 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 s end end class OsgeoPostgresql < Formula desc "Object-relational database system" homepage "https://www.postgresql.org/" url "https://ftp.postgresql.org/pub/source/v12.4/postgresql-12.4.tar.bz2" sha256 "bee93fbe2c32f59419cb162bcc0145c58da9a8644ee154a30b9a5ce47de606cc" bottle do root_url "https://bottle.download.osgeo.org" sha256 "c2ffac019bf7f8aed005fb3a0c50d2cfe30b7daf3a1edda9e415e64e0328a153" => :catalina sha256 "c2ffac019bf7f8aed005fb3a0c50d2cfe30b7daf3a1edda9e415e64e0328a153" => :mojave sha256 "c2ffac019bf7f8aed005fb3a0c50d2cfe30b7daf3a1edda9e415e64e0328a153" => :high_sierra end #revision 1 head "https://github.com/postgres/postgres.git", :branch => "master" option "with-cellar", "Use /Cellar in the path configuration (necessary for migration)" # keg_only "postgresql is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "pkg-config" => :build depends_on "gettext" depends_on "icu4c" depends_on "openldap" # libldap depends_on "openssl" depends_on "readline" depends_on "tcl-tk" depends_on "krb5" depends_on "libxml2" depends_on "python" depends_on "perl" depends_on "zlib" # depends_on "e2fsprogs" # others: pam def install # avoid adding the SDK library directory to the linker search path # XML2_CONFIG=: ENV["XML2_CONFIG"] = "xml2-config --exec-prefix=/usr" # As of Xcode/CLT 10.x the Perl headers were moved from /System # to inside the SDK, so we need to use `-iwithsysroot` instead # of `-I` to point to the correct location. # https://www.postgresql.org/message-id/153558865647.1483.573481613491501077%40wrigleys.postgresql.org ENV.prepend "LDFLAGS", "-L#{Formula["openssl"].opt_lib} -L#{Formula["readline"].opt_lib} -R#{lib}/postgresql" ENV.prepend "CPPFLAGS", "-I#{Formula["openssl"].opt_include} -I#{Formula["readline"].opt_include}" # ENV["PYTHON"] = which("python3") ENV["PYTHON"] = "#{Formula["python"].opt_bin}/python3" args = %W[ --disable-debug --enable-thread-safety --with-bonjour --with-gssapi --with-icu --with-ldap --with-libxml --with-libxslt --with-openssl --with-pam --with-perl --with-uuid=e2fs --enable-dtrace --enable-nls --with-python ] if build.with? "cellar" args += [ "--prefix=#{prefix}", # "bindir=#{bin}", # if define this, will refer to /Cellar "--datadir=#{share}/postgresql", "--libdir=#{lib}/postgresql", "--sysconfdir=#{etc}", "--docdir=#{doc}/postgresql", "--includedir=#{include}/postgresql" ] else # this is to not have the reference to /Cellar in the files args += [ "--prefix=#{prefix}", # "--bindir=#{HOMEBREW_PREFIX}/bin", "--sysconfdir=#{HOMEBREW_PREFIX}/etc", "--libdir=#{HOMEBREW_PREFIX}/lib", "--datadir=#{HOMEBREW_PREFIX}/share/postgresql", "--docdir=#{HOMEBREW_PREFIX}/share/doc/postgresql", "--localstatedir=#{HOMEBREW_PREFIX}/var", "--includedir=#{HOMEBREW_PREFIX}/include", "--datarootdir=#{HOMEBREW_PREFIX}/share", "--localedir=#{HOMEBREW_PREFIX}/share/locale", "--mandir=#{HOMEBREW_PREFIX}/share/man", ] # args << "--with-system-tzdata=#{HOMEBREW_PREFIX}/share/zoneinfo" # use system time zone data in DIR end dirs = [ # "bindir=#{bin}", "datadir=#{share}/postgresql", # #{pkgshare} "libdir=#{lib}", "pkglibdir=#{lib}/postgresql", # #{lib} "pkgincludedir=#{include}/postgresql", "sysconfdir=#{etc}", "includedir=#{include}", "localedir=#{share}/locale", "mandir=#{man}", "docdir=#{share}/doc/postgresql", ] # The CLT is required to build Tcl support on 10.7 and 10.8 because # tclConfig.sh is not part of the SDK args << "--with-tcl" if File.exist?("#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework/tclConfig.sh") args << "--with-tclconfig=#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework" end # Add include and library directories of dependencies, so that # they can be used for compiling extensions. Superenv does this # when compiling this package, but won't record it for pg_config. deps = %w[gettext icu4c openldap openssl readline tcl-tk] with_includes = deps.map { |f| Formula[f].opt_include }.join(":") with_libraries = deps.map { |f| Formula[f].opt_lib }.join(":") args << "--with-includes=#{with_includes}" args << "--with-libraries=#{with_libraries}" ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" system "./configure", *args system "make" # Temporarily disable building/installing the documentation. # Postgresql seems to "know" the build system has been altered and # tries to regenerate the documentation when using `install-world`. # This results in the build failing: # `ERROR: `osx' is missing on your system.` # Attempting to fix that by adding a dependency on `open-sp` doesn't # work and the build errors out on generating the documentation, so # for now let's simply omit it so we can package Postgresql for Mojave. # if DevelopmentTools.clang_build_version >= 1000 system "make", "all" system "make", "-C", "contrib", "install", "all", *dirs system "make", "install", "all", *dirs # else # system "make", "install-world", *dirs # end end def post_install # (var/"log").mkpath # (var/"postgresql").mkpath # unless File.exist? "#{var}/postgresql/PG_VERSION" # system "#{bin}/initdb", "#{var}/postgresql" # end if build.with? "cellar" if File.exists?(File.join("#{HOMEBREW_PREFIX}/Cellar", "osgeo-postgis@2.4")) unless File.exists?("#{HOMEBREW_PREFIX}/opt/osgeo-postgresql/lib/postgresql/postgis-2.4.so") # copy postgis 2.4.x to postgresql 11.x FileUtils.cp_r "#{Formula["osgeo-postgis@2.4"].opt_share}/postgresql/.", "#{share}/postgresql/" FileUtils.cp_r "#{Formula["osgeo-postgis@2.4"].opt_lib}/postgresql/.", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis@2.4"].opt_lib}/postgresql/rtpostgis-2.4.so", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis@2.4"].opt_lib}/postgresql/postgis-2.4.so", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis@2.4"].opt_lib}/postgresql/postgis_topology-2.4.so", "#{lib}/postgresql/" end end # if File.exists?(File.join("#{HOMEBREW_PREFIX}/Cellar", "osgeo-postgis")) # unless File.exists?("#{HOMEBREW_PREFIX}/opt/osgeo-postgresql/lib/postgresql/postgis-2.5.so") # # install postgis 2.5.x to postgresql 11.x # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_share}/postgresql/.", "#{share}/postgresql/" # # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/.", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/rtpostgis-2.5.so", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/postgis-2.5.so", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/postgis_topology-2.5.so", "#{lib}/postgresql/" # end # end end end def caveats; <<~EOS 1 - If you need to link "#{name}": \e[32m$ brew link #{name} --force\e[0m Previously unlink any other version that you have installed. 2 - If you need to init postgresql just execute the following command: \e[32m$ initdb #{HOMEBREW_PREFIX}/var/postgresql -E utf8 --locale=en_US.UTF-8\e[0m If the file "#{HOMEBREW_PREFIX}/var/postgresql/PG_VERSION" exists, it is because you already created this in postinstall or a previous installation. 3 - Start using: \e[32m$ pg_ctl start -D /usr/local/var/postgresql\e[0m 4 - Connecting to our new database \e[32m$ psql -h localhost -d postgres\e[0m Note: - Services doesn't start properly, add to \e[32mhomebrew.mxcl.osgeo-postgresql.plist\e[0m: \e[32mEnvironmentVariables\e[0m \e[32m\e[0m \e[32mLC_ALL\e[0m \e[32men_US.UTF-8\e[0m \e[32m\e[0m issue: \e[32mhttps://github.com/OSGeo/homebrew-osgeo4mac/issues/1075#issuecomment-490052517\e[0m - Could not bind ipv6 address database system was not properly shut: \e[32m$ sudo lsof -i :5432\e[0m (search PID) \e[32m$ kill PID\e[0m - To migrate existing data from a previous major version of PostgreSQL run: \e[32m$ brew postgresql-upgrade-database\e[0m - For more information see our page with documentation: \e[32mhttps://osgeo.github.io/homebrew-osgeo4mac\e[0m EOS end plist_options :manual => "pg_ctl -D #{HOMEBREW_PREFIX}/var/postgresql start" def plist; <<~EOS KeepAlive Label #{plist_name} ProgramArguments #{opt_bin}/postgres -D #{var}/postgresql RunAtLoad WorkingDirectory #{HOMEBREW_PREFIX} StandardOutPath #{var}/log/postgresql.log StandardErrorPath #{var}/log/postgresql.log EOS end test do ENV["LC_ALL"]="en_US.UTF-8" ENV["LC_CTYPE"]="en_US.UTF-8" system "#{bin}/initdb", testpath/"test" if build.with? "cellar" assert_equal (share/"postgresql").to_s, shell_output("#{bin}/pg_config --sharedir").chomp assert_equal (lib/"postgresql").to_s, shell_output("#{bin}/pg_config --libdir").chomp assert_equal (lib/"postgresql").to_s, shell_output("#{bin}/pg_config --pkglibdir").chomp else assert_equal "#{HOMEBREW_PREFIX}/share/postgresql", shell_output("#{bin}/pg_config --sharedir").chomp assert_equal "#{HOMEBREW_PREFIX}/lib", shell_output("#{bin}/pg_config --libdir").chomp assert_equal "#{HOMEBREW_PREFIX}/lib/postgresql", shell_output("#{bin}/pg_config --pkglibdir").chomp end end end ================================================ FILE: Formula/osgeo-postgresql@10.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !osgeo_postgresql11_linked && !osgeo_postgresql_linked && !core_postgresql_linked && !core_postgresql11_linked && !core_postgresql10_linked } def osgeo_postgresql_linked Formula["osgeo-postgresql"].linked_keg.exist? rescue return false end def osgeo_postgresql11_linked Formula["osgeo-postgresql@11"].linked_keg.exist? rescue return false end def core_postgresql_linked Formula["postgresql"].linked_keg.exist? rescue return false end def core_postgresql11_linked Formula["postgresql@11"].linked_keg.exist? rescue return false end def core_postgresql10_linked Formula["postgresql@10"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 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 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 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 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 s end end class OsgeoPostgresqlAT10 < Formula desc "Relational database management system" homepage "https://www.postgresql.org/" url "https://ftp.postgresql.org/pub/source/v10.14/postgresql-10.14.tar.bz2" sha256 "381cd8f491d8f77db2f4326974542a50095b5fa7709f24d7c5b760be2518b23b" #revision 1 head "https://github.com/postgres/postgres.git", :branch => "REL_10_STABLE" bottle do root_url "https://bottle.download.osgeo.org" sha256 "128325ac2bd019ac15159a331d5b18fde8a82657a5df25d868cba91426897d45" => :catalina sha256 "128325ac2bd019ac15159a331d5b18fde8a82657a5df25d868cba91426897d45" => :mojave sha256 "128325ac2bd019ac15159a331d5b18fde8a82657a5df25d868cba91426897d45" => :high_sierra end option "with-cellar", "Use /Cellar in the path configuration (necessary for migration)" # keg_only :versioned_formula # we will verify that other versions are not linked depends_on Unlinked depends_on "pkg-config" => :build depends_on "gettext" depends_on "icu4c" depends_on "openldap" # libldap depends_on "openssl" depends_on "readline" depends_on "tcl-tk" depends_on "krb5" depends_on "libxml2" depends_on "python" depends_on "perl" depends_on "zlib" # depends_on "e2fsprogs" # others: pam def install # avoid adding the SDK library directory to the linker search path # XML2_CONFIG=: ENV["XML2_CONFIG"] = "xml2-config --exec-prefix=/usr" # As of Xcode/CLT 10.x the Perl headers were moved from /System # to inside the SDK, so we need to use `-iwithsysroot` instead # of `-I` to point to the correct location. # https://www.postgresql.org/message-id/153558865647.1483.573481613491501077%40wrigleys.postgresql.org ENV.prepend "LDFLAGS", "-L#{Formula["openssl"].opt_lib} -L#{Formula["readline"].opt_lib} -R#{lib}/postgresql" ENV.prepend "CPPFLAGS", "-I#{Formula["openssl"].opt_include} -I#{Formula["readline"].opt_include}" # ENV["PYTHON"] = which("python3") ENV["PYTHON"] = "#{Formula["python"].opt_bin}/python3" args = %W[ --disable-debug --enable-thread-safety --with-bonjour --with-gssapi --with-icu --with-ldap --with-libxml --with-libxslt --with-openssl --with-pam --with-perl --enable-dtrace --enable-nls --with-python ] # --with-uuid=e2fs if build.with? "cellar" args += [ "--prefix=#{prefix}", # "bindir=#{bin}", # if define this, will refer to /Cellar "--datadir=#{share}/postgresql", "--libdir=#{lib}/postgresql", "--sysconfdir=#{etc}", "--docdir=#{doc}/postgresql", "--includedir=#{include}/postgresql" ] else # this is to not have the reference to /Cellar in the files args += [ "--prefix=#{prefix}", # "--bindir=#{HOMEBREW_PREFIX}/bin", "--sysconfdir=#{HOMEBREW_PREFIX}/etc", "--libdir=#{HOMEBREW_PREFIX}/lib", "--datadir=#{HOMEBREW_PREFIX}/share/postgresql", "--docdir=#{HOMEBREW_PREFIX}/share/doc/postgresql", "--localstatedir=#{HOMEBREW_PREFIX}/var", "--includedir=#{HOMEBREW_PREFIX}/include", "--datarootdir=#{HOMEBREW_PREFIX}/share", "--localedir=#{HOMEBREW_PREFIX}/share/locale", "--mandir=#{HOMEBREW_PREFIX}/share/man", ] # args << "--with-system-tzdata=#{HOMEBREW_PREFIX}/share/zoneinfo" # use system time zone data in DIR end dirs = [ # "bindir=#{bin}", "datadir=#{share}/postgresql", # #{pkgshare} "libdir=#{lib}", "pkglibdir=#{lib}/postgresql", # #{lib} "pkgincludedir=#{include}/postgresql", "sysconfdir=#{etc}", "includedir=#{include}", "localedir=#{share}/locale", "mandir=#{man}", "docdir=#{share}/doc/postgresql", ] # The CLT is required to build Tcl support on 10.7 and 10.8 because # tclConfig.sh is not part of the SDK args << "--with-tcl" if File.exist?("#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework/tclConfig.sh") args << "--with-tclconfig=#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework" end # Add include and library directories of dependencies, so that # they can be used for compiling extensions. Superenv does this # when compiling this package, but won't record it for pg_config. deps = %w[gettext icu4c openldap openssl readline tcl-tk] with_includes = deps.map { |f| Formula[f].opt_include }.join(":") with_libraries = deps.map { |f| Formula[f].opt_lib }.join(":") args << "--with-includes=#{with_includes}" args << "--with-libraries=#{with_libraries}" ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" system "./configure", *args system "make" # Temporarily disable building/installing the documentation. # Postgresql seems to "know" the build system has been altered and # tries to regenerate the documentation when using `install-world`. # This results in the build failing: # `ERROR: `osx' is missing on your system.` # Attempting to fix that by adding a dependency on `open-sp` doesn't # work and the build errors out on generating the documentation, so # for now let's simply omit it so we can package Postgresql for Mojave. # if DevelopmentTools.clang_build_version >= 1000 system "make", "all" system "make", "-C", "contrib", "install", "all", *dirs system "make", "install", "all", *dirs # else # system "make", "install-world", *dirs # end end def post_install # (var/"log").mkpath # (var/"postgresql@10").mkpath # unless File.exist? "#{var}/postgresql@10/PG_VERSION" # system "#{bin}/initdb", "#{var}/postgresql@10" # end # if build.with? "cellar" # if File.exists?(File.join("#{HOMEBREW_PREFIX}/Cellar", "osgeo-postgis@2.4")) # unless File.exists?("#{HOMEBREW_PREFIX}/opt/osgeo-postgresql@10/lib/postgresql/postgis-2.4.so") # # copy postgis 2.4.x to postgresql 10.x # FileUtils.cp_r "#{Formula["osgeo-postgis@2.4"].opt_share}/postgresql/.", "#{share}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis@2.4"].opt_lib}/postgresql/.", "#{lib}/postgresql/" # # FileUtils.cp_r "#{Formula["osgeo-postgis@2.4"].opt_lib}/postgresql/rtpostgis-2.4.so", "#{lib}/postgresql/" # # FileUtils.cp_r "#{Formula["osgeo-postgis@2.4"].opt_lib}/postgresql/postgis-2.4.so", "#{lib}/postgresql/" # # FileUtils.cp_r "#{Formula["osgeo-postgis@2.4"].opt_lib}/postgresql/postgis_topology-2.4.so", "#{lib}/postgresql/" # end # end # # # if File.exists?(File.join("#{HOMEBREW_PREFIX}/Cellar", "osgeo-postgis")) # # unless File.exists?("#{HOMEBREW_PREFIX}/opt/osgeo-postgresql@10/lib/postgresql/postgis-2.5.so") # # # install postgis 2.5.x to postgresql 10.x # # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_share}/postgresql/.", "#{share}/postgresql/" # # # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/.", "#{lib}/postgresql/" # # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/rtpostgis-2.5.so", "#{lib}/postgresql/" # # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/postgis-2.5.so", "#{lib}/postgresql/" # # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/postgis_topology-2.5.so", "#{lib}/postgresql/" # # end # # end # end end def caveats; <<~EOS 1 - If you need to link "#{name}": \e[32m$ brew link #{name} --force\e[0m Previously unlink any other version that you have installed. 2 - If you need to init postgresql just execute the following command: \e[32m$ initdb #{HOMEBREW_PREFIX}/var/postgresql@10 -E utf8 --locale=en_US.UTF-8\e[0m If the file "#{HOMEBREW_PREFIX}/var/postgresql@10/PG_VERSION" exists, it is because you already created this in postinstall or a previous installation. 3 - Start using: \e[32m$ pg_ctl start -D /usr/local/var/postgresql@10\e[0m 4 - Connecting to our new database \e[32m$ psql -h localhost -d postgres\e[0m Note: - Services doesn't start properly, add to \e[32mhomebrew.mxcl.osgeo-postgresql@10.plist\e[0m: \e[32mEnvironmentVariables\e[0m \e[32m\e[0m \e[32mLC_ALL\e[0m \e[32men_US.UTF-8\e[0m \e[32m\e[0m issue: \e[32mhttps://github.com/OSGeo/homebrew-osgeo4mac/issues/1075#issuecomment-490052517\e[0m - Could not bind ipv6 address database system was not properly shut: \e[32m$ sudo lsof -i :5432\e[0m (search PID) \e[32m$ kill PID\e[0m - To migrate existing data from a previous major version of PostgreSQL run: \e[32m$ brew postgresql-upgrade-database\e[0m - For more information see our page with documentation: \e[32mhttps://osgeo.github.io/homebrew-osgeo4mac\e[0m EOS end plist_options :manual => "pg_ctl -D #{HOMEBREW_PREFIX}/var/postgresql@10 start" def plist; <<~EOS KeepAlive Label #{plist_name} ProgramArguments #{opt_bin}/postgres -D #{var}/postgresql@10 RunAtLoad WorkingDirectory #{HOMEBREW_PREFIX} StandardOutPath #{var}/log/postgresql@10.log StandardErrorPath #{var}/log/postgresql@10.log EOS end test do ENV["LC_ALL"]="en_US.UTF-8" ENV["LC_CTYPE"]="en_US.UTF-8" system "#{bin}/initdb", testpath/"test" if build.with? "cellar" assert_equal (share/"postgresql").to_s, shell_output("#{bin}/pg_config --sharedir").chomp assert_equal (lib/"postgresql").to_s, shell_output("#{bin}/pg_config --libdir").chomp assert_equal (lib/"postgresql").to_s, shell_output("#{bin}/pg_config --pkglibdir").chomp else assert_equal "#{HOMEBREW_PREFIX}/share/postgresql", shell_output("#{bin}/pg_config --sharedir").chomp assert_equal "#{HOMEBREW_PREFIX}/lib", shell_output("#{bin}/pg_config --libdir").chomp assert_equal "#{HOMEBREW_PREFIX}/lib/postgresql", shell_output("#{bin}/pg_config --pkglibdir").chomp end end end ================================================ FILE: Formula/osgeo-postgresql@11.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !osgeo_postgresql_linked && !osgeo_postgresql10_linked && !core_postgresql_linked && !core_postgresql11_linked && !core_postgresql10_linked } def osgeo_postgresql_linked Formula["osgeo-postgresql"].linked_keg.exist? rescue return false end def osgeo_postgresql10_linked Formula["osgeo-postgresql@10"].linked_keg.exist? rescue return false end def core_postgresql_linked Formula["postgresql"].linked_keg.exist? rescue return false end def core_postgresql11_linked Formula["postgresql@11"].linked_keg.exist? rescue return false end def core_postgresql10_linked Formula["postgresql@10"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 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 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 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 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 s end end class OsgeoPostgresqlAT11 < Formula desc "Object-relational database system" homepage "https://www.postgresql.org/" url "https://ftp.postgresql.org/pub/source/v11.9/postgresql-11.9.tar.bz2" sha256 "35618aa72e0372091f923c42389c6febd07513157b4fbb9408371706afbb6635" bottle do root_url "https://bottle.download.osgeo.org" sha256 "9746c2b686fc3a568f0c7062e62d517917612991832918eff4062627245701bd" => :catalina sha256 "9746c2b686fc3a568f0c7062e62d517917612991832918eff4062627245701bd" => :mojave sha256 "9746c2b686fc3a568f0c7062e62d517917612991832918eff4062627245701bd" => :high_sierra end #revision 2 head "https://github.com/postgres/postgres.git", :branch => "master" option "with-cellar", "Use /Cellar in the path configuration (necessary for migration)" # keg_only "postgresql is already provided by homebrew/core" # we will verify that other versions are not linked #depends_on Unlinked depends_on "pkg-config" => :build depends_on "gettext" depends_on "icu4c" depends_on "openldap" # libldap depends_on "openssl" depends_on "readline" depends_on "tcl-tk" depends_on "krb5" depends_on "libxml2" depends_on "python" depends_on "perl" depends_on "zlib" # depends_on "e2fsprogs" # others: pam def install # avoid adding the SDK library directory to the linker search path # XML2_CONFIG=: ENV["XML2_CONFIG"] = "xml2-config --exec-prefix=/usr" # As of Xcode/CLT 10.x the Perl headers were moved from /System # to inside the SDK, so we need to use `-iwithsysroot` instead # of `-I` to point to the correct location. # https://www.postgresql.org/message-id/153558865647.1483.573481613491501077%40wrigleys.postgresql.org ENV.prepend "LDFLAGS", "-L#{Formula["openssl"].opt_lib} -L#{Formula["readline"].opt_lib} -R#{lib}/postgresql" ENV.prepend "CPPFLAGS", "-I#{Formula["openssl"].opt_include} -I#{Formula["readline"].opt_include}" # ENV["PYTHON"] = which("python3") ENV["PYTHON"] = "#{Formula["python"].opt_bin}/python3" args = %W[ --disable-debug --enable-thread-safety --with-bonjour --with-gssapi --with-icu --with-ldap --with-libxml --with-libxslt --with-openssl --with-pam --with-perl --with-uuid=e2fs --enable-dtrace --enable-nls --with-python ] if build.with? "cellar" args += [ "--prefix=#{prefix}", # "bindir=#{bin}", # if define this, will refer to /Cellar "--datadir=#{share}/postgresql", "--libdir=#{lib}/postgresql", "--sysconfdir=#{etc}", "--docdir=#{doc}/postgresql", "--includedir=#{include}/postgresql" ] else # this is to not have the reference to /Cellar in the files args += [ "--prefix=#{prefix}", # "--bindir=#{HOMEBREW_PREFIX}/bin", "--sysconfdir=#{HOMEBREW_PREFIX}/etc", "--libdir=#{HOMEBREW_PREFIX}/lib", "--datadir=#{HOMEBREW_PREFIX}/share/postgresql", "--docdir=#{HOMEBREW_PREFIX}/share/doc/postgresql", "--localstatedir=#{HOMEBREW_PREFIX}/var", "--includedir=#{HOMEBREW_PREFIX}/include", "--datarootdir=#{HOMEBREW_PREFIX}/share", "--localedir=#{HOMEBREW_PREFIX}/share/locale", "--mandir=#{HOMEBREW_PREFIX}/share/man", ] # args << "--with-system-tzdata=#{HOMEBREW_PREFIX}/share/zoneinfo" # use system time zone data in DIR end dirs = [ # "bindir=#{bin}", "datadir=#{share}/postgresql", # #{pkgshare} "libdir=#{lib}", "pkglibdir=#{lib}/postgresql", # #{lib} "pkgincludedir=#{include}/postgresql", "sysconfdir=#{etc}", "includedir=#{include}", "localedir=#{share}/locale", "mandir=#{man}", "docdir=#{share}/doc/postgresql", ] # The CLT is required to build Tcl support on 10.7 and 10.8 because # tclConfig.sh is not part of the SDK args << "--with-tcl" if File.exist?("#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework/tclConfig.sh") args << "--with-tclconfig=#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework" end # Add include and library directories of dependencies, so that # they can be used for compiling extensions. Superenv does this # when compiling this package, but won't record it for pg_config. deps = %w[gettext icu4c openldap openssl readline tcl-tk] with_includes = deps.map { |f| Formula[f].opt_include }.join(":") with_libraries = deps.map { |f| Formula[f].opt_lib }.join(":") args << "--with-includes=#{with_includes}" args << "--with-libraries=#{with_libraries}" ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" system "./configure", *args system "make" # Temporarily disable building/installing the documentation. # Postgresql seems to "know" the build system has been altered and # tries to regenerate the documentation when using `install-world`. # This results in the build failing: # `ERROR: `osx' is missing on your system.` # Attempting to fix that by adding a dependency on `open-sp` doesn't # work and the build errors out on generating the documentation, so # for now let's simply omit it so we can package Postgresql for Mojave. # if DevelopmentTools.clang_build_version >= 1000 system "make", "all" system "make", "-C", "contrib", "install", "all", *dirs system "make", "install", "all", *dirs # else # system "make", "install-world", *dirs # end end def post_install # (var/"log").mkpath # (var/"postgresql").mkpath # unless File.exist? "#{var}/postgresql/PG_VERSION" # system "#{bin}/initdb", "#{var}/postgresql" # end if build.with? "cellar" if File.exists?(File.join("#{HOMEBREW_PREFIX}/Cellar", "osgeo-postgis@2.5")) unless File.exists?("#{HOMEBREW_PREFIX}/opt/osgeo-postgresql/lib/postgresql/postgis-2.5.so") # copy postgis 2.5.x to postgresql 11.x FileUtils.cp_r "#{Formula["osgeo-postgis@2.5"].opt_share}/postgresql/.", "#{share}/postgresql/" FileUtils.cp_r "#{Formula["osgeo-postgis@2.5"].opt_lib}/postgresql/.", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis@2.5"].opt_lib}/postgresql/rtpostgis-2.5.so", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis@2.5"].opt_lib}/postgresql/postgis-2.5.so", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis@2.5"].opt_lib}/postgresql/postgis_topology-2.5.so", "#{lib}/postgresql/" end end # if File.exists?(File.join("#{HOMEBREW_PREFIX}/Cellar", "osgeo-postgis")) # unless File.exists?("#{HOMEBREW_PREFIX}/opt/osgeo-postgresql/lib/postgresql/postgis-2.5.so") # # install postgis 2.5.x to postgresql 11.x # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_share}/postgresql/.", "#{share}/postgresql/" # # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/.", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/rtpostgis-2.5.so", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/postgis-2.5.so", "#{lib}/postgresql/" # FileUtils.cp_r "#{Formula["osgeo-postgis"].opt_lib}/postgresql/postgis_topology-2.5.so", "#{lib}/postgresql/" # end # end end end def caveats; <<~EOS 1 - If you need to link "#{name}": \e[32m$ brew link #{name} --force\e[0m Previously unlink any other version that you have installed. 2 - If you need to init postgresql just execute the following command: \e[32m$ initdb #{HOMEBREW_PREFIX}/var/postgresql -E utf8 --locale=en_US.UTF-8\e[0m If the file "#{HOMEBREW_PREFIX}/var/postgresql/PG_VERSION" exists, it is because you already created this in postinstall or a previous installation. 3 - Start using: \e[32m$ pg_ctl start -D /usr/local/var/postgresql\e[0m 4 - Connecting to our new database \e[32m$ psql -h localhost -d postgres\e[0m Note: - Services doesn't start properly, add to \e[32mhomebrew.mxcl.osgeo-postgresql.plist\e[0m: \e[32mEnvironmentVariables\e[0m \e[32m\e[0m \e[32mLC_ALL\e[0m \e[32men_US.UTF-8\e[0m \e[32m\e[0m issue: \e[32mhttps://github.com/OSGeo/homebrew-osgeo4mac/issues/1075#issuecomment-490052517\e[0m - Could not bind ipv6 address database system was not properly shut: \e[32m$ sudo lsof -i :5432\e[0m (search PID) \e[32m$ kill PID\e[0m - To migrate existing data from a previous major version of PostgreSQL run: \e[32m$ brew postgresql-upgrade-database\e[0m - For more information see our page with documentation: \e[32mhttps://osgeo.github.io/homebrew-osgeo4mac\e[0m EOS end plist_options :manual => "pg_ctl -D #{HOMEBREW_PREFIX}/var/postgresql start" def plist; <<~EOS KeepAlive Label #{plist_name} ProgramArguments #{opt_bin}/postgres -D #{var}/postgresql RunAtLoad WorkingDirectory #{HOMEBREW_PREFIX} StandardOutPath #{var}/log/postgresql.log StandardErrorPath #{var}/log/postgresql.log EOS end test do ENV["LC_ALL"]="en_US.UTF-8" ENV["LC_CTYPE"]="en_US.UTF-8" system "#{bin}/initdb", testpath/"test" if build.with? "cellar" assert_equal (share/"postgresql").to_s, shell_output("#{bin}/pg_config --sharedir").chomp assert_equal (lib/"postgresql").to_s, shell_output("#{bin}/pg_config --libdir").chomp assert_equal (lib/"postgresql").to_s, shell_output("#{bin}/pg_config --pkglibdir").chomp else assert_equal "#{HOMEBREW_PREFIX}/share/postgresql", shell_output("#{bin}/pg_config --sharedir").chomp assert_equal "#{HOMEBREW_PREFIX}/lib", shell_output("#{bin}/pg_config --libdir").chomp assert_equal "#{HOMEBREW_PREFIX}/lib/postgresql", shell_output("#{bin}/pg_config --pkglibdir").chomp end end end ================================================ FILE: Formula/osgeo-proj.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_proj_linked } def core_proj_linked Formula["proj"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoProj < Formula desc "Cartographic Projections Library" homepage "https://proj.org/" url "https://github.com/OSGeo/PROJ/releases/download/6.3.2/proj-6.3.2.tar.gz" sha256 "cb776a70f40c35579ae4ba04fb4a388c1d1ce025a1df6171350dc19f25b80311" bottle do root_url "https://bottle.download.osgeo.org" sha256 "729a8816d46c6f3293951bf7f68d6b6e32bb13e4c75f339a29140f44b5ffa2e7" => :catalina sha256 "729a8816d46c6f3293951bf7f68d6b6e32bb13e4c75f339a29140f44b5ffa2e7" => :mojave sha256 "729a8816d46c6f3293951bf7f68d6b6e32bb13e4c75f339a29140f44b5ffa2e7" => :high_sierra end # revision 1 # keg_only "proj is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked head do url "https://github.com/OSGeo/PROJ.git", :branch => "master" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end depends_on "pkg-config" => :build # depends_on "libtiff" Proj >7 conflicts_with "blast", :because => "both install a `libproj.a` library" skip_clean :la # The datum grid files are required to support datum shifting Proj <7 # TODO: If needed, include content from https://github.com/OSGeo/PROJ-data #resource "projdata" do resource "datumgrid" do url "https://download.osgeo.org/proj/proj-datumgrid-1.8.zip" sha256 "b9838ae7e5f27ee732fb0bfed618f85b36e8bb56d7afb287d506338e9f33861e" end def install #(buildpath).install resource("projdata") (buildpath/"nad").install resource("datumgrid") system "./autogen.sh" if build.head? system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make", "install" end test do (testpath/"test").write <<~EOS 45d15n 71d07w Boston, United States 40d40n 73d58w New York, United States 48d51n 2d20e Paris, France 51d30n 7'w London, England EOS match = <<~EOS -4887590.49\t7317961.48 Boston, United States -5542524.55\t6982689.05 New York, United States 171224.94\t5415352.81 Paris, France -8101.66\t5707500.23 London, England EOS output = shell_output("#{bin}/proj +proj=poly +ellps=clrk66 -r #{testpath}/test") assert_equal match, output end end ================================================ FILE: Formula/osgeo-psqlodbc.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_psqlodbc_linked } def core_psqlodbc_linked Formula["psqlodbc"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoPsqlodbc < Formula desc "Official PostgreSQL ODBC driver" homepage "https://odbc.postgresql.org" url "https://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-12.02.0000.tar.gz" sha256 "7b00d99ee729c06cfc784ab43deb7dee77761b667dd62122c2cb0cd7b043ba67" #revision 3 bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "a9085711555601a64b30ee356643a2dfbecc7ff9ccd254c477d7977b66e0d365" => :catalina sha256 "a9085711555601a64b30ee356643a2dfbecc7ff9ccd254c477d7977b66e0d365" => :mojave sha256 "a9085711555601a64b30ee356643a2dfbecc7ff9ccd254c477d7977b66e0d365" => :high_sierra end # revision 1 head do url "https://git.postgresql.org/git/psqlodbc.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end option "with-pg11", "Build with PostgreSQL 11 client" # keg_only "psqlodbc is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "openssl" depends_on "unixodbc" if build.with?("pg11") depends_on "osgeo-postgresql@11" else depends_on "osgeo-postgresql" end def install system "./bootstrap" if build.head? system "./configure", "--prefix=#{prefix}", "--with-unixodbc=#{Formula["unixodbc"].opt_prefix}" system "make" system "make", "install" end test do output = shell_output("#{Formula["unixodbc"].bin}/dltest #{lib}/psqlodbcw.so") assert_equal "SUCCESS: Loaded #{lib}/psqlodbcw.so\n", output end end ================================================ FILE: Formula/osgeo-pyqt-webkit.rb ================================================ class OsgeoPyqtWebkit < Formula desc "Python bindings for v5 of Qt's Webkit" homepage "https://www.riverbankcomputing.com/software/pyqt/intro" url "https://www.riverbankcomputing.com/static/Downloads/PyQt5/5.13.2/PyQt5-5.13.2.tar.gz" sha256 "adc17c077bf233987b8e43ada87d1e0deca9bd71a13e5fd5fc377482ed69c827" revision 2 bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "1e04c2744db39236c0f356fcaf118b9486912e91a348b9040fc1a8d088e7d1e9" => :catalina sha256 "1e04c2744db39236c0f356fcaf118b9486912e91a348b9040fc1a8d088e7d1e9" => :mojave sha256 "1e04c2744db39236c0f356fcaf118b9486912e91a348b9040fc1a8d088e7d1e9" => :high_sierra end option "with-debug", "Build with debug symbols" keg_only "PyQt 5 Webkit has CMake issues when linked" # Error: Failed to fix install linkage # adding -DCMAKE_INSTALL_NAME_DIR=#{lib} and -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON # to the CMake arguments will fix the problem. depends_on "python" depends_on "qt" depends_on "osgeo-sip" depends_on "osgeo-pyqt" depends_on "osgeo-qt-webkit" def install # sneak the WebKit modules into the Qt.modules setup before referencing in .pro files wk_mods = Formula["osgeo-qt-webkit"].opt_prefix/"mkspecs/modules" inreplace "configure.py" do |s| s.sub! /('TEMPLATE = lib'\])/, "\\1\n" + <<-EOS pro_lines.append('include(#{wk_mods}/qt_lib_webkit.pri)') pro_lines.append('include(#{wk_mods}/qt_lib_webkitwidgets.pri)') EOS end version = Language::Python.major_minor_version "python3" args = ["--confirm-license", "--bindir=#{bin}", "--destdir=#{lib}/python#{version}/site-packages", "--stubsdir=#{lib}/python#{version}/site-packages/PyQt5", "--sipdir=#{share}/sip/PyQt5", # sip.h could not be found automatically "--sip-incdir=#{Formula["osgeo-sip"].opt_include}", "--qmake=#{Formula["qt"].bin}/qmake", # Force deployment target to avoid libc++ issues "QMAKE_MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}", "--enable=QtWebKit", "--enable=QtWebKitWidgets", "--no-designer-plugin", "--no-python-dbus", "--no-qml-plugin", "--no-qsci-api", "--no-sip-files", "--no-tools", "--verbose", "--no-dist-info" ] args << "--debug" if build.with? "debug" system "python3", "configure.py", *args system "make" system "make", "install" system "make", "clean" # clean out non-WebKit artifacts (already in pyqt5 formula prefix) rm_r prefix/"share" cd "#{lib}/python#{version}/site-packages/PyQt5" do rm "__init__.py" rm "Qt.so" rm_r "uic" end end test do version = Language::Python.major_minor_version "python3" ENV["PYTHONPATH"] = lib/"python#{version}/site-packages" system "python3", "-c", '"import PyQt5.QtWebKit"' system "python3", "-c", '"import PyQt5.QtWebKitWidgets"' end end ================================================ FILE: Formula/osgeo-pyspatialite.rb ================================================ class OsgeoPyspatialite < Formula desc "DB-API 2.0 interface for SQLite with Spatialite" homepage "https://code.google.com/p/pyspatialite" revision 4 head "https://code.google.com/p/pyspatialite/", :using => :hg stable do # temporary download of source, prior to pyspatialite move to github url "https://osgeo4mac.s3.amazonaws.com/src/pyspatialite-3.0.1.tar.gz" sha256 "81a3e4966fb6348802a985486cbf62e019a0fcb0a1e006b9522e8b02dc08f238" patch do # Patch to work with libspatialite 4.x, drop amalgamation support, dynamically # link libspatialite and sqlite3, and fix redeclaration build error # Reported upstream: http://code.google.com/p/pyspatialite/issues/detail?id=15 # (not tested/supported with HEAD builds) url "https://gist.github.com/dakcarto/7510460/raw/2e56dd217c19d8dd661e4d3ffb2b669f34da580b/pyspatialite-3.0.1-Mac-patch.diff" sha256 "8696caaadfc6edf9aa159fe61ed44ce1eac23da2fd68c242148fc2218e6c6901" end end bottle do root_url "https://bottle.download.osgeo.org" cellar :any rebuild 1 sha256 "e092709d45638000fc044d2072230ed80abd586513b90539872e1113cd0da6a5" => :mojave sha256 "e092709d45638000fc044d2072230ed80abd586513b90539872e1113cd0da6a5" => :high_sierra sha256 "a3139ac50f2e8c5c202cb22a26a74b1a54f188780e2583a00eace33a471e9c7c" => :sierra end depends_on "python@2" depends_on "geos" depends_on "osgeo-proj" depends_on "sqlite" depends_on "osgeo-libspatialite" def install # write setup.cfg (buildpath/"setup.cfg").write <<~EOS [build_ext] include_dirs=#{HOMEBREW_PREFIX}/include/:#{HOMEBREW_PREFIX}/opt/sqlite/include/ library_dirs=#{HOMEBREW_PREFIX}/lib:#{HOMEBREW_PREFIX}/opt/sqlite/lib EOS system "#{Formula["python@2"].opt_bin}/python2", "setup.py", "build" system "#{Formula["python@2"].opt_bin}/python2", "setup.py", "install", "--prefix=#{prefix}" end test do Language::Python.each_python(build) do |python, _version| system python, "-c", "import pyspatialite" end end end ================================================ FILE: Formula/osgeo-qscintilla2.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_qscintilla2_linked } def core_qscintilla2_linked Formula["qscintilla2"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoQscintilla2 < Formula desc "Port to Qt of the Scintilla editing component" homepage "https://www.riverbankcomputing.com/software/qscintilla/intro" url "https://www.riverbankcomputing.com/static/Downloads/QScintilla/2.11.4/QScintilla-2.11.4.tar.gz" sha256 "723f8f1d1686d9fc8f204cd855347e984322dd5cd727891d324d0d7d187bee20" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "106160e70896743c54ccc0ffeb5fd3bbbe986092588e0a5a7f5e500eaf895ff9" => :catalina sha256 "106160e70896743c54ccc0ffeb5fd3bbbe986092588e0a5a7f5e500eaf895ff9" => :mojave sha256 "106160e70896743c54ccc0ffeb5fd3bbbe986092588e0a5a7f5e500eaf895ff9" => :high_sierra end revision 5 # keg_only "qscintilla2 is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "python" depends_on "qt" depends_on "osgeo-sip" depends_on "osgeo-pyqt" def install spec = (ENV.compiler == :clang && MacOS.version >= :mavericks) ? "macx-clang" : "macx-g++" args = %W[-config release -spec #{spec}] cd "Qt4Qt5" do inreplace "qscintilla.pro" do |s| s.gsub! "$$[QT_INSTALL_LIBS]", lib s.gsub! "$$[QT_INSTALL_HEADERS]", include s.gsub! "$$[QT_INSTALL_TRANSLATIONS]", prefix/"trans" s.gsub! "$$[QT_INSTALL_DATA]", prefix/"data" s.gsub! "$$[QT_HOST_DATA]", prefix/"data" end inreplace "features/qscintilla2.prf" do |s| s.gsub! "$$[QT_INSTALL_LIBS]", lib s.gsub! "$$[QT_INSTALL_HEADERS]", include end system "#{Formula["qt"].bin}/qmake", "qscintilla.pro", *args system "make" system "make", "install" end # Add qscintilla2 features search path, since it is not installed in Qt keg's mkspecs/features/ ENV["QMAKEFEATURES"] = prefix/"data/mkspecs/features" cd "Python" do (share/"sip/PyQt5/Qsci").mkpath version = Language::Python.major_minor_version "python3" ENV["PYTHONPATH"] = lib/"python#{version}/site-packages" system "python3", "configure.py", "-o", lib, "-n", include, "--apidir=#{prefix}/qsci", "--destdir=#{lib}/python#{version}/site-packages/PyQt5", "--stubsdir=#{lib}/python#{version}/site-packages/PyQt5", "--qsci-sipdir=#{share}/sip/PyQt5", "--qsci-incdir=#{include}", "--qsci-libdir=#{lib}", "--pyqt=PyQt5", "--pyqt-sipdir=#{Formula["osgeo-pyqt"].opt_share}/sip/PyQt5", "--sip-incdir=#{Formula["osgeo-sip"].opt_include}", "--spec=#{spec}", "--no-dist-info", "--verbose" system "make" system "make", "install" system "make", "clean" end (share/"sip/PyQt5/Qsci").install Dir["sip/*.sip"] end test do (testpath/"test.py").write <<~EOS import PyQt5.Qsci assert("QsciLexer" in dir(PyQt5.Qsci)) EOS version = Language::Python.major_minor_version "python3" ENV["PYTHONPATH"] = lib/"python#{version}/site-packages" system "python3", "test.py" end end ================================================ FILE: Formula/osgeo-qt-mysql.rb ================================================ class OsgeoQtMysql < Formula desc "Qt SQL Database Driver - QMYSQL for MySQL 4 and higher" homepage "https://doc.qt.io/qt-5/sql-driver.html" url "https://download.qt.io/official_releases/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz" sha256 "6f17f488f512b39c2feb57d83a5e0a13dcef32999bea2e2a8f832f54a29badb8" revision 1 head "https://code.qt.io/qt/qt5.git", :branch => "5.14", :shallow => false bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "a90441a61949cc849de6119ed35e3ac42151c4ec246519fc944660adcb501208" => :catalina sha256 "a90441a61949cc849de6119ed35e3ac42151c4ec246519fc944660adcb501208" => :mojave sha256 "a90441a61949cc849de6119ed35e3ac42151c4ec246519fc944660adcb501208" => :high_sierra end depends_on "pkg-config" => :build depends_on "libiconv" depends_on "gettext" depends_on "libxml2" depends_on "libxslt" depends_on "zlib" depends_on "qt" depends_on "sqlite" depends_on "openssl" depends_on "mysql" depends_on :xcode => :build def install qt_plugins = lib/"qt/plugins" (qt_plugins/"sqldrivers").mkpath chdir "#{buildpath}/qtbase/src/plugins/sqldrivers" do system "#{Formula["qt"].opt_bin}/qmake", "--", "MYSQL_PREFIX=#{Formula["mysql"].opt_prefix}" system "make" # copy libqsqlmysql.dylib # libqsqlite.dylib from qt cp_r "#{buildpath}/qtbase/src/plugins/sqldrivers/plugins/sqldrivers/libqsqlmysql.dylib", "#{lib}/qt/plugins/sqldrivers/" end end def caveats; <<~EOS Plugins generated are linked to the following directory: #{HOMEBREW_PREFIX}/lib/qt/plugins/sqldrivers EOS end test do (testpath/"hello.pro").write <<~EOS QT += core sql QT -= gui TARGET = hello CONFIG += console CONFIG -= app_bundle TEMPLATE = app HEADERS = client.h SOURCES += client.cpp main.cpp EOS (testpath/"client.h").write <<~EOS #ifndef CLIENT_H #define CLIENT_H #include #include #include class Client : public QObject { Q_OBJECT public: Client(QObject *parent = 0); public slots: void checkSqlDriver(); }; #endif // CLIENT_H EOS (testpath/"client.cpp").write <<~EOS #include "client.h" #include #include #include #include Client::Client(QObject *parent) : QObject(parent) { } void Client::checkSqlDriver() { QCoreApplication::addLibraryPath("#{HOMEBREW_PREFIX}/lib/qt/plugins"); QCoreApplication::addLibraryPath("#{lib}/qt/plugins"); qDebug() << "QSqlDatabase::drivers(): " << QSqlDatabase::drivers().join(" "); QCoreApplication::exit(!QSqlDatabase::isDriverAvailable("QMYSQL")); } EOS (testpath/"main.cpp").write <<~EOS #include #include #include #include "client.h" int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); Client c(app.instance()); qDebug() << "Running application"; QTimer::singleShot(1000, &c, SLOT(checkSqlDriver())); return app.exec(); } EOS cd testpath do system Formula["qt"].bin/"qmake", "hello.pro" system "make" assert_predicate testpath/"client.o", :exist? assert_predicate testpath/"moc_client.o", :exist? assert_predicate testpath/"main.o", :exist? assert_predicate testpath/"hello", :exist? system "./hello" end end end ================================================ FILE: Formula/osgeo-qt-odbc.rb ================================================ class OsgeoQtOdbc < Formula desc "Qt SQL Database Driver - QODBC for Open Database Connectivity (ODBC)" homepage "https://doc.qt.io/qt-5/sql-driver.html" url "https://download.qt.io/official_releases/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz" sha256 "6f17f488f512b39c2feb57d83a5e0a13dcef32999bea2e2a8f832f54a29badb8" revision 2 head "https://code.qt.io/qt/qt5.git", :branch => "5.14", :shallow => false bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "39d3f151cc9a2725ad9616c34589e430f850c9980b0b0d8f8a67a6efd3a1cc91" => :catalina sha256 "39d3f151cc9a2725ad9616c34589e430f850c9980b0b0d8f8a67a6efd3a1cc91" => :mojave sha256 "39d3f151cc9a2725ad9616c34589e430f850c9980b0b0d8f8a67a6efd3a1cc91" => :high_sierra end depends_on "pkg-config" => :build depends_on "libiconv" depends_on "gettext" depends_on "libxml2" depends_on "libxslt" depends_on "zlib" depends_on "qt" depends_on "sqlite" depends_on "openssl" depends_on "unixodbc" depends_on :xcode => :build def install qt_plugins = lib/"qt/plugins" (qt_plugins/"sqldrivers").mkpath chdir "#{buildpath}/qtbase/src/plugins/sqldrivers" do system "#{Formula["qt"].opt_bin}/qmake", "--", "ODBC_PREFIX=#{Formula["unixodbc"].opt_prefix}" system "make" # copy libqsqlodbc.dylib # libqsqlite.dylib from qt cp_r "#{buildpath}/qtbase/src/plugins/sqldrivers/plugins/sqldrivers/libqsqlodbc.dylib", "#{lib}/qt/plugins/sqldrivers/" end end def caveats; <<~EOS Plugins generated are linked to the following directory: #{HOMEBREW_PREFIX}/lib/qt/plugins/sqldrivers EOS end test do (testpath/"hello.pro").write <<~EOS QT += core sql QT -= gui TARGET = hello CONFIG += console CONFIG -= app_bundle TEMPLATE = app HEADERS = client.h SOURCES += client.cpp main.cpp EOS (testpath/"client.h").write <<~EOS #ifndef CLIENT_H #define CLIENT_H #include #include #include class Client : public QObject { Q_OBJECT public: Client(QObject *parent = 0); public slots: void checkSqlDriver(); }; #endif // CLIENT_H EOS (testpath/"client.cpp").write <<~EOS #include "client.h" #include #include #include #include Client::Client(QObject *parent) : QObject(parent) { } void Client::checkSqlDriver() { QCoreApplication::addLibraryPath("#{HOMEBREW_PREFIX}/lib/qt/plugins"); QCoreApplication::addLibraryPath("#{lib}/qt/plugins"); qDebug() << "QSqlDatabase::drivers(): " << QSqlDatabase::drivers().join(" "); QCoreApplication::exit(!QSqlDatabase::isDriverAvailable("QODBC")); } EOS (testpath/"main.cpp").write <<~EOS #include #include #include #include "client.h" int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); Client c(app.instance()); qDebug() << "Running application"; QTimer::singleShot(1000, &c, SLOT(checkSqlDriver())); return app.exec(); } EOS cd testpath do system Formula["qt"].bin/"qmake", "hello.pro" system "make" assert_predicate testpath/"client.o", :exist? assert_predicate testpath/"moc_client.o", :exist? assert_predicate testpath/"main.o", :exist? assert_predicate testpath/"hello", :exist? system "./hello" end end end ================================================ FILE: Formula/osgeo-qt-psql.rb ================================================ class OsgeoQtPsql < Formula desc "Qt SQL Database Driver - QPSQL for PostgreSQL" homepage "https://doc.qt.io/qt-5/sql-driver.html" url "https://download.qt.io/official_releases/qt/5.14/5.14.1/single/qt-everywhere-src-5.14.1.tar.xz" sha256 "6f17f488f512b39c2feb57d83a5e0a13dcef32999bea2e2a8f832f54a29badb8" revision 2 head "https://code.qt.io/qt/qt5.git", :branch => "5.14", :shallow => false bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "fe8d91af1ea799a6f1ff983f0b6f1d920b2a3342951f867fb1f23b8deb80c8fe" => :catalina sha256 "fe8d91af1ea799a6f1ff983f0b6f1d920b2a3342951f867fb1f23b8deb80c8fe" => :mojave sha256 "fe8d91af1ea799a6f1ff983f0b6f1d920b2a3342951f867fb1f23b8deb80c8fe" => :high_sierra end depends_on "pkg-config" => :build depends_on "libiconv" depends_on "gettext" depends_on "libxml2" depends_on "libxslt" depends_on "zlib" depends_on "qt" depends_on "sqlite" depends_on "openssl" depends_on "libpq" depends_on "osgeo-postgresql" depends_on :xcode => :build def install qt_plugins = lib/"qt/plugins" (qt_plugins/"sqldrivers").mkpath chdir "#{buildpath}/qtbase/src/plugins/sqldrivers" do system "#{Formula["qt"].opt_bin}/qmake", "--", "PSQL_INCDIR=#{Formula["postgresql"].opt_include}" system "make" # copy libqsqlpsql.dylib # libqsqlite.dylib from qt cp_r "#{buildpath}/qtbase/src/plugins/sqldrivers/plugins/sqldrivers/libqsqlpsql.dylib", "#{lib}/qt/plugins/sqldrivers/" end end def caveats; <<~EOS Plugins generated are linked to the following directory: #{HOMEBREW_PREFIX}/lib/qt/plugins/sqldrivers EOS end test do (testpath/"hello.pro").write <<~EOS QT += core sql QT -= gui TARGET = hello CONFIG += console CONFIG -= app_bundle TEMPLATE = app HEADERS = client.h SOURCES += client.cpp main.cpp EOS (testpath/"client.h").write <<~EOS #ifndef CLIENT_H #define CLIENT_H #include #include #include class Client : public QObject { Q_OBJECT public: Client(QObject *parent = 0); public slots: void checkSqlDriver(); }; #endif // CLIENT_H EOS (testpath/"client.cpp").write <<~EOS #include "client.h" #include #include #include #include Client::Client(QObject *parent) : QObject(parent) { } void Client::checkSqlDriver() { QCoreApplication::addLibraryPath("#{HOMEBREW_PREFIX}/lib/qt/plugins"); QCoreApplication::addLibraryPath("#{lib}/qt/plugins"); qDebug() << "QSqlDatabase::drivers(): " << QSqlDatabase::drivers().join(" "); QCoreApplication::exit(!QSqlDatabase::isDriverAvailable("QPSQL")); } EOS (testpath/"main.cpp").write <<~EOS #include #include #include #include "client.h" int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); Client c(app.instance()); qDebug() << "Running application"; QTimer::singleShot(1000, &c, SLOT(checkSqlDriver())); return app.exec(); } EOS cd testpath do system Formula["qt"].bin/"qmake", "hello.pro" system "make" assert_predicate testpath/"client.o", :exist? assert_predicate testpath/"moc_client.o", :exist? assert_predicate testpath/"main.o", :exist? assert_predicate testpath/"hello", :exist? system "./hello" end end end ================================================ FILE: Formula/osgeo-qt-webkit.rb ================================================ class OsgeoQtWebkit < Formula desc "Classes for a WebKit2 based implementation and a new QML API" homepage "https://www.qt.io/developers" url "https://github.com/qt/qtwebkit/archive/ab1bd15209abaf7effc51dbc2f272c5681af7223.tar.gz" sha256 "0128e09a9623a62ffe93c395294f571306f2d318797cf4e69d812cca6e42ec90" version "5.14.1" revision 3 # from the developer: "https://github.com/annulen/webkit.git" head "https://github.com/qt/qtwebkit.git" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "72b7e4c0f9740a19b9c296ddf690dff0be1e89d96051084e3036466f8e768673" => :catalina sha256 "72b7e4c0f9740a19b9c296ddf690dff0be1e89d96051084e3036466f8e768673" => :mojave sha256 "72b7e4c0f9740a19b9c296ddf690dff0be1e89d96051084e3036466f8e768673" => :high_sierra end # insert the XPC_NOESCAPE macro in the right places in xpc_array_apply and xpc_dictionary_apply # to match the definitions now used in the 10.14 SDK # patch :DATA depends_on "cmake" => :build depends_on "ninja" => [:build, :recommended] depends_on "fontconfig" => :build depends_on "freetype" => :build depends_on "gperf" => :build depends_on "sqlite" => :build depends_on "bison" => :build depends_on "pkg-config" => :build depends_on "python" => :build depends_on "ruby" => :build depends_on "perl" => :build depends_on :xcode => :build depends_on "gcc" => :build # features.h depends_on "libxslt" depends_on "qt" depends_on "webp" depends_on "zlib" # depends_on "gst-plugins-base" # depends_on "libjpeg" # Qt < 5.10 depends_on "libjpeg-turbo" depends_on "libpng" depends_on "libxslt" depends_on "gst-plugins-good" => :optional def cmake_args args = %W[ -DCMAKE_INSTALL_PREFIX=#{prefix} -DCMAKE_BUILD_TYPE=Release -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev ] args end def install args = cmake_args args << "-DPORT=Qt" args << "-DENABLE_TOOLS=OFF" args << "-DCMAKE_MACOSX_RPATH=OFF" args << "-DEGPF_SET_RPATH=OFF" args << "-DCMAKE_SKIP_RPATH=ON" args << "-DCMAKE_SKIP_INSTALL_RPATH=ON" # Fuck off rpath # inreplace "Source/cmake/OptionsQt.cmake", # "set(CMAKE_MACOSX_RPATH\ ON)", # "" mkdir "build" do system "cmake", "-G", build.with?("ninja") ? "Ninja" : "Unix Makefiles", *args, ".." system "cmake", "--build", ".", "--target", "all", "--", "-j", Hardware::CPU.cores system "cmake", "--build", ".", "--target", "install", "--", "-j", Hardware::CPU.cores end # rename the .so files mv "#{lib}/qml/QtWebKit/libqmlwebkitplugin.so", "#{lib}/qml/QtWebKit/libqmlwebkitplugin.dylib" mv "#{lib}/qml/QtWebKit/experimental/libqmlwebkitexperimentalplugin.so", "#{lib}/qml/QtWebKit/experimental/libqmlwebkitexperimentalplugin.dylib" ln_s "#{lib}/qml", "#{prefix}/qml" ln_s "#{lib}/libexec", "#{prefix}/libexec" # some config scripts will only find Qt in a "Frameworks" folder frameworks.install_symlink Dir["#{lib}/*.framework"] # the pkg-config files installed suggest that headers can be found in the # `include` directory. Make this so by creating symlinks from `include` to # the Frameworks' Headers folders Pathname.glob("#{lib}/*.framework/Headers") do |path| include.install_symlink path => path.parent.basename(".framework") end # for some reason it is not generating the .pc files, that's why they are created # although these are not necessary mkdir "#{lib}/pkgconfig" do # create Qt5WebKit.pc File.open("#{lib}/pkgconfig/Qt5WebKit.pc", "w") { |file| file << "Name: Qt5WebKit\n" file << "Description: Qt WebKit module\n" file << "Version: #{version}\n" # file << "Libs: -F#{lib} -framework QtWebKit" file << "Libs: -L#{lib} -lQt5WebKit\n" # file << "Cflags: -DQT_WEBKIT_LIB -I#{include}/QtWebKit\n" file << "Cflags: -I#{include}/QtWebKit\n" file << "Requires: Qt5Core Qt5Gui Qt5Network" } # create QtWebKitWidgets.pc File.open("#{lib}/pkgconfig/Qt5WebKitWidgets.pc", "w") { |file| file << "Name: Qt5WebKitWidgets\n" file << "Description: Qt WebKitWidgets module\n" file << "Version: #{version}\n" # file << "Libs: -F#{lib} -framework QtWebKitWidgets" file << "Libs: -L#{lib} -lQt5WebKitWidgets\n" # file << "Cflags: -DQT_WEBKITWIDGETS_LIB -I#{include}/QtWebKitWidgets\n" file << "Cflags: -I#{include}/QtWebKitWidgets\n" file << "Requires:" } end # fix rpath values MachO::Tools.change_install_name("#{lib}/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets", "@rpath/QtWebKit.framework/Versions/5/QtWebKit", "#{lib}/QtWebKit.framework/Versions/5/QtWebKit") MachO::Tools.change_install_name("#{prefix}/qml/QtWebKit/libqmlwebkitplugin.dylib", "@rpath/QtWebKit.framework/Versions/5/QtWebKit", "#{lib}/QtWebKit.framework/Versions/5/QtWebKit") MachO::Tools.change_install_name("#{prefix}/qml/QtWebKit/experimental/libqmlwebkitexperimentalplugin.dylib", "@rpath/QtWebKit.framework/Versions/5/QtWebKit", "#{lib}/QtWebKit.framework/Versions/5/QtWebKit") MachO::Tools.change_install_name("#{libexec}/QtWebProcess", "@rpath/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets", "#{lib}/QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets") MachO::Tools.change_install_name("#{libexec}/QtWebProcess", "@rpath/QtWebKit.framework/Versions/5/QtWebKit", "#{lib}/QtWebKit.framework/Versions/5/QtWebKit") end # Failed to connect to localhost port 80: Connection refused test do # (testpath/"hello.pro").write <<~EOS # QT += core webkitwidgets # QT -= gui # TARGET = hello # CONFIG += console # CONFIG -= app_bundle # TEMPLATE = app # HEADERS = client.h # SOURCES += client.cpp main.cpp # include(#{prefix}/mkspecs/modules/qt_lib_webkit.pri) # include(#{prefix}/mkspecs/modules/qt_lib_webkitwidgets.pri) # EOS # # (testpath/"client.h").write <<~EOS # #ifndef CLIENT_H # #define CLIENT_H # #include # #include # # class Client : public QObject # { # Q_OBJECT # # public: # Client(const QString &url, QObject *parent = 0); # # private Q_SLOTS: # void loadUrl(); # void output(bool ok); # # private: # QWebPage page; # QString url; # # }; # #endif // CLIENT_H # EOS # # (testpath/"client.cpp").write <<~EOS # #include "client.h" # #include # #include # #include # #include # # Client::Client(const QString &myurl, QObject *parent) # : QObject(parent) # , url(myurl) # { # } # # void Client::loadUrl() # { # page.mainFrame()->load(QUrl(url)); # connect(&page, SIGNAL(loadFinished(bool)), this, SLOT(output(bool))); # } # # void Client::output(bool ok) # { # if (ok){ # qDebug() << "Page title: " << page.mainFrame()->title(); # QCoreApplication::exit(0); # } else { # qDebug() << "Error loading " << url; # QCoreApplication::exit(1); # } # } # EOS # # (testpath/"main.cpp").write <<~EOS # #include # #include # #include # #include # #include "client.h" # # int main(int argc, char *argv[]) # { # QApplication app(argc, argv); # Client c("file://#{testpath}/test.html", app.instance()); # qDebug() << "Running application"; # QTimer::singleShot(1000, &c, SLOT(loadUrl())); # return app.exec(); # } # EOS # # (testpath/"test.html").write <<~EOS # # # My title # Body content # # EOS # # cd testpath do # system Formula["qt5"].bin/"qmake", "hello.pro" # system "make" # assert_predicate testpath/"client.o", :exist? # assert_predicate testpath/"moc_client.o", :exist? # assert_predicate testpath/"main.o", :exist? # assert_predicate testpath/"hello", :exist? # # # test that we can actually serve the page # pid = fork do # exec testpath/"hello" # end # sleep 2 # begin # assert_match "

It works!

\n", shell_output("curl http://localhost:80") # ensure # Process.kill("SIGINT", pid) # Process.wait(pid) # end # end end # could be used: # (testpath/"CMakeLists.txt").write("find_package(Qt5 CONFIG COMPONENTS WebKit WebKitWidgets REQUIRED)") # system "cmake", ".", "-Wno-dev" end __END__ --- a/Source/cmake/WebKitCommon.cmake +++ b/Source/cmake/WebKitCommon.cmake @@ -24,9 +24,9 @@ # TODO Enforce version requirement for perl find_package(Perl 5.10.0 REQUIRED) - find_package(PythonInterp 2.7.0 REQUIRED) - if (PYTHON_VERSION_MAJOR GREATER 2) - message(FATAL_ERROR "Python 2 is required, but Python ${PYTHON_VERSION_MAJOR} was found.") + find_package(PythonInterp 3.7.6 REQUIRED) + if (PYTHON_VERSION_MAJOR GREATER 3) + message(FATAL_ERROR "Python 3 is required, but Python ${PYTHON_VERSION_MAJOR} was found.") endif () # We cannot check for RUBY_FOUND because it is set only when the full package is installed and # --- a/Source/WTF/wtf/spi/darwin/XPCSPI.h 2017-06-17 13:46:54.000000000 +0300 # +++ b/Source/WTF/wtf/spi/darwin/XPCSPI.h 2018-09-08 23:41:06.397523110 +0300 # @@ -89,10 +89,6 @@ # EXTERN_C const struct _xpc_type_s _xpc_type_string; # # EXTERN_C xpc_object_t xpc_array_create(const xpc_object_t*, size_t count); # -#if COMPILER_SUPPORTS(BLOCKS) # -EXTERN_C bool xpc_array_apply(xpc_object_t, xpc_array_applier_t); # -EXTERN_C bool xpc_dictionary_apply(xpc_object_t xdict, xpc_dictionary_applier_t applier); # -#endif # EXTERN_C size_t xpc_array_get_count(xpc_object_t); # EXTERN_C const char* xpc_array_get_string(xpc_object_t, size_t index); # EXTERN_C void xpc_array_set_string(xpc_object_t, size_t index, const char* string); ================================================ FILE: Formula/osgeo-qtkeychain.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_qtkeychain_linked } def core_qtkeychain_linked Formula["qtkeychain"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoQtkeychain < Formula desc "Platform-independent Qt-based API for storing passwords securely" homepage "https://github.com/frankosterfeld/qtkeychain" url "https://github.com/frankosterfeld/qtkeychain/archive/v0.10.0.tar.gz" sha256 "5f916cd97843de550467db32d2e10f218b904af5b21cfdfcc7c6425d7dfc3ec2" # revision 1 head "https://github.com/frankosterfeld/qtkeychain.git", :using => :git bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "a9261f3ce89b4e46e1cc52415d54b993fc2716cc7ed4fd713bb57d2f78596659" => :catalina sha256 "a9261f3ce89b4e46e1cc52415d54b993fc2716cc7ed4fd713bb57d2f78596659" => :mojave sha256 "a9261f3ce89b4e46e1cc52415d54b993fc2716cc7ed4fd713bb57d2f78596659" => :high_sierra end option "with-static", "Build static in addition to shared library" option "with-translations", "Generate Qt translation (.ts) files" # keg_only "qtkeychain is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "cmake" => :build depends_on "qt" def lib_name "libqt5keychain" end def install args = std_cmake_args args << "-DQTKEYCHAIN_STATIC=OFF" args << "-DBUILD_WITH_QT4=OFF" args << "-DBUILD_TRANSLATIONS=#{build.with?("translations") ? "ON" : "OFF"}" mkdir "build" do system "cmake", "..", *args system "make", "install" (libexec/"bin").install "testclient" so_ver = 1 lib_name_ver = "#{lib_name}.#{so_ver}" MachO::Tools.change_install_name("#{libexec}/bin/testclient", "@rpath/#{lib_name_ver}.dylib", "#{opt_lib}/#{lib_name_ver}.dylib") if build.with? "static" args << "-DQTKEYCHAIN_STATIC=ON" system "cmake", "..", *args system "make" mv "#{lib_name}.a", lib/"#{lib_name}_static.a" end end end def caveats if build.with? "static" <<~EOS Static library is available at: #{opt_lib}/#{lib_name}_static.a EOS end end test do assert_match "Password deleted successfully", shell_output(libexec/"bin/testclient delete something-particular") end end ================================================ FILE: Formula/osgeo-saga-lts.rb ================================================ class OsgeoSagaLts < Formula desc "System for Automated Geoscientific Analyses - Long Term Support" homepage "http://saga-gis.org" url "https://downloads.sourceforge.net/project/saga-gis/SAGA%20-%207/SAGA%20-%207.3.0/saga-7.3.0.tar.gz" sha256 "f3c0f805bd48c3afbad56a35b6b0aa40e8e92799ed0ef0d682aea275fa36fbbc" # QGIS & PROJ 6 & SAGA # https://lists.osgeo.org/pipermail/qgis-developer/2019-December/059512.html # https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py # REQUIRED_VERSION = '2.3.' # BETA_SUPPORT_VERSION = '7.3.' revision 1 head "https://git.code.sf.net/p/saga-gis/code.git" bottle do root_url "https://bottle.download.osgeo.org" sha256 "260038069d9185a8cfe5f5eafd4d496e9064cde276123eaf11b2508aadd2863c" => :catalina sha256 "260038069d9185a8cfe5f5eafd4d496e9064cde276123eaf11b2508aadd2863c" => :mojave sha256 "260038069d9185a8cfe5f5eafd4d496e9064cde276123eaf11b2508aadd2863c" => :high_sierra end keg_only "This version is specifically to work with QGIS" option "with-pg10", "Build with PostgreSQL 10 client" option "with-app", "Build SAGA.app Package" depends_on "automake" => :build depends_on "autoconf" => :build depends_on "libtool" => :build depends_on "pkg-config" => :build depends_on "python" depends_on "wxmac" depends_on "wxpython" depends_on "geos" depends_on "jasper" depends_on "fftw" depends_on "libtiff" depends_on "swig" depends_on "xz" # lzma depends_on "giflib" depends_on "opencv@2" depends_on "unixodbc" depends_on "libharu" depends_on "qhull" # instead of looking for triangle depends_on "poppler" depends_on "sqlite" depends_on "hdf5" depends_on "osgeo-hdf4" depends_on "osgeo-proj" depends_on "osgeo-netcdf" depends_on "osgeo-laszip@2" depends_on "osgeo-gdal" # (gdal-curl, gdal-filegdb, gdal-hdf4) depends_on "osgeo-liblas" # Vigra support builds, but dylib in saga shows 'failed' when loaded # Also, using --with-python will trigger vigra to be built with it, which # triggers a source (re)build of boost --with-python depends_on "osgeo-vigra" => :optional if build.with?("pg10") depends_on "osgeo-postgresql@10" else depends_on "osgeo-postgresql" end resource "app_icon" do url "https://osgeo4mac.s3.amazonaws.com/src/saga_gui.icns" sha256 "288e589d31158b8ffb9ef76fdaa8e62dd894cf4ca76feabbae24a8e7015e321f" end def install ENV.cxx11 # SKIP liblas support until SAGA supports > 1.8.1, which should support GDAL 2; # otherwise, SAGA binaries may lead to multiple GDAL versions being loaded # See: https://github.com/libLAS/libLAS/issues/106 # Update: https://github.com/libLAS/libLAS/issues/106 # https://sourceforge.net/p/saga-gis/wiki/Compiling%20SAGA%20on%20Mac%20OS%20X/ # configure FEATURES CXX="CXX" CPPFLAGS="DEFINES GDAL_H $PROJ_H" LDFLAGS="GDAL_SRCH PROJ_SRCH LINK_MISC" # cppflags : wx-config --version=3.0 --cppflags # defines : -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ 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__" # libs : wx-config --version=3.0 --libs 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 # xcode : xcrun --show-sdk-path link_misc = "-arch x86_64 -mmacosx-version-min=10.9 -isysroot #{MacOS::Xcode.prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX#{MacOS.version}.sdk -lstdc++" ENV.append "CPPFLAGS", "-I#{Formula["osgeo-proj"].opt_include} -I#{Formula["osgeo-gdal"].opt_include} #{cppflags}" ENV.append "LDFLAGS", "-L#{Formula["osgeo-proj"].opt_lib}/libproj.dylib -L#{Formula["osgeo-gdal"].opt_lib}/libgdal.dylib #{link_misc} #{ldflags}" # Disable narrowing warnings when compiling in C++11 mode. ENV.append "CXXFLAGS", "-Wno-c++11-narrowing -std=c++11" ENV.append "PYTHON_VERSION", "3.7" ENV.append "PYTHON", "#{Formula["python"].opt_bin}/python3" # support for PROJ 6 # ENV.append_to_cflags "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" # saga lts does not support proj 6 # https://github.com/OSGeo/proj.4/wiki/proj.h-adoption-status # https://sourceforge.net/p/saga-gis/bugs/271/ # cd "saga-gis" # fix homebrew-specific header location for qhull inreplace "src/tools/grid/grid_gridding/nn/delaunay.c", "qhull/", "libqhull/" # if build.with? "qhull" # libfire and triangle are for non-commercial use only, skip them args = %W[ --prefix=#{prefix} --disable-dependency-tracking --disable-openmp --disable-libfire --enable-shared --enable-debug --disable-gui ] #--enable-gui # --enable-unicode args << "--disable-odbc" if build.without? "unixodbc" args << "--disable-triangle" # if build.with? "qhull" args << "--enable-python" # if build.with? "python" if build.with?("pg10") args << "--with-postgresql=#{Formula["osgeo-postgresql@10"].opt_bin}/pg_config" else args << "--with-postgresql=#{Formula["osgeo-postgresql"].opt_bin}/pg_config" # if build.with? "postgresql" end system "autoreconf", "-i" system "./configure", *args system "make", "install" if build.with? "app" (prefix/"SAGA.app/Contents/PkgInfo").write "APPLSAGA" (prefix/"SAGA.app/Contents/Resources").install resource("app_icon") config = <<~EOS CFBundleDevelopmentRegion English CFBundleExecutable saga_gui CFBundleIconFile saga_gui.icns CFBundleInfoDictionaryVersion 6.0 CFBundleName SAGA CFBundlePackageType APPL CFBundleSignature SAGA CFBundleVersion 1.0 CSResourcesFileMapped NSHighResolutionCapable True EOS (prefix/"SAGA.app/Contents/Info.plist").write config chdir "#{prefix}/SAGA.app/Contents" do mkdir "MacOS" do ln_s "#{bin}/saga_gui", "saga_gui" end end end end def caveats if build.with? "app" <<~EOS SAGA.app was installed in: #{prefix} You may also symlink QGIS.app into /Applications or ~/Applications: ln -Fs `find $(brew --prefix) -name "SAGA.app"` /Applications/SAGA.app Note that the SAGA GUI does not work very well yet. 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). EOS end end test do output = `#{bin}/saga_cmd --help` assert_match /The SAGA command line interpreter/, output end end ================================================ FILE: Formula/osgeo-saga.rb ================================================ class OsgeoSaga < Formula desc "System for Automated Geoscientific Analyses - Long Term Support" homepage "http://saga-gis.org" url "https://downloads.sourceforge.net/project/saga-gis/SAGA%20-%207/SAGA%20-%207.7.0/saga-7.7.0.tar.gz" sha256 "f327cf8502cb4850e921985b8c3d6aa97adb7c1c612b7b935657547619cdbbda" # QGIS & PROJ 6 & SAGA # https://lists.osgeo.org/pipermail/qgis-developer/2019-December/059512.html # https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/saga/SagaAlgorithmProvider.py # REQUIRED_VERSION = '2.3.' # BETA_SUPPORT_VERSION = '7.3.' #revision 2 head "https://git.code.sf.net/p/saga-gis/code.git" bottle do root_url "https://bottle.download.osgeo.org" sha256 "11e96aa538e00ace2a776418bea09cbabba808172487d08664b7bd0a036359b0" => :catalina sha256 "11e96aa538e00ace2a776418bea09cbabba808172487d08664b7bd0a036359b0" => :mojave sha256 "11e96aa538e00ace2a776418bea09cbabba808172487d08664b7bd0a036359b0" => :high_sierra end keg_only "QGIS fails to load the correct SAGA version, if the latest version is in the path" option "with-pg10", "Build with PostgreSQL 10 client" option "with-app", "Build SAGA.app Package" depends_on "automake" => :build depends_on "autoconf" => :build depends_on "libtool" => :build depends_on "pkg-config" => :build depends_on "python@3.8" depends_on "wxmac" depends_on "wxpython" depends_on "geos" depends_on "jasper" depends_on "fftw" depends_on "libtiff" depends_on "swig" depends_on "xz" # lzma depends_on "giflib" depends_on "opencv@2" depends_on "unixodbc" depends_on "libharu" depends_on "qhull" # instead of looking for triangle depends_on "poppler" depends_on "sqlite" depends_on "hdf5" depends_on "osgeo-hdf4" depends_on "osgeo-proj" depends_on "osgeo-netcdf" depends_on "osgeo-gdal" # (gdal-curl, gdal-filegdb, gdal-hdf4) # TODO OpenMP support depends_on "libomp" # SKIP liblas support until SAGA supports > 1.8.1, which should support GDAL 2; # otherwise, SAGA binaries may lead to multiple GDAL versions being loaded # See: https://github.com/libLAS/libLAS/issues/106 # Update: https://github.com/libLAS/libLAS/issues/106 #depends_on "osgeo-laszip@2" #depends_on "osgeo-liblas" # Vigra support builds, but dylib in saga shows 'failed' when loaded # Also, using --with-python will trigger vigra to be built with it, which # triggers a source (re)build of boost --with-python depends_on "osgeo-vigra" => :optional if build.with?("pg11") depends_on "osgeo-postgresql@11" else depends_on "osgeo-postgresql" end resource "app_icon" do url "https://osgeo4mac.s3.amazonaws.com/src/saga_gui.icns" sha256 "288e589d31158b8ffb9ef76fdaa8e62dd894cf4ca76feabbae24a8e7015e321f" end def install ENV.cxx11 # https://sourceforge.net/p/saga-gis/wiki/Compiling%20SAGA%20on%20Mac%20OS%20X/ # configure FEATURES CXX="CXX" CPPFLAGS="DEFINES GDAL_H $PROJ_H" LDFLAGS="GDAL_SRCH PROJ_SRCH LINK_MISC" # cppflags : wx-config --version=3.0 --cppflags # defines : -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ 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__" # libs : wx-config --version=3.0 --libs 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 # xcode : xcrun --show-sdk-path link_misc = "-arch x86_64 -mmacosx-version-min=10.9 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -lstdc++" ENV.append "CPPFLAGS", "-I#{Formula["osgeo-proj"].opt_include} -I#{Formula["osgeo-gdal"].opt_include} #{cppflags}" ENV.append "LDFLAGS", "-L#{Formula["osgeo-proj"].opt_lib}/libproj.dylib -L#{Formula["osgeo-gdal"].opt_lib}/libgdal.dylib #{link_misc} #{ldflags}" # Disable narrowing warnings when compiling in C++11 mode. ENV.append "CXXFLAGS", "-Wno-c++11-narrowing -std=c++11" ENV.append "PYTHON_VERSION", "3.8" ENV.append "PYTHON", "#{Formula["python@3.8"].opt_bin}/python3" # support for PROJ 6 # ENV.append_to_cflags "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" # saga lts does not support proj 6 # https://github.com/OSGeo/proj.4/wiki/proj.h-adoption-status # https://sourceforge.net/p/saga-gis/bugs/271/ # cd "saga-gis" # fix homebrew-specific header location for qhull inreplace "src/tools/grid/grid_gridding/nn/delaunay.c", "qhull/", "libqhull/" # if build.with? "qhull" # libfire and triangle are for non-commercial use only, skip them args = %W[ --prefix=#{prefix} --disable-dependency-tracking --disable-libfire --enable-shared --enable-debug --disable-gui ] #--disable-openmp #--enable-gui # --enable-unicode args << "--disable-odbc" if build.without? "unixodbc" args << "--disable-triangle" # if build.with? "qhull" args << "--enable-python" # if build.with? "python" if build.with?("pg11") args << "--with-postgresql=#{Formula["osgeo-postgresql@11"].opt_bin}/pg_config" else args << "--with-postgresql=#{Formula["osgeo-postgresql"].opt_bin}/pg_config" # if build.with? "postgresql" end system "autoreconf", "-i" system "./configure", *args system "make", "install" if build.with? "app" (prefix/"SAGA.app/Contents/PkgInfo").write "APPLSAGA" (prefix/"SAGA.app/Contents/Resources").install resource("app_icon") config = <<~EOS CFBundleDevelopmentRegion English CFBundleExecutable saga_gui CFBundleIconFile saga_gui.icns CFBundleInfoDictionaryVersion 6.0 CFBundleName SAGA CFBundlePackageType APPL CFBundleSignature SAGA CFBundleVersion 1.0 CSResourcesFileMapped NSHighResolutionCapable True EOS (prefix/"SAGA.app/Contents/Info.plist").write config chdir "#{prefix}/SAGA.app/Contents" do mkdir "MacOS" do ln_s "#{bin}/saga_gui", "saga_gui" end end end end def caveats if build.with? "app" <<~EOS SAGA.app was installed in: #{prefix} You may also symlink QGIS.app into /Applications or ~/Applications: ln -Fs `find $(brew --prefix) -name "SAGA.app"` /Applications/SAGA.app Note that the SAGA GUI does not work very well yet. 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). EOS end end test do output = `#{bin}/saga_cmd --help` assert_match /The SAGA command line interpreter/, output end end ================================================ FILE: Formula/osgeo-shark.rb ================================================ class OsgeoShark < Formula desc "Machine leaning library" homepage "http://image.diku.dk/shark/" url "https://github.com/Shark-ML/Shark/archive/v4.0.1.tar.gz" sha256 "1caf9c73c5ebf54f9543a090e2b05ac646f95559aa1de483cd7662c378c1ec21" revision 1 head "https://github.com/Shark-ML/Shark.git", :branch => "master" bottle :disable, "needs to be rebuilt with latest boost" depends_on "cmake" => :build depends_on "boost" def install system "cmake", ".", *std_cmake_args system "make", "install" end test do system bin/"SharkVersion" (testpath/"test.cpp").write <<~EOS #include #include int main( int argc, char ** argv ) { shark::Shark::info( std::cout ); } EOS system ENV.cxx, "test.cpp", "-o", "test", "-L#{lib}", "-lshark", "-L#{Formula["boost"].lib}", "-lboost_serialization", "-I#{Formula["boost"].include}" system "./test" end end ================================================ FILE: Formula/osgeo-simple-tiles.rb ================================================ class OsgeoSimpleTiles < Formula desc "Image generation library for spatial data" homepage "https://propublica.github.io/simple-tiles" url "https://github.com/propublica/simple-tiles/archive/v0.6.1.tar.gz" sha256 "2391b2f727855de28adfea9fc95d8c7cbaca63c5b86c7286990d8cbbcd640d6f" bottle do root_url "https://bottle.download.osgeo.org" cellar :any rebuild 1 sha256 "fec2a26451465b4e4d895e2ef383b20240af7f6956d57b5ea70fd7fcf059d47e" => :mojave sha256 "fec2a26451465b4e4d895e2ef383b20240af7f6956d57b5ea70fd7fcf059d47e" => :high_sierra sha256 "e1d77cc94e155ce5067b5f84d3b5dc781b3f5014eab0a5d18ce77681cbb9ecaa" => :sierra end revision 2 head "https://github.com/propublica/simple-tiles.git", :branch => "master" depends_on "pkg-config" => :build depends_on "cairo" depends_on "pango" depends_on "osgeo-gdal" def install system "./configure", "--prefix=#{prefix}" system "make", "install" end test do (testpath/"test.c").write <<~EOS #include int main(){ simplet_map_t *map = simplet_map_new(); simplet_map_free(map); return 0; } EOS system ENV.cc, "-I#{include}", "-L#{lib}", "-lsimple-tiles", "-I#{Formula["cairo"].opt_include}/cairo", "-I#{Formula["osgeo-gdal"].opt_include}", "-I#{Formula["glib"].opt_include}/glib-2.0", "-I#{Formula["glib"].opt_lib}/glib-2.0/include", "-I#{Formula["pango"].opt_include}/pango-1.0", "test.c", "-o", "test" system testpath/"test" end end ================================================ FILE: Formula/osgeo-six.rb ================================================ class OsgeoSix < Formula desc "Python 2 and 3 compatibility utilities" homepage "https://pypi.python.org/pypi/six" url "https://github.com/benjaminp/six/archive/1.15.0.tar.gz" sha256 "36252a752837b72f60def78bc408a05c21d22fe00a34a7dc3409d96b2c6e20c8" #revision 3 head "https://github.com/benjaminp/six.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any_skip_relocation sha256 "84f5bd6a34d8563f07531b51f13cd0783d5bfc337866d47980552daf35441122" => :catalina sha256 "84f5bd6a34d8563f07531b51f13cd0783d5bfc337866d47980552daf35441122" => :mojave sha256 "84f5bd6a34d8563f07531b51f13cd0783d5bfc337866d47980552daf35441122" => :high_sierra end depends_on "python" depends_on "tcl-tk" resource "setuptools" do url "https://files.pythonhosted.org/packages/42/3e/2464120172859e5d103e5500315fb5555b1e908c0dacc73d80d35a9480ca/setuptools-45.1.0.zip" sha256 "91f72d83602a6e5e4a9e4fe296e27185854038d7cbda49dcd7006c4d3b3b89d5" end resource "pytest" do url "https://files.pythonhosted.org/packages/f0/5f/41376614e41f7cdee02d22d1aec1ea028301b4c6c4523a5f7ef8e960fe0b/pytest-5.3.5.tar.gz" sha256 "0d5fe9189a148acc3c3eb2ac8e1ac0742cb7618c084f3d228baaec0c254b318d" end def install xy = Language::Python.major_minor_version "python3" ENV.prepend_create_path "PYTHONPATH", "#{libexec}/lib/python#{xy}/site-packages" resource("setuptools").stage do system "python3", "setup.py", "install", "--prefix=#{libexec}", "--single-version-externally-managed", "--record=installed.txt" end resource("pytest").stage do system "python3", "setup.py", "install", "--prefix=#{libexec}", "--single-version-externally-managed", "--record=installed.txt" end ENV.prepend_create_path "PYTHONPATH", "#{lib}/python#{xy}/site-packages" system "python3", "setup.py", "install", "--prefix=#{prefix}", "--single-version-externally-managed", "--record=installed.txt", "--optimize=1" bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"]) end test do # TODO end end ================================================ FILE: Formula/osgeo-taudem.rb ================================================ class OsgeoTaudem < Formula desc "Terrain Analysis Using Digital Elevation Models for hydrology" homepage "http://hydrology.usu.edu/taudem/taudem5/" url "https://github.com/dtarb/TauDEM/archive/bf9417172225a9ce2462f11138c72c569c253a1a.tar.gz" sha256 "2adffb82f6c9cdda42c2373f551aefb4d52f444005df961675eaf08f6edcbccc" version "5.3.8" revision 2 head "https://github.com/dtarb/TauDEM.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "4e5d5df235413e6f3b02c1112eda3a95b5200c7e1eae640f9df0ed50db62765e" => :mojave sha256 "4e5d5df235413e6f3b02c1112eda3a95b5200c7e1eae640f9df0ed50db62765e" => :high_sierra sha256 "a425c679506c2f16bc90f274b96fce85973ef826d2f7b926798255ff6f65d9f3" => :sierra end depends_on "cmake" => :build depends_on "open-mpi" depends_on "osgeo-gdal" resource "logan" do url "http://hydrology.usu.edu/taudem/taudem5/LoganDemo.zip" sha256 "3340f75a30d3043e7ad09b7a7324fa71374811b22fa913ad577840499a7dab83" version "5.3.5" end def install ENV.cxx11 args = std_cmake_args cd "src" do system "cmake", ".", *args system "make" system "make", "install" end mkdir "#{bin}" bin.install_symlink Dir["#{prefix}/taudem/*"] end test do resource("logan").stage do system "#{opt_prefix}/bin/pitremove", "logan.tif" end end end ================================================ FILE: Formula/osgeo-vigra.rb ================================================ class OsgeoVigra < Formula include Language::Python::Virtualenv desc "Image processing and analysis library" homepage "https://ukoethe.github.io/vigra/" url "https://github.com/ukoethe/vigra/releases/download/Version-1-11-1/vigra-1.11.1-src.tar.gz" sha256 "a5564e1083f6af6a885431c1ee718bad77d11f117198b277557f8558fa461aaf" revision 2 head "https://github.com/ukoethe/vigra.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" cellar :any rebuild 1 sha256 "3b864be9be725491b2db6cdad5c94fc130536c1bdc32d67d827b35d670e27cc3" => :mojave sha256 "3b864be9be725491b2db6cdad5c94fc130536c1bdc32d67d827b35d670e27cc3" => :high_sierra sha256 "ecd4a73b3e8f366c69014890e0ced53a6e8fc446dbd1bc6f91c666beebdf36d7" => :sierra end option "without-test", "skip tests" option "with-python3", "Build with Python 3 (for Saga GIS no LTS)" deprecated_option "without-check" => "without-test" depends_on "cmake" => :build depends_on "boost" => :build depends_on "jpeg" depends_on "libpng" depends_on "libtiff" depends_on "numpy" depends_on "hdf5" => :recommended depends_on "fftw" => :recommended depends_on "openexr" # => :optional if build.with? "python3" depends_on "python" else depends_on "python@2" # => :optional end patch do url "https://git.archlinux.org/svntogit/community.git/plain/trunk/fix-incorrect-template-parameter-type.patch?h=packages/vigra" sha256 "f151f902483dfa2b1f3d431f54bb161300cf184158c9f416fa653d19ab363cc4" end patch do url "https://git.archlinux.org/svntogit/community.git/plain/trunk/py3.7.diff?h=packages/vigra" sha256 "8fcdcce50c377be44387cbd4a001dadf5e03b32483de55c05a359c887e95a05b" end resource "numpy" do url "https://files.pythonhosted.org/packages/93/48/956b9dcdddfcedb1705839280e02cbfeb2861ed5d7f59241210530867d5b/numpy-1.16.3.zip" sha256 "78a6f89da87eeb48014ec652a65c4ffde370c036d780a995edaeb121d3625621" end resource "nose" do url "https://files.pythonhosted.org/packages/58/a5/0dc93c3ec33f4e281849523a5a913fa1eea9a3068acfa754d44d88107a44/nose-1.3.7.tar.gz" sha256 "f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98" end # vigra python bindings requires boost-python # see https://packages.ubuntu.com/saucy/python-vigra depends_on "boost-python" => "c++11" # if build.with? "python" def install ENV.cxx11 ENV.append "CXXFLAGS", "-ftemplate-depth=512" # if build.with? "python" venv = virtualenv_create(libexec) venv.pip_install resources # end cmake_args = std_cmake_args cmake_args << "-DWITH_VIGRANUMPY=0" if build.without? :python cmake_args << "-DWITH_HDF5=0" if build.without? "hdf5" cmake_args << "-DWITH_OPENEXR=1" # if build.with? "openexr" # cmake_args << "-DVIGRANUMPY_INSTALL_DIR=#{lib}/python2.7/site-packages" # if build.with? :python # not used by the project if build.with? "python3" cmake_args << "-DPYTHON_EXECUTABLE=#{Formula["python"].opt_bin}/python3" else cmake_args << "-DPYTHON_EXECUTABLE=#{Formula["python@2"].opt_bin}/python2" # if build.with? :python end mkdir "build" do system "cmake", "..", *cmake_args system "make" system "make", "check" if build.with? "test" system "make", "install" end end def caveats s = "" libtiff = Formula["libtiff"] libtiff_cxx11 = Tab.for_formula(libtiff).cxx11? if (build.cxx11? && !libtiff_cxx11) || (libtiff_cxx11 && !build.cxx11?) s += <<~EOS The Homebrew warning about libtiff not being built with the C++11 standard may be safely ignored as Vigra only relies on C API of libtiff. EOS end s end test do system bin/"vigra-config", "--version" end end ================================================ FILE: Formula/osgeo-vtk.rb ================================================ class OsgeoVtk < Formula # include Language::Python::Virtualenv desc "Toolkit for 3D computer graphics, image processing, and visualization" homepage "https://www.vtk.org/" url "https://www.vtk.org/files/release/8.2/VTK-8.2.0.tar.gz" sha256 "34c3dc775261be5e45a8049155f7228b6bd668106c72a3c435d95730d17d57bb" # url "https://gitlab.kitware.com/vtk/vtk/-/archive/81221c6aa9076d4d22d388cfa07a46bc13e0cfc7/vtk-81221c6aa9076d4d22d388cfa07a46bc13e0cfc7.tar.gz" # sha256 "badeaada5bd2ef93c010dd17445280d032505aad6eb45a5ec423aa1030fe9801" # version "8.2.0" revision 16 head "https://github.com/Kitware/VTK.git", :branch => "master" bottle do root_url "https://bottle.download.osgeo.org" sha256 "3f74f585a3250d6308703072c0c008d6c2405b8bb318845b29cfd65efb36610d" => :catalina sha256 "3f74f585a3250d6308703072c0c008d6c2405b8bb318845b29cfd65efb36610d" => :mojave sha256 "3f74f585a3250d6308703072c0c008d6c2405b8bb318845b29cfd65efb36610d" => :high_sierra end # resource "FindPEGTL" do # url "https://src.fedoraproject.org/rpms/vtk/raw/master/f/FindPEGTL.cmake" # sha256 "0183debe3b115c8504edb2bf73b1eb4dc7127a864dce077d12c56a0b0ccf1b8a" # end # Fix compile issues on Mojave and later # Files: # Infovis/BoostGraphAlgorithms/vtkBoostGraphAdapter.h # Error: ‘my_bool’ was not declared in this scope; # https://bugs.gentoo.org/692674 # Files: # IO/MySQL/vtkMySQLDatabase.cxx # IO/MySQL/vtkMySQLQuery.cxx # Add libogg to IOMovie target link libraries # Files: # IO/Movie/CMakeLists.txt # Allow-compilation-on-GLES-platforms # On GLES 2.0 platforms (more specifically, for Qt5 "opengl es2" builds), # QOpenGLFunctions_3_2_Core does not exist. Since Qt 5.7, # QOpenGlFramebufferObject has a static wrapper method for framebuffer blitting, which in worst case is a noop. # Files: # GUISupport/Qt/QVTKOpenGLNativeWidget.cxx # Make code calling proj4 compatible with proj4 5.0 and later # GeoVis incompatible with external libproj4 6.0 # https://gitlab.kitware.com/vtk/vtk/issues/17554 # https://github.com/OSGeo/proj.4/wiki/proj.h-adoption-status # - projects.h is no longer available in 6.0 # - use of proj_api.h has to be opted in since 6.0, to be removed in 7.0 # - pj_get_list_ref has been renamed proj_list_operations in 5.0 # - PJProps is opaque now, its contents can be accessed with proj_pj_info. # As the contents are no longer global, the const char* from # GetProjectionName has to be copied into the vtkGeoProjection object. # Files: # Geovis/Core/vtkGeoProjection.cxx # Geovis/Core/vtkGeoTransform.cxx # ThirdParty/libproj/vtk_libproj.h.in # Bundled exodusii add missing libpthread # Files: # ThirdParty/exodusII/vtkexodusII/CMakeLists.txt # Bundled libharu add missing libm # Files: # ThirdParty/libharu/vtklibharu/src/CMakeLists.txt # Alt build - FindNetCDF - Wrapping/PythonCor # Files: # CMake/FindNetCDF.cmake # Wrapping/PythonCore/CMakeLists.txt # Fix compilation issue due to Python3.7 API change # The PyUnicode_AsUTF8() method returns a "const char *" in Py37 # Files: # Wrapping/PythonCore/vtkPythonArgs.cxx # Wrap # Files: # /Wrapping/Tools/CMakeLists.txt # Others compile # Files: # Wrapping/Java/CMakeLists.txt # nohtmldoc # Files: # Utilities/Doxygen/CMakeLists.txt # Compatibility for Python 3.8 # The PyTypeObject struct was modified in Python 3.8, this change is required to avoid compile errors. # Files: # PythonInterpreter/vtkPythonStdStreamCaptureHelper.h # Wrapping/PythonCore/PyVTKMethodDescriptor.cxx # Wrapping/PythonCore/PyVTKNamespace.cxx # Wrapping/PythonCore/PyVTKReference.cxx # Wrapping/PythonCore/PyVTKTemplate.cxx # Wrapping/PythonCore/vtkPythonCompatibility.h # Wrapping/Tools/vtkWrapPythonClass.c # Wrapping/Tools/vtkWrapPythonEnum.c # Wrapping/Tools/vtkWrapPythonType.c # GDAL # Files: # IO/GDAL/vtkGDALVectorReader.cxx # pthreads declaration # Files: # ThirdParty/libxml2/vtklibxml2/threads.c patch :DATA option "with-pg11", "Build with PostgreSQL 11 client" depends_on "cmake" => :build depends_on "boost" depends_on "fontconfig" depends_on "hdf5" depends_on "jpeg" depends_on "jpeg-turbo" depends_on "libpng" depends_on "libtiff" depends_on "python" depends_on "qt" depends_on "osgeo-netcdf" depends_on "gcc" depends_on "double-conversion" depends_on "doxygen" depends_on "ffmpeg" depends_on "gnuplot" depends_on "tcl-tk" depends_on "unixodbc" depends_on "wget" depends_on "eigen" depends_on "expat" depends_on "freetype" depends_on "glew" depends_on "jsoncpp" depends_on "libxml2" depends_on "lz4" depends_on "xz" depends_on "libogg" depends_on "pegtl" depends_on "pugixml" depends_on "ffmpeg2theora" depends_on "zlib" depends_on "sqlite" depends_on "graphviz" depends_on "osgeo-proj" depends_on "osgeo-gdal" #depends_on "osgeo-pyqt" depends_on "pyqt" depends_on "osgeo-qt-webkit" depends_on "osgeo-matplotlib" # JAVA_VERSION = "1.8" # "1.10+" depends_on "openjdk" => :build # JAVA_VERSION depends_on "gl2ps" depends_on "libharu" # depends_on "mysql" depends_on "mysql-client" depends_on "openslide" depends_on "tbb" depends_on "inetutils" if build.with?("pg11") depends_on "osgeo-postgresql@11" else depends_on "osgeo-postgresql" end depends_on "open-mpi" # depends_on "osgeo-mpi4py" def install # Warning: python modules have explicit framework links # These python extension modules were linked directly to a Python # framework binary. They should be linked with -undefined dynamic_lookup # instead of -lpython or -framework Python # ENV["PYTHON_LIBS"] = "-undefined dynamic_lookup" # PYTHON_LDFLAGS=-undefined dynamic_lookup # PYTHON_EXTRA_LIBS=-undefined dynamic_lookup # PYTHON_EXTRA_LDFLAGS=-undefined dynamic_lookup python_executable = `which python3`.strip python_prefix = `#{python_executable} -c 'import sys;print(sys.prefix)'`.chomp python_include = `#{python_executable} -c 'from distutils import sysconfig;print(sysconfig.get_python_inc(True))'`.chomp python_version = "python" + `#{python_executable} -c 'import sys;print(sys.version[:3])'`.chomp py_site_packages = "#{lib}/#{python_version}/site-packages" # # install python environment # venv = virtualenv_create(libexec/'vendor', "#{Formula["python"].opt_bin}/python3") # # res_required = ['setuptools', 'mpi4py'] # # res_required.each do |r| # venv.pip_install r # end # support for PROJ 6 # ENV.append_to_cflags "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" # Fix build with Java 12 # sed -i 's/VTK_JAVA_SOURCE_VERSION "1.6"/VTK_JAVA_SOURCE_VERSION "1.7"/ # s/VTK_JAVA_TARGET_VERSION "1.6"/VTK_JAVA_TARGET_VERSION "1.7"/' Wrapping/Java/CMakeLists.txt inreplace "Wrapping/Java/CMakeLists.txt", 'VTK_JAVA_SOURCE_VERSION "1.6"', 'VTK_JAVA_SOURCE_VERSION "1.7"' inreplace "Wrapping/Java/CMakeLists.txt", 'VTK_JAVA_TARGET_VERSION "1.6"', 'VTK_JAVA_TARGET_VERSION "1.7"' cmd = Language::Java.java_home_cmd("1.8") # JAVA_VERSION ENV["JAVA_HOME"] = Utils.popen_read(cmd).chomp # export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) args = std_cmake_args + %W[ -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_NAME_DIR:STRING=#{lib} -DCMAKE_INSTALL_RPATH:STRING=#{lib} -DModule_vtkInfovisBoost=ON -DModule_vtkInfovisBoostGraphAlgorithms=ON -DModule_vtkRenderingFreeTypeFontConfig=ON -DVTK_REQUIRED_OBJCXX_FLAGS='' -DVTK_USE_COCOA=ON -DVTK_USE_SYSTEM_EXPAT=ON -DVTK_USE_SYSTEM_HDF5=ON -DVTK_USE_SYSTEM_JPEG=ON -DVTK_USE_SYSTEM_LIBXML2=ON -DVTK_USE_SYSTEM_NETCDF=ON -DVTK_USE_SYSTEM_PNG=ON -DVTK_USE_SYSTEM_TIFF=ON -DVTK_USE_SYSTEM_ZLIB=ON -DVTK_WRAP_PYTHON=ON -DVTK_PYTHON_VERSION=3 -DPYTHON_EXECUTABLE=#{python_executable} -DPYTHON_INCLUDE_DIR=#{python_include} -DVTK_PYTHON_SITE_PACKAGES_SUFFIX=#{py_site_packages} -DVTK_INSTALL_PYTHON_MODULE_DIR=#{lib}/#{python_version}/site-packages -DVTK_QT_VERSION=5 -DVTK_Group_Qt=ON -DVTK_WRAP_PYTHON_SIP=ON -DSIP_PYQT_DIR=#{HOMEBREW_PREFIX}/share/sip/PyQt5 -DVTK_USE_FFMPEG_ENCODER=ON -DVTK_USE_LARGE_DATA=ON -DVTK_WRAP_JAVA=ON -DVTK_WRAP_TCL=ON -DCMAKE_CXX_FLAGS="-D__STDC_CONSTANT_MACROS" ] # Common with ParaView # VTK_USE_SYSTEM_LIB="" args << "-DVTK_USE_SYSTEM_DOUBLECONVERSION=ON" args << "-DVTK_USE_SYSTEM_EIGEN=ON" args << "-DVTK_USE_SYSTEM_FREETYPE=ON" args << "-DVTK_USE_SYSTEM_GLEW=ON" args << "-DVTK_USE_SYSTEM_JSONCPP=ON" args << "-DVTK_USE_SYSTEM_LZ4=ON" args << "-DVTK_USE_SYSTEM_LZMA=ON" args << "-DVTK_USE_SYSTEM_OGG=ON" # args << "-DVTK_USE_SYSTEM_PEGTL=ON" args << "-DVTK_USE_SYSTEM_PUGIXML=ON" args << "-DVTK_USE_SYSTEM_THEORA=ON" args << "-DVTK_USE_SYSTEM_LIBPROJ=ON" args << "-DVTK_USE_SYSTEM_SQLITE=ON" args << "-DVTK_USE_OGGTHEORA_ENCODER=0N" args << "-DOGGTHEORA_ogg_INCLUDE_DIR=#{Formula["libogg"].opt_include}/ogg/ogg.h" # ogg/ogg.h args << "-DOGGTHEORA_ogg_LIBRARY=#{Formula["libogg"].opt_lib}/libogg.dylib" # ogg args << "-DOGGTHEORA_theora_INCLUDE_DIR=#{Formula["theora"].opt_include}/theora/theora.h" # theora/theora.h args << "-DOGGTHEORA_theoraenc_LIBRARY=#{Formula["theora"].opt_lib}/libtheoraenc.dylib" # theoraenc args << "-DOGGTHEORA_theoradec_LIBRARY=#{Formula["theora"].opt_lib}/libtheoradec.dylib" # theoradec # args << "-DPEGTL_DIR=#{Formula["pegtl"]}" # args << "-DModule_vtkIOPDAL=ON" # args << "-DVTK_CUSTOM_LIBRARY_SUFFIX=" # args << "-DVTK_INSTALL_INCLUDE_DIR=include/vtk" # args << "-DVTK_INSTALL_TCL_DIR=lib/tcl/vtk/" args << "-DCMAKE_SKIP_RPATH=ON" args << "-DBUILD_DOCUMENTATION=OFF" args << "-DDOXYGEN_KEEP_TEMP=ON" args << "-DDOCUMENTATION_HTML_HELP=OFF" args << "-DDOCUMENTATION_HTML_TARZ=OFF" args << "-DBUILD_EXAMPLES=ON" args << "-DXDMF_STATIC_AND_SHARED=OFF" # args << "-DVTK_USE_TK=ON" # args << "-DVTK_USE_EXTERNAL=ON" # For MPI4PY args << "-DVTK_USE_SYSTEM_MPI4PY=OFF" # disable for error build ThirdParty/mpi4py # args << "-DVTK_USE_MPI=OFF" # args << "-Dmpi4py_INCLUDE_DIR=#{libexec}/vendor/lib/python#{python_version}/site-packages/mpi4py/include" # args << "-DVTK_GROUP_ENABLE_Rendering:STRING=WANT" # args << "-DVTK_GROUP_ENABLE_StandAlone:STRING=WANT" # args << "-DVTK_GROUP_ENABLE_Imaging:STRING=WANT" # args << "-DVTK_GROUP_ENABLE_MPI:STRING=DONT_WANT" # args << "-DVTK_GROUP_ENABLE_Views:STRING=WANT" # args << "-DVTK_GROUP_ENABLE_Qt:STRING=WANT" # args << "-DVTK_GROUP_ENABLE_Web:STRING=WANT" # args << "-DVTK_Group_Rendering:BOOL=ON" # args << "-DVTK_Group_StandAlone:BOOL=ON" # args << "-DVTK_Group_Imaging:BOOL=ON" # args << "-DVTK_Group_MPI:BOOL=OFF" # args << "-DVTK_Group_Views:BOOL=ON" # args << "-DVTK_Group_Qt:BOOL=ON" # args << "-DVTK_Group_Web:BOOL=ON" # args << "-DVTK_MODULE_ENABLE_VTK_ParallelMPI4Py:BOOL=OFF" # args << "-DModule_vtkParallelMPI4Py:BOOL=OFF" args << "-DVTK_BUILD_ALL_MODULES=ON" # For some reason, when ThirdParty/mpi4py is built it fails # The options (see above) to disable it do not seem to work # A non-ideal solution is applied, but that works to deactivate it mv "#{buildpath}/Parallel/MPI4Py/CMakeLists.txt", "#{buildpath}/Parallel/MPI4Py/CMakeLists.txt.bk" mv "#{buildpath}/Parallel/MPI4Py/module.cmake", "#{buildpath}/Parallel/MPI4Py/module.cmake.bk" mv "#{buildpath}/ThirdParty/mpi4py/CMakeLists.txt", "#{buildpath}/ThirdParty/mpi4py/CMakeLists.txt.bk" mv "#{buildpath}/ThirdParty/mpi4py/module.cmake", "#{buildpath}/ThirdParty/mpi4py/module.cmake.bk" # CMake picks up the system's python dylib, even if we have a brewed one. if File.exist? "#{python_prefix}/Python" args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'" elsif File.exist? "#{python_prefix}/lib/lib#{python_version}.a" args << "-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.a'" elsif File.exist? "#{python_prefix}/lib/lib#{python_version}.dylib" args << "-DPYTHON_LIBRARY='#{python_prefix}/lib/lib#{python_version}.dylib'" else odie "No libpythonX.Y.{dylib|a} file found!" end # git submodule update --init # system "git submodule update --init --recursive" # (buildpath/"ThirdParty/vtkm/vtkvtkm/vtk-m").install resource("vtk-m") # rm "#{buildpath}/CMake/FindPEGTL.cmake" # (buildpath/"CMake/FindPEGTL.cmake").install resource("FindPEGTL") mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end # Avoid hard-coding Python's Cellar paths inreplace Dir["#{lib}/cmake/**/vtkPython.cmake"].first, Formula["python"].prefix.realpath, Formula["python"].opt_prefix # Avoid hard-coding HDF5's Cellar path inreplace Dir["#{lib}/cmake/**/vtkhdf5.cmake"].first, Formula["hdf5"].prefix.realpath, Formula["hdf5"].opt_prefix # fix lib/python # maybe the reason is that it was changed VTK_INSTALL_PYTHON_MODULE_DIR # by VTK_PYTHON_SITE_PACKAGES_SUFFIX mv "#{lib}/#{lib}/#{python_version}", "#{lib}/#{python_version}" rm_r "#{lib}/usr" # fix: Could not fix @rpath/libjawt.dylib MachO::Tools.change_install_name("#{lib}/libvtkChartsCoreJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkDomainsChemistryJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkDomainsChemistryOpenGL2Java.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkDomainsParallelChemistryJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkFiltersHybridJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkFiltersParallelDIY2Java.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkFiltersParallelGeometryJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkFiltersParallelImagingJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkFiltersParallelJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkFiltersParallelMPIJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkGeovisCoreJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkIOExportJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkIOExportOpenGL2Java.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkIOExportPDFJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkIOImportJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkIOMINCJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkIOMPIParallelJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkIOParallelJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkInteractionImageJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkInteractionStyleJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkInteractionWidgetsJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingAnnotationJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingContext2DJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingContextOpenGL2Java.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingCoreJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingFreeTypeJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingGL2PSOpenGL2Java.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingImageJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingLICOpenGL2Java.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingLODJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingLabelJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingMatplotlibJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingOpenGL2Java.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingParallelJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingParallelLICJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingQtJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingSceneGraphJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingVolumeAMRJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingVolumeJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkRenderingVolumeOpenGL2Java.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkTestingRenderingJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkViewsContext2DJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkViewsCoreJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkViewsGeovisJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") MachO::Tools.change_install_name("#{lib}/libvtkViewsInfovisJava.dylib", "@rpath/libjawt.dylib", "#{ENV["JAVA_HOME"]}/jre/lib/libjawt.dylib") # Warning: JARs were installed to "/usr/local/opt/osgeo-vtk/lib" # Installing JARs to "lib" can cause conflicts between packages. # For Java software, it is typically better for the formula to # install to "libexec" and then symlink or wrap binaries into "bin". # See "activemq", "jruby", etc. for examples. # The offending files are: # /usr/local/opt/osgeo-vtk/lib/vtk.jar # libexec.install Dir["*"] # bin.install_symlink Dir["#{libexec}/bin/*"] end test do vtk_include = Dir[opt_include/"vtk-*"].first major, minor = vtk_include.match(/.*-(.*)$/)[1].split(".") (testpath/"version.cpp").write <<~EOS #include #include int main(int, char *[]) { assert (vtkVersion::GetVTKMajorVersion()==#{major}); assert (vtkVersion::GetVTKMinorVersion()==#{minor}); return EXIT_SUCCESS; } EOS system ENV.cxx, "-std=c++11", "version.cpp", "-I#{vtk_include}" system "./a.out" system "#{bin}/vtkpython", "-c", "exit()" end end __END__ ################################################################################ --- a/Infovis/BoostGraphAlgorithms/vtkBoostGraphAdapter.h +++ b/Infovis/BoostGraphAlgorithms/vtkBoostGraphAdapter.h @@ -159,14 +159,14 @@ namespace boost { public iterator_facade { public: explicit vtk_vertex_iterator(vtkIdType i = 0) : index(i) {} private: - vtkIdType dereference() const { return index; } + const vtkIdType& dereference() const { return index; } bool equal(const vtk_vertex_iterator& other) const { return index == other.index; } @@ -183,7 +183,7 @@ namespace boost { public iterator_facade { public: @@ -243,11 +243,16 @@ namespace boost { iter = nullptr; } } + + RecalculateEdge(); } private: - vtkEdgeType dereference() const - { return vtkEdgeType(vertex, iter->Target, iter->Id); } + const vtkEdgeType& dereference() const + { + assert(iter); + return edge; + } bool equal(const vtk_edge_iterator& other) const { return vertex == other.vertex && iter == other.iter; } @@ -277,6 +282,7 @@ namespace boost { inc(); } } + RecalculateEdge(); } void inc() @@ -304,12 +310,21 @@ namespace boost { } } + void RecalculateEdge() + { + if (iter) + { + edge = vtkEdgeType(vertex, iter->Target, iter->Id); + } + } + bool directed; vtkIdType vertex; vtkIdType lastVertex; const vtkOutEdgeType * iter; const vtkOutEdgeType * end; vtkGraph *graph; + vtkEdgeType edge; friend class iterator_core_access; }; @@ -318,12 +333,12 @@ namespace boost { public iterator_facade { public: explicit vtk_out_edge_pointer_iterator(vtkGraph *g = 0, vtkIdType v = 0, bool end = false) : - vertex(v) + vertex(v), iter(nullptr) { if (g) { @@ -334,19 +349,42 @@ namespace boost { iter += nedges; } } + RecalculateEdge(); } private: - vtkEdgeType dereference() const { return vtkEdgeType(vertex, iter->Target, iter->Id); } + const vtkEdgeType& dereference() const + { + assert(iter); + return edge; + } bool equal(const vtk_out_edge_pointer_iterator& other) const { return iter == other.iter; } - void increment() { iter++; } - void decrement() { iter--; } + void increment() + { + iter++; + RecalculateEdge(); + } + + void decrement() + { + iter--; + RecalculateEdge(); + } + + void RecalculateEdge() + { + if (iter) + { + edge = vtkEdgeType(vertex, iter->Target, iter->Id); + } + } vtkIdType vertex; const vtkOutEdgeType *iter; + vtkEdgeType edge; friend class iterator_core_access; }; @@ -355,12 +393,12 @@ namespace boost { public iterator_facade { public: explicit vtk_in_edge_pointer_iterator(vtkGraph *g = 0, vtkIdType v = 0, bool end = false) : - vertex(v) + vertex(v), iter(nullptr) { if (g) { @@ -371,19 +409,42 @@ namespace boost { iter += nedges; } } + RecalculateEdge(); } private: - vtkEdgeType dereference() const { return vtkEdgeType(iter->Source, vertex, iter->Id); } + const vtkEdgeType& dereference() const + { + assert(iter); + return edge; + } bool equal(const vtk_in_edge_pointer_iterator& other) const { return iter == other.iter; } - void increment() { iter++; } - void decrement() { iter--; } + void increment() + { + iter++; + RecalculateEdge(); + } + + void decrement() + { + iter--; + RecalculateEdge(); + } + + void RecalculateEdge() + { + if (iter) + { + edge = vtkEdgeType(iter->Source, vertex, iter->Id); + } + } vtkIdType vertex; const vtkInEdgeType *iter; + vtkEdgeType edge; friend class iterator_core_access; }; ################################################################################ ################################################################################ --- a/IO/MySQL/vtkMySQLDatabase.cxx +++ b/IO/MySQL/vtkMySQLDatabase.cxx @@ -146,7 +146,7 @@ if ( this->Reconnect ) { - my_bool recon = true; + bool recon = true; mysql_options( &this->Private->NullConnection, MYSQL_OPT_RECONNECT, &recon ); } --- a/IO/MySQL/vtkMySQLQuery.cxx +++ b/IO/MySQL/vtkMySQLQuery.cxx @@ -103,13 +103,13 @@ } public: - my_bool IsNull; // Is this parameter nullptr? - my_bool IsUnsigned; // For integer types, is it unsigned? + bool IsNull; // Is this parameter nullptr? + bool IsUnsigned; // For integer types, is it unsigned? char *Data; // Buffer holding actual data unsigned long BufferSize; // Buffer size unsigned long DataLength; // Size of the data in the buffer (must // be less than or equal to BufferSize) - my_bool HasError; // for the server to report truncation + bool HasError; // for the server to report truncation enum enum_field_types DataType; // MySQL data type for the contained data }; ################################################################################ ################################################################################ --- a/IO/Movie/CMakeLists.txt +++ b/IO/Movie/CMakeLists.txt @@ -33,3 +33,7 @@ vtk_module_library(vtkIOMovie ${Module_SRCS}) if(WIN32 AND VTK_USE_VIDEO_FOR_WINDOWS) vtk_module_link_libraries(vtkIOMovie LINK_PRIVATE vfw32) endif() + +if(vtkIOMovie_vtkoggtheora) + target_link_libraries(vtkIOMovie PUBLIC ogg) +endif() # @@ -30,6 +30,8 @@ set(vtkIOMovie_HDRS # # vtk_module_library(vtkIOMovie ${Module_SRCS}) # # +vtk_module_link_libraries(vtkIOMovie LINK_PRIVATE ogg) # + # if(WIN32 AND VTK_USE_VIDEO_FOR_WINDOWS) # vtk_module_link_libraries(vtkIOMovie LINK_PRIVATE vfw32) # endif() ################################################################################ ################################################################################ --- a/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx +++ b/GUISupport/Qt/QVTKOpenGLNativeWidget.cxx @@ -534,10 +534,15 @@ void QVTKOpenGLNativeWidget::paintGL() // blit from this->FBO to QOpenGLWidget's FBO. vtkQVTKOpenGLNativeWidgetDebugMacro("paintGL::blit-to-defaultFBO"); +#if QT_VERSION < 0x050700 QOpenGLFunctions_3_2_Core* f = QOpenGLContext::currentContext()->versionFunctions(); +#else + QOpenGLFunctions* f = QOpenGLContext::currentContext()->functions(); +#endif if (f) { +#if QT_VERSION < 0x050700 vtkOpenGLState *ostate = this->RenderWindow->GetState(); f->glBindFramebuffer(GL_DRAW_FRAMEBUFFER, this->defaultFramebufferObject()); @@ -556,6 +561,13 @@ void QVTKOpenGLNativeWidget::paintGL() f->glBlitFramebuffer(0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1], 0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1], GL_COLOR_BUFFER_BIT, GL_NEAREST); +#else + f->glDisable(GL_SCISSOR_TEST); // Scissor affects glBindFramebuffer. + QRect rect(0, 0, this->RenderWindow->GetSize()[0], this->RenderWindow->GetSize()[1]); + QOpenGLFramebufferObject::blitFramebuffer(0 /* binds to default framebuffer */, rect, + this->FBO, rect, GL_COLOR_BUFFER_BIT, GL_NEAREST, GL_COLOR_ATTACHMENT0, + GL_COLOR_ATTACHMENT0, QOpenGLFramebufferObject::DontRestoreFramebufferBinding); +#endif // now clear alpha otherwise we end up blending the rendering with // background windows in certain cases. It happens on OsX ################################################################################ ################################################################################ --- a/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt +++ b/ThirdParty/exodusII/vtkexodusII/CMakeLists.txt @@ -297,8 +297,10 @@ "${CMAKE_CURRENT_BINARY_DIR}/include/exodusII_cfg.h" "${CMAKE_CURRENT_BINARY_DIR}/include/exodus_config.h") -vtk_add_library(vtkexodusII ${sources} ${headers}) +vtk_add_library(vtkexodusII ${sources} ${headers}) +set_property(TARGET vtkexodusII PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(vtkexodusII PUBLIC ${vtknetcdf_LIBRARIES}) +target_link_libraries(vtkexodusII PUBLIC ${vtknetcdf_LIBRARIES} -pthread) if (NOT VTK_INSTALL_NO_DEVELOPMENT) install(FILES ${headers} ################################################################################ ################################################################################ --- a/ThirdParty/libharu/vtklibharu/src/CMakeLists.txt +++ b/ThirdParty/libharu/vtklibharu/src/CMakeLists.txt @@ -101,8 +101,10 @@ ) endif(LIBHPDF_SHARED) else () - vtk_add_library(vtklibharu ${LIBHPDF_SRCS}) + vtk_add_library(vtklibharu ${LIBHPDF_SRCS}) + set_property(TARGET vtklibharu PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(vtklibharu PRIVATE ${vtkzlib_LIBRARIES} ${vtkpng_LIBRARIES}) + target_link_libraries(vtklibharu PRIVATE ${vtkzlib_LIBRARIES} ${vtkpng_LIBRARIES} m) if (WIN32) set_target_properties(vtklibharu PROPERTIES ################################################################################ ################################################################################ --- a/CMake/FindNetCDF.cmake +++ b/CMake/FindNetCDF.cmake @@ -44,7 +44,7 @@ if(NETCDF_USE_DEFAULT_PATHS) endif() find_path (NETCDF_INCLUDE_DIR netcdf.h - PATHS "${NETCDF_DIR}/include") + PATHS "${NETCDF_DIR}/include/netcdf") mark_as_advanced (NETCDF_INCLUDE_DIR) set (NETCDF_C_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR}) @@ -67,7 +67,7 @@ macro (NetCDF_check_interface lang header libs) #search starting from user modifiable cache var find_path (NETCDF_${lang}_INCLUDE_DIR NAMES ${header} HINTS "${NETCDF_INCLUDE_DIR}" - HINTS "${NETCDF_${lang}_ROOT}/include" + HINTS "${NETCDF_${lang}_ROOT}/include/netcdf" ${USE_DEFAULT_PATHS}) find_library (NETCDF_${lang}_LIBRARY NAMES ${libs} --- a/Wrapping/PythonCore/CMakeLists.txt +++ b/Wrapping/PythonCore/CMakeLists.txt @@ -44,6 +44,7 @@ set(${vtk-module}_INCLUDE_DIRS) set(XY ${PYTHON_MAJOR_VERSION}${PYTHON_MINOR_VERSION}) vtk_module_library(${vtk-module} ${Module_SRCS}) +vtk_module_link_libraries(${vtk-module} LINK_PRIVATE ${PYTHON_LIBRARIES}) get_property(output_name TARGET ${vtk-module} PROPERTY OUTPUT_NAME) string(REPLACE "Python" "Python${XY}" output_name "${output_name}") set_property(TARGET ${vtk-module} PROPERTY OUTPUT_NAME ${output_name}) ################################################################################ ################################################################################ --- a/Wrapping/PythonCore/vtkPythonArgs.cxx +++ b/Wrapping/PythonCore/vtkPythonArgs.cxx @@ -124,8 +124,13 @@ { if (PyBytes_Check(o)) { +#if PY_VERSION_HEX >= 0x03070000 + a = const_cast(PyBytes_AS_STRING(o)); + return true; +#else a = PyBytes_AS_STRING(o); return true; +#endif } else if (PyByteArray_Check(o)) { @@ -135,7 +140,10 @@ #ifdef Py_USING_UNICODE else if (PyUnicode_Check(o)) { -#if PY_VERSION_HEX >= 0x03030000 +#if PY_VERSION_HEX >= 0x03070000 + a = const_cast(PyUnicode_AsUTF8(o)); + return true; +#elif PY_VERSION_HEX >= 0x03030000 a = PyUnicode_AsUTF8(o); return true; #else ################################################################################ ################################################################################ --- a/Wrapping/Tools/CMakeLists.txt +++ b/Wrapping/Tools/CMakeLists.txt @@ -66,6 +66,7 @@ target_link_libraries(vtkWrapHierarchy vtkWrappingTools) vtk_compile_tools_target(vtkWrapHierarchy) +if(VTK_WRAP_PYTHON) add_executable(vtkWrapPython vtkWrapPython.c vtkWrapPythonClass.c @@ -82,12 +83,15 @@ add_executable(vtkWrapPythonInit vtkWrapPythonInit.c) vtk_compile_tools_target(vtkWrapPython) vtk_compile_tools_target(vtkWrapPythonInit) +endif() +if(VTK_WRAP_JAVA) add_executable(vtkParseJava vtkParseJava.c) target_link_libraries(vtkParseJava vtkWrappingTools) add_executable(vtkWrapJava vtkWrapJava.c) target_link_libraries(vtkWrapJava vtkWrappingTools) vtk_compile_tools_target(vtkParseJava) vtk_compile_tools_target(vtkWrapJava) +endif() endif() # other # if(VTK_WRAP_TCL) # add_executable(vtkWrapTcl vtkWrapTcl.c) # target_link_libraries(vtkWrapTcl vtkWrappingTools) # add_executable(vtkWrapTclInit vtkWrapTclInit.c) # vtk_compile_tools_target(vtkWrapTcl) # vtk_compile_tools_target(vtkWrapTclInit) # endif() ################################################################################ ################################################################################ # --- a/Wrapping/Java/CMakeLists.txt # +++ b/Wrapping/Java/CMakeLists.txt # @@ -339,9 +339,9 @@ if(JOGL_GLUE) # endif() # # # Set the javac source version # -set(VTK_JAVA_SOURCE_VERSION "1.6" CACHE STRING "javac source version") # +set(VTK_JAVA_SOURCE_VERSION "13" CACHE STRING "javac source version") # mark_as_advanced(VTK_JAVA_SOURCE_VERSION) # -set(VTK_JAVA_TARGET_VERSION "1.6" CACHE STRING "javac target version") # +set(VTK_JAVA_TARGET_VERSION "13" CACHE STRING "javac target version") # mark_as_advanced(VTK_JAVA_TARGET_VERSION) # # # On machines with long paths to VTK (or windows where the command line length ################################################################################ ################################################################################ --- a/Utilities/Doxygen/CMakeLists.txt +++ b/Utilities/Doxygen/CMakeLists.txt @@ -80,7 +80,4 @@ install(FILES doc_readme.txt DESTINATION ${VTK_INSTALL_DOXYGEN_DIR} COMPONENT Development) - install(DIRECTORY ${VTK_BINARY_DIR}/Utilities/Doxygen/doc/html - DESTINATION ${VTK_INSTALL_DOXYGEN_DIR} - COMPONENT Development) endif() ################################################################################ ################################################################################ --- a/CMake/FindLibPROJ.cmake +++ b/CMake/FindLibPROJ.cmake @@ -30,7 +30,7 @@ if ( NOT LibPROJ_INCLUDE_DIR OR NOT LibP ) find_path( LibPROJ_INCLUDE_DIR - NAMES proj_api.h + NAMES proj_api.h proj.h HINTS ${_LibPROJ_DIR} ${_LibPROJ_DIR}/include --- a/Geovis/Core/vtkGeoProjection.cxx +++ b/Geovis/Core/vtkGeoProjection.cxx @@ -72,6 +72,9 @@ public: } std::map< std::string, std::string > OptionalParameters; +#if PROJ_VERSION_MAJOR >= 5 + PJ_PROJ_INFO ProjInfo; +#endif }; //----------------------------------------------------------------------------- @@ -80,7 +83,7 @@ int vtkGeoProjection::GetNumberOfProject if ( vtkGeoProjectionNumProj < 0 ) { vtkGeoProjectionNumProj = 0; - for ( const PJ_LIST* pj = pj_get_list_ref(); pj && pj->id; ++ pj ) + for ( const PJ_LIST* pj = proj_list_operations(); pj && pj->id; ++ pj ) ++ vtkGeoProjectionNumProj; } return vtkGeoProjectionNumProj; @@ -91,7 +94,7 @@ const char* vtkGeoProjection::GetProject if ( projection < 0 || projection >= vtkGeoProjection::GetNumberOfProjections() ) return nullptr; - return pj_get_list_ref()[projection].id; + return proj_list_operations()[projection].id; } //----------------------------------------------------------------------------- const char* vtkGeoProjection::GetProjectionDescription( int projection ) @@ -99,7 +102,7 @@ const char* vtkGeoProjection::GetProject if ( projection < 0 || projection >= vtkGeoProjection::GetNumberOfProjections() ) return nullptr; - return pj_get_list_ref()[projection].descr[0]; + return proj_list_operations()[projection].descr[0]; } //----------------------------------------------------------------------------- vtkGeoProjection::vtkGeoProjection() @@ -144,7 +147,7 @@ void vtkGeoProjection::PrintSelf( ostrea int vtkGeoProjection::GetIndex() { int i = 0; - for ( const PJ_LIST* proj = pj_get_list_ref(); proj && proj->id; ++ proj, ++ i ) + for ( const PJ_LIST* proj = proj_list_operations(); proj && proj->id; ++ proj, ++ i ) { if ( ! strcmp( proj->id, this->Name ) ) { @@ -161,7 +164,11 @@ const char* vtkGeoProjection::GetDescrip { return nullptr; } +#if PROJ_VERSION_MAJOR >= 5 + return this->Internals->ProjInfo.description; +#else return this->Projection->descr; +#endif } //----------------------------------------------------------------------------- projPJ vtkGeoProjection::GetProjection() @@ -232,6 +239,9 @@ int vtkGeoProjection::UpdateProjection() this->ProjectionMTime = this->GetMTime(); if ( this->Projection ) { +#if PROJ_VERSION_MAJOR >= 5 + this->Internals->ProjInfo = proj_pj_info(this->Projection); +#endif return 0; } return 1; --- a/Geovis/Core/vtkGeoTransform.cxx +++ b/Geovis/Core/vtkGeoTransform.cxx @@ -167,9 +167,17 @@ void vtkGeoTransform::InternalTransformP double* coord = x; for ( vtkIdType i = 0; i < numPts; ++ i ) { +#if PROJ_VERSION_MAJOR >= 5 + xy.x = coord[0]; xy.y = coord[1]; +#else xy.u = coord[0]; xy.v = coord[1]; +#endif lp = pj_inv( xy, src ); +#if PROJ_VERSION_MAJOR >= 5 + coord[0] = lp.lam; coord[1] = lp.phi; +#else coord[0] = lp.u; coord[1] = lp.v; +#endif coord += stride; } } @@ -191,9 +199,17 @@ void vtkGeoTransform::InternalTransformP double* coord = x; for ( vtkIdType i = 0; i < numPts; ++ i ) { +#if PROJ_VERSION_MAJOR >= 5 + lp.lam = coord[0]; lp.phi = coord[1]; +#else lp.u = coord[0]; lp.v = coord[1]; +#endif xy = pj_fwd( lp, dst ); +#if PROJ_VERSION_MAJOR >= 5 + coord[0] = xy.x; coord[1] = xy.y; +#else coord[0] = xy.u; coord[1] = xy.v; +#endif coord += stride; } } --- a/ThirdParty/libproj/vtk_libproj.h.in +++ b/ThirdParty/libproj/vtk_libproj.h.in @@ -15,10 +15,20 @@ #ifndef vtk_libproj_h #define vtk_libproj_h +#define VTK_LibPROJ_MAJOR_VERSION @LibPROJ_MAJOR_VERSION@ + /* Use the libproj library configured for VTK. */ #cmakedefine VTK_USE_SYSTEM_LIBPROJ #ifdef VTK_USE_SYSTEM_LIBPROJ -# include +# if VTK_LibPROJ_MAJOR_VERSION >= 5 +# include +# endif +# if VTK_LibPROJ_MAJOR_VERSION < 6 +# include +# endif +# if VTK_LibPROJ_MAJOR_VERSION >= 6 +# define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 +# endif # include # include #else --- VTK-8.2.0/CMake/FindLibPROJ.cmake 2019-09-11 22:13:29.493741215 -0600 +++ vtk/CMake/FindLibPROJ.cmake 2019-09-11 19:56:57.465802610 -0600 @@ -1,55 +1,67 @@ -# Find LibPROJ library and header file -# Sets -# LibPROJ_FOUND to 0 or 1 depending on the result -# LibPROJ_INCLUDE_DIR to directories required for using libproj4 -# LibPROJ_LIBRARIES to libproj4 and any dependent libraries -# If LibPROJ_REQUIRED is defined, then a fatal error message will be generated if libproj4 is not found - -if ( NOT LibPROJ_INCLUDE_DIR OR NOT LibPROJ_LIBRARIES OR NOT LibPROJ_FOUND ) +find_path(LibPROJ_INCLUDE_DIR + NAMES proj_api.h proj.h + DOC "libproj include directories") +mark_as_advanced(LibPROJ_INCLUDE_DIR) - if ( $ENV{LibPROJ_DIR} ) - file( TO_CMAKE_PATH "$ENV{LibPROJ_DIR}" _LibPROJ_DIR ) +find_library(LibPROJ_LIBRARY_RELEASE + NAMES proj + DOC "libproj release library") +mark_as_advanced(LibPROJ_LIBRARY_RELEASE) + +find_library(LibPROJ_LIBRARY_DEBUG + NAMES projd + DOC "libproj debug library") +mark_as_advanced(LibPROJ_LIBRARY_DEBUG) + +include(SelectLibraryConfigurations) +select_library_configurations(LibPROJ) + +if (LibPROJ_INCLUDE_DIR) + if (EXISTS "${LibPROJ_INCLUDE_DIR}/proj.h") + file(STRINGS "${LibPROJ_INCLUDE_DIR}/proj.h" _libproj_version_lines REGEX "#define[ \t]+PROJ_VERSION_(MAJOR|MINOR|PATCH)") + string(REGEX REPLACE ".*PROJ_VERSION_MAJOR *\([0-9]*\).*" "\\1" _libproj_version_major "${_libproj_version_lines}") + string(REGEX REPLACE ".*PROJ_VERSION_MINOR *\([0-9]*\).*" "\\1" _libproj_version_minor "${_libproj_version_lines}") + string(REGEX REPLACE ".*PROJ_VERSION_PATCH *\([0-9]*\).*" "\\1" _libproj_version_patch "${_libproj_version_lines}") + else () + file(STRINGS "${LibPROJ_INCLUDE_DIR}/proj_api.h" _libproj_version_lines REGEX "#define[ \t]+PJ_VERSION") + string(REGEX REPLACE ".*PJ_VERSION *\([0-9]*\).*" "\\1" _libproj_version "${_libproj_version_lines}") + math(EXPR _libproj_version_major "${_libproj_version} / 100") + math(EXPR _libproj_version_minor "(${_libproj_version} % 100) / 10") + math(EXPR _libproj_version_patch "${_libproj_version} % 10") endif () - - set(LibPROJ_LIBRARY_SEARCH_PATHS - ${_LibPROJ_DIR} - ${_LibPROJ_DIR}/lib64 - ${_LibPROJ_DIR}/lib - ) - - find_library( LibPROJ_LIBRARY_RELEASE - NAMES proj - HINTS - ${LibPROJ_LIBRARY_SEARCH_PATHS} - ) - - find_library( LibPROJ_LIBRARY_DEBUG - NAMES projd - PATHS - ${LibPROJ_LIBRARY_SEARCH_PATHS} - ) - - find_path( LibPROJ_INCLUDE_DIR - NAMES proj_api.h proj.h - HINTS - ${_LibPROJ_DIR} - ${_LibPROJ_DIR}/include - ) - - include(SelectLibraryConfigurations) - select_library_configurations(LibPROJ) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(LibPROJ - REQUIRED_VARS LibPROJ_LIBRARY LibPROJ_INCLUDE_DIR) - - if(LibPROJ_FOUND) - set(LibPROJ_INCLUDE_DIRS ${LibPROJ_INCLUDE_DIR}) - - if(NOT LibPROJ_LIBRARIES) - set(LibPROJ_LIBRARIES ${LibPROJ_LIBRARY}) - endif() - endif() + set(LibPROJ_VERSION "${_libproj_version_major}.${_libproj_version_minor}.${_libproj_version_patch}") + set(LibPROJ_MAJOR_VERSION "${_libproj_version_major}") + unset(_libproj_version_major) + unset(_libproj_version_minor) + unset(_libproj_version_patch) + unset(_libproj_version) + unset(_libproj_version_lines) endif () -mark_as_advanced(LibPROJ_INCLUDE_DIR) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibPROJ + REQUIRED_VARS LibPROJ_LIBRARY LibPROJ_INCLUDE_DIR + VERSION_VAR LibPROJ_VERSION) + +if (LibPROJ_FOUND) + set(LibPROJ_INCLUDE_DIRS "${LibPROJ_INCLUDE_DIR}") + set(LibPROJ_LIBRARIES "${LibPROJ_LIBRARY}") + + if (NOT TARGET LibPROJ::LibPROJ) + add_library(LibPROJ::LibPROJ UNKNOWN IMPORTED) + set_target_properties(LibPROJ::LibPROJ PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${LibPROJ_INCLUDE_DIR}") + if (LibPROJ_LIBRARY_RELEASE) + set_property(TARGET LibPROJ::LibPROJ APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(LibPROJ::LibPROJ PROPERTIES + IMPORTED_LOCATION_RELEASE "${LibPROJ_LIBRARY_RELEASE}") + endif () + if (LibPROJ_LIBRARY_DEBUG) + set_property(TARGET LibPROJ::LibPROJ APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(LibPROJ::LibPROJ PROPERTIES + IMPORTED_LOCATION_DEBUG "${LibPROJ_LIBRARY_DEBUG}") + endif () + endif () +endif () ################################################################################ ################################################################################ --- a/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h +++ b/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h @@ -140,6 +140,12 @@ static PyTypeObject vtkPythonStdStreamCaptureHelperType = { #if PY_VERSION_HEX >= 0x03040000 0, // tp_finalize #endif +#if PY_VERSION_HEX >= 0x03080000 + 0, // tp_vectorcall +#if PY_VERSION_HEX < 0x03090000 + 0, // tp_print +#endif +#endif }; static PyObject* vtkWrite(PyObject* self, PyObject* args) --- a/Wrapping/PythonCore/PyVTKMethodDescriptor.cxx +++ b/Wrapping/PythonCore/PyVTKMethodDescriptor.cxx @@ -186,7 +186,7 @@ PyTypeObject PyVTKMethodDescriptor_Type = { sizeof(PyMethodDescrObject), // tp_basicsize 0, // tp_itemsize PyVTKMethodDescriptor_Delete, // tp_dealloc - nullptr, // tp_print + 0, // tp_vectorcall_offset nullptr, // tp_getattr nullptr, // tp_setattr nullptr, // tp_compare --- a/Wrapping/PythonCore/PyVTKNamespace.cxx +++ b/Wrapping/PythonCore/PyVTKNamespace.cxx @@ -49,7 +49,7 @@ PyTypeObject PyVTKNamespace_Type = { 0, // tp_basicsize 0, // tp_itemsize PyVTKNamespace_Delete, // tp_dealloc - nullptr, // tp_print + 0, // tp_vectorcall_offset nullptr, // tp_getattr nullptr, // tp_setattr nullptr, // tp_compare --- a/Wrapping/PythonCore/PyVTKReference.cxx +++ b/Wrapping/PythonCore/PyVTKReference.cxx @@ -1010,7 +1010,7 @@ PyTypeObject PyVTKReference_Type = { sizeof(PyVTKReference), // tp_basicsize 0, // tp_itemsize PyVTKReference_Delete, // tp_dealloc - nullptr, // tp_print + 0, // tp_vectorcall_offset nullptr, // tp_getattr nullptr, // tp_setattr nullptr, // tp_compare @@ -1067,7 +1067,7 @@ PyTypeObject PyVTKNumberReference_Type = { sizeof(PyVTKReference), // tp_basicsize 0, // tp_itemsize PyVTKReference_Delete, // tp_dealloc - nullptr, // tp_print + 0, // tp_vectorcall_offset nullptr, // tp_getattr nullptr, // tp_setattr nullptr, // tp_compare @@ -1124,7 +1124,7 @@ PyTypeObject PyVTKStringReference_Type = { sizeof(PyVTKReference), // tp_basicsize 0, // tp_itemsize PyVTKReference_Delete, // tp_dealloc - nullptr, // tp_print + 0, // tp_vectorcall_offset nullptr, // tp_getattr nullptr, // tp_setattr nullptr, // tp_compare @@ -1181,7 +1181,7 @@ PyTypeObject PyVTKTupleReference_Type = { sizeof(PyVTKReference), // tp_basicsize 0, // tp_itemsize PyVTKReference_Delete, // tp_dealloc - nullptr, // tp_print + 0, // tp_vectorcall_offset nullptr, // tp_getattr nullptr, // tp_setattr nullptr, // tp_compare --- a/Wrapping/PythonCore/PyVTKTemplate.cxx +++ b/Wrapping/PythonCore/PyVTKTemplate.cxx @@ -268,7 +268,7 @@ PyTypeObject PyVTKTemplate_Type = { 0, // tp_basicsize 0, // tp_itemsize nullptr, // tp_dealloc - nullptr, // tp_print + 0, // tp_vectorcall_offset nullptr, // tp_getattr nullptr, // tp_setattr nullptr, // tp_compare --- a/Wrapping/PythonCore/vtkPythonCompatibility.h +++ b/Wrapping/PythonCore/vtkPythonCompatibility.h @@ -64,7 +64,13 @@ #endif // PyTypeObject compatibility -#if PY_VERSION_HEX >= 0x03040000 +#if PY_VERSION_HEX >= 0x03090000 +#define VTK_WRAP_PYTHON_SUPPRESS_UNINITIALIZED \ + 0, 0, 0, 0, +#elif PY_VERSION_HEX >= 0x03080000 +#define VTK_WRAP_PYTHON_SUPPRESS_UNINITIALIZED \ + 0, 0, 0, 0, 0, +#elif PY_VERSION_HEX >= 0x03040000 #define VTK_WRAP_PYTHON_SUPPRESS_UNINITIALIZED \ 0, 0, 0, #else --- a/Wrapping/Tools/vtkWrapPythonClass.c +++ b/Wrapping/Tools/vtkWrapPythonClass.c @@ -521,7 +521,7 @@ void vtkWrapPython_GenerateObjectType( " sizeof(PyVTKObject), // tp_basicsize\n" " 0, // tp_itemsize\n" " PyVTKObject_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" --- a/Wrapping/Tools/vtkWrapPythonEnum.c +++ b/Wrapping/Tools/vtkWrapPythonEnum.c @@ -145,7 +145,7 @@ void vtkWrapPython_GenerateEnumType( " sizeof(PyIntObject), // 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" --- a/Wrapping/Tools/vtkWrapPythonType.c +++ b/Wrapping/Tools/vtkWrapPythonType.c @@ -709,7 +709,7 @@ void vtkWrapPython_GenerateSpecialType( " sizeof(PyVTKSpecialObject), // tp_basicsize\n" " 0, // tp_itemsize\n" " Py%s_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" ################################################################################ ################################################################################ # --- a/IO/GDAL/vtkGDALVectorReader.cxx # +++ b/IO/GDAL/vtkGDALVectorReader.cxx # @@ -44,7 +44,7 @@ class vtkGDALVectorReader::Internal # public: # Internal( const char* srcName, int srcMode, int appendFeatures, int addFeatIds ) # { # - this->Source = OGRSFDriverRegistrar::Open( srcName, srcMode, &this->Driver ); # + this->Source = (GDALDataset*) OGROpen( srcName, srcMode, NULL ); # if ( ! this->Source ) # { # this->LastError = CPLGetLastErrorMsg(); # @@ -61,7 +61,7 @@ public: # { # if ( this->Source ) # { # - OGRDataSource::DestroyDataSource( this->Source ); # + GDALClose( (GDALDatasetH) this->Source ); # } # } # # @@ -304,7 +304,7 @@ public: # return nCells; # } # # - OGRDataSource* Source; # + GDALDataset* Source; # OGRSFDriver* Driver; # const char* LastError; # int LayerIdx; ################################################################################ ################################################################################ # --- a/ThirdParty/libxml2/vtklibxml2/threads.c # +++ b/ThirdParty/libxml2/vtklibxml2/threads.c # @@ -49,7 +49,7 @@ # #ifdef HAVE_PTHREAD_H # # static int libxml_is_threaded = -1; # -#ifdef __GNUC__ # +#if 0 # #ifdef linux # #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3) # extern int pthread_once (pthread_once_t *__once_control, ################################################################################ ================================================ FILE: Formula/osgeo-whitebox-tools.rb ================================================ class OsgeoWhiteboxTools < Formula desc "An advanced geospatial data analysis platform" homepage "https://www.uoguelph.ca/~hydrogeo/WhiteboxTools" url "https://jblindsay.github.io/ghrg/WhiteboxTools/WhiteboxTools_darwin_amd64.zip" sha256 "c6bbd1bf8775ee778b11bb816f54dc50a93633b5f8480b512129d27cad346737" version "1.2.0" # revision 1 bottle do root_url "https://bottle.download.osgeo.org" cellar :any_skip_relocation sha256 "24b5c05d0b058953e7a783f1a923be428ff1ffc27fc48a4a9bc7b120a6830809" => :catalina sha256 "24b5c05d0b058953e7a783f1a923be428ff1ffc27fc48a4a9bc7b120a6830809" => :mojave sha256 "24b5c05d0b058953e7a783f1a923be428ff1ffc27fc48a4a9bc7b120a6830809" => :high_sierra end def install cp_r buildpath.to_s, prefix.to_s mkdir bin.to_s ln_s "#{prefix}/WBT/whitebox_tools", "#{bin}/whitebox_tools" end test do system "#{bin}/whitebox_tools", "--toolbox=Slope" end end ================================================ FILE: Formula/osgeo-whitebox.rb ================================================ class OsgeoWhitebox < Formula desc "Geographic information system (GIS) and remote sensing package intended for advanced geospatial analysis and data visualization" homepage "https://www.uoguelph.ca/~hydrogeo/Whitebox" url "https://www.uoguelph.ca/~hydrogeo/Whitebox/WhiteboxGAT-mac.zip" sha256 "32b2a75dab883e97d271621c60e7ad254558587b8bda0f1013bb9562077eea34" version "3.4.0" revision 6 bottle do root_url "https://bottle.download.osgeo.org" cellar :any_skip_relocation sha256 "3f55a7bc83ba79dfdf98d73e37385ae4f10601c31e44d351afe040573ec42e73" => :catalina sha256 "3f55a7bc83ba79dfdf98d73e37385ae4f10601c31e44d351afe040573ec42e73" => :mojave sha256 "3f55a7bc83ba79dfdf98d73e37385ae4f10601c31e44d351afe040573ec42e73" => :high_sierra end option "with-app", "Build WBT.app Package" depends_on "bash" # depends_on "openjdk" def install cp_r "#{buildpath}", "#{prefix}" mkdir "#{bin}" # create whitebox File.open("#{bin}/whitebox", "w") { |file| file << '#!/bin/sh' file << "\n" file << "/usr/bin/java -jar #{prefix}/WhiteboxGAT-mac/WhiteboxGIS.jar" } # chmod("+x", "#{bin}/whitebox") if build.with? "app" (prefix/"WBT.app/Contents/PkgInfo").write "APPLWBT" (prefix/"WBT.app/Contents/Resources").mkpath cp_r "#{prefix}/WhiteboxGAT-mac/resources/Images/wbGAT.png", "#{prefix}/WBT.app/Contents/Resources/whitebox.icns" config = <<~EOS CFBundleDevelopmentRegion English CFBundleExecutable whitebox CFBundleIconFile whitebox.icns CFBundleInfoDictionaryVersion 6.0 CFBundleName WTB CFBundlePackageType APPL CFBundleSignature WTB CFBundleVersion 1.0 CSResourcesFileMapped NSHighResolutionCapable True EOS (prefix/"WBT.app/Contents/Info.plist").write config chdir "#{prefix}/WBT.app/Contents" do mkdir "MacOS" do ln_s "#{bin}/whitebox", "whitebox" end end end end def caveats s = <<~EOS \n\033[31mRequires Java 8.\e[0m \e[0mHow To Install Java 8: \e[32mbrew tap caskroom/cask\e[0m \e[32mbrew install java8\e[0m Install Multiple Java Versions: https://gist.github.com/ntamvl/5f4dbaa8f68e6897b99682a395a44c2e https://gist.github.com/alChaCC/ddb11542c9e6b6683bad80d9ca858bc5 EOS if build.with? "app" s += <<~EOS \e[32mWBT.app\e[0m was installed in: \e[32m#{prefix}\e[0m You may also symlink to /Applications or ~/Applications: \e[32mln -Fs `find $(brew --prefix) -name "WBT.app"` /Applications/WBT.app\e[0m EOS end s end test do # TODO end end ================================================ FILE: Formula/prepair.rb ================================================ class Prepair < Formula desc "Automatic repair of single GIS polygons using constrained triangulation" homepage "https://github.com/tudelft-gist/prepair" url "https://github.com/tudelft3d/prepair/archive/v0.7.1.tar.gz" sha256 "2abc69588880e595552af363580e38c1a4a63c9d51549f6450ab6f96ee1ad67f" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" cellar :any sha256 "25ac4f4cdb1282e662718e7bf6cb1419d9ae586af842db3ac26bfb9ce1d8848c" => :high_sierra sha256 "25ac4f4cdb1282e662718e7bf6cb1419d9ae586af842db3ac26bfb9ce1d8848c" => :sierra end option "with-library", "Build library in addition to executable" depends_on "cmake" => :build depends_on "cgal" depends_on "gdal2" def install libexec.install(%w[data icon.png]) # geojson sample data and project icon args = std_cmake_args mkdir "build" do system "cmake", "..", *args # system "/usr/local/bin/bbedit", "CMakeCache.txt" # raise system "make" bin.install "prepair" if build.with? "library" args << "-DAS_LIBRARY=ON" system "cmake", "..", *args system "make" lib.install "libprepair.dylib" end end end test do mktemp do system "#{bin}/prepair", "--shpOut", "--ogr", "#{libexec}/data/CLC2006_180927.geojson" end end end ================================================ FILE: Formula/qca-qt@5.7.rb ================================================ class QcaQtAT57 < Formula desc "Qt Cryptographic Architecture (QCA)" homepage "http://delta.affinix.com/qca/" head "https://anongit.kde.org/qca.git" stable do url "https://github.com/KDE/qca/archive/v2.1.1.tar.gz" sha256 "aa8ec328da163a5e20ac59146e56b17d0677789f020d0c3875c4ed5e9e82e749" # Fix for linking CoreFoundation and removing deprecated code (already in HEAD) patch do url "https://github.com/KDE/qca/commit/f223ce03d4b94ffbb093fc8be5adf8d968f54434.diff" sha256 "75ef105b01658c3b4030b8c697338dbceddbcc654b022162b284e0fa8df582b5" end # Fix for framework installation (already in HEAD) patch do url "https://github.com/KDE/qca/commit/9e4bf795434304bce32626fe0f6887c10fec0824.diff" sha256 "5f4e575d2c9f55090c7e3358dc27b6e22cccecaaee264d1638aabac86421c314" end end bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" sha256 "f478153f18c3640a42d0dbe22495e194d2ddeb8c55ab8d67d08a9b850a4b9ed3" => :sierra end keg_only "Qt5 is keg-only" option "with-api-docs", "Build API documentation" deprecated_option "with-gnupg" => "with-gpg2" deprecated_option "with-qt" => "with-qt@5.7" depends_on "cmake" => :build depends_on "pkg-config" => :build depends_on "qt@5.7" => :recommended # Plugins (QCA needs at least one plugin to do anything useful) depends_on "openssl" # qca-ossl depends_on "botan" => :optional # qca-botan depends_on "libgcrypt" => :optional # qca-gcrypt depends_on "gpg" => :optional # qca-gnupg depends_on "nss" => :optional # qca-nss depends_on "pkcs11-helper" => :optional # qca-pkcs11 if build.with? "api-docs" depends_on "graphviz" => :build depends_on "doxygen" => [:build, "with-graphviz"] end def install odie "Qt dependency must be defined" if build.without?("qt") && build.without?("qt@5.7") args = std_cmake_args args << "-DQT4_BUILD=OFF" args << "-DBUILD_TESTS=OFF" # Plugins (qca-ossl, qca-cyrus-sasl, qca-logger, qca-softstore always built) args << "-DWITH_botan_PLUGIN=#{build.with?("botan") ? "YES" : "NO"}" args << "-DWITH_gcrypt_PLUGIN=#{build.with?("libgcrypt") ? "YES" : "NO"}" args << "-DWITH_gnupg_PLUGIN=#{build.with?("gpg2") ? "YES" : "NO"}" args << "-DWITH_nss_PLUGIN=#{build.with?("nss") ? "YES" : "NO"}" args << "-DWITH_pkcs11_PLUGIN=#{build.with?("pkcs11-helper") ? "YES" : "NO"}" system "cmake", ".", *args system "make", "install" if build.with? "api-docs" system "make", "doc" doc.install "apidocs/html" end end test do system bin/"qcatool-qt5", "--noprompt", "--newpass=", "key", "make", "rsa", "2048", "test.key" end end ================================================ FILE: Formula/qt-ifw-qt5.rb ================================================ class QtIfwQt5 < Formula desc "Static build of version 5 of Qt for use in Qt Installer Framework" homepage "http://qt-project.org" url "https://download.qt.io/official_releases/qt/5.6/5.6.0/single/qt-everywhere-opensource-src-5.6.0.tar.xz" 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" sha256 "76a95cf6c1503290f75a641aa25079cd0c5a8fcd7cff07ddebff80a955b07de7" keg_only "Qt 5 conflicts Qt 4 (which is currently much more widely used)." # OS X 10.7 Lion is still supported in Qt 5.5, but is no longer a reference # configuration and thus untested in practice. Builds on OS X 10.7 have been # reported to fail: . # depends_on :macos => :mountain_lion # error: unknown version depends_on "pkg-config" => :build depends_on :xcode => :build def install args = ["-prefix", prefix, "-release", "-static", "-accessibility", "-qt-zlib", "-qt-libpng", "-qt-libjpeg", "-qt-freetype", "-qt-pcre", "-no-cups", "-no-sql-sqlite", "-no-qml-debug", "-nomake", "examples", "-nomake", "tests", "-skip", "qt3d", "-skip", "qtactiveqt", "-skip", "qtcanvas3d", "-skip", "qtenginio", "-skip", "qtlocation", "-skip", "qtmultimedia", "-skip", "qtserialbus", "-skip", "qtserialport", "-skip", "qtquickcontrols", "-skip", "qtquickcontrols2", "-skip", "qtscript", "-skip", "qtsensors", "-skip", "qtwebview", "-skip", "qtwebsockets", "-skip", "qtxmlpatterns", "-confirm-license", "-opensource"] system "./configure", *args system "make" ENV.j1 system "make", "install" # Some config scripts will only find Qt in a "Frameworks" folder frameworks.install_symlink Dir["#{lib}/*.framework"] # The pkg-config files installed suggest that headers can be found in the # `include` directory. Make this so by creating symlinks from `include` to # the Frameworks' Headers folders. Pathname.glob("#{lib}/*.framework/Headers") do |path| include.install_symlink path => path.parent.basename(".framework") end # configure saved PKG_CONFIG_LIBDIR set up by superenv; remove it # see: https://github.com/Homebrew/homebrew/issues/27184 inreplace prefix/"mkspecs/qconfig.pri", /\n# pkgconfig\n(PKG_CONFIG_(SYSROOT_DIR|LIBDIR) = .*\n){2}\n/, "\n" # Move `*.app` bundles into `libexec` to expose them to `brew linkapps` and # because we don't like having them in `bin`. Also add a `-qt5` suffix to # avoid conflict with the `*.app` bundles provided by the `qt` formula. # (Note: This move/rename breaks invocation of Assistant via the Help menu # of both Designer and Linguist as that relies on Assistant being in `bin`.) libexec.mkpath Pathname.glob("#{bin}/*.app") do |app| mv app, libexec/"#{app.basename(".app")}-qt5.app" end end def caveats; <<~EOS We agreed to the Qt5 opensource license for you. If this is unacceptable you should uninstall. EOS end test do (testpath/"hello.pro").write <<~EOS QT += core QT -= gui TARGET = hello CONFIG += console CONFIG -= app_bundle TEMPLATE = app SOURCES += main.cpp EOS (testpath/"main.cpp").write <<~EOS #include #include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); qDebug() << "Hello World!"; return 0; } EOS system bin/"qmake", testpath/"hello.pro" system "make" assert_predicate "hello", :exists? assert_predicate "main.o", :exists? system "./hello" end end ================================================ FILE: Formula/qt-ifw.rb ================================================ class QtIfw < Formula desc "Tools and utilities to create installers for Qt desktop platforms" homepage "http://qt-project.org/wiki/Qt-Installer-Framework" url "https://download.qt.io/official_releases/qt-installer-framework/2.0.1/qt-installer-framework-opensource-2.0.1-src.tar.gz" sha256 "9f3bdb46182cef0254920750315bb22ea83fef4b45ab19a00161175823fabd98" depends_on "qt-ifw-qt5" def install args = %w[installerfw.pro -config release] args << "PREFIX=#{prefix}" system "#{Formula["qt-ifw-qt5"].opt_bin}/qmake", *args system "make" # system "make", "docs" # no install targets, just copy to prefix prefix.install "bin" prefix.install "lib" prefix.install "examples" prefix.install Dir["LICENSE*"], "LGPL_EXCEPTION.txt" # doc.install "doc/html", "doc/ifw.qch" end def caveats; <<~EOS We agreed to the Qt5 opensource license for you. If this is unacceptable you should uninstall. EOS end test do # pass end end ================================================ FILE: Formula/qt5-webkit-qt@5.7.rb ================================================ class NoQt5WebKitAlreadyRequirement < Requirement fatal true satisfy(:build_env => false) { !(Formula["qt@5.7"].lib/"QtWebKit.framework").exist? } def message; <<~EOS Qt5 formula already has QtWebKit installed (e.g. built `--with-webkit``) EOS end end class Qt5WebkitQtAT57 < Formula desc "QtWebit module for Qt 5.7.x" homepage "https://download.qt.io/community_releases/5.7/5.7.1/" url "https://download.qt.io/community_releases/5.7/5.7.1/qtwebkit-opensource-src-5.7.1.tar.xz" sha256 "a46cf7c89339645f94a5777e8ae5baccf75c5fc87ab52c9dafc25da3327b5f03" keg_only "Qt5 is keg-only" depends_on NoQt5WebKitAlreadyRequirement # depends on "pkg-config" => :build depends_on "qt@5.7" # TODO: main qt5 formula does not use these, should we here? # the .pro setup seems to opportunistically check for them, # but depending upon the formulae does not help find them # depends on "fontconfig" # depends on "icu4c" depends_on "webp" # might as well add it since compilation fails if lib found depends_on "libxslt" depends_on "sqlite" # depends_on :macos => :mountain_lion # # error: unknown version depends_on :xcode => :build def install # On Mavericks we want to target libc++, this requires a macx-clang flag. if ENV.compiler == :clang && MacOS.version >= :mavericks spec = "macx-clang" else spec = "macx-g++" end args = %W[-config release -spec #{spec}] args << %Q(INCLUDEPATH+="#{Formula["webp"].opt_include}") mkdir "build" do system Formula["qt@5.7"].bin/"qmake", "../WebKit.pro", *args system "make" ENV.deparallelize # just let it install to qt@5.7 formula prefix system "make", "install" end # now move installed bits back to this formula prefix (lib/"cmake").mkpath (lib/"pkgconfig").mkpath # (prefix/"imports").mkpath # TODO: necessary for .pri? (prefix/"mkspecs/modules").mkpath (prefix/"plugins").mkpath (prefix/"qml").mkpath libexec.mkpath qt5 = Formula["qt@5.7"] mv Dir["#{qt5.opt_lib}/QtWebKit*.framework"], "#{lib}/" mv Dir["#{qt5.opt_lib}/cmake/Qt5WebKit*"], "#{lib}/cmake/" mv Dir["#{qt5.opt_lib}/pkgconfig/Qt5WebKit*.pc"], "#{lib}/pkgconfig/" mv Dir["#{qt5.opt_prefix}/mkspecs/modules/qt_lib_webkit*.pri"], "#{prefix}/mkspecs/modules/" mv qt5.opt_prefix/"plugins/webkit", "#{prefix}/plugins/" mv qt5.opt_prefix/"qml/QtWebKit", "#{prefix}/qml/" mv qt5.opt_libexec/"QtWebProcess", "#{libexec}/" # Some config scripts will only find Qt in a "Frameworks" folder frameworks.install_symlink Dir["#{lib}/*.framework"] # The pkg-config files installed suggest that headers can be found in the # `include` directory. Make this so by creating symlinks from `include` to # the Frameworks' Headers folders. Pathname.glob("#{lib}/*.framework/Headers") do |path| include.install_symlink path => path.parent.basename(".framework") end # update pkgconfig files Dir["#{lib}/pkgconfig/Qt5WebKit*.pc"].each do |pc| inreplace pc do |s| s.sub! /^(prefix=).*$/, "\\1#{prefix}" end end # update .pri files # TODO: unsure if QT_MODULE_IMPORT_BASE is relative to module or its imports Dir["#{prefix}/mkspecs/modules/qt_lib_webkit*.pri"].each do |pri| inreplace pri do |s| s.gsub! "$$QT_MODULE_LIB_BASE", opt_lib.to_s next if pri.end_with? "_private.pri" s.gsub! "$$QT_MODULE_BIN_BASE", opt_bin.to_s s.gsub! "$$QT_MODULE_LIBEXEC_BASE", opt_libexec.to_s s.gsub! "$$QT_MODULE_PLUGIN_BASE", (opt_prefix/"plugins/webkit").to_s # s.gsub! "$$QT_MODULE_IMPORT_BASE", (opt_prefix/"imports").to_s s.gsub! "$$QT_MODULE_QML_BASE", (opt_prefix/"qml").to_s end end # fix up linking to QtWebKit*.frameworks in qt5 prefix path machos = [ lib/"QtWebKitWidgets.framework/Versions/5/QtWebKitWidgets", libexec/"QtWebProcess", prefix/"qml/QtWebKit/libqmlwebkitplugin.dylib", prefix/"qml/QtWebKit/experimental/libqmlwebkitexperimentalplugin.dylib", ] qt5 = Formula["qt@5.7"] qt5_prefix = "#{HOMEBREW_CELLAR}/#{qt5.name}/#{qt5.installed_version}" machos.each do |m| dylibs = m.dynamically_linked_libraries m.ensure_writable do dylibs.each do |d| next unless d.to_s =~ %r{^#{qt5_prefix}/lib/QtWebKit(Widgets)?\.framework} # Deprecated: Using MachO::Tools # system "install_name_tool", "-change", d, d.sub("#{qt5_prefix}/lib", opt_lib), m.to_s MachO::Tools.change_dylib_name(d, d.sub("#{qt5_prefix}/lib", opt_lib), m.to_s) end end end end test do (testpath/"hello.pro").write <<~EOS QT += core webkitwidgets TARGET = hello CONFIG += console CONFIG -= app_bundle TEMPLATE = app HEADERS = client.h SOURCES += client.cpp main.cpp include(#{prefix}/mkspecs/modules/qt_lib_webkit.pri) include(#{prefix}/mkspecs/modules/qt_lib_webkitwidgets.pri) EOS (testpath/"client.h").write <<~EOS #ifndef CLIENT_H #define CLIENT_H #include #include class Client : public QObject { Q_OBJECT public: Client(const QString &url, QObject *parent = 0); private Q_SLOTS: void loadUrl(); void output(bool ok); private: QWebPage page; QString url; }; #endif // CLIENT_H EOS (testpath/"client.cpp").write <<~EOS #include "client.h" #include #include #include #include Client::Client(const QString &myurl, QObject *parent) : QObject(parent) , url(myurl) { } void Client::loadUrl() { page.mainFrame()->load(QUrl(url)); connect(&page, SIGNAL(loadFinished(bool)), this, SLOT(output(bool))); } void Client::output(bool ok) { if (ok){ qDebug() << "Page title: " << page.mainFrame()->title(); QCoreApplication::exit(0); } else { qDebug() << "Error loading " << url; QCoreApplication::exit(1); } } EOS (testpath/"main.cpp").write <<~EOS #include #include #include #include #include "client.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); Client c("http://www.example.com/", app.instance()); qDebug() << "Running application"; QTimer::singleShot(1000, &c, SLOT(loadUrl())); return app.exec(); } EOS cd testpath do system Formula["qt@5.7"].bin/"qmake", "hello.pro" system "make" assert_predicate "client.o", :exists? assert_predicate "moc_client.o", :exists? assert_predicate "main.o", :exists? assert_predicate "hello", :exists? system "./hello" end end end ================================================ FILE: Formula/qtkeychain-qt@5.7.rb ================================================ class QtkeychainQtAT57 < Formula desc "Platform-independent Qt API for storing passwords securely" homepage "https://github.com/frankosterfeld/qtkeychain" url "https://github.com/frankosterfeld/qtkeychain/archive/d077333d7c4bb2846b9de9f3b8631a0b58f70a7e.tar.gz" version "0.7.90" sha256 "fe766d6189ffd89f5c8303833b43b832b13e14481970466ac09821e28d103f08" head "https://github.com/frankosterfeld/qtkeychain.git", :using => :git bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" cellar :any sha256 "ca83e609900bee30417f87265e50775eaa4bf20ca82fc0ad1ff755a6632fd178" => :sierra end keg_only "Qt5 is keg-only" option "with-static", "Build static in addition to shared library" option "with-translations", "Generate Qt translation (.ts) files" depends_on "cmake" => :build depends_on "qt@5.7" def install args = std_cmake_args args << "-DQTKEYCHAIN_STATIC=OFF" args << "-DBUILD_WITH_QT4=OFF" args << "-DBUILD_TRANSLATIONS=#{build.with?("translations") ? "ON" : "OFF"}" mkdir "build" do system "cmake", "..", *args system "make", "install" (libexec/"bin").install "testclient" system "install_name_tool", "-change", "@rpath/libqt5keychain.1.dylib", "#{opt_lib}/libqt5keychain.1.dylib", "#{libexec}/bin/testclient" if build.with? "static" args << "-DQTKEYCHAIN_STATIC=ON" system "cmake", "..", *args system "make" mv "libqtkeychain.a", lib/"libqtkeychain_static.a" end end end def caveats if build.with? "static" <<~EOS Static library is available at: #{opt_lib}/libqtkeychain_static.a EOS end end test do assert_match "Password deleted successfully", shell_output(libexec/"bin/testclient delete something") end end ================================================ FILE: Formula/travis-cache-seed.rb ================================================ class TravisCacheSeed < Formula desc "Trigger update of Travis CI cache with geospatial dependencies" homepage "https://github.com/OSGeo/homebrew-osgeo4mac" url "https://osgeo4mac.s3.amazonaws.com/src/dummy.tar.gz" version "0.0.1" sha256 "e7776e2ff278d6460300bd69a26d7383e6c5e2fbeb17ff12998255e7fc4c9511" keg_only "because it doesn't really install anything" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "bison" depends_on "boost" depends_on "cairo" depends_on "cgal" depends_on "cmake" => :build depends_on "coreutils" depends_on "expat" depends_on "fcgi" depends_on "fftw" depends_on "flex" depends_on "freetype" depends_on "gdal2-python" depends_on "gdal2" depends_on "geos" depends_on "gettext" depends_on "ghostscript" # depends on "git" depends_on "glew" depends_on "glfw" # depends on "gnupg" # depends on "gpg-agent" depends_on "gpsbabel-qt4" depends_on "gsl" # depends on "brewsci/science/insighttoolkit" # depends on "brewsci/science/osgearth" depends_on "jpeg" depends_on "lbzip2" # depends on "libevent" depends_on "osgeo-libgeotiff" depends_on "libgpg-error" depends_on "libharu" depends_on "libkml" depends_on "libpng" depends_on "libssh" depends_on "libsvm" depends_on "libtiff" depends_on "libtool" => :build depends_on "minizip" depends_on "muparser" # depends on "mysql" # depends on "numpy" depends_on "open-scene-graph" depends_on "openssl" depends_on "osgeo-ossim" depends_on "pcre" depends_on "pkg-config" => :build # depends on "postgis" # creates dep on gdal 1.x depends_on "osgeo-postgresql" depends_on "osgeo-proj" depends_on "pyenv" depends_on "pyqt-qt4" depends_on "pyspatialite" depends_on "python" # depends on "python3" depends_on "qca-qt4" depends_on "qhull" depends_on "qjson-qt4" depends_on "qscintilla2-qt4" depends_on "qt-4" depends_on "qwt-qt4" depends_on "qwtpolar-qt4" depends_on "readline" depends_on "sfcgal" depends_on "sip-qt4" depends_on "spatialindex" depends_on "sqlite" depends_on "swig" => :build depends_on "tinyxml" depends_on "unixodbc" # depends on "vtk" # depends on "wxmac" # depends on "wxpython" depends_on "zlib" def install (share/"blank").write "blank" end def caveats; <<~EOS Formula does not install anything per se. Just updates cache at Travis CI with geospatial dependencies to reduce build times of larger formulae. Example `.travis.yml` settings: cache: directories: - /usr/local timeout: 900 before_cache: - brew cleanup EOS end test do # end end ================================================ FILE: LICENSE ================================================ BSD 3-Clause License Copyright (c) 2003, Open Source Geospatial Foundation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================ FILE: README.md ================================================ ![docs/assets/images/osgeo-logo-brew-rgb.png](docs/assets/images/osgeo-logo-brew-rgb.png) # Homebrew-osgeo4mac **Build Status**: [![CircleCI](https://circleci.com/gh/OSGeo/homebrew-osgeo4mac.svg?style=svg)](https://circleci.com/gh/OSGeo/homebrew-osgeo4mac) This 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. ## How do I install these formulae? Just `brew tap osgeo/osgeo4mac` and then `brew install `. Easy, isn't it? You can also install via URL: ```shell $ brew install https://raw.githubusercontent.com/OSGeo/homebrew-osgeo4mac/master/Formula/.rb ``` ## Docs Run `brew help`, `man brew`, check the [Homebrew documentation][documentation] or the [tap documentation][osgeo4mac-docs]. ## Help wanted :sos: If 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. In 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. [homebrew]: http://brew.sh [taps]: https://github.com/Homebrew/homebrew-versions [osgeo]: https://www.osgeo.org [proj]: https://github.com/OSGeo/PROJ [gdal]: https://github.com/OSGeo/gdal [postgis]: https://postgis.net/ [documentation]: https://github.com/Homebrew/brew/tree/master/docs#readme [osgeo4mac-docs]: https://osgeo.github.io/homebrew-osgeo4mac/ [taps-docs]: https://docs.brew.sh/Taps [homebrew-core]: https://github.com/Homebrew/homebrew-core ================================================ FILE: Requirements/gdal_third_party.rb ================================================ class GdalThirdParty < Requirement fatal true satisfy do envar = ENV['GDAL_THIRD_PARTY'] envar && File.exists?(envar) end def message; <<~EOS Define GDAL_THIRD_PARTY environment variable that points to a directory, which contains the unaltered download archive of the third-party library: `export GDAL_THIRD_PARTY=/path/to/gdal/third-party/directory` EOS end end ================================================ FILE: Requirements/grass_requirements.rb ================================================ class UnlinkedGRASS7 < Requirement fatal true def unlinked_grass found = `readlink ${HOMEBREW_PREFIX}/bin/grass7* | egrep -o '/grass[^/]*/' | tr -d '/' | tr -d '\n'` return found.empty?, found end satisfy(:build_env => false) { unlinked_grass[0] } def message grass_f = unlinked_grass[1] <<~EOS Another GRASS 7.x formula is linked: #{grass_f} Do `brew unlink #{grass_f}` then try installing this formula again. You can leave #{grass_f} unlinked and installed as keg-only; however, launching it as keg-only may cause issues or crashes, since it will be now be referencing Python modules of any newly linked GRASS. Keep all GRASS formulae unlinked if you wish to run multiple installs. EOS end end class UnlinkedGRASS6 < Requirement fatal true def unlinked_grass found = `readlink ${HOMEBREW_PREFIX}/bin/grass6* | egrep -o '/grass[^/]*/' | tr -d '/' | tr -d '\n'` return found.empty?, found end satisfy(:build_env => false) { unlinked_grass[0] } def message grass_f = unlinked_grass[1] <<~EOS Another GRASS 6.x formula is linked: #{grass_f} Do `brew unlink #{grass_f}` then try installing this formula again. You can leave #{grass_f} unlinked and installed as keg-only; however, launching it as keg-only may cause issues or crashes, since it will be now be referencing Python modules of any newly linked GRASS. Keep all GRASS formulae unlinked if you wish to run multiple installs. EOS end end ================================================ FILE: Requirements/qgis_requirements.rb ================================================ class UnlinkedQGIS2 < Requirement fatal true def unlinked_qgis found = `readlink ${HOMEBREW_PREFIX}/bin/qgis | egrep -o '/qgis[^/]*/' | tr -d '/' | tr -d '\n'` return found.empty?, found end satisfy(:build_env => false) { unlinked_qgis[0] } def message qgis_f = unlinked_qgis[1] <<~EOS Another QGIS formula is linked: #{qgis_f} Do `brew unlink #{qgis_f}` then try installing this formula again. You can leave #{qgis_f} unlinked and installed as keg-only; however, launching it as keg-only may cause issues or crashes, since it will be now be referencing Python modules of any newly linked QGIS. Issue can be overcome by setting PYTHONPATH, e.g. in the app's Options. Or, keep all QGIS formulae unlinked if you wish to run multiple installs. EOS end end class SipBinary < Requirement fatal true #noinspection RubyResolve # default_formula 'sip' satisfy(:build_env => false) { which 'sip' } def message <<~EOS The `sip` binary is missing. It is needed to generate the Python bindings for QGIS. Ensure `sip` formula is installed and linked. EOS end end class PyQtConfig < Requirement fatal true #noinspection RubyResolve # default_formula 'pyqt' # pyqtconfig is not created with PyQt4 >= 4.10.x when using configure-ng. # Homebrew's `pyqt` formula corrects this. Remains an issue until QGIS project # adjusts FindPyQt.py in CMake setup to work with configure-ng. satisfy(:build_env => false) { quiet_system 'python', '-c', 'from PyQt4 import pyqtconfig' } def message <<~EOS Python could not import the PyQt4.pyqtconfig module. This will cause the QGIS build to fail. The most common reason for this failure is that the PYTHONPATH needs to be adjusted. The `pyqt` caveats explain this adjustment and may be reviewed using: brew info pyqt Ensure `pyqt` formula is installed and linked, and that it includes the `pyqtconfig` module. EOS end end ================================================ FILE: Strategies/cache-download.rb ================================================ class CacheDownloadStrategy < CurlDownloadStrategy def fetch archive = @url.sub(%r[^file://], "") unless File.exists?(archive) odie <<~EOS Formula expects to locate the following archive: #{Pathname.new(archive).basename} in the HOMEBREW_CACHE directory: #{HOMEBREW_CACHE} Copy archive to cache or create a symlink in cache to archive: ln -sf /path/to/archive $(brew --cache)/ EOS end super end end ================================================ FILE: boneyard/brew-stack.rb ================================================ # Install a formula and dependencies from pre-made bottles or as built bottles. # # Useful for creating a portable Homebrew directory for a specific OS version. # Example: portable domain-specific software stack in custom Homebrew prefix # # Hint: Use command in `brew bundle` Brewfiles to quickly build full stacks. # Also, --dry option helps create correctly ordered Brewfiles when you # want to use custom options for dependencies and build those first. require "formula" require "cmd/deps" require "utils" require "hooks/bottles" def usage; <<-EOS Usage: brew stack [--dry] [install-options...] formula [formula-options...] Same options as for `brew install`, but only for a single formula. Note: --interactive install option is not supported Options: --dry Don't install anything, just output topologically ordered list of install commands. --all List all dependencies, including installed, on --dry run. EOS end class Stack attr_reader :f, :opts, :argv, :dry, :all, :verbose # Variable to track what's been installed, to avoid endless loops with --dry. @@dry_installed = [] @@first_run = true def initialize formula, options=[], argv=nil, dry=false, all=false, verbose=false @f = formula @opts = options @argv = argv @dry = dry @all = all @verbose = verbose end def tap_name(f_obj) (f_obj.tap? ? f_obj.tap.sub("homebrew-", "") + "/" : "") + f_obj.name end def to_tap_names(f_name_list) f_name_list.map { |f| tap_name(Formulary.factory(f)) } end def oohai title, *sput # don't truncate, like ohai puts "#{Tty.blue}==>#{Tty.white} #{title}#{Tty.reset}" puts sput unless sput.empty? end def ooh1 title # don't truncate, like oh1 puts "#{Tty.green}==>#{Tty.white} #{title}#{Tty.reset}" end def owell title puts "#{Tty.gray}==>#{Tty.white} #{title}#{Tty.reset}" end def install # Install dependencies in topological order. # This is necessary to ensure --build-bottle is used for any source builds. f_build_opts = @f.build.used_options.as_flags unless @argv && @argv.ignore_deps? deps = Homebrew.deps_for_formula(@f, true) # recurse deps = deps.reject { |d| d.installed? } unless @dry && @all deps = deps.reject { |d| @@dry_installed.include?(tap_name(d.to_formula)) } if @dry if @dry if @verbose oohai "Installed formulae: #{to_tap_names(%x[brew list].split("\n")).join(" ")}\n" if @@first_run unless f_build_opts.empty? oohai "Options used, #{@f.name}: #{f_build_opts.join(" ")}" oohai "Options unused, #{@f.name}: #{(@f.build.as_flags - f_build_opts).join(" ")}" end end unless deps.empty? deps_w_opts = deps.map do |d| d.to_s + (d.options.empty? ? "" : " ") + d.options.as_flags.join(" ") end oohai "Deps needed, #{@f.name}: #{deps_w_opts.join(", ")}" end puts if @@first_run end @@first_run = false deps.each do |d| d_obj = d.to_formula d_args = [] d_args.concat @opts - f_build_opts + d.options.as_flags # strip these options d_args -= %W[--ignore-dependencies --only-dependencies] d_args -= %W[--build-from-source --force-bottle --build-bottle] d_args -= %W[--devel --HEAD] # recurse down into dependencies, nixing argv Stack.new(d_obj, options=d_args, argv=nil, dry=@dry, all=@all, verbose=@verbose).install end unless deps.empty? end # Install formula unless @argv && @argv.only_deps? f_tap_name = tap_name(@f) if (@f.installed? && !(@dry && @all)) || (@dry && @@dry_installed.include?(f_tap_name)) owell "#{f_tap_name} already installed" else f_args = [] f_args.concat @opts if (@argv && @argv.build_from_source?) || !pour_bottle?(@f) f_args |= %W[--build-bottle] end attempt_install @f, f_args end end end def attempt_install f_obj, args f_tap_name = tap_name(f_obj) args -= %W[--dry --all --build-from-source] args << f_tap_name ooh1 "brew install #{args.join(" ")}" if @dry @@dry_installed += [f_tap_name] return end return if system "brew", "install", *args if args.include?("--build-bottle") odie "Source bottle build failed" else opoo "Bottle may have failed to install" ohai "Attempting to build bottle from source" args |= %W[--build-bottle] return if system "brew", "install", *args odie "Source bottle build failed" end end def pour_bottle? f # Culled from FormulaInstaller::pour_bottle? return true if Homebrew::Hooks::Bottles.formula_has_bottle?(f) return true if @argv && @argv.force_bottle? && f.bottle return false if @argv && (@argv.build_from_source? || @argv.build_bottle?) return false unless f.build.used_options.empty? return true if f.local_bottle_path return false unless f.bottle && f.pour_bottle? f.requirements.each do |req| next if req.optional? || req.pour_bottle? opoo "Bottle for #{f} blocked by #{req} requirement" return false end unless f.bottle.compatible_cellar? opoo "Cellar of #{f}'s bottle is #{f.bottle.cellar}" return false end true end end # Necessary to raise error if bottle fails to install ENV["HOMEBREW_DEVELOPER"] = "1" if ARGV.formulae.length != 1 || ARGV.interactive? puts usage exit 1 end if ARGV.include? "--help" puts usage exit 0 end Stack.new( ARGV.formulae[0], options=ARGV.options_only, argv=ARGV, dry=ARGV.include?("--dry"), all=ARGV.include?("--all"), verbose=(ARGV.verbose? || ARGV.switch?("v")) ).install puts "\n ---------- DRY RUN ----------" if ARGV.include?("--dry") exit 0 ================================================ FILE: boneyard/enki.rb ================================================ require "formula" class Enki < Formula homepage "http://enki-editor.org/" url "https://github.com/hlamer/enki/archive/v13.11.1.tar.gz" sha1 "2bcf6bb14550b07c5a227a5525834aa28849fb59" depends_on :python depends_on "pyqt" depends_on "qutepart" depends_on "ctags" => :recommended depends_on "pyparsing" => [:python] depends_on "markdown" => [:python] depends_on "docutils" => [:python] def install ENV.deparallelize system "python", "setup.py", "install", "--prefix=#{prefix}" end test do assert_equal %x(enki --version).strip, "enki #{version}" end end ================================================ FILE: boneyard/gdal-110.rb ================================================ require 'formula' class Gdal110 < Formula homepage 'http://www.gdal.org/' url 'http://download.osgeo.org/gdal/1.10.1/gdal-1.10.1.tar.gz' sha256 '9984f0314c0bd831eb59fb646c2bc5e13cf1378be4f51499045166cbe62be6ea' option 'complete', 'Use additional Homebrew libraries to provide more drivers.' option 'enable-opencl', 'Build with OpenCL acceleration.' option 'enable-armadillo', 'Build with Armadillo accelerated TPS transforms.' option 'enable-unsupported', "Allow configure to drag in any library it can find. Invoke this at your own risk." option 'enable-mdb', 'Build with Access MDB driver (requires Java 1.6+ JDK/JRE, from Apple or Oracle).' keg_only "Older version; gdal is in main tap and installs same components" depends_on :python => :recommended if build.with? "python" depends_on "fortran" => :build end depends_on 'libpng' depends_on 'jpeg' depends_on 'giflib' depends_on 'libtiff' depends_on 'libgeotiff' depends_on 'proj' depends_on 'geos' depends_on 'sqlite' # To ensure compatibility with SpatiaLite. depends_on 'freexl' depends_on 'libspatialite' depends_on "postgresql" => :optional depends_on "mysql" => :optional depends_on 'homebrew/science/armadillo' if build.include? 'enable-armadillo' depends_on "homebrew/versions/openjpeg20" if build.include? 'enable-unsupported' if build.include? 'complete' # Raster libraries depends_on "homebrew/science/netcdf" # Also brings in HDF5 depends_on "jasper" depends_on "webp" depends_on "cfitsio" depends_on "epsilon" depends_on "libdap" # Vector libraries depends_on "unixodbc" # OS X version is not complete enough depends_on "xerces-c" # Other libraries depends_on "xz" # get liblzma compression algorithm library from XZutils depends_on "poppler" end # Prevent build failure on 10.6 / 10.7: http://trac.osgeo.org/gdal/ticket/5197 # Fix build against MySQL 5.6.x: http://trac.osgeo.org/gdal/ticket/5284 patch :DATA stable do # Patch of configure that finds Mac Java for MDB driver (uses Oracle or Mac default JDK) # TODO: Remove when future GDAL release includes a fix # http://trac.osgeo.org/gdal/ticket/5267 (patch applied to trunk, 2.0 release milestone) # Must come before DATA patch do url "https://gist.githubusercontent.com/dakcarto/6877854/raw/82ae81e558c0b6048336f0acb5d7577bd0a237d5/gdal-mdb-patch.diff" sha256 "63bf3d3d984dd851856a5d61c85828978f0f0b0ed3bbff9dce01a4c38309bfb7" end if build.include? "enable-mdb" end resource 'numpy' do url 'http://downloads.sourceforge.net/project/numpy/NumPy/1.8.1/numpy-1.8.1.tar.gz' sha256 'd4f85af64afe57a76e2b3a79cfcac740fb8ce8a3cd6402662f3c760abfa515e4' end def get_configure_args args = [ # Base configuration. "--prefix=#{prefix}", "--mandir=#{man}", "--disable-debug", "--with-local=#{prefix}", "--with-threads", "--with-libtool", # GDAL native backends. "--with-pcraster=internal", "--with-pcidsk=internal", "--with-bsb", "--with-grib", "--with-pam", # Backends supported by OS X. "--with-libiconv-prefix=/usr", "--with-libz=/usr", "--with-png=#{Formula["libpng"].opt_prefix}", "--with-expat=/usr", "--with-curl=/usr/bin/curl-config", # Default Homebrew backends. "--with-jpeg=#{HOMEBREW_PREFIX}", "--without-jpeg12", # Needs specially configured JPEG and TIFF libraries. "--with-gif=#{HOMEBREW_PREFIX}", "--with-libtiff=#{HOMEBREW_PREFIX}", "--with-geotiff=#{HOMEBREW_PREFIX}", "--with-sqlite3=#{Formula["sqlite"].opt_prefix}", "--with-freexl=#{HOMEBREW_PREFIX}", "--with-spatialite=#{HOMEBREW_PREFIX}", "--with-geos=#{HOMEBREW_PREFIX}/bin/geos-config", "--with-static-proj4=#{HOMEBREW_PREFIX}", # GRASS backend explicitly disabled. Creates a chicken-and-egg problem. # Should be installed separately after GRASS installation using the # official GDAL GRASS plugin. "--without-grass", "--without-libgrass" ] # Optional Homebrew packages supporting additional formats. supported_backends = %w[ liblzma cfitsio hdf5 netcdf jasper xerces odbc dods-root epsilon webp poppler ] if build.include? 'complete' supported_backends.delete 'liblzma' args << '--with-liblzma=yes' args.concat supported_backends.map {|b| '--with-' + b + '=' + HOMEBREW_PREFIX} else args.concat supported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported' end # The following libraries are either proprietary, not available for public # download or have no stable version in the Homebrew core that is # compatible with GDAL. Interested users will have to install such software # manually and most likely have to tweak the install routine. # # Podofo is disabled because Poppler provides the same functionality and # then some. unsupported_backends = %w[ gta ogdi fme hdf4 openjpeg fgdb ecw kakadu mrsid jp2mrsid mrsid_lidar msg oci ingres libkml dwgdirect idb sde podofo rasdaman ] args.concat unsupported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported' # Database support. args << (build.with?("postgresql") ? "--with-pg=#{HOMEBREW_PREFIX}/bin/pg_config" : "--without-pg") args << (build.with?("mysql") ? "--with-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config" : "--without-mysql") if build.include? 'enable-mdb' args << "--with-java=yes" # The rpath is only embedded for Oracle (non-framework) installs args << "--with-jvm-lib-add-rpath=yes" args << "--with-mdb=yes" end # There is a problem with compiling and avx, so disable avx for HEAD builds args << "--without-avx" if build.head? # Python is installed manually to ensure everything is properly sandboxed. args << '--without-python' # Scripting APIs that have not been re-worked to respect Homebrew prefixes. # # Currently disabled as they install willy-nilly into locations outside of # the Homebrew prefix. Enable if you feel like it, but uninstallation may be # a manual affair. # # TODO: Fix installation of script bindings so they install into the # Homebrew prefix. args << "--without-perl" args << "--without-php" args << "--without-ruby" args << (build.include?("enable-opencl") ? "--with-opencl" : "--without-opencl") args << (build.include?("enable-armadillo") ? "--with-armadillo=yes" : "--with-armadillo=no") return args end def install if build.with? 'python' ENV.prepend_create_path 'PYTHONPATH', libexec+'lib/python2.7/site-packages' numpy_args = [ "build", "--fcompiler=gnu95", "install", "--prefix=#{libexec}" ] resource('numpy').stage { system "python", "setup.py", *numpy_args } end # Linking flags for SQLite are not added at a critical moment when the GDAL # library is being assembled. This causes the build to fail due to missing # symbols. Also, ensure Homebrew SQLite is used so that Spatialite is # functional. # # Fortunately, this can be remedied using LDFLAGS. sqlite = Formula["sqlite"] ENV.append 'LDFLAGS', "-L#{sqlite.opt_lib} -lsqlite3" ENV.append 'CFLAGS', "-I#{sqlite.opt_include}" # Needed by libdap ENV.libxml2 if build.include? 'complete' # Reset ARCHFLAGS to match how we build. ENV['ARCHFLAGS'] = "-arch #{MacOS.preferred_arch}" # Fix hardcoded mandir: http://trac.osgeo.org/gdal/ticket/5092 inreplace 'configure', %r[^mandir='\$\{prefix\}/man'$], '' system "./configure", *get_configure_args system "make" system "make install" # `python-config` may try to talk us into building bindings for more # architectures than we really should. if MacOS.prefer_64_bit? ENV.append_to_cflags "-arch #{Hardware::CPU.arch_64_bit}" else ENV.append_to_cflags "-arch #{Hardware::CPU.arch_32_bit}" end cd 'swig/python' do system "python", "setup.py", "install", "--prefix=#{prefix}", "--record=installed.txt", "--single-version-externally-managed" bin.install Dir['scripts/*'] end system 'make', 'man' if build.head? system 'make', 'install-man' # Clean up any stray doxygen files. Dir[bin + '*.dox'].each { |p| rm p } end def caveats if build.include? 'enable-mdb' <<~EOS To have a functional MDB driver, install supporting .jar files in: `/Library/Java/Extensions/` See: `http://www.gdal.org/ogr/drv_mdb.html` EOS end end end __END__ diff --git a/GDALmake.opt.in b/GDALmake.opt.in index d7273aa..2fcbd53 100644 --- a/GDALmake.opt.in +++ b/GDALmake.opt.in @@ -123,6 +123,7 @@ INGRES_INC = @INGRES_INC@ HAVE_MYSQL = @HAVE_MYSQL@ MYSQL_LIB = @MYSQL_LIB@ MYSQL_INC = @MYSQL_INC@ +MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION = @MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION@ LIBS += $(MYSQL_LIB) # diff --git a/configure b/configure index 1c4f8fb..120b17f 100755 --- a/configure +++ b/configure @@ -700,6 +700,7 @@ INGRES_INC INGRES_LIB II_SYSTEM HAVE_INGRES +MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION MYSQL_LIB MYSQL_INC HAVE_MYSQL @@ -23045,6 +23046,34 @@ $as_echo "no, mysql is pre-4.x" >&6; } MYSQL_INC="`$MYSQL_CONFIG --include`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } + + # Check if mysql headers declare load_defaults + { $as_echo "$as_me:${as_lineno-$LINENO}: checking load_defaults() in MySQL" >&5 +$as_echo_n "checking load_defaults() in MySQL... " >&6; } + rm -f testmysql.* + echo '#include "my_global.h"' > testmysql.cpp + echo '#include "my_sys.h"' >> testmysql.cpp + echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp + if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in my_sys.h" >&5 +$as_echo "yes, found in my_sys.h" >&6; } + else + echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp + echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp + if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in library but not in header" >&5 +$as_echo "yes, found in library but not in header" >&6; } + MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes + else + HAVE_MYSQL=no + MYSQL_LIB= + MYSQL_INC= + as_fn_error $? "Cannot find load_defaults()" "$LINENO" 5 + fi + fi + rm -f testmysql.* + rm -f testmysql + ;; esac fi @@ -23055,6 +23084,8 @@ MYSQL_INC=$MYSQL_INC MYSQL_LIB=$MYSQL_LIB +MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=$MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION + diff --git a/configure.in b/configure.in index 481e8ea..d83797f 100644 --- a/configure.in +++ b/configure.in @@ -2294,6 +2294,31 @@ else MYSQL_LIB="`$MYSQL_CONFIG --libs`" MYSQL_INC="`$MYSQL_CONFIG --include`" AC_MSG_RESULT([yes]) + + # Check if mysql headers declare load_defaults + AC_MSG_CHECKING([load_defaults() in MySQL]) + rm -f testmysql.* + echo '#include "my_global.h"' > testmysql.cpp + echo '#include "my_sys.h"' >> testmysql.cpp + echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp + if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then + AC_MSG_RESULT([yes, found in my_sys.h]) + else + echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp + echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp + if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then + AC_MSG_RESULT([yes, found in library but not in header]) + MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes + else + HAVE_MYSQL=no + MYSQL_LIB= + MYSQL_INC= + AC_MSG_ERROR([Cannot find load_defaults()]) + fi + fi + rm -f testmysql.* + rm -f testmysql + ;; esac fi @@ -2301,6 +2326,7 @@ fi AC_SUBST(HAVE_MYSQL,$HAVE_MYSQL) AC_SUBST(MYSQL_INC,$MYSQL_INC) AC_SUBST(MYSQL_LIB,$MYSQL_LIB) +AC_SUBST(MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION,$MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION) dnl --------------------------------------------------------------------------- dnl INGRES support. diff --git a/ogr/ogrsf_frmts/mysql/GNUmakefile b/ogr/ogrsf_frmts/mysql/GNUmakefile index 292ae45..e78398d 100644 --- a/ogr/ogrsf_frmts/mysql/GNUmakefile +++ b/ogr/ogrsf_frmts/mysql/GNUmakefile @@ -7,6 +7,11 @@ OBJ = ogrmysqldriver.o ogrmysqldatasource.o \ CPPFLAGS := -I.. -I../.. $(GDAL_INCLUDE) $(MYSQL_INC) $(CPPFLAGS) +ifeq ($(MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION),yes) +CPPFLAGS += -DMYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION +endif + + default: $(O_OBJ:.o=.$(OBJ_EXT)) clean: diff --git a/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp b/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp index 65c275b..447e374 100644 --- a/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp +++ b/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp @@ -36,6 +36,16 @@ #include "cpl_conv.h" #include "cpl_string.h" +/* Recent versions of mysql no longer declare load_defaults() in my_sys.h */ +/* but they still have it in the lib. Very fragile... */ +#ifdef MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION +extern "C" { +int load_defaults(const char *conf_file, const char **groups, + int *argc, char ***argv); +void free_defaults(char **argv); +} +#endif + CPL_CVSID("$Id: ogrmysqldatasource.cpp 24947 2012-09-22 09:54:23Z rouault $"); /************************************************************************/ /* OGRMySQLDataSource() */ diff --git a/port/cpl_spawn.cpp b/port/cpl_spawn.cpp index d702594..69ea3c2 100644 --- a/port/cpl_spawn.cpp +++ b/port/cpl_spawn.cpp @@ -464,7 +464,7 @@ void CPLSpawnAsyncCloseErrorFileHandle(CPLSpawnedProcess* p) #ifdef __APPLE__ #include #endif - #if defined(__APPLE__) && !defined(TARGET_OS_IPHONE) + #if defined(__APPLE__) && (!defined(TARGET_OS_IPHONE) || TARGET_OS_IPHONE==0) #include #define environ (*_NSGetEnviron()) #else ================================================ FILE: boneyard/gdal-19.rb ================================================ require 'formula' class Gdal19 < Formula homepage 'http://www.gdal.org/' url 'http://download.osgeo.org/gdal/gdal-1.9.2.tar.gz' sha256 '9f3b9ae968eaa8d06ee5448e5b65e7bfa940e2e345282a29d95275421f36c688' conflicts_with 'gdal' option 'complete', 'Use additional Homebrew libraries to provide more drivers.' option 'with-postgres', 'Specify PostgreSQL as a dependency.' option 'with-mysql', 'Specify MySQL as a dependency.' option 'without-python', 'Build without Python support (disables a lot of tools).' option 'enable-opencl', 'Build with OpenCL acceleration.' option 'enable-armadillo', 'Build with Armadillo accelerated TPS transforms.' option 'enable-unsupported', "Allow configure to drag in any library it can find. Invoke this at your own risk." # For creating up to date man pages. depends_on 'doxygen' => :build if build.head? depends_on 'libpng' depends_on 'jpeg' depends_on 'giflib' depends_on 'libtiff' depends_on 'libgeotiff' depends_on 'proj' depends_on 'geos' depends_on 'sqlite' # To ensure compatibility with SpatiaLite. depends_on 'freexl' depends_on 'libspatialite' depends_on "postgresql" if build.include? 'with-postgres' depends_on "mysql" if build.include? 'with-mysql' # Without Numpy, the Python bindings can't deal with raster data. depends_on 'numpy' => :python unless build.include? 'without-python' depends_on 'homebrew/science/armadillo' if build.include? 'enable-armadillo' if build.include? 'complete' # Raster libraries depends_on "netcdf" # Also brings in HDF5 depends_on "jasper" depends_on "webp" depends_on "cfitsio" depends_on "epsilon" depends_on "libdap" # Fix a bug in LibDAP detection: http://trac.osgeo.org/gdal/ticket/4630 patch :DATA unless build.head? # Vector libraries depends_on "unixodbc" # OS X version is not complete enough depends_on "xerces-c" # Other libraries depends_on "xz" # get liblzma compression algorithm library from XZutils depends_on "poppler" end def get_configure_args args = [ # Base configuration. "--prefix=#{prefix}", "--mandir=#{man}", "--disable-debug", "--with-local=#{prefix}", "--with-threads", "--with-libtool", # GDAL native backends. "--with-pcraster=internal", "--with-pcidsk=internal", "--with-bsb", "--with-grib", "--with-pam", # Backends supported by OS X. "--with-libiconv-prefix=/usr", "--with-libz=/usr", "--with-png=#{(MacOS.version >= :mountain_lion) ? HOMEBREW_PREFIX : MacOS::X11.prefix}", "--with-expat=/usr", "--with-curl=/usr/bin/curl-config", # Default Homebrew backends. "--with-jpeg=#{HOMEBREW_PREFIX}", "--without-jpeg12", # Needs specially configured JPEG and TIFF libraries. "--with-gif=#{HOMEBREW_PREFIX}", "--with-libtiff=#{HOMEBREW_PREFIX}", "--with-geotiff=#{HOMEBREW_PREFIX}", "--with-sqlite3=#{Formula['sqlite'].opt_prefix}", "--with-freexl=#{HOMEBREW_PREFIX}", "--with-spatialite=#{HOMEBREW_PREFIX}", "--with-geos=#{HOMEBREW_PREFIX}/bin/geos-config", "--with-static-proj4=#{HOMEBREW_PREFIX}", # GRASS backend explicitly disabled. Creates a chicken-and-egg problem. # Should be installed separately after GRASS installation using the # official GDAL GRASS plugin. "--without-grass", "--without-libgrass" ] # Optional Homebrew packages supporting additional formats. supported_backends = %w[ liblzma cfitsio hdf5 netcdf jasper xerces odbc dods-root epsilon webp poppler ] if build.include? 'complete' supported_backends.delete 'liblzma' args << '--with-liblzma=yes' args.concat supported_backends.map {|b| '--with-' + b + '=' + HOMEBREW_PREFIX} else args.concat supported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported' end # The following libraries are either proprietary, not available for public # download or have no stable version in the Homebrew core that is # compatible with GDAL. Interested users will have to install such software # manually and most likely have to tweak the install routine. # # Podofo is disabled because Poppler provides the same functionality and # then some. unsupported_backends = %w[ gta ogdi fme hdf4 openjpeg fgdb ecw kakadu mrsid jp2mrsid mrsid_lidar msg oci ingres libkml dwgdirect idb sde podofo rasdaman ] args.concat unsupported_backends.map {|b| '--without-' + b} unless build.include? 'enable-unsupported' # Database support. args << (build.include?("with-postgres") ? "--with-pg=#{HOMEBREW_PREFIX}/bin/pg_config" : "--without-pg") args << (build.include?("with-mysql") ? "--with-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config" : "--without-mysql") # Python is installed manually to ensure everything is properly sandboxed. args << '--without-python' # Scripting APIs that have not been re-worked to respect Homebrew prefixes. # # Currently disabled as they install willy-nilly into locations outside of # the Homebrew prefix. Enable if you feel like it, but uninstallation may be # a manual affair. # # TODO: Fix installation of script bindings so they install into the # Homebrew prefix. args << "--without-perl" args << "--without-php" args << "--without-ruby" args << (build.include?("enable-opencl") ? "--with-opencl" : "--without-opencl") args << (build.include?("enable-armadillo") ? "--with-armadillo=yes" : "--with-armadillo=no") return args end def install # Linking flags for SQLite are not added at a critical moment when the GDAL # library is being assembled. This causes the build to fail due to missing # symbols. Also, ensure Homebrew SQLite is used so that Spatialite is # functional. # # Fortunately, this can be remedied using LDFLAGS. sqlite = Formula.factory 'sqlite' ENV.append 'LDFLAGS', "-L#{sqlite.opt_prefix}/lib -lsqlite3" # Needed by libdap. ENV.append 'CPPFLAGS', '-I/usr/include/libxml2' if build.include? 'complete' # Reset ARCHFLAGS to match how we build. if MacOS.prefer_64_bit? ENV['ARCHFLAGS'] = "-arch x86_64" else ENV['ARCHFLAGS'] = "-arch i386" end system "./configure", *get_configure_args system "make" system "make install" unless build.include? 'without-python' # If setuptools happens to be installed, setup.py will cowardly refuse to # install to anywhere that is not on the PYTHONPATH. # # Really setuptools, we're all consenting adults here... python_lib = lib + which_python + 'site-packages' ENV.append 'PYTHONPATH', python_lib # setuptools is also apparently incapable of making the directory it's # self python_lib.mkpath # `python-config` may try to talk us into building bindings for more # architectures than we really should. if MacOS.prefer_64_bit? ENV.append_to_cflags '-arch x86_64' else ENV.append_to_cflags '-arch i386' end cd 'swig/python' do system "python", "setup.py", "install_lib", "--install-dir=#{python_lib}" bin.install Dir['scripts/*'] end end system 'make', 'man' if build.head? system 'make', 'install-man' # Clean up any stray doxygen files. Dir[bin + '*.dox'].each { |p| rm p } end def which_python "python" + `python -c 'import sys;print(sys.version[:3])'`.strip end unless build.include? 'without-python' def caveats <<-EOS This version of GDAL was built with Python support. In addition to providing modules that makes GDAL functions available to Python scripts, the Python binding provides ~18 additional command line tools. Unless you are using Homebrew's Python, both the bindings and the additional tools will be unusable unless the following directory is added to the PYTHONPATH: #{HOMEBREW_PREFIX}/lib/#{which_python}/site-packages EOS end end end __END__ Fix test for LibDAP >= 3.10. diff --git a/configure b/configure index 997bbbf..a1928d5 100755 --- a/configure +++ b/configure @@ -24197,7 +24197,7 @@ else rm -f islibdappost310.* echo '#include "Connect.h"' > islibdappost310.cpp echo 'int main(int argc, char** argv) { return 0; } ' >> islibdappost310.cpp -if test -z "`${CXX} islibdappost310.cpp -c ${DODS_INC} 2>&1`" ; then +if test -z "`${CXX} islibdappost310.cpp -c ${DODS_INC} ${CPPFLAGS} 2>&1`" ; then DODS_INC="$DODS_INC -DLIBDAP_310 -DLIBDAP_39" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libdap >= 3.10" >&5 $as_echo "libdap >= 3.10" >&6; } ================================================ FILE: boneyard/gdal-20.rb ================================================ class Gdal20 < Formula desc "GDAL: Geospatial Data Abstraction Library" homepage "http://www.gdal.org/" url "http://download.osgeo.org/gdal/2.1.0/gdal-2.1.0.tar.gz" sha256 "eb499b18e5c5262a803bb7530ae56e95c3293be7b26c74bcadf67489203bf2cd" bottle do root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" sha256 "efc51d54d02e302fb1339b3e2520fe15e3aba7418d5accd970d1e9faee298361" => :mavericks end head do url "https://svn.osgeo.org/gdal/trunk/gdal" depends_on "doxygen" => :build end keg_only "Older version of gdal is in main tap and installs similar components" option "with-complete", "Use additional Homebrew libraries to provide more drivers." option "with-qhull", "Build with internal qhull libary support" option "with-opencl", "Build with OpenCL acceleration." option "with-armadillo", "Build with Armadillo accelerated TPS transforms." option "with-unsupported", "Allow configure to drag in any library it can find. Invoke this at your own risk." option "with-mdb", "Build with Access MDB driver (requires Java 1.6+ JDK/JRE, from Apple or Oracle)." option "with-libkml", "Build with Google's libkml driver (requires libkml --HEAD or >= 1.3)" option "without-python", "Build without python2 support" option "with-swig-java", "Build the swig java bindings" deprecated_option "enable-opencl" => "with-opencl" deprecated_option "enable-armadillo" => "with-armadillo" deprecated_option "enable-unsupported" => "with-unsupported" deprecated_option "enable-mdb" => "with-mdb" deprecated_option "complete" => "with-complete" depends_on "libpng" depends_on "jpeg" depends_on "giflib" depends_on "libtiff" depends_on "libgeotiff" depends_on "proj" depends_on "geos" depends_on "sqlite" # To ensure compatibility with SpatiaLite. depends_on "freexl" depends_on "libspatialite" depends_on "postgresql" => :optional depends_on "mysql" => :optional depends_on "homebrew/science/armadillo" if build.with? "armadillo" if build.with? "libkml" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end if build.with? "complete" # Raster libraries depends_on "homebrew/science/netcdf" # Also brings in HDF5 depends_on "jasper" depends_on "webp" depends_on "homebrew/science/cfitsio" depends_on "epsilon" depends_on "libdap" depends_on "libxml2" depends_on "openjpeg" # Vector libraries depends_on "unixodbc" # OS X version is not complete enough depends_on "xerces-c" # Other libraries depends_on "xz" # get liblzma compression algorithm library from XZutils depends_on "poppler" depends_on "podofo" depends_on "json-c" end depends_on "java" => ["1.7+", :optional, :build] if build.with? "swig-java" depends_on "ant" => :build depends_on "swig" => :build end depends_on :python => :optional if MacOS.version <= :snow_leopard depends_on :python3 => :optional depends_on "numpy" => :python if build.with? "python" depends_on "numpy" => :python3 if build.with? "python3" resource "libkml" do # Until 1.3 is stable, use master branch url "https://github.com/google/libkml.git", :revision => "9b50572641f671194e523ad21d0171ea6537426e" version "1.3-dev" end def configure_args args = [ # Base configuration. "--prefix=#{prefix}", "--mandir=#{man}", "--disable-debug", "--with-local=#{prefix}", "--with-threads", "--with-libtool", # GDAL native backends. "--with-pcraster=internal", "--with-pcidsk=internal", "--with-bsb", "--with-grib", "--with-pam", # Backends supported by OS X. "--with-libiconv-prefix=/usr", "--with-libz=/usr", "--with-png=#{Formula["libpng"].opt_prefix}", "--with-expat=/usr", "--with-curl=/usr/bin/curl-config", # Default Homebrew backends. "--with-jpeg=#{HOMEBREW_PREFIX}", "--without-jpeg12", # Needs specially configured JPEG and TIFF libraries. "--with-gif=#{HOMEBREW_PREFIX}", "--with-libtiff=#{HOMEBREW_PREFIX}", "--with-geotiff=#{HOMEBREW_PREFIX}", "--with-sqlite3=#{Formula["sqlite"].opt_prefix}", "--with-freexl=#{HOMEBREW_PREFIX}", "--with-spatialite=#{HOMEBREW_PREFIX}", "--with-geos=#{HOMEBREW_PREFIX}/bin/geos-config", "--with-static-proj4=#{HOMEBREW_PREFIX}", "--with-libjson-c=#{Formula["json-c"].opt_prefix}", # GRASS backend explicitly disabled. Creates a chicken-and-egg problem. # Should be installed separately after GRASS installation using the # official GDAL GRASS plugin. "--without-grass", "--without-libgrass", ] # Optional Homebrew packages supporting additional formats. supported_backends = %w[ liblzma cfitsio hdf5 netcdf jasper xerces odbc dods-root epsilon webp openjpeg podofo pdfium ] if build.with? "complete" supported_backends.delete "liblzma" args << "--with-liblzma=yes" supported_backends.delete "pdfium" args << "--with-pdfium=yes" args.concat supported_backends.map { |b| "--with-" + b + "=" + HOMEBREW_PREFIX } elsif build.without? "unsupported" args.concat supported_backends.map { |b| "--without-" + b } end # The following libraries are either proprietary, not available for public # download or have no stable version in the Homebrew core that is # compatible with GDAL. Interested users will have to install such software # manually and most likely have to tweak the install routine. # # Podofo is disabled because Poppler provides the same functionality and # then some. unsupported_backends = %w[ gta ogdi fme hdf4 fgdb ecw kakadu mrsid jp2mrsid mrsid_lidar msg oci ingres dwgdirect idb sde rasdaman sosi ] args.concat unsupported_backends.map { |b| "--without-" + b } if build.without? "unsupported" # Database support. args << (build.with?("postgresql") ? "--with-pg=#{HOMEBREW_PREFIX}/bin/pg_config" : "--without-pg") args << (build.with?("mysql") ? "--with-mysql=#{HOMEBREW_PREFIX}/bin/mysql_config" : "--without-mysql") if build.with? "mdb" args << "--with-java=yes" # The rpath is only embedded for Oracle (non-framework) installs args << "--with-jvm-lib-add-rpath=yes" args << "--with-mdb=yes" end args << "--with-libkml=#{libexec}" if build.with? "libkml" args << "--with-qhull=#{build.with?("qhull") ? "internal" : "no"}" # Python is installed manually to ensure everything is properly sandboxed. args << "--without-python" # Scripting APIs that have not been re-worked to respect Homebrew prefixes. # # Currently disabled as they install willy-nilly into locations outside of # the Homebrew prefix. Enable if you feel like it, but uninstallation may be # a manual affair. # # TODO: Fix installation of script bindings so they install into the # Homebrew prefix. args << "--without-perl" args << "--without-php" args << "--without-ruby" args << (build.with?("opencl") ? "--with-opencl" : "--without-opencl") args << (build.with?("armadillo") ? "--with-armadillo=#{Formula["armadillo"].opt_prefix}" : "--with-armadillo=no") args end def install if build.with? "libkml" resource("libkml").stage do # See main `libkml` formula for info on patches inreplace "configure.ac", "-Werror", "" inreplace "third_party/Makefile.am" do |s| s.sub! /(lib_LTLIBRARIES =) libminizip.la liburiparser.la/, "\\1" s.sub! /(noinst_LTLIBRARIES = libgtest.la libgtest_main.la)/, "\\1 libminizip.la liburiparser.la" s.sub! /(libminizip_la_LDFLAGS =)/, "\\1 -static" s.sub! /(liburiparser_la_LDFLAGS =)/, "\\1 -static" end system "./autogen.sh" system "./configure", "--prefix=#{libexec}" system "make", "install" end end # Linking flags for SQLite are not added at a critical moment when the GDAL # library is being assembled. This causes the build to fail due to missing # symbols. Also, ensure Homebrew SQLite is used so that Spatialite is # functional. # # Fortunately, this can be remedied using LDFLAGS. sqlite = Formula["sqlite"] ENV.append "LDFLAGS", "-L#{sqlite.opt_lib} -lsqlite3" ENV.append "CFLAGS", "-I#{sqlite.opt_include}" # Reset ARCHFLAGS to match how we build. ENV["ARCHFLAGS"] = "-arch #{MacOS.preferred_arch}" # Fix hardcoded mandir: http://trac.osgeo.org/gdal/ticket/5092 inreplace "configure", %r[^mandir='\$\{prefix\}/man'$], "" # These libs are statically linked in vendored libkml and libkml formula inreplace "configure", " -lminizip -luriparser", "" if build.with? "libkml" system "./configure", *configure_args system "make" system "make", "install" inreplace "swig/python/setup.cfg" do |s| s.gsub! /#(.*_dirs)/, "\\1" s.sub! /(include_dirs = \S+)/, "\\1:../../apps/" end Language::Python.each_python(build) do |python, _python_version| cd "swig/python" do system python, *Language::Python.setup_install_args(prefix) bin.install Dir["scripts/*"] if python == "python" end end if build.with? "swig-java" cd "swig/java" do inreplace "java.opt", "linux", "darwin" inreplace "java.opt", "#JAVA_HOME = /usr/lib/jvm/java-6-openjdk/", "JAVA_HOME=$(shell echo $$JAVA_HOME)" system "make" system "make", "install" # Install the jar that complements the native JNI bindings system "ant" lib.install "gdal.jar" end end system "make", "man" if build.head? system "make", "install-man" # Clean up any stray doxygen files. Dir.glob("#{bin}/*.dox") { |p| rm p } end def caveats if build.with? "mdb" <<~EOS To have a functional MDB driver, install supporting .jar files in: `/Library/Java/Extensions/` See: `http://www.gdal.org/ogr/drv_mdb.html` EOS end end test do # basic tests to see if third-party dylibs are loading OK system "#{bin}/gdalinfo", "--formats" system "#{bin}/ogrinfo", "--formats" # test Python support Language::Python.each_python(build) do |python, python_version| if (lib/"python#{python_version}/site-packages").exist? ENV["PYTHONPATH"] = lib/"python#{python_version}/site-packages" system python, "-c", "from osgeo import gdal, ogr, osr, gdal_array, gdalconst" end end end end ================================================ FILE: boneyard/gdal-ecwjp2.rb ================================================ ECWJP2_SDK = "/Hexagon/ERDASEcwJpeg2000SDK5.2.1/Desktop_Read-Only" class EcwJp2Sdk < Requirement fatal true satisfy(:build_env => false) { File.exist? ECWJP2_SDK } def message; <<~EOS ERDAS ECW/JP2 SDK was not found at: #{ECWJP2_SDK} Download SDK and install 'Desktop Read-Only' to default location from: http://download.intergraph.com/?ProductName=ERDAS%20ECW/JPEG2000%20SDK EOS end end class GdalEcwjp2 < Formula homepage "http://www.gdal.org/frmt_ecw.html" url "http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz" sha256 "989db33ff411e2c888348e71edec5ad06c74ed68781ebfbc4e85179b9d65aafe" depends_on "macos" => :lion # as per SDK docs depends_on EcwJp2Sdk depends_on "gdal" def gdal_clib gdal_lib = "#{Formula["gdal"].opt_lib}/libgdal.dylib" (%x[otool -L #{gdal_lib}].include? "libstdc++") ? "std" : "" end def install gdal = Formula["gdal"] (lib/"gdalplugins").mkpath # vendor Desktop Read-Only lib, etc # match c-lib that gdal was built against cp "#{ECWJP2_SDK}/lib/lib#{gdal_clib}c++/dynamic/libNCSEcw.dylib", "#{lib}/" system "install_name_tool", "-id", HOMEBREW_PREFIX/"lib/libNCSEcw.dylib", lib/"libNCSEcw.dylib" cp_r "#{ECWJP2_SDK}/etc", "#{prefix}/" # cxx flags args = %W[-Iport -Igcore -Ifrmts -DFRMT_ecw -DECWSDK_VERSION=51 -Ifrmts/ecw -I#{ECWJP2_SDK}/include -I#{ECWJP2_SDK}/include/NCSEcw/API -I#{ECWJP2_SDK}/include/NCSEcw/ECW -I#{ECWJP2_SDK}/include/NCSEcw/JP2] # source files Dir["frmts/ecw/*.cpp"].each do |src| args.concat %W[#{src}] end # plugin dylib args.concat %W[ -dynamiclib -install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/gdal_ECW_JP2ECW.dylib -current_version #{version} -compatibility_version #{version} -o #{lib}/gdalplugins/gdal_ECW_JP2ECW.dylib -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{lib} -lNCSEcw] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you will need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins Once plugin is installed, the ERDAS ECW/JP2 SDK can be deleted from its default install location of: /Hexagon/ERDASEcwJpeg2000SDK* EOS end end ================================================ FILE: boneyard/gdal-filegdb.rb ================================================ require 'formula' class GdalFilegdb < Formula homepage 'http://www.gdal.org/ogr/drv_filegdb.html' url 'http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz' sha256 '989db33ff411e2c888348e71edec5ad06c74ed68781ebfbc4e85179b9d65aafe' depends_on "filegdb-api" depends_on 'gdal' def install filegdb_opt = Formula['filegdb-api'].opt_prefix (lib/'gdalplugins').mkpath # cxx flags args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/filegdb -I#{filegdb_opt}/include/filegdb] # source files Dir['ogr/ogrsf_frmts/filegdb/*.c*'].each do |src| args.concat %W[#{src}] end # plugin dylib args.concat %W[ -dynamiclib -install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/ogr_FileGDB.dylib -current_version #{version} -compatibility_version #{version} -o #{lib}/gdalplugins/ogr_FileGDB.dylib -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{filegdb_opt}/lib -lFileGDBAPI] # build and install shared plugin if ENV.compiler == :clang && MacOS.version >= :mavericks # fixes to make plugin work with gdal possibly built against libc++ # NOTE: works, but I don't know if it is a sane fix # see: http://forums.arcgis.com/threads/95958-OS-X-Mavericks # https://gist.github.com/jctull/f4d620cd5f1560577d17 # TODO: needs removed as soon as ESRI updates filegdb binaries for libc++ cxxstdlib_check :skip args.unshift "-mmacosx-version-min=10.8" # better than -stdlib=libstdc++ ? end system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you will need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins ============================== IMPORTANT ============================== If compiled using clang (default) on 10.9+ this plugin was built against libstdc++ (like filegdb binaries), which may load into your GDAL, but possibly be incompatible. Please report any issues to: https://github.com/osgeo/homebrew-osgeo4mac/issues EOS end end ================================================ FILE: boneyard/gdal-grass64.rb ================================================ require 'formula' class GdalGrass64 < Formula homepage 'http://www.gdal.org' url 'http://download.osgeo.org/gdal/gdal-grass-1.4.3.tar.gz' sha256 'ea18d1e773e8875aaf3261a6ccd2a5fa22d998f064196399dfe73d991688f1dd' revision 1 bottle do root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" sha256 "93be8a55d7855eb95e08fe888ec7ce893aa1d2e34d91f8a19669d56c9c060c27" => :mavericks sha256 "30f9c487696e908e73efbf74702668ad896d68a7238e529dd19671255b15e651" => :yosemite sha256 "43fdc5d8e5b6ac67f05551fca316bc5f91e36e14cb3bc5cdd698516a724748f8" => :el_capitan end depends_on 'gdal' depends_on 'grass-64' conflicts_with 'gdal-grass', :because => 'both install same-named gdal plugin' def install gdal = Formula['gdal'] grass = Formula['grass-64'] system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking", "--with-gdal=#{gdal.bin}/gdal-config", "--with-grass=#{grass.prefix}/grass-#{grass.version}", "--with-autoload=#{lib}/gdalplugins" inreplace "Makefile", 'mkdir', 'mkdir -p' system "make install" end def caveats; <<~EOS This formula provides a plugin that allows GDAL and OGR to access geospatial data stored using the GRASS vector and raster formats. In order to use the plugin, you will need to add the following path to the GDAL_DRIVER_PATH enviroment variable: #{HOMEBREW_PREFIX}/lib/gdalplugins EOS end end ================================================ FILE: boneyard/gdal-mrsid.rb ================================================ class GdalMrsid < Formula homepage "http://www.gdal.org/frmt_mrsid.html" url "http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz" sha256 "989db33ff411e2c888348e71edec5ad06c74ed68781ebfbc4e85179b9d65aafe" depends_on "mrsid-sdk" depends_on "gdal" def install mrsid_sdk_opt = Formula['mrsid-sdk'].opt_prefix (lib/"gdalplugins").mkpath plugins = {} lidar_args, mrsid_args = [], [] # source files & cxx/ld flags # gdal_MG4Lidar.dylib Dir["frmts/mrsid_lidar/*.c*"].each { |src| lidar_args.concat %W[#{src}] } lidar_args.concat %W[ -Iport -Igcore -Ifrmts -Ifrmts/mrsid_lidar -I#{mrsid_sdk_opt}/include/mrsid ] lidar_args.concat %W[-L#{mrsid_sdk_opt}/lib -llti_lidar_dsdk] plugins[:gdal_MG4Lidar] = lidar_args # gdal_MrSID.dylib Dir["frmts/mrsid/*.c*"].each { |src| mrsid_args.concat %W[#{src}] } mrsid_args.concat %W[ -DMRSID_J2K=1 -Iport -Igcore -Ifrmts -Ifrmts/mrsid -I#{mrsid_sdk_opt}/include/mrsid ] mrsid_args.concat %W[-L#{mrsid_sdk_opt}/lib -lltidsdk] plugins[:gdal_MrSID] = mrsid_args # plugin dylib # TODO: remove cxxstdlib_check, after LizardTech updates binaries for libc++ # https://www.lizardtech.com/forums/viewtopic.php?f=6&t=821 cxxstdlib_check :skip plugins.each do |key, args| # TODO: can the compatibility_version be 1.10.0? args.concat %W[ -dynamiclib -install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/#{key.to_s}.dylib -current_version #{version} -compatibility_version #{version} -o #{lib}/gdalplugins/#{key.to_s}.dylib -undefined dynamic_lookup ] # build and install shared plugin system ENV.cxx, *args end end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you will need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins ============================== IMPORTANT ============================== If compiled using clang (default) on 10.9+ this plugin links to libc++ (whereas MrSID libs/binaries link to libstdc++). This may lead to issues during usage, including crashes. Please report any issues to: https://github.com/osgeo/homebrew-osgeo4mac/issues EOS end end ================================================ FILE: boneyard/gdal-oracle.rb ================================================ class GdalOracle < Formula homepage "http://www.gdal.org/ogr/drv_oci.html" url 'http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz' sha256 '989db33ff411e2c888348e71edec5ad06c74ed68781ebfbc4e85179b9d65aafe' depends_on "oracle-client-sdk" depends_on "gdal" def install oracle_opt = Formula['oracle-client-sdk'].opt_prefix (lib/"gdalplugins").mkpath args = [] # source files args.concat %W[ogr/ogrsf_frmts/oci/oci_utils.cpp] Dir["ogr/ogrsf_frmts/oci/ogr*.c*"].each { |src| args.concat %W[#{src}] } # plugin dylib # TODO: can the compatibility_version be 1.10.0? args.concat %W[ -dynamiclib -install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/ogr_OCI.dylib -current_version #{version} -compatibility_version #{version} -o #{lib}/gdalplugins/ogr_OCI.dylib -undefined dynamic_lookup ] # cxx flags args.concat %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/oci -I#{oracle_opt}/sdk/include] # ld flags args.concat %W[-L#{oracle_opt}/lib -lclntsh] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you will need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end end ================================================ FILE: boneyard/gdal-sosi.rb ================================================ class GdalSosi < Formula homepage "http://trac.osgeo.org/gdal/wiki/SOSI" url "http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz" sha256 "989db33ff411e2c888348e71edec5ad06c74ed68781ebfbc4e85179b9d65aafe" depends_on "fyba" depends_on "gdal" def install fyba_opt = Formula["fyba"].opt_prefix (lib/"gdalplugins").mkpath # cxx flags args = %W[-DLINUX -DUNIX -Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/sosi -I#{fyba_opt}/include/fyba] # source files Dir['ogr/ogrsf_frmts/sosi/ogrsosi*.c*'].each do |src| args.concat %W[#{src}] end # plugin dylib args.concat %W[ -dynamiclib -install_name #{HOMEBREW_PREFIX}/lib/gdalplugins/ogr_SOSI.dylib -current_version #{version} -compatibility_version #{version} -o #{lib}/gdalplugins/ogr_SOSI.dylib -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{fyba_opt}/lib -lfyba -lfygm -lfyut] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you will need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end end ================================================ FILE: boneyard/gdal1-ecwjp2.rb ================================================ class Gdal1Ecwjp2 < Formula desc "GDAL/OGR 1.x plugin for ECW driver" homepage "http://www.gdal.org/frmt_ecw.html" url "http://download.osgeo.org/gdal/1.11.5/gdal-1.11.5.tar.gz" sha256 "49f99971182864abed9ac42de10545a92392d88f7dbcfdb11afe449a7eb754fe" depends_on "ecwjp2-sdk" depends_on "gdal" def gdal_majmin_ver gdal_ver_list = Formula["gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def gdal_clib gdal_lib = "#{Formula["gdal"].opt_lib}/libgdal.dylib" (`otool -L #{gdal_lib}`.include? "libstdc++") ? "-stdcxx" : "" end def install ENV.libstdcxx if gdal_clib == "-stdcxx" ecwjp2_opt = Formula["ecwjp2-sdk"].opt_prefix ecwjp2_opt_include = ecwjp2_opt/"include/ECWJP2" gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath (HOMEBREW_PREFIX/"lib/#{gdal_plugins_subdirectory}").mkpath # cxx flags args = %W[-Iport -Igcore -Ifrmts -DFRMT_ecw -DECWSDK_VERSION=53 -Ifrmts/ecw -I#{ecwjp2_opt_include} -I#{ecwjp2_opt_include}/NCSEcw/API -I#{ecwjp2_opt_include}/NCSEcw/ECW -I#{ecwjp2_opt_include}/NCSEcw/JP2] # source files Dir["frmts/ecw/*.cpp"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "gdal_ECW_JP2ECW.dylib" args.concat %W[ -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{ecwjp2_opt}/lib -lNCSEcw#{gdal_clib}] args << "-stdlib=libstdc++" if gdal_clib == "-stdcxx" # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["gdal"].opt_bin out = `#{gdal_opt_bin}/gdalinfo --formats` assert_match "ECW (rov)", out assert_match "JP2ECW (rov)", out ecwjp2_test = Formula["ecwjp2-sdk"].opt_prefix/"test" out = `#{gdal_opt_bin}/gdalinfo #{ecwjp2_test}/RGB_8bit.ecw` assert_match "Driver: ECW/ERDAS Compressed Wavelets", out assert_match "Size is 4320, 2160", out out = `#{gdal_opt_bin}/gdalinfo #{ecwjp2_test}/RGB_8bit.jp2` assert_match "Driver: JP2ECW/ERDAS JPEG2000", out assert_match "Size is 4320, 2160", out end end ================================================ FILE: boneyard/gdal1-filegdb.rb ================================================ class Gdal1Filegdb < Formula desc "GDAL/OGR 1.x plugin for ESRI FileGDB driver" homepage "http://www.gdal.org/drv_filegdb.html" url "http://download.osgeo.org/gdal/1.11.5/gdal-1.11.5.tar.gz" sha256 "49f99971182864abed9ac42de10545a92392d88f7dbcfdb11afe449a7eb754fe" depends_on "filegdb-api" depends_on "gdal" def gdal_majmin_ver gdal_ver_list = Formula["gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install filegdb_opt = Formula["filegdb-api"].opt_prefix gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath (HOMEBREW_PREFIX/"lib/#{gdal_plugins_subdirectory}").mkpath # cxx flags args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/filegdb -I#{filegdb_opt}/include/filegdb] # source files Dir["ogr/ogrsf_frmts/filegdb/*.c*"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "ogr_FileGDB.dylib" args.concat %W[ -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{filegdb_opt}/lib -lFileGDBAPI] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["gdal"].opt_bin out = `#{gdal_opt_bin}/ogrinfo --formats` assert_match "\"FileGDB\" (read/write)", out end end ================================================ FILE: boneyard/gdal1-grass6.rb ================================================ class Gdal1Grass6 < Formula desc "GDAL/OGR 1.x plugin for GRASS 6" homepage "http://www.gdal.org" url "http://download.osgeo.org/gdal/gdal-grass-1.11.2.tar.gz" sha256 "08473ade53d699e1292c54a4271ed0108ec39e0b3a5ebfea04dc88d31e44bd1b" revision 1 # bottle do # root_url "https://osgeo4mac.s3.amazonaws.com/bottles" # sha256 "" => :mavericks # end depends_on "gdal" depends_on "grass6" def gdal_majmin_ver gdal_ver_list = Formula["gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def install gdal = Formula["gdal"] gdal_plugins = lib/"gdalplugins/#{gdal_majmin_ver}" gdal_plugins.mkpath (HOMEBREW_PREFIX/"lib/gdalplugins/#{gdal_majmin_ver}").mkpath grass = Formula["grass6"] # due to DYLD_LIBRARY_PATH no longer being setable, strictly define extension inreplace "Makefile.in", ".so", ".dylib" system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking", "--with-gdal=#{gdal.opt_bin}/gdal-config", "--with-grass=#{grass.prefix}/grass-#{grass.version}", "--with-autoload=#{gdal_plugins}" inreplace "Makefile", "mkdir", "mkdir -p" system "make", "install" end def caveats; <<~EOS This formula provides a plugin that allows GDAL and OGR to access geospatial data stored using the GRASS vector and raster formats. In order to use the plugin, you will need to add the following path to the GDAL_DRIVER_PATH enviroment variable: #{HOMEBREW_PREFIX}/lib/gdalplugins/#{gdal_majmin_ver} EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["gdal"].opt_bin out = `#{gdal_opt_bin}/gdalinfo --formats` assert_match "GRASS (ro)", out out = `#{gdal_opt_bin}/ogrinfo --formats` assert_match "\"GRASS\" (readonly)", out end end ================================================ FILE: boneyard/gdal1-mrsid.rb ================================================ class Gdal1Mrsid < Formula desc "GDAL/OGR 1 plugin for MrSID raster and LiDAR drivers" homepage "http://www.gdal.org/frmt_mrsid.html" url "http://download.osgeo.org/gdal/1.11.5/gdal-1.11.5.tar.gz" sha256 "49f99971182864abed9ac42de10545a92392d88f7dbcfdb11afe449a7eb754fe" depends_on "mrsid-sdk" depends_on "gdal" def gdal_majmin_ver gdal_ver_list = Formula["gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install mrsid_sdk_opt = Formula["mrsid-sdk"].opt_prefix gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath (HOMEBREW_PREFIX/"lib/#{gdal_plugins_subdirectory}").mkpath plugins = {} lidar_args = [] mrsid_args = [] # source files & cxx/ld flags # gdal_MG4Lidar.dylib Dir["frmts/mrsid_lidar/*.c*"].each { |src| lidar_args.concat %W[#{src}] } lidar_args.concat %W[ -Iport -Igcore -Ifrmts -Ifrmts/mrsid_lidar -I#{mrsid_sdk_opt}/include/mrsid ] lidar_args.concat %W[-L#{mrsid_sdk_opt}/lib -llti_lidar_dsdk] plugins[:gdal_MG4Lidar] = lidar_args # gdal_MrSID.dylib Dir["frmts/mrsid/*.c*"].each { |src| mrsid_args.concat %W[#{src}] } mrsid_args.concat %W[ -DMRSID_J2K=1 -Iport -Igcore -Ifrmts -Ifrmts/mrsid -Ifrmts/gtiff/libgeotiff -I#{mrsid_sdk_opt}/include/mrsid ] mrsid_args.concat %W[-L#{mrsid_sdk_opt}/lib -lltidsdk] plugins[:gdal_MrSID] = mrsid_args # plugin dylib plugins.each do |key, args| args.concat %W[ -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{key}.dylib -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{key}.dylib -undefined dynamic_lookup ] # build and install shared plugin system ENV.cxx, *args end end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["gdal"].opt_bin out = `#{gdal_opt_bin}/gdalinfo --formats` assert_match "MG4Lidar (ro)", out assert_match "MrSID (rov)", out assert_match "JP2MrSID (rov)", out end end ================================================ FILE: boneyard/gdal1-mysql.rb ================================================ class Gdal1Mysql < Formula desc "GDAL/OGR 1.x plugin for MySQL driver" homepage "http://www.gdal.org/drv_mysql.html" url "http://download.osgeo.org/gdal/1.11.5/gdal-1.11.5.tar.gz" sha256 "49f99971182864abed9ac42de10545a92392d88f7dbcfdb11afe449a7eb754fe" depends_on "mysql" => :build # adds openssl depends_on "gdal" def gdal_majmin_ver gdal_ver_list = Formula["gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install mysql = Formula["mysql"] gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath (HOMEBREW_PREFIX/"lib/#{gdal_plugins_subdirectory}").mkpath # cxx flags args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/mysql -I#{mysql.opt_include}/mysql] # source files Dir["ogr/ogrsf_frmts/mysql/*.c*"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "ogr_MySQL.dylib" args.concat %W[ -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # ld flags args.concat %W[ #{mysql.opt_lib}/libmysqlclient.a -L#{Formula["openssl"].opt_lib} -lssl -lcrypto ] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["gdal"].opt_bin out = `#{gdal_opt_bin}/ogrinfo --formats` assert_match "\"MySQL\" (read/write)", out end end ================================================ FILE: boneyard/gdal1-oracle.rb ================================================ class Gdal1Oracle < Formula desc "GDAL/OGR 1.x plugin for Oracle Spatial driver" homepage "http://www.gdal.org/drv_oci.html" url "http://download.osgeo.org/gdal/1.11.5/gdal-1.11.5.tar.gz" sha256 "49f99971182864abed9ac42de10545a92392d88f7dbcfdb11afe449a7eb754fe" depends_on "oracle-client-sdk" depends_on "gdal" def gdal_majmin_ver gdal_ver_list = Formula["gdal"].version.to_s.split(".") "#{gdal_ver_list[0]}.#{gdal_ver_list[1]}" end def gdal_plugins_subdirectory "gdalplugins/#{gdal_majmin_ver}" end def install oracle_opt = Formula["oracle-client-sdk"].opt_prefix gdal_plugins = lib/gdal_plugins_subdirectory gdal_plugins.mkpath (HOMEBREW_PREFIX/"lib/#{gdal_plugins_subdirectory}").mkpath # cxx flags args = %W[-Iport -Igcore -Iogr -Iogr/ogrsf_frmts -Iogr/ogrsf_frmts/generic -Iogr/ogrsf_frmts/oci -I#{oracle_opt}/include/oci] # source files Dir["ogr/ogrsf_frmts/oci/oci_utils.cpp", "ogr/ogrsf_frmts/oci/ogr*.c*"].each do |src| args.concat %W[#{src}] end # plugin dylib dylib_name = "ogr_OCI.dylib" args.concat %W[ -dynamiclib -install_name #{opt_lib}/#{gdal_plugins_subdirectory}/#{dylib_name} -current_version #{version} -compatibility_version #{gdal_majmin_ver}.0 -o #{gdal_plugins}/#{dylib_name} -undefined dynamic_lookup ] # ld flags args.concat %W[-L#{oracle_opt}/lib -lclntsh] # build and install shared plugin system ENV.cxx, *args end def caveats; <<~EOS This formula provides a plugin that allows GDAL or OGR to access geospatial data stored in its format. In order to use the shared plugin, you may need to set the following enviroment variable: export GDAL_DRIVER_PATH=#{HOMEBREW_PREFIX}/lib/gdalplugins EOS end test do ENV["GDAL_DRIVER_PATH"] = "#{HOMEBREW_PREFIX}/lib/gdalplugins" gdal_opt_bin = Formula["gdal"].opt_bin out = `#{gdal_opt_bin}/ogrinfo --formats` assert_match "\"OCI\" (read/write)", out end end ================================================ FILE: boneyard/gpsbabel-qt4.rb ================================================ class GpsbabelQt4 < Formula desc "Converts/uploads GPS waypoints, tracks, and routes" homepage "https://www.gpsbabel.org/" url "https://github.com/gpsbabel/gpsbabel/archive/gpsbabel_1_5_3.tar.gz" sha256 "10b7aaca44ce557fa1175fec37297b8df55611ab2c51cb199753a22dbf2d3997" revision 1 head "https://github.com/gpsbabel/gpsbabel.git" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" sha256 "6d25eda9d6eca9e834c56a2d05dc5049ede3a7ee8988422f145d7075664a470d" => :sierra sha256 "6d25eda9d6eca9e834c56a2d05dc5049ede3a7ee8988422f145d7075664a470d" => :high_sierra end keg_only "gpsbabel is in main tap and same-name bin utilities are installed" depends_on "libusb" => :optional depends_on "qt-4" # Fix build with Xcode 9, remove for next version patch do url "https://github.com/gpsbabel/gpsbabel/commit/b7365b93.patch?full_index=1" sha256 "e949182def36fef99889e43ba4bc4d61e36d6b95badc74188a8cd3da5156d341" end def install args = ["--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"] args << "--without-libusb" if build.without? "libusb" system "./configure", *args system "make", "install" end test do (testpath/"test.loc").write <<~EOS EOS system bin/"gpsbabel", "-i", "geo", "-f", "test.loc", "-o", "gpx", "-F", "test.gpx" assert_predicate testpath/"test.gpx", :exist? end end ================================================ FILE: boneyard/grass-64.rb ================================================ class Grass64 < Formula desc "Geographic Resources Analysis Support System" homepage "http://grass.osgeo.org/" stable do url "https://grass.osgeo.org/grass64/source/grass-6.4.5.tar.gz" sha256 "f501da62807eb08efcb85820859fe5ade9bc392e20641b606273c956bb678f3e" # Patches to keep files from being installed outside of the prefix. # Remove lines from Makefile that try to install to /Library/Documentation. # Also, quick patch for compiling with clang (as yet, unreported issue) patch :DATA end bottle do # root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" # revision 1 # sha256 "13723d19221024073a0e781dddf3cbb9ab30e13a3b8d4d50c6eb61d0e60c347f" => :mavericks # sha256 "f951bfe72e348529ebd8ee56f202872258ccd803cee472079222d68acfd70e9b" => :yosemite end keg_only "grass is in main tap and same-name bin utilities are installed" option "without-gui", "Build without WxPython interface. Command line tools still available." # TODO: test on 10.6 first. may work with latest wxWidgets 3.0 # depends on :macos => :lion # TODO: builds with clang (has same non-fatal errors as gcc), but is it compiled correctly? # depends on "gcc" => :build depends_on "pkg-config" => :build depends_on "gettext" depends_on "readline" depends_on "gdal" depends_on "libtiff" depends_on "unixodbc" depends_on "fftw" depends_on :python depends_on "wxpython" depends_on "postgresql" => :optional depends_on "mysql" => :optional depends_on "cairo" depends_on "x11" # needs to find at least X11/include/GL/gl.h def headless? # The GRASS GUI is based on WxPython. build.without? "gui" end def install readline = Formula["readline"].opt_prefix gettext = Formula["gettext"].opt_prefix # noinspection RubyLiteralArrayInspection args = [ "--disable-debug", "--disable-dependency-tracking", "--enable-largefile", "--enable-shared", "--with-cxx", "--without-motif", "--with-python", "--with-blas", "--with-lapack", "--with-sqlite", "--with-odbc", "--with-geos=#{Formula["geos"].opt_bin}/geos-config", "--with-proj-share=#{Formula["proj"].opt_share}/proj", "--with-png", "--with-readline-includes=#{readline}/include", "--with-readline-libs=#{readline}/lib", "--with-readline", "--with-nls-includes=#{gettext}/include", "--with-nls-libs=#{gettext}/lib", "--with-nls", "--with-freetype", "--without-tcltk", # Disabled due to compatibility issues with OS X Tcl/Tk "--with-includes=#{gettext}/include" ] unless MacOS::CLT.installed? # On Xcode-only systems (without the CLT), we have to help: args << "--with-macosx-sdk=#{MacOS.sdk_path}" args << "--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers" end if headless? args << "--without-wxwidgets" else wx_paths = formula_site_packages "wxpython" ENV.prepend("PYTHONPATH", wx_paths, File::PATH_SEPARATOR) if wx_paths args << "--with-wxwidgets=#{Formula["wxmac"].opt_bin}/wx-config" end args << "--enable-64bit" if MacOS.prefer_64_bit? args << "--with-macos-archs=#{MacOS.preferred_arch}" cairo = Formula["cairo"] args << "--with-cairo-includes=#{cairo.include}/cairo" args << "--with-cairo-libs=#{cairo.lib}" args << "--with-cairo" # Database support args << "--with-postgres" if build.with? "postgresql" if build.with? "mysql" mysql = Formula["mysql"] args << "--with-mysql-includes=#{mysql.include}/mysql" args << "--with-mysql-libs=#{mysql.lib}" args << "--with-mysql" end if MacOS.version >= :el_capitan # handle stripping of DYLD_* env vars by SIP when passed to utilities; # HOME env var is .brew_home during build, so it is still checked for lib ln_sf "#{buildpath}/dist.x86_64-apple-darwin#{`uname -r`.strip}/lib", ".brew_home/lib" end system "./configure", "--prefix=#{prefix}", *args system "make", "GDAL_DYNAMIC=" # make and make install must be separate steps. system "make", "GDAL_DYNAMIC=", "install" # GDAL_DYNAMIC set to blank for r.external compatability end def post_install # ensure QGIS's Processing plugin recognizes install ln_sf "../bin/grass64", prefix/"grass-#{version}/grass.sh" # link so settings in external apps don't need updated on grass version bump # in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass-64/grass-base ln_sf "grass-#{version}", prefix/"grass-base" end def formula_site_packages(f) `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 end def caveats if headless? <<~EOS This build of GRASS has been compiled without the WxPython GUI. The command line tools remain fully functional. EOS end end test do system "#{bin}/grass64", "--version" end end __END__ diff --git a/Makefile b/Makefile index f1edea6..be404b0 100644 --- a/Makefile +++ b/Makefile @@ -304,8 +304,6 @@ ifeq ($(strip $(MINGW)),) -tar cBf - gem/skeleton | (cd ${INST_DIR}/etc ; tar xBf - ) 2>/dev/null -${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${BINDIR} 2>/dev/null endif - @# enable OSX Help Viewer - @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 install-strip: FORCE diff --git a/raster/r.terraflow/direction.cc b/raster/r.terraflow/direction.cc index 7744518..778c225 100644 --- a/raster/r.terraflow/direction.cc +++ b/raster/r.terraflow/direction.cc @@ -53,11 +53,11 @@ encodeDirectionMFD(const genericWindow& elevwin, if(!is_nodata(elevwin.get())) { dir = 0; - if (elevwin.get(5) < elevwin.get() && !is_void(elevwin.get(5))) dir |= 1; - if (elevwin.get(3) < elevwin.get() && !is_void(elevwin.get(3))) dir |= 16; + if (elevwin.get(5) < elevwin.get() && !is_voided(elevwin.get(5))) dir |= 1; + if (elevwin.get(3) < elevwin.get() && !is_voided(elevwin.get(3))) dir |= 16; for(int i=0; i<3; i++) { - if(elevwin.get(i) < elevwin.get() && !is_void(elevwin.get(i))) dir |= 32<>i; + if(elevwin.get(i) < elevwin.get() && !is_voided(elevwin.get(i))) dir |= 32<>i; } } diff --git a/raster/r.terraflow/nodata.cc b/raster/r.terraflow/nodata.cc index 159c66d..610ca55 100644 --- a/raster/r.terraflow/nodata.cc +++ b/raster/r.terraflow/nodata.cc @@ -73,7 +73,7 @@ is_nodata(float x) { int -is_void(elevation_type el) { +is_voided(elevation_type el) { return (el == nodataType::ELEVATION_NODATA); } diff --git a/raster/r.terraflow/nodata.h b/raster/r.terraflow/nodata.h index 1e843c5..ac56504 100644 --- a/raster/r.terraflow/nodata.h +++ b/raster/r.terraflow/nodata.h @@ -37,7 +37,7 @@ int is_nodata(elevation_type el); int is_nodata(int x); int is_nodata(float x); -int is_void(elevation_type el); +int is_voided(elevation_type el); class nodataType : public ijBaseType { ================================================ FILE: boneyard/grass-70.rb ================================================ class Grass70 < Formula desc "Geographic Resources Analysis Support System" homepage "http://grass.osgeo.org/" stable do url "https://grass.osgeo.org/grass70/source/grass-7.0.4.tar.gz" sha256 "657188dc640b8482d16f889ff281abe424a0b232d03328086ba28cbf02c65af2" # Patches to keep files from being installed outside of the prefix. # Remove lines from Makefile that try to install to /Library/Documentation. patch :DATA end bottle do root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" sha256 "bb240ec7666eb963c4642913d067a8225b7e644d41eea14a74f441dc92c53275" => :mavericks end option "without-gui", "Build without WxPython interface. Command line tools still available." option "with-gdal-1", "Build with GDAL/OGR v1.x instead of v2.x" # TODO: test on 10.6 first. may work with latest wxWidgets 3.0 # depends on :macos => :lion # TODO: builds with clang (has same non-fatal errors as gcc), but is it compiled correctly? # depends on "gcc" => :build depends_on "pkg-config" => :build depends_on "gettext" depends_on "readline" if build.with? "gdal-1" depends_on "gdal" else depends_on "gdal2" end depends_on "libtiff" depends_on "unixodbc" depends_on "fftw" depends_on :python depends_on "wxpython" depends_on "postgresql" => :optional depends_on "mysql" => :optional depends_on "cairo" depends_on "ghostscript" # for cartographic composer previews depends_on "x11" # needs to find at least X11/include/GL/gl.h depends_on "openblas" => :optional depends_on "liblas" => :optional depends_on "netcdf" => :optional depends_on "ffmpeg" => :optional def headless? # The GRASS GUI is based on WxPython. build.without? "gui" end def install readline = Formula["readline"] gettext = Formula["gettext"] # noinspection RubyLiteralArrayInspection args = [ "--disable-debug", "--disable-dependency-tracking", "--enable-shared", "--with-cxx", "--with-python", "--with-blas", "--with-lapack", "--with-sqlite", "--with-odbc", "--with-geos=#{Formula["geos"].opt_bin}/geos-config", "--with-proj-share=#{Formula["proj"].opt_share}/proj", "--with-png", "--with-readline-includes=#{readline.opt_include}", "--with-readline-libs=#{readline.opt_lib}", "--with-readline", "--with-nls-includes=#{gettext.opt_include}", "--with-nls-libs=#{gettext.opt_lib}", "--with-nls", "--with-freetype", "--without-tcltk", # Disabled due to compatibility issues with OS X Tcl/Tk "--with-includes=#{gettext.opt_include}" ] unless MacOS::CLT.installed? # On Xcode-only systems (without the CLT), we have to help: args << "--with-macosx-sdk=#{MacOS.sdk_path}" args << "--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers" end if headless? args << "--without-wxwidgets" else wx_paths = formula_site_packages "wxpython" ENV.prepend("PYTHONPATH", wx_paths, File::PATH_SEPARATOR) if wx_paths args << "--with-wxwidgets=#{Formula["wxmac"].opt_bin}/wx-config" end args << "--enable-64bit" if MacOS.prefer_64_bit? args << "--with-macos-archs=#{MacOS.preferred_arch}" cairo = Formula["cairo"] args << "--with-cairo-includes=#{cairo.opt_include}/cairo" args << "--with-cairo-libs=#{cairo.opt_lib}" args << "--with-cairo" # Database support args << "--with-postgres" if build.with? "postgresql" if build.with? "mysql" mysql = Formula["mysql"] args << "--with-mysql-includes=#{mysql.opt_include}/mysql" args << "--with-mysql-libs=#{mysql.opt_lib}" args << "--with-mysql" end # other optional support if build.with? "openblas" # otherwise, Apple's will be found openblas = Formula["openblas"] args << "--with-blas-includes=#{openblas.opt_include}" args << "--with-blas-libs=#{openblas.opt_lib}" end args << "--with-liblas=#{Formula["liblas"].opt_bin}/liblas-config" if build.with? "liblas" args << "--with-netcdf=#{Formula["netcdf"].opt_bin}/nc-config" if build.with? "netcdf" if build.with? "ffmpeg" ffmpeg = Formula["ffmpeg"] args << "--with-ffmpeg-includes=#{(Dir["#{ffmpeg.opt_include}/*"]).join(" ")}" args << "--with-ffmpeg-libs=#{ffmpeg.opt_lib}" args << "--with-ffmpeg" end if MacOS.version >= :el_capitan # handle stripping of DYLD_* env vars by SIP when passed to utilities; # HOME env var is .brew_home during build, so it is still checked for lib ln_sf "#{buildpath}/dist.x86_64-apple-darwin#{`uname -r`.strip}/lib", ".brew_home/lib" end system "./configure", "--prefix=#{prefix}", *args system "make", "GDAL_DYNAMIC=" # make and make install must be separate steps. system "make", "GDAL_DYNAMIC=", "install" # GDAL_DYNAMIC set to blank for r.external compatability # ensure QGIS's Processing plugin recognizes install ln_sf "../bin/grass70", prefix/"grass-#{version}/grass70.sh" # link so settings in external apps don't need updated on grass version bump # in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass-70/grass-base ln_sf "grass-#{version}", prefix/"grass-base" end def formula_site_packages(f) `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 end def caveats if headless? <<~EOS This build of GRASS has been compiled without the WxPython GUI. The command line tools remain fully functional. EOS end end test do system bin/"grass70", "--version" end end __END__ diff --git a/include/Make/Install.make b/include/Make/Install.make index cf16788..8c0007b 100644 --- a/include/Make/Install.make +++ b/include/Make/Install.make @@ -114,11 +114,6 @@ real-install: | $(INST_DIR) $(UNIX_BIN) -$(INSTALL) config.status $(INST_DIR)/config.status -$(CHMOD) -R a+rX $(INST_DIR) 2>/dev/null -ifneq ($(findstring darwin,$(ARCH)),) - @# enable OSX Help Viewer - @/bin/ln -sfh "$(INST_DIR)/docs/html" /Library/Documentation/Help/GRASS-$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR) -endif - $(INST_DIR) $(UNIX_BIN): $(MAKE_DIR_CMD) $@ ================================================ FILE: boneyard/grass6.rb ================================================ require File.expand_path("../../Requirements/grass_requirements", Pathname.new(__FILE__).realpath) class Grass6 < Formula desc "Geographic Resources Analysis Support System" homepage "http://grass.osgeo.org/" stable do url "https://grass.osgeo.org/grass64/source/grass-6.4.6.tar.gz" sha256 "5a84754614619cc265d843980e28f39a1d24048805b9b2865e76a583d973f333" # Patches to keep files from being installed outside of the prefix. # Remove lines from Makefile that try to install to /Library/Documentation. # Also, quick patch for compiling with clang (as yet, unreported issue) patch :DATA end bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" sha256 "3b3257f5fcc7c3d4eb3997c658e8965fbdbda67f5068a6465eeeeea38c025134" => :sierra end option "without-gui", "Build without WxPython interface. Command line tools still available." depends_on UnlinkedGRASS6 # TODO: test on 10.6 first. may work with latest wxWidgets 3.0 # depends on :macos => :lion # TODO: builds with clang (has same non-fatal errors as gcc), but is it compiled correctly? # depends on "gcc" => :build depends_on "pkg-config" => :build depends_on "gettext" depends_on "readline" depends_on "gdal" depends_on "libtiff" depends_on "unixodbc" depends_on "fftw" depends_on "python@2" depends_on "wxpython" depends_on "osgeo-postgresql" => :optional depends_on "mysql" => :optional depends_on "cairo" depends_on :x11 # needs to find at least X11/include/GL/gl.h def headless? # The GRASS GUI is based on WxPython. build.without? "gui" end def install readline = Formula["readline"].opt_prefix gettext = Formula["gettext"].opt_prefix # noinspection RubyLiteralArrayInspection args = [ "--disable-debug", "--disable-dependency-tracking", "--enable-largefile", "--enable-shared", "--with-cxx", "--without-motif", "--with-python", "--with-blas", "--with-lapack", "--with-sqlite", "--with-odbc", "--with-geos=#{Formula["geos"].opt_bin}/geos-config", "--with-proj-share=#{Formula["proj"].opt_share}/proj", "--with-png", "--with-readline-includes=#{readline}/include", "--with-readline-libs=#{readline}/lib", "--with-readline", "--with-nls-includes=#{gettext}/include", "--with-nls-libs=#{gettext}/lib", "--with-nls", "--with-freetype", "--without-tcltk", # Disabled due to compatibility issues with OS X Tcl/Tk "--with-includes=#{gettext}/include" ] unless MacOS::CLT.installed? # On Xcode-only systems (without the CLT), we have to help: args << "--with-macosx-sdk=#{MacOS.sdk_path}" args << "--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers" end if headless? args << "--without-wxwidgets" else wx_paths = formula_site_packages "wxpython" ENV.prepend("PYTHONPATH", wx_paths, File::PATH_SEPARATOR) if wx_paths args << "--with-wxwidgets=#{Formula["wxmac"].opt_bin}/wx-config" end args << "--enable-64bit" if MacOS.prefer_64_bit? args << "--with-macos-archs=#{MacOS.preferred_arch}" cairo = Formula["cairo"] args << "--with-cairo-includes=#{cairo.include}/cairo" args << "--with-cairo-libs=#{cairo.lib}" args << "--with-cairo" # Database support args << "--with-postgres" if build.with? "postgresql" if build.with? "mysql" mysql = Formula["mysql"] args << "--with-mysql-includes=#{mysql.include}/mysql" args << "--with-mysql-libs=#{mysql.lib}" args << "--with-mysql" end if MacOS.version >= :el_capitan # handle stripping of DYLD_* env vars by SIP when passed to utilities; # HOME env var is .brew_home during build, so it is still checked for lib ln_sf "#{buildpath}/dist.x86_64-apple-darwin#{`uname -r`.strip}/lib", ".brew_home/lib" end system "./configure", "--prefix=#{prefix}", *args system "make", "GDAL_DYNAMIC=" # make and make install must be separate steps. system "make", "GDAL_DYNAMIC=", "install" # GDAL_DYNAMIC set to blank for r.external compatability end def post_install # ensure QGIS's Processing plugin recognizes install ln_sf "../bin/grass64", prefix/"grass-#{version}/grass.sh" # link so settings in external apps don't need updated on grass version bump # in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass6/grass-base ln_sf "grass-#{version}", prefix/"grass-base" end def formula_site_packages(f) `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 end def caveats if headless? <<~EOS This build of GRASS has been compiled without the WxPython GUI. The command line tools remain fully functional. EOS end end test do system "#{bin}/grass64", "--version" end end __END__ diff --git a/Makefile b/Makefile index 40b736d..1a1d8df 100644 --- a/Makefile +++ b/Makefile @@ -311,8 +311,6 @@ ifeq ($(strip $(MINGW)),) -tar cBf - gem/skeleton | (cd ${INST_DIR}/etc ; tar xBf - ) 2>/dev/null -${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${BINDIR} 2>/dev/null endif - @# enable OSX Help Viewer - @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 install-strip: FORCE diff --git a/raster/r.terraflow/direction.cpp b/raster/r.terraflow/direction.cpp index 7744518..778c225 100644 --- a/raster/r.terraflow/direction.cpp +++ b/raster/r.terraflow/direction.cpp @@ -53,11 +53,11 @@ encodeDirectionMFD(const genericWindow& elevwin, if(!is_nodata(elevwin.get())) { dir = 0; - if (elevwin.get(5) < elevwin.get() && !is_void(elevwin.get(5))) dir |= 1; - if (elevwin.get(3) < elevwin.get() && !is_void(elevwin.get(3))) dir |= 16; + if (elevwin.get(5) < elevwin.get() && !is_voided(elevwin.get(5))) dir |= 1; + if (elevwin.get(3) < elevwin.get() && !is_voided(elevwin.get(3))) dir |= 16; for(int i=0; i<3; i++) { - if(elevwin.get(i) < elevwin.get() && !is_void(elevwin.get(i))) dir |= 32<>i; + if(elevwin.get(i) < elevwin.get() && !is_voided(elevwin.get(i))) dir |= 32<>i; } } diff --git a/raster/r.terraflow/nodata.cpp b/raster/r.terraflow/nodata.cpp index 159c66d..610ca55 100644 --- a/raster/r.terraflow/nodata.cpp +++ b/raster/r.terraflow/nodata.cpp @@ -73,7 +73,7 @@ is_nodata(float x) { int -is_void(elevation_type el) { +is_voided(elevation_type el) { return (el == nodataType::ELEVATION_NODATA); } diff --git a/raster/r.terraflow/nodata.h b/raster/r.terraflow/nodata.h index 1e843c5..ac56504 100644 --- a/raster/r.terraflow/nodata.h +++ b/raster/r.terraflow/nodata.h @@ -37,7 +37,7 @@ int is_nodata(elevation_type el); int is_nodata(int x); int is_nodata(float x); -int is_void(elevation_type el); +int is_voided(elevation_type el); class nodataType : public ijBaseType { ================================================ FILE: boneyard/grass7-lts.rb ================================================ require File.expand_path("../../Requirements/grass_requirements", Pathname.new(__FILE__).realpath) class Grass7Lts < Formula desc "Geographic Resources Analysis Support System" homepage "https://grass.osgeo.org/" stable do url "https://grass.osgeo.org/grass72/source/grass-7.2.3.tar.gz" sha256 "a8d9a024d2c64c11082e8128f4200222c05659b971e3d826a146f9a8f9d93398" # Patches to keep files from being installed outside of the prefix. # Remove lines from Makefile that try to install to /Library/Documentation. patch :DATA end bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" sha256 "e2ddee7d7fa3575a9ba42634613bb9667897b773d5a82d01feb810496599919d" => :high_sierra sha256 "e2ddee7d7fa3575a9ba42634613bb9667897b773d5a82d01feb810496599919d" => :sierra end option "without-gui", "Build without WxPython interface. Command line tools still available." option "with-liblas", "Build with LibLAS-with-GDAL2 support" depends_on UnlinkedGRASS7 # TODO: test on 10.6 first. may work with latest wxWidgets 3.0 # depends on :macos => :lion # TODO: builds with clang (has same non-fatal errors as gcc), but is it compiled correctly? # depends on "gcc" => :build depends_on "pkg-config" => :build depends_on "gettext" depends_on "readline" depends_on "flex" depends_on "bison" depends_on "lbzip2" depends_on "gdal2" depends_on "libtiff" depends_on "unixodbc" depends_on "fftw" depends_on "python@2" depends_on "numpy" depends_on "wxpython" depends_on "osgeo-postgresql" => :optional depends_on "mysql" => :optional depends_on "cairo" depends_on "ghostscript" # for cartographic composer previews depends_on :x11 # needs to find at least X11/include/GL/gl.h depends_on "openblas" => :optional depends_on "liblas-gdal2" if build.with? "liblas" depends_on "osgeo-netcdf" => :optional depends_on "ffmpeg" => :optional def headless? # The GRASS GUI is based on WxPython. build.without? "gui" end def majmin_ver ver_split = version.to_s.split(".") ver_split[0] + ver_split[1] end def install readline = Formula["readline"] gettext = Formula["gettext"] # noinspection RubyLiteralArrayInspection args = [ "--disable-debug", "--disable-dependency-tracking", "--enable-shared", "--with-cxx", "--with-python", "--with-blas", "--with-lapack", "--with-sqlite", "--with-odbc", "--with-bzlib", "--with-geos=#{Formula["geos"].opt_bin}/geos-config", "--with-proj-share=#{Formula["proj"].opt_share}/proj", "--with-png", "--with-readline-includes=#{readline.opt_include}", "--with-readline-libs=#{readline.opt_lib}", "--with-readline", "--with-nls-includes=#{gettext.opt_include}", "--with-nls-libs=#{gettext.opt_lib}", "--with-nls", "--with-freetype", "--without-tcltk", # Disabled due to compatibility issues with OS X Tcl/Tk "--with-includes=#{gettext.opt_include}" ] unless MacOS::CLT.installed? # On Xcode-only systems (without the CLT), we have to help: args << "--with-macosx-sdk=#{MacOS.sdk_path}" args << "--with-opengl-includes=#{MacOS.sdk_path}/System/Library/Frameworks/OpenGL.framework/Headers" end if headless? args << "--without-wxwidgets" else wx_paths = formula_site_packages "wxpython" ENV.prepend("PYTHONPATH", wx_paths, File::PATH_SEPARATOR) if wx_paths args << "--with-wxwidgets=#{Formula["wxmac"].opt_bin}/wx-config" end args << "--enable-64bit" if MacOS.prefer_64_bit? args << "--with-macos-archs=#{MacOS.preferred_arch}" cairo = Formula["cairo"] args << "--with-cairo-includes=#{cairo.opt_include}/cairo" args << "--with-cairo-libs=#{cairo.opt_lib}" args << "--with-cairo" # Database support args << "--with-postgres" if build.with? "postgresql" if build.with? "mysql" mysql = Formula["mysql"] args << "--with-mysql-includes=#{mysql.opt_include}/mysql" args << "--with-mysql-libs=#{mysql.opt_lib}" args << "--with-mysql" end # other optional support if build.with? "openblas" # otherwise, Apple's will be found openblas = Formula["openblas"] args << "--with-blas-includes=#{openblas.opt_include}" args << "--with-blas-libs=#{openblas.opt_lib}" end args << "--with-liblas=#{Formula["liblas-gdal2"].opt_bin}/liblas-config" if build.with? "liblas" args << "--with-netcdf=#{Formula["netcdf"].opt_bin}/nc-config" if build.with? "netcdf" if build.with? "ffmpeg" ffmpeg = Formula["ffmpeg"] args << "--with-ffmpeg-includes=#{(Dir["#{ffmpeg.opt_include}/*"]).join(" ")}" args << "--with-ffmpeg-libs=#{ffmpeg.opt_lib}" args << "--with-ffmpeg" end if MacOS.version >= :el_capitan # handle stripping of DYLD_* env vars by SIP when passed to utilities; # HOME env var is .brew_home during build, so it is still checked for lib ln_sf "#{buildpath}/dist.x86_64-apple-darwin#{`uname -r`.strip}/lib", ".brew_home/lib" end system "./configure", "--prefix=#{prefix}", *args system "make", "GDAL_DYNAMIC=" # make and make install must be separate steps. system "make", "GDAL_DYNAMIC=", "install" # GDAL_DYNAMIC set to blank for r.external compatability # ensure QGIS's Processing plugin recognizes install # 2.14.8+ and other newer QGIS versions may reference just grass.sh bin_grass = "../bin/grass#{majmin_ver}" ln_sf bin_grass, prefix/"grass-#{version}/grass#{majmin_ver}.sh" ln_sf bin_grass, prefix/"grass-#{version}/grass.sh" # link so settings in external apps don't need updated on grass version bump # in QGIS Processing options, GRASS folder = HOMEBREW_PREFIX/opt/grass7/grass-base ln_sf "grass-#{version}", prefix/"grass-base" # ensure python2 is used bin.env_script_all_files(libexec/"bin", :GRASS_PYTHON => "python2") end def formula_site_packages(f) `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 end def caveats if headless? <<~EOS This build of GRASS has been compiled without the WxPython GUI. The command line tools remain fully functional. EOS end end test do system bin/"grass#{majmin_ver}", "--version" end end __END__ diff --git a/include/Make/Install.make b/include/Make/Install.make index cf16788..8c0007b 100644 --- a/include/Make/Install.make +++ b/include/Make/Install.make @@ -114,11 +114,6 @@ real-install: | $(INST_DIR) $(UNIX_BIN) -$(INSTALL) config.status $(INST_DIR)/config.status -$(CHMOD) -R a+rX $(INST_DIR) 2>/dev/null -ifneq ($(findstring darwin,$(ARCH)),) - @# enable OSX Help Viewer - @/bin/ln -sfh "$(INST_DIR)/docs/html" /Library/Documentation/Help/GRASS-$(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR) -endif - $(INST_DIR) $(UNIX_BIN): $(MAKE_DIR_CMD) $@ ================================================ FILE: boneyard/libgpkg.rb ================================================ require "formula" class RubyVersion19 < Requirement fatal true satisfy(:build_env => false) { %x(ruby -e 'print RUBY_VERSION').strip.to_f >= 1.9 } def message; <<~EOS Ruby >= 1.9 is required to run tests, which utilize Encoding class. Install without `--with-tests` option. EOS end end class Libgpkg < Formula homepage "https://bitbucket.org/luciad/libgpkg" url "https://bitbucket.org/luciad/libgpkg/get/0.9.15.tar.gz" sha1 "1c42c36c0fd0b043b532efe11208652f581aa52c" head "https://bitbucket.org/luciad/libgpkg", :using => :hg, :branch => "default" option "with-tests", "Run unit tests after build, prior to install" depends_on "cmake" => :build depends_on "geos" => :recommended if build.with? "tests" depends_on RubyVersion19 depends_on "ruby" => :build depends_on "bundler" => :ruby end def install args = std_cmake_args args << "-DGPKG_GEOS=ON" if build.with? "geos" args << "-DGPKG_TEST=ON" if build.with? "tests" mkdir "build" do system "cmake", "..", *args system "make" IO.popen("make test") {|io| io.each {|s| print s}} if build.with? "tests" system "make", "install" end end def caveats; <<~EOS Custom SQLite command-line shell that autoloads static GeoPackage extension: #{opt_prefix}/bin/gpkg Make sure to review Usage (extension loading) and Function Reference docs: https://bitbucket.org/luciad/libgpkg/wiki/Home EOS end end ================================================ FILE: boneyard/mapcache-12.rb ================================================ class Mapcache12 < Formula MAPSERVER = "mapserver-64" homepage "http://mapserver.org/mapcache/" url "https://github.com/mapserver/mapcache/archive/rel-1-2-1.tar.gz" sha256 "31c6c074324f609eda69743b288926c36bb23826eb6bf090f1146aaf31b59c20" version "1.2.1" option "with-tiff-cache", "Build with TIFFs as a cache backend" option "without-apache-module", "Build without Apache2 module" depends_on "cmake" => :build depends_on "pkg-config" => :build depends_on "apr" => :build if build.with? "apache-module" depends_on "libpng" depends_on "jpeg" depends_on "pcre" => :recommended depends_on "pixman" => :recommended depends_on "fcgi" depends_on "sqlite" depends_on "gdal" depends_on "geos" if build.with? "tiff-cache" depends_on "libgeotiff" depends_on "libtiff" end depends_on "berkeley-db" => :optional depends_on "memcached" => :optional depends_on MAPSERVER => :optional def install args = std_cmake_args # option(WITH_SQLITE "Use sqlite as a cache backend" ON) # option(WITH_GEOS "Choose if GEOS geometry operations support should be built in" ON) # option(WITH_OGR "Choose if OGR/GDAL input vector support should be built in" ON) # option(WITH_CGI "Choose if CGI executable should be built" ON) # option(WITH_FCGI "Choose if CGI executable should support FastCGI" ON) # Fix up .fcgi install path args << "-DCMAKE_INSTALL_CGIBINDIR=#{libexec}" # option(WITH_VERSION_STRING "Show MapCache in server version string" ON) # option(WITH_APACHE "Build Apache Module" ON) if build.with? "apache-module" args << "-DAPACHE_MODULE_DIR=#{libexec}" else args << "-DWITH_APACHE=OFF" end # option(WITH_PIXMAN "Use pixman for SSE optimized image manipulations" ON) args << "-DWWITH_PIXMAN=" + (build.with?("pixman") ? "ON" : "OFF") # option(WITH_BERKELEY_DB "Use Berkeley DB as a cache backend" OFF) args << "-DWITH_BERKELEY_DB=" + (build.with?("berkeley-db") ? "ON" : "OFF") # option(WITH_MEMCACHE "Use memcache as a cache backend (requires recent apr-util)" OFF) args << "-DWITH_MEMCACHE=" + (build.with?("memcached") ? "ON" : "OFF") # option(WITH_PCRE "Use PCRE for regex tests" OFF) args << "-DWITH_PCRE=" + (build.with?("pcre") ? "ON" : "OFF") # option(WITH_MAPSERVER "Enable (experimental) support for the mapserver library" OFF) args << "-DWITH_MAPSERVER=" + (build.with?(MAPSERVER) ? "ON" : "OFF") # option(WITH_TIFF "Use TIFFs as a cache backend" OFF) # option(WITH_TIFF_WRITE_SUPPORT "Enable (experimental) support for writable TIFF cache backends" OFF) # option(WITH_GEOTIFF "Allow GeoTIFF metadata creation for TIFF cache backends" OFF) args << "-DWITH_TIFF=" + (build.with?("tiff-cache") ? "ON" : "OFF") args << "-DWITH_GEOTIFF=" + (build.with?("tiff-cache") ? "ON" : "OFF") mkdir "build" do system "cmake", "..", *args # system "/usr/local/bin/bbedit", "CMakeCache.txt" # raise system "make" system "make", "install" end # Add config examples (prefix/"config").mkpath cp Dir["mapcache.xml*"], prefix/"config" end def caveats; <<~EOS The MapCache FCGI executable and Apache module are located in: #{libexec}/ Configuration examples are located in: #{prefix}/ EOS end end ================================================ FILE: boneyard/mapserver-64.rb ================================================ class JavaJDK < Requirement fatal true def self.home [ `/usr/libexec/java_home`.chomp!, ENV["JAVA_HOME"] ].find { |dir| dir && File.exist?("#{dir}/bin/javac") && (File.exist?("#{dir}/include" || File.exist?("#{dir}/bundle"))) } end satisfy :build_env => false do self.class.home end def message; <<~EOS Could not find a JDK (i.e. not a JRE) Do one of the following: - install a JDK that is detected with /usr/libexec/java_home - set the JAVA_HOME environment variable - specify --without-java EOS end end class Mapserver64 < Formula # TODO: audit and comapare against `mapserver` in core desc "" homepage "http://mapserver.org/" url "http://download.osgeo.org/mapserver/mapserver-6.4.3.tar.gz" sha256 "1f432d4b44e7a0e4e9ce883b02c91c9a66314123028eebb0415144903b8de9c2" # bottle do # root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" # sha256 "" => :mavericks # end head do url "https://github.com/mapserver/mapserver.git", :branch => "master" depends_on "harfbuzz" depends_on "v8" => :optional end conflicts_with "mapserver", :because => "mapserver is in main tap" option "without-php", "Build PHP MapScript module" option "without-rpath", "Don't embed rpath to installed libmapserver in modules" option "without-geos", "Build without GEOS spatial operations support" option "without-postgresql", "Build without PostgreSQL data source support" option "without-xml-mapfile", "Build with native XML mapfile support" option "with-java", "Build Java MapScript module" option "with-gd", "Build with GD support (deprecated)" unless build.head? option "with-librsvg", "Build with SVG symbology support" option "with-docs", "Download and generate HTML documentation" option "with-unit-tests", "Download and install full unit test suite" depends_on "cmake" => :build depends_on "freetype" depends_on "libpng" depends_on :python depends_on "swig" => :build depends_on JavaJDK if build.with? "java" depends_on "giflib" depends_on "gd" => :optional unless build.head? depends_on "proj" depends_on "geos" => :recommended depends_on "gdal" depends_on "postgresql" => :recommended depends_on "mysql" => :optional depends_on "fcgi" => :recommended depends_on "cairo" => :recommended depends_on "libxml2" if build.with? "xml-mapfile" or MacOS.version < :mountain_lion depends_on "libxslt" if build.with? "xml-mapfile" depends_on "librsvg" => :optional depends_on "fribidi" depends_on :python => %w[sphinx] if build.with? "docs" resource "sphinx" do url "https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.2.tar.gz" sha256 "2d3415f5b3e6b7535877f4c84fe228bdb802a8993c239b2d02c23169d67349bd" end resource "docs" do # NOTE: seems to be no tagged releases for `docs`, just active branches url "https://github.com/mapserver/docs.git", :branch => "branch-6-4" version "6.4" end resource "unittests" do url "https://github.com/mapserver/msautotest.git", :revision => "b0ba5ccbfb6b0395820f492eb5a190cf643b5ed8" version "6.4" end def png_prefix png = Formula["libpng"] (png.installed? or MacOS.version >= :mountain_lion) ? png.opt_prefix : MacOS::X11.prefix end def freetype_prefix ft = Formula["freetype"] (ft.installed? or MacOS.version >= :mountain_lion) ? ft.opt_prefix : MacOS::X11.prefix end def install # install unit tests (prefix/"msautotest").install resource("unittests") if build.with? "unit-tests" ENV.prepend_path "CMAKE_PREFIX_PATH", freetype_prefix ENV.prepend_path "CMAKE_PREFIX_PATH", png_prefix args = std_cmake_args if MacOS.prefer_64_bit? args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}" else args << "-DCMAKE_OSX_ARCHITECTURES=i386" end # defaults different than CMakeLists.txt (they don't incur extra dependencies) args.concat %W[ -DWITH_KML=ON -DWITH_CURL=ON -DWITH_CLIENT_WMS=ON -DWITH_CLIENT_WFS=ON -DWITH_SOS=ON ] args << "-DWITH_XMLMAPFILE=ON" if build.with? "xml-mapfile" args << "-DWITH_MYSQL=ON" if build.with? "mysql" args << "-DWITH_GD=ON" if build.with? "gd" && !build.head? args << "-DWITH_RSVG=ON" if build.with? "librsvg" mapscr_dir = prefix/"mapscript" mapscr_dir.mkpath rpath = %Q{-Wl,-rpath,"#{opt_prefix/"lib"}"} use_rpath = build.with? "rpath" cd "mapscript" do args << "-DWITH_PYTHON=ON" inreplace "python/CMakeLists.txt" do |s| s.gsub! "${PYTHON_SITE_PACKAGES}", %Q{"#{lib/which_python/"site-packages"}"} s.sub! "${MAPSERVER_LIBMAPSERVER}", "#{rpath} ${MAPSERVER_LIBMAPSERVER}" if use_rpath end # override language extension install locations, e.g. install to prefix/"mapscript/lang" args << "-DWITH_RUBY=ON" (mapscr_dir/"ruby").mkpath inreplace "ruby/CMakeLists.txt" do |s| s.gsub! "${RUBY_SITEARCHDIR}", %Q{"#{mapscr_dir}/ruby"} s.sub! "${MAPSERVER_LIBMAPSERVER}", "#{rpath} ${MAPSERVER_LIBMAPSERVER}" if use_rpath end if build.with? "php" args << "-DWITH_PHP=ON" (mapscr_dir/"php").mkpath inreplace "php/CMakeLists.txt" do |s| s.gsub! "${PHP5_EXTENSION_DIR}", %Q{"#{mapscr_dir}/php"} s.sub! "${MAPSERVER_LIBMAPSERVER}", "#{rpath} ${MAPSERVER_LIBMAPSERVER}" if use_rpath end end args << "-DWITH_PERL=ON" (mapscr_dir/"perl").mkpath args << "-DCUSTOM_PERL_SITE_ARCH_DIR=#{mapscr_dir}/perl" inreplace "perl/CMakeLists.txt", "${MAPSERVER_LIBMAPSERVER}", "#{rpath} ${MAPSERVER_LIBMAPSERVER}" if use_rpath if build.with? "java" args << "-DWITH_JAVA=ON" ENV["JAVA_HOME"] = JavaJDK.home (mapscr_dir/"java").mkpath inreplace "java/CMakeLists.txt" do |s| s.gsub! "DESTINATION ${CMAKE_INSTALL_LIBDIR}", %Q|${CMAKE_CURRENT_BINARY_DIR}/mapscript.jar DESTINATION "#{mapscr_dir}/java"| s.sub! "${MAPSERVER_LIBMAPSERVER}", "#{rpath} ${MAPSERVER_LIBMAPSERVER}" if use_rpath end end end mkdir "build" do system "cmake", "..", *args system "make", "install" end # install devel headers (include/"mapserver").install Dir["*.h"] prefix.install "tests" (mapscr_dir/"python").install "mapscript/python/tests" cd "mapscript" do %w[python ruby perl].each {|x|(mapscr_dir/"#{x}").install "#{x}/examples"} (mapscr_dir/"php").install "php/examples" if build.with? "php" (mapscr_dir/"java").install "java/examples" if build.with? "java" end # write install instructions for modules s = "" mapscr_opt_dir = opt_prefix/"mapscript" if build.with? "php" s += <<~EOS Using the built PHP module: * Add the following line to php.ini: extension="#{mapscr_opt_dir}/php/php_mapscript.so" * Execute "php -m" * You should see MapScript in the module list EOS end %w[ruby perl java].each do |m| if m != "java" or build.with? m cmd = [] case m when "ruby" ruby_site = %x[ruby -r rbconfig -e 'puts RbConfig::CONFIG["sitearchdir"]'].chomp cmd << "sudo cp -f mapscript.bundle #{ruby_site}/" when "perl" perl_site = %x[perl -MConfig -e 'print $Config{"sitearch"};'].chomp cmd << "sudo cp -f mapscript.pm #{perl_site}/" cmd << "sudo cp -fR auto/mapscript #{perl_site}/auto/" when "java" cmd << "sudo cp -f libjavamapscript.jnilib mapscript.jar /Library/Java/Extensions/" else end s += <<~EOS Install the built #{m.upcase} module with: cd #{mapscr_opt_dir}/#{m} #{cmd[0]} #{cmd[1] + "\n" if cmd[1]} EOS end end (mapscr_dir/"Install_Modules.txt").write s if build.with? "docs" unless which("sphinx-build") # vendor a local sphinx install sphinx_site = libexec/"lib/python2.7/site-packages" ENV.prepend_create_path "PYTHONPATH", sphinx_site resource("sphinx").stage {quiet_system "python2.7", "setup.py", "install", "--prefix=#{libexec}"} ENV.prepend_path "PATH", libexec/"bin" end resource("docs").stage do # just build the en docs inreplace "Makefile", "$(TRANSLATIONS_I18N) $(TRANSLATIONS_STATIC)", "" system "make", "html" doc.install "build/html" => "html" end end end def caveats; <<~EOS The Mapserver CGI executable is #{opt_prefix}/bin/mapserv Instructions for installing any built, but uninstalled, mapscript modules: #{opt_prefix}/mapscript/Install_Modules.txt EOS end test do mapscr_opt_dir = opt_prefix/"mapscript" system "#{bin}/mapserv", "-v" system "python", "-c", '"import mapscript"' system "ruby", "-e", "\"require '#{mapscr_opt_dir}/ruby/mapscript'\"" system "perl", "-I#{mapscr_opt_dir}/perl", "-e", '"use mapscript;"' cd "#{mapscr_opt_dir}/java/examples" do system "#{JavaJDK.home}/bin/javac", "-classpath", "../", "-Djava.ext.dirs=../", "RFC24.java" system "#{JavaJDK.home}/bin/java", "-classpath", "../", "-Djava.library.path=../", "-Djava.ext.dirs=../", "RFC24", "../../../tests/test.map" end if build.with? "java" end private def which_python "python" + %x(python -c "import sys;print(sys.version[:3])").strip end end ================================================ FILE: boneyard/minizip.rb ================================================ require 'formula' class Minizip < Formula homepage 'http://www.winimage.com/zLibDll/minizip.html' url 'http://zlib.net/zlib-1.2.8.tar.gz' sha1 'a4d316c404ff54ca545ea71a27af7dbc29817088' # version for minizip, not zlib version '1.1' option :universal depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build def patches # configure script fails to detect the right compiler when "cc" is # clang, not gcc. # see: https://github.com/Homebrew/homebrew-dupes/pull/228 # https://github.com/madler/zlib/pull/54 DATA end def install ENV.universal_binary if build.universal? system './configure', "--prefix=#{prefix}" system 'make' cd 'contrib/minizip' do # edits to statically link to libz.a inreplace 'Makefile.am' do |s| s.sub! '-L$(zlib_top_builddir)', '$(zlib_top_builddir)/libz.a' s.sub! '-version-info 1:0:0 -lz', '-version-info 1:0:0' s.sub! 'libminizip.la -lz', 'libminizip.la' end system 'autoreconf', '-fi' system './configure', "--prefix=#{prefix}" system 'make install' end end def caveats <<~EOS Minizip headers installed in 'minizip' subdirectory, since they conflict with the venerable 'unzip' library. EOS end end __END__ diff --git a/configure b/configure index b77a8a8..54f33f7 100755 --- a/configure +++ b/configure @@ -159,6 +159,7 @@ case "$cc" in esac case `$cc -v 2>&1` in *gcc*) gcc=1 ;; + *clang*) gcc=1 ;; esac show $cc -c $test.c ================================================ FILE: boneyard/openjpeg20.rb ================================================ require 'formula' class Openjpeg20 < Formula homepage 'http://www.openjpeg.org/' url 'http://openjpeg.googlecode.com/files/openjpeg-2.0.0.tar.gz' sha1 '0af78ab2283b43421458f80373422d8029a9f7a7' keg_only 'Conflicts with openjpeg in main repository.' head 'http://openjpeg.googlecode.com/svn/trunk/' depends_on 'cmake' => :build depends_on 'little-cms2' depends_on 'libtiff' depends_on "libpng" def install system 'cmake', '.', *std_cmake_args system 'make install' end end ================================================ FILE: boneyard/orfeo-32.rb ================================================ require 'formula' class Orfeo32 < Formula homepage 'http://www.orfeo-toolbox.org/otb/' url 'https://downloads.sourceforge.net/project/orfeo-toolbox/OTB/OTB-3.20/OTB-3.20.0.tgz' sha256 '0b7ae22aca430b357457b0878cf6d0c62b7a0eb27b6e3368b8012de054fd726fsha' option "with-external-boost", "Build with brewed Boost" keg_only "Older version; orfeo is in main tap and installs same components" depends_on 'cmake' => :build depends_on "boost" if build.with? "external-boost" depends_on :python => :optional depends_on 'fltk' depends_on 'gdal' depends_on 'qt' depends_on "muparser" depends_on "liblas" # support removed in v4.0, but still functional here depends_on "libkml" depends_on "minizip" depends_on "tinyxml" depends_on "fftw" => :optional # restricts built binaries to GPL license depends_on "opencv" => :optional option 'examples', 'Compile and install various examples' option 'java', 'Enable Java support' option 'patented', 'Enable patented algorithms' resource "geoid" do # geoid to use in elevation calculations, if no DEM defined or avialable url "http://hg.orfeo-toolbox.org/OTB-Data/raw-file/dec1ce83a5f3/Input/DEM/egm96.grd" sha256 "2babe341e8e04db11447e823ac0dfe4b17f37fd24c7966bb6aeab85a30d9a733" version "3.20.0" end patch do # Fix some CMake modules # Ensure external liblas_c and liblas are found on Mac # Ensure external libOpenThreads is not used unless specified; otherwise it # may use open-scene-graph's newer lib, which fails when linking with orfeo url "https://gist.github.com/dakcarto/8890690/raw/ab16c6cbaf7d214b786583f456d8839585a04fa7/orfeo-cmake-fixes.diff" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end patch do if MacOS.version >= :mavericks # Fix for forward declaration (and other issues) with clang and libc++ # See https://groups.google.com/forum/#!topic/otb-users/dRjdIxlDWfs url "https://gist.github.com/dakcarto/8930966/raw/331cca49a8e8dd579c4c19c865b17090a7433cd6/orfeo-libc-fixes.diff" sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" end end def install (libexec/"default_geoid").install resource("geoid") # gettext, libpqxx support removed in v4.0, deprecated here args = std_cmake_args + %W[ -DBUILD_APPLICATIONS=ON -DOTB_USE_EXTERNAL_FLTK=ON -DBUILD_TESTING=OFF -DOTB_USE_EXTERNAL_OPENTHREADS=OFF -DOTB_USE_GETTEXT=OFF -DOTB_USE_PQXX=OFF -DBUILD_SHARED_LIBS=ON -DOTB_WRAP_QT=ON ] args << "-DOTB_USE_EXTERNAL_BOOST=" + ((build.with? "external-boost") ? 'ON' : 'OFF') args << '-DBUILD_EXAMPLES=' + ((build.include? 'examples') ? 'ON' : 'OFF') args << '-DOTB_WRAP_JAVA=' + ((build.include? 'java') ? 'ON' : 'OFF') args << '-DOTB_USE_PATENTED=' + ((build.include? 'patented') ? 'ON' : 'OFF') args << '-DOTB_WRAP_PYTHON=OFF' if build.without? 'python' args << "-DUSE_FFTWF=" + ((build.with? "fftw") ? "ON" : "OFF") args << "-DOTB_USE_OPENCV=" + ((build.with? "opencv") ? "ON" : "OFF") mkdir 'build' do system 'cmake', '..', *args #system "bbedit", "CMakeCache.txt" #raise system 'make' system 'make install' end end end ================================================ FILE: boneyard/orfeo-40.rb ================================================ require 'formula' class Orfeo40 < Formula homepage 'http://www.orfeo-toolbox.org/otb/' # url 'https://downloads.sf.net/project/orfeo-toolbox/OTB/OTB-4.0/OTB-4.0.0.tgz' # sha1 'c2417cc4d11544fb477007e06d3a82a032353c95' url "http://hg.orfeo-toolbox.org/OTB/archive/b06793664fbc.tar.gz" sha1 "e848f43266dd5ad62f5cc455aa1cc211d6285f76" version "4.0.0" revision 1 bottle do root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" sha1 "7c81e6235c700ee17281d79a7ac647d678388c0a" => :mavericks end option "with-external-boost", "Build with brewed Boost" option "with-external-itk", "Build with brewed Insight Segmentation and Registration Toolkit" option 'examples', 'Compile and install various examples' option 'java', 'Enable Java support' option 'patented', 'Enable patented algorithms' depends_on 'cmake' => :build depends_on "boost" if build.with? "external-boost" depends_on "homebrew/science/insighttoolkit" if build.with? "external-itk" depends_on :python => :optional depends_on 'gdal' depends_on 'qt' depends_on "muparser" depends_on "libkml" depends_on "minizip" depends_on "tinyxml" depends_on "fftw" => :optional # restricts built binaries to GPL license depends_on "opencv" => :optional # external libs that may work in next release: #depends_on "open-scene-graph" # (for libOpenThreads, now internal to osg) # conflicts_with "orfeo", :because => "orfeo is in main tap" resource "geoid" do # geoid to use in elevation calculations, if no DEM defined or avialable url "http://hg.orfeo-toolbox.org/OTB-Data/raw-file/dec1ce83a5f3/Input/DEM/egm96.grd" sha1 "034ae375ff41b87d5e964f280fde0438c8fc8983" version "4.0.0" end patch :DATA def install (libexec/"default_geoid").install resource("geoid") args = std_cmake_args + %W[ -DBUILD_APPLICATIONS=ON -DBUILD_TESTING=OFF -DOTB_USE_EXTERNAL_OPENTHREADS=OFF -DBUILD_SHARED_LIBS=ON -DOTB_WRAP_QT=ON ] args << "-DOTB_USE_EXTERNAL_BOOST=" + ((build.with? "external-boost") ? 'ON' : 'OFF') args << "-DOTB_USE_EXTERNAL_ITK=" + ((build.with? "external-itk") ? 'ON' : 'OFF') args << '-DBUILD_EXAMPLES=' + ((build.include? 'examples') ? 'ON' : 'OFF') args << '-DOTB_WRAP_JAVA=' + ((build.include? 'java') ? 'ON' : 'OFF') args << '-DOTB_USE_PATENTED=' + ((build.include? 'patented') ? 'ON' : 'OFF') args << '-DOTB_WRAP_PYTHON=OFF' if build.without? 'python' args << "-DITK_USE_FFTWF=" + ((build.with? "fftw") ? "ON" : "OFF") args << "-DITK_USE_FFTWD=" + ((build.with? "fftw") ? "ON" : "OFF") args << "-DITK_USE_SYSTEM_FFTW=" + ((build.with? "fftw") ? "ON" : "OFF") args << "-DOTB_USE_OPENCV=" + ((build.with? "opencv") ? "ON" : "OFF") mkdir 'build' do system 'cmake', '..', *args #system "bbedit", "CMakeCache.txt" #raise system 'make' system 'make install' end end end __END__ diff --git a/Code/ApplicationEngine/otbWrapperApplication.h b/Code/ApplicationEngine/otbWrapperApplication.h index 4bebf08..f977d9f 100644 --- a/Code/ApplicationEngine/otbWrapperApplication.h +++ b/Code/ApplicationEngine/otbWrapperApplication.h @@ -707,7 +707,7 @@ protected: if (dynamic_cast(param)) { InputImageParameter* paramDown = dynamic_cast(param); - ret = paramDown->GetImage(); + ret = dynamic_cast(paramDown->GetImage()); } //TODO: exception if not found ? ================================================ FILE: boneyard/orfeo-42.rb ================================================ class Orfeo42 < Formula homepage "http://www.orfeo-toolbox.org/otb/" url "https://downloads.sourceforge.net/project/orfeo-toolbox/OTB/OTB-4.2.1/OTB-4.2.1.tgz" sha1 "c4f1299a2828a6f6acb81c1e022c706b7b7f10ea" bottle do root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" sha1 "55f60cff6d66ce5c82ded881def49f65a64e5d1e" => :mavericks end option "with-external-boost", "Build with brewed Boost" option "with-external-itk", "Build with brewed Insight Segmentation and Registration Toolkit" option "examples", "Compile and install various examples" option "java", "Enable Java support" option "patented", "Enable patented algorithms" depends_on "cmake" => :build depends_on "boost" if build.with? "external-boost" depends_on "homebrew/science/insighttoolkit" if build.with? "external-itk" depends_on :python => :optional depends_on "gdal" depends_on "qt" depends_on "muparser" depends_on "libkml" depends_on "minizip" depends_on "tinyxml" depends_on "fftw" => :optional # restricts built binaries to GPL license depends_on "opencv" => :optional # external libs that may work in next release: #depends on "open-scene-graph" # (for libOpenThreads, now internal to osg) # conflicts_with "orfeo", :because => "orfeo provides same functionality" conflicts_with "orfeo-40", :because => "orfeo-40 provides same functionality" conflicts_with "orfeo-32", :because => "orfeo-32 provides same functionality" resource "geoid" do # geoid to use in elevation calculations, if no DEM defined or avialable url "http://hg.orfeo-toolbox.org/OTB-Data/raw-file/dec1ce83a5f3/Input/DEM/egm96.grd" sha1 "034ae375ff41b87d5e964f280fde0438c8fc8983" version "4.0.0" end def install (libexec/"default_geoid").install resource("geoid") args = std_cmake_args + %W[ -DBUILD_APPLICATIONS=ON -DBUILD_TESTING=OFF -DOTB_USE_EXTERNAL_OPENTHREADS=OFF -DBUILD_SHARED_LIBS=ON -DOTB_WRAP_QT=ON -DCMAKE_MACOSX_RPATH=OFF ] args << "-DOTB_USE_EXTERNAL_BOOST=" + (build.with?("external-boost") ? "ON" : "OFF") args << "-DOTB_USE_EXTERNAL_ITK=" + (build.with?("external-itk") ? "ON" : "OFF") args << "-DBUILD_EXAMPLES=" + (build.include?("examples") ? "ON" : "OFF") args << "-DOTB_WRAP_JAVA=" + (build.include?("java") ? "ON" : "OFF") args << "-DOTB_USE_PATENTED=" + (build.include?("patented") ? "ON" : "OFF") args << "-DOTB_WRAP_PYTHON=OFF" if build.without? "python" args << "-DITK_USE_FFTWF=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DITK_USE_FFTWD=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DITK_USE_SYSTEM_FFTW=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DOTB_USE_OPENCV=" + (build.with?("opencv") ? "ON" : "OFF") if build.without?("external-itk") # nix @rpath prefix for install names of libs for internal ITK build inreplace "Utilities/ITK/Modules/ThirdParty/KWSys/src/CMakeLists.txt", "set(KWSYS_PROPERTIES_CXX MACOSX_RPATH 1)", "" inreplace "Utilities/ITK/CMakeLists.txt" do |s| s.sub! "project(ITK)", "project(ITK)\nset(CMAKE_MACOSX_RPATH 0)" # Don't let internal ITK conflict with linking of insighttoolkit formula s.sub! "share/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}", "\\0-orfeo" s.sub! "share/doc/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}", "\\0-orfeo" s.sub! "lib/cmake/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}", "\\0-orfeo" end end mkdir "build" do system "cmake", "..", *args # system "/usr/local/bin/bbedit", "CMakeCache.txt" # raise system "make" system "make", "install" end end end ================================================ FILE: boneyard/orfeo-54.rb ================================================ class Orfeo54 < Formula desc "Library of image processing algorithms" homepage "http://www.orfeo-toolbox.org/otb/" url "https://github.com/orfeotoolbox/OTB/archive/5.4.0.tar.gz" sha256 "d232e8099bab7d9777ab2213a8fc1bf97d6731db88dad8963aa930f2ac13e38f" revision 1 # bottle do # root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" # cellar :any # sha256 "" => :mavericks # end option "with-examples", "Compile and install various examples" option "with-java", "Enable Java support" # option "with-patented", "Enable patented algorithms" depends_on "cmake" => :build # required depends_on "boost" depends_on "homebrew/science/vtk" depends_on "homebrew/science/insighttoolkit" depends_on "libgeotiff" depends_on "ossim" depends_on "tinyxml" depends_on "open-scene-graph" # (for libOpenThreads, now internal to osg) # recommended depends_on "gdal2" => :recommended depends_on "qt" => :recommended depends_on "muparser" => :recommended depends_on "libkml" => :recommended depends_on "libsvm" => :recommended depends_on "minizip" => :recommended # optional depends_on :python => :optional depends_on "mapnik" => :optional depends_on "openjpeg" => :optional depends_on "homebrew/x11/freeglut" => :optional depends_on "fftw" => :optional # restricts built binaries to GPL license depends_on "opencv" => :optional depends_on "glew" => :optional conflicts_with "orfeo", :because => "orfeo provides same functionality" resource "geoid" do # geoid to use in elevation calculations, if no DEM defined or avialable url "https://git.orfeo-toolbox.org/otb-data.git/blob_plain/88264d17dffd4269d36a4fb93a236a915f729515:/Input/DEM/egm96.grd" sha256 "2babe341e8e04db11447e823ac0dfe4b17f37fd24c7966bb6aeab85a30d9a733" version "5.0.0" end def install (libexec/"default_geoid").install resource("geoid") args = std_cmake_args + %W[ -DOTB_BUILD_DEFAULT_MODULES=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_MACOSX_RPATH=OFF ] args << "-DBUILD_EXAMPLES=" + (build.with?("examples") ? "ON" : "OFF") # args << "-DOTB_USE_PATENTED=" + (build.with?("patented") ? "ON" : "OFF") args << "-DOTB_WRAP_JAVA=" + (build.with?("java") ? "ON" : "OFF") args << "-DOTB_WRAP_PYTHON=OFF" if build.without? "python" args << "-DITK_USE_FFTWF=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DITK_USE_FFTWD=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DITK_USE_SYSTEM_FFTW=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DOTB_USE_OPENCV=" + (build.with?("opencv") ? "ON" : "OFF") args << "-DOTB_USE_CURL=" + (build.with?("examples") ? "ON" : "OFF") args << "-DOTB_USE_GLEW=" + (build.with?("glew") ? "ON" : "OFF") # args << "-DOTB_USE_GLFW=" + (build.with?("") ? "ON" : "OFF") args << "-DOTB_USE_GLUT=" + (build.with?("freeglut") ? "ON" : "OFF") args << "-DOTB_USE_LIBKML=" + (build.with?("libkml") ? "ON" : "OFF") args << "-DOTB_USE_LIBSVM=" + (build.with?("libsvm") ? "ON" : "OFF") args << "-DOTB_USE_MAPNIK=" + (build.with?("mapnik") ? "ON" : "OFF") args << "-DOTB_USE_MUPARSER=" + (build.with?("muparser") ? "ON" : "OFF") # args << "-DOTB_USE_MUPARSERX=" + (build.with?("") ? "ON" : "OFF") args << "-DOTB_USE_OPENCV=" + (build.with?("opencv") ? "ON" : "OFF") # args << "-DOTB_USE_OPENGL=" + (build.with?("examples") ? "ON" : "OFF") args << "-DOTB_USE_OPENJPEG=" + (build.with?("openjpeg") ? "ON" : "OFF") args << "-DOTB_USE_QT4=" + (build.with?("qt") ? "ON" : "OFF") # args << "-DOTB_USE_SIFTFAST=" + (build.with?("") ? "ON" : "OFF") mkdir "build" do system "cmake", "..", *args # bbedit = "/usr/local/bin/bbedit" # cmake_config = Pathname("#{Dir.pwd}/orfeo-50_cmake-config.txt") # cmake_config.write ["cmake ..", *args].join(" \\\n") # system bbedit, cmake_config.to_s # system bbedit, "CMakeCache.txt" # raise system "make" system "make", "install" end end test do # end end ================================================ FILE: boneyard/orfeo5.rb ================================================ class Orfeo5 < Formula desc "Library of image processing algorithms" homepage "https://www.orfeo-toolbox.org/otb/" stable do url "https://github.com/orfeotoolbox/OTB/archive/5.10.1.tar.gz" sha256 "01b40747f0afba51af1aa5e696a7205c2177b0f99f5208d9db8369acc984fe39" # Patch to fix OSSIM adaptor compilation patch :DATA end bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" cellar :any rebuild 1 sha256 "d9a2e74ea28e4d2d2c87cac68852e5e96b8c31bfea682df22e196a572b24136b" => :high_sierra sha256 "d9a2e74ea28e4d2d2c87cac68852e5e96b8c31bfea682df22e196a572b24136b" => :sierra end option "without-monteverdi", "Build without Monteverdi and Mapla applications (Qt4 required)" option "with-iceviewer", "Build with ICE Viewer application (Qt4 and X11 required)" option "with-examples", "Compile and install various examples" option "with-java", "Enable Java support" depends_on "cmake" => :build # required depends_on "boost" depends_on "osgeo-vtk" depends_on "brewsci/science/insighttoolkit" depends_on "osgeo-libgeotiff" depends_on "libpng" depends_on "pcre" depends_on "openssl" depends_on "ossim@2.1" depends_on "sqlite" depends_on "tinyxml" depends_on "open-scene-graph" # (for libOpenThreads, now internal to osg) depends_on "zlib" depends_on "qwt-qt4@5.2" # recommended depends_on "muparser" => :recommended depends_on "libkml" => :recommended depends_on "libsvm" => :recommended depends_on "minizip" => :recommended # optional depends_on "python@2" => :optional depends_on "swig" if build.with? "python@2" depends_on "fftw" => :optional # restricts built binaries to GPL license depends_on "mapnik" => :optional depends_on "brewsci/science/opencv" => :optional depends_on "openjpeg" => :optional depends_on "open-mpi" => :optional depends_on "brewsci/science/shark" => :optional # ICE Viewer: needs X11 support # apparently, GLUT is not needed by Monteverdi, which uses ICE non-gui module, # but is needed for the ICE Viewer depends_on "freeglut" if build.with? "iceviewer" # Monteverdi: required deps and required/optionals shared with OTB if build.with? "monteverdi" depends_on "gdal2" depends_on "glew" depends_on "glfw" depends_on "qt-4" depends_on "qwt-qt4@5.2" else depends_on "gdal2" => :recommended depends_on "glew" => :optional depends_on "glfw" => :optional depends_on "qt-4" => :optional end resource "geoid" do # geoid to use in elevation calculations, if no DEM defined or avialable url "https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-data/raw/master/Input/DEM/egm96.grd" sha256 "2babe341e8e04db11447e823ac0dfe4b17f37fd24c7966bb6aeab85a30d9a733" version "5.0.0" end def install (libexec/"default_geoid").install resource("geoid") args = std_cmake_args + %W[ -DOTB_BUILD_DEFAULT_MODULES=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_MACOSX_RPATH=OFF -DCMAKE_CXX_STANDARD=11 -DQWT_LIB=#{Formula['qwt-qt4@5.2'].lib} -DQWT_INCLUDE_DIR=#{Formula['qwt-qt4@5.2'].include} ] ENV.cxx11 if build.with? "iceviewer" fg = Formula["freeglut"] args << "-DGLUT_INCLUDE_DIR=#{fg.opt_include}" args << "-DGLUT_glut_LIBRARY=#{fg.opt_lib}/libglut.dylib" end args << "-DBUILD_EXAMPLES=" + (build.with?("examples") ? "ON" : "OFF") # args << "-DOTB_USE_PATENTED=" + (build.with?("patented") ? "ON" : "OFF") args << "-DOTB_WRAP_JAVA=" + (build.with?("java") ? "ON" : "OFF") args << "-DOTB_WRAP_PYTHON=OFF" if build.without? "python@2" args << "-DITK_USE_FFTWF=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DITK_USE_FFTWD=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DITK_USE_SYSTEM_FFTW=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DOTB_USE_CURL=ON" args << "-DOTB_USE_GLEW=" + ((build.with?("glew") || build.with?("monteverdi")) ? "ON" : "OFF") args << "-DOTB_USE_GLFW=" + ((build.with?("glfw") || build.with?("monteverdi")) ? "ON" : "OFF") args << "-DOTB_USE_GLUT=" + (build.with?("iceviewer") ? "ON" : "OFF") args << "-DOTB_USE_LIBKML=" + (build.with?("libkml") ? "ON" : "OFF") args << "-DOTB_USE_LIBSVM=" + (build.with?("libsvm") ? "ON" : "OFF") args << "-DOTB_USE_MAPNIK=" + (build.with?("mapnik") ? "ON" : "OFF") args << "-DOTB_USE_MUPARSER=" + (build.with?("muparser") ? "ON" : "OFF") # args << "-DOTB_USE_MUPARSERX=" + (build.with?("") ? "ON" : "OFF") args << "-DOTB_USE_OPENCV=" + (build.with?("opencv") ? "ON" : "OFF") args << "-DOTB_USE_OPENGL=" + ((build.with?("examples") || build.with?("iceviewer") || build.with?("monteverdi")) ? "ON" : "OFF") args << "-DOTB_USE_MPI=" + (build.with?("mpi") ? "ON" : "OFF") args << "-DOTB_USE_OPENJPEG=" + (build.with?("openjpeg") ? "ON" : "OFF") args << "-DOTB_USE_QT4=" + ((build.with?("qt-4") || build.with?("monteverdi")) ? "ON" : "OFF") args << "-DOTB_USE_QWT=" + ((build.with?("qt-4") || build.with?("monteverdi")) ? "ON" : "OFF") args << "-DOTB_USE_SIFTFAST=ON" args << "-DOTB_USE_SHARK=" + (build.with?("brewsci/science/shark") ? "ON" : "OFF") mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" end # clean up any unneeded otbgui script wrappers rm_f Dir["#{bin}/otbgui*"] unless (bin/"otbgui").exist? # make env-wrapped command line utility launcher scripts envars = { :GDAL_DATA => "#{Formula["gdal2"].opt_share}/gdal", :OTB_APPLICATION_PATH => "#{opt_lib}/otb/applications", } bin.env_script_all_files(libexec/"bin", envars) end def caveats; <<~EOS The default geoid to use in elevation calculations is available in: #{opt_libexec}/default_geoid/egm96.grd EOS end test do puts "Testing CLI wrapper" out = `#{opt_bin}/otbcli 2>&1` assert_match "module_name [MODULEPATH] [arguments]", out puts "Testing Rescale CLI app" out = `#{opt_bin}/otbcli_Rescale 2>&1` assert_match "Rescale the image between two given values", out if (opt_bin/"otbgui").exist? puts "Testing Qt GUI wrapper" out = `#{opt_bin}/otbgui 2>&1` assert_match "module_name [module_path]", out end end end __END__ diff --git a/Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx b/Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx index d20e208..92796dd 100644 --- a/Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx +++ b/Modules/Adapters/OSSIMAdapters/src/otbRPCSolverAdapter.cxx @@ -109,7 +109,8 @@ RPCSolverAdapter::Solve(const GCPsContainerType& gcpContainer, rmsError = rpcSolver->getRmsError(); // Retrieve the output RPC projection - ossimRefPtr rpcProjection = dynamic_cast(rpcSolver->createRpcProjection()->getProjection()); + ossimRefPtr outputProj = dynamic_cast(rpcSolver->createRpcProjection()); + ossimRefPtr rpcProjection = dynamic_cast(outputProj->getProjection()); // Export the sensor model in an ossimKeywordlist ossimKeywordlist geom_kwl; ================================================ FILE: boneyard/orfeo5@5.4.rb ================================================ class Orfeo5AT54 < Formula desc "Library of image processing algorithms" homepage "http://www.orfeo-toolbox.org/otb/" url "https://github.com/orfeotoolbox/OTB/archive/5.4.0.tar.gz" sha256 "d232e8099bab7d9777ab2213a8fc1bf97d6731db88dad8963aa930f2ac13e38f" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" sha256 "41187da6cafbc580f1eb05d75f3491581cc53903d87d2e24052abc07d708ec9e" => :sierra end keg_only "to avoid conflict with newer OTB installs" option "with-iceviewer", "Build with ICE Viewer application (Qt4 and X11 required)" option "with-examples", "Compile and install various examples" option "with-java", "Enable Java support" # option "with-patented", "Enable patented algorithms" depends_on "cmake" => :build # required depends_on "boost" depends_on "osgeo-vtk" depends_on "brewsci/science/insighttoolkit" depends_on "osgeo-libgeotiff" depends_on "libpng" depends_on "pcre" depends_on "openssl" depends_on "ossim@2.1" depends_on "sqlite" depends_on "tinyxml" depends_on "open-scene-graph" # (for libOpenThreads, now internal to osg) depends_on "zlib" # recommended depends_on "muparser" => :recommended depends_on "libkml" => :recommended depends_on "libsvm" => :recommended depends_on "minizip" => :recommended # optional depends_on "python@2" => :optional depends_on "swig" if build.with? "python@2" depends_on "fftw" => :optional # restricts built binaries to GPL license depends_on "mapnik" => :optional depends_on "brewsci/science/opencv" => :optional depends_on "openjpeg" => :optional # ICE Viewer: needs X11 support if build.with? "iceviewer" depends_on "freeglut" depends_on "gdal2" depends_on "glew" depends_on "glfw" depends_on "qt-4" else depends_on "gdal2" => :recommended depends_on "glew" => :optional depends_on "glfw" => :optional depends_on "qt-4" => :optional end resource "geoid" do # geoid to use in elevation calculations, if no DEM defined or avialable url "https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb-data/raw/master/Input/DEM/egm96.grd" sha256 "2babe341e8e04db11447e823ac0dfe4b17f37fd24c7966bb6aeab85a30d9a733" version "5.0.0" end def install (libexec/"default_geoid").install resource("geoid") args = std_cmake_args + %w[ -DOTB_BUILD_DEFAULT_MODULES=ON -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_MACOSX_RPATH=OFF ] if build.with? "iceviewer" fg = Formula["freeglut"] args << "-DGLUT_INCLUDE_DIR=#{fg.opt_include}" args << "-DGLUT_glut_LIBRARY=#{fg.opt_lib}/libglut.dylib" end args << "-DBUILD_EXAMPLES=" + (build.with?("examples") ? "ON" : "OFF") # args << "-DOTB_USE_PATENTED=" + (build.with?("patented") ? "ON" : "OFF") args << "-DOTB_WRAP_JAVA=" + (build.with?("java") ? "ON" : "OFF") args << "-DOTB_WRAP_PYTHON=OFF" if build.without? "python@2" args << "-DITK_USE_FFTWF=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DITK_USE_FFTWD=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DITK_USE_SYSTEM_FFTW=" + (build.with?("fftw") ? "ON" : "OFF") args << "-DOTB_USE_OPENCV=" + (build.with?("opencv") ? "ON" : "OFF") args << "-DOTB_USE_CURL=ON" args << "-DOTB_USE_GLEW=" + (build.with?("glew") || build.with?("iceviewer") ? "ON" : "OFF") args << "-DOTB_USE_GLFW=" + (build.with?("glfw") || build.with?("iceviewer") ? "ON" : "OFF") args << "-DOTB_USE_GLUT=" + (build.with?("iceviewer") ? "ON" : "OFF") args << "-DOTB_USE_LIBKML=" + (build.with?("libkml") ? "ON" : "OFF") args << "-DOTB_USE_LIBSVM=" + (build.with?("libsvm") ? "ON" : "OFF") args << "-DOTB_USE_MAPNIK=" + (build.with?("mapnik") ? "ON" : "OFF") args << "-DOTB_USE_MUPARSER=" + (build.with?("muparser") ? "ON" : "OFF") # args << "-DOTB_USE_MUPARSERX=" + (build.with?("") ? "ON" : "OFF") args << "-DOTB_USE_OPENCV=" + (build.with?("opencv") ? "ON" : "OFF") args << "-DOTB_USE_OPENGL=" + (build.with?("examples") || build.with?("iceviewer") ? "ON" : "OFF") args << "-DOTB_USE_OPENJPEG=" + (build.with?("openjpeg") ? "ON" : "OFF") args << "-DOTB_USE_QT4=" + (build.with?("qt-4") || build.with?("iceviewer") ? "ON" : "OFF") args << "-DOTB_USE_SIFTFAST=ON" mkdir "build" do system "cmake", "..", *args # bbedit = "/usr/local/bin/bbedit" # cmake_config = Pathname("#{Dir.pwd}/orfeo5@5.4_cmake-config.txt") # cmake_config.write ["cmake ..", *args].join(" \\\n") # system bbedit, cmake_config.to_s # system bbedit, "CMakeCache.txt" # raise system "make" system "make", "install" end # clean up any unneeded otbgui script wrappers unless (bin/"otbgui").exist? rm_f Dir["#{bin}/otbgui*"] end # make env-wrapped command line utility launcher scripts envars = { :GDAL_DATA => "#{Formula["gdal2"].opt_share}/gdal", :OTB_APPLICATION_PATH => "#{opt_lib}/otb/applications", } bin.env_script_all_files(libexec/"bin", envars) end def caveats; <<~EOS The default geoid to use in elevation calculations is available in: #{opt_libexec}/default_geoid/egm96.grd EOS end test do puts "Testing CLI wrapper" out = `#{opt_bin}/otbcli 2>&1` assert_match "module_name [MODULEPATH] [arguments]", out puts "Testing Rescale CLI app" out = `#{opt_bin}/otbcli_Rescale 2>&1` assert_match "Rescale the image between two given values", out if (opt_bin/"otbgui").exist? puts "Testing Qt GUI wrapper" out = `#{opt_bin}/otbgui 2>&1` assert_match "module_name [module_path]", out end end end ================================================ FILE: boneyard/osgearth-qt4.rb ================================================ class OsgearthQt4 < Formula desc "Geospatial SDK and terrain engine for OpenSceneGraph" homepage "http://osgearth.org" url "https://github.com/gwaldron/osgearth.git", :branch => "2.7", :commit => "dda0f0a92cedc83d6d40ed69cfb01140008f9911" version "2.7.0" # QGIS Globe Plugin does not support a larger version than OSGearh v2.7. # revision 1 head "https://github.com/gwaldron/osgearth.git", :branch => "master" bottle do root_url "https://dl.bintray.com/homebrew-osgeo/osgeo-bottles" sha256 "7080cdc8b0da8e250cc48fc3288236ed0366ad7beca38a638fca358a5986e551" => :mojave sha256 "7080cdc8b0da8e250cc48fc3288236ed0366ad7beca38a638fca358a5986e551" => :high_sierra sha256 "7080cdc8b0da8e250cc48fc3288236ed0366ad7beca38a638fca358a5986e551" => :sierra end # The OSGearth 2.7 version is not being built with GDAL 2.x. patch :DATA option "without-minizip", "Build without Google KMZ file access support" option "with-v8", "Build with Google's V8 JavaScript engine support" option "with-tinyxml", "Use external libtinyxml, instead of internal" option "with-docs-examples", "Build and install html documentation and examples" depends_on "cmake" => :build # depends_on "gdal2" depends_on "sqlite" depends_on "qt-4" depends_on "minizip" => :recommended depends_on "v8" => :optional depends_on "tinyxml" => :optional if (build.with? "docs-examples") && (!which("sphinx-build")) # temporarily vendor a local sphinx install sphinx_dir = prefix/"sphinx" sphinx_site = sphinx_dir/"lib/python#{py_ver}/site-packages" sphinx_site.mkpath ENV.prepend_create_path "PYTHONPATH", sphinx_site resource("Sphinx").stage { quiet_system "python#{py_ver}", "setup.py", "install", "--prefix=#{sphinx_dir}" } ENV.prepend_path "PATH", sphinx_dir/"bin" end def install if (build.with? "docs-examples") && (!which("sphinx-build")) # temporarily vendor a local sphinx install sphinx_dir = prefix/"sphinx" sphinx_site = sphinx_dir/"lib/python2.7/site-packages" sphinx_site.mkpath ENV.prepend_create_path "PYTHONPATH", sphinx_site resource("sphinx").stage { quiet_system "python2.7", "setup.py", "install", "--prefix=#{sphinx_dir}" } ENV.prepend_path "PATH", sphinx_dir/"bin" end args = std_cmake_args args << "-DOSGEARTH_USE_QT=OFF" args << "-DWITH_EXTERNAL_TINYXML=ON" if build.with? "tinyxml" # v8 and minizip options should have empty values if not defined '--with' if build.without? "v8" args << "-DV8_INCLUDE_DIR=''" << "-DV8_BASE_LIBRARY=''" << "-DV8_SNAPSHOT_LIBRARY=''" args << "-DV8_ICUI18N_LIBRARY=''" << "-DV8_ICUUC_LIBRARY=''" end # define libminizip paths (skips the only pkconfig dependency in cmake modules) mzo = Formula["minizip"].opt_prefix args << "-DMINIZIP_INCLUDE_DIR=#{(build.with? "minizip") ? mzo/"include/minizip" : "''"}" args << "-DMINIZIP_LIBRARY=#{(build.with? "minizip") ? mzo/"lib/libminizip.dylib" : "''"}" mkdir "build" do system "cmake", "..", *args system "make", "install" end if build.with? "docs-examples" cd "docs" do system "make", "html" doc.install "build/html" => "html" end doc.install "data" doc.install "tests" => "examples" rm_r prefix/"sphinx" if File.exist?(prefix/"sphinx") end end def caveats osg = Formula["open-scene-graph"] osgver = (osg.linked_keg.exist?) ? osg.version : "#.#.# (version)" <<~EOS This formula installs Open Scene Graph plugins. To ensure access when using the osgEarth toolset, set the OSG_LIBRARY_PATH enviroment variable to: #{HOMEBREW_PREFIX}/lib/osgPlugins-#{osgver} EOS end test do system "#{bin}/osgearth_version" end end __END__ --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,7 +117,7 @@ FIND_PACKAGE(OpenGL) FIND_PACKAGE(CURL) -FIND_PACKAGE(GDAL) +# FIND_PACKAGE(GDAL) FIND_PACKAGE(GEOS) FIND_PACKAGE(Sqlite3) FIND_PACKAGE(ZLIB) ================================================ FILE: boneyard/osgearth.rb ================================================ require "formula" class Osgearth < Formula homepage "http://osgearth.org" url "https://github.com/gwaldron/osgearth/archive/osgearth-2.5.tar.gz" sha1 "97ed0075422c3efcb7b958f89ae02b32d670c48e" head "https://github.com/gwaldron/osgearth.git", :branch => "master" option "without-minizip", "Build without Google KMZ file access support" option "with-v8", "Build with Google's V8 JavaScript engine support" option "with-libnoise", "Build with coherent noise-generating terrain support" option "with-tinyxml", "Use external libtinyxml, instead of internal" option "with-docs-examples", "Build and install html documentation and examples" depends_on "cmake" => :build depends_on "open-scene-graph" depends_on "gdal" depends_on "sqlite" depends_on "qt" => :recommended depends_on "minizip" => :recommended depends_on "v8" => :optional depends_on "libnoise" => :optional depends_on "tinyxml" => :optional resource "sphinx" do url "https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.1.tar.gz" sha1 "448cdb89d96c85993e01fe793ce7786494cbcda7" end # all merged upstream, remove on next version # find a v8 lib: https://github.com/gwaldron/osgearth/pull/434 # find JavaScriptCore lib: https://github.com/gwaldron/osgearth/pull/435 # find libnoise lib: https://github.com/gwaldron/osgearth/pull/436 def patches DATA end def install if build.with? "docs-examples" and not which("sphinx-build") # temporarily vendor a local sphinx install sphinx_dir = prefix/"sphinx" sphinx_site = sphinx_dir/"lib/python2.7/site-packages" sphinx_site.mkpath ENV.prepend_create_path "PYTHONPATH", sphinx_site resource("sphinx").stage {quiet_system "python2.7", "setup.py", "install", "--prefix=#{sphinx_dir}"} ENV.prepend_path "PATH", sphinx_dir/"bin" end args = std_cmake_args if MacOS.prefer_64_bit? args << "-DCMAKE_OSX_ARCHITECTURES=#{Hardware::CPU.arch_64_bit}" else args << "-DCMAKE_OSX_ARCHITECTURES=i386" end args << "-DOSGEARTH_USE_QT=OFF" if build.without? "qt" args << "-DWITH_EXTERNAL_TINYXML=ON" if build.with? "tinyxml" # v8, noise and minizip options should have empty values if not defined '--with' if build.without? "v8" args << "-DV8_INCLUDE_DIR=''" << "-DV8_BASE_LIBRARY=''" << "-DV8_SNAPSHOT_LIBRARY=''" args << "-DV8_ICUI18N_LIBRARY=''" << "-DV8_ICUUC_LIBRARY=''" end args << "-DLIBNOISE_INCLUDE_DIR=''" << "-DLIBNOISE_LIBRARY=''" if build.without? "libnoise" # define libminizip paths (skips the only pkconfig dependency in cmake modules) mzo = Formula.factory("minizip").opt_prefix args << "-DMINIZIP_INCLUDE_DIR=#{(build.with? "minizip") ? mzo/"include/minizip" : "''"}" args << "-DMINIZIP_LIBRARY=#{(build.with? "minizip") ? mzo/"lib/libminizip.dylib" : "''"}" mkdir "build" do system "cmake", "..", *args system "make", "install" end if build.with? "docs-examples" cd "docs" do system "make", "html" doc.install "build/html" => "html" end doc.install "data" doc.install "tests" => "examples" rm_r prefix/"sphinx" if File.exist?(prefix/"sphinx") end end def caveats osg = Formula.factory("open-scene-graph") osgver = (osg.linked_keg.exist?) ? osg.version : "#.#.# (version)" <<~EOS This formula installs Open Scene Graph plugins. To ensure access when using the osgEarth toolset, set the OSG_LIBRARY_PATH enviroment variable to: #{HOMEBREW_PREFIX}/lib/osgPlugins-#{osgver} EOS end test do system "#{bin}/osgearth_version" end end __END__ diff --git a/CMakeModules/FindV8.cmake b/CMakeModules/FindV8.cmake index 9f5684d..94cf4c4 100644 --- a/CMakeModules/FindV8.cmake +++ b/CMakeModules/FindV8.cmake @@ -21,7 +21,7 @@ FIND_PATH(V8_INCLUDE_DIR v8.h ) FIND_LIBRARY(V8_BASE_LIBRARY - NAMES v8_base v8_base.ia32 libv8_base + NAMES v8_base v8_base.ia32 v8_base.x64 libv8_base PATHS ${V8_DIR} ${V8_DIR}/lib @@ -40,7 +40,7 @@ FIND_LIBRARY(V8_BASE_LIBRARY ) FIND_LIBRARY(V8_BASE_LIBRARY_DEBUG - NAMES v8_base v8_base.ia32 libv8_base + NAMES v8_base v8_base.ia32 v8_base.x64 libv8_base PATHS ${V8_DIR} ${V8_DIR}/lib diff --git a/CMakeModules/FindJavaScriptCore.cmake b/CMakeModules/FindJavaScriptCore.cmake index 1bca250..3877cd5 100644 --- a/CMakeModules/FindJavaScriptCore.cmake +++ b/CMakeModules/FindJavaScriptCore.cmake @@ -21,7 +21,7 @@ FIND_PATH(JAVASCRIPTCORE_INCLUDE_DIR JavaScriptCore.h ) FIND_LIBRARY(JAVASCRIPTCORE_LIBRARY - NAMES libJavaScriptCore + NAMES libJavaScriptCore JavaScriptCore PATHS ${JAVASCRIPTCORE_DIR} ${JAVASCRIPTCORE_DIR}/lib diff --git a/CMakeModules/FindLibNoise.cmake b/CMakeModules/FindLibNoise.cmake index 99d006b..0051b51 100644 --- a/CMakeModules/FindLibNoise.cmake +++ b/CMakeModules/FindLibNoise.cmake @@ -43,7 +43,7 @@ FIND_LIBRARY(LIBNOISE_LIBRARY ) FIND_LIBRARY(LIBNOISE_LIBRARY - NAMES libnoise + NAMES libnoise noise PATHS ~/Library/Frameworks /Library/Frameworks ================================================ FILE: boneyard/osgeo-proj@5.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_proj_linked } def core_proj_linked Formula["proj"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoProjAT5 < Formula desc "Cartographic Projections Library" homepage "https://proj4.org/" url "https://github.com/OSGeo/proj.4/archive/5.2.0.tar.gz" sha256 "d784d51a8e56282123eb5918a2c685ed7da5097595afcacf5fa0246337a44361" bottle do root_url "https://bottle.download.osgeo.org" sha256 "623b42fc026ca183a93ecc14e7db9ecc1cf30a729e15cad255d025268088d5d7" => :mojave sha256 "623b42fc026ca183a93ecc14e7db9ecc1cf30a729e15cad255d025268088d5d7" => :high_sierra sha256 "bd9c8607cc813b32b7c956b349ff1235519323deb710fb0d8a1232eab83b6d6b" => :sierra end # revision 1 head "https://github.com/OSGeo/proj.4.git", :branch => "master" keg_only :versioned_formula # we will verify that other versions are not linked depends_on Unlinked depends_on "pkg-config" => :build depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build conflicts_with "blast", :because => "both install a `libproj.a` library" skip_clean :la # The datum grid files are required to support datum shifting resource "datumgrid" do url "https://download.osgeo.org/proj/proj-datumgrid-1.8.zip" sha256 "b9838ae7e5f27ee732fb0bfed618f85b36e8bb56d7afb287d506338e9f33861e" end def install (buildpath/"nad").install resource("datumgrid") system "./autogen.sh" system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" system "make", "install" end test do (testpath/"test").write <<~EOS 45d15n 71d07w Boston, United States 40d40n 73d58w New York, United States 48d51n 2d20e Paris, France 51d30n 7'w London, England EOS match = <<~EOS -4887590.49\t7317961.48 Boston, United States -5542524.55\t6982689.05 New York, United States 171224.94\t5415352.81 Paris, France -8101.66\t5707500.23 London, England EOS output = shell_output("#{bin}/proj +proj=poly +ellps=clrk66 -r #{testpath}/test") assert_equal match, output end end ================================================ FILE: boneyard/osgeo-pyqt.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_pyqt_linked } def core_pyqt_linked Formula["pyqt"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoPyqt < Formula desc "Python bindings for v5 of Qt" homepage "https://www.riverbankcomputing.com/software/pyqt/download5" url "https://files.pythonhosted.org/packages/4d/81/b9a66a28fb9a7bbeb60e266f06ebc4703e7e42b99e3609bf1b58ddd232b9/PyQt5-5.14.2.tar.gz" sha256 "bd230c6fd699eabf1ceb51e13a8b79b74c00a80272c622427b80141a22269eb0" bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "d12d8f3633c20c53d850fa7618003deffcfd643bf2ce300597ad77225c1a21c7" => :catalina sha256 "d12d8f3633c20c53d850fa7618003deffcfd643bf2ce300597ad77225c1a21c7" => :mojave sha256 "d12d8f3633c20c53d850fa7618003deffcfd643bf2ce300597ad77225c1a21c7" => :high_sierra end # revision 5 # keg_only "pyqt" is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "python" depends_on "osgeo-sip" depends_on "qt" depends_on "dbus" => :optional def install version = Language::Python.major_minor_version "python3" ENV["PYTHONPATH"] = lib/"python#{version}/site-packages" args = ["--confirm-license", "--bindir=#{bin}", "--destdir=#{lib}/python#{version}/site-packages", "--stubsdir=#{lib}/python#{version}/site-packages/PyQt5", "--sipdir=#{share}/sip/PyQt5", # Qt5 # sip.h could not be found automatically "--sip-incdir=#{Formula["osgeo-sip"].opt_include}", "--qmake=#{Formula["qt"].bin}/qmake", # Force deployment target to avoid libc++ issues "QMAKE_MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}", "--designer-plugindir=#{pkgshare}/plugins", "--qml-plugindir=#{pkgshare}/plugins", "--verbose", "--sip=#{Formula["osgeo-sip"].opt_bin}/sip", # ERROR: Unknown module(s) in QT "--disable=QtWebKit", "--disable=QtWebKitWidgets", "--disable=QAxContainer", "--disable=QtX11Extras", "--disable=QtWinExtras", "--disable=Enginio", "--no-dist-info" ] system "python3", "configure.py", *args system "make" # system "make", "install" ENV.deparallelize { system "make", "install" } system "make", "clean" end test do system "#{bin}/pyuic5", "--version" system "#{bin}/pylupdate5", "-version" version = Language::Python.major_minor_version "python3" ENV["PYTHONPATH"] = lib/"python#{version}/site-packages" system "python3", "-c", '"import PyQt5"' system "python3", "-c", '"import PyQt5.QtGui"' system "python3", "-c", '"import PyQt5.QtLocation"' system "python3", "-c", '"import PyQt5.QtMultimedia"' system "python3", "-c", '"import PyQt5.QtNetwork"' system "python3", "-c", '"import PyQt5.QtQuick"' system "python3", "-c", '"import PyQt5.QtSvg"' system "python3", "-c", '"import PyQt5.QtWidgets"' system "python3", "-c", '"import PyQt5.QtXml"' end end ================================================ FILE: boneyard/osgeo-qgis-ltr.rb ================================================ ################################################################################ # Maintainer: FJ Perini @fjperini # Collaborator: Luis Puerto @luispuerto ################################################################################ class UnlinkedQGIS < Requirement fatal true satisfy(:build_env => false) { !qt4_linked && !pyqt4_linked && !txt2tags_linked } def qt4_linked (Formula["qt-4"].linked_keg/"lib/QtCore.framework/Versions/4").exist? rescue return false end def pyqt4_linked (Formula["pyqt-qt4"].linked_keg/"lib/qt-4/python2.7/site-packages/PyQt4").exist? rescue return false end def txt2tags_linked Formula["txt2tags"].linked_keg.exist? rescue return false end def message s = "Compilation can fail if these formulae are installed and linked:\n\n" s += "Unlink with `brew unlink qt-4` or remove with `brew uninstall qt-4`\n" if qt4_linked s += "Unlink with `brew unlink pyqt-qt4` or remove with `brew uninstall pyqt-qt4`\n" if pyqt4_linked s += "Unlink with `brew unlink txt2tags` or remove with `brew uninstall txt2tags`\n" if txt2tags_linked s end end class OsgeoQgisLtr < Formula desc "Open Source Geographic Information System" homepage "https://www.qgis.org" url "https://github.com/qgis/QGIS/archive/final-3_4_9.tar.gz" sha256 "bfdc8442e12e1f7521beaf6eb41f9d0cb3aba13ea0f649cb315444cdbc480cd8" # version "3.4.9" # revision 1 bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "741f70d5bff7420a445b129b677dabff7f9e47a54ae2634e767e98acf3c5199b" => :mojave sha256 "741f70d5bff7420a445b129b677dabff7f9e47a54ae2634e767e98acf3c5199b" => :high_sierra sha256 "709f5dc7ae4c284e25185c1ae8353fdd5e885bae5484be02f4250e6105d13e5f" => :sierra end head "https://github.com/qgis/QGIS.git", :branch => "master" # fix FindQsci and FindPyQt5 patch :DATA def pour_bottle? brewed_python? end option "without-debug", "Disable debug build, which outputs info to system.log or console" option "without-ninja", "Disable use of ninja CMake generator" option "without-server", "Build without QGIS Server (qgis_mapserv.fcgi)" option "without-postgresql", "Build without current PostgreSQL client" option "without-pyqt5-webkit", "Build without webkit python bindings" option "without-qgis-res", "Build without QGIS Resources support" option "with-api-docs", "Build the API documentation with Doxygen and Graphviz" option "with-isolation", "Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs" option "with-mssql", "Build with Microsoft ODBC Driver for SQL Server" option "with-oracle", "Build extra Oracle geospatial database and raster support" option "with-pg10", "Build with PostgreSQL 10 client" # option "with-globe", "Build with Globe plugin, based upon osgEarth" # Build with 3D Map View panel # Build with GPSBabel. Read, write and manipulate GPS waypoints in a variety of formats # Build with GRASS 7 integration plugin and Processing plugin support (or install grass-7x first) # Build with LAStools, efficient tools for LiDAR processing. Contains LASlib, a C++ programming API for reading / writing LIDAR data stored in standard LAS format. # Build extra Orfeo Toolbox for Processing plugin # Build QSpatialite Qt database driver # Build extra R for Processing plugin # Build extra Saga GIS (LTS) for Processing plugin # Build with QGIS Server (qgis_mapserv.fcgi) # Build with TauDEM, Terrain Analysis Using Digital Elevation Models for hydrology # Build with Whitebox Tools, an advanced geospatial data analysis platform deprecated_option "with-saga-gis-lts" => "with-saga" deprecated_option "with-postgresql10" => "with-pg10" depends_on UnlinkedQGIS # required depends_on "cmake" => :build depends_on "ninja" => [:build, :recommended] depends_on "gsl" => :build # Georeferencer plugin depends_on "six" => [:build, :recommended] depends_on "osgeo-sip" => [:build, :recommended] depends_on "bison" => :build depends_on "flex" => :build depends_on "pkg-config" => :build depends_on "python" depends_on "osgeo-gdal-python" # gdal - core providers depends_on "libzip" depends_on "osgeo-qscintilla2" depends_on "qca" depends_on "qt" depends_on "osgeo-pyqt" depends_on "osgeo-pyqt-webkit" # qt5-webkit depends_on "osgeo-qtkeychain" depends_on "qwt" depends_on "spatialindex" depends_on "sqlite" depends_on "expat" depends_on "osgeo-proj" depends_on "hdf5" depends_on "geos" depends_on "libtasn1" depends_on "osgeo-libspatialite" depends_on "qwtpolar" depends_on "desktop-file-utils" depends_on "hicolor-icon-theme" # recommended depends_on "openssl" depends_on "qjson" depends_on "unixodbc" # depends_on "libiodbc" depends_on "freetds" depends_on "osgeo-psqlodbc" depends_on "libpq" depends_on "osgeo-postgis" depends_on "exiv2" depends_on "osgeo-liblas" depends_on "osgeo-netcdf" depends_on "osgeo-pdal" depends_on "szip" depends_on "openvpn" depends_on "curl" depends_on "libiconv" depends_on "poppler" depends_on "gnu-sed" depends_on "git" depends_on "libxml2" depends_on "libffi" depends_on "numpy" depends_on "scipy" depends_on "osgeo-matplotlib" if build.with?("api-docs") depends_on "graphviz" => :build depends_on "doxygen" => :build end # requires python modules # jinja - MetaSearch # numpy - Processing # owslib - MetaSearch # psycopg2 - DB Manager and Processing # pygments - MetaSearch # yaml - Processing # many useful modules are incorporated depends_on "osgeo-qgis-res" # fcgi - server depends_on "fcgi" depends_on "spawn-fcgi" depends_on "lighttpd" # core plugins (c++ and python # grass depends_on "osgeo-grass" depends_on "gettext" depends_on "gpsbabel" # GPS Tools plugin # the Globe Plugin for QGIS 3 is still not available, # only for QGIS 2 and it does not support a larger version than OSGearh v2.7. # working on the implementation # if build.with? "globe" # depends_on "osgeo-openscenegraph" # depends_on "osgeo-osgqt" # depends_on "osgeo-osgearth" # end # TODO: remove "pyspatialite" when PyPi package supports spatialite 4.x # or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite) # TODO: what to do for Py3 and pyspatialite? depends_on "osgeo-pyspatialite" # for DB Manager # use newer postgresql client than Apple's, also needed by `psycopg2` if build.with?("pg10") depends_on "osgeo-postgresql@10" else depends_on "osgeo-postgresql" end depends_on "osgeo-oracle-client-sdk" if build.with?("oracle") # TODO: add MSSQL third-party support formula?, :optional if build.with?("mssql") depends_on "microsoft/mssql-release/msodbcsql17" depends_on "microsoft/mssql-release/mssql-tools" end depends_on "osgeo-qt-psql" depends_on "osgeo-qt-odbc" depends_on "osgeo-qt-mysql" # for eVis plugin # depends_on "osgeo-qt-tds" # obsolete from Qt 4.7 # depends_on "osgeo-qt-oci" # from oracle-client-sdk? # core processing plugin extras # see `grass` above depends_on "osgeo-orfeo" depends_on "osgeo-saga-lts" depends_on "osgeo-whitebox-tools" depends_on "osgeo-lastools" depends_on "osgeo-taudem" # R with more support # https://github.com/adamhsparks/setup_macOS_for_R # fix: will not build if the R version does not match # If you installed sethrfore/r-srf/r, before installing # rename "/usr/local/opt/r" to "/usr/local/Cellar/r-bk" # and then restore it after installing qgis depends_on "r" # optional # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools) # TODO: Fusion from USFS (via `wine`?) # R Plugin resource "r" do url "https://github.com/north-road/qgis-processing-r/archive/51371402c0200b6649fa3daa8ca8067e83aa6c15.tar.gz" sha256 "f6309e1edc334f76938f46a396c71e986b1910dd8c4c58936cad8d7fad54a346" version "1.0.5" end # OTB Plugin unless build.head? resource "otb" do url "https://gitlab.orfeo-toolbox.org/orfeotoolbox/qgis-otb-plugin/-/archive/d5e8f0a2e11e9d1d5b28f1a0d1f9af1a4985b477/qgis-otb-plugin-d5e8f0a2e11e9d1d5b28f1a0d1f9af1a4985b477.tar.gz" sha256 "939b89065604c10ee3a1b61f186e494f8e734aae1856547a32b1cb296dc4895b" version "1.4.2" end # # Patch: OtbUtils # resource "OtbUtils" do # url "https://gist.githubusercontent.com/fjperini/dc45ed0f637ae7dc8ec543a701e012f6/raw/c2b6bbafd6a9439bba903403f14c1b3c1ec3683d/OtbUtils.diff" # sha256 "b02c2fba5751dea84284072c590ce969ef215bb54e06cc2043ccbaf4449189e5" # end # # Patch: OtbAlgorithmProvider # resource "OtbAlgorithmProvider" do # url "https://gist.githubusercontent.com/fjperini/d8fe440818814c0800e5071a0ccb4f70/raw/034e1dc2950749fcf70b2fd2925df11aa6deaae3/OtbAlgorithmProvider.diff" # sha256 "add76b970cee0c42bd56af50da1f77e1a214ae8912e6b8e3da6e82611ecc30b5" # end end # WhiteboxTools Plugin resource "whitebox" do url "https://github.com/alexbruy/processing-whitebox/archive/5cbd81240e2a4e08fa0df515bf3dbf11957998ea.tar.gz" sha256 "4ccf112dae81447842ccaa08a86d3c5fa12b0a1087e8dc485723a5c8737ebbd9" version "0.9.0" end # Patch: whiteboxProvider resource "whiteboxProvider" do url "https://gist.githubusercontent.com/fjperini/fcb9f964c5396ab8b72c874a8db41b1d/raw/154deb8f17d52d11f1fba2642d43df2b1d0d936d/whiteboxProvider.diff" sha256 "e95191b38765d6072c1a637e735114cce03d53173e47b96626bb30930b5e9c7f" end # TauDEM Plugin resource "taudem" do url "https://github.com/alexbruy/processing-taudem/archive/38dc454c477b6a6e917f2b3777dc69ed3ecd6062.tar.gz" sha256 "7df793ae6a26ed65b6b15a8c8151b7f8598118b9f8da920eb260049d7c57229d" version "2.0.0" end # Patch: taudemProvider resource "taudemProvider" do url "https://gist.githubusercontent.com/fjperini/1899e20e0286058a74116aecf466f0a0/raw/a2fc2c7a31c747fca5fbed4e885a6503fe6a5d4c/taudemProvider.diff" sha256 "39a494f886d00011a0101b40715d828465592f304590438a7658d03298950cf5" end # Patch: taudemUtils resource "taudemUtils" do url "https://gist.githubusercontent.com/fjperini/f3e5ed0e964f4b7ead80a7c39a7115f6/raw/c3c8cca96d51156d0f60fe487b5b848faa3d0c2c/taudemUtils.diff" sha256 "3cf403f74c2ed67f6cdfb87c04cf0b09b085fb9f77ddde9be1d7f2ac12fe53a3" end # LAStools Plugin resource "lastools" do url "https://github.com/rapidlasso/LAStoolsPluginQGIS3/archive/55866f1685c03c8f9771a6a995550e08095b1f8a.tar.gz" sha256 "0badea99da9f14ae02a50860e368c48953eea921bf732593a2c059c090e1c248" version "1.3" end # Patch: LAStoolsProvider resource "LAStoolsProvider" do url "https://gist.githubusercontent.com/fjperini/d6dd9f294be338fba4a05959b845f095/raw/4da2e9e0bd931ad00b3ca66777c3a9d50cde18ba/LAStoolsProvider.diff" sha256 "82656a9fd6f42056d5c2a5487f2429b7f2c66c83287852fb644517abccecc563" end # splash resource "splash" do url "https://bottle.download.osgeo.org/qgis-splash/splash-3.4.png" sha256 "39aa3a7f99b3056a763da053ff74f39250f12b4088b02115c21ea97723d7fcb0" end def install ENV.cxx11 # change splash rm "#{buildpath}/images/splash/splash.png" (buildpath/"images/splash").install resource("splash") mv "#{buildpath}/images/splash/splash-3.4.png", "#{buildpath}/images/splash/splash.png" # suggestions before installing printf "\n\033[31mSome suggestions that you should keep in mind!!!\e[0m\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" printf " QGIS will use the first Python that is in its PATH, so the installation may fail.\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" printf " Try after doing:\n\n" printf " \e[32m$ brew unlink python && brew link --force python\e[0m \e[1;33m(*)\e[0m\n\n" printf " \e[32m$ $PATH (Check that there is no other version)\e[0m\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" printf " Try after doing:\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" printf " \e[32m$ brew link --overwrite osgeo-pyqt\e[0m \e[1;33m(**)\e[0m\n\n" printf "- Other Notes:\n\n" printf " - An installation that failed previously may have created this link\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" printf " - Also make sure that the folder \033[31m#{HOMEBREW_PREFIX}/Cellar/qgis\e[0m does not exist if the installation fails.\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" printf " - If you are going to install with several options you may have the following error:\n\n" printf " \033[31mError: Too many open files @ rb_sysopen - #{HOMEBREW_PREFIX}/var/homebrew/locks/..\e[0m\n\n" printf " Check before with: \e[32m$ ulimit -n\e[0m\n" printf " You can change it temporarily to avoid this problem: \e[32m$ ulimit -n 1024\e[0m\n" printf " Will be re-established in the next session\n\n" printf " - If the installation failed with the error\n\n" printf " \033[31mfatal error: 'libintl.h' file not found\e[0m\n\n" printf " Try after doing: \e[32m$ brew unlink gettext && brew link --force gettext\e[0m \e[1;33m(***)\e[0m\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" printf "\n\033[31mto make sure everything works correctly.\e[0m\n\n" printf "\033[31mThe installation will continue, but remember the above.\e[0m\n" 30.downto(0) do |i| printf "#{'%02d'% i}." sleep 1 end printf "\n\n" # proceeds to install the add-ons as a first step, # to ensure that the patches are applied mkdir "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" # OTB is available from branch_3.8 unless build.head? # resource("otb").stage do # cp_r "./otb", "#{buildpath}/python/plugins/" # end resource("otb").stage do cp_r "./otb", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" end # resource("OtbUtils").stage do # cp_r "./OtbUtils.diff", "#{buildpath}" # end # resource("OtbAlgorithmProvider").stage do # cp_r "./OtbAlgorithmProvider.diff", "#{buildpath}" # end # system "patch", "-p1", "-i", "#{buildpath}/OtbUtils.diff" # system "patch", "-p1", "-i", "#{buildpath}/OtbAlgorithmProvider.diff" # cp_r "#{buildpath}/python/plugins/otb", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" end # R resource("r").stage do cp_r "./processing_r", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" end # WhiteboxTools resource("whitebox").stage do cp_r "./", "#{buildpath}/python/plugins/processing_whitebox" end resource("whiteboxProvider").stage do cp_r "./whiteboxProvider.diff", "#{buildpath}" end system "patch", "-p1", "-i", "#{buildpath}/whiteboxProvider.diff" cp_r "#{buildpath}/python/plugins/processing_whitebox", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" # TauDEM resource("taudem").stage do cp_r "./", "#{buildpath}/python/plugins/processing_taudem" end resource("taudemProvider").stage do cp_r "./taudemProvider.diff", "#{buildpath}" end resource("taudemUtils").stage do cp_r "./taudemUtils.diff", "#{buildpath}" end system "patch", "-p1", "-i", "#{buildpath}/taudemProvider.diff" system "patch", "-p1", "-i", "#{buildpath}/taudemUtils.diff" cp_r "#{buildpath}/python/plugins/processing_taudem", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" # LASTools resource("lastools").stage do cp_r "./LAStools", "#{buildpath}/python/plugins/lastools" end resource("LAStoolsProvider").stage do cp_r "./LAStoolsProvider.diff", "#{buildpath}" end system "patch", "-p1", "-i", "#{buildpath}/LAStoolsProvider.diff" cp_r "#{buildpath}/python/plugins/lastools", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" # if you have a 3rd party Python installed, and/or Python 3, # you need to remove it from your path for the installation. # once installed, QGIS will run even if the primary Python is, # for example, Anaconda Python 3. # reset path ENV["PATH"] = nil pths = "#{HOMEBREW_PREFIX}/bin:#{HOMEBREW_PREFIX}/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11/bin" ENV.append_path "PATH", "#{pths}" # when osgeo-gdal-python.rb loaded, PYTHONPATH gets set to 2.7 site-packages... # clear it before calling any local python3 functions ENV["PYTHONPATH"] = nil if ARGV.debug? puts "brewed_python?: #{brewed_python?}" puts "python_prefix: #{python_prefix}" puts "python_exec: #{python_exec}" puts "py_ver: #{py_ver}" puts "python_site_packages: #{python_site_packages}" puts "qgis_site_packages: #{qgis_site_packages}" puts "qgis_python_packages: #{qgis_python_packages}" puts "gdal_python_packages: #{gdal_python_packages}" puts "gdal_python_opt_bin: #{gdal_python_opt_bin}" puts "gdal_opt_bin: #{gdal_opt_bin}" end # set bundling level back to 0 (the default in all versions prior to 1.8.0) # so that no time and energy is wasted copying the Qt frameworks into QGIS. # install custom widgets Designer plugin to local qt plugins prefix mkdir lib/"qt/plugins/designer" inreplace "src/customwidgets/CMakeLists.txt", "${QT_PLUGINS_DIR}/designer", lib/"qt/plugins/designer".to_s # fix custom widgets Designer module install path mkdir lib/"python#{py_ver}/site-packages/PyQt5" inreplace "CMakeLists.txt", "${PYQT5_MOD_DIR}", lib/"python#{py_ver}/site-packages/PyQt5".to_s # install db plugins to local qt plugins prefix # qspatialite mkdir lib/"qt/plugins/sqldrivers" inreplace "external/qspatialite/CMakeLists.txt", "${QT_PLUGINS_DIR}/sqldrivers", lib/"qt/plugins/sqldrivers".to_s # end if build.with? "oracle" mkdir lib/"qt/plugins/sqldrivers" inreplace "src/providers/oracle/ocispatial/CMakeLists.txt", "${QT_PLUGINS_DIR}/sqldrivers", lib/"qt/plugins/sqldrivers".to_s end # support for PROJ 6 # https://github.com/OSGeo/proj.4/wiki/proj.h-adoption-status # ENV.append "CFLAGS", "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" args = std_cmake_args args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo" if build.with? "debug" # override cmake_prefixes = %w[ qt osgeo-qt-webkit osgeo-pyqt-webkit osgeo-qscintilla2 osgeo-pyqt osgeo-sip qwt qwtpolar qca osgeo-qtkeychain osgeo-gdal gsl geos osgeo-proj osgeo-libspatialite spatialindex expat sqlite libzip flex bison fcgi ].freeze # force CMake to search HB/opt paths first, so headers in HB/include are not found instead; # specifically, ensure any gdal v1 includes are not used args << "-DCMAKE_PREFIX_PATH=#{cmake_prefixes.map { |f| Formula[f.to_s].opt_prefix }.join(";")}" qwt_fw = Formula["qwt"].opt_lib/"qwt.framework" qwtpolar_fw = Formula["qwtpolar"].opt_lib/"qwtpolar.framework" qca_fw = Formula["qca"].opt_lib/"qca-qt5.framework" args += %W[ -DBISON_EXECUTABLE=#{Formula["bison"].opt_bin}/bison -DEXPAT_INCLUDE_DIR=#{Formula["expat"].opt_include} -DEXPAT_LIBRARY=#{Formula["expat"].opt_lib}/libexpat.dylib -DFLEX_EXECUTABLE=#{Formula["flex"].opt_bin}/flex -DPROJ_INCLUDE_DIR=#{Formula["osgeo-proj"].opt_include} -DPROJ_LIBRARY=#{Formula["osgeo-proj"].opt_lib}/libproj.dylib -DQCA_INCLUDE_DIR=#{qca_fw}/Headers -DQCA_LIBRARY=#{qca_fw}/qca-qt5 -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers -DQWT_LIBRARY=#{qwt_fw}/qwt -DSPATIALINDEX_INCLUDE_DIR=#{Formula["spatialindex"].opt_include} -DSPATIALINDEX_LIBRARY=#{Formula["spatialindex"].opt_lib}/libspatialindex.dylib -DSQLITE3_INCLUDE_DIR=#{Formula["sqlite"].opt_include} -DSQLITE3_LIBRARY=#{Formula["sqlite"].opt_lib}/libsqlite3.dylib -DLIBZIP_CONF_INCLUDE_DIR=#{Formula["libzip"].opt_lib}/pkgconfig -DLIBZIP_INCLUDE_DIR=#{Formula["libzip"].opt_include} -DLIBZIP_LIBRARY=#{Formula["libzip"].opt_lib}/libzip.dylib -DSPATIALITE_INCLUDE_DIR=#{Formula["osgeo-libspatialite"].opt_include} -DSPATIALITE_LIBRARY=#{Formula["osgeo-libspatialite"].opt_lib}/libspatialite.dylib -DQTKEYCHAIN_INCLUDE_DIR=#{Formula["qtkeychain"].opt_include}/qt5keychain -DQTKEYCHAIN_LIBRARY=#{Formula["osgeo-qtkeychain"].opt_lib}/libqt5keychain.dylib -DLIBTASN1_INCLUDE_DIR=#{Formula["libtasn1"].opt_include} -DLIBTASN1_LIBRARY=#{Formula["libtasn1"].opt_lib}/libtasn1.dylib -DPYRCC_PROGRAM=#{libexec}/vendor/bin/pyrcc5 -DPYUIC_PROGRAM=#{libexec}/vendor/bin/pyuic5 -DWITH_QWTPOLAR=TRUE -DWITH_INTERNAL_QWTPOLAR=FALSE -DWITH_QSCIAPI=FALSE -DWITH_CUSTOM_WIDGETS=TRUE -DWITH_ASTYLE=FALSE -DWITH_QTWEBKIT=TRUE -DQT_LRELEASE_EXECUTABLE=#{Formula["qt"].opt_bin}/lrelease -DQT5_3DEXTRA_INCLUDE_DIR=#{Formula["qt"].opt_lib}/cmake/Qt53DExtras -DQt5WebKitWidgets_DIR=#{Formula["osgeo-qt-webkit"].opt_lib}/cmake/Qt5WebKitWidgets -DQt5WebKit_DIR=#{Formula["osgeo-qt-webkit"].opt_lib}/cmake/Qt5WebKit ] args << "-DQGIS_MACAPP_BUNDLE=0" args << "-DQGIS_MACAPP_INSTALL_DEV=FALSE" # args << "-DQGIS_APP_NAME=QGIS-HB" # Build unit tests args << "-DENABLE_TESTS=FALSE" # Enable QT ModelTest (not for production) args << "-DENABLE_MODELTEST=FALSE" # Perform coverage tests args << "-DENABLE_COVERAGE=FALSE" args << "-DSIP_BINARY_PATH=#{Formula["osgeo-sip"].opt_bin}/sip" args << "-DSIP_DEFAULT_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip" args << "-DSIP_INCLUDE_DIR=#{Formula["osgeo-sip"].opt_include}" args << "-DSIP_MODULE_DIR=#{Formula["osgeo-sip"].opt_lib}/python#{py_ver}/site-packages" args << "-DPYQT5_MOD_DIR=#{Formula["python"].opt_prefix}/Frameworks/Python.framework/Versions/#{py_ver}/lib/python#{py_ver}/site-packages/PyQt5" args << "-DPYQT5_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip/PyQt5" # Qt5 args << "-DPYQT5_BIN_DIR=#{Formula["python"].opt_prefix}/Frameworks/Python.framework/Versions/#{py_ver}/bin" args << "-DPYQT5_SIP_IMPORT=PyQt5.sip" args << "-DPYQT5_SIP_FLAGS=-n PyQt5.sip -t WS_MACX -t Qt_5_12_1" args << "-DQSCI_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip/PyQt5/Qsci" # Qsci/qscimod5.sip args << "-DQSCINTILLA_INCLUDE_DIR=#{Formula["osgeo-qscintilla2"].opt_include}" # Qsci/qsciglobal.h args << "-DQSCINTILLA_LIBRARY=#{Formula["osgeo-qscintilla2"].opt_lib}/libqscintilla2_qt5.dylib" # disable CCache args << "-DUSE_CCACHE=OFF" # Determines whether QGIS core should be built args << "-DWITH_CORE=TRUE" # Determines whether QGIS GUI library (and everything built on top of it) should be built args << "-DWITH_GUI=TRUE" # Determines whether QGIS analysis library should be built # args << "-DWITH_ANALYSIS=TRUE" # Determines whether QGIS desktop should be built args << "-DWITH_DESKTOP=TRUE" # Determines whether QGIS Quick library should be built args << "-DWITH_QUICK=FALSE" # Determines whether MDAL support should be built args << "-DWITH_INTERNAL_MDAL=TRUE" # Determines whether GeoReferencer plugin should be built args << "-DWITH_GEOREFERENCER=TRUE" # Determines whether std::thread_local should be used args << "-DWITH_THREAD_LOCAL=TRUE" # Determines whether Qt5SerialPort should be tried for GPS positioning # args << "-DWITH_QT5SERIALPORT=TRUE" # Use Clang tidy args << "-DWITH_CLANG_TIDY=FALSE" # try to configure and build python bindings by default # determines whether python bindings should be built args << "-DWITH_BINDINGS=TRUE" # by default bindings will be installed only to QGIS directory # someone might want to install it to python site-packages directory # as otherwise user has to use PYTHONPATH environment variable to add # QGIS bindings to package search path # install bindings to global python directory? (might need root) args << "-DBINDINGS_GLOBAL_INSTALL=FALSE" # Stage-install core Python plugins to run from build directory? (utilities and console are always staged) args << "-DWITH_STAGED_PLUGINS=TRUE" # Determines whether Python modules in staged or installed locations are byte-compiled" args << "-DWITH_PY_COMPILE=FALSE" # python Configuration args << "-DPYTHON_EXECUTABLE=#{`#{Formula["python"].opt_bin}/python3 -c "import sys; print(sys.executable)"`.chomp}" # args << "-DPYTHON_INCLUDE_PATH=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/include/python#{py_ver}m" # args << "-DPYTHON_LIBRARY=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/Python" # args << "-DPYTHON_SITE_PACKAGES_DIR=#{HOMEBREW_PREFIX}/lib/python#{py_ver}/site-packages" # if using Homebrew's Python, make sure its components are always found first # see: https://github.com/Homebrew/homebrew/pull/28597 ENV["PYTHONHOME"] = python_prefix if brewed_python? # handle custom site-packages for keg-only modules and packages ENV.append_path "PYTHONPATH", "#{python_site_packages}" ENV.append_path "PYTHONPATH", "#{qgis_site_packages}" ENV.append_path "PYTHONPATH", "#{qgis_python_packages}" ENV.append_path "PYTHONPATH", "#{gdal_python_packages}" # find git revision for HEAD build if build.head? && File.exist?("#{cached_download}/.git/index") args << "-DGITCOMMAND=#{Formula["git"].opt_bin}/git" args << "-DGIT_MARKER=#{cached_download}/.git/index" # disable OpenCL support # necessary to build from branch: master # fix for CL/cl2.hpp # https://github.com/qgis/QGIS/pull/7451 # args << "-DUSE_OPENCL=OFF" end # used internal sources # args << "OPENCL_HPP_INCLUDE_DIR=" # server args << "-DWITH_SERVER=TRUE" args << "-DWITH_SERVER_PLUGINS=TRUE" fcgi_opt = Formula["fcgi"].opt_prefix args << "-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include" args << "-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib" # postgresql args << "-DWITH_POSTGRESQL=TRUE" if build.with?("pg10") args << "-DPOSTGRES_CONFIG=#{Formula["osgeo-postgresql@10"].opt_bin}/pg_config" args << "-DPOSTGRES_INCLUDE_DIR=#{Formula["osgeo-postgresql@10"].opt_include}" args << "-DPOSTGRES_LIBRARY=#{Formula["osgeo-postgresql@10"].opt_lib}/libpq.dylib" else args << "-DPOSTGRES_CONFIG=#{Formula["osgeo-postgresql"].opt_bin}/pg_config" args << "-DPOSTGRES_INCLUDE_DIR=#{Formula["osgeo-postgresql"].opt_include}" args << "-DPOSTGRES_LIBRARY=#{Formula["osgeo-postgresql"].opt_lib}/libpq.dylib" end # grass args << "-DWITH_GRASS7=TRUE" args << "-DWITH_GRASS=FALSE" # grass6 # this is to build the GRASS Plugin, not for Processing plugin support grass = Formula["osgeo-grass"] args << "-DGRASS_PREFIX7=#{grass.opt_prefix}/grass-base" # keep superenv from stripping (use Cellar prefix) ENV.append "CXXFLAGS", "-isystem #{grass.prefix.resolved_path}/grass-base/include" # So that `libintl.h` can be found (use Cellar prefix; should not be needed anymore with QGIS 2.99+) ENV.append "CXXFLAGS", "-isystem #{Formula["gettext"].include.resolved_path}" # args << "-DWITH_GLOBE=TRUE" # osg = Formula["osgeo-openscenegraph"] # osgqt = Formula["osgqt"] # osgearth = Formula["osgeo-osgearth"] # opoo "`osgeo-openscenegraph` formula's keg not linked." unless osg.linked_keg.exist? # # OSG # # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there # args << "-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}" # args << "-DOSG_DIR=#{osg.opt_prefix}" # args << "-DOSG_INCLUDE_DIR=#{osg.opt_include}" # osg/Node # args << "-DOSG_GEN_INCLUDE_DIR=#{osg.opt_include}" # osg/Config # args << "-DOSG_LIBRARY=#{osg.opt_lib}/libosg.dylib" # args << "-DOSGUTIL_LIBRARY=#{osg.opt_lib}/libosgUtil.dylib" # args << "-DOSGDB_LIBRARY=#{osg.opt_lib}/libosgDB.dylib" # args << "-DOSGTEXT_LIBRARY=#{osg.opt_lib}/libosgText.dylib" # args << "-DOSGTERRAIN_LIBRARY=#{osg.opt_lib}/libosgTerrain.dylib" # args << "-DOSGFX_LIBRARY=#{osg.opt_lib}/libosgFX.dylib" # args << "-DOSGSIM_LIBRARY=#{osg.opt_lib}/libosgSim.dylib" # args << "-DOSGVIEWER_LIBRARY=#{osg.opt_lib}/libosgViewer.dylib" # args << "-DOSGGA_LIBRARY=#{osg.opt_lib}/libosgGA.dylib" # args << "-DOSGQT_LIBRARY=#{osgqt.opt_lib}/libosgQt5.dylib" # args << "-DOSGWIDGET_LIBRARY=#{osg.opt_lib}/libosgWidget.dylib" # args << "-DOPENTHREADS_LIBRARY=#{osg.opt_lib}/libOpenThreads.dylib" # # args << "-DOPENTHREADS_INCLUDE_DIR=#{osg.opt_include}" # # args << "-DOSGSHADOW_LIBRARY=#{osg.opt_lib}/libosgShadow.dylib" # # args << "-DOSGMANIPULATOR_LIBRARY=#{osg.opt_lib}/libosgManipulator.dylib" # # args << "-DOSGPARTICLE_LIBRARY=#{osg.opt_lib}/libosgParticle.dylib" # # OSGEARTH # args << "-DOSGEARTH_DIR=#{osgearth.opt_prefix}" # args << "-DOSGEARTH_INCLUDE_DIR=#{osgearth.opt_include}" # osgEarth/TileSource # args << "-DOSGEARTH_GEN_INCLUDE_DIR=#{osgearth.opt_include}" # osgEarth/Common # args << "-DOSGEARTH_ELEVATION_QUERY=#{osgearth.opt_include}" # osgEarth/ElevationQuery # args << "-DOSGEARTH_LIBRARY=#{osgearth.opt_lib}/libosgEarth.dylib" # args << "-DOSGEARTHUTIL_LIBRARY=#{osgearth.opt_lib}/libosgEarthUtil.dylib" # args << "-DOSGEARTHFEATURES_LIBRARY=#{osgearth.opt_lib}/libosgEarthFeatures.dylib" # args << "-DOSGEARTHSYMBOLOGY_LIBRARY=#{osgearth.opt_lib}/libosgEarthSymbology.dylib" # args << "-DOSGEARTHQT_LIBRARY=#{osgearth.opt_lib}/libosgEarthQt5.dylib" # args << "-DOSGEARTHANNOTATION_LIBRARY=#{osgearth.opt_lib}/libosgEarthAnnotation.dylib" # # qt # args << "-DQt5OpenGL_INCLUDE_DIRS=#{Formula["qt"].opt_include}/QtOpenGL" args << "-DWITH_ORACLE=#{build.with?("oracle") || brewed_oracle? ? "TRUE" : "FALSE"}" if build.with?("oracle") || brewed_oracle? oracle_opt = Formula["osgeo-oracle-client-sdk"].opt_prefix args << "-DOCI_INCLUDE_DIR=#{oracle_opt}/include/oci" args << "-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib" end args << "-DWITH_QSPATIALITE=TRUE" args << "-DWITH_APIDOC=#{build.with?("api-docs") ? "TRUE" : "FALSE"}" args << "-DWITH_3D=TRUE" # args << "-DWITH_QTWEBKIT=#{build.with?("osgeo-qt-webkit") ? "TRUE" : "FALSE"}" # if build.with? "qtwebkit" #  args << "-DOPTIONAL_QTWEBKIT=#{Formula["osgeo-qt-webkit"].opt_lib}/cmake/Qt5WebKitWidgets" # end # prefer opt_prefix for CMake modules that find versioned prefix by default # this keeps non-critical dependency upgrades from breaking QGIS linking args << "-DGDAL_CONFIG=#{Formula["osgeo-gdal"].opt_bin}/gdal-config" args << "-DGDAL_INCLUDE_DIR=#{Formula["osgeo-gdal"].opt_include}" args << "-DGDAL_LIBRARY=#{Formula["osgeo-gdal"].opt_lib}/libgdal.dylib" args << "-DGEOS_CONFIG=#{Formula["geos"].opt_bin}/geos-config" args << "-DGEOS_INCLUDE_DIR=#{Formula["geos"].opt_include}" args << "-DGEOS_LIBRARY=#{Formula["geos"].opt_lib}/libgeos_c.dylib" args << "-DGSL_CONFIG=#{Formula["gsl"].opt_bin}/gsl-config" args << "-DGSL_INCLUDE_DIR=#{Formula["gsl"].opt_include}" args << "-DGSL_LIBRARIES='-L#{Formula["gsl"].opt_lib} -lgsl -lgslcblas'" # avoid ld: framework not found QtSql # (https://github.com/Homebrew/homebrew-science/issues/23) ENV.append "CXXFLAGS", "-F#{Formula["qt"].opt_lib}" # handle some compiler warnings # ENV["CXX_EXTRA_FLAGS"] = "-Wno-unused-private-field -Wno-deprecated-register" # if ENV.compiler == :clang && (MacOS::Xcode.version >= "7.0" || MacOS::CLT.version >= "7.0") # ENV.append "CXX_EXTRA_FLAGS", "-Wno-inconsistent-missing-override" # end args << "-DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations" # If set to true, it will disable deprecated functionality to prepare for the next generation of QGIS # args << "-DDISABLE_DEPRECATED=TRUE" # Newer versions of UseQt4.cmake include Qt with -isystem automatically # This can be used to force this behavior on older systems # Can be removed as soon as Travis-CI updates from precise # args << "-DSUPPRESS_QT_WARNINGS=TRUE" ENV.prepend_path "PATH", libexec/"vendor/bin" mkdir "#{libexec}/vendor/bin" # create pyrcc5 File.open("#{libexec}/vendor/bin/pyrcc5", "w") { |file| file << '#!/bin/sh' file << "\n" file << 'exec' + " #{Formula["python"].opt_bin}/python3 " + '-m PyQt5.pyrcc_main ${1+"$@"}' } # create pyuic5 File.open("#{libexec}/vendor/bin/pyuic5", "w") { |file| file << '#!/bin/sh' file << "\n" file << 'exec' + " #{Formula["python"].opt_bin}/python3 " + '-m PyQt5.pyuic5_main ${1+"$@"}' } chmod("+x", "#{libexec}/vendor/bin/pyrcc5") chmod("+x", "#{libexec}/vendor/bin/pyuic5") mkdir "build" do system "cmake", "-G", build.with?("ninja") ? "Ninja" : "Unix Makefiles", *args, ".." system "cmake", "--build", ".", "--target", "all", "--", "-j", Hardware::CPU.cores system "cmake", "--build", ".", "--target", "install", "--", "-j", Hardware::CPU.cores end # fixup some errant lib linking # TODO: fix upstream in CMake dy_libs = [lib/"qt/plugins/designer/libqgis_customwidgets.dylib"] dy_libs << lib/"qt/plugins/sqldrivers/libqsqlspatialite.dylib" # qspatialite dy_libs << lib/"qt/plugins/sqldrivers/libqsqlocispatial.dylib" if build.with? "oracle" dy_libs.each do |dy_lib| MachO::Tools.dylibs(dy_lib.to_s).each do |i_n| %w[core gui native].each do |f_n| sufx = i_n[/(qgis_#{f_n}\.framework.*)/, 1] next if sufx.nil? i_n_to = "#{opt_prefix}/QGIS.app/Contents/Frameworks/#{sufx}" puts "Changing install name #{i_n} to #{i_n_to} in #{dy_lib}" if ARGV.debug? dy_lib.ensure_writable do MachO::Tools.change_install_name(dy_lib.to_s, i_n.to_s, i_n_to, :strict => false) end end end end # update .app's bundle identifier, so other installers doesn't get confused inreplace prefix/"QGIS.app/Contents/Info.plist", "org.qgis.qgis3", "org.qgis.osgeo-qgis-ltr-hb#{build.head? ? "-dev" : ""}" py_lib = lib/"python#{py_ver}/site-packages" py_lib.mkpath ln_s "../../../QGIS.app/Contents/Resources/python/qgis", py_lib/"qgis" ln_s "QGIS.app/Contents/MacOS/fcgi-bin", prefix/"fcgi-bin" # server doc.mkpath mv prefix/"QGIS.app/Contents/Resources/doc/api", doc/"api" if build.with? "api-docs" ln_s "../../../QGIS.app/Contents/Resources/doc", doc/"doc" # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped) # only works with QGIS > 2.0.1 # doesn't need executable bit set, loaded by Python runner in QGIS # TODO: for Py3 cp_r "#{Formula["osgeo-qgis-res"].opt_libexec}/pyqgis_startup.py", "#{libexec}/pyqgis_startup.py" bin.mkdir qgis_bin = bin/name.to_s touch qgis_bin.to_s # so it will be linked into HOMEBREW_PREFIX qgis_bin.chmod 0755 post_install end def post_install # configure environment variables for .app and launching binary directly. # having this in `post_intsall` allows it to be individually run *after* installation with: # `brew postinstall -v ` app = prefix/"QGIS.app" tab = Tab.for_formula(self) opts = tab.used_options # bottle_poured = tab.poured_from_bottle # define default isolation env vars pthsep = File::PATH_SEPARATOR pypth = "#{python_site_packages}" pths = %W[#{HOMEBREW_PREFIX}/bin #{HOMEBREW_PREFIX}/sbin /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin] unless opts.include?("with-isolation") pths = ORIGINAL_PATHS.dup pyenv = ENV["PYTHONPATH"] if pyenv pypth = pyenv.include?(pypth) ? pyenv : pypth + pthsep + pyenv end end unless pths.include?(HOMEBREW_PREFIX/"bin") pths = pths.insert(0, HOMEBREW_PREFIX/"bin") end # set install's lib/python#{py_ver}/site-packages first, so app will work if unlinked pypths = %W[#{qgis_python_packages} #{qgis_site_packages} #{pypth}] pths.insert(0, "#{gdal_opt_bin}") pths.insert(0, "#{gdal_python_opt_bin}") pypths.insert(0, "#{gdal_python_packages}") # prepend qt based utils to PATH (reverse order) pths.insert(0, "#{Formula["qca"].opt_bin}") pths.insert(0, "#{Formula["osgeo-pyqt"].opt_bin}") pths.insert(0, "#{Formula["osgeo-sip"].opt_bin}") pths.insert(0, "#{Formula["qt"].opt_bin}") pths.insert(0, "#{Formula["gpsbabel"].opt_bin}") # we need to manually add the saga lts path, since it's keg only pths.insert(0, "#{Formula["osgeo-saga-lts"].opt_bin}") envars = { :PATH => pths.join(pthsep), :QGIS_BUNDLE => "#{opt_prefix}/QGIS.app/Contents", :QGIS_PREFIX_PATH => "#{opt_prefix}/QGIS.app/Contents/MacOS", :GDAL_DRIVER_PATH => "#{HOMEBREW_PREFIX}/lib/gdalplugins", :GDAL_DATA => "#{Formula["osgeo-gdal"].opt_share}/gdal", :CHECK_DISK_FREE_SPACE => "FALSE", :PYTHONPATH => pypths.join(pthsep), # if it is set, grass it will not work correctly, using Python 2 # it will be necessary to wait until it is built with Python 3 # :PYTHONHOME => "#{Formula["python"].opt_frameworks}/Python.framework/Versions/#{py_ver}", } # handle multiple Qt plugins directories qtplgpths = %W[ #{opt_lib}/qt/plugins #{Formula["qt"].opt_prefix}/plugins #{HOMEBREW_PREFIX}/lib/qt/plugins ] envars[:QT_PLUGIN_PATH] = qtplgpths.join(pthsep) envars[:QT_AUTO_SCREEN_SCALE_FACTOR] = "1" # https://github.com/OSGeo/homebrew-osgeo4mac/issues/447 # envars[:QT_AUTO_SCREEN_SCALE_FACTOR] = "0" # envars[:QT_DEVICE_PIXEL_RATIO] = "1" proc_plugins = "#{app}/Contents/Resources/python/plugins" proc_plugins_algs = "#{proc_plugins}/processing/algs" # for core integration plugin support # grass grass = Formula["osgeo-grass"] grass_version = "#{grass.version}" envars[:GRASS_PREFIX] = "#{grass.opt_prefix}/grass-base" envars[:GRASS_SH] = "/bin/sh" envars[:GRASS_PROJSHARE] = "#{Formula["osgeo-proj"].opt_share}" envars[:GRASS_VERSION] = "#{grass_version}" envars[:GRASS_LD_LIBRARY_PATH] = "#{grass.opt_prefix}/grass#{majmin_ver}/lib" # envars[:GRASS_PERL] = "#{Formula["perl"].opt_bin}/perl" envars[:PROJ_LIB] = "#{Formula["osgeo-proj"].opt_lib}" envars[:GEOTIFF_CSV] = "#{Formula["osgeo-libgeotiff"].opt_share}/epsg_csv" # envars[:R_HOME] = "#{Formula["r"].opt_bin}/R" # envars[:R_HOME] = "/Applications/RStudio.app/Contents/MacOS/RStudio" # envars[:R_USER] = "USER_PROFILE/Documents" begin inreplace "#{proc_plugins_algs}/grass7/Grass7Utils.py", "'/Applications/GRASS-7.{}.app/Contents/MacOS'.format(version)", "'#{grass.opt_prefix}/grass-base'" puts "GRASS 7 GrassUtils.py has been updated" rescue Utils::InreplaceError puts "GRASS 7 GrassUtils.py already updated" end # OTB is available from branch_3.8 # unless build.head? # orfeo = Formula["osgeo-orfeo"] # # envars[:QGIS_PLUGINPATH] = "#{orfeo.opt_prefix}" # begin # inreplace "#{proc_plugins}/otb/OTBUtils.py" do |s| # # default geoid path # # try to replace first, so it fails (if already done) before global replaces # s.sub! "OTB_FOLDER", "#{orfeo.opt_prefix}" # s.sub! "OTB_APP_FOLDER", "#{orfeo.opt_lib}/otb/applications" # s.sub! "OTB_GEOID_FILE", "#{orfeo.opt_libexec}/default_geoid/egm96.grd" # end # puts "ORFEO 6 OTBUtils.py has been updated" # rescue Utils::InreplaceError # puts "ORFEO 6 OTBUtils.py already updated" # end # end # R # Remove setting to activate provider # See: https://github.com/north-road/qgis-processing-r/commit/7d8d182962392297690c02f77829b8cd64b5e8a9#diff-ce2ac984448f961cfa0f7e446bdbd4ca # begin # inreplace "#{proc_plugins}/processing_r/processing/provider.py" do |s| # s.gsub! "'Activate'), False))", "'Activate'), True))" # end # puts "R RAlgorithmProvider.py has been updated" # rescue Utils::InreplaceError # puts "R provider.py already updated" # end # WhiteboxTools begin whitebox="#{Formula["osgeo-whitebox-tools"].opt_bin}/whitebox_tools" inreplace "#{proc_plugins}/processing_whitebox/whiteboxProvider.py" do |s| s.gsub! "/usr/local/opt/whitebox-tools/bin/whitebox_tools", "#{whitebox}" end puts "Whitebox Tools whiteboxProvider.py has been updated" rescue Utils::InreplaceError puts "Whitebox Tools whiteboxProvider.py already updated" end # TauDEM begin taudem="#{Formula["osgeo-taudem"].opt_bin}" mpich="#{Formula["open-mpi"].opt_bin}" inreplace "#{proc_plugins}/processing_taudem/taudemProvider.py" do |s| s.gsub! "/usr/local/opt/taudem/bin", "#{taudem}" s.gsub! "/usr/local/opt/open-mpi/bin", "#{mpich}" end puts "TauDEM taudemProvider.py and has been updated" rescue Utils::InreplaceError puts "TauDEM taudemProvider.py already updated" end # LASTools begin lastools="#{Formula["osgeo-lastools"].opt_prefix}" inreplace "#{proc_plugins}/lastools/LAStoolsProvider.py" do |s| s.gsub! 'C:\LAStools', "#{lastools}" end puts "LAStools LAStoolsProvider.py has been updated" rescue Utils::InreplaceError puts "LAStools LAStoolsProvider.py already updated" end unless opts.include?("without-globe") osg = Formula["osgeo-openscenegraph"] envars[:OSG_LIBRARY_PATH] = "#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}" end if opts.include?("with-isolation") envars[:DYLD_FRAMEWORK_PATH] = "#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks" versioned = %W[ #{Formula["sqlite"].opt_lib} #{Formula["expat"].opt_lib} #{Formula["libxml2"].opt_lib} #{HOMEBREW_PREFIX}/lib ] envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep) end # TODO: add for Py3 if opts.include?("with-isolation") || File.exist?("/Library/Frameworks/GDAL.framework") envars[:PYQGIS_STARTUP] = opt_libexec/"pyqgis_startup.py" end # envars.each { |key, value| puts "#{key.to_s}=#{value}" } # exit # add env vars to QGIS.app's Info.plist, in LSEnvironment section plst = app/"Contents/Info.plist" # first delete any LSEnvironment setting, ignoring errors # CAUTION!: may not be what you want, if .app already has LSEnvironment settings dflt = `defaults read-type \"#{plst}\" LSEnvironment 2> /dev/null` `defaults delete \"#{plst}\" LSEnvironment` if dflt kv = "{ " envars.each { |key, value| kv += "'#{key}' = '#{value}'; " } kv += "}" `defaults write \"#{plst}\" LSEnvironment \"#{kv}\"` # add ability to toggle high resolution in Get Info dialog for app hrc = `defaults read-type \"#{plst}\" NSHighResolutionCapable 2> /dev/null` `defaults delete \"#{plst}\" NSHighResolutionCapable` if hrc `defaults write \"#{plst}\" NSHighResolutionCapable \"True\"` # leave the plist readable; convert from binary to XML format `plutil -convert xml1 -- \"#{plst}\"` # make sure plist is readble by all users plst.chmod 0644 # update modification date on app bundle, or changes won't take effect touch app.to_s # add env vars to launch script for QGIS app's binary qgis_bin = bin/name.to_s rm_f qgis_bin if File.exist?(qgis_bin) # install generates empty file bin_cmds = %W[#!/bin/sh\n] # setup shell-prepended env vars (may result in duplication of paths) unless pths.include? HOMEBREW_PREFIX/"bin" pths.insert(0, HOMEBREW_PREFIX/"bin") end # even though this should be affected by with-isolation, allow local env override pths << "$PATH" pypths << "$PYTHONPATH" envars[:PATH] = pths.join(pthsep) envars[:PYTHONPATH] = pypths.join(pthsep) envars.each { |key, value| bin_cmds << "export #{key}=#{value}" } bin_cmds << opt_prefix/"QGIS.app/Contents/MacOS/QGIS \"$@\"" qgis_bin.write(bin_cmds.join("\n")) qgis_bin.chmod 0755 # link python modules (prefix/"QGIS.app/Contents/Resources/python").install_symlink Dir["#{Formula["osgeo-qgis-res"].opt_libexec}/vendor/lib/python#{py_ver}/site-packages/*"] (prefix/"QGIS.app/Contents/Resources/python/PyQt5").install_symlink Dir["#{Formula["osgeo-sip"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*"] ln_s "#{Formula["osgeo-sip"].opt_lib}/python#{py_ver}/site-packages/sipconfig.py", "#{prefix}/QGIS.app/Contents/Resources/python/sipconfig.py" ln_s "#{Formula["osgeo-sip"].opt_lib}/python#{py_ver}/site-packages/sipdistutils.py", "#{prefix}/QGIS.app/Contents/Resources/python/sipdistutils.py" (prefix/"QGIS.app/Contents/Resources/python/PyQt5").install_symlink Dir["#{Formula["osgeo-pyqt"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*"] (prefix/"QGIS.app/Contents/Resources/python/PyQt5").install_symlink Dir["#{Formula["osgeo-pyqt-webkit"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*"] (prefix/"QGIS.app/Contents/Resources/python/PyQt5").install_symlink Dir["#{Formula["osgeo-qscintilla2"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*"] # (prefix/"QGIS.app/Contents/Resources/python").install_symlink Dir["#{Formula["osgeo-matplotlib"].opt_lib}/python#{py_ver}/site-packages/*"] # (prefix/"QGIS.app/Contents/Resources/python").install_symlink Dir["#{Formula["numpy"].opt_lib}/python#{py_ver}/site-packages/*"] # (prefix/"QGIS.app/Contents/Resources/python").install_symlink Dir["#{Formula["scipy"].opt_lib}/python#{py_ver}/site-packages/*"] (prefix/"QGIS.app/Contents/Resources/python").install_symlink Dir["#{Formula["osgeo-gdal-python"].opt_lib}/python#{py_ver}/site-packages/*"] # fix ImportError: No module named site for gdal_*.py mkdir "#{prefix}/QGIS.app/Contents/MacOS/bin" (prefix/"QGIS.app/Contents/MacOS/bin").install_symlink Dir["#{Formula["osgeo-gdal-python"].opt_bin}/*"] (prefix/"QGIS.app/Contents/MacOS/bin").install_symlink Dir["#{Formula["osgeo-gdal"].opt_bin}/*"] (prefix/"QGIS.app/Contents/Frameworks").install_symlink Dir["#{Formula["qt"].opt_frameworks}/*"] (prefix/"QGIS.app/Contents/Frameworks").install_symlink Dir["#{Formula["python"].opt_frameworks}/*"] ln_s "#{prefix}/QGIS.app/Contents/MacOS/lib", "#{prefix}/QGIS.app/Contents/MacOS/bin" ln_s "#{prefix}/QGIS.app/Contents/Frameworks", "#{prefix}/QGIS.app/Contents/MacOS" ln_s "#{Formula["python"].opt_bin}/python#{py_ver}", "#{prefix}/QGIS.app/Contents/MacOS/bin/python3" ln_s "#{Formula["python"].opt_bin}/python#{py_ver}", "#{prefix}/QGIS.app/Contents/MacOS/bin/python" end def caveats s = <<~EOS \nQGIS is built as an application bundle. Environment variables for the Homebrew prefix are embedded in \e[32mQGIS.app\e[0m: \e[32m#{opt_prefix}/QGIS.app\e[0m You may also symlink \e[32mQGIS.app\e[0m into \e[32m/Applications\e[0m or \e[32m~/Applications\e[0m: \e[32mln -Fs `find $(brew --prefix) -name "QGIS.app"` /Applications/QGIS.app\e[0m To directly run the \e[32m`QGIS.app/Contents/MacOS/QGIS`\e[0m binary use the wrapper script pre-defined with Homebrew prefix environment variables: \e[32m#{opt_bin}/#{name}\e[0m If you need QGIS to appear in Spotlight, create and run the following script: \e[32m#!/usr/bin/env bash\e[0m \e[32mqgis_location=$(find $(brew --prefix)/Cellar/osgeo-qgis/ -name "3.*" -print -quit)/QGIS.app\e[0m \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 https://github.com/OSGeo/homebrew-osgeo4mac/issues/607#issuecomment-455905926 NOTE: Your current PATH and PYTHONPATH environment variables are honored when launching via the wrapper script, while launching \e[32mQGIS.app\e[0m bundle they are not. For standalone Python 3 development, set the following environment variable: \e[32mexport PYTHONPATH=#{python_site_packages}:#{qgis_site_packages}:#{qgis_python_packages}:#{gdal_python_packages}:$PYTHONPATH\e[0m EOS if build.with?("isolation") s += <<~EOS \033[31mQGIS built with isolation enabled. This allows it to coexist with other types of installations of QGIS on your Mac. However, on versions >= 2.0.1, this also means Python modules installed in the *system* Python will NOT be available to Python processes within QGIS.app.\e[0m EOS end s += <<~EOS You installed LAStools! If you will use Wine to have more features: \n1 - Download \e[32mhttp://lastools.org/download/LAStools.zip\e[0m and unzip LASTools. Remember where you unzipped it. 2 - Start QGIS. Select \e[32mProcessing/Options.\e[0m In the Providers section scroll to “LASTools” \033[31mLASTools folder:\e[0m \e[32mLASTools directory\e[0m (unzipped) \033[31mWine Folder:\e[0m \e[32m#{Formula["wine"].opt_bin}\e[0m\n EOS s += <<~EOS If you have built GRASS 7 for the Processing plugin set the following in QGIS \e[32mProcessing -> Options: Providers -> GRASS GIS 7 commands -> GRASS 7 folder\e[0m to \e[32m#{HOMEBREW_PREFIX}/opt/osgeo-grass/grass-base\e[0m EOS s += <<~EOS QGIS plugins may need extra Python modules to function. Most can be installed with \e[32mpip\e[0m in a Terminal: \e[32mpip3 install modulename\e[0m If you want to upgrade modules, add the \e[32m-U\e[0m option: \e[32mpip3 install -U modulename\e[0m EOS s += <<~EOS Activate plugins \e[32mManage and Install Plugins -> Installed -> Plugin name\e[0m (click its checkbox) EOS s end test do output = `#{bin}/#{name.to_s} --help 2>&1` # why does help go to stderr? assert_match /^QGIS is a user friendly/, output end private def majmin_ver grass_version = "#{Formula["osgeo-grass"].version}" ver_split = grass_version.to_s.split(".") ver_split[0] + ver_split[1] end # def brewed_openscenegraph? # Formula["osgeo-openscenegraph"].opt_prefix.exist? # end # def brewed_osgqt? # Formula["osgeo-osgqt"].opt_prefix.exist? # end # def brewed_osgearth? # Formula["osgeo-osgearth"].opt_prefix.exist? # end def brewed_oracle? Formula["osgeo-oracle-client-sdk"].opt_prefix.exist? end def brewed_python? Formula["python"].linked_keg.exist? end def python_exec if brewed_python? "#{Formula["python"].opt_bin}/python3" else py_exec = `which python3`.strip raise if py_exec == "" py_exec end end def py_ver `#{python_exec} -c 'import sys;print("{0}.{1}".format(sys.version_info[0],sys.version_info[1]))'`.strip end def python_prefix `#{python_exec} -c 'import sys;print(sys.prefix)'`.strip end def qgis_python_packages "#{opt_prefix}/QGIS.app/Contents/Resources/python" end def qgis_site_packages "#{opt_lib}/python#{py_ver}/site-packages" end def python_site_packages "#{HOMEBREW_PREFIX}/opt/lib/python#{py_ver}/site-packages" end def gdal_python_packages "#{Formula["osgeo-gdal-python"].opt_lib}/python#{py_ver}/site-packages" end def gdal_python_opt_bin "#{Formula["osgeo-gdal-python"].opt_bin}" end def gdal_opt_bin "#{Formula["osgeo-gdal"].opt_bin}" end end __END__ --- a/cmake/FindQsci.cmake +++ b/cmake/FindQsci.cmake @@ -21,16 +21,20 @@ SET(QSCI_FOUND TRUE) ELSE(EXISTS QSCI_MOD_VERSION_STR) - FIND_FILE(_find_qsci_py FindQsci.py PATHS ${CMAKE_MODULE_PATH}) + # FIND_FILE(_find_qsci_py FindQsci.py PATHS ${CMAKE_MODULE_PATH}) SET(QSCI_VER 5) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_qsci_py} ${QSCI_VER} OUTPUT_VARIABLE qsci_ver) + # EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_qsci_py} ${QSCI_VER} OUTPUT_VARIABLE qsci_ver) IF(qsci_ver) STRING(REGEX REPLACE "^qsci_version_str:([^\n]+).*$" "\\1" QSCI_MOD_VERSION_STR ${qsci_ver}) SET(QSCI_FOUND TRUE) ENDIF(qsci_ver) + + SET(QSCI_FOUND TRUE) + SET(QSCI_MOD_VERSION_STR 2.11.1) + IF(QSCI_FOUND) FIND_PATH(QSCI_SIP_DIR --- a/cmake/FindPyQt5.py +++ b/cmake/FindPyQt5.py @@ -39,7 +39,7 @@ import os.path import sys cfg = sipconfig.Configuration() - sip_dir = cfg.default_sip_dir + sip_dir = "HOMEBREW_PREFIX/share/sip" if sys.platform.startswith('freebsd'): py_version = str(sys.version_info.major) + str(sys.version_info.minor) sip_dir = sip_dir.replace(py_version, '') --- a/cmake/FindPyQt5.cmake +++ b/cmake/FindPyQt5.cmake @@ -37,9 +37,7 @@ STRING(REGEX REPLACE ".*\npyqt_version_num:([^\n]+).*$" "\\1" PYQT5_VERSION_NUM ${pyqt_config}) STRING(REGEX REPLACE ".*\npyqt_mod_dir:([^\n]+).*$" "\\1" PYQT5_MOD_DIR ${pyqt_config}) STRING(REGEX REPLACE ".*\npyqt_sip_dir:([^\n]+).*$" "\\1" PYQT5_SIP_DIR ${pyqt_config}) - IF(EXISTS ${PYQT5_SIP_DIR}/Qt5) - SET(PYQT5_SIP_DIR ${PYQT5_SIP_DIR}/Qt5) - ENDIF(EXISTS ${PYQT5_SIP_DIR}/Qt5) + SET(PYQT5_SIP_DIR ${PYQT5_SIP_DIR}) STRING(REGEX REPLACE ".*\npyqt_sip_flags:([^\n]+).*$" "\\1" PYQT5_SIP_FLAGS ${pyqt_config}) STRING(REGEX REPLACE ".*\npyqt_bin_dir:([^\n]+).*$" "\\1" PYQT5_BIN_DIR ${pyqt_config}) STRING(REGEX REPLACE ".*\npyqt_sip_module:([^\n]+).*$" "\\1" PYQT5_SIP_IMPORT ${pyqt_config}) --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -509,7 +509,7 @@ if ( QgsProject::instance()->isDirty() ) caption.prepend( '*' ); - caption += QgisApp::tr( "QGIS" ); + caption += QgisApp::tr( "OSGeo4Mac - QGIS" ); if ( Qgis::QGIS_VERSION.endsWith( QLatin1String( "Master" ) ) ) { --- a/src/ui/qgsabout.ui +++ b/src/ui/qgsabout.ui @@ -244,6 +244,16 @@ + + + + + OSGeo4Mac Team / Maintainer: @fjperini - Collaborator: @luispuerto + + + Qt::AlignCenter + + ================================================ FILE: boneyard/osgeo-qgis-res.rb ================================================ ################################################################################ # Maintainer: FJ Perini @fjperini # Collaborator: Luis Puerto @luispuerto ################################################################################ class OsgeoQgisRes < Formula include Language::Python::Virtualenv desc "Resources for QGIS" homepage "https://www.qgis.org" url "https://gist.githubusercontent.com/dakcarto/11385561/raw/e49f75ecec96ed7d6d3950f45ad3f30fe94d4fb2/pyqgis_startup.py" sha256 "385dce925fc2d29f05afd6508bc1f46ec84c0bc607cc0c8dfce78a4bb93b9c4e" version "3.8.0" # revision 1 bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "8e9ab749b7f1aa6d8e423803ac837038cc46c1c63e9b5c6581fa80068a7fc0c4" => :mojave sha256 "8e9ab749b7f1aa6d8e423803ac837038cc46c1c63e9b5c6581fa80068a7fc0c4" => :high_sierra sha256 "550e3697860fc778b23e93b38246da65181afef57872f4616e11ee29cb38be7c" => :sierra end option "with-pg10", "Build with PostgreSQL 10 client" depends_on "pkg-config" => :build depends_on "gcc" => :build # for gfortran # numpy depends_on "python" => :build depends_on "swig" => :build depends_on "lapack" depends_on "openblas" depends_on "cython" depends_on "libyaml" # yaml depends_on "tcl-tk" # six depends_on "openjpeg" # for Pillow depends_on "zlib" # for Pillow depends_on "freetype" depends_on "dbus" depends_on "glib" depends_on "qt" depends_on "osgeo-pyqt" # psycopg2 if build.with?("pg10") depends_on "osgeo-postgresql@10" else depends_on "osgeo-postgresql" end depends_on "swig" depends_on "libagg" depends_on "libpng" depends_on "openssl" depends_on "libssh" depends_on "qhull" depends_on "ghostscript" depends_on "cairo" depends_on "py3cairo" depends_on "libsvg-cairo" depends_on "librsvg" depends_on "svg2pdf" depends_on "gtk+3" depends_on "pygobject3" depends_on "pygobject" depends_on "pygtk" depends_on "wxpython" depends_on "ffmpeg" depends_on "imagemagick" depends_on "numpy" depends_on "scipy" depends_on "osgeo-matplotlib" depends_on "osgeo-gdal-python" # osgeo-gdal: for Fiona depends_on "spatialindex" # for Rtree depends_on "hdf5" # for h5py depends_on "unixodbc" # for pyodbc depends_on "pyside" # for pyqtgraph / required llvm depends_on "freetds" # for pymssql # R with more support # https://github.com/adamhsparks/setup_macOS_for_R # rpy2 requires finding R # unless Formula["sethrfore/r-srf/r"].linked_keg.exist? depends_on "r" # end # for rpy2 depends_on "gettext" depends_on "readline" depends_on "pcre" depends_on "xz" depends_on "bzip2" depends_on "libiconv" depends_on "icu4c" # pyqgis_startup.py # TODO: add one for Py3 (only necessary when macOS ships a Python3 or 3rd-party isolation is needed) # resource "pyproj" do # url "https://files.pythonhosted.org/packages/93/48/956b9dcdddfcedb1705839280e02cbfeb2861ed5d7f59241210530867d5b/numpy-1.16.3.zip" # sha256 "78a6f89da87eeb48014ec652a65c4ffde370c036d780a995edaeb121d3625621" # end resource "numpy" do url "https://files.pythonhosted.org/packages/93/48/956b9dcdddfcedb1705839280e02cbfeb2861ed5d7f59241210530867d5b/numpy-1.16.3.zip" sha256 "78a6f89da87eeb48014ec652a65c4ffde370c036d780a995edaeb121d3625621" end resource "scipy" do url "https://files.pythonhosted.org/packages/cb/97/361c8c6ceb3eb765371a702ea873ff2fe112fa40073e7d2b8199db8eb56e/scipy-1.3.0.tar.gz" sha256 "c3bb4bd2aca82fb498247deeac12265921fe231502a6bc6edea3ee7fe6c40a7a" end resource "matplotlib" do url "https://files.pythonhosted.org/packages/26/04/8b381d5b166508cc258632b225adbafec49bbe69aa9a4fa1f1b461428313/matplotlib-3.0.3.tar.gz" sha256 "e1d33589e32f482d0a7d1957bf473d43341115d40d33f578dad44432e47df7b7" end def install # install python environment venv = virtualenv_create(libexec/'vendor', "#{Formula["python"].opt_bin}/python3") py_ver = Language::Python.major_minor_version "#{libexec}/vendor/bin/python3" # fix pip._vendor.pep517.wrappers.BackendUnavailable // use pip<19.0.0 system libexec/"vendor/bin/pip3", "install", "--upgrade", "-v", "setuptools", "pip", "wheel" res_r = ['rpy2', 'sphinxcontrib-websupport'] res_r.each do |r| venv.pip_install r end # fix ModuleNotFoundError: No module named 'pip.req' system libexec/"vendor/bin/pip3", "install", "--upgrade", "-v", "setuptools", "pip==9.0.3", "wheel" venv.pip_install "pyRscript" # fix pip._vendor.pep517.wrappers.BackendUnavailable system libexec/"vendor/bin/pip3", "install", "--upgrade", "-v", "setuptools", "pip<19.0.0", "wheel" res_required = ['requests', 'six', 'future', 'Sphinx', 'setuptools-scm', 'chardet', 'idna', 'urllib3', 'PySocks', 'Pillow', 'cycler', \ 'kiwisolver', 'tornado', 'Unidecode', 'pyparsing', 'MarkupSafe', 'nose', 'Cython', 'python-dateutil', 'pytz', 'Jinja2', 'OWSLib', \ 'psycopg2', 'Pygments', 'PyYAML', "dbus-python", "PyOpenGL", 'certifi', 'funcsigs', 'coverage', 'mock', 'pbr', 'termcolor', 'oauthlib', 'pyOpenSSL', 'httplib2'] res_required.each do |r| venv.pip_install r end resource("numpy").stage do openblas = Formula["openblas"].opt_prefix ENV["ATLAS"] = "None" # avoid linking against Accelerate.framework ENV["BLAS"] = ENV["LAPACK"] = "#{openblas}/lib/libopenblas.dylib" config = <<~EOS [openblas] libraries = openblas library_dirs = #{openblas}/lib include_dirs = #{openblas}/include EOS Pathname("site.cfg").write config system "#{libexec}/vendor/bin/python3", "setup.py", "build", "--fcompiler=gnu95", "--parallel=#{ENV.make_jobs}", "install", "--prefix=#{libexec}/vendor", "--single-version-externally-managed", "--record=installed.txt" end resource("scipy").stage do openblas = Formula["openblas"].opt_prefix ENV["ATLAS"] = "None" # avoid linking against Accelerate.framework ENV["BLAS"] = ENV["LAPACK"] = "#{openblas}/lib/libopenblas.dylib" config = <<~EOS [DEFAULT] library_dirs = #{HOMEBREW_PREFIX}/lib include_dirs = #{HOMEBREW_PREFIX}/include [openblas] libraries = openblas library_dirs = #{openblas}/lib include_dirs = #{openblas}/include EOS Pathname("site.cfg").write config system "#{libexec}/vendor/bin/python3", "setup.py", "build", "--fcompiler=gnu95", "install", "--prefix=#{libexec}/vendor" # cleanup leftover .pyc files from previous installs which can cause problems # see https://github.com/Homebrew/homebrew-python/issues/185#issuecomment-67534979 rm_f Dir["#{libexec}/vendor/lib/python*.*/site-packages/scipy/**/*.pyc"] end resource("matplotlib").stage do if DevelopmentTools.clang_build_version >= 900 ENV.delete "SDKROOT" ENV.delete "HOMEBREW_SDKROOT" end inreplace "setupext.py", "'darwin': ['/usr/local/'", "'darwin': ['#{HOMEBREW_PREFIX}'" system "#{libexec}/vendor/bin/python3", "setup.py", "install", "--prefix=#{libexec}/vendor" end res_optional = ['argparse', 'asn1crypto', 'atlas', 'backports.functools_lru_cache', 'beautifulsoup4', 'blosc', 'bottleneck', \ 'cffi', 'cryptography', 'decorator', 'descartes', 'ExifRead', 'Fiona', 'geopandas', 'geopy', 'geos', 'gitdb', 'gitdb2', 'GitPython', \ 'gnm', 'h5py', 'ipython', 'ipython_genutils', 'jsonschema', 'jupyter', 'jupyter_core', 'lidar', 'lxml', 'mpmath', 'nbformat', \ 'networkx', 'nltk', 'nose2', 'numexpr', 'olefile', 'openpyxl', 'palettable', 'pandas', 'pandas_oracle', 'pandas-datareader', 'pgi', \ 'plotly', 'ply', 'pubsub', 'py-postgresql', 'py2oracle', 'pycparser', 'pymssql', 'PyMySQL', 'pyodbc', 'PyPubSub', \ 'pyqtgraph', 'Pyro4', 'PySAL', 'pytest', 'pytils', 'qtpy', 'retrying', 'Rtree', 'seaborn', 'Shapely', 'simplejson', 'smmap', \ 'smmap2', 'sqlalchemy', 'statsmodels', 'subprocess32', 'sympy', 'test', 'tools', 'traitlets', 'whitebox', 'xlrd', 'xlsxwriter', 'xlwt'] # others: gmt-python, pytables res_optional.each do |r| venv.pip_install r end # 'scikit-learn': It seems that scikit-learn cannot be built with OpenMP support # 'pyproj': version 2.0.0 supports & requires PROJ 6 system libexec/"vendor/bin/pip3", "install", "--upgrade", "-v", "setuptools", "pip<19.0.0", "wheel", "scikit-learn==0.19.2", "pyproj==1.9.6" # upgrade pip # system libexec/"vendor/bin/pip3", "install", "--upgrade", "-v", "setuptools", "pip", "wheel" cp_r "#{buildpath}/pyqgis_startup.py", "#{libexec}" end def caveats s = <<~EOS This formula was created to have more Python modules and save time using the generated bottle. It is not necessary to build each time a new version or revision of the QGIS formula is generated. It will only be updated if necessary, although you can choose to update modules if you wish, just remember that you will need to build QGIS again. EOS s end test do # TODO end end ================================================ FILE: boneyard/osgeo-qgis.rb ================================================ ################################################################################ # Maintainer: FJ Perini @fjperini # Collaborator: Luis Puerto @luispuerto ################################################################################ class UnlinkedQGIS < Requirement fatal true satisfy(:build_env => false) { !qt4_linked && !pyqt4_linked && !txt2tags_linked } def qt4_linked (Formula["qt-4"].linked_keg/"lib/QtCore.framework/Versions/4").exist? rescue return false end def pyqt4_linked (Formula["pyqt-qt4"].linked_keg/"lib/qt-4/python2.7/site-packages/PyQt4").exist? rescue return false end def txt2tags_linked Formula["txt2tags"].linked_keg.exist? rescue return false end def message s = "Compilation can fail if these formulae are installed and linked:\n\n" s += "Unlink with `brew unlink qt-4` or remove with `brew uninstall qt-4`\n" if qt4_linked s += "Unlink with `brew unlink pyqt-qt4` or remove with `brew uninstall pyqt-qt4`\n" if pyqt4_linked s += "Unlink with `brew unlink txt2tags` or remove with `brew uninstall txt2tags`\n" if txt2tags_linked s end end class OsgeoQgis < Formula desc "Open Source Geographic Information System" homepage "https://www.qgis.org" url "https://github.com/qgis/QGIS/archive/final-3_8_0.tar.gz" sha256 "f6db56b8cce8482933ec492b26376a2c62cb269cd1b722b374b6c828e35f258e" # version "3.8.0" revision 1 bottle do root_url "https://bottle.download.osgeo.org" cellar :any sha256 "2a576d409659dee8a6033356b06962aee01782dd7a00240039bf15ba880ba227" => :mojave sha256 "2a576d409659dee8a6033356b06962aee01782dd7a00240039bf15ba880ba227" => :high_sierra sha256 "7c7b0b8c196a716380ed817749a519680487fd82ec472e7ac347e8fa41b3b824" => :sierra end head "https://github.com/qgis/QGIS.git", :branch => "master" # fix FindQsci and FindPyQt5 patch :DATA def pour_bottle? brewed_python? end option "without-debug", "Disable debug build, which outputs info to system.log or console" option "without-ninja", "Disable use of ninja CMake generator" option "without-server", "Build without QGIS Server (qgis_mapserv.fcgi)" option "without-postgresql", "Build without current PostgreSQL client" option "without-pyqt5-webkit", "Build without webkit python bindings" option "without-qgis-res", "Build without QGIS Resources support" option "with-api-docs", "Build the API documentation with Doxygen and Graphviz" option "with-isolation", "Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs" option "with-mssql", "Build with Microsoft ODBC Driver for SQL Server" option "with-oracle", "Build extra Oracle geospatial database and raster support" option "with-pg10", "Build with PostgreSQL 10 client" # option "with-globe", "Build with Globe plugin, based upon osgEarth" # Build with 3D Map View panel # Build with GPSBabel. Read, write and manipulate GPS waypoints in a variety of formats # Build with GRASS 7 integration plugin and Processing plugin support (or install grass-7x first) # Build with LAStools, efficient tools for LiDAR processing. Contains LASlib, a C++ programming API for reading / writing LIDAR data stored in standard LAS format. # Build extra Orfeo Toolbox for Processing plugin # Build QSpatialite Qt database driver # Build extra R for Processing plugin # Build extra Saga GIS (LTS) for Processing plugin # Build with QGIS Server (qgis_mapserv.fcgi) # Build with TauDEM, Terrain Analysis Using Digital Elevation Models for hydrology # Build with Whitebox Tools, an advanced geospatial data analysis platform deprecated_option "with-saga-gis-lts" => "with-saga" deprecated_option "with-postgresql10" => "with-pg10" depends_on UnlinkedQGIS # required depends_on "cmake" => :build depends_on "ninja" => [:build, :recommended] depends_on "gsl" => :build # Georeferencer plugin depends_on "six" => [:build, :recommended] depends_on "osgeo-sip" => [:build, :recommended] depends_on "bison" => :build depends_on "flex" => :build depends_on "pkg-config" => :build depends_on "python" depends_on "osgeo-gdal-python" # gdal - core providers depends_on "libzip" depends_on "osgeo-qscintilla2" depends_on "qca" depends_on "qt" depends_on "osgeo-pyqt" depends_on "osgeo-pyqt-webkit" # qt5-webkit depends_on "osgeo-qtkeychain" depends_on "qwt" depends_on "spatialindex" depends_on "sqlite" depends_on "expat" depends_on "osgeo-proj" depends_on "hdf5" depends_on "geos" depends_on "libtasn1" depends_on "osgeo-libspatialite" depends_on "qwtpolar" depends_on "desktop-file-utils" depends_on "hicolor-icon-theme" # recommended depends_on "openssl" depends_on "qjson" depends_on "unixodbc" # depends_on "libiodbc" depends_on "freetds" depends_on "osgeo-psqlodbc" depends_on "libpq" depends_on "osgeo-postgis" depends_on "exiv2" depends_on "osgeo-liblas" depends_on "osgeo-netcdf" depends_on "osgeo-pdal" depends_on "szip" depends_on "openvpn" depends_on "curl" depends_on "libiconv" depends_on "poppler" depends_on "gnu-sed" depends_on "git" depends_on "libxml2" depends_on "libffi" depends_on "numpy" depends_on "scipy" depends_on "osgeo-matplotlib" if build.with?("api-docs") depends_on "graphviz" => :build depends_on "doxygen" => :build end # requires python modules # jinja - MetaSearch # numpy - Processing # owslib - MetaSearch # psycopg2 - DB Manager and Processing # pygments - MetaSearch # yaml - Processing # many useful modules are incorporated depends_on "osgeo-qgis-res" # fcgi - server depends_on "fcgi" depends_on "spawn-fcgi" depends_on "lighttpd" # core plugins (c++ and python # grass depends_on "osgeo-grass" depends_on "gettext" depends_on "gpsbabel" # GPS Tools plugin # the Globe Plugin for QGIS 3 is still not available, # only for QGIS 2 and it does not support a larger version than OSGearh v2.7. # working on the implementation # if build.with? "globe" # depends_on "osgeo-openscenegraph" # depends_on "osgeo-osgqt" # depends_on "osgeo-osgearth" # end # TODO: remove "pyspatialite" when PyPi package supports spatialite 4.x # or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite) # TODO: what to do for Py3 and pyspatialite? depends_on "osgeo-pyspatialite" # for DB Manager # use newer postgresql client than Apple's, also needed by `psycopg2` if build.with?("pg10") depends_on "osgeo-postgresql@10" else depends_on "osgeo-postgresql" end depends_on "osgeo-oracle-client-sdk" if build.with?("oracle") # TODO: add MSSQL third-party support formula?, :optional if build.with?("mssql") depends_on "microsoft/mssql-release/msodbcsql17" depends_on "microsoft/mssql-release/mssql-tools" end depends_on "osgeo-qt-psql" depends_on "osgeo-qt-odbc" depends_on "osgeo-qt-mysql" # for eVis plugin # depends_on "osgeo-qt-tds" # obsolete from Qt 4.7 # depends_on "osgeo-qt-oci" # from oracle-client-sdk? # core processing plugin extras # see `grass` above depends_on "osgeo-orfeo" depends_on "osgeo-saga-lts" depends_on "osgeo-whitebox-tools" depends_on "osgeo-lastools" depends_on "osgeo-taudem" # R with more support # https://github.com/adamhsparks/setup_macOS_for_R # fix: will not build if the R version does not match # If you installed sethrfore/r-srf/r, before installing # rename "/usr/local/opt/r" to "/usr/local/Cellar/r-bk" # and then restore it after installing qgis depends_on "r" # optional # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools) # TODO: Fusion from USFS (via `wine`?) # R Plugin resource "r" do url "https://github.com/north-road/qgis-processing-r/archive/51371402c0200b6649fa3daa8ca8067e83aa6c15.tar.gz" sha256 "f6309e1edc334f76938f46a396c71e986b1910dd8c4c58936cad8d7fad54a346" version "1.0.5" end # OTB Plugin unless build.head? resource "otb" do url "https://gitlab.orfeo-toolbox.org/orfeotoolbox/qgis-otb-plugin/-/archive/d5e8f0a2e11e9d1d5b28f1a0d1f9af1a4985b477/qgis-otb-plugin-d5e8f0a2e11e9d1d5b28f1a0d1f9af1a4985b477.tar.gz" sha256 "939b89065604c10ee3a1b61f186e494f8e734aae1856547a32b1cb296dc4895b" version "1.4.2" end # # Patch: OtbUtils # resource "OtbUtils" do # url "https://gist.githubusercontent.com/fjperini/dc45ed0f637ae7dc8ec543a701e012f6/raw/c2b6bbafd6a9439bba903403f14c1b3c1ec3683d/OtbUtils.diff" # sha256 "b02c2fba5751dea84284072c590ce969ef215bb54e06cc2043ccbaf4449189e5" # end # # Patch: OtbAlgorithmProvider # resource "OtbAlgorithmProvider" do # url "https://gist.githubusercontent.com/fjperini/d8fe440818814c0800e5071a0ccb4f70/raw/034e1dc2950749fcf70b2fd2925df11aa6deaae3/OtbAlgorithmProvider.diff" # sha256 "add76b970cee0c42bd56af50da1f77e1a214ae8912e6b8e3da6e82611ecc30b5" # end end # WhiteboxTools Plugin resource "whitebox" do url "https://github.com/alexbruy/processing-whitebox/archive/5cbd81240e2a4e08fa0df515bf3dbf11957998ea.tar.gz" sha256 "4ccf112dae81447842ccaa08a86d3c5fa12b0a1087e8dc485723a5c8737ebbd9" version "0.9.0" end # Patch: whiteboxProvider resource "whiteboxProvider" do url "https://gist.githubusercontent.com/fjperini/fcb9f964c5396ab8b72c874a8db41b1d/raw/154deb8f17d52d11f1fba2642d43df2b1d0d936d/whiteboxProvider.diff" sha256 "e95191b38765d6072c1a637e735114cce03d53173e47b96626bb30930b5e9c7f" end # TauDEM Plugin resource "taudem" do url "https://github.com/alexbruy/processing-taudem/archive/38dc454c477b6a6e917f2b3777dc69ed3ecd6062.tar.gz" sha256 "7df793ae6a26ed65b6b15a8c8151b7f8598118b9f8da920eb260049d7c57229d" version "2.0.0" end # Patch: taudemProvider resource "taudemProvider" do url "https://gist.githubusercontent.com/fjperini/1899e20e0286058a74116aecf466f0a0/raw/a2fc2c7a31c747fca5fbed4e885a6503fe6a5d4c/taudemProvider.diff" sha256 "39a494f886d00011a0101b40715d828465592f304590438a7658d03298950cf5" end # Patch: taudemUtils resource "taudemUtils" do url "https://gist.githubusercontent.com/fjperini/f3e5ed0e964f4b7ead80a7c39a7115f6/raw/c3c8cca96d51156d0f60fe487b5b848faa3d0c2c/taudemUtils.diff" sha256 "3cf403f74c2ed67f6cdfb87c04cf0b09b085fb9f77ddde9be1d7f2ac12fe53a3" end # LAStools Plugin resource "lastools" do url "https://github.com/rapidlasso/LAStoolsPluginQGIS3/archive/55866f1685c03c8f9771a6a995550e08095b1f8a.tar.gz" sha256 "0badea99da9f14ae02a50860e368c48953eea921bf732593a2c059c090e1c248" version "1.3" end # Patch: LAStoolsProvider resource "LAStoolsProvider" do url "https://gist.githubusercontent.com/fjperini/d6dd9f294be338fba4a05959b845f095/raw/4da2e9e0bd931ad00b3ca66777c3a9d50cde18ba/LAStoolsProvider.diff" sha256 "82656a9fd6f42056d5c2a5487f2429b7f2c66c83287852fb644517abccecc563" end # splash resource "splash" do url "https://bottle.download.osgeo.org/qgis-splash/splash-3.8.png" sha256 "e53726b42fc4e11c97f667b662a052ef25ef0c7d99d358e2ee3a21189d2bfc04" end def install ENV.cxx11 # change splash rm "#{buildpath}/images/splash/splash.png" (buildpath/"images/splash").install resource("splash") mv "#{buildpath}/images/splash/splash-3.8.png", "#{buildpath}/images/splash/splash.png" # suggestions before installing printf "\n\033[31mSome suggestions that you should keep in mind!!!\e[0m\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" printf " QGIS will use the first Python that is in its PATH, so the installation may fail.\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" printf " Try after doing:\n\n" printf " \e[32m$ brew unlink python && brew link --force python\e[0m \e[1;33m(*)\e[0m\n\n" printf " \e[32m$ $PATH (Check that there is no other version)\e[0m\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" printf " Try after doing:\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" printf " \e[32m$ brew link --overwrite osgeo-pyqt\e[0m \e[1;33m(**)\e[0m\n\n" printf "- Other Notes:\n\n" printf " - An installation that failed previously may have created this link\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" printf " - Also make sure that the folder \033[31m#{HOMEBREW_PREFIX}/Cellar/qgis\e[0m does not exist if the installation fails.\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" printf " - If you are going to install with several options you may have the following error:\n\n" printf " \033[31mError: Too many open files @ rb_sysopen - #{HOMEBREW_PREFIX}/var/homebrew/locks/..\e[0m\n\n" printf " Check before with: \e[32m$ ulimit -n\e[0m\n" printf " You can change it temporarily to avoid this problem: \e[32m$ ulimit -n 1024\e[0m\n" printf " Will be re-established in the next session\n\n" printf " - If the installation failed with the error\n\n" printf " \033[31mfatal error: 'libintl.h' file not found\e[0m\n\n" printf " Try after doing: \e[32m$ brew unlink gettext && brew link --force gettext\e[0m \e[1;33m(***)\e[0m\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" printf "\n\033[31mto make sure everything works correctly.\e[0m\n\n" printf "\033[31mThe installation will continue, but remember the above.\e[0m\n" 30.downto(0) do |i| printf "#{'%02d'% i}." sleep 1 end printf "\n\n" # proceeds to install the add-ons as a first step, # to ensure that the patches are applied mkdir "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" # OTB is available from branch_3.8 unless build.head? # resource("otb").stage do # cp_r "./otb", "#{buildpath}/python/plugins/" # end resource("otb").stage do cp_r "./otb", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" end # resource("OtbUtils").stage do # cp_r "./OtbUtils.diff", "#{buildpath}" # end # resource("OtbAlgorithmProvider").stage do # cp_r "./OtbAlgorithmProvider.diff", "#{buildpath}" # end # system "patch", "-p1", "-i", "#{buildpath}/OtbUtils.diff" # system "patch", "-p1", "-i", "#{buildpath}/OtbAlgorithmProvider.diff" # cp_r "#{buildpath}/python/plugins/otb", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" end # R resource("r").stage do cp_r "./processing_r", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" end # WhiteboxTools resource("whitebox").stage do cp_r "./", "#{buildpath}/python/plugins/processing_whitebox" end resource("whiteboxProvider").stage do cp_r "./whiteboxProvider.diff", "#{buildpath}" end system "patch", "-p1", "-i", "#{buildpath}/whiteboxProvider.diff" cp_r "#{buildpath}/python/plugins/processing_whitebox", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" # TauDEM resource("taudem").stage do cp_r "./", "#{buildpath}/python/plugins/processing_taudem" end resource("taudemProvider").stage do cp_r "./taudemProvider.diff", "#{buildpath}" end resource("taudemUtils").stage do cp_r "./taudemUtils.diff", "#{buildpath}" end system "patch", "-p1", "-i", "#{buildpath}/taudemProvider.diff" system "patch", "-p1", "-i", "#{buildpath}/taudemUtils.diff" cp_r "#{buildpath}/python/plugins/processing_taudem", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" # LASTools resource("lastools").stage do cp_r "./LAStools", "#{buildpath}/python/plugins/lastools" end resource("LAStoolsProvider").stage do cp_r "./LAStoolsProvider.diff", "#{buildpath}" end system "patch", "-p1", "-i", "#{buildpath}/LAStoolsProvider.diff" cp_r "#{buildpath}/python/plugins/lastools", "#{prefix}/QGIS.app/Contents/Resources/python/plugins/" # if you have a 3rd party Python installed, and/or Python 3, # you need to remove it from your path for the installation. # once installed, QGIS will run even if the primary Python is, # for example, Anaconda Python 3. # reset path ENV["PATH"] = nil pths = "#{HOMEBREW_PREFIX}/bin:#{HOMEBREW_PREFIX}/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11/bin" ENV.append_path "PATH", "#{pths}" # when osgeo-gdal-python.rb loaded, PYTHONPATH gets set to 2.7 site-packages... # clear it before calling any local python3 functions ENV["PYTHONPATH"] = nil if ARGV.debug? puts "brewed_python?: #{brewed_python?}" puts "python_prefix: #{python_prefix}" puts "python_exec: #{python_exec}" puts "py_ver: #{py_ver}" puts "python_site_packages: #{python_site_packages}" puts "qgis_site_packages: #{qgis_site_packages}" puts "qgis_python_packages: #{qgis_python_packages}" puts "gdal_python_packages: #{gdal_python_packages}" puts "gdal_python_opt_bin: #{gdal_python_opt_bin}" puts "gdal_opt_bin: #{gdal_opt_bin}" end # set bundling level back to 0 (the default in all versions prior to 1.8.0) # so that no time and energy is wasted copying the Qt frameworks into QGIS. # install custom widgets Designer plugin to local qt plugins prefix mkdir lib/"qt/plugins/designer" inreplace "src/customwidgets/CMakeLists.txt", "${QT_PLUGINS_DIR}/designer", lib/"qt/plugins/designer".to_s # fix custom widgets Designer module install path mkdir lib/"python#{py_ver}/site-packages/PyQt5" inreplace "CMakeLists.txt", "${PYQT5_MOD_DIR}", lib/"python#{py_ver}/site-packages/PyQt5".to_s # install db plugins to local qt plugins prefix # qspatialite mkdir lib/"qt/plugins/sqldrivers" inreplace "external/qspatialite/CMakeLists.txt", "${QT_PLUGINS_DIR}/sqldrivers", lib/"qt/plugins/sqldrivers".to_s # end if build.with? "oracle" mkdir lib/"qt/plugins/sqldrivers" inreplace "src/providers/oracle/ocispatial/CMakeLists.txt", "${QT_PLUGINS_DIR}/sqldrivers", lib/"qt/plugins/sqldrivers".to_s end # support for PROJ 6 # https://github.com/OSGeo/proj.4/wiki/proj.h-adoption-status # ENV.append "CFLAGS", "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" args = std_cmake_args args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo" if build.with? "debug" # override cmake_prefixes = %w[ qt osgeo-qt-webkit osgeo-pyqt-webkit osgeo-qscintilla2 osgeo-pyqt osgeo-sip qwt qwtpolar qca osgeo-qtkeychain osgeo-gdal gsl geos osgeo-proj osgeo-libspatialite spatialindex expat sqlite libzip flex bison fcgi ].freeze # force CMake to search HB/opt paths first, so headers in HB/include are not found instead; # specifically, ensure any gdal v1 includes are not used args << "-DCMAKE_PREFIX_PATH=#{cmake_prefixes.map { |f| Formula[f.to_s].opt_prefix }.join(";")}" qwt_fw = Formula["qwt"].opt_lib/"qwt.framework" qwtpolar_fw = Formula["qwtpolar"].opt_lib/"qwtpolar.framework" qca_fw = Formula["qca"].opt_lib/"qca-qt5.framework" args += %W[ -DBISON_EXECUTABLE=#{Formula["bison"].opt_bin}/bison -DEXPAT_INCLUDE_DIR=#{Formula["expat"].opt_include} -DEXPAT_LIBRARY=#{Formula["expat"].opt_lib}/libexpat.dylib -DFLEX_EXECUTABLE=#{Formula["flex"].opt_bin}/flex -DPROJ_INCLUDE_DIR=#{Formula["osgeo-proj"].opt_include} -DPROJ_LIBRARY=#{Formula["osgeo-proj"].opt_lib}/libproj.dylib -DQCA_INCLUDE_DIR=#{qca_fw}/Headers -DQCA_LIBRARY=#{qca_fw}/qca-qt5 -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers -DQWT_LIBRARY=#{qwt_fw}/qwt -DSPATIALINDEX_INCLUDE_DIR=#{Formula["spatialindex"].opt_include} -DSPATIALINDEX_LIBRARY=#{Formula["spatialindex"].opt_lib}/libspatialindex.dylib -DSQLITE3_INCLUDE_DIR=#{Formula["sqlite"].opt_include} -DSQLITE3_LIBRARY=#{Formula["sqlite"].opt_lib}/libsqlite3.dylib -DLIBZIP_CONF_INCLUDE_DIR=#{Formula["libzip"].opt_lib}/pkgconfig -DLIBZIP_INCLUDE_DIR=#{Formula["libzip"].opt_include} -DLIBZIP_LIBRARY=#{Formula["libzip"].opt_lib}/libzip.dylib -DSPATIALITE_INCLUDE_DIR=#{Formula["osgeo-libspatialite"].opt_include} -DSPATIALITE_LIBRARY=#{Formula["osgeo-libspatialite"].opt_lib}/libspatialite.dylib -DQTKEYCHAIN_INCLUDE_DIR=#{Formula["qtkeychain"].opt_include}/qt5keychain -DQTKEYCHAIN_LIBRARY=#{Formula["osgeo-qtkeychain"].opt_lib}/libqt5keychain.dylib -DLIBTASN1_INCLUDE_DIR=#{Formula["libtasn1"].opt_include} -DLIBTASN1_LIBRARY=#{Formula["libtasn1"].opt_lib}/libtasn1.dylib -DPYRCC_PROGRAM=#{libexec}/vendor/bin/pyrcc5 -DPYUIC_PROGRAM=#{libexec}/vendor/bin/pyuic5 -DWITH_QWTPOLAR=TRUE -DWITH_INTERNAL_QWTPOLAR=FALSE -DWITH_QSCIAPI=FALSE -DWITH_CUSTOM_WIDGETS=TRUE -DWITH_ASTYLE=FALSE -DWITH_QTWEBKIT=TRUE -DQT_LRELEASE_EXECUTABLE=#{Formula["qt"].opt_bin}/lrelease -DQT5_3DEXTRA_INCLUDE_DIR=#{Formula["qt"].opt_lib}/cmake/Qt53DExtras -DQt5WebKitWidgets_DIR=#{Formula["osgeo-qt-webkit"].opt_lib}/cmake/Qt5WebKitWidgets -DQt5WebKit_DIR=#{Formula["osgeo-qt-webkit"].opt_lib}/cmake/Qt5WebKit ] args << "-DQGIS_MACAPP_BUNDLE=0" args << "-DQGIS_MACAPP_INSTALL_DEV=FALSE" # args << "-DQGIS_APP_NAME=QGIS-HB" # Build unit tests args << "-DENABLE_TESTS=FALSE" # Enable QT ModelTest (not for production) args << "-DENABLE_MODELTEST=FALSE" # Perform coverage tests args << "-DENABLE_COVERAGE=FALSE" args << "-DSIP_BINARY_PATH=#{Formula["osgeo-sip"].opt_bin}/sip" args << "-DSIP_DEFAULT_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip" args << "-DSIP_INCLUDE_DIR=#{Formula["osgeo-sip"].opt_include}" args << "-DSIP_MODULE_DIR=#{Formula["osgeo-sip"].opt_lib}/python#{py_ver}/site-packages" args << "-DPYQT5_MOD_DIR=#{Formula["python"].opt_prefix}/Frameworks/Python.framework/Versions/#{py_ver}/lib/python#{py_ver}/site-packages/PyQt5" args << "-DPYQT5_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip/PyQt5" # Qt5 args << "-DPYQT5_BIN_DIR=#{Formula["python"].opt_prefix}/Frameworks/Python.framework/Versions/#{py_ver}/bin" args << "-DPYQT5_SIP_IMPORT=PyQt5.sip" args << "-DPYQT5_SIP_FLAGS=-n PyQt5.sip -t WS_MACX -t Qt_5_12_1" args << "-DQSCI_SIP_DIR=#{HOMEBREW_PREFIX}/share/sip/PyQt5/Qsci" # Qsci/qscimod5.sip args << "-DQSCINTILLA_INCLUDE_DIR=#{Formula["osgeo-qscintilla2"].opt_include}" # Qsci/qsciglobal.h args << "-DQSCINTILLA_LIBRARY=#{Formula["osgeo-qscintilla2"].opt_lib}/libqscintilla2_qt5.dylib" # disable CCache args << "-DUSE_CCACHE=OFF" # Determines whether QGIS core should be built args << "-DWITH_CORE=TRUE" # Determines whether QGIS GUI library (and everything built on top of it) should be built args << "-DWITH_GUI=TRUE" # Determines whether QGIS analysis library should be built # args << "-DWITH_ANALYSIS=TRUE" # Determines whether QGIS desktop should be built args << "-DWITH_DESKTOP=TRUE" # Determines whether QGIS Quick library should be built args << "-DWITH_QUICK=FALSE" # Determines whether MDAL support should be built args << "-DWITH_INTERNAL_MDAL=TRUE" # Determines whether GeoReferencer plugin should be built args << "-DWITH_GEOREFERENCER=TRUE" # Determines whether std::thread_local should be used args << "-DWITH_THREAD_LOCAL=TRUE" # Determines whether Qt5SerialPort should be tried for GPS positioning # args << "-DWITH_QT5SERIALPORT=TRUE" # Use Clang tidy args << "-DWITH_CLANG_TIDY=FALSE" # try to configure and build python bindings by default # determines whether python bindings should be built args << "-DWITH_BINDINGS=TRUE" # by default bindings will be installed only to QGIS directory # someone might want to install it to python site-packages directory # as otherwise user has to use PYTHONPATH environment variable to add # QGIS bindings to package search path # install bindings to global python directory? (might need root) args << "-DBINDINGS_GLOBAL_INSTALL=FALSE" # Stage-install core Python plugins to run from build directory? (utilities and console are always staged) args << "-DWITH_STAGED_PLUGINS=TRUE" # Determines whether Python modules in staged or installed locations are byte-compiled" args << "-DWITH_PY_COMPILE=FALSE" # python Configuration args << "-DPYTHON_EXECUTABLE=#{`#{Formula["python"].opt_bin}/python3 -c "import sys; print(sys.executable)"`.chomp}" # args << "-DPYTHON_INCLUDE_PATH=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/include/python#{py_ver}m" # args << "-DPYTHON_LIBRARY=#{HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/#{py_ver}/Python" # args << "-DPYTHON_SITE_PACKAGES_DIR=#{HOMEBREW_PREFIX}/lib/python#{py_ver}/site-packages" # if using Homebrew's Python, make sure its components are always found first # see: https://github.com/Homebrew/homebrew/pull/28597 ENV["PYTHONHOME"] = python_prefix if brewed_python? # handle custom site-packages for keg-only modules and packages ENV.append_path "PYTHONPATH", "#{python_site_packages}" ENV.append_path "PYTHONPATH", "#{qgis_site_packages}" ENV.append_path "PYTHONPATH", "#{qgis_python_packages}" ENV.append_path "PYTHONPATH", "#{gdal_python_packages}" # find git revision for HEAD build if build.head? && File.exist?("#{cached_download}/.git/index") args << "-DGITCOMMAND=#{Formula["git"].opt_bin}/git" args << "-DGIT_MARKER=#{cached_download}/.git/index" # disable OpenCL support # necessary to build from branch: master # fix for CL/cl2.hpp # https://github.com/qgis/QGIS/pull/7451 # args << "-DUSE_OPENCL=OFF" end # used internal sources # args << "OPENCL_HPP_INCLUDE_DIR=" # server args << "-DWITH_SERVER=TRUE" args << "-DWITH_SERVER_PLUGINS=TRUE" fcgi_opt = Formula["fcgi"].opt_prefix args << "-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include" args << "-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib" # postgresql args << "-DWITH_POSTGRESQL=TRUE" if build.with?("pg10") args << "-DPOSTGRES_CONFIG=#{Formula["osgeo-postgresql@10"].opt_bin}/pg_config" args << "-DPOSTGRES_INCLUDE_DIR=#{Formula["osgeo-postgresql@10"].opt_include}" args << "-DPOSTGRES_LIBRARY=#{Formula["osgeo-postgresql@10"].opt_lib}/libpq.dylib" else args << "-DPOSTGRES_CONFIG=#{Formula["osgeo-postgresql"].opt_bin}/pg_config" args << "-DPOSTGRES_INCLUDE_DIR=#{Formula["osgeo-postgresql"].opt_include}" args << "-DPOSTGRES_LIBRARY=#{Formula["osgeo-postgresql"].opt_lib}/libpq.dylib" end # grass args << "-DWITH_GRASS7=TRUE" args << "-DWITH_GRASS=FALSE" # grass6 # this is to build the GRASS Plugin, not for Processing plugin support grass = Formula["osgeo-grass"] args << "-DGRASS_PREFIX7=#{grass.opt_prefix}/grass-base" # keep superenv from stripping (use Cellar prefix) ENV.append "CXXFLAGS", "-isystem #{grass.prefix.resolved_path}/grass-base/include" # So that `libintl.h` can be found (use Cellar prefix; should not be needed anymore with QGIS 2.99+) ENV.append "CXXFLAGS", "-isystem #{Formula["gettext"].include.resolved_path}" # args << "-DWITH_GLOBE=TRUE" # osg = Formula["osgeo-openscenegraph"] # osgqt = Formula["osgqt"] # osgearth = Formula["osgeo-osgearth"] # opoo "`osgeo-openscenegraph` formula's keg not linked." unless osg.linked_keg.exist? # # OSG # # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there # args << "-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}" # args << "-DOSG_DIR=#{osg.opt_prefix}" # args << "-DOSG_INCLUDE_DIR=#{osg.opt_include}" # osg/Node # args << "-DOSG_GEN_INCLUDE_DIR=#{osg.opt_include}" # osg/Config # args << "-DOSG_LIBRARY=#{osg.opt_lib}/libosg.dylib" # args << "-DOSGUTIL_LIBRARY=#{osg.opt_lib}/libosgUtil.dylib" # args << "-DOSGDB_LIBRARY=#{osg.opt_lib}/libosgDB.dylib" # args << "-DOSGTEXT_LIBRARY=#{osg.opt_lib}/libosgText.dylib" # args << "-DOSGTERRAIN_LIBRARY=#{osg.opt_lib}/libosgTerrain.dylib" # args << "-DOSGFX_LIBRARY=#{osg.opt_lib}/libosgFX.dylib" # args << "-DOSGSIM_LIBRARY=#{osg.opt_lib}/libosgSim.dylib" # args << "-DOSGVIEWER_LIBRARY=#{osg.opt_lib}/libosgViewer.dylib" # args << "-DOSGGA_LIBRARY=#{osg.opt_lib}/libosgGA.dylib" # args << "-DOSGQT_LIBRARY=#{osgqt.opt_lib}/libosgQt5.dylib" # args << "-DOSGWIDGET_LIBRARY=#{osg.opt_lib}/libosgWidget.dylib" # args << "-DOPENTHREADS_LIBRARY=#{osg.opt_lib}/libOpenThreads.dylib" # # args << "-DOPENTHREADS_INCLUDE_DIR=#{osg.opt_include}" # # args << "-DOSGSHADOW_LIBRARY=#{osg.opt_lib}/libosgShadow.dylib" # # args << "-DOSGMANIPULATOR_LIBRARY=#{osg.opt_lib}/libosgManipulator.dylib" # # args << "-DOSGPARTICLE_LIBRARY=#{osg.opt_lib}/libosgParticle.dylib" # # OSGEARTH # args << "-DOSGEARTH_DIR=#{osgearth.opt_prefix}" # args << "-DOSGEARTH_INCLUDE_DIR=#{osgearth.opt_include}" # osgEarth/TileSource # args << "-DOSGEARTH_GEN_INCLUDE_DIR=#{osgearth.opt_include}" # osgEarth/Common # args << "-DOSGEARTH_ELEVATION_QUERY=#{osgearth.opt_include}" # osgEarth/ElevationQuery # args << "-DOSGEARTH_LIBRARY=#{osgearth.opt_lib}/libosgEarth.dylib" # args << "-DOSGEARTHUTIL_LIBRARY=#{osgearth.opt_lib}/libosgEarthUtil.dylib" # args << "-DOSGEARTHFEATURES_LIBRARY=#{osgearth.opt_lib}/libosgEarthFeatures.dylib" # args << "-DOSGEARTHSYMBOLOGY_LIBRARY=#{osgearth.opt_lib}/libosgEarthSymbology.dylib" # args << "-DOSGEARTHQT_LIBRARY=#{osgearth.opt_lib}/libosgEarthQt5.dylib" # args << "-DOSGEARTHANNOTATION_LIBRARY=#{osgearth.opt_lib}/libosgEarthAnnotation.dylib" # # qt # args << "-DQt5OpenGL_INCLUDE_DIRS=#{Formula["qt"].opt_include}/QtOpenGL" args << "-DWITH_ORACLE=#{build.with?("oracle") || brewed_oracle? ? "TRUE" : "FALSE"}" if build.with?("oracle") || brewed_oracle? oracle_opt = Formula["osgeo-oracle-client-sdk"].opt_prefix args << "-DOCI_INCLUDE_DIR=#{oracle_opt}/include/oci" args << "-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib" end args << "-DWITH_QSPATIALITE=TRUE" args << "-DWITH_APIDOC=#{build.with?("api-docs") ? "TRUE" : "FALSE"}" args << "-DWITH_3D=TRUE" # args << "-DWITH_QTWEBKIT=#{build.with?("osgeo-qt-webkit") ? "TRUE" : "FALSE"}" # if build.with? "qtwebkit" #  args << "-DOPTIONAL_QTWEBKIT=#{Formula["osgeo-qt-webkit"].opt_lib}/cmake/Qt5WebKitWidgets" # end # prefer opt_prefix for CMake modules that find versioned prefix by default # this keeps non-critical dependency upgrades from breaking QGIS linking args << "-DGDAL_CONFIG=#{Formula["osgeo-gdal"].opt_bin}/gdal-config" args << "-DGDAL_INCLUDE_DIR=#{Formula["osgeo-gdal"].opt_include}" args << "-DGDAL_LIBRARY=#{Formula["osgeo-gdal"].opt_lib}/libgdal.dylib" args << "-DGEOS_CONFIG=#{Formula["geos"].opt_bin}/geos-config" args << "-DGEOS_INCLUDE_DIR=#{Formula["geos"].opt_include}" args << "-DGEOS_LIBRARY=#{Formula["geos"].opt_lib}/libgeos_c.dylib" args << "-DGSL_CONFIG=#{Formula["gsl"].opt_bin}/gsl-config" args << "-DGSL_INCLUDE_DIR=#{Formula["gsl"].opt_include}" args << "-DGSL_LIBRARIES='-L#{Formula["gsl"].opt_lib} -lgsl -lgslcblas'" # avoid ld: framework not found QtSql # (https://github.com/Homebrew/homebrew-science/issues/23) ENV.append "CXXFLAGS", "-F#{Formula["qt"].opt_lib}" # handle some compiler warnings # ENV["CXX_EXTRA_FLAGS"] = "-Wno-unused-private-field -Wno-deprecated-register" # if ENV.compiler == :clang && (MacOS::Xcode.version >= "7.0" || MacOS::CLT.version >= "7.0") # ENV.append "CXX_EXTRA_FLAGS", "-Wno-inconsistent-missing-override" # end args << "-DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations" # If set to true, it will disable deprecated functionality to prepare for the next generation of QGIS # args << "-DDISABLE_DEPRECATED=TRUE" # Newer versions of UseQt4.cmake include Qt with -isystem automatically # This can be used to force this behavior on older systems # Can be removed as soon as Travis-CI updates from precise # args << "-DSUPPRESS_QT_WARNINGS=TRUE" ENV.prepend_path "PATH", libexec/"vendor/bin" mkdir "#{libexec}/vendor/bin" # create pyrcc5 File.open("#{libexec}/vendor/bin/pyrcc5", "w") { |file| file << '#!/bin/sh' file << "\n" file << 'exec' + " #{Formula["python"].opt_bin}/python3 " + '-m PyQt5.pyrcc_main ${1+"$@"}' } # create pyuic5 File.open("#{libexec}/vendor/bin/pyuic5", "w") { |file| file << '#!/bin/sh' file << "\n" file << 'exec' + " #{Formula["python"].opt_bin}/python3 " + '-m PyQt5.pyuic5_main ${1+"$@"}' } chmod("+x", "#{libexec}/vendor/bin/pyrcc5") chmod("+x", "#{libexec}/vendor/bin/pyuic5") mkdir "build" do system "cmake", "-G", build.with?("ninja") ? "Ninja" : "Unix Makefiles", *args, ".." system "cmake", "--build", ".", "--target", "all", "--", "-j", Hardware::CPU.cores system "cmake", "--build", ".", "--target", "install", "--", "-j", Hardware::CPU.cores end # fixup some errant lib linking # TODO: fix upstream in CMake dy_libs = [lib/"qt/plugins/designer/libqgis_customwidgets.dylib"] dy_libs << lib/"qt/plugins/sqldrivers/libqsqlspatialite.dylib" # qspatialite dy_libs << lib/"qt/plugins/sqldrivers/libqsqlocispatial.dylib" if build.with? "oracle" dy_libs.each do |dy_lib| MachO::Tools.dylibs(dy_lib.to_s).each do |i_n| %w[core gui native].each do |f_n| sufx = i_n[/(qgis_#{f_n}\.framework.*)/, 1] next if sufx.nil? i_n_to = "#{opt_prefix}/QGIS.app/Contents/Frameworks/#{sufx}" puts "Changing install name #{i_n} to #{i_n_to} in #{dy_lib}" if ARGV.debug? dy_lib.ensure_writable do MachO::Tools.change_install_name(dy_lib.to_s, i_n.to_s, i_n_to, :strict => false) end end end end # update .app's bundle identifier, so other installers doesn't get confused inreplace prefix/"QGIS.app/Contents/Info.plist", "org.qgis.qgis3", "org.qgis.osgeo-qgis-hb#{build.head? ? "-dev" : ""}" py_lib = lib/"python#{py_ver}/site-packages" py_lib.mkpath ln_s "../../../QGIS.app/Contents/Resources/python/qgis", py_lib/"qgis" ln_s "QGIS.app/Contents/MacOS/fcgi-bin", prefix/"fcgi-bin" # server doc.mkpath mv prefix/"QGIS.app/Contents/Resources/doc/api", doc/"api" if build.with? "api-docs" ln_s "../../../QGIS.app/Contents/Resources/doc", doc/"doc" # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped) # only works with QGIS > 2.0.1 # doesn't need executable bit set, loaded by Python runner in QGIS # TODO: for Py3 cp_r "#{Formula["osgeo-qgis-res"].opt_libexec}/pyqgis_startup.py", "#{libexec}/pyqgis_startup.py" bin.mkdir qgis_bin = bin/name.to_s touch qgis_bin.to_s # so it will be linked into HOMEBREW_PREFIX qgis_bin.chmod 0755 post_install end def post_install # configure environment variables for .app and launching binary directly. # having this in `post_intsall` allows it to be individually run *after* installation with: # `brew postinstall -v ` app = prefix/"QGIS.app" tab = Tab.for_formula(self) opts = tab.used_options # bottle_poured = tab.poured_from_bottle # define default isolation env vars pthsep = File::PATH_SEPARATOR pypth = "#{python_site_packages}" pths = %W[#{HOMEBREW_PREFIX}/bin #{HOMEBREW_PREFIX}/sbin /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin] unless opts.include?("with-isolation") pths = ORIGINAL_PATHS.dup pyenv = ENV["PYTHONPATH"] if pyenv pypth = pyenv.include?(pypth) ? pyenv : pypth + pthsep + pyenv end end unless pths.include?(HOMEBREW_PREFIX/"bin") pths = pths.insert(0, HOMEBREW_PREFIX/"bin") end # set install's lib/python#{py_ver}/site-packages first, so app will work if unlinked pypths = %W[#{qgis_python_packages} #{qgis_site_packages} #{pypth}] pths.insert(0, "#{gdal_opt_bin}") pths.insert(0, "#{gdal_python_opt_bin}") pypths.insert(0, "#{gdal_python_packages}") # prepend qt based utils to PATH (reverse order) pths.insert(0, "#{Formula["qca"].opt_bin}") pths.insert(0, "#{Formula["osgeo-pyqt"].opt_bin}") pths.insert(0, "#{Formula["osgeo-sip"].opt_bin}") pths.insert(0, "#{Formula["qt"].opt_bin}") pths.insert(0, "#{Formula["gpsbabel"].opt_bin}") # we need to manually add the saga lts path, since it's keg only pths.insert(0, "#{Formula["osgeo-saga-lts"].opt_bin}") envars = { :PATH => pths.join(pthsep), :QGIS_BUNDLE => "#{opt_prefix}/QGIS.app/Contents", :QGIS_PREFIX_PATH => "#{opt_prefix}/QGIS.app/Contents/MacOS", :GDAL_DRIVER_PATH => "#{HOMEBREW_PREFIX}/lib/gdalplugins", :GDAL_DATA => "#{Formula["osgeo-gdal"].opt_share}/gdal", :CHECK_DISK_FREE_SPACE => "FALSE", :PYTHONPATH => pypths.join(pthsep), # if it is set, grass it will not work correctly, using Python 2 # it will be necessary to wait until it is built with Python 3 # :PYTHONHOME => "#{Formula["python"].opt_frameworks}/Python.framework/Versions/#{py_ver}", } # handle multiple Qt plugins directories qtplgpths = %W[ #{opt_lib}/qt/plugins #{Formula["qt"].opt_prefix}/plugins #{HOMEBREW_PREFIX}/lib/qt/plugins ] envars[:QT_PLUGIN_PATH] = qtplgpths.join(pthsep) envars[:QT_AUTO_SCREEN_SCALE_FACTOR] = "1" # https://github.com/OSGeo/homebrew-osgeo4mac/issues/447 # envars[:QT_AUTO_SCREEN_SCALE_FACTOR] = "0" # envars[:QT_DEVICE_PIXEL_RATIO] = "1" proc_plugins = "#{app}/Contents/Resources/python/plugins" proc_plugins_algs = "#{proc_plugins}/processing/algs" # for core integration plugin support # grass grass = Formula["osgeo-grass"] grass_version = "#{grass.version}" envars[:GRASS_PREFIX] = "#{grass.opt_prefix}/grass-base" envars[:GRASS_SH] = "/bin/sh" envars[:GRASS_PROJSHARE] = "#{Formula["osgeo-proj"].opt_share}" envars[:GRASS_VERSION] = "#{grass_version}" envars[:GRASS_LD_LIBRARY_PATH] = "#{grass.opt_prefix}/grass#{majmin_ver}/lib" # envars[:GRASS_PERL] = "#{Formula["perl"].opt_bin}/perl" envars[:PROJ_LIB] = "#{Formula["osgeo-proj"].opt_lib}" envars[:GEOTIFF_CSV] = "#{Formula["osgeo-libgeotiff"].opt_share}/epsg_csv" # envars[:R_HOME] = "#{Formula["r"].opt_bin}/R" # envars[:R_HOME] = "/Applications/RStudio.app/Contents/MacOS/RStudio" # envars[:R_USER] = "USER_PROFILE/Documents" begin inreplace "#{proc_plugins_algs}/grass7/Grass7Utils.py", "'/Applications/GRASS-7.{}.app/Contents/MacOS'.format(version)", "'#{grass.opt_prefix}/grass-base'" puts "GRASS 7 GrassUtils.py has been updated" rescue Utils::InreplaceError puts "GRASS 7 GrassUtils.py already updated" end # OTB is available from branch_3.8 # unless build.head? # orfeo = Formula["osgeo-orfeo"] # # envars[:QGIS_PLUGINPATH] = "#{orfeo.opt_prefix}" # begin # inreplace "#{proc_plugins}/otb/OTBUtils.py" do |s| # # default geoid path # # try to replace first, so it fails (if already done) before global replaces # s.sub! "OTB_FOLDER", "#{orfeo.opt_prefix}" # s.sub! "OTB_APP_FOLDER", "#{orfeo.opt_lib}/otb/applications" # s.sub! "OTB_GEOID_FILE", "#{orfeo.opt_libexec}/default_geoid/egm96.grd" # end # puts "ORFEO 6 OTBUtils.py has been updated" # rescue Utils::InreplaceError # puts "ORFEO 6 OTBUtils.py already updated" # end # end # R # Remove setting to activate provider # See: https://github.com/north-road/qgis-processing-r/commit/7d8d182962392297690c02f77829b8cd64b5e8a9#diff-ce2ac984448f961cfa0f7e446bdbd4ca # begin # inreplace "#{proc_plugins}/processing_r/processing/provider.py" do |s| # s.gsub! "'Activate'), False))", "'Activate'), True))" # end # puts "R RAlgorithmProvider.py has been updated" # rescue Utils::InreplaceError # puts "R provider.py already updated" # end # WhiteboxTools begin whitebox="#{Formula["osgeo-whitebox-tools"].opt_bin}/whitebox_tools" inreplace "#{proc_plugins}/processing_whitebox/whiteboxProvider.py" do |s| s.gsub! "/usr/local/opt/whitebox-tools/bin/whitebox_tools", "#{whitebox}" end puts "Whitebox Tools whiteboxProvider.py has been updated" rescue Utils::InreplaceError puts "Whitebox Tools whiteboxProvider.py already updated" end # TauDEM begin taudem="#{Formula["osgeo-taudem"].opt_bin}" mpich="#{Formula["open-mpi"].opt_bin}" inreplace "#{proc_plugins}/processing_taudem/taudemProvider.py" do |s| s.gsub! "/usr/local/opt/taudem/bin", "#{taudem}" s.gsub! "/usr/local/opt/open-mpi/bin", "#{mpich}" end puts "TauDEM taudemProvider.py and has been updated" rescue Utils::InreplaceError puts "TauDEM taudemProvider.py already updated" end # LASTools begin lastools="#{Formula["osgeo-lastools"].opt_prefix}" inreplace "#{proc_plugins}/lastools/LAStoolsProvider.py" do |s| s.gsub! 'C:\LAStools', "#{lastools}" end puts "LAStools LAStoolsProvider.py has been updated" rescue Utils::InreplaceError puts "LAStools LAStoolsProvider.py already updated" end unless opts.include?("without-globe") osg = Formula["osgeo-openscenegraph"] envars[:OSG_LIBRARY_PATH] = "#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}" end if opts.include?("with-isolation") envars[:DYLD_FRAMEWORK_PATH] = "#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks" versioned = %W[ #{Formula["sqlite"].opt_lib} #{Formula["expat"].opt_lib} #{Formula["libxml2"].opt_lib} #{HOMEBREW_PREFIX}/lib ] envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep) end # TODO: add for Py3 if opts.include?("with-isolation") || File.exist?("/Library/Frameworks/GDAL.framework") envars[:PYQGIS_STARTUP] = opt_libexec/"pyqgis_startup.py" end # envars.each { |key, value| puts "#{key.to_s}=#{value}" } # exit # add env vars to QGIS.app's Info.plist, in LSEnvironment section plst = app/"Contents/Info.plist" # first delete any LSEnvironment setting, ignoring errors # CAUTION!: may not be what you want, if .app already has LSEnvironment settings dflt = `defaults read-type \"#{plst}\" LSEnvironment 2> /dev/null` `defaults delete \"#{plst}\" LSEnvironment` if dflt kv = "{ " envars.each { |key, value| kv += "'#{key}' = '#{value}'; " } kv += "}" `defaults write \"#{plst}\" LSEnvironment \"#{kv}\"` # add ability to toggle high resolution in Get Info dialog for app hrc = `defaults read-type \"#{plst}\" NSHighResolutionCapable 2> /dev/null` `defaults delete \"#{plst}\" NSHighResolutionCapable` if hrc `defaults write \"#{plst}\" NSHighResolutionCapable \"True\"` # leave the plist readable; convert from binary to XML format `plutil -convert xml1 -- \"#{plst}\"` # make sure plist is readble by all users plst.chmod 0644 # update modification date on app bundle, or changes won't take effect touch app.to_s # add env vars to launch script for QGIS app's binary qgis_bin = bin/name.to_s rm_f qgis_bin if File.exist?(qgis_bin) # install generates empty file bin_cmds = %W[#!/bin/sh\n] # setup shell-prepended env vars (may result in duplication of paths) unless pths.include? HOMEBREW_PREFIX/"bin" pths.insert(0, HOMEBREW_PREFIX/"bin") end # even though this should be affected by with-isolation, allow local env override pths << "$PATH" pypths << "$PYTHONPATH" envars[:PATH] = pths.join(pthsep) envars[:PYTHONPATH] = pypths.join(pthsep) envars.each { |key, value| bin_cmds << "export #{key}=#{value}" } bin_cmds << opt_prefix/"QGIS.app/Contents/MacOS/QGIS \"$@\"" qgis_bin.write(bin_cmds.join("\n")) qgis_bin.chmod 0755 # link python modules (prefix/"QGIS.app/Contents/Resources/python").install_symlink Dir["#{Formula["osgeo-qgis-res"].opt_libexec}/vendor/lib/python#{py_ver}/site-packages/*"] (prefix/"QGIS.app/Contents/Resources/python/PyQt5").install_symlink Dir["#{Formula["osgeo-sip"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*"] ln_s "#{Formula["osgeo-sip"].opt_lib}/python#{py_ver}/site-packages/sipconfig.py", "#{prefix}/QGIS.app/Contents/Resources/python/sipconfig.py" ln_s "#{Formula["osgeo-sip"].opt_lib}/python#{py_ver}/site-packages/sipdistutils.py", "#{prefix}/QGIS.app/Contents/Resources/python/sipdistutils.py" (prefix/"QGIS.app/Contents/Resources/python/PyQt5").install_symlink Dir["#{Formula["osgeo-pyqt"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*"] (prefix/"QGIS.app/Contents/Resources/python/PyQt5").install_symlink Dir["#{Formula["osgeo-pyqt-webkit"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*"] (prefix/"QGIS.app/Contents/Resources/python/PyQt5").install_symlink Dir["#{Formula["osgeo-qscintilla2"].opt_lib}/python#{py_ver}/site-packages/PyQt5/*"] # (prefix/"QGIS.app/Contents/Resources/python").install_symlink Dir["#{Formula["osgeo-matplotlib"].opt_lib}/python#{py_ver}/site-packages/*"] # (prefix/"QGIS.app/Contents/Resources/python").install_symlink Dir["#{Formula["numpy"].opt_lib}/python#{py_ver}/site-packages/*"] # (prefix/"QGIS.app/Contents/Resources/python").install_symlink Dir["#{Formula["scipy"].opt_lib}/python#{py_ver}/site-packages/*"] (prefix/"QGIS.app/Contents/Resources/python").install_symlink Dir["#{Formula["osgeo-gdal-python"].opt_lib}/python#{py_ver}/site-packages/*"] # fix ImportError: No module named site for gdal_*.py mkdir "#{prefix}/QGIS.app/Contents/MacOS/bin" (prefix/"QGIS.app/Contents/MacOS/bin").install_symlink Dir["#{Formula["osgeo-gdal-python"].opt_bin}/*"] (prefix/"QGIS.app/Contents/MacOS/bin").install_symlink Dir["#{Formula["osgeo-gdal"].opt_bin}/*"] (prefix/"QGIS.app/Contents/Frameworks").install_symlink Dir["#{Formula["qt"].opt_frameworks}/*"] (prefix/"QGIS.app/Contents/Frameworks").install_symlink Dir["#{Formula["python"].opt_frameworks}/*"] ln_s "#{prefix}/QGIS.app/Contents/MacOS/lib", "#{prefix}/QGIS.app/Contents/MacOS/bin" ln_s "#{prefix}/QGIS.app/Contents/Frameworks", "#{prefix}/QGIS.app/Contents/MacOS" ln_s "#{Formula["python"].opt_bin}/python#{py_ver}", "#{prefix}/QGIS.app/Contents/MacOS/bin/python3" ln_s "#{Formula["python"].opt_bin}/python#{py_ver}", "#{prefix}/QGIS.app/Contents/MacOS/bin/python" end def caveats s = <<~EOS \nQGIS is built as an application bundle. Environment variables for the Homebrew prefix are embedded in \e[32mQGIS.app\e[0m: \e[32m#{opt_prefix}/QGIS.app\e[0m You may also symlink \e[32mQGIS.app\e[0m into \e[32m/Applications\e[0m or \e[32m~/Applications\e[0m: \e[32mln -Fs `find $(brew --prefix) -name "QGIS.app"` /Applications/QGIS.app\e[0m To directly run the \e[32m`QGIS.app/Contents/MacOS/QGIS`\e[0m binary use the wrapper script pre-defined with Homebrew prefix environment variables: \e[32m#{opt_bin}/#{name}\e[0m If you need QGIS to appear in Spotlight, create and run the following script: \e[32m#!/usr/bin/env bash\e[0m \e[32mqgis_location=$(find $(brew --prefix)/Cellar/osgeo-qgis/ -name "3.*" -print -quit)/QGIS.app\e[0m \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 https://github.com/OSGeo/homebrew-osgeo4mac/issues/607#issuecomment-455905926 NOTE: Your current PATH and PYTHONPATH environment variables are honored when launching via the wrapper script, while launching \e[32mQGIS.app\e[0m bundle they are not. For standalone Python 3 development, set the following environment variable: \e[32mexport PYTHONPATH=#{python_site_packages}:#{qgis_site_packages}:#{qgis_python_packages}:#{gdal_python_packages}:$PYTHONPATH\e[0m EOS if build.with?("isolation") s += <<~EOS \033[31mQGIS built with isolation enabled. This allows it to coexist with other types of installations of QGIS on your Mac. However, on versions >= 2.0.1, this also means Python modules installed in the *system* Python will NOT be available to Python processes within QGIS.app.\e[0m EOS end s += <<~EOS You installed LAStools! If you will use Wine to have more features: \n1 - Download \e[32mhttp://lastools.org/download/LAStools.zip\e[0m and unzip LASTools. Remember where you unzipped it. 2 - Start QGIS. Select \e[32mProcessing/Options.\e[0m In the Providers section scroll to “LASTools” \033[31mLASTools folder:\e[0m \e[32mLASTools directory\e[0m (unzipped) \033[31mWine Folder:\e[0m \e[32m#{Formula["wine"].opt_bin}\e[0m\n EOS s += <<~EOS If you have built GRASS 7 for the Processing plugin set the following in QGIS \e[32mProcessing -> Options: Providers -> GRASS GIS 7 commands -> GRASS 7 folder\e[0m to \e[32m#{HOMEBREW_PREFIX}/opt/osgeo-grass/grass-base\e[0m EOS s += <<~EOS QGIS plugins may need extra Python modules to function. Most can be installed with \e[32mpip\e[0m in a Terminal: \e[32mpip3 install modulename\e[0m If you want to upgrade modules, add the \e[32m-U\e[0m option: \e[32mpip3 install -U modulename\e[0m EOS s += <<~EOS Activate plugins \e[32mManage and Install Plugins -> Installed -> Plugin name\e[0m (click its checkbox) EOS s end test do output = `#{bin}/#{name.to_s} --help 2>&1` # why does help go to stderr? assert_match /^QGIS is a user friendly/, output end private def majmin_ver grass_version = "#{Formula["osgeo-grass"].version}" ver_split = grass_version.to_s.split(".") ver_split[0] + ver_split[1] end # def brewed_openscenegraph? # Formula["osgeo-openscenegraph"].opt_prefix.exist? # end # def brewed_osgqt? # Formula["osgeo-osgqt"].opt_prefix.exist? # end # def brewed_osgearth? # Formula["osgeo-osgearth"].opt_prefix.exist? # end def brewed_oracle? Formula["osgeo-oracle-client-sdk"].opt_prefix.exist? end def brewed_python? Formula["python"].linked_keg.exist? end def python_exec if brewed_python? "#{Formula["python"].opt_bin}/python3" else py_exec = `which python3`.strip raise if py_exec == "" py_exec end end def py_ver `#{python_exec} -c 'import sys;print("{0}.{1}".format(sys.version_info[0],sys.version_info[1]))'`.strip end def python_prefix `#{python_exec} -c 'import sys;print(sys.prefix)'`.strip end def qgis_python_packages "#{opt_prefix}/QGIS.app/Contents/Resources/python" end def qgis_site_packages "#{opt_lib}/python#{py_ver}/site-packages" end def python_site_packages "#{HOMEBREW_PREFIX}/opt/lib/python#{py_ver}/site-packages" end def gdal_python_packages "#{Formula["osgeo-gdal-python"].opt_lib}/python#{py_ver}/site-packages" end def gdal_python_opt_bin "#{Formula["osgeo-gdal-python"].opt_bin}" end def gdal_opt_bin "#{Formula["osgeo-gdal"].opt_bin}" end end __END__ --- a/cmake/FindQsci.cmake +++ b/cmake/FindQsci.cmake @@ -21,16 +21,20 @@ SET(QSCI_FOUND TRUE) ELSE(EXISTS QSCI_MOD_VERSION_STR) - FIND_FILE(_find_qsci_py FindQsci.py PATHS ${CMAKE_MODULE_PATH}) + # FIND_FILE(_find_qsci_py FindQsci.py PATHS ${CMAKE_MODULE_PATH}) SET(QSCI_VER 5) - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_qsci_py} ${QSCI_VER} OUTPUT_VARIABLE qsci_ver) + # EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_qsci_py} ${QSCI_VER} OUTPUT_VARIABLE qsci_ver) IF(qsci_ver) STRING(REGEX REPLACE "^qsci_version_str:([^\n]+).*$" "\\1" QSCI_MOD_VERSION_STR ${qsci_ver}) SET(QSCI_FOUND TRUE) ENDIF(qsci_ver) + + SET(QSCI_FOUND TRUE) + SET(QSCI_MOD_VERSION_STR 2.11.1) + IF(QSCI_FOUND) FIND_PATH(QSCI_SIP_DIR --- a/cmake/FindPyQt5.py +++ b/cmake/FindPyQt5.py @@ -39,7 +39,7 @@ import os.path import sys cfg = sipconfig.Configuration() - sip_dir = cfg.default_sip_dir + sip_dir = "HOMEBREW_PREFIX/share/sip" if sys.platform.startswith('freebsd'): py_version = str(sys.version_info.major) + str(sys.version_info.minor) sip_dir = sip_dir.replace(py_version, '') --- a/cmake/FindPyQt5.cmake +++ b/cmake/FindPyQt5.cmake @@ -37,9 +37,7 @@ STRING(REGEX REPLACE ".*\npyqt_version_num:([^\n]+).*$" "\\1" PYQT5_VERSION_NUM ${pyqt_config}) STRING(REGEX REPLACE ".*\npyqt_mod_dir:([^\n]+).*$" "\\1" PYQT5_MOD_DIR ${pyqt_config}) STRING(REGEX REPLACE ".*\npyqt_sip_dir:([^\n]+).*$" "\\1" PYQT5_SIP_DIR ${pyqt_config}) - IF(EXISTS ${PYQT5_SIP_DIR}/Qt5) - SET(PYQT5_SIP_DIR ${PYQT5_SIP_DIR}/Qt5) - ENDIF(EXISTS ${PYQT5_SIP_DIR}/Qt5) + SET(PYQT5_SIP_DIR ${PYQT5_SIP_DIR}) STRING(REGEX REPLACE ".*\npyqt_sip_flags:([^\n]+).*$" "\\1" PYQT5_SIP_FLAGS ${pyqt_config}) STRING(REGEX REPLACE ".*\npyqt_bin_dir:([^\n]+).*$" "\\1" PYQT5_BIN_DIR ${pyqt_config}) STRING(REGEX REPLACE ".*\npyqt_sip_module:([^\n]+).*$" "\\1" PYQT5_SIP_IMPORT ${pyqt_config}) # --- a/src/core/processing/qgsprocessingfeedback.cpp # +++ b/src/core/processing/qgsprocessingfeedback.cpp # @@ -22,6 +22,9 @@ # #if PROJ_VERSION_MAJOR > 4 # #include # #else # +#ifndef ACCEPT_USE_OF_DEPRECATED_PROJ_API_H # +#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H # +#endif # #include # #endif # # @@ -124,4 +127,3 @@ void QgsProcessingMultiStepFeedback::updateOverallProgress( double progress ) # double currentAlgorithmProgress = progress / mChildSteps; # mFeedback->setProgress( baseProgress + currentAlgorithmProgress ); # } # - --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -509,7 +509,7 @@ if ( QgsProject::instance()->isDirty() ) caption.prepend( '*' ); - caption += QgisApp::tr( "QGIS" ); + caption += QgisApp::tr( "OSGeo4Mac - QGIS" ); if ( Qgis::QGIS_VERSION.endsWith( QLatin1String( "Master" ) ) ) { --- a/src/ui/qgsabout.ui +++ b/src/ui/qgsabout.ui @@ -244,6 +244,16 @@ + + + + + OSGeo4Mac Team / Maintainer: @fjperini - Collaborator: @luispuerto + + + Qt::AlignCenter + + ================================================ FILE: boneyard/osgeo-sip.rb ================================================ class Unlinked < Requirement fatal true satisfy(:build_env => false) { !core_sip_linked } def core_sip_linked Formula["sip"].linked_keg.exist? rescue return false end def message s = "\033[31mYou have other linked versions!\e[0m\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 s end end class OsgeoSip < Formula desc "Tool to create Python bindings for C and C++ libraries" homepage "https://www.riverbankcomputing.com/software/sip/intro" url "https://www.riverbankcomputing.com/static/Downloads/sip/4.19.22/sip-4.19.22.tar.gz" sha256 "e1b768824ec1a2ee38dd536b6b6b3d06de27b00a2f5f55470d1b512306e3be45" # revision 5 head "https://www.riverbankcomputing.com/hg/sip", :using => :hg bottle do root_url "https://bottle.download.osgeo.org" cellar :any_skip_relocation sha256 "85280c9f58b9b1e4f601cebb09b1a69729030ea4188348fde32d02698db5cb55" => :catalina sha256 "85280c9f58b9b1e4f601cebb09b1a69729030ea4188348fde32d02698db5cb55" => :mojave sha256 "85280c9f58b9b1e4f601cebb09b1a69729030ea4188348fde32d02698db5cb55" => :high_sierra end # keg_only "sip" is already provided by homebrew/core" # we will verify that other versions are not linked depends_on Unlinked depends_on "python" def install ENV.prepend_path "PATH", Formula["python"].opt_libexec/"bin" ENV.delete("SDKROOT") # Avoid picking up /Application/Xcode.app paths if build.head? # Link the Mercurial repository into the download directory so # build.py can use it to figure out a version number. ln_s cached_download/".hg", ".hg" # build.py doesn't run with python3 system "python3", "build.py", "prepare" end version = Language::Python.major_minor_version "python3" system "python3", "configure.py", "--deployment-target=#{MacOS.version}", "--destdir=#{lib}/python#{version}/site-packages", "--bindir=#{bin}", "--incdir=#{include}", "--sipdir=#{HOMEBREW_PREFIX}/share/sip", "--sip-module=PyQt5.sip", "--no-dist-info" system "make" system "make", "install" system "make", "clean" end def post_install (HOMEBREW_PREFIX/"share/sip").mkpath end def caveats; <<~EOS The sip-dir for Python is #{HOMEBREW_PREFIX}/share/sip. EOS end test do (testpath/"test.h").write <<~EOS #pragma once class Test { public: Test(); void test(); }; EOS (testpath/"test.cpp").write <<~EOS #include "test.h" #include Test::Test() {} void Test::test() { std::cout << "Hello World!" << std::endl; } EOS (testpath/"test.sip").write <<~EOS %Module test class Test { %TypeHeaderCode #include "test.h" %End public: Test(); void test(); }; EOS system ENV.cxx, "-shared", "-Wl,-install_name,#{testpath}/libtest.dylib", "-o", "libtest.dylib", "test.cpp" system bin/"sip", "-b", "test.build", "-c", ".", "test.sip" version = Language::Python.major_minor_version "python3" ENV["PYTHONPATH"] = lib/"python#{version}/site-packages" system "python3", "-c", '"import PyQt5.sip"' end end ================================================ FILE: boneyard/ossim@2.1.rb ================================================ class OssimAT21 < Formula desc "Geospatial libs and apps to process imagery, terrain, and vector data" homepage "https://trac.osgeo.org/ossim/" stable do url "https://github.com/ossimlabs/ossim/archive/EgmontKey-2.1.0.tar.gz" sha256 "f1a9577c10ee98962d024b19e78ba53b029d5acc4f506b322a5cffe89e3c122f" end bottle do root_url "https://dl.bintray.com/homebrew-osgeo/osgeo-bottles" rebuild 1 sha256 "9002228f425c996fe332e1e150424cf2bc6bb94b8bea8687ab626a9185e872d7" => :high_sierra sha256 "9002228f425c996fe332e1e150424cf2bc6bb94b8bea8687ab626a9185e872d7" => :sierra end keg_only :versioned_formula option "with-curl-apps", "Build curl-dependent apps" option "without-framework", "Generate library instead of framework" option "with-gui", "Build new ossimGui library and geocell application" depends_on "cmake" => :build depends_on "open-scene-graph" # just for its OpenThreads lib depends_on "jpeg" depends_on "jsoncpp" depends_on "libtiff" depends_on "osgeo-libgeotiff" depends_on "geos" depends_on "freetype" depends_on "zlib" depends_on "open-mpi" => :optional def install ENV.cxx11 # build setup expects the checkout to be in subdir named 'ossim' # cur_dir = Dir["*", ".git*"] # mkdir "ossim" # (buildpath/"ossim").install cur_dir # mkdir "build" ENV["OSSIM_DEV_HOME"] = buildpath.to_s ENV["OSSIM_BUILD_DIR"] = (buildpath/"build").to_s ENV["OSSIM_INSTALL_PREFIX"] = prefix.to_s # TODO: add options and deps for plugins args = std_cmake_args + %W[ -DCMAKE_CXX_STANDARD=11 -DOSSIM_DEV_HOME=#{ENV["OSSIM_DEV_HOME"]} -DINSTALL_LIBRARY_DIR=lib -DBUILD_OSSIM_APPS=ON -DBUILD_OMS=OFF -DBUILD_CNES_PLUGIN=OFF -DBUILD_GEOPDF_PLUGIN=OFF -DBUILD_GDAL_PLUGIN=OFF -DBUILD_HDF5_PLUGIN=OFF -DBUILD_KAKADU_PLUGIN=OFF -DBUILD_KML_PLUGIN=OFF -DBUILD_MRSID_PLUGIN=OFF -DMRSID_DIR= -DOSSIM_PLUGIN_LINK_TYPE=SHARED -DBUILD_OPENCV_PLUGIN=OFF -DBUILD_OPENJPEG_PLUGIN=OFF -DBUILD_PDAL_PLUGIN=OFF -DBUILD_PNG_PLUGIN=OFF -DBUILD_POTRACE_PLUGIN=OFF -DBUILD_SQLITE_PLUGIN=OFF -DBUILD_WEB_PLUGIN=OFF -DBUILD_OSSIM_VIDEO=OFF -DBUILD_OSSIM_WMS=OFF -DBUILD_OSSIM_PLANET=OFF -DOSSIM_BUILD_ADDITIONAL_DIRECTORIES= -DBUILD_OSSIM_TESTS=OFF ] args << "-DBUILD_OSSIM_FRAMEWORKS=" + (build.with?("framework") ? "ON" : "OFF") args << "-DBUILD_OSSIM_MPI_SUPPORT=" + (build.with?("mpi") ? "ON" : "OFF") args << "-DBUILD_OSSIM_CURL_APPS=" + (build.with?("curl-apps") ? "ON" : "OFF") args << "-DBUILD_OSSIM_GUI=" + (build.with?("gui") ? "ON" : "OFF") # fix up include/ossim/base/ossimRefPtr.h # inreplace "ossim/include/ossim/base/ossimRefPtr.h" do |s| # s.sub! /(#include )/, "\\1\n#include " # s.gsub! "nullptr_t", "std::nullptr_t" # end mkdir "build" do system "cmake", "..", *args system "make" system "make", "install" # File.rename (prefix/"lib64").to_s, lib.to_s end end test do system bin/"ossim-cli", "--version" end end ================================================ FILE: boneyard/pdfium.rb ================================================ class Pdfium < Formula ver = "3625".freeze # relates to chromium version desc "Google-contributed PDF library (without V8 JavaScript engine)" homepage "https://pdfium.googlesource.com/pdfium/" url "https://pdfium.googlesource.com/pdfium.git", :branch => "chromium/#{ver}" version ver bottle do root_url "https://dl.bintray.com/homebrew-osgeo/osgeo-bottles" cellar :any_skip_relocation sha256 "8d36c01cd5d05370bbcdfc8e33e74b1784b8373d4d0184a954db207079e2a605" => :mojave sha256 "8d36c01cd5d05370bbcdfc8e33e74b1784b8373d4d0184a954db207079e2a605" => :high_sierra sha256 "8d36c01cd5d05370bbcdfc8e33e74b1784b8373d4d0184a954db207079e2a605" => :sierra end depends_on "python@2" => :build # gyp doesn't run under 2.6 or lower resource "depot_tools" do url "https://chromium.googlesource.com/chromium/tools/depot_tools.git" end resource "chromium_icu" do url "https://chromium.googlesource.com/chromium/deps/icu.git", :revision => "e4194dc7bbb3305d84cbb1b294274ca70d230721" end def pdfium_build_dir "out/Release_x64" end def copy_file_and_dir_path(dir_search, dst_pathname) Dir[dir_search].each do |f| dst = dst_pathname/File.dirname(f) dst.mkpath dst.install(f) end end def install # need to move git checkout into gclient solutions directory base_install = Dir[".*", "*"] - [".", "..", ".brew_home"] (buildpath/"pdfium/").mkpath base_install.each { |f| mv f, buildpath/"pdfium/" } # install chromium's build tools, includes ninja and gyp (buildpath/"depot_tools").install resource("depot_tools") ENV.prepend_path "PATH", buildpath/"depot_tools" # Add Chromium ICU (buildpath/"pdfium/third_party/icu").install resource("chromium_icu") # use pdfium's gyp scripts to create ninja build files. ENV["GYP_GENERATORS"] = "ninja" system "gclient", "config", "--unmanaged", "--name=pdfium", "https://pdfium.googlesource.com/pdfium.git" # @#{pdfium_rev} system "gclient", "sync", "--no-history" # "--shallow" cd "pdfium" do cwdir = Pathname.new(Dir.pwd) # system "./build/install-build-deps.sh" # Linux-only (cwdir/pdfium_build_dir).mkpath # write out config args (cwdir/"#{pdfium_build_dir}/args.gn").write <<~EOS # Build arguments go here. # See "gn args --list" for available build arguments. use_goma=false is_debug=false pdf_use_skia=false pdf_use_skia_paths=false pdf_enable_xfa=false pdf_enable_v8=false pdf_is_standalone=true pdf_is_complete_lib=true is_component_build=false clang_use_chrome_plugins=false is_clang=true mac_deployment_target="#{MacOS.version}" EOS system "gn", "gen", pdfium_build_dir # compile release build of pdfium & its test binaries system "ninja", "-C", pdfium_build_dir, "pdfium_all" # copy header files into a pdfium directory copy_file_and_dir_path("core/**/*.h", include/"pdfium") copy_file_and_dir_path("fpdfsdk/**/*.h", include/"pdfium") (include/"pdfium").install Dir["public/**/*.h"] # and 3rd party dependency headers (include/"pdfium/third_party/base/numerics").install Dir["third_party/base/numerics/*.h"] (include/"pdfium/third_party/base").install Dir["third_party/base/*.h"] # test data (libexec/"testing/resources").install Dir["testing/resources/*"] cd pdfium_build_dir do (lib/"pdfium").install Dir["obj/lib*.a"] bin.install "pdfium_test", "pdfium_diff" (libexec/pdfium_build_dir).install Dir["pdfium_*tests"] end end end def caveats; <<~EOS For building other software, static libs are located in #{opt_lib}/pdfium and includes in #{opt_include}/pdfium EOS end test do system libexec/"#{pdfium_build_dir}/pdfium_unittests" system libexec/"#{pdfium_build_dir}/pdfium_embeddertests" end end ================================================ FILE: boneyard/points2grid.rb ================================================ require 'formula' class Points2grid < Formula homepage 'https://github.com/CRREL/points2grid' url 'https://github.com/CRREL/points2grid/archive/1.2.1.tar.gz' sha1 'afd1b8ac0086b7ac220a3615e0ec1512161a4628' head "https://github.com/CRREL/points2grid.git" depends_on 'cmake' => :build depends_on 'boost' def install libexec.install "example.las" system "cmake", ".", *std_cmake_args system "make install" end test do mktemp do system bin/"points2grid", "-i", libexec/"example.las", "-o", "example", "--max", "--output_format", "grid" assert_equal 5, %x(grep -c '423.820000' < example.max.grid).strip.to_i end end end ================================================ FILE: boneyard/pyqt-qt4.rb ================================================ class PyqtQt4 < Formula desc "Python bindings for Qt" homepage "https://www.riverbankcomputing.com/software/pyqt/intro" url "https://downloads.sf.net/project/pyqt/PyQt4/PyQt-4.11.4/PyQt-mac-gpl-4.11.4.tar.gz" sha256 "f178ba12a814191df8e9f87fb95c11084a0addc827604f1a18a82944225ed918" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" rebuild 1 sha256 "00d6c9ee4e673050ebc4bdf7fbd7f95689981fe7e2186bc8be4f1ab16c07a1bd" => :high_sierra sha256 "00d6c9ee4e673050ebc4bdf7fbd7f95689981fe7e2186bc8be4f1ab16c07a1bd" => :sierra end depends_on "python@2" => :recommended depends_on "qt-4" depends_on "sip-qt4" def install if build.without? "python@2" # this is a flaw in Homebrew, where `depends on :python` alone does not work odie "Must be built with Python2" end # On Mavericks we want to target libc++, this requires a non default qt makespec if ENV.compiler == :clang && MacOS.version >= :mavericks ENV.append "QMAKESPEC", "unsupported/macx-clang-libc++" end ENV.prepend_path "PATH", "#{Formula["sip-qt4"].opt_libexec}/bin" Language::Python.each_python(build) do |python, version| ENV["PYTHONPATH"] = "#{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages" args = %W[ --confirm-license --bindir=#{bin} --destdir=#{lib}/qt-4/python#{version}/site-packages --sipdir=#{share}/sip-qt4 ] # We need to run "configure.py" so that pyqtconfig.py is generated, which # is needed by QGIS, PyQWT (and many other PyQt interoperable # implementations such as the ROS GUI libs). This file is currently needed # for generating build files appropriate for the qmake spec that was used # to build Qt. The alternatives provided by configure-ng.py is not # sufficient to replace pyqtconfig.py yet (see # https://github.com/qgis/QGIS/pull/1508). Using configure.py is # deprecated and will be removed with SIP v5, so we do the actual compile # using the newer configure-ng.py as recommended. In order not to # interfere with the build using configure-ng.py, we run configure.py in a # temporary directory and only retain the pyqtconfig.py from that. oldargs = args + %W[--plugin-destdir=#{lib}/qt-4/plugins] require "tmpdir" dir = Dir.mktmpdir begin cp_r(Dir.glob("*"), dir) cd dir do system python, "configure.py", *oldargs qt4 = Formula["qt-4"] # can't use qt4.prefix anymore, as it is opt-relative inreplace "pyqtconfig.py", qt4.opt_prefix.realpath, qt4.opt_prefix inreplace "pyqtconfig.py", "#{HOMEBREW_CELLAR}/#{name}/#{installed_version}", opt_prefix (lib/"qt-4/python#{version}/site-packages/PyQt4").install "pyqtconfig.py" end ensure remove_entry_secure dir end # On Mavericks we want to target libc++, this requires a non default qt makespec if ENV.compiler == :clang && MacOS.version >= :mavericks args << "--spec" << "unsupported/macx-clang-libc++" end ngargs = args + %W[ --sip-incdir=#{Formula["sip-qt4"].opt_libexec}/include --designer-plugindir=#{lib}/qt-4/plugins/designer ] system python, "configure-ng.py", *ngargs system "make" system "make", "install" system "make", "clean" # for when building against multiple Pythons end end def caveats s = "Phonon support is broken.\n\n" s += "Python modules in:\n" Language::Python.each_python(build) do |_python, version| s += " #{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages/PyQt4" end s end test do Language::Python.each_python(build) do |python, version| ENV["PYTHONPATH"] = HOMEBREW_PREFIX/"lib/qt-4/python#{version}/site-packages" system "#{bin}/pyuic4", "--version" system "#{bin}/pylupdate4", "-version" system python, "-c", "import PyQt4" %w[ Qt QtCore QtDeclarative QtDesigner QtGui QtHelp QtMultimedia QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg QtTest QtWebKit QtXml QtXmlPatterns ].each { |mod| system python, "-c", "import PyQt4.#{mod}" } end end end ================================================ FILE: boneyard/qca-qt4.rb ================================================ class QcaQt4 < Formula desc "Qt Cryptographic Architecture (QCA)" homepage "http://delta.affinix.com/qca/" head "https://anongit.kde.org/qca.git" stable do url "https://github.com/KDE/qca/archive/v2.1.1.tar.gz" sha256 "aa8ec328da163a5e20ac59146e56b17d0677789f020d0c3875c4ed5e9e82e749" # Fix for linking CoreFoundation and removing deprecated code; already in HEAD). patch do url "https://github.com/KDE/qca/commit/f223ce03d4b94ffbb093fc8be5adf8d968f54434.diff?full_index=1" sha256 "e882bfa4a290d62a7ddea8c05019d5e616234027c95f7f8339072af03a2e6bc7" end # Fix for framework installation; already in HEAD). patch do url "https://github.com/KDE/qca/commit/9e4bf795434304bce32626fe0f6887c10fec0824.diff?full_index=1" sha256 "a7dc91e0d68b38712fbe2228f3c028090e6e2f8ba3a74b334b46bae4276430ee" end end bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" rebuild 1 sha256 "b36a88ea9d3f7d2588341e37e9b2c6d4580cb1de1cdafa2a09a4571d5afe722f" => :high_sierra sha256 "b36a88ea9d3f7d2588341e37e9b2c6d4580cb1de1cdafa2a09a4571d5afe722f" => :sierra end keg_only "newer Qt5-only version in homebrew-core" option "with-api-docs", "Build API documentation" deprecated_option "with-gnupg" => "with-gpg2" depends_on "cmake" => :build depends_on "pkg-config" => :build depends_on "qt-4" # Plugins (QCA needs at least one plugin to do anything useful) depends_on "openssl" # qca-ossl depends_on "botan" => :optional # qca-botan depends_on "libgcrypt" => :optional # qca-gcrypt depends_on "gnupg" depends_on "nss" => :optional # qca-nss depends_on "pkcs11-helper" => :optional # qca-pkcs11 if build.with? "api-docs" depends_on "graphviz" => :build depends_on "doxygen" => :build end def install args = std_cmake_args args << "-DQT4_BUILD=ON" args << "-DBUILD_TESTS=OFF" # Plugins (qca-ossl, qca-cyrus-sasl, qca-logger, qca-softstore always built) args << "-DWITH_botan_PLUGIN=#{build.with?("botan") ? "YES" : "NO"}" args << "-DWITH_gcrypt_PLUGIN=#{build.with?("libgcrypt") ? "YES" : "NO"}" args << "-DWITH_gnupg_PLUGIN=#{build.with?("gpg2") ? "YES" : "NO"}" args << "-DWITH_nss_PLUGIN=#{build.with?("nss") ? "YES" : "NO"}" args << "-DWITH_pkcs11_PLUGIN=#{build.with?("pkcs11-helper") ? "YES" : "NO"}" system "cmake", ".", *args system "make", "install" if build.with? "api-docs" system "make", "doc" doc.install "apidocs/html" end end test do system bin/"qcatool", "--noprompt", "--newpass=", "key", "make", "rsa", "2048", "test.key" end end ================================================ FILE: boneyard/qgis-18.rb ================================================ require 'formula' class PyQtImportable < Requirement fatal true satisfy { quiet_system 'python', '-c', '"from PyQt4 import QtCore"' } def message <<~EOS Python could not import the PyQt4 module. This will cause the QGIS build to fail. The most common reason for this failure is that the PYTHONPATH needs to be adjusted. The pyqt caveats explain this adjustment and may be reviewed using: brew info pyqt EOS end end class Qgis18 < Formula homepage 'http://www.qgis.org' url 'http://qgis.org/downloads/qgis-1.8.0.tar.bz2' sha1 '99c0d716acbe0dd70ad0774242d01e9251c5a130' depends_on 'cmake' => :build depends_on :python depends_on PyQtImportable depends_on 'gsl' depends_on 'pyqt' depends_on 'qwt60' depends_on 'expat' depends_on 'gdal-19' depends_on 'proj' depends_on 'spatialindex' depends_on 'bison' depends_on 'grass' => :optional depends_on 'gettext' if build.with? 'grass' depends_on 'postgis' => :optional def install cxxstdlib_check :skip # Set bundling level back to 0 (the default in all versions prior to 1.8.0) # so that no time and energy is wasted copying the Qt frameworks into QGIS. args = std_cmake_args.concat %W[ -DQWT_INCLUDE_DIR=#{Formula['qwt60'].opt_prefix}/lib/qwt.framework/Headers/ -DQWT_LIBRARY=#{Formula['qwt60'].opt_prefix}/lib/qwt.framework/qwt -DBISON_EXECUTABLE=#{Formula['bison'].opt_prefix}/bin/bison -DENABLE_TESTS=NO -DQGIS_MACAPP_BUNDLE=0 -DQGIS_MACAPP_DEV_PREFIX='#{prefix}/Frameworks' -DQGIS_MACAPP_INSTALL_DEV=YES -DPYTHON_INCLUDE_DIR='#{python.incdir}' -DPYTHON_LIBRARY='#{python.libdir}/lib#{python.xy}.dylib' ] grass = Formula['grass'] args << "-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version}'" if build.with? 'grass' # So that `libintl.h` can be found ENV.append 'CXXFLAGS', "-I'#{Formula['gettext'].opt_prefix}/include'" if build.with? 'grass' # Avoid ld: framework not found QtSql (https://github.com/Homebrew/homebrew-science/issues/23) ENV.append 'CXXFLAGS', "-F#{Formula['qt'].opt_prefix}/lib" Dir.mkdir 'build' python do Dir.chdir 'build' do system 'cmake', '..', *args system 'make install' end py_lib = lib/"#{python.xy}/site-packages" qgis_modules = prefix + 'QGIS.app/Contents/Resources/python/qgis' py_lib.mkpath ln_s qgis_modules, py_lib + 'qgis' # Create script to launch QGIS app (bin + 'qgis').write <<~EOS #!/bin/sh # Ensure Python modules can be found when QGIS is running. env PATH='#{HOMEBREW_PREFIX}/bin':$PATH PYTHONPATH='#{HOMEBREW_PREFIX}/lib/#{python.xy}/site-packages':$PYTHONPATH\\ open #{prefix}/QGIS.app EOS end end def caveats s = <<~EOS QGIS has been built as an application bundle. To make it easily available, a wrapper script has been written that launches the app with environment variables set so that Python modules will be functional: qgis You may also symlink QGIS.app into ~/Applications: brew linkapps mkdir -p #{ENV['HOME']}/.MacOSX defaults write #{ENV['HOME']}/.MacOSX/environment.plist PYTHONPATH -string "#{HOMEBREW_PREFIX}/lib/#{python.xy}/site-packages" You will need to log out and log in again to make environment.plist effective. EOS #s += python.standard_caveats if python s end end ================================================ FILE: boneyard/qgis-20.rb ================================================ require 'formula' require File.expand_path("../../Requirements/qgis_requirements", Pathname.new(__FILE__).realpath) class UnlinkedQGIS20 < UnlinkedQGIS fatal true def qgis_list %W[homebrew/science/qgis qgis-18 qgis-22 qgis-24] end satisfy(:build_env => false) { no_linked_qgis[0] } end class Qgis20 < Formula homepage 'http://www.qgis.org' url 'https://github.com/qgis/QGIS/archive/final-2_0_1.tar.gz' sha1 'd532677c1934c3faacd3036af15958b464051853' revision 4 option 'enable-isolation', "Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs" option 'with-debug', 'Enable debug build, which outputs info to system.log or console' option 'skip-stdlib-check', 'Build skips checking if dependencies are built against conflicting stdlib.' option 'without-server', 'Build without QGIS Server (qgis_mapserv.fcgi)' option 'without-postgresql', 'Build without current PostgreSQL client' option 'with-globe', 'Build with Globe plugin, based upon osgEarth' option 'with-grass', 'Build with GRASS integration plugin support' option 'with-postgis', 'Build extra PostGIS geospatial database extender' option 'with-oracle', 'Build extra Oracle geospatial database and raster support' option 'with-orfeo', 'Build extra Orfeo Toolbox for Processing plugin' option 'with-r', 'Build extra R for Processing plugin' option 'with-saga-gis', 'Build extra Saga GIS for Processing plugin' option 'with-qt-mysql', 'Build extra Qt MySQL plugin for eVis plugin' option 'with-api-docs', 'Build the API documentation with Doxygen and Graphviz' #option 'persistent-build', 'Maintain the build directory in HOMEBREW_TEMP (--HEAD only)' depends_on UnlinkedQGIS20 # core qgis depends_on 'cmake' => :build depends_on 'bison' => :build if build.with? 'api-docs' depends_on 'graphviz' => [:build, 'with-freetype'] depends_on 'doxygen' => [:build, 'with-dot'] # with graphviz support end depends_on (build.include? 'enable-isolation' || MacOS.version < :lion ) ? 'python' : :python depends_on 'qt' depends_on 'pyqt' depends_on SipBinary depends_on PyQtConfig depends_on 'qscintilla2' # will probably be a C++ lib deps in near future depends_on 'qwt' depends_on 'qwtpolar' depends_on 'gsl' depends_on 'sqlite' # keg_only depends_on 'expat' # keg_only depends_on 'proj' depends_on 'spatialindex' depends_on 'fcgi' if build.with? 'server' # use newer postgresql client than Apple's, also needed by `psycopg2` depends_on 'postgresql' => :recommended # core providers depends_on 'gdal' depends_on 'postgis' => :optional depends_on "oracle-client-sdk" if build.with? "oracle" # TODO: add MSSQL third-party support formula?, :optional # core plugins (c++ and python) depends_on "grass-64" => :optional depends_on 'gdal-grass' if build.with? 'grass' depends_on 'gettext' if build.with? 'grass' depends_on 'gpsbabel' => [:recommended, 'with-libusb'] depends_on 'open-scene-graph' if build.with? 'globe' depends_on 'homebrew/science/osgearth' if build.with? 'globe' # TODO: remove 'pyspatialite' when PyPi package supports spatialite 4.x # or DB Manager supports libspatialite > 4.1.1 (with mod_spatialite) depends_on 'pyspatialite' # for DB Manager depends_on 'qt-mysql' => :optional # for eVis plugin (non-functional in 2.0.1?) # core processing plugin extras # see `postgis` and `grass` above depends_on 'orfeo' => :optional depends_on 'homebrew/science/r' => :optional depends_on 'saga-gis' => :optional # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools) # TODO: Fusion from USFS (via `wine`?) resource "pyqgis-startup" do url "https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py" sha1 "13d624e8ccc6bf072bbaeaf68cd6f7309abc1e74" version "2.0.0" end # fixes for stable to work with sip 4.15, remove on release > 2.0.1 # see: https://github.com/qgis/QGIS/commit/d27ad33c # https://github.com/qgis/QGIS/commit/641359d3 # https://github.com/qgis/QGIS/commit/6f9795b0 # fix for finding Qt Plugins directory when QGIS_MACAPP_BUNDLE = 0 # see: https://github.com/osgeo/homebrew-osgeo4mac/issues/13 # backport PYQGIS_STARTUP support for isolation, or to avoid Kyngchaos.com # python modules pulling in duplicate linked *.framework libs patch do url "https://gist.githubusercontent.com/dakcarto/11231756/raw/8454c7bf118e5672899afadc53f61d252316ce21/qgis-20_fixes.patch" sha1 "8bbc5cbca1eaa4befb04b3e8319036c5a263119b" end def install # Set bundling level back to 0 (the default in all versions prior to 1.8.0) # so that no time and energy is wasted copying the Qt frameworks into QGIS. qwt_fw = Formula['qwt'].opt_prefix/"lib/qwt.framework" qwtpolar_fw = Formula['qwtpolar'].opt_prefix/"lib/qwtpolar.framework" dev_fw = lib/'qgis-dev' dev_fw.mkpath qsci_opt = Formula['qscintilla2'].opt_prefix args = %W[ -DCMAKE_INSTALL_PREFIX=#{prefix} -DCMAKE_BUILD_TYPE=#{(build.with?('debug')) ? 'RelWithDebInfo' : 'None' } -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=TRUE -Wno-dev -DBISON_EXECUTABLE=#{Formula['bison'].opt_prefix}/bin/bison -DENABLE_TESTS=FALSE -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers -DQWT_LIBRARY=#{qwt_fw}/qwt -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include/Qsci -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib -DWITH_INTERNAL_QWTPOLAR=FALSE -DQGIS_MACAPP_BUNDLE=0 -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}' -DQGIS_MACAPP_INSTALL_DEV=TRUE -DWITH_QSCIAPI=FALSE -DWITH_STAGED_PLUGINS=FALSE ] args << "-DPYTHON_EXECUTABLE='#{python_exec}'" # brewed python is used if installed if brewed_python? args << "-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'" end args << "-DGIT_MARKER=''" # if release tarball, ends up defined as 'exported' args << '-DWITH_MAPSERVER=TRUE' if build.with? 'server' pgsql = Formula['postgresql'] args << "-DPOSTGRES_CONFIG=#{pgsql.opt_prefix}/bin/pg_config" if build.with? 'postgresql' if build.with? 'oracle' args << '-DWITH_ORACLE=TRUE' oracle_opt = Formula['oracle-client-sdk'].opt_prefix args << "-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include" args << "-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib" end if build.with? 'grass' grass = Formula["grass-64"] args << "-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version.to_s}'" # So that `libintl.h` can be found ENV.append 'CXXFLAGS', "-I'#{Formula['gettext'].opt_prefix}/include'" end if build.with? 'globe' osg = Formula['open-scene-graph'] opoo "`open-scene-graph` formula's keg not linked." unless osg.linked_keg.exist? args << '-DWITH_GLOBE=TRUE' # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there args << "-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.linked_keg.realpath.basename.to_s}" end args << '-DWITH_APIDOC=TRUE' if build.with? 'api-docs' # Avoid ld: framework not found QtSql # (https://github.com/Homebrew/homebrew-science/issues/23) ENV.append 'CXXFLAGS', "-F#{Formula['qt'].opt_prefix}/lib" # TODO: update .app's bundle identifier for HEAD builds # (convert to using `defaults`) #/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier org.qgis.qgis-dev" "$APPTARGET/Contents/Info.plist" # TODO: keep persistent build directory for HEAD builds mkdir 'build' cd 'build' do # fix install fail on stdlib check for Mavericks+, if mixing supporting libs with different stdlibs cxxstdlib_check :skip if MacOS.version >= :mavericks and build.include? 'skip-stdlib-check' system 'cmake', '..', *args #system 'bbedit', 'CMakeCache.txt' #raise system 'make', 'install' end py_lib = lib/"python2.7/site-packages" qgis_modules = prefix/'QGIS.app/Contents/Resources/python/qgis' py_lib.mkpath ln_s qgis_modules, py_lib/'qgis' ln_s 'QGIS.app/Contents/MacOS/fcgi-bin', prefix/'fcgi-bin' if build.with? 'server' doc.mkpath mv prefix/'QGIS.app/Contents/Resources/doc/api', doc/'api' if build.with? 'api-docs' ln_s prefix/'QGIS.app/Contents/Resources/doc', doc/'doc' # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped) # only works with QGIS > 2.0.1 # doesn't need executable bit set, loaded by Python runner in QGIS libexec.install resource("pyqgis-startup") bin.mkdir touch "#{bin}/qgis" # so it will be linked into HOMEBREW_PREFIX end def post_install # configure environment variables for .app and launching binary directly. # having this in `post_intsall` allows it to be individually run *after* installation with: # `brew postinstall -v qgis-20` opts = Tab.for_formula(self).used_options # define default isolation env vars pthsep = File::PATH_SEPARATOR pypth = "#{python_site_packages}" pths = %W[#{HOMEBREW_PREFIX/'bin'} /usr/bin /bin /usr/sbin /sbin /usr/X11/bin].join(pthsep) unless opts.include? 'enable-isolation' pths = ORIGINAL_PATHS.join(pthsep) unless pths.include? HOMEBREW_PREFIX/'bin' pths = HOMEBREW_PREFIX/'bin' + pthsep + pths end pyenv = ENV['PYTHONPATH'] if pyenv pypth = (pyenv.include?(pypth)) ? pyenv : pypth + pthsep + pyenv end end envars = { :PATH => "#{pths}", :PYTHONPATH => "#{pypth}", :GDAL_DRIVER_PATH => "#{HOMEBREW_PREFIX}/lib/gdalplugins" } if opts.include? 'with-grass' grass = Formula["grass-64"] envars[:GRASS_PREFIX] = "#{grass.opt_prefix}/grass-#{grass.version.to_s}" end if opts.include? 'with-globe' osg = Formula['open-scene-graph'] envars[:OSG_LIBRARY_PATH] = "#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.linked_keg.realpath.basename}" end if opts.include? 'enable-isolation' envars[:DYLD_FRAMEWORK_PATH] = "#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks" versioned = %W[ #{Formula['sqlite'].opt_prefix}/lib #{Formula['expat'].opt_prefix}/lib #{Formula['libxml2'].opt_prefix}/lib #{HOMEBREW_PREFIX}/lib ] envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep) end if opts.include? 'enable-isolation' or File.exist?("/Library/Frameworks/GDAL.framework") # TODO: is PYTHONHOME necessary for isolation, or is it set by embedded interpreter? #envars[:PYTHONHOME] = "#{python.framework}/Python.framework/Versions/Current" envars[:PYQGIS_STARTUP] = opt_libexec/'pyqgis_startup.py' end #envars.each { |key, value| puts "#{key.to_s}=#{value}" } #exit # add env vars to QGIS.app's Info.plist, in LSEnvironment section app = prefix/'QGIS.app' plst = app/'Contents/Info.plist' # first delete any LSEnvironment setting, ignoring errors # CAUTION!: may not be what you want, if .app already has LSEnvironment settings dflt = quiet_system "defaults read-type \"#{plst}\" LSEnvironment" system "defaults delete \"#{plst}\" LSEnvironment" if dflt kv = '{ ' envars.each { |key, value| kv += "'#{key.to_s}' = '#{value}'; " } kv += '}' system "defaults write \"#{plst}\" LSEnvironment \"#{kv}\"" # leave the plist readable; convert from binary to XML format system "plutil -convert xml1 -- \"#{plst}\"" # update modification date on app bundle, or changes won't take effect system "touch \"#{app}\"" # add env vars to launch script for QGIS app's binary qgis_bin = bin/'qgis' rm_f qgis_bin if File.exists?(qgis_bin) # install generates empty file bin_cmds = %W[#!/bin/sh\n] # setup shell-prepended env vars (may result in duplication of paths) envars[:PATH] = "#{HOMEBREW_PREFIX}/bin" + pthsep + '$PATH' envars[:PYTHONPATH] = "#{python_site_packages}" + pthsep + '$PYTHONPATH' envars.each { |key, value| bin_cmds << "export #{key.to_s}=#{value}" } bin_cmds << opt_prefix/'QGIS.app/Contents/MacOS/QGIS' qgis_bin.write(bin_cmds.join("\n")) qgis_bin.chmod 0755 end def caveats s = <<~EOS QGIS is built as an application bundle. Environment variables for the Homebrew prefix are embedded in QGIS.app: #{opt_prefix}/QGIS.app You may also symlink QGIS.app into /Applications or ~/Applications: brew linkapps [--local] To run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper script pre-defined with Homebrew prefix environment variables: #{opt_prefix}/bin/qgis NOTE: Your current PATH and PYTHONPATH environment variables are honored when launching via the wrapper script, while launching QGIS.app bundle they are not. For standalone Python development, set the following environment variable: export PYTHONPATH=#{python_site_packages}:$PYTHONPATH Developer frameworks are installed in: #{opt_prefix}/lib/qgis-dev NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation. Use dyld -F option in CPPFLAGS/LDFLAGS when building other software. EOS if build.include? 'enable-isolation' s += <<~EOS QGIS built with isolation enabled. This allows it to coexist with other types of installations of QGIS on your Mac. However, on versions >= 2.0.1, this also means Python modules installed in the *system* Python will NOT be available to Python processes within QGIS.app. EOS end # check for required run-time Python module dependencies # TODO: add 'pyspatialite' when PyPi package supports spatialite 4.x xm = [] %w[psycopg2 matplotlib].each { |m| xm << m unless module_importable? m } unless xm.empty? s += <<~EOS The following Python modules are needed by QGIS during run-time: #{xm.join(', ')} You can install manually, via installer package or with `pip` (if availble): pip install OR pip-2.7 install EOS end # TODO: remove this when libqscintilla.dylib becomes core build dependency? unless module_importable? 'PyQt4.Qsci' s += <<~EOS QScintilla Python module is needed by QGIS during run-time. Ensure `qscintilla2` formula is linked. EOS end s end private # python utils (deprecated in latest Homebrew) # see: https://github.com/Homebrew/homebrew/pull/24842 #def osx_python? # p = `python -c "import sys; print(sys.prefix)"`.strip # p.start_with?("/System/Library/Frameworks/Python.framework") #end def brewed_python_framework HOMEBREW_PREFIX/"Frameworks/Python.framework/Versions/2.7" end def brewed_python_framework? brewed_python_framework.exist? end def brewed_python? Formula["python"].linked_keg.exist? and brewed_python_framework? end def python_exec if brewed_python? brewed_python_framework/"bin/python" else which("python") end end def python_incdir Pathname.new(`#{python_exec} -c 'from distutils import sysconfig; print(sysconfig.get_python_inc())'`.strip) end def python_libdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))"`.strip) end def python_site_packages HOMEBREW_PREFIX/"lib/python2.7/site-packages" end def module_importable?(mod) quiet_system python_exec, "-c", "import #{mod}" end end ================================================ FILE: boneyard/qgis-214.rb ================================================ require File.expand_path("../../Requirements/qgis_requirements", Pathname.new(__FILE__).realpath) class Qgis214 < Formula desc "Open Source Geographic Information System" homepage "http://www.qgis.org" head "https://github.com/qgis/QGIS.git", branch: "release-2_14" stable do url "https://github.com/qgis/QGIS/archive/final-2_14_6.tar.gz" sha256 "a3c5a1cb2359dac925e3efea9d6b56d37ab9dd3639c38b9915be0d340b54f5ad" # patches that represent all backports to release-2_14 branch, since 2.14.2 tag, git id (date) # see: https://github.com/qgis/QGIS/commits/release-2_14 # patch do # # git id (date) through git id (date) minus windows-formatted patches # url "" # sha256 "" # end end bottle do root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" sha256 "cea85a8c16c481180bf5756f2032584e918c150b251f8a261428cacc34ea0ce3" => :mavericks end def pour_bottle? brewed_python? end option "with-isolation", "Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs" option "without-debug", "Disable debug build, which outputs info to system.log or console" option "without-server", "Build without QGIS Server (qgis_mapserv.fcgi)" option "without-postgresql", "Build without current PostgreSQL client" option "with-gdal-1", "Build with GDAL/OGR v1.x instead of v2.x" option "with-globe", "Build with Globe plugin, based upon osgEarth" option "with-grass", "Build with GRASS 7 integration plugin and Processing plugin support (or install grass-7x first)" option "with-grass6", "Build extra GRASS 6 for Processing plugin" option "with-oracle", "Build extra Oracle geospatial database and raster support" option "with-orfeo", "Build extra Orfeo Toolbox for Processing plugin" option "with-r", "Build extra R for Processing plugin" option "with-saga-gis", "Build extra Saga GIS for Processing plugin" option "with-qt-mysql", "Build extra Qt MySQL plugin for eVis plugin" option "with-qspatialite", "Build QSpatialite Qt database driver" option "with-api-docs", "Build the API documentation with Doxygen and Graphviz" deprecated_option "enable-isolation" => "with-isolation" depends_on UnlinkedQGIS2 # core qgis depends_on "cmake" => :build depends_on "bison" => :build if build.with? "api-docs" depends_on "graphviz" => [:build, "with-freetype"] depends_on "doxygen" => [:build, "with-dot"] # with graphviz support end depends_on (build.with?("isolation") || MacOS.version < :lion) ? "python" : :python depends_on "qt" depends_on "pyqt" depends_on SipBinary depends_on PyQtConfig depends_on "qca" depends_on "qscintilla2-qt4" # will probably be a C++ lib deps in near future depends_on "qwt" depends_on "qwtpolar" depends_on "gsl" depends_on "sqlite" # keg_only depends_on "expat" # keg_only depends_on "proj" depends_on "spatialindex" depends_on "fcgi" if build.with? "server" # use newer postgresql client than Apple's, also needed by `psycopg2` depends_on "postgresql" => :recommended # core providers if build.with? "gdal-1" depends_on "gdal" else depends_on "gdal-20" end depends_on "oracle-client-sdk" if build.with? "oracle" # TODO: add MSSQL third-party support formula?, :optional # core plugins (c++ and python) if build.with? "grass" depends_on "grass-70" depends_on "gettext" end if build.with? "globe" # this is pretty borked with OS X >= 10.10+ depends_on "open-scene-graph" => ["with-qt"] depends_on "homebrew/science/osgearth" end depends_on "gpsbabel" # TODO: remove "pyspatialite" when PyPi package supports spatialite 4.x # or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite) depends_on "pyspatialite" # for DB Manager depends_on "qt-mysql" => :optional # for eVis plugin (non-functional in 2.x?) # core processing plugin extras # see `grass` above depends_on "grass-64" if build.with? "grass6" depends_on "orfeo-54" if build.with? "orfeo" depends_on "homebrew/science/r" => :optional depends_on "saga-gis" => :optional # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools) # TODO: Fusion from USFS (via `wine`?) resource "pyqgis-startup" do url "https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py" sha256 "3d0adca0c8684f3d907c626fc86d93d73165e184960d16ae883fca665ecc32e6" version "2.0.0" end def install # Set bundling level back to 0 (the default in all versions prior to 1.8.0) # so that no time and energy is wasted copying the Qt frameworks into QGIS. qwt_fw = Formula["qwt"].opt_lib/"qwt.framework" qwtpolar_fw = Formula["qwtpolar"].opt_lib/"qwtpolar.framework" dev_fw = lib/"qgis-dev" dev_fw.mkpath qsci_opt = Formula["qscintilla2-qt4"].opt_prefix args = std_cmake_args args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo" if build.with? "debug" # override args += %W[ -DBISON_EXECUTABLE=#{Formula["bison"].opt_bin}/bison -DENABLE_TESTS=FALSE -DENABLE_MODELTEST=FALSE -DSUPPRESS_QT_WARNINGS=TRUE -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers -DQWT_LIBRARY=#{qwt_fw}/qwt -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib -DQSCI_SIP_DIR=#{qsci_opt}/share/sip -DWITH_QWTPOLAR=TRUE -DWITH_INTERNAL_QWTPOLAR=FALSE -DQGIS_MACAPP_BUNDLE=0 -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}' -DQGIS_MACAPP_INSTALL_DEV=TRUE -DWITH_QSCIAPI=FALSE -DWITH_STAGED_PLUGINS=TRUE -DWITH_GRASS=FALSE ] if build.without? "gdal-1" args << "-DGDAL_LIBRARY=#{Formula["gdal-20"].opt_lib}/libgdal.dylib" args << "-DGDAL_INCLUDE_DIR=#{Formula["gdal-20"].opt_include}" # These specific includes help ensure any gdal v1 includes are not # accidentally pulled from /usr/local/include # In CMakeLists.txt throughout QGIS source tree these includes may come # before opt/gdal-20/include; 'fixing' many CMakeLists.txt may be unwise args << "-DGEOS_INCLUDE_DIR=#{Formula["geos"].opt_include}" args << "-DGSL_INCLUDE_DIR=#{Formula["gsl"].opt_include}" args << "-DPROJ_INCLUDE_DIR=#{Formula["proj"].opt_include}" args << "-DQCA_INCLUDE_DIR=#{Formula["qca"].opt_lib}/qca.framework/Headers" args << "-DSPATIALINDEX_INCLUDE_DIR=#{Formula["spatialindex"].opt_include}/spatialindex" args << "-DSPATIALITE_INCLUDE_DIR=#{Formula["libspatialite"].opt_include}" args << "-DSQLITE3_INCLUDE_DIR=#{Formula["sqlite"].opt_include}" end args << "-DPYTHON_EXECUTABLE='#{python_exec}'" # brewed python is used if installed if brewed_python? args << "-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'" end # find git revision for HEAD build if build.head? && File.exist?("#{cached_download}/.git/index") args << "-DGITCOMMAND=#{Formula["git"].opt_bin}/git" args << "-DGIT_MARKER=#{cached_download}/.git/index" end args << "-DWITH_SERVER=#{build.with?("server") ? "TRUE" : "FALSE"}" if build.with? "server" fcgi_opt = Formula["fcgi"].opt_prefix args << "-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include" args << "-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib" end args << "-DPOSTGRES_CONFIG=#{Formula["postgresql"].opt_bin}/pg_config" if build.with? "postgresql" args << "-DWITH_GRASS7=#{(build.with?("grass") || brewed_grass7?) ? "TRUE" : "FALSE"}" if build.with?("grass") || brewed_grass7? # this is to build the GRASS Plugin, not for Processing plugin support grass7 = Formula["grass-70"] args << "-DGRASS_PREFIX7='#{grass7.opt_prefix}/grass-#{grass7.version}'" # So that `libintl.h` can be found ENV.append "CXXFLAGS", "-I'#{Formula["gettext"].opt_include}'" end args << "-DWITH_GLOBE=#{build.with?("globe") ? "TRUE" : "FALSE"}" if build.with? "globe" osg = Formula["open-scene-graph"] opoo "`open-scene-graph` formula's keg not linked." unless osg.linked_keg.exist? # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there args << "-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}" end args << "-DWITH_ORACLE=#{build.with?("oracle") ? "TRUE" : "FALSE"}" if build.with? "oracle" oracle_opt = Formula["oracle-client-sdk"].opt_prefix args << "-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include" args << "-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib" end args << "-DWITH_QSPATIALITE=#{build.with?("qspatialite") ? "TRUE" : "FALSE"}" args << "-DWITH_APIDOC=#{build.with?("api-docs") ? "TRUE" : "FALSE"}" # Avoid ld: framework not found QtSql # (https://github.com/Homebrew/homebrew-science/issues/23) ENV.append "CXXFLAGS", "-F#{Formula["qt"].opt_lib}" # if using Homebrew's Python, make sure its components are always found first # see: https://github.com/Homebrew/homebrew/pull/28597 ENV["PYTHONHOME"] = brewed_python_framework.to_s if brewed_python? # handle some compiler warnings ENV["CXX_EXTRA_FLAGS"] = "-Wno-unused-private-field -Wno-deprecated-register" if ENV.compiler == :clang && (MacOS::Xcode.version >= "7.0" || MacOS::CLT.version >= "7.0") ENV.append "CXX_EXTRA_FLAGS", "-Wno-inconsistent-missing-override" end mkdir "build" do system "cmake", "..", *args # system "bbedit", "CMakeCache.txt" # raise system "make", "install" end # Update .app's bundle identifier, so Kyngchaos.com installer doesn't get confused inreplace prefix/"QGIS.app/Contents/Info.plist", "org.qgis.qgis2", "org.qgis.qgis2-hb#{build.head? ? "-dev" : ""}" py_lib = lib/"python2.7/site-packages" py_lib.mkpath ln_s "../../../QGIS.app/Contents/Resources/python/qgis", py_lib/"qgis" ln_s "QGIS.app/Contents/MacOS/fcgi-bin", prefix/"fcgi-bin" if build.with? "server" doc.mkpath mv prefix/"QGIS.app/Contents/Resources/doc/api", doc/"api" if build.with? "api-docs" ln_s "../../../QGIS.app/Contents/Resources/doc", doc/"doc" # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped) # only works with QGIS > 2.0.1 # doesn't need executable bit set, loaded by Python runner in QGIS libexec.install resource("pyqgis-startup") bin.mkdir touch "#{bin}/qgis" # so it will be linked into HOMEBREW_PREFIX post_install end def post_install # configure environment variables for .app and launching binary directly. # having this in `post_intsall` allows it to be individually run *after* installation with: # `brew postinstall -v qgis-XX` <-- where XX is formula version app = prefix/"QGIS.app" tab = Tab.for_formula(self) opts = tab.used_options # bottle_poured = tab.poured_from_bottle # define default isolation env vars pthsep = File::PATH_SEPARATOR pypth = python_site_packages.to_s pths = %W[#{HOMEBREW_PREFIX/"bin"} /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin].join(pthsep) gdalpth = "#{Formula["gdal-20"].opt_lib}/python2.7/site-packages" qscipth = "#{Formula["qscintilla2-qt4"].opt_lib}/python2.7/site-packages" unless opts.include? "with-isolation" pths = ORIGINAL_PATHS.join(pthsep) unless pths.include? HOMEBREW_PREFIX/"bin" pths = HOMEBREW_PREFIX/"bin" + pthsep + pths end pyenv = ENV["PYTHONPATH"] if pyenv pypth = pyenv.include?(pypth) ? pyenv : pypth + pthsep + pyenv end end # set install's lib/python2.7/site-packages first, so app will work if unlinked pypth = %W[#{qscipth} #{gdalpth} #{lib}/python2.7/site-packages #{pypth}].join(pthsep) envars = { PATH: pths.to_s, PYTHONPATH: pypth.to_s, GDAL_DRIVER_PATH: "#{HOMEBREW_PREFIX}/lib/gdalplugins", } proc_algs = "Contents/Resources/python/plugins/processing/algs" if opts.include?("with-grass") || brewed_grass7? grass7 = Formula["grass-70"] # for core integration plugin support envars[:GRASS_PREFIX] = "#{grass7.opt_prefix}/grass-#{grass7.version}" begin inreplace app/"#{proc_algs}/grass7/Grass7Utils.py", "/Applications/GRASS-7.0.app/Contents/MacOS", "#{grass7.opt_prefix}/grass-base" rescue Utils::InreplaceError puts "GRASS 7 GrassUtils already updated" end end if opts.include?("with-grass6") || brewed_grass6? grass6 = Formula["grass-64"] begin inreplace app/"#{proc_algs}/grass/GrassUtils.py", "/Applications/GRASS-6.4.app/Contents/MacOS", "#{grass6.opt_prefix}/grass-base" rescue Utils::InreplaceError puts "GRASS 6 GrassUtils already updated" end end unless opts.include? "without-globe" osg = Formula["open-scene-graph"] envars[:OSG_LIBRARY_PATH] = "#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}" end if opts.include? "with-isolation" envars[:DYLD_FRAMEWORK_PATH] = "#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks" versioned = %W[ #{Formula["sqlite"].opt_lib} #{Formula["expat"].opt_lib} #{Formula["libxml2"].opt_lib} #{HOMEBREW_PREFIX}/lib ] envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep) end if opts.include?("with-isolation") || File.exist?("/Library/Frameworks/GDAL.framework") envars[:PYQGIS_STARTUP] = opt_libexec/"pyqgis_startup.py" end # envars.each { |key, value| puts "#{key.to_s}=#{value}" } # exit # add env vars to QGIS.app's Info.plist, in LSEnvironment section plst = app/"Contents/Info.plist" # first delete any LSEnvironment setting, ignoring errors # CAUTION!: may not be what you want, if .app already has LSEnvironment settings dflt = `defaults read-type \"#{plst}\" LSEnvironment 2> /dev/null` `defaults delete \"#{plst}\" LSEnvironment` if dflt kv = "{ " envars.each { |key, value| kv += "'#{key}' = '#{value}'; " } kv += "}" `defaults write \"#{plst}\" LSEnvironment \"#{kv}\"` # add ability to toggle high resolution in Get Info dialog for app hrc = `defaults read-type \"#{plst}\" NSHighResolutionCapable 2> /dev/null` `defaults delete \"#{plst}\" NSHighResolutionCapable` if hrc `defaults write \"#{plst}\" NSHighResolutionCapable \"False\"` # leave the plist readable; convert from binary to XML format `plutil -convert xml1 -- \"#{plst}\"` # update modification date on app bundle, or changes won't take effect touch app.to_s # add env vars to launch script for QGIS app's binary qgis_bin = bin/"qgis" rm_f qgis_bin if File.exist?(qgis_bin) # install generates empty file bin_cmds = %W[#!/bin/sh\n] # setup shell-prepended env vars (may result in duplication of paths) envars[:PATH] = "#{HOMEBREW_PREFIX}/bin" + pthsep + "$PATH" envars[:PYTHONPATH] = %W[#{gdalpth} #{python_site_packages} $PYTHONPATH].join(pthsep) envars.each { |key, value| bin_cmds << "export #{key}=#{value}" } bin_cmds << opt_prefix/"QGIS.app/Contents/MacOS/QGIS \"$@\"" qgis_bin.write(bin_cmds.join("\n")) qgis_bin.chmod 0755 end def caveats s = <<~EOS Bottles support only Homebrew's Python QGIS is built as an application bundle. Environment variables for the Homebrew prefix are embedded in QGIS.app: #{opt_prefix}/QGIS.app You may also symlink QGIS.app into /Applications or ~/Applications: brew linkapps [--local] To directly run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper script pre-defined with Homebrew prefix environment variables: #{opt_bin}/qgis NOTE: Your current PATH and PYTHONPATH environment variables are honored when launching via the wrapper script, while launching QGIS.app bundle they are not. For standalone Python development, set the following environment variable: export PYTHONPATH=#{python_site_packages}:$PYTHONPATH Developer frameworks are installed in: #{opt_lib}/qgis-dev NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation. Use dyld -F option in CPPFLAGS/LDFLAGS when building other software. EOS if build.with? "isolation" s += <<~EOS QGIS built with isolation enabled. This allows it to coexist with other types of installations of QGIS on your Mac. However, on versions >= 2.0.1, this also means Python modules installed in the *system* Python will NOT be available to Python processes within QGIS.app. EOS end # check for required run-time Python module dependencies # TODO: add "pyspatialite" when PyPi package supports spatialite 4.x xm = [] %w[psycopg2 matplotlib pyparsing].each do |m| xm << m unless module_importable? m end unless xm.empty? s += <<~EOS The following Python modules are needed by QGIS during run-time: #{xm.join(", ")} You can install manually, via installer package or with `pip` (if availble): pip install OR pip-2.7 install EOS end # TODO: remove this when libqscintilla.dylib becomes core build dependency? unless module_importable? "PyQt4.Qsci" s += <<~EOS QScintilla Python module is needed by QGIS during run-time. Ensure `qscintilla2` formula is linked. EOS end s += <<~EOS If you have built GRASS 6.4.x or 7.0.x support for the Processing plugin set the following in QGIS: Processing->Options: Providers->GRASS commands->GRASS folder to: #{HOMEBREW_PREFIX}/opt/grass-64/grass-base Processing->Options: Providers->GRASS GIS 7 commands->GRASS 7 folder to: #{HOMEBREW_PREFIX}/opt/grass-70/grass-base EOS s end test do output = `#{bin}/qgis --help 2>&1` # why does help go to stderr? assert_match /^QGIS is a user friendly/, output end private def brewed_grass7? Formula["grass-70"].opt_prefix.exist? end def brewed_grass6? Formula["grass-64"].opt_prefix.exist? end def brewed_python_framework HOMEBREW_PREFIX/"Frameworks/Python.framework/Versions/2.7" end def brewed_python_framework? brewed_python_framework.exist? end def brewed_python? Formula["python"].linked_keg.exist? && brewed_python_framework? end def python_exec if brewed_python? brewed_python_framework/"bin/python" else which("python") end end def python_incdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`.strip) end def python_libdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))"`.strip) end def python_site_packages HOMEBREW_PREFIX/"lib/python2.7/site-packages" end def module_importable?(mod) quiet_system python_exec, "-c", "import #{mod}" end end ================================================ FILE: boneyard/qgis-22.rb ================================================ require 'formula' require File.expand_path("../../Requirements/qgis_requirements", Pathname.new(__FILE__).realpath) class UnlinkedQGIS22 < UnlinkedQGIS fatal true def qgis_formula_name "qgis-22" end satisfy(:build_env => false) { no_linked_qgis[0] } end class Qgis22 < Formula homepage 'http://www.qgis.org' url 'https://github.com/qgis/QGIS/archive/final-2_2_0.tar.gz' sha1 '5d043ef6b31a043aa2608a3eebdc3d7d997f2189' revision 4 option 'enable-isolation', "Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs" option 'with-debug', 'Enable debug build, which outputs info to system.log or console' option 'skip-stdlib-check', 'Build skips checking if dependencies are built against conflicting stdlib.' option 'without-server', 'Build without QGIS Server (qgis_mapserv.fcgi)' option 'without-postgresql', 'Build without current PostgreSQL client' option 'with-globe', 'Build with Globe plugin, based upon osgEarth' option 'with-grass', 'Build with GRASS integration plugin support' option 'with-postgis', 'Build extra PostGIS geospatial database extender' option 'with-oracle', 'Build extra Oracle geospatial database and raster support' option 'with-orfeo', 'Build extra Orfeo Toolbox for Processing plugin' option 'with-r', 'Build extra R for Processing plugin' option 'with-saga-gis', 'Build extra Saga GIS for Processing plugin' option 'with-qt-mysql', 'Build extra Qt MySQL plugin for eVis plugin' option 'with-api-docs', 'Build the API documentation with Doxygen and Graphviz' depends_on UnlinkedQGIS22 # core qgis depends_on 'cmake' => :build depends_on 'bison' => :build if build.with? 'api-docs' depends_on 'graphviz' => [:build, 'with-freetype'] depends_on 'doxygen' => [:build, 'with-dot'] # with graphviz support end depends_on (build.include? 'enable-isolation' || MacOS.version < :lion ) ? 'python' : :python depends_on 'qt' depends_on 'pyqt' depends_on SipBinary depends_on PyQtConfig depends_on 'qscintilla2' # will probably be a C++ lib deps in near future depends_on 'qwt' depends_on 'qwtpolar' depends_on 'gsl' depends_on 'sqlite' # keg_only depends_on 'expat' # keg_only depends_on 'proj' depends_on 'spatialindex' depends_on 'fcgi' if build.with? 'server' # use newer postgresql client than Apple's, also needed by `psycopg2` depends_on 'postgresql' => :recommended # core providers depends_on 'gdal' depends_on 'postgis' => :optional depends_on "oracle-client-sdk" if build.with? "oracle" # core plugins (c++ and python) depends_on 'grass-64' => :optional depends_on 'gdal-grass64' if build.with? 'grass' depends_on 'gettext' if build.with? 'grass' depends_on 'gpsbabel' => [:recommended, 'with-libusb'] depends_on 'open-scene-graph' if build.with? 'globe' depends_on 'homebrew/science/osgearth' if build.with? 'globe' depends_on 'pyspatialite' # for DB Manager depends_on 'qt-mysql' => :optional # for eVis plugin (non-functional in 2.0.1?) # core processing plugin extras # see `postgis` and `grass` above depends_on 'orfeo' => :optional depends_on 'homebrew/science/r' => :optional depends_on 'saga-gis' => :optional resource "pyqgis-startup" do url "https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py" sha1 "13d624e8ccc6bf072bbaeaf68cd6f7309abc1e74" version "2.0.0" end # patch that represents all backports to release-2_2 branch, # through 03e15e05b28fbab68541ba37be17e3ea6b1dfec2 stable do patch do url "https://gist.githubusercontent.com/dakcarto/9781934/raw/19d25932c8f0e1e89849cc8d2fc50a43dacfae42/qgis-22-backports.diff" sha1 "5cf37ba41686c78bc71430ed4405c6b5998b09cf" end end def install # Set bundling level back to 0 (the default in all versions prior to 1.8.0) # so that no time and energy is wasted copying the Qt frameworks into QGIS. qwt_fw = Formula['qwt'].opt_prefix/"lib/qwt.framework" qwtpolar_fw = Formula['qwtpolar'].opt_prefix/"lib/qwtpolar.framework" dev_fw = lib/'qgis-dev' dev_fw.mkpath qsci_opt = Formula['qscintilla2'].opt_prefix args = %W[ -DCMAKE_INSTALL_PREFIX=#{prefix} -DCMAKE_BUILD_TYPE=#{(build.with?('debug')) ? 'RelWithDebInfo' : 'None' } -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_VERBOSE_MAKEFILE=TRUE -Wno-dev -DBISON_EXECUTABLE=#{Formula['bison'].opt_prefix}/bin/bison -DENABLE_TESTS=FALSE -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers -DQWT_LIBRARY=#{qwt_fw}/qwt -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include/Qsci -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib -DWITH_INTERNAL_QWTPOLAR=FALSE -DQGIS_MACAPP_BUNDLE=0 -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}' -DQGIS_MACAPP_INSTALL_DEV=TRUE -DWITH_QSCIAPI=FALSE -DWITH_STAGED_PLUGINS=FALSE ] args << "-DPYTHON_EXECUTABLE='#{python_exec}'" # brewed python is used if installed if brewed_python? args << "-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'" end args << "-DGIT_MARKER=''" # if git clone borked, or release tarball, ends up defined as 'exported' args << '-DWITH_MAPSERVER=TRUE' if build.with? 'server' pgsql = Formula['postgresql'] args << "-DPOSTGRES_CONFIG=#{pgsql.opt_prefix}/bin/pg_config" if build.with? 'postgresql' if build.with? 'oracle' args << '-DWITH_ORACLE=TRUE' oracle_opt = Formula['oracle-client-sdk'].opt_prefix args << "-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include" args << "-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib" end if build.with? 'grass' grass = Formula["grass-64"] args << "-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version.to_s}'" # So that `libintl.h` can be found ENV.append 'CXXFLAGS', "-I'#{Formula['gettext'].opt_prefix}/include'" end if build.with? 'globe' osg = Formula['open-scene-graph'] opoo "`open-scene-graph` formula's keg not linked." unless osg.linked_keg.exist? args << '-DWITH_GLOBE=TRUE' # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there args << "-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.linked_keg.realpath.basename.to_s}" end args << '-DWITH_APIDOC=TRUE' if build.with? 'api-docs' # Avoid ld: framework not found QtSql # (https://github.com/Homebrew/homebrew-science/issues/23) ENV.append 'CXXFLAGS', "-F#{Formula['qt'].opt_prefix}/lib" mkdir 'build' cd 'build' do # fix install fail on stdlib check for Mavericks+, if mixing supporting libs with different stdlibs cxxstdlib_check :skip if MacOS.version >= :mavericks and build.include? 'skip-stdlib-check' system 'cmake', '..', *args #system 'bbedit', 'CMakeCache.txt' #raise system 'make', 'install' end py_lib = lib/"python2.7/site-packages" qgis_modules = prefix/'QGIS.app/Contents/Resources/python/qgis' py_lib.mkpath ln_s qgis_modules, py_lib/'qgis' ln_s 'QGIS.app/Contents/MacOS/fcgi-bin', prefix/'fcgi-bin' if build.with? 'server' doc.mkpath mv prefix/'QGIS.app/Contents/Resources/doc/api', doc/'api' if build.with? 'api-docs' ln_s prefix/'QGIS.app/Contents/Resources/doc', doc/'doc' # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped) # only works with QGIS > 2.0.1 # doesn't need executable bit set, loaded by Python runner in QGIS libexec.install resource("pyqgis-startup") bin.mkdir touch "#{bin}/qgis" # so it will be linked into HOMEBREW_PREFIX end def post_install # configure environment variables for .app and launching binary directly. # having this in `post_intsall` allows it to be individually run *after* installation with: # `brew postinstall -v qgis-22` opts = Tab.for_formula(self).used_options # define default isolation env vars pthsep = File::PATH_SEPARATOR pypth = "#{python_site_packages}" pths = %W[#{HOMEBREW_PREFIX/'bin'} /usr/bin /bin /usr/sbin /sbin /usr/X11/bin].join(pthsep) unless opts.include? 'enable-isolation' pths = ORIGINAL_PATHS.join(pthsep) unless pths.include? HOMEBREW_PREFIX/'bin' pths = HOMEBREW_PREFIX/'bin' + pthsep + pths end pyenv = ENV['PYTHONPATH'] if pyenv pypth = (pyenv.include?(pypth)) ? pyenv : pypth + pthsep + pyenv end end envars = { :PATH => "#{pths}", :PYTHONPATH => "#{pypth}", :GDAL_DRIVER_PATH => "#{HOMEBREW_PREFIX}/lib/gdalplugins" } if opts.include? 'with-grass' grass = Formula["grass-64"] envars[:GRASS_PREFIX] = "#{grass.opt_prefix}/grass-#{grass.version.to_s}" end if opts.include? 'with-globe' osg = Formula['open-scene-graph'] envars[:OSG_LIBRARY_PATH] = "#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.linked_keg.realpath.basename}" end if opts.include? 'enable-isolation' envars[:DYLD_FRAMEWORK_PATH] = "#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks" versioned = %W[ #{Formula['sqlite'].opt_prefix}/lib #{Formula['expat'].opt_prefix}/lib #{Formula['libxml2'].opt_prefix}/lib #{HOMEBREW_PREFIX}/lib ] envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep) end if opts.include? 'enable-isolation' or File.exist?("/Library/Frameworks/GDAL.framework") envars[:PYQGIS_STARTUP] = opt_libexec/'pyqgis_startup.py' end #envars.each { |key, value| puts "#{key.to_s}=#{value}" } #exit # add env vars to QGIS.app's Info.plist, in LSEnvironment section app = prefix/'QGIS.app' plst = app/'Contents/Info.plist' # first delete any LSEnvironment setting, ignoring errors # CAUTION!: may not be what you want, if .app already has LSEnvironment settings dflt = quiet_system "defaults read-type \"#{plst}\" LSEnvironment" system "defaults delete \"#{plst}\" LSEnvironment" if dflt kv = '{ ' envars.each { |key, value| kv += "'#{key.to_s}' = '#{value}'; " } kv += '}' system "defaults write \"#{plst}\" LSEnvironment \"#{kv}\"" # leave the plist readable; convert from binary to XML format system "plutil -convert xml1 -- \"#{plst}\"" # update modification date on app bundle, or changes won't take effect system "touch \"#{app}\"" # add env vars to launch script for QGIS app's binary qgis_bin = bin/'qgis' rm_f qgis_bin if File.exists?(qgis_bin) # install generates empty file bin_cmds = %W[#!/bin/sh\n] # setup shell-prepended env vars (may result in duplication of paths) envars[:PATH] = "#{HOMEBREW_PREFIX}/bin" + pthsep + '$PATH' envars[:PYTHONPATH] = "#{python_site_packages}" + pthsep + '$PYTHONPATH' envars.each { |key, value| bin_cmds << "export #{key.to_s}=#{value}" } bin_cmds << opt_prefix/'QGIS.app/Contents/MacOS/QGIS' qgis_bin.write(bin_cmds.join("\n")) qgis_bin.chmod 0755 end def caveats s = <<~EOS QGIS is built as an application bundle. Environment variables for the Homebrew prefix are embedded in QGIS.app: #{opt_prefix}/QGIS.app You may also symlink QGIS.app into /Applications or ~/Applications: brew linkapps [--local] To run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper script pre-defined with Homebrew prefix environment variables: #{opt_prefix}/bin/qgis NOTE: Your current PATH and PYTHONPATH environment variables are honored when launching via the wrapper script, while launching QGIS.app bundle they are not. For standalone Python development, set the following environment variable: export PYTHONPATH=#{python_site_packages}:$PYTHONPATH Developer frameworks are installed in: #{opt_prefix}/lib/qgis-dev NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation. Use dyld -F option in CPPFLAGS/LDFLAGS when building other software. EOS if build.include? 'enable-isolation' s += <<~EOS QGIS built with isolation enabled. This allows it to coexist with other types of installations of QGIS on your Mac. However, on versions >= 2.0.1, this also means Python modules installed in the *system* Python will NOT be available to Python processes within QGIS.app. EOS end # check for required run-time Python module dependencies # TODO: add 'pyspatialite' when PyPi package supports spatialite 4.x xm = [] %w[psycopg2 matplotlib pyparsing].each { |m| xm << m unless module_importable? m } unless xm.empty? s += <<~EOS The following Python modules are needed by QGIS during run-time: #{xm.join(', ')} You can install manually, via installer package or with `pip` (if availble): pip install OR pip-2.7 install EOS end # TODO: remove this when libqscintilla.dylib becomes core build dependency? unless module_importable? 'PyQt4.Qsci' s += <<~EOS QScintilla Python module is needed by QGIS during run-time. Ensure `qscintilla2` formula is linked. EOS end s end private # python utils (deprecated in latest Homebrew) def brewed_python_framework HOMEBREW_PREFIX/"Frameworks/Python.framework/Versions/2.7" end def brewed_python_framework? brewed_python_framework.exist? end def brewed_python? Formula["python"].linked_keg.exist? and brewed_python_framework? end def python_exec if brewed_python? brewed_python_framework/"bin/python" else which("python") end end def python_incdir Pathname.new(`#{python_exec} -c 'from distutils import sysconfig; print(sysconfig.get_python_inc())'`.strip) end def python_libdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))"`.strip) end def python_site_packages HOMEBREW_PREFIX/"lib/python2.7/site-packages" end def module_importable?(mod) quiet_system python_exec, "-c", "import #{mod}" end end ================================================ FILE: boneyard/qgis-24.rb ================================================ require File.expand_path("../../Requirements/qgis_requirements", Pathname.new(__FILE__).realpath) class UnlinkedQGIS24 < UnlinkedQGIS fatal true def qgis_formula_name "qgis-24" end satisfy(:build_env => false) { no_linked_qgis[0] } end class Qgis24 < Formula homepage "http://www.qgis.org" url "https://github.com/qgis/QGIS/archive/final-2_4_0.tar.gz" sha1 "df479a4c3ffe2c0f9f4777f320aab92ae2dd08b0" revision 4 def pour_bottle? brewed_python? end def bottle_caveat (MacOS.version == :mavericks) ? "Bottle supports only Homebrew Python\n\n" : "" end option "enable-isolation", "Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs" option "with-debug", "Enable debug build, which outputs info to system.log or console" option "without-server", "Build without QGIS Server (qgis_mapserv.fcgi)" option "without-postgresql", "Build without current PostgreSQL client" option "with-globe", "Build with Globe plugin, based upon osgEarth" option "without-postgis", "Build without extra PostGIS geospatial database extender" option "without-grass", "Build without GRASS 6 integration plugin and Processing plugin support" option "with-grass7", "Build with GRASS 7 for Processing plugin" option "with-oracle", "Build extra Oracle geospatial database and raster support" option "with-orfeo", "Build extra Orfeo Toolbox for Processing plugin" option "with-r", "Build extra R for Processing plugin" option "with-saga-gis", "Build extra Saga GIS for Processing plugin" option "with-qt-mysql", "Build extra Qt MySQL plugin for eVis plugin" option "with-api-docs", "Build the API documentation with Doxygen and Graphviz" depends_on UnlinkedQGIS24 # core qgis depends_on "cmake" => :build depends_on "bison" => :build if build.with? "api-docs" depends_on "graphviz" => [:build, "with-freetype"] depends_on "doxygen" => [:build, "with-dot"] # with graphviz support end depends_on (build.include? "enable-isolation" || MacOS.version < :lion ) ? "python" : :python depends_on "qt" depends_on "pyqt" depends_on SipBinary depends_on PyQtConfig depends_on "qscintilla2" # will probably be a C++ lib deps in near future depends_on "qwt" depends_on "qwtpolar" depends_on "gsl" depends_on "sqlite" # keg_only depends_on "expat" # keg_only depends_on "proj" depends_on "spatialindex" depends_on "fcgi" if build.with? "server" # use newer postgresql client than Apple's, also needed by `psycopg2` depends_on "postgresql" => :recommended # core providers depends_on "gdal" depends_on "postgis" => :recommended depends_on "oracle-client-sdk" if build.with? "oracle" # TODO: add MSSQL third-party support formula?, :optional # core plugins (c++ and python) if build.with? "grass" depends_on "grass-64" depends_on "gdal-grass64" depends_on "gettext" end if build.with? "globe" depends_on "open-scene-graph" => ["with-qt"] depends_on "homebrew/science/osgearth" end depends_on "gpsbabel" => [:recommended, "with-libusb"] # TODO: remove "pyspatialite" when PyPi package supports spatialite 4.x # or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite) depends_on "pyspatialite" # for DB Manager depends_on "qt-mysql" => :optional # for eVis plugin (non-functional in 2.x?) # core processing plugin extras # see `postgis` and `grass` above depends_on "grass-70" if build.with? "grass7" depends_on "orfeo-40" if build.with? "orfeo" depends_on "homebrew/science/r" => :optional depends_on "saga-gis" => :optional # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools) # TODO: Fusion from USFS (via `wine`?) resource "pyqgis-startup" do url "https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py" sha1 "13d624e8ccc6bf072bbaeaf68cd6f7309abc1e74" version "2.0.0" end # patch that represents all backports to release-2_4 branch, stable do patch do # 8fdd08a through ed14cf3, with all ms-windows subdirectory changes stripped (line endings break patch apply) url "https://gist.githubusercontent.com/dakcarto/ef82c5ade74120d92339/raw/1f7a5e39d87f07da79e8185e3f4aa6b00935456f/qgis-24-backports.diff" sha1 "298f6f9a853d03ae33dfe09eb4608d1aeaf8d5b8" end patch do # ed10647 through e973c66 url "https://gist.githubusercontent.com/dakcarto/a0465f760dd054d2ed02/raw/53c9ec6d6c042db4cbf807a7cd3d4e93a51e738d/qgis-24-backports-2.diff" sha1 "4ec068f7f2b42f680e90bb8d837f963b39f479ff" end end def install # Set bundling level back to 0 (the default in all versions prior to 1.8.0) # so that no time and energy is wasted copying the Qt frameworks into QGIS. qwt_fw = Formula["qwt"].opt_lib/"qwt.framework" qwtpolar_fw = Formula["qwtpolar"].opt_lib/"qwtpolar.framework" dev_fw = lib/"qgis-dev" dev_fw.mkpath qsci_opt = Formula["qscintilla2"].opt_prefix args = std_cmake_args args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo" if build.with? "debug" # override args += %W[ -DBISON_EXECUTABLE=#{Formula["bison"].opt_bin}/bison -DENABLE_TESTS=FALSE -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers -DQWT_LIBRARY=#{qwt_fw}/qwt -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include/Qsci -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib -DWITH_INTERNAL_QWTPOLAR=FALSE -DQGIS_MACAPP_BUNDLE=0 -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}' -DQGIS_MACAPP_INSTALL_DEV=TRUE -DWITH_QSCIAPI=FALSE -DWITH_STAGED_PLUGINS=FALSE ] args << "-DPYTHON_EXECUTABLE='#{python_exec}'" # brewed python is used if installed if brewed_python? args << "-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'" end args << "-DGIT_MARKER=''" # if git clone borked, or release tarball, ends up defined as 'exported' args << "-DWITH_MAPSERVER=#{build.with?("server") ? "TRUE" : "FALSE"}" args << "-DPOSTGRES_CONFIG=#{Formula["postgresql"].opt_bin}/pg_config" if build.with? "postgresql" args << "-DWITH_GRASS=#{build.with?("grass") ? "TRUE" : "FALSE"}" if build.with? "grass" # this is to build the GRASS Plugin, not for Processing plugin support grass = Formula["grass-64"] args << "-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version.to_s}'" # So that `libintl.h` can be found ENV.append "CXXFLAGS", "-I'#{Formula["gettext"].opt_include}'" end args << "-DWITH_GLOBE=#{build.with?("globe") ? "TRUE" : "FALSE"}" if build.with? "globe" osg = Formula["open-scene-graph"] opoo "`open-scene-graph` formula's keg not linked." unless osg.linked_keg.exist? # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there args << "-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}" end args << "-DWITH_ORACLE=#{build.with?("oracle") ? "TRUE" : "FALSE"}" if build.with? "oracle" oracle_opt = Formula["oracle-client-sdk"].opt_prefix args << "-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include" args << "-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib" end args << "-DWITH_APIDOC=#{build.with?("api-docs") ? "TRUE" : "FALSE"}" # Avoid ld: framework not found QtSql # (https://github.com/Homebrew/homebrew-science/issues/23) ENV.append "CXXFLAGS", "-F#{Formula["qt"].opt_lib}" # if using Homebrew's Python, make sure its components are always found first # see: https://github.com/Homebrew/homebrew/pull/28597 ENV["PYTHONHOME"] = "#{brewed_python_framework}" if brewed_python? mkdir "build" do system "cmake", "..", *args #system "bbedit", "CMakeCache.txt" #raise system "make", "install" end # Update .app's bundle identifier, so Kyngchaos.com installer doesn't get confused inreplace prefix/"QGIS.app/Contents/Info.plist", "org.qgis.qgis2", "org.qgis.qgis2-hb" py_lib = lib/"python2.7/site-packages" qgis_modules = prefix/"QGIS.app/Contents/Resources/python/qgis" py_lib.mkpath ln_s qgis_modules, py_lib/"qgis" ln_s "QGIS.app/Contents/MacOS/fcgi-bin", prefix/"fcgi-bin" if build.with? "server" doc.mkpath mv prefix/"QGIS.app/Contents/Resources/doc/api", doc/"api" if build.with? "api-docs" ln_s prefix/"QGIS.app/Contents/Resources/doc", doc/"doc" # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped) # only works with QGIS > 2.0.1 # doesn't need executable bit set, loaded by Python runner in QGIS libexec.install resource("pyqgis-startup") bin.mkdir touch "#{bin}/qgis" # so it will be linked into HOMEBREW_PREFIX end def post_install # configure environment variables for .app and launching binary directly. # having this in `post_intsall` allows it to be individually run *after* installation with: # `brew postinstall -v qgis-XX` <-- where XX is formula version app = prefix/"QGIS.app" tab = Tab.for_formula(self) opts = tab.used_options bottle_poured = tab.poured_from_bottle # define default isolation env vars pthsep = File::PATH_SEPARATOR pypth = "#{python_site_packages}" pths = %W[#{HOMEBREW_PREFIX/"bin"} /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin].join(pthsep) unless opts.include? "enable-isolation" pths = ORIGINAL_PATHS.join(pthsep) unless pths.include? HOMEBREW_PREFIX/"bin" pths = HOMEBREW_PREFIX/"bin" + pthsep + pths end pyenv = ENV["PYTHONPATH"] if pyenv pypth = (pyenv.include?(pypth)) ? pyenv : pypth + pthsep + pyenv end end # set install's lib/python2.7/site-packages first, so app will work if unlinked pypth = "#{lib}/python2.7/site-packages" + pthsep + pypth envars = { :PATH => "#{pths}", :PYTHONPATH => "#{pypth}", :GDAL_DRIVER_PATH => "#{HOMEBREW_PREFIX}/lib/gdalplugins" } proc_algs = "Contents/Resources/python/plugins/processing/algs" unless opts.include? "without-grass" grass = Formula["grass-64"] envars[:GRASS_PREFIX] = "#{grass.opt_prefix}/grass-#{grass.version.to_s}" begin inreplace app/"#{proc_algs}/grass/GrassUtils.py", "/Applications/GRASS-6.4.app/Contents/MacOS", HOMEBREW_PREFIX/"opt/grass-64/grass-base" unless bottle_poured rescue Utils::InreplaceError puts "GRASS 6 GrassUtils already updated" end end if opts.include? "with-grass7" begin inreplace app/"#{proc_algs}/grass7/Grass7Utils.py", "/Applications/GRASS-7.0.app/Contents/MacOS", HOMEBREW_PREFIX/"opt/grass-70/grass-base" rescue Utils::InreplaceError puts "GRASS 7 GrassUtils already updated" end end unless opts.include? "without-globe" osg = Formula["open-scene-graph"] envars[:OSG_LIBRARY_PATH] = "#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}" end if opts.include? "enable-isolation" envars[:DYLD_FRAMEWORK_PATH] = "#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks" versioned = %W[ #{Formula["sqlite"].opt_lib} #{Formula["expat"].opt_lib} #{Formula["libxml2"].opt_lib} #{HOMEBREW_PREFIX}/lib ] envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep) end if opts.include? "enable-isolation" or File.exist?("/Library/Frameworks/GDAL.framework") envars[:PYQGIS_STARTUP] = opt_libexec/"pyqgis_startup.py" end #envars.each { |key, value| puts "#{key.to_s}=#{value}" } #exit # add env vars to QGIS.app's Info.plist, in LSEnvironment section plst = app/"Contents/Info.plist" # first delete any LSEnvironment setting, ignoring errors # CAUTION!: may not be what you want, if .app already has LSEnvironment settings dflt = quiet_system "defaults read-type \"#{plst}\" LSEnvironment" system "defaults delete \"#{plst}\" LSEnvironment" if dflt kv = "{ " envars.each { |key, value| kv += "'#{key.to_s}' = '#{value}'; " } kv += "}" system "defaults write \"#{plst}\" LSEnvironment \"#{kv}\"" # leave the plist readable; convert from binary to XML format system "plutil -convert xml1 -- \"#{plst}\"" # update modification date on app bundle, or changes won't take effect system "touch \"#{app}\"" # add env vars to launch script for QGIS app's binary qgis_bin = bin/"qgis" rm_f qgis_bin if File.exists?(qgis_bin) # install generates empty file bin_cmds = %W[#!/bin/sh\n] # setup shell-prepended env vars (may result in duplication of paths) envars[:PATH] = "#{HOMEBREW_PREFIX}/bin" + pthsep + "$PATH" envars[:PYTHONPATH] = "#{python_site_packages}" + pthsep + "$PYTHONPATH" envars.each { |key, value| bin_cmds << "export #{key.to_s}=#{value}" } bin_cmds << opt_prefix/"QGIS.app/Contents/MacOS/QGIS \"$@\"" qgis_bin.write(bin_cmds.join("\n")) qgis_bin.chmod 0755 end def caveats s = bottle_caveat s += <<~EOS QGIS is built as an application bundle. Environment variables for the Homebrew prefix are embedded in QGIS.app: #{opt_prefix}/QGIS.app You may also symlink QGIS.app into /Applications or ~/Applications: brew linkapps [--local] To directly run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper script pre-defined with Homebrew prefix environment variables: #{opt_bin}/qgis NOTE: Your current PATH and PYTHONPATH environment variables are honored when launching via the wrapper script, while launching QGIS.app bundle they are not. For standalone Python development, set the following environment variable: export PYTHONPATH=#{python_site_packages}:$PYTHONPATH Developer frameworks are installed in: #{opt_lib}/qgis-dev NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation. Use dyld -F option in CPPFLAGS/LDFLAGS when building other software. EOS if build.include? "enable-isolation" s += <<~EOS QGIS built with isolation enabled. This allows it to coexist with other types of installations of QGIS on your Mac. However, on versions >= 2.0.1, this also means Python modules installed in the *system* Python will NOT be available to Python processes within QGIS.app. EOS end # check for required run-time Python module dependencies # TODO: add "pyspatialite" when PyPi package supports spatialite 4.x xm = [] %w[psycopg2 matplotlib pyparsing].each { |m| xm << m unless module_importable? m } unless xm.empty? s += <<~EOS The following Python modules are needed by QGIS during run-time: #{xm.join(", ")} You can install manually, via installer package or with `pip` (if availble): pip install OR pip-2.7 install EOS end # TODO: remove this when libqscintilla.dylib becomes core build dependency? unless module_importable? "PyQt4.Qsci" s += <<~EOS QScintilla Python module is needed by QGIS during run-time. Ensure `qscintilla2` formula is linked. EOS end s += <<~EOS If you have built GRASS 6.4.x or 7.0.x support for the Processing plugin set the following in QGIS: Processing->Options: Providers->GRASS commands->GRASS folder to: #{HOMEBREW_PREFIX}/opt/grass-64/grass-base Processing->Options: Providers->GRASS GIS 7 commands->GRASS 7 folder to: #{HOMEBREW_PREFIX}/opt/grass-70/grass-base EOS s end private # python utils (deprecated in latest Homebrew) # see: https://github.com/Homebrew/homebrew/pull/24842 #def osx_python? # p = `python -c "import sys; print(sys.prefix)"`.strip # p.start_with?("/System/Library/Frameworks/Python.framework") #end def brewed_python_framework HOMEBREW_PREFIX/"Frameworks/Python.framework/Versions/2.7" end def brewed_python_framework? brewed_python_framework.exist? end def brewed_python? Formula["python"].linked_keg.exist? and brewed_python_framework? end def python_exec if brewed_python? brewed_python_framework/"bin/python" else which("python") end end def python_incdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`.strip) end def python_libdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))"`.strip) end def python_site_packages HOMEBREW_PREFIX/"lib/python2.7/site-packages" end def module_importable?(mod) quiet_system python_exec, "-c", "import #{mod}" end end ================================================ FILE: boneyard/qgis-26.rb ================================================ require File.expand_path("../../Requirements/qgis_requirements", Pathname.new(__FILE__).realpath) class UnlinkedQGIS26 < UnlinkedQGIS fatal true def qgis_formula_name "qgis-26" end satisfy(:build_env => false) { no_linked_qgis[0] } end class Qgis26 < Formula homepage "http://www.qgis.org" url "https://github.com/qgis/QGIS/archive/final-2_6_1.tar.gz" sha1 "44f11f227658034c96b1bb8de52e84765422308c" revision 2 bottle do root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" sha1 "16f3990b210998f3d81e6aa13652d685ba18e897" => :mavericks sha1 "b4d5b5ee6fe443c000dd51c3c8437613aecaa3f1" => :yosemite end def pour_bottle? brewed_python? end option "enable-isolation", "Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs" option "with-debug", "Enable debug build, which outputs info to system.log or console" option "without-server", "Build without QGIS Server (qgis_mapserv.fcgi)" option "without-postgresql", "Build without current PostgreSQL client" option "with-globe", "Build with Globe plugin, based upon osgEarth" option "without-postgis", "Build without extra PostGIS geospatial database extender" option "without-grass", "Build without GRASS 6 integration plugin and Processing plugin support" option "with-grass7", "Build with GRASS 7 for Processing plugin" option "with-oracle", "Build extra Oracle geospatial database and raster support" option "with-orfeo", "Build extra Orfeo Toolbox for Processing plugin" option "with-r", "Build extra R for Processing plugin" option "with-saga-gis", "Build extra Saga GIS for Processing plugin" option "with-qt-mysql", "Build extra Qt MySQL plugin for eVis plugin" option "with-api-docs", "Build the API documentation with Doxygen and Graphviz" depends_on UnlinkedQGIS26 # core qgis depends_on "cmake" => :build depends_on "bison" => :build if build.with? "api-docs" depends_on "graphviz" => [:build, "with-freetype"] depends_on "doxygen" => [:build, "with-dot"] # with graphviz support end depends_on (build.include? "enable-isolation" || MacOS.version < :lion ) ? "python" : :python depends_on "qt" depends_on "pyqt" depends_on SipBinary depends_on PyQtConfig depends_on "qscintilla2" # will probably be a C++ lib deps in near future depends_on "qwt" depends_on "qwtpolar" depends_on "gsl" depends_on "sqlite" # keg_only depends_on "expat" # keg_only depends_on "proj" depends_on "spatialindex" depends_on "fcgi" if build.with? "server" # use newer postgresql client than Apple's, also needed by `psycopg2` depends_on "postgresql" => :recommended # core providers depends_on "gdal" depends_on "postgis" => :recommended depends_on "oracle-client-sdk" if build.with? "oracle" # TODO: add MSSQL third-party support formula?, :optional # core plugins (c++ and python) if build.with? "grass" depends_on "grass-64" depends_on "gdal-grass64" depends_on "gettext" end if build.with? "globe" depends_on "open-scene-graph" => ["with-qt"] depends_on "homebrew/science/osgearth" end depends_on "gpsbabel" => [:recommended, "with-libusb"] # TODO: remove "pyspatialite" when PyPi package supports spatialite 4.x # or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite) depends_on "pyspatialite" # for DB Manager depends_on "qt-mysql" => :optional # for eVis plugin (non-functional in 2.x?) # core processing plugin extras # see `postgis` and `grass` above depends_on "grass-70" if build.with? "grass7" depends_on "orfeo-40" if build.with? "orfeo" depends_on "homebrew/science/r" => :optional depends_on "saga-gis" => :optional # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools) # TODO: Fusion from USFS (via `wine`?) resource "pyqgis-startup" do url "https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py" sha1 "13d624e8ccc6bf072bbaeaf68cd6f7309abc1e74" version "2.0.0" end # patches that represent all backports to release-2_6 branch, since 2.6.1 tag, e2a51df (2014-11-28) # see: https://github.com/qgis/QGIS/commits/release-2_6 # and https://github.com/qgis/QGIS/commits/final-2_6_1 stable do patch do # 4e78b8b (2014-25-28) through e4d34cb (2015-01-20) minus windows-formatted patches url "https://gist.githubusercontent.com/dakcarto/55fa8700ca9640561b9f/raw/0da58873ce64e05f6e7add3c879c43879fa7b799/qgis-261-backports_A.diff" sha1 "8c426efec3d378038effc2e59b34f03acd1bcd0e" end end def install # Set bundling level back to 0 (the default in all versions prior to 1.8.0) # so that no time and energy is wasted copying the Qt frameworks into QGIS. qwt_fw = Formula["qwt"].opt_lib/"qwt.framework" qwtpolar_fw = Formula["qwtpolar"].opt_lib/"qwtpolar.framework" dev_fw = lib/"qgis-dev" dev_fw.mkpath qsci_opt = Formula["qscintilla2"].opt_prefix args = std_cmake_args args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo" if build.with? "debug" # override args += %W[ -DBISON_EXECUTABLE=#{Formula["bison"].opt_bin}/bison -DENABLE_TESTS=FALSE -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers -DQWT_LIBRARY=#{qwt_fw}/qwt -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib -DQSCI_SIP_DIR=#{qsci_opt}/share/sip -DWITH_INTERNAL_QWTPOLAR=FALSE -DQGIS_MACAPP_BUNDLE=0 -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}' -DQGIS_MACAPP_INSTALL_DEV=TRUE -DWITH_QSCIAPI=FALSE -DWITH_STAGED_PLUGINS=FALSE ] args << "-DPYTHON_EXECUTABLE='#{python_exec}'" # brewed python is used if installed if brewed_python? args << "-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'" end args << "-DGIT_MARKER=''" # if git clone borked, or release tarball, ends up defined as 'exported' args << "-DWITH_SERVER=#{build.with?("server") ? "TRUE" : "FALSE"}" if build.with? "server" fcgi_opt = Formula["fcgi"].opt_prefix args << "-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include" args << "-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib" end args << "-DPOSTGRES_CONFIG=#{Formula["postgresql"].opt_bin}/pg_config" if build.with? "postgresql" args << "-DWITH_GRASS=#{build.with?("grass") ? "TRUE" : "FALSE"}" if build.with? "grass" # this is to build the GRASS Plugin, not for Processing plugin support grass = Formula["grass-64"] args << "-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version.to_s}'" # So that `libintl.h` can be found ENV.append "CXXFLAGS", "-I'#{Formula["gettext"].opt_include}'" end args << "-DWITH_GLOBE=#{build.with?("globe") ? "TRUE" : "FALSE"}" if build.with? "globe" osg = Formula["open-scene-graph"] opoo "`open-scene-graph` formula's keg not linked." unless osg.linked_keg.exist? # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there args << "-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}" end args << "-DWITH_ORACLE=#{build.with?("oracle") ? "TRUE" : "FALSE"}" if build.with? "oracle" oracle_opt = Formula["oracle-client-sdk"].opt_prefix args << "-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include" args << "-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib" end args << "-DWITH_APIDOC=#{build.with?("api-docs") ? "TRUE" : "FALSE"}" # Avoid ld: framework not found QtSql # (https://github.com/Homebrew/homebrew-science/issues/23) ENV.append "CXXFLAGS", "-F#{Formula["qt"].opt_lib}" # if using Homebrew's Python, make sure its components are always found first # see: https://github.com/Homebrew/homebrew/pull/28597 ENV["PYTHONHOME"] = "#{brewed_python_framework}" if brewed_python? mkdir "build" do system "cmake", "..", *args #system "bbedit", "CMakeCache.txt" #raise system "make", "install" end # Update .app's bundle identifier, so Kyngchaos.com installer doesn't get confused inreplace prefix/"QGIS.app/Contents/Info.plist", "org.qgis.qgis2", "org.qgis.qgis2-hb" py_lib = lib/"python2.7/site-packages" qgis_modules = prefix/"QGIS.app/Contents/Resources/python/qgis" py_lib.mkpath ln_s qgis_modules, py_lib/"qgis" ln_s "QGIS.app/Contents/MacOS/fcgi-bin", prefix/"fcgi-bin" if build.with? "server" doc.mkpath mv prefix/"QGIS.app/Contents/Resources/doc/api", doc/"api" if build.with? "api-docs" ln_s prefix/"QGIS.app/Contents/Resources/doc", doc/"doc" # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped) # only works with QGIS > 2.0.1 # doesn't need executable bit set, loaded by Python runner in QGIS libexec.install resource("pyqgis-startup") bin.mkdir touch "#{bin}/qgis" # so it will be linked into HOMEBREW_PREFIX end def post_install # configure environment variables for .app and launching binary directly. # having this in `post_intsall` allows it to be individually run *after* installation with: # `brew postinstall -v qgis-XX` <-- where XX is formula version app = prefix/"QGIS.app" tab = Tab.for_formula(self) opts = tab.used_options bottle_poured = tab.poured_from_bottle # define default isolation env vars pthsep = File::PATH_SEPARATOR pypth = "#{python_site_packages}" pths = %W[#{HOMEBREW_PREFIX/"bin"} /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin].join(pthsep) unless opts.include? "enable-isolation" pths = ORIGINAL_PATHS.join(pthsep) unless pths.include? HOMEBREW_PREFIX/"bin" pths = HOMEBREW_PREFIX/"bin" + pthsep + pths end pyenv = ENV["PYTHONPATH"] if pyenv pypth = (pyenv.include?(pypth)) ? pyenv : pypth + pthsep + pyenv end end # set install's lib/python2.7/site-packages first, so app will work if unlinked pypth = "#{lib}/python2.7/site-packages" + pthsep + pypth envars = { :PATH => "#{pths}", :PYTHONPATH => "#{pypth}", :GDAL_DRIVER_PATH => "#{HOMEBREW_PREFIX}/lib/gdalplugins" } proc_algs = "Contents/Resources/python/plugins/processing/algs" unless opts.include? "without-grass" grass = Formula["grass-64"] envars[:GRASS_PREFIX] = "#{grass.opt_prefix}/grass-#{grass.version.to_s}" begin inreplace app/"#{proc_algs}/grass/GrassUtils.py", "/Applications/GRASS-6.4.app/Contents/MacOS", HOMEBREW_PREFIX/"opt/grass-64/grass-base" unless bottle_poured rescue Utils::InreplaceError puts "GRASS 6 GrassUtils already updated" end end if opts.include? "with-grass7" begin inreplace app/"#{proc_algs}/grass7/Grass7Utils.py", "/Applications/GRASS-7.0.app/Contents/MacOS", HOMEBREW_PREFIX/"opt/grass-70/grass-base" rescue Utils::InreplaceError puts "GRASS 7 GrassUtils already updated" end end unless opts.include? "without-globe" osg = Formula["open-scene-graph"] envars[:OSG_LIBRARY_PATH] = "#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}" end if opts.include? "enable-isolation" envars[:DYLD_FRAMEWORK_PATH] = "#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks" versioned = %W[ #{Formula["sqlite"].opt_lib} #{Formula["expat"].opt_lib} #{Formula["libxml2"].opt_lib} #{HOMEBREW_PREFIX}/lib ] envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep) end if opts.include? "enable-isolation" or File.exist?("/Library/Frameworks/GDAL.framework") envars[:PYQGIS_STARTUP] = opt_libexec/"pyqgis_startup.py" end #envars.each { |key, value| puts "#{key.to_s}=#{value}" } #exit # add env vars to QGIS.app's Info.plist, in LSEnvironment section plst = app/"Contents/Info.plist" # first delete any LSEnvironment setting, ignoring errors # CAUTION!: may not be what you want, if .app already has LSEnvironment settings dflt = quiet_system "defaults read-type \"#{plst}\" LSEnvironment" system "defaults delete \"#{plst}\" LSEnvironment" if dflt kv = "{ " envars.each { |key, value| kv += "'#{key.to_s}' = '#{value}'; " } kv += "}" system "defaults write \"#{plst}\" LSEnvironment \"#{kv}\"" # leave the plist readable; convert from binary to XML format system "plutil -convert xml1 -- \"#{plst}\"" # update modification date on app bundle, or changes won't take effect touch "#{app}" # add env vars to launch script for QGIS app's binary qgis_bin = bin/"qgis" rm_f qgis_bin if File.exists?(qgis_bin) # install generates empty file bin_cmds = %W[#!/bin/sh\n] # setup shell-prepended env vars (may result in duplication of paths) envars[:PATH] = "#{HOMEBREW_PREFIX}/bin" + pthsep + "$PATH" envars[:PYTHONPATH] = "#{python_site_packages}" + pthsep + "$PYTHONPATH" envars.each { |key, value| bin_cmds << "export #{key.to_s}=#{value}" } bin_cmds << opt_prefix/"QGIS.app/Contents/MacOS/QGIS \"$@\"" qgis_bin.write(bin_cmds.join("\n")) qgis_bin.chmod 0755 end def caveats s = <<~EOS Bottles support only Homebrew's Python QGIS is built as an application bundle. Environment variables for the Homebrew prefix are embedded in QGIS.app: #{opt_prefix}/QGIS.app You may also symlink QGIS.app into /Applications or ~/Applications: brew linkapps [--local] To directly run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper script pre-defined with Homebrew prefix environment variables: #{opt_bin}/qgis NOTE: Your current PATH and PYTHONPATH environment variables are honored when launching via the wrapper script, while launching QGIS.app bundle they are not. For standalone Python development, set the following environment variable: export PYTHONPATH=#{python_site_packages}:$PYTHONPATH Developer frameworks are installed in: #{opt_lib}/qgis-dev NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation. Use dyld -F option in CPPFLAGS/LDFLAGS when building other software. EOS if build.include? "enable-isolation" s += <<~EOS QGIS built with isolation enabled. This allows it to coexist with other types of installations of QGIS on your Mac. However, on versions >= 2.0.1, this also means Python modules installed in the *system* Python will NOT be available to Python processes within QGIS.app. EOS end # check for required run-time Python module dependencies # TODO: add "pyspatialite" when PyPi package supports spatialite 4.x xm = [] %w[psycopg2 matplotlib pyparsing].each { |m| xm << m unless module_importable? m } unless xm.empty? s += <<~EOS The following Python modules are needed by QGIS during run-time: #{xm.join(", ")} You can install manually, via installer package or with `pip` (if availble): pip install OR pip-2.7 install EOS end # TODO: remove this when libqscintilla.dylib becomes core build dependency? unless module_importable? "PyQt4.Qsci" s += <<~EOS QScintilla Python module is needed by QGIS during run-time. Ensure `qscintilla2` formula is linked. EOS end s += <<~EOS If you have built GRASS 6.4.x or 7.0.x support for the Processing plugin set the following in QGIS: Processing->Options: Providers->GRASS commands->GRASS folder to: #{HOMEBREW_PREFIX}/opt/grass-64/grass-base Processing->Options: Providers->GRASS GIS 7 commands->GRASS 7 folder to: #{HOMEBREW_PREFIX}/opt/grass-70/grass-base EOS s end private # python utils (deprecated in latest Homebrew) # see: https://github.com/Homebrew/homebrew/pull/24842 #def osx_python? # p = `python -c "import sys; print(sys.prefix)"`.strip # p.start_with?("/System/Library/Frameworks/Python.framework") #end def brewed_python_framework HOMEBREW_PREFIX/"Frameworks/Python.framework/Versions/2.7" end def brewed_python_framework? brewed_python_framework.exist? end def brewed_python? Formula["python"].linked_keg.exist? and brewed_python_framework? end def python_exec if brewed_python? brewed_python_framework/"bin/python" else which("python") end end def python_incdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`.strip) end def python_libdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))"`.strip) end def python_site_packages HOMEBREW_PREFIX/"lib/python2.7/site-packages" end def module_importable?(mod) quiet_system python_exec, "-c", "import #{mod}" end end ================================================ FILE: boneyard/qgis-28.rb ================================================ require File.expand_path("../../Requirements/qgis_requirements", Pathname.new(__FILE__).realpath) class UnlinkedQGIS28 < UnlinkedQGIS fatal true def qgis_formula_name "qgis-28" end satisfy(:build_env => false) { no_linked_qgis[0] } end class Qgis28 < Formula desc "Open Source Geographic Information System" homepage "http://www.qgis.org" url "https://github.com/qgis/QGIS/archive/final-2_8_9.tar.gz" sha256 "7bfc6fa2221ec7fc809c0cacc5ef821f6d3b6d8d8254b4cee8fd9c452731e3d6" bottle do # root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" # sha256 "6a2d89239b8da548a765beb839d428a81d1a1b34c3e64d8fe4c8699993aff7ef" => :mavericks # sha256 "15210d5e07cf9bfe1de8a042c5ddee82acf41b94adb28909a9c79dd6582e91c2" => :yosemite end def pour_bottle? brewed_python? end head "https://github.com/qgis/QGIS.git", :branch => "release-2_8" option "enable-isolation", "Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs" option "with-debug", "Enable debug build, which outputs info to system.log or console" option "without-server", "Build without QGIS Server (qgis_mapserv.fcgi)" option "without-postgresql", "Build without current PostgreSQL client" option "with-globe", "Build with Globe plugin, based upon osgEarth" option "without-postgis", "Build without extra PostGIS geospatial database extender" option "without-grass", "Build without GRASS 6 integration plugin and Processing plugin support" option "with-grass7", "Build with GRASS 7 for Processing plugin" option "with-oracle", "Build extra Oracle geospatial database and raster support" option "with-orfeo", "Build extra Orfeo Toolbox for Processing plugin" option "with-r", "Build extra R for Processing plugin" option "with-saga-gis", "Build extra Saga GIS for Processing plugin" option "with-qt-mysql", "Build extra Qt MySQL plugin for eVis plugin" option "with-api-docs", "Build the API documentation with Doxygen and Graphviz" depends_on UnlinkedQGIS28 # core qgis depends_on "cmake" => :build depends_on "bison" => :build if build.with? "api-docs" depends_on "graphviz" => [:build, "with-freetype"] depends_on "doxygen" => [:build, "with-dot"] # with graphviz support end depends_on (build.include? "enable-isolation" || MacOS.version < :lion ) ? "python" : :python depends_on "qt" depends_on "pyqt" depends_on SipBinary depends_on PyQtConfig depends_on "qscintilla2" # will probably be a C++ lib deps in near future depends_on "qwt" depends_on "qwtpolar" depends_on "gsl" depends_on "sqlite" # keg_only depends_on "expat" # keg_only depends_on "proj" depends_on "spatialindex" depends_on "fcgi" if build.with? "server" # use newer postgresql client than Apple's, also needed by `psycopg2` depends_on "postgresql" => :recommended # core providers depends_on "gdal" depends_on "postgis" => :recommended depends_on "oracle-client-sdk" if build.with? "oracle" # TODO: add MSSQL third-party support formula?, :optional # core plugins (c++ and python) if build.with? "grass" depends_on "grass-64" depends_on "gdal-grass64" depends_on "gettext" end if build.with? "globe" depends_on "open-scene-graph" => ["with-qt"] depends_on "homebrew/science/osgearth" end depends_on "gpsbabel" => [:recommended, "with-libusb"] # TODO: remove "pyspatialite" when PyPi package supports spatialite 4.x # or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite) depends_on "pyspatialite" # for DB Manager depends_on "qt-mysql" => :optional # for eVis plugin (non-functional in 2.x?) # core processing plugin extras # see `postgis` and `grass` above depends_on "grass-70" if build.with? "grass7" depends_on "orfeo-42" if build.with? "orfeo" depends_on "homebrew/science/r" => :optional depends_on "saga-gis" => :optional # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools) # TODO: Fusion from USFS (via `wine`?) resource "pyqgis-startup" do url "https://gist.githubusercontent.com/dakcarto/11385561/raw/7af66d0c8885a888831da6f12298a906484a1471/pyqgis_startup.py" sha256 "3d0adca0c8684f3d907c626fc86d93d73165e184960d16ae883fca665ecc32e6" version "2.0.0" end # patches that represent all backports to release-2_8 branch # see: https://github.com/qgis/QGIS/commits/release-2_8 # stable do # patch do # # since 2.8.9 tag thru ---, minus windows-formatted patches # url "" # sha256 "" # end # end def install # Set bundling level back to 0 (the default in all versions prior to 1.8.0) # so that no time and energy is wasted copying the Qt frameworks into QGIS. qwt_fw = Formula["qwt"].opt_lib/"qwt.framework" qwtpolar_fw = Formula["qwtpolar"].opt_lib/"qwtpolar.framework" dev_fw = lib/"qgis-dev" dev_fw.mkpath qsci_opt = Formula["qscintilla2"].opt_prefix args = std_cmake_args args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo" if build.with? "debug" # override args += %W[ -DBISON_EXECUTABLE=#{Formula["bison"].opt_bin}/bison -DENABLE_TESTS=FALSE -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers -DQWT_LIBRARY=#{qwt_fw}/qwt -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/include -DQSCINTILLA_LIBRARY=#{qsci_opt}/lib/libqscintilla2.dylib -DQSCI_SIP_DIR=#{qsci_opt}/share/sip -DWITH_INTERNAL_QWTPOLAR=FALSE -DQGIS_MACAPP_BUNDLE=0 -DQGIS_MACAPP_DEV_PREFIX='#{dev_fw}' -DQGIS_MACAPP_INSTALL_DEV=TRUE -DWITH_QSCIAPI=FALSE -DWITH_STAGED_PLUGINS=FALSE ] args << "-DPYTHON_EXECUTABLE='#{python_exec}'" # brewed python is used if installed if brewed_python? args << "-DPYTHON_CUSTOM_FRAMEWORK='#{brewed_python_framework}'" end # find git revision for HEAD build if build.head? && File.exists?("#{cached_download}/.git/index") args << "-DGITCOMMAND=#{Formula["git"].opt_bin}/git" args << "-DGIT_MARKER=#{cached_download}/.git/index" else args << "-DGIT_MARKER=''" # if git clone borked, or release tarball, ends up defined as 'exported' end args << "-DWITH_SERVER=#{build.with?("server") ? "TRUE" : "FALSE"}" if build.with? "server" fcgi_opt = Formula["fcgi"].opt_prefix args << "-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include" args << "-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib" end args << "-DPOSTGRES_CONFIG=#{Formula["postgresql"].opt_bin}/pg_config" if build.with? "postgresql" args << "-DWITH_GRASS=#{build.with?("grass") ? "TRUE" : "FALSE"}" if build.with? "grass" # this is to build the GRASS Plugin, not for Processing plugin support grass = Formula["grass-64"] args << "-DGRASS_PREFIX='#{grass.opt_prefix}/grass-#{grass.version.to_s}'" # So that `libintl.h` can be found ENV.append "CXXFLAGS", "-I'#{Formula["gettext"].opt_include}'" end args << "-DWITH_GLOBE=#{build.with?("globe") ? "TRUE" : "FALSE"}" if build.with? "globe" osg = Formula["open-scene-graph"] opoo "`open-scene-graph` formula's keg not linked." unless osg.linked_keg.exist? # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there args << "-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}" end args << "-DWITH_ORACLE=#{build.with?("oracle") ? "TRUE" : "FALSE"}" if build.with? "oracle" oracle_opt = Formula["oracle-client-sdk"].opt_prefix args << "-DOCI_INCLUDE_DIR=#{oracle_opt}/sdk/include" args << "-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib" end args << "-DWITH_APIDOC=#{build.with?("api-docs") ? "TRUE" : "FALSE"}" # Avoid ld: framework not found QtSql # (https://github.com/Homebrew/homebrew-science/issues/23) ENV.append "CXXFLAGS", "-F#{Formula["qt"].opt_lib}" # if using Homebrew's Python, make sure its components are always found first # see: https://github.com/Homebrew/homebrew/pull/28597 ENV["PYTHONHOME"] = "#{brewed_python_framework}" if brewed_python? mkdir "build" do system "cmake", "..", *args #system "bbedit", "CMakeCache.txt" #raise system "make", "install" end # Update .app's bundle identifier, so Kyngchaos.com installer doesn't get confused inreplace prefix/"QGIS.app/Contents/Info.plist", "org.qgis.qgis2", "org.qgis.qgis2-hb#{build.head? ? "-dev" : ""}" py_lib = lib/"python2.7/site-packages" py_lib.mkpath ln_s "../../../QGIS.app/Contents/Resources/python/qgis", py_lib/"qgis" ln_s "QGIS.app/Contents/MacOS/fcgi-bin", prefix/"fcgi-bin" if build.with? "server" doc.mkpath mv prefix/"QGIS.app/Contents/Resources/doc/api", doc/"api" if build.with? "api-docs" ln_s "../../../QGIS.app/Contents/Resources/doc", doc/"doc" # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped) # only works with QGIS > 2.0.1 # doesn't need executable bit set, loaded by Python runner in QGIS libexec.install resource("pyqgis-startup") bin.mkdir touch "#{bin}/qgis" # so it will be linked into HOMEBREW_PREFIX post_install end def post_install # configure environment variables for .app and launching binary directly. # having this in `post_intsall` allows it to be individually run *after* installation with: # `brew postinstall -v qgis-XX` <-- where XX is formula version app = prefix/"QGIS.app" tab = Tab.for_formula(self) opts = tab.used_options bottle_poured = tab.poured_from_bottle # define default isolation env vars pthsep = File::PATH_SEPARATOR pypth = "#{python_site_packages}" pths = %W[#{HOMEBREW_PREFIX/"bin"} /usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin].join(pthsep) unless opts.include? "enable-isolation" pths = ORIGINAL_PATHS.join(pthsep) unless pths.include? HOMEBREW_PREFIX/"bin" pths = HOMEBREW_PREFIX/"bin" + pthsep + pths end pyenv = ENV["PYTHONPATH"] if pyenv pypth = (pyenv.include?(pypth)) ? pyenv : pypth + pthsep + pyenv end end # set install's lib/python2.7/site-packages first, so app will work if unlinked pypth = "#{lib}/python2.7/site-packages" + pthsep + pypth envars = { :PATH => "#{pths}", :PYTHONPATH => "#{pypth}", :GDAL_DRIVER_PATH => "#{HOMEBREW_PREFIX}/lib/gdalplugins" } proc_algs = "Contents/Resources/python/plugins/processing/algs" unless opts.include? "without-grass" grass = Formula["grass-64"] envars[:GRASS_PREFIX] = "#{grass.opt_prefix}/grass-#{grass.version.to_s}" begin inreplace app/"#{proc_algs}/grass/GrassUtils.py", "/Applications/GRASS-6.4.app/Contents/MacOS", HOMEBREW_PREFIX/"opt/grass-64/grass-base" unless bottle_poured rescue Utils::InreplaceError puts "GRASS 6 GrassUtils already updated" end end if opts.include? "with-grass7" begin inreplace app/"#{proc_algs}/grass7/Grass7Utils.py", "/Applications/GRASS-7.0.app/Contents/MacOS", HOMEBREW_PREFIX/"opt/grass-70/grass-base" rescue Utils::InreplaceError puts "GRASS 7 GrassUtils already updated" end end unless opts.include? "without-globe" osg = Formula["open-scene-graph"] envars[:OSG_LIBRARY_PATH] = "#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version.to_s}" end if opts.include? "enable-isolation" envars[:DYLD_FRAMEWORK_PATH] = "#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks" versioned = %W[ #{Formula["sqlite"].opt_lib} #{Formula["expat"].opt_lib} #{Formula["libxml2"].opt_lib} #{HOMEBREW_PREFIX}/lib ] envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep) end if opts.include? "enable-isolation" or File.exist?("/Library/Frameworks/GDAL.framework") envars[:PYQGIS_STARTUP] = opt_libexec/"pyqgis_startup.py" end #envars.each { |key, value| puts "#{key.to_s}=#{value}" } #exit # add env vars to QGIS.app's Info.plist, in LSEnvironment section plst = app/"Contents/Info.plist" # first delete any LSEnvironment setting, ignoring errors # CAUTION!: may not be what you want, if .app already has LSEnvironment settings dflt = quiet_system "defaults read-type \"#{plst}\" LSEnvironment" system "defaults delete \"#{plst}\" LSEnvironment" if dflt kv = "{ " envars.each { |key, value| kv += "'#{key.to_s}' = '#{value}'; " } kv += "}" system "defaults write \"#{plst}\" LSEnvironment \"#{kv}\"" # leave the plist readable; convert from binary to XML format system "plutil -convert xml1 -- \"#{plst}\"" # update modification date on app bundle, or changes won't take effect touch "#{app}" # add env vars to launch script for QGIS app's binary qgis_bin = bin/"qgis" rm_f qgis_bin if File.exists?(qgis_bin) # install generates empty file bin_cmds = %W[#!/bin/sh\n] # setup shell-prepended env vars (may result in duplication of paths) envars[:PATH] = "#{HOMEBREW_PREFIX}/bin" + pthsep + "$PATH" envars[:PYTHONPATH] = "#{python_site_packages}" + pthsep + "$PYTHONPATH" envars.each { |key, value| bin_cmds << "export #{key.to_s}=#{value}" } bin_cmds << opt_prefix/"QGIS.app/Contents/MacOS/QGIS \"$@\"" qgis_bin.write(bin_cmds.join("\n")) qgis_bin.chmod 0755 end def caveats s = <<~EOS Bottles support only Homebrew's Python QGIS is built as an application bundle. Environment variables for the Homebrew prefix are embedded in QGIS.app: #{opt_prefix}/QGIS.app You may also symlink QGIS.app into /Applications or ~/Applications: brew linkapps [--local] To directly run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper script pre-defined with Homebrew prefix environment variables: #{opt_bin}/qgis NOTE: Your current PATH and PYTHONPATH environment variables are honored when launching via the wrapper script, while launching QGIS.app bundle they are not. For standalone Python development, set the following environment variable: export PYTHONPATH=#{python_site_packages}:$PYTHONPATH Developer frameworks are installed in: #{opt_lib}/qgis-dev NOTE: not symlinked to HOMEBREW_PREFIX/Frameworks, which affects isolation. Use dyld -F option in CPPFLAGS/LDFLAGS when building other software. EOS if build.include? "enable-isolation" s += <<~EOS QGIS built with isolation enabled. This allows it to coexist with other types of installations of QGIS on your Mac. However, on versions >= 2.0.1, this also means Python modules installed in the *system* Python will NOT be available to Python processes within QGIS.app. EOS end # check for required run-time Python module dependencies # TODO: add "pyspatialite" when PyPi package supports spatialite 4.x xm = [] %w[psycopg2 matplotlib pyparsing].each { |m| xm << m unless module_importable? m } unless xm.empty? s += <<~EOS The following Python modules are needed by QGIS during run-time: #{xm.join(", ")} You can install manually, via installer package or with `pip` (if availble): pip install OR pip-2.7 install EOS end # TODO: remove this when libqscintilla.dylib becomes core build dependency? unless module_importable? "PyQt4.Qsci" s += <<~EOS QScintilla Python module is needed by QGIS during run-time. Ensure `qscintilla2` formula is linked. EOS end s += <<~EOS If you have built GRASS 6.4.x or 7.0.x support for the Processing plugin set the following in QGIS: Processing->Options: Providers->GRASS commands->GRASS folder to: #{HOMEBREW_PREFIX}/opt/grass-64/grass-base Processing->Options: Providers->GRASS GIS 7 commands->GRASS 7 folder to: #{HOMEBREW_PREFIX}/opt/grass-70/grass-base EOS s end private def brewed_python_framework HOMEBREW_PREFIX/"Frameworks/Python.framework/Versions/2.7" end def brewed_python_framework? brewed_python_framework.exist? end def brewed_python? Formula["python"].linked_keg.exist? and brewed_python_framework? end def python_exec if brewed_python? brewed_python_framework/"bin/python" else which("python") end end def python_incdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`.strip) end def python_libdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))"`.strip) end def python_site_packages HOMEBREW_PREFIX/"lib/python2.7/site-packages" end def module_importable?(mod) quiet_system python_exec, "-c", "import #{mod}" end end ================================================ FILE: boneyard/qgis-ltr@2.rb ================================================ class QgisLtrAT2 < Formula include Language::Python::Virtualenv desc "Open Source Geographic Information System" homepage "https://www.qgis.org" revision 1 head "https://github.com/qgis/QGIS.git", :branch => "release-2_18" stable do url "https://github.com/qgis/QGIS/archive/final-2_18_28.tar.gz" sha256 "977380578a1dfd80861d25324fd841adab97647a15cb8582f748946dbd23277c" end bottle do root_url "https://dl.bintray.com/homebrew-osgeo/osgeo-bottles" sha256 "78a60f8a233aeec26ce7393f0d5af7124ff1b5fffe598a02f259e6a9e041c978" => :mojave sha256 "78a60f8a233aeec26ce7393f0d5af7124ff1b5fffe598a02f259e6a9e041c978" => :high_sierra sha256 "78a60f8a233aeec26ce7393f0d5af7124ff1b5fffe598a02f259e6a9e041c978" => :sierra end def pour_bottle? brewed_python? end option "with-isolation", "Isolate .app's environment to HOMEBREW_PREFIX, to coexist with other QGIS installs" option "without-debug", "Disable debug build, which outputs info to system.log or console" option "without-server", "Build without QGIS Server (qgis_mapserv.fcgi)" option "without-postgresql", "Build without current PostgreSQL client" option "with-gdal-1", "Build with GDAL/OGR v1.x instead of v2.x" option "with-globe", "Build with Globe plugin, based upon osgEarth" option "with-grass", "Build with GRASS 7 integration plugin and Processing plugin support (or install grass-7x first)" option "with-grass6", "Build extra GRASS 6 for Processing plugin" option "with-oracle", "Build extra Oracle geospatial database and raster support" option "with-orfeo5", "Build extra Orfeo Toolbox for Processing plugin" option "with-r", "Build extra R for Processing plugin" option "with-saga-gis-lts", "Build extra Saga GIS for Processing plugin" option "with-qspatialite", "Build QSpatialite Qt database driver" option "with-api-docs", "Build the API documentation with Doxygen and Graphviz" # option "with-qt-mysql", "Build extra Qt MySQL plugin for eVis plugin" # core qgis depends_on "cmake" => :build depends_on "bison" => :build depends_on "flex" => :build if build.with? "api-docs" depends_on "graphviz" => :build depends_on "doxygen" => :build end depends_on "python@2" depends_on "qt-4" depends_on "sip-qt4" depends_on "pyqt-qt4" depends_on "qca-qt4" depends_on "qscintilla2-qt4" depends_on "qwt-qt4" depends_on "qwtpolar-qt4" depends_on "qjson-qt4" depends_on "gsl" depends_on "sqlite" # keg_only depends_on "expat" # keg_only depends_on "osgeo-proj" depends_on "spatialindex" depends_on "fcgi" if build.with? "server" # use newer postgresql client than Apple's, also needed by `psycopg2` depends_on "osgeo-postgresql" => :recommended # core providers if build.with? "gdal-1" depends_on "gdal" else depends_on "gdal2" depends_on "gdal2-python" end depends_on "oracle-client-sdk" if build.with? "oracle" # TODO: add MSSQL third-party support formula?, :optional # core plugins (c++ and python) if build.with?("grass") || (HOMEBREW_PREFIX/"opt/grass7").exist? depends_on "osgeo-grass" depends_on "gettext" end if build.with? "globe" # this is pretty borked with OS X >= 10.10+ # depends on "open-scene-graph" => ["with-qt"] depends_on "open-scene-graph" depends_on "brewsci/science/osgearth" end depends_on "gpsbabel-qt4" => :optional # TODO: remove "pyspatialite" when PyPi package supports spatialite 4.x # or DB Manager supports libspatialite >= 4.2.0 (with mod_spatialite) depends_on "pyspatialite" # for DB Manager # depends on "qt-mysql" => :optional # for eVis plugin (non-functional in 2.x?) # core processing plugin extras # see `grass` above depends_on "grass6" => :optional depends_on "orfeo5" => :optional depends_on "r" => :optional depends_on "osgeo-saga-lts" => :optional # TODO: LASTools straight build (2 reporting tools), or via `wine` (10 tools) # TODO: Fusion from USFS (via `wine`?) resource "pyqgis-startup" do url "https://gist.githubusercontent.com/dakcarto/11385561/raw/e49f75ecec96ed7d6d3950f45ad3f30fe94d4fb2/pyqgis_startup.py" sha256 "385dce925fc2d29f05afd6508bc1f46ec84c0bc607cc0c8dfce78a4bb93b9c4e" version "2.14.0" end resource "certifi" do url "https://files.pythonhosted.org/packages/55/54/3ce77783acba5979ce16674fc98b1920d00b01d337cfaaf5db22543505ed/certifi-2018.11.29.tar.gz" sha256 "47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7" end resource "chardet" do url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz" sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae" end resource "idna" do url "https://files.pythonhosted.org/packages/ad/13/eb56951b6f7950cadb579ca166e448ba77f9d24efc03edd7e55fa57d04b7/idna-2.8.tar.gz" sha256 "c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407" end # MetaSearch plugin resource "OWSLib" do url "https://files.pythonhosted.org/packages/07/15/9609cbb31c9f7ce729d444c04319c1e68a1ae3fd377a93c7615392c0b1e0/OWSLib-0.17.1.tar.gz" sha256 "b2e7fd694d3cffcee79317bad492d60c0aa887aea6916517c051c3247b33b5a5" end resource "cython" do url "https://files.pythonhosted.org/packages/e0/31/4a166556f92c469d8291d4b03a187f325c773c330fffc1e798bf83d947f2/Cython-0.29.5.tar.gz" sha256 "9d5290d749099a8e446422adfb0aa2142c711284800fb1eb70f595101e32cbf1" end resource "pyproj" do url "https://files.pythonhosted.org/packages/26/8c/1da0580f334718e04f8bbf74f0515a7fb8185ff96b2560ce080c11aa145b/pyproj-1.9.6.tar.gz" sha256 "e0c02b1554b20c710d16d673817b2a89ff94738b0b537aead8ecb2edc4c4487b" end resource "python-dateutil" do url "https://files.pythonhosted.org/packages/ad/99/5b2e99737edeb28c71bcbec5b5dda19d0d9ef3ca3e92e3e925e7c0bb364c/python-dateutil-2.8.0.tar.gz" sha256 "c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e" end resource "pytz" do url "https://files.pythonhosted.org/packages/af/be/6c59e30e208a5f28da85751b93ec7b97e4612268bb054d0dff396e758a90/pytz-2018.9.tar.gz" sha256 "d5f05e487007e29e03409f9398d074e158d920d36eb82eaf66fb1136b0c5374c" end resource "requests" do url "https://files.pythonhosted.org/packages/52/2c/514e4ac25da2b08ca5a464c50463682126385c4272c18193876e91f4bc38/requests-2.21.0.tar.gz" sha256 "502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e" end resource "six" do url "https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz" sha256 "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" end resource "urllib3" do url "https://files.pythonhosted.org/packages/b1/53/37d82ab391393565f2f831b8eedbffd57db5a718216f82f1a8b4d381a1c1/urllib3-1.24.1.tar.gz" sha256 "de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22" end resource "coverage" do url "https://files.pythonhosted.org/packages/fb/af/ce7b0fe063ee0142786ee53ad6197979491ce0785567b6d8be751d2069e8/coverage-4.5.2.tar.gz" sha256 "ab235d9fe64833f12d1334d29b558aacedfbca2356dfb9691f2d0d38a8a7bfb4" end resource "funcsigs" do url "https://files.pythonhosted.org/packages/94/4a/db842e7a0545de1cdb0439bb80e6e42dfe82aaeaadd4072f2263a4fbed23/funcsigs-1.0.2.tar.gz" sha256 "a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50" end resource "future" do url "https://files.pythonhosted.org/packages/90/52/e20466b85000a181e1e144fd8305caf2cf475e2f9674e797b222f8105f5f/future-0.17.1.tar.gz" sha256 "67045236dcfd6816dc439556d009594abf643e5eb48992e36beac09c2ca659b8" end resource "mock" do url "https://files.pythonhosted.org/packages/0c/53/014354fc93c591ccc4abff12c473ad565a2eb24dcd82490fae33dbf2539f/mock-2.0.0.tar.gz" sha256 "b158b6df76edd239b8208d481dc46b6afd45a846b7812ff0ce58971cf5bc8bba" end resource "nose2" do url "https://files.pythonhosted.org/packages/1b/c5/d5fcd60f5bf8af1e320fde832d7965933581a9b21b0d1b29bbe2208f4403/nose2-0.8.0.tar.gz" sha256 "9052f2b46807b63d9bdf68e0768da1f8386368889b50043fd5d0889c470258f3" end resource "pbr" do url "https://files.pythonhosted.org/packages/4e/cc/691ba51448695510978855c07753344ca27af1d881a05f03b56dd8087570/pbr-5.1.2.tar.gz" sha256 "d717573351cfe09f49df61906cd272abaa759b3e91744396b804965ff7bff38b" end # DB Manager plugin and Processing plugin resource "psycopg2" do url "https://files.pythonhosted.org/packages/63/54/c039eb0f46f9a9406b59a638415c2012ad7be9b4b97bfddb1f48c280df3a/psycopg2-2.7.7.tar.gz" sha256 "f4526d078aedd5187d0508aa5f9a01eae6a48a470ed678406da94b4cd6524b7e" end # Processing plugin resource "PyYAML" do url "https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz" sha256 "3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf" end # MetaSearch plugin resource "Jinja2" do url "https://files.pythonhosted.org/packages/56/e6/332789f295cf22308386cf5bbd1f4e00ed11484299c5d7383378cf48ba47/Jinja2-2.10.tar.gz" sha256 "f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4" end resource "MarkupSafe" do url "https://files.pythonhosted.org/packages/ac/7e/1b4c2e05809a4414ebce0892fe1e32c14ace86ca7d50c70f00979ca9b3a3/MarkupSafe-1.1.0.tar.gz" sha256 "4e97332c9ce444b0c2c38dd22ddc61c743eb208d916e4265a2a3b575bdccb1d3" end # MetaSearch plugin resource "Pygments" do url "https://files.pythonhosted.org/packages/64/69/413708eaf3a64a6abb8972644e0f20891a55e621c6759e2c3f3891e05d63/Pygments-2.3.1.tar.gz" sha256 "5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a" end def install # Install python dependencies venv = virtualenv_create(libexec/'vendor') venv.pip_install resources.reject { |r| r.name == "pyqgis-startup" } # Set bundling level back to 0 (the default in all versions prior to 1.8.0) # so that no time and energy is wasted copying the Qt frameworks into QGIS. # Install custom widgets Designer plugin to local qt-4 plugins prefix inreplace "src/customwidgets/CMakeLists.txt", "${QT_PLUGINS_DIR}/designer", lib_qt4/"plugins/designer".to_s # Fix custom widgets Designer module install path inreplace "CMakeLists.txt", "${PYQT4_MOD_DIR}", lib_qt4/"python2.7/site-packages/PyQt4".to_s # Install db plugins to local qt-4 plugins prefix if build.with? "qspatialite" inreplace "src/providers/spatialite/qspatialite/CMakeLists.txt", "${QT_PLUGINS_DIR}/sqldrivers", lib_qt4/"plugins/sqldrivers".to_s end if build.with? "oracle" inreplace "src/providers/oracle/ocispatial/CMakeLists.txt", "${QT_PLUGINS_DIR}/sqldrivers", lib_qt4/"plugins/sqldrivers".to_s end qwt_fw = Formula["qwt-qt4"].opt_lib/"qwt.framework" qwtpolar_fw = Formula["qwtpolar-qt4"].opt_lib/"qwtpolar.framework" qsci_opt = Formula["qscintilla2-qt4"].opt_prefix args = std_cmake_args args << "-DCMAKE_BUILD_TYPE=RelWithDebInfo" if build.with? "debug" # override args += %W[ -DBISON_EXECUTABLE=#{Formula["bison"].opt_bin}/bison -DFLEX_EXECUTABLE=#{Formula["flex"].opt_bin}/flex -DENABLE_TESTS=FALSE -DENABLE_MODELTEST=FALSE -DSUPPRESS_QT_WARNINGS=TRUE -DQWT_INCLUDE_DIR=#{qwt_fw}/Headers -DQWT_LIBRARY=#{qwt_fw}/qwt -DQWTPOLAR_INCLUDE_DIR=#{qwtpolar_fw}/Headers -DQWTPOLAR_LIBRARY=#{qwtpolar_fw}/qwtpolar -DQSCINTILLA_INCLUDE_DIR=#{qsci_opt}/libexec/include -DQSCINTILLA_LIBRARY=#{qsci_opt}/libexec/lib/libqscintilla2.dylib -DQSCI_SIP_DIR=#{qsci_opt}/share/sip-qt4 -DWITH_QWTPOLAR=TRUE -DWITH_INTERNAL_QWTPOLAR=FALSE -DQGIS_MACAPP_BUNDLE=0 -DQGIS_MACAPP_INSTALL_DEV=FALSE -DWITH_QSCIAPI=FALSE -DWITH_STAGED_PLUGINS=TRUE -DWITH_GRASS=FALSE -DWITH_CUSTOM_WIDGETS=TRUE ] if build.without? "gdal-1" args << "-DGDAL_LIBRARY=#{Formula["gdal2"].opt_lib}/libgdal.dylib" args << "-DGDAL_INCLUDE_DIR=#{Formula["gdal2"].opt_include}" # These specific includes help ensure any gdal v1 includes are not # accidentally pulled from /usr/local/include # In CMakeLists.txt throughout QGIS source tree these includes may come # before opt/gdal2/include; 'fixing' many CMakeLists.txt may be unwise args << "-DGEOS_INCLUDE_DIR=#{Formula["geos"].opt_include}" args << "-DGSL_INCLUDE_DIR=#{Formula["gsl"].opt_include}" args << "-DPROJ_INCLUDE_DIR=#{Formula["proj"].opt_include}" args << "-DQCA_INCLUDE_DIR=#{Formula["qca-qt4"].opt_lib}/qca.framework/Headers" args << "-DSPATIALINDEX_INCLUDE_DIR=#{Formula["spatialindex"].opt_include}/spatialindex" args << "-DSPATIALITE_INCLUDE_DIR=#{Formula["libspatialite"].opt_include}" args << "-DSQLITE3_INCLUDE_DIR=#{Formula["sqlite"].opt_include}" end # Python Configuration args << "-DPYTHON_EXECUTABLE='#{`python2 -c "import sys; print(sys.executable)"`.chomp}'" args << "-DPYTHON_CUSTOM_FRAMEWORK='#{`python2 -c "import sys; print(sys.prefix)"`.chomp}'" # Disable future, because we've installed it in the virtualenv and will provide it at runtime. args << "-DWITH_INTERNAL_FUTURE=FALSE" # if using Homebrew's Python, make sure its components are always found first # see: https://github.com/Homebrew/homebrew/pull/28597 ENV["PYTHONHOME"] = brewed_python_framework.to_s if brewed_python? # handle custom site-packages for qt-4 keg-only modules and packages ENV.prepend_path "PYTHONPATH", python_site_packages ENV.append_path "PYTHONPATH", python_qt4_site_packages ENV.prepend_path "PATH", libexec/'vendor/bin/' # find git revision for HEAD build if build.head? && File.exist?("#{cached_download}/.git/index") args << "-DGITCOMMAND=#{Formula["git"].opt_bin}/git" args << "-DGIT_MARKER=#{cached_download}/.git/index" end args << "-DWITH_SERVER=#{build.with?("server") ? "TRUE" : "FALSE"}" if build.with? "server" fcgi_opt = Formula["fcgi"].opt_prefix args << "-DFCGI_INCLUDE_DIR=#{fcgi_opt}/include" args << "-DFCGI_LIBRARY=#{fcgi_opt}/lib/libfcgi.dylib" end args << "-DPOSTGRES_CONFIG=#{Formula["postgresql"].opt_bin}/pg_config" if build.with? "postgresql" args << "-DWITH_GRASS7=#{(build.with?("grass") || brewed_grass7?) ? "TRUE" : "FALSE"}" if build.with?("grass") || brewed_grass7? # this is to build the GRASS Plugin, not for Processing plugin support grass7 = Formula["grass7"] args << "-DGRASS_PREFIX7='#{grass7.opt_prefix}/grass-base'" # Keep superenv from stripping (use Cellar prefix) ENV.append "CXXFLAGS", "-isystem #{grass7.prefix.resolved_path}/grass-base/include" # So that `libintl.h` can be found (use Cellar prefix) ENV.append "CXXFLAGS", "-isystem #{Formula["gettext"].include.resolved_path}" end args << "-DWITH_GLOBE=#{build.with?("globe") ? "TRUE" : "FALSE"}" if build.with? "globe" osg = Formula["open-scene-graph"] opoo "`open-scene-graph` formula's keg not linked." unless osg.linked_keg.exist? # must be HOMEBREW_PREFIX/lib/osgPlugins-#.#.#, since all osg plugins are symlinked there args << "-DOSG_PLUGINS_PATH=#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}" end args << "-DWITH_ORACLE=#{build.with?("oracle") ? "TRUE" : "FALSE"}" if build.with? "oracle" oracle_opt = Formula["oracle-client-sdk"].opt_prefix args << "-DOCI_INCLUDE_DIR=#{oracle_opt}/include/oci" args << "-DOCI_LIBRARY=#{oracle_opt}/lib/libclntsh.dylib" end args << "-DWITH_QSPATIALITE=#{build.with?("qspatialite") ? "TRUE" : "FALSE"}" args << "-DWITH_APIDOC=#{build.with?("api-docs") ? "TRUE" : "FALSE"}" # Avoid ld: framework not found QtSql # (https://github.com/Homebrew/homebrew-science/issues/23) ENV.append "CXXFLAGS", "-F#{Formula["qt-4"].opt_lib}" # handle some compiler warnings ENV["CXX_EXTRA_FLAGS"] = "-Wno-unused-private-field -Wno-deprecated-register" if ENV.compiler == :clang && (MacOS::Xcode.version >= "7.0" || MacOS::CLT.version >= "7.0") ENV.append "CXX_EXTRA_FLAGS", "-Wno-inconsistent-missing-override" end mkdir "build" do # bbedit = "/usr/local/bin/bbedit" # cmake_config = Pathname("#{Dir.pwd}/#{name}_cmake-config.txt") # cmake_config.write ["cmake ..", *args].join(" \\\n") # system bbedit, cmake_config.to_s # raise system "cmake", "..", *args # system bbedit, "CMakeCache.txt" # raise system "make" system "make", "install" end # Fixup some errant lib linking # TODO: fix upstream in CMake dy_libs = [lib_qt4/"plugins/designer/libqgis_customwidgets.dylib"] dy_libs << lib_qt4/"plugins/sqldrivers/libqsqlspatialite.dylib" if build.with? "qspatialite" dy_libs.each do |dy_lib| MachO::Tools.dylibs(dy_lib.to_s).each do |i_n| %w[core gui].each do |f_n| sufx = i_n[/(qgis_#{f_n}\.framework.*)/, 1] next if sufx.nil? i_n_to = "#{opt_prefix}/QGIS.app/Contents/Frameworks/#{sufx}" puts "Changing install name #{i_n} to #{i_n_to} in #{dy_lib}" if ARGV.debug? dy_lib.ensure_writable do MachO::Tools.change_install_name(dy_lib.to_s, i_n.to_s, i_n_to, :strict => false) end end end end # Update .app's bundle identifier, so Kyngchaos.com installer doesn't get confused inreplace prefix/"QGIS.app/Contents/Info.plist", "org.qgis.qgis2", "org.qgis.qgis2-hb#{build.head? ? "-dev" : ""}" py_lib = python_site_packages ln_s "../../../QGIS.app/Contents/Resources/python/qgis", py_lib/"qgis" ln_s "QGIS.app/Contents/MacOS/fcgi-bin", prefix/"fcgi-bin" if build.with? "server" doc.mkpath mv prefix/"QGIS.app/Contents/Resources/doc/api", doc/"api" if build.with? "api-docs" ln_s "../../../QGIS.app/Contents/Resources/doc", doc/"doc" # copy PYQGIS_STARTUP file pyqgis_startup.py, even if not isolating (so tap can be untapped) # only works with QGIS > 2.0.1 # doesn't need executable bit set, loaded by Python runner in QGIS libexec.install resource("pyqgis-startup") bin.mkdir qgis_bin = bin/name.to_s touch qgis_bin.to_s # so it will be linked into HOMEBREW_PREFIX qgis_bin.chmod 0755 post_install end def post_install # configure environment variables for .app and launching binary directly. # having this in `post_intsall` allows it to be individually run *after* installation with: # `brew postinstall -v ` app = prefix/"QGIS.app" tab = Tab.for_formula(self) opts = tab.used_options # bottle_poured = tab.poured_from_bottle # define default isolation env vars pthsep = File::PATH_SEPARATOR pypth = python_site_packages.to_s pths = %w[/usr/bin /bin /usr/sbin /sbin /opt/X11/bin /usr/X11/bin] unless opts.include?("with-isolation") pths = ORIGINAL_PATHS.dup pyenv = ENV["PYTHONPATH"] if pyenv pypth = pyenv.include?(pypth) ? pyenv : pypth + pthsep + pyenv end end unless pths.include?(HOMEBREW_PREFIX/"bin") pths = pths.insert(0, HOMEBREW_PREFIX/"bin") end # set qt-4's then install's libexec/python2.7/site-packages first, so app will work if unlinked pypths = %W[#{python_qt4_site_packages} #{opt_libexec}/python2.7/site-packages #{pypth}] unless opts.include?("with-gdal-1") pths.insert(0, Formula["gdal2"].opt_bin.to_s) pths.insert(0, Formula["gdal2-python"].opt_bin.to_s) pypths.insert(0, "#{Formula["gdal2-python"].opt_lib}/python2.7/site-packages") end # prepend qt-4 based utils to PATH (reverse order) pths.insert(0, Formula["qca-qt4"].opt_bin.to_s) pths.insert(0, Formula["pyqt-qt4"].opt_bin.to_s) pths.insert(0, "#{Formula["sip-qt4"].opt_libexec}/bin") pths.insert(0, Formula["qt-4"].opt_bin.to_s) if opts.include?("with-gpsbabel-qt4") pths.insert(0, Formula["gpsbabel-qt4"].opt_bin.to_s) end # We need to manually add the saga lts path, since it's keg only if build.with? "saga-gis-lts" pths.insert(0, Formula["saga-gis-lts"].opt_bin.to_s) end envars = { :PATH => pths.join(pthsep), :PYTHONPATH => pypths.join(pthsep), :GDAL_DRIVER_PATH => "#{HOMEBREW_PREFIX}/lib/gdalplugins", } envars[:GDAL_DATA] = "#{Formula[opts.include?("with-gdal-1") ? "gdal": "gdal2"].opt_share}/gdal" # handle multiple Qt plugins directories qtplgpths = %W[ #{opt_lib}/qt-4/plugins #{hb_lib_qt4}/plugins #{Formula["qt-4"].opt_prefix}/plugins ] envars[:QT_PLUGIN_PATH] = qtplgpths.join(pthsep) proc_algs = "Contents/Resources/python/plugins/processing/algs" if opts.include?("with-grass") || brewed_grass7? grass7 = Formula["grass7"] # for core integration plugin support envars[:GRASS_PREFIX] = "#{grass7.opt_prefix}/grass-base" begin inreplace app/"#{proc_algs}/grass7/Grass7Utils.py", "/Applications/GRASS-7.0.app/Contents/MacOS", "#{grass7.opt_prefix}/grass-base" puts "GRASS 7 GrassUtils.py has been updated" rescue Utils::InreplaceError puts "GRASS 7 GrassUtils.py already updated" end end grass6 = Formula["grass6"] grass6_rpl = (opts.include?("with-grass6") || brewed_grass6?) ? "#{grass6.opt_prefix}/grass-base" : "" begin inreplace app/"#{proc_algs}/grass/GrassUtils.py", "/Applications/GRASS-6.4.app/Contents/MacOS", grass6_rpl puts "GRASS 6 GrassUtils.py has been updated" rescue Utils::InreplaceError puts "GRASS 6 GrassUtils.py already updated" end if opts.include?("with-orfeo5") || brewed_orfeo5? orfeo5 = Formula["orfeo5"] begin inreplace app/"#{proc_algs}/otb/OTBUtils.py" do |s| # default geoid path # try to replace first, so it fails (if already done) before global replaces s.sub! "OTB_GEOID_FILE) or ''", "OTB_GEOID_FILE) or '#{orfeo5.opt_libexec}/default_geoid/egm96.grd'" # default bin and lib path s.gsub! "/usr/local/bin", orfeo5.opt_bin.to_s s.gsub! "/usr/local/lib", orfeo5.opt_lib.to_s end puts "ORFEO 5 OTBUtils.py has been updated" rescue Utils::InreplaceError puts "ORFEO 5 OTBUtils.py already updated" end end unless opts.include?("without-globe") osg = Formula["open-scene-graph"] envars[:OSG_LIBRARY_PATH] = "#{HOMEBREW_PREFIX}/lib/osgPlugins-#{osg.version}" end if opts.include?("with-isolation") envars[:DYLD_FRAMEWORK_PATH] = "#{HOMEBREW_PREFIX}/Frameworks:/System/Library/Frameworks" versioned = %W[ #{Formula["sqlite"].opt_lib} #{Formula["expat"].opt_lib} #{Formula["libxml2"].opt_lib} #{HOMEBREW_PREFIX}/lib ] envars[:DYLD_VERSIONED_LIBRARY_PATH] = versioned.join(pthsep) end if opts.include?("with-isolation") || File.exist?("/Library/Frameworks/GDAL.framework") envars[:PYQGIS_STARTUP] = opt_libexec/"pyqgis_startup.py" end # envars.each { |key, value| puts "#{key.to_s}=#{value}" } # exit # add env vars to QGIS.app's Info.plist, in LSEnvironment section plst = app/"Contents/Info.plist" # first delete any LSEnvironment setting, ignoring errors # CAUTION!: may not be what you want, if .app already has LSEnvironment settings dflt = `defaults read-type \"#{plst}\" LSEnvironment 2> /dev/null` `defaults delete \"#{plst}\" LSEnvironment` if dflt kv = "{ " envars.each { |key, value| kv += "'#{key}' = '#{value}'; " } kv += "}" `defaults write \"#{plst}\" LSEnvironment \"#{kv}\"` # add ability to toggle high resolution in Get Info dialog for app hrc = `defaults read-type \"#{plst}\" NSHighResolutionCapable 2> /dev/null` `defaults delete \"#{plst}\" NSHighResolutionCapable` if hrc `defaults write \"#{plst}\" NSHighResolutionCapable \"False\"` # leave the plist readable; convert from binary to XML format `plutil -convert xml1 -- \"#{plst}\"` # make sure plist is readble by all users plst.chmod 0644 # update modification date on app bundle, or changes won't take effect touch app.to_s # add env vars to launch script for QGIS app's binary qgis_bin = bin/name.to_s rm_f qgis_bin if File.exist?(qgis_bin) # install generates empty file bin_cmds = %W[#!/bin/sh\n] # setup shell-prepended env vars (may result in duplication of paths) unless pths.include? HOMEBREW_PREFIX/"bin" pths.insert(0, HOMEBREW_PREFIX/"bin") end # even though this should be affected by with-isolation, allow local env override pths << "$PATH" pypths << "$PYTHONPATH" envars[:PATH] = pths.join(pthsep) envars[:PYTHONPATH] = pypths.join(pthsep) envars.each { |key, value| bin_cmds << "export #{key}=#{value}" } bin_cmds << opt_prefix/"QGIS.app/Contents/MacOS/QGIS \"$@\"" qgis_bin.write(bin_cmds.join("\n")) qgis_bin.chmod 0755 end def caveats s = <<~EOS Bottles support only Homebrew's Python QGIS is built as an application bundle. Environment variables for the Homebrew prefix are embedded in QGIS.app: #{opt_prefix}/QGIS.app You may also symlink QGIS.app into /Applications or ~/Applications: ln -Fs `find $(brew --prefix) -name "QGIS.app"` /Applications/QGIS.app To directly run the `QGIS.app/Contents/MacOS/QGIS` binary use the wrapper script pre-defined with Homebrew prefix environment variables: #{opt_bin}/#{name} NOTE: Your current PATH and PYTHONPATH environment variables are honored when launching via the wrapper script, while launching QGIS.app bundle they are not. For standalone Python development, set the following environment variable: export PYTHONPATH=#{libexec/"python2.7/site-packages"}:#{python_qt4_site_packages}:#{python_site_packages}:$PYTHONPATH EOS if build.with? "isolation" s += <<~EOS QGIS built with isolation enabled. This allows it to coexist with other types of installations of QGIS on your Mac. However, on versions >= 2.0.1, this also means Python modules installed in the *system* Python will NOT be available to Python processes within QGIS.app. EOS end # check for required run-time Python module dependencies # TODO: add "pyspatialite" when PyPi package supports spatialite 4.x xm = [] %w[psycopg2 matplotlib pyparsing requests future jinja2 pygments].each do |m| xm << m unless module_importable? m end unless xm.empty? s += <<~EOS #{Tty.red} The following Python modules are needed by QGIS during run-time: #{xm.join(", ")} You can install manually, via installer package or with `pip` (if availble): pip install OR pip-2.7 install #{Tty.red} #{Tty.reset} EOS end # TODO: remove this when libqscintilla.dylib becomes core build dependency? unless module_importable? "PyQt4.Qsci" s += <<~EOS QScintilla Python module is needed by QGIS during run-time. Ensure `qscintilla2-qt4` formula is linked. EOS end s += <<~EOS If you have built GRASS 6.4.x or 7.0.x support for the Processing plugin set the following in QGIS: Processing->Options: Providers->GRASS commands->GRASS folder to: #{HOMEBREW_PREFIX}/opt/grass6/grass-base Processing->Options: Providers->GRASS GIS 7 commands->GRASS 7 folder to: #{HOMEBREW_PREFIX}/opt/grass7/grass-base EOS s end test do output = `#{bin}/#{name.to_s} --help 2>&1` # why does help go to stderr? assert_match /^QGIS is a user friendly/, output end private def brewed_grass7? Formula["grass7"].opt_prefix.exist? end def brewed_grass6? Formula["grass6"].opt_prefix.exist? end def brewed_orfeo5? Formula["orfeo5"].opt_prefix.exist? end def brewed_python_framework HOMEBREW_PREFIX/"Frameworks/Python.framework/Versions/2.7" end def brewed_python_framework? brewed_python_framework.exist? end def brewed_python? Formula["python"].linked_keg.exist? && brewed_python_framework? end def python_exec if brewed_python? brewed_python_framework/"bin/python2" else which("python") end end def python_incdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`.strip) end def python_libdir Pathname.new(`#{python_exec} -c "from distutils import sysconfig; print(sysconfig.get_config_var('LIBPL'))"`.strip) end def python_site_packages libexec/"vendor/lib/python2.7/site-packages" end def hb_lib_qt4 HOMEBREW_PREFIX/"lib/qt-4" end def python_qt4_site_packages hb_lib_qt4/"python2.7/site-packages" end def lib_qt4 lib/"qt-4" end def opt_lib_qt4 opt_lib/"qt-4" end def module_importable?(mod) quiet_system python_exec, "-c", "import sys;sys.path.insert(1, '#{python_qt4_site_packages}'); import #{mod}" end end ================================================ FILE: boneyard/qjson-qt4.rb ================================================ class QjsonQt4 < Formula desc "Map JSON to QVariant objects" homepage "https://qjson.sourceforge.io/" url "https://downloads.sourceforge.net/project/qjson/qjson/0.8.1/qjson-0.8.1.tar.bz2" mirror "https://mirrors.kernel.org/debian/pool/main/q/qjson/qjson_0.8.1.orig.tar.bz2" sha256 "cd4db5b956247c4991a9c3e95512da257cd2a6bd011357e363d02300afc814d9" head "https://github.com/flavio/qjson.git" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" sha256 "b1c454074eb32130bb2be41f9790f8d138437ee1cdc1c29c5cf1922e25e22f0c" => :sierra sha256 "b1c454074eb32130bb2be41f9790f8d138437ee1cdc1c29c5cf1922e25e22f0c" => :high_sierra end depends_on "cmake" => :build depends_on "qt-4" def install system "cmake", ".", *std_cmake_args system "make", "install" end test do (testpath/"test.cpp").write <<~EOS #include int main() { QJson::Parser parser; return 0; } EOS system ENV.cxx, "-I#{include}", "-I#{Formula["qt-4"].opt_include}", "-L#{lib}", "-lqjson", testpath/"test.cpp", "-o", testpath/"test" system "./test" end end ================================================ FILE: boneyard/qscintilla2-qt4.rb ================================================ class Qscintilla2Qt4 < Formula desc "Port to Qt of the Scintilla editing component" homepage "https://www.riverbankcomputing.com/software/qscintilla/intro" url "https://downloads.sf.net/project/pyqt/QScintilla2/QScintilla-2.9.3/QScintilla_gpl-2.9.3.tar.gz" sha256 "98aab93d73b05635867c2fc757acb383b5856a0b416e3fd7659f1879996ddb7e" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" cellar :any rebuild 1 sha256 "4901834123c98962f50c4fa4fd7c48b46c926e846cd0b4390a2cd79d45e93e2b" => :high_sierra sha256 "4901834123c98962f50c4fa4fd7c48b46c926e846cd0b4390a2cd79d45e93e2b" => :sierra end option "without-plugin", "Skip building the Qt Designer plugin" option "without-python@2", "Skip building the Python bindings" depends_on "python@2" => :recommended if build.with? "python@2" depends_on "pyqt-qt4" else depends_on "qt-4" end # Fix build with Xcode 8 "error: implicit instantiation of undefined template" # Originally reported 7 Oct 2016 https://www.riverbankcomputing.com/pipermail/qscintilla/2016-October/001160.html # Patch below posted 13 Oct 2016 https://www.riverbankcomputing.com/pipermail/qscintilla/2016-October/001167.html # Same as Alan Garny's OpenCOR commit https://github.com/opencor/opencor/commit/70f3944e36b8b95b3ad92106aeae2f511b3f0e90 if DevelopmentTools.clang_build_version >= 800 patch do url "https://raw.githubusercontent.com/Homebrew/formula-patches/a651d71/qscintilla2/xcode-8.patch" sha256 "1a88309fdfd421f4458550b710a562c622d72d6e6fdd697107e4a43161d69bc9" end end def install # On Mavericks we want to target libc++, this requires an # unsupported/macx-clang-libc++ flag. if ENV.compiler == :clang && MacOS.version >= :mavericks spec = "unsupported/macx-clang-libc++" else spec = "macx-g++" end args = %W[-config release -spec #{spec}] cd "Qt4Qt5" do inreplace "qscintilla.pro" do |s| s.gsub! "$$[QT_INSTALL_LIBS]", libexec/"lib" s.gsub! "$$[QT_INSTALL_HEADERS]", libexec/"include" s.gsub! "$$[QT_INSTALL_TRANSLATIONS]", prefix/"trans" s.gsub! "$$[QT_INSTALL_DATA]", prefix/"data" end inreplace "features/qscintilla2.prf" do |s| s.gsub! "$$[QT_INSTALL_LIBS]", libexec/"lib" s.gsub! "$$[QT_INSTALL_HEADERS]", libexec/"include" end system "qmake", "qscintilla.pro", *args system "make" system "make", "install" end # Add qscintilla2 features search path, since it is not installed in Qt keg's mkspecs/features/ ENV["QMAKEFEATURES"] = prefix/"data/mkspecs/features" if build.with?("python@2") sip_f = Formula["sip-qt4"] ENV.prepend_path "PATH", "#{sip_f.opt_libexec}/bin" sip_dir = sip_f.name cd "Python" do Language::Python.each_python(build) do |python, version| lib.mkpath (share/sip_dir).mkpath ENV["PYTHONPATH"] = "#{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages" system python, "configure.py", "-o", libexec/"lib", "-n", libexec/"include", "--apidir=#{prefix}/qsci", "--destdir=#{lib}/qt-4/python#{version}/site-packages/PyQt4", "--stubsdir=#{lib}/qt-4/python#{version}/site-packages/PyQt4", "--sip-incdir=#{sip_f.opt_libexec}/include", "--qsci-sipdir=#{share}/#{sip_dir}", "--pyqt-sipdir=#{Formula["pyqt-qt4"].opt_share}/#{sip_dir}", "--spec=#{spec}" system "make" system "make", "install" system "make", "clean" end end end if build.with? "plugin" mkpath prefix/"plugins/designer" cd "designer-Qt4Qt5" do inreplace "designer.pro" do |s| s.sub! "$$[QT_INSTALL_PLUGINS]", "#{lib}/qt-4/plugins" s.sub! "$$[QT_INSTALL_LIBS]", libexec/"lib" end system "qmake", "designer.pro", *args system "make" system "make", "install" end end end def caveats s = "Libraries installed in #{opt_libexec}/lib\n\n" s += "Headers installed in #{opt_libexec}/include\n\n" s += "Python modules installed in:\n" Language::Python.each_python(build) do |_python, version| s += " #{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages/PyQt4" end s end test do Language::Python.each_python(build) do |python, version| ENV["PYTHONPATH"] = "#{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages" Pathname("test.py").write <<~EOS import PyQt4.Qsci assert("QsciLexer" in dir(PyQt4.Qsci)) EOS system python, "test.py" end end end ================================================ FILE: boneyard/qscintilla2.rb ================================================ require 'formula' class Qscintilla2 < Formula homepage 'http://www.riverbankcomputing.co.uk/software/qscintilla/intro' url 'http://downloads.sf.net/project/pyqt/QScintilla2/QScintilla-2.8/QScintilla-gpl-2.8.tar.gz' sha1 '3edf9d476d4e6af0706a4d33401667a38e3a697e' depends_on 'pyqt' depends_on 'sip' def install args = %W[-config release -spec] # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag if ENV.compiler == :clang and MacOS.version >= :mavericks args << "unsupported/macx-clang-libc++" else args << "macx-g++" end cd 'Qt4Qt5' do inreplace 'qscintilla.pro' do |s| s.gsub! '$$[QT_INSTALL_LIBS]', lib s.gsub! "$$[QT_INSTALL_HEADERS]", include s.gsub! "$$[QT_INSTALL_TRANSLATIONS]", "#{prefix}/trans" s.gsub! "$$[QT_INSTALL_DATA]", "#{prefix}/data" end system "qmake", *args system "make" system "make", "install" end cd 'Python' do (share/"sip").mkpath system 'python', 'configure.py', "-o", lib, "-n", include, "--apidir=#{prefix}/qsci", "--destdir=#{lib}/python2.7/site-packages/PyQt4", "--qsci-sipdir=#{share}/sip", "--pyqt-sipdir=#{HOMEBREW_PREFIX}/share/sip" system 'make' system 'make', 'install' end libexec.mkpath cd "designer-Qt4Qt5" do args << %Q["INCLUDEPATH+=#{include}"] inreplace "designer.pro" do |s| s.gsub! "$$[QT_INSTALL_LIBS]", lib s.gsub! "$$[QT_INSTALL_PLUGINS]", libexec end system "qmake", *args system "make" system "make", "install" end # symlink QT Designer plugin (note: not removed on formula uninstall) ln_sf libexec/"designer/libqscintillaplugin.dylib", "#{Formula.factory('qt').opt_prefix}/plugins/designer/" end test do system "python", "-c", "import PyQt4" end end ================================================ FILE: boneyard/qt-4.rb ================================================ class Qt4 < Formula desc "Cross-platform application and UI framework" homepage "https://www.qt.io/" url "https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz" mirror "http://qt.mirror.constant.com/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz" sha256 "e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0" bottle do root_url "https://dl.bintray.com/homebrew-osgeo/osgeo-bottles" rebuild 1 sha256 "b144bc04f10d95c1855ab79d69e0a2905694eb0165907846c8b153fa64ff1f67" => :high_sierra sha256 "b144bc04f10d95c1855ab79d69e0a2905694eb0165907846c8b153fa64ff1f67" => :sierra end # Backport of Qt5 commit to fix the fatal build error with Xcode 7, SDK 10.11. # https://code.qt.io/cgit/qt/qtbase.git/commit/?id=b06304e164ba47351fa292662c1e6383c081b5ca if MacOS.version >= :el_capitan patch do url "https://raw.githubusercontent.com/Homebrew/formula-patches/480b7142c4e2ae07de6028f672695eb927a34875/qt/el-capitan.patch" sha256 "c8a0fa819c8012a7cb70e902abb7133fc05235881ce230235d93719c47650c4e" end end keg_only "deprecated in homebrew-core for macOS >= Sierra (10.12)" option "with-qt3support", "Build with deprecated Qt3Support module support" option "with-docs", "Build documentation" option "without-webkit", "Build without QtWebKit module" depends_on "openssl" depends_on "dbus" => :optional depends_on "mysql" => :optional depends_on "osgeo-postgresql" => :optional # Qt4 is dead upstream. We backported a build fix for 10.11 but do not # intend to keep rescuing it forever, including for macOS 10.12. Homebrew will # be migrating to Qt5 as widely as possible, which remains supported upstream. # depends on MaximumMacOSRequirement => :el_capitan deprecated_option "qtdbus" => "with-dbus" deprecated_option "with-d-bus" => "with-dbus" resource "test-project" do url "https://gist.github.com/tdsmith/f55e7e69ae174b5b5a03.git", :revision => "6f565390395a0259fa85fdd3a4f1968ebcd1cc7d" end def install if ENV.compiler == :clang && (MacOS::Xcode.version >= "9.0" || MacOS::CLT.version >= "9.0") odie <<~EOS Compilation not supported with Xcode/CLT 9.0 or higher. Use no formula or source-build options and install available bottle. EOS end args = %W[ -prefix #{prefix} -release -opensource -confirm-license -fast -system-zlib -qt-libtiff -qt-libpng -qt-libjpeg -nomake demos -nomake examples -cocoa ] if ENV.compiler == :clang args << "-platform" if MacOS.version >= :mavericks args << "unsupported/macx-clang-libc++" else args << "unsupported/macx-clang" end end # Phonon is broken on macOS 10.12+ and Xcode 8+ due to QTKit.framework # being removed. args << "-no-phonon" if MacOS.version >= :sierra || MacOS::Xcode.version >= "8.0" args << "-openssl-linked" args << "-I" << Formula["openssl"].opt_include args << "-L" << Formula["openssl"].opt_lib args << "-plugin-sql-mysql" if build.with? "mysql" args << "-plugin-sql-psql" if build.with? "postgresql" if build.with? "dbus" dbus_opt = Formula["dbus"].opt_prefix args << "-I#{dbus_opt}/lib/dbus-1.0/include" args << "-I#{dbus_opt}/include/dbus-1.0" args << "-L#{dbus_opt}/lib" args << "-ldbus-1" args << "-dbus-linked" end if build.with? "qt3support" args << "-qt3support" else args << "-no-qt3support" end args << "-nomake" << "docs" if build.without? "docs" if MacOS.prefer_64_bit? args << "-arch" << "x86_64" else args << "-arch" << "x86" end args << "-no-webkit" if build.without? "webkit" system "./configure", *args system "make" ENV.deparallelize system "make", "install" # what are these anyway? (bin+"pixeltool.app").rmtree (bin+"qhelpconverter.app").rmtree # remove porting file for non-humans (prefix+"q3porting.xml").unlink if build.without? "qt3support" # Some config scripts will only find Qt in a "Frameworks" folder frameworks.install_symlink Dir["#{lib}/*.framework"] # The pkg-config files installed suggest that headers can be found in the # `include` directory. Make this so by creating symlinks from `include` to # the Frameworks' Headers folders. Pathname.glob("#{lib}/*.framework/Headers") do |path| include.install_symlink path => path.parent.basename(".framework") end # Make `HOMEBREW_PREFIX/lib/qt-4/plugins` an additional plug-in search path # for Qt Designer to support formulae that provide Qt Designer plug-ins. system "/usr/libexec/PlistBuddy", "-c", "Add :LSEnvironment:QT_PLUGIN_PATH string \"#{HOMEBREW_PREFIX}/lib/qt-4/plugins\"", "#{bin}/Designer.app/Contents/Info.plist" Pathname.glob("#{bin}/*.app") { |app| mv app, prefix } end def post_install (HOMEBREW_PREFIX/"lib/qt-4/plugins/designer").mkpath end def caveats; <<~EOS We agreed to the Qt opensource license for you. If this is unacceptable you should uninstall. Qt Designer no longer picks up changes to the QT_PLUGIN_PATH environment variable as it was tweaked to search for plug-ins provided by formulae in #{HOMEBREW_PREFIX}/lib/qt-4/plugins Phonon is not supported on macOS Sierra or with Xcode 8. EOS end test do Encoding.default_external = "UTF-8" unless RUBY_VERSION.start_with? "1." resource("test-project").stage testpath system bin/"qmake" system "make" assert_match(/GitHub/, pipe_output(testpath/"qtnetwork-test 2>&1", nil, 0)) end end ================================================ FILE: boneyard/qt4-mysql.rb ================================================ class NoQt4MysqlAlreadyRequirement < Requirement fatal true satisfy(:build_env => false) { !(Formula["qt-4"].prefix/"plugins/sqldrivers/libqsqlmysql.dylib").exist? } def message; <<~EOS Qt5 formula already has QtWebKit installed (e.g. built `--with-webkit`) EOS end end class Qt4Mysql < Formula desc "MySQL database plugin for Qt 4" homepage "http://qt-project.org/" # stripped down archive of just what's needed to compile driver url "https://osgeo4mac.s3.amazonaws.com/src/qt-4.8.7-mysql-driver.tar.gz" sha256 "fd542bb8502308e615aef68c76727091786cdd02f298e5b6e0c168d2ee49be85" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" sha256 "a32644c5b499c448eb426d19bcc9276f33f377cd199010946b1f85fa83dcb788" => :sierra sha256 "a32644c5b499c448eb426d19bcc9276f33f377cd199010946b1f85fa83dcb788" => :high_sierra end depends_on NoQt4MysqlAlreadyRequirement depends_on "mysql" => :build # just needs static client lib and headers depends_on "qt-4" depends_on "openssl" def install ENV.deparallelize qt_plugins = lib/"qt-4/plugins" (qt_plugins/"sqldrivers").mkpath inreplace "src/plugins/sqldrivers/qsqldriverbase.pri", "$$[QT_INSTALL_PLUGINS]", qt_plugins.to_s cd "src/plugins/sqldrivers/mysql" do args = %w[-spec] # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag if ENV.compiler == :clang && MacOS.version >= :mavericks args << "unsupported/macx-clang-libc++" else args << "macx-g++" end mysql = Formula["mysql"] args << %Q(INCLUDEPATH+="#{mysql.include}/mysql") args << %Q(LIBS+="#{mysql.lib}/libmysqlclient.a") args << %Q(LIBS+="-L#{Formula["openssl"].opt_lib}") args << 'LIBS+="-lssl"' args << 'LIBS+="-lcrypto"' args << "mysql.pro" system "#{Formula["qt-4"].opt_bin}/qmake", *args system "make", "release" system "make", "release-install" end end test do (testpath/"hello.pro").write <<~EOS QT += core sql QT -= gui TARGET = hello CONFIG += console CONFIG -= app_bundle TEMPLATE = app HEADERS = client.h SOURCES += client.cpp main.cpp EOS (testpath/"client.h").write <<~EOS #ifndef CLIENT_H #define CLIENT_H #include #include #include class Client : public QObject { Q_OBJECT public: Client(QObject *parent = 0); public slots: void checkSqlDriver(); }; #endif // CLIENT_H EOS (testpath/"client.cpp").write <<~EOS #include "client.h" #include #include #include #include Client::Client(QObject *parent) : QObject(parent) { } void Client::checkSqlDriver() { QCoreApplication::addLibraryPath("#{HOMEBREW_PREFIX}/lib/qt-4/plugins"); QCoreApplication::addLibraryPath("#{lib}/qt-4/plugins"); qDebug() << "QSqlDatabase::drivers(): " << QSqlDatabase::drivers().join(" "); QCoreApplication::exit(!QSqlDatabase::isDriverAvailable("QMYSQL")); } EOS (testpath/"main.cpp").write <<~EOS #include #include #include #include "client.h" int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); Client c(app.instance()); qDebug() << "Running application"; QTimer::singleShot(1000, &c, SLOT(checkSqlDriver())); return app.exec(); } EOS cd testpath do system Formula["qt-4"].bin/"qmake", "hello.pro" system "make" assert_predicate testpath/"client.o", :exist? assert_predicate testpath/"moc_client.o", :exist? assert_predicate testpath/"main.o", :exist? assert_predicate testpath/"hello", :exist? system "./hello" end end end ================================================ FILE: boneyard/qt4-oracle.rb ================================================ class Qt4Oracle < Formula desc "Oracle database plugin for Qt 4" homepage "http://qt-project.org/" # stripped down archive of just what's needed to compile driver url "https://osgeo4mac.s3.amazonaws.com/src/qt-4.8.7-oracle-driver.tar.gz" sha256 "72714836bebc58c7d0944110fef956ba085c714c7e81f00da287cdeedcbc231b" depends_on "qt-4" depends_on "oracle-client-sdk" def oracle_env_vars oci = Formula["oracle-client-sdk"] tab = Tab.for_formula(self) opts = tab.used_options oci_env_vars = { :ORACLE_HOME => oci.opt_prefix, :OCI_LIB => oci.opt_lib, :TNS_ADMIN => oci.opt_prefix/"network/admin", } oci_env_vars[:NLS_LANG] = "AMERICAN_AMERICA.UTF8" unless opts.include?("with-basic") oci_env_vars end def install ENV.deparallelize qt_plugins = lib/"qt-4/plugins" (qt_plugins/"sqldrivers").mkpath inreplace "src/plugins/sqldrivers/qsqldriverbase.pri", "$$[QT_INSTALL_PLUGINS]", qt_plugins.to_s sql_drivers = "#{buildpath}/src/sql/drivers" inreplace "#{sql_drivers}/oci/qsql_oci.h", "", '"qsqlcachedresult_p.h"' cd "src/plugins/sqldrivers/oci" do args = %w[-spec] # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag if ENV.compiler == :clang && MacOS.version >= :mavericks args << "unsupported/macx-clang-libc++" else args << "macx-g++" end args << %Q(INCLUDEPATH+="#{sql_drivers}/kernel") oci = Formula["oracle-client-sdk"] args << %Q(INCLUDEPATH+="#{oci.include}/oci") args << %Q(LIBS+="-L#{oci.opt_lib}") args << "oci.pro" # args << %Q(QMAKE_LFLAGS+="-Wl,-flat_namespace,-U,_environ") system "#{Formula["qt-4"].opt_bin}/qmake", *args system "make", "release" system "make", "release-install" end end def caveats s = <<~EOS Oracle client SDK environ: EOS oracle_env_vars.each { |k, v| s += " #{k}=#{v}\n" } s += "\n" end test do (testpath/"hello.pro").write <<~EOS QT += core sql QT -= gui TARGET = hello CONFIG += console CONFIG -= app_bundle TEMPLATE = app HEADERS = client.h SOURCES += client.cpp main.cpp EOS (testpath/"client.h").write <<~EOS #ifndef CLIENT_H #define CLIENT_H #include #include #include class Client : public QObject { Q_OBJECT public: Client(QObject *parent = 0); public slots: void checkSqlDriver(); }; #endif // CLIENT_H EOS (testpath/"client.cpp").write <<~EOS #include "client.h" #include #include #include #include Client::Client(QObject *parent) : QObject(parent) { } void Client::checkSqlDriver() { QCoreApplication::addLibraryPath("#{HOMEBREW_PREFIX}/lib/qt-4/plugins"); QCoreApplication::addLibraryPath("#{lib}/qt-4/plugins"); qDebug() << "QSqlDatabase::drivers(): " << QSqlDatabase::drivers().join(" "); QCoreApplication::exit(!QSqlDatabase::isDriverAvailable("QOCI")); } EOS (testpath/"main.cpp").write <<~EOS #include #include #include #include "client.h" int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); Client c(app.instance()); qDebug() << "Running application"; QTimer::singleShot(1000, &c, SLOT(checkSqlDriver())); return app.exec(); } EOS cd testpath do system Formula["qt-4"].bin/"qmake", "hello.pro" system "make" assert_predicate testpath/"client.o", :exist? assert_predicate testpath/"moc_client.o", :exist? assert_predicate testpath/"main.o", :exist? assert_predicate testpath/"hello", :exist? system "./hello" end end end ================================================ FILE: boneyard/qtkeychain-qt4.rb ================================================ class QtkeychainQt4 < Formula desc "Platform-independent Qt API for storing passwords securely" homepage "https://github.com/frankosterfeld/qtkeychain" url "https://github.com/frankosterfeld/qtkeychain/archive/d077333d7c4bb2846b9de9f3b8631a0b58f70a7e.tar.gz" version "0.7.90" sha256 "fe766d6189ffd89f5c8303833b43b832b13e14481970466ac09821e28d103f08" head "https://github.com/frankosterfeld/qtkeychain.git", :using => :git bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" sha256 "1baa17282d8777f0b6bd66cd5486a7c397d686cff51116cae7671401f2a4ece6" => :sierra sha256 "1baa17282d8777f0b6bd66cd5486a7c397d686cff51116cae7671401f2a4ece6" => :high_sierra end keg_only "newer Qt5-only version in homebrew-core" option "with-static", "Build static in addition to shared library" option "with-translations", "Generate Qt translation (.ts) files" depends_on "cmake" => :build depends_on "qt-4" def install args = std_cmake_args args << "-DQTKEYCHAIN_STATIC=OFF" args << "-DBUILD_WITH_QT4=ON" args << "-DBUILD_TRANSLATIONS=#{build.with?("translations") ? "ON" : "OFF"}" mkdir "build" do system "cmake", "..", *args system "make", "install" (libexec/"bin").install "testclient" # Deprecated: Using MachO::Tools # system "install_name_tool", "-change", "@rpath/libqtkeychain.1.dylib", # "#{opt_lib}/libqtkeychain.1.dylib", # "#{libexec}/bin/testclient" MachO::Tools.change_dylib_name("@rpath/libqtkeychain.1.dylib", "#{opt_lib}/libqtkeychain.1.dylib", "#{libexec}/bin/testclient") if build.with? "static" args << "-DQTKEYCHAIN_STATIC=ON" system "cmake", "..", *args system "make" mv "libqtkeychain.a", lib/"libqtkeychain_static.a" end end end def caveats if build.with? "static" <<~EOS Static library is available at: #{opt_lib}/libqtkeychain_static.a EOS end end test do assert_match "Password deleted successfully", shell_output(libexec/"bin/testclient delete something") end end ================================================ FILE: boneyard/quazip.rb ================================================ require "formula" class Quazip < Formula homepage "http://quazip.sourceforge.net/" url "https://downloads.sourceforge.net/project/quazip/quazip/0.6.2/quazip-0.6.2.tar.gz" sha1 "2fdcd063df645f94f047374d7d540b102fc683dc" depends_on "qt" def install # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag if ENV.compiler == :clang and MacOS.version >= :mavericks spec = "unsupported/macx-clang-libc++" else spec = "macx-g++" end args = %W[ -config release -spec #{spec} PREFIX=#{prefix} LIBS+=-L/usr/lib LIBS+=-lz INCLUDEPATH+=/usr/include ] system "qmake", "quazip.pro", *args system "make", "install" cd "qztest" do args = %W[-config release -spec #{spec}] system "qmake", *args system "make" libexec.install "qztest" end end test do ENV["DYLD_LIBRARY_PATH"] = "#{lib}" system "#{libexec}/qztest" end end ================================================ FILE: boneyard/qutepart.rb ================================================ require "formula" class Qutepart < Formula homepage "https://github.com/hlamer/qutepart" url "https://github.com/hlamer/qutepart/archive/v1.1.1.tar.gz" sha1 "0be6bd7dd4d0d770046b038d0e630bd6c42016ce" depends_on :python depends_on "pyqt" depends_on "pcre" def install ENV.deparallelize args = %W[ --prefix=#{prefix} --lib-dir=#{HOMEBREW_PREFIX/"lib"} --include-dir=#{HOMEBREW_PREFIX/"include"} ] system "python", "setup.py", "install", *args prefix.install "editor.py" rm "todo.txt" end test do assert_equal "(#{version.to_s.gsub(".", ", ")})", %x(python -c 'import qutepart;print qutepart.VERSION').strip end end ================================================ FILE: boneyard/qwt-qt4.rb ================================================ class QwtQt4 < Formula desc "Qt Widgets for Technical Applications" homepage "https://qwt.sourceforge.io/" url "https://downloads.sourceforge.net/project/qwt/qwt/6.1.3/qwt-6.1.3.tar.bz2" sha256 "f3ecd34e72a9a2b08422fb6c8e909ca76f4ce5fa77acad7a2883b701f4309733" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" sha256 "f1103a619ff0d1fc5df8708238185b2028ae645bc888f7be6ad017001a8a60f4" => :sierra sha256 "f1103a619ff0d1fc5df8708238185b2028ae645bc888f7be6ad017001a8a60f4" => :high_sierra end keg_only "newer Qt5-only version in homebrew-core" option "with-qwtmathml", "Build the qwtmathml library" option "without-plugin", "Skip building the Qt Designer plugin" depends_on "qt-4" # Update designer plugin linking back to qwt framework/lib after install # See: https://sourceforge.net/p/qwt/patches/45/ patch :DATA def install inreplace "qwtconfig.pri" do |s| s.gsub! /^\s*QWT_INSTALL_PREFIX\s*=(.*)$/, "QWT_INSTALL_PREFIX=#{prefix}" s.sub! /\+(=\s*QwtDesigner)/, "-\\1" if build.without? "plugin" # Install Qt plugin in `lib/qt-4/plugins/designer`, not `plugins/designer`. s.sub! %r{(= \$\$\{QWT_INSTALL_PREFIX\})/(plugins/designer)$}, "\\1/lib/qt-4/\\2" end args = ["-config", "release", "-spec"] # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag if ENV.compiler == :clang && MacOS.version >= :mavericks args << "unsupported/macx-clang-libc++" else args << "macx-g++" end if build.with? "qwtmathml" args << "QWT_CONFIG+=QwtMathML" prefix.install "textengines/mathml/qtmmlwidget-license" end system "qmake", *args system "make" system "make", "install" end def caveats s = "" if build.with? "qwtmathml" s += <<~EOS The qwtmathml library contains code of the MML Widget from the Qt solutions package. Beside the Qwt license you also have to take care of its license: #{opt_prefix}/qtmmlwidget-license EOS end if build.with? "plugin" s += <<~EOS Qt Designer plugin is not installed, but available at: #{opt_lib}/qt-4/plugins/designer/libqwt_designer_plugin.dylib EOS end s end test do (testpath/"test.cpp").write <<~EOS #include int main() { QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1"); return (curve1 == NULL); } EOS system ENV.cxx, "test.cpp", "-o", "out", "-framework", "qwt", "-framework", "QtCore", "-F#{Formula["qt-4"].opt_lib}", "-F#{lib}", "-I#{lib}/qwt.framework/Headers", "-I#{Formula["qt-4"].opt_lib}/QtCore.framework/Headers", "-I#{Formula["qt-4"].opt_lib}/QtGui.framework/Headers" system "./out" end end __END__ diff --git a/designer/designer.pro b/designer/designer.pro index c269e9d..c2e07ae 100644 --- a/designer/designer.pro +++ b/designer/designer.pro @@ -126,6 +126,16 @@ contains(QWT_CONFIG, QwtDesigner) { target.path = $${QWT_INSTALL_PLUGINS} INSTALLS += target + + macx { + contains(QWT_CONFIG, QwtFramework) { + QWT_LIB = qwt.framework/Versions/$${QWT_VER_MAJ}/qwt + } + else { + QWT_LIB = libqwt.$${QWT_VER_MAJ}.dylib + } + QMAKE_POST_LINK = install_name_tool -change $${QWT_LIB} $${QWT_INSTALL_LIBS}/$${QWT_LIB} $(DESTDIR)$(TARGET) + } } else { TEMPLATE = subdirs # do nothing ================================================ FILE: boneyard/qwt-qt4@5.2.rb ================================================ class QwtQt4AT52 < Formula desc "Qt Widgets for Technical Applications" homepage "https://qwt.sourceforge.io/" url "https://downloads.sourceforge.net/project/qwt/qwt/5.2.3/qwt-5.2.3.tar.bz2" sha256 "37feaf306753230b0d8538b4ff9b255c6fddaa3d6609ec5a5cc39a5a4d020ab7" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" sha256 "735c1d81cdf7b4192967e3923e15c07fbb1c06200c63cadd232b573fa022a2f2" => :sierra end keg_only "to avoid conflicts with newer versions" depends_on "qt-4" def install # redefine install prefix to Cellar inreplace "qwtconfig.pri", /^(\s*)INSTALLBASE\s*=(.*)$/, "\\1INSTALLBASE=#{prefix}" args = ["-config", "release", "-spec"] # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag if ENV.compiler == :clang && MacOS.version >= :mavericks args << "unsupported/macx-clang-libc++" else args << "macx-g++" end system "qmake", *args system "make" system "make", "install" end test do (testpath/"test.cpp").write <<~EOS #include int main() { QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1"); return (curve1 == NULL); } EOS system ENV.cxx, "test.cpp", "-o", "out", "-framework", "QtCore", "-F#{Formula["qt-4"].opt_lib}", "-L#{lib}", "-lqwt", "-I#{include}", "-I#{Formula["qt-4"].opt_lib}/QtCore.framework/Headers", "-I#{Formula["qt-4"].opt_lib}/QtGui.framework/Headers" system "./out" end end ================================================ FILE: boneyard/qwt60.rb ================================================ require 'formula' class Qwt60 < Formula homepage 'http://qwt.sourceforge.net/' url 'http://downloads.sourceforge.net/project/qwt/qwt/6.0.2/qwt-6.0.2.tar.bz2' sha1 'cbdd00b29521987c9e7bc6aa51092f0474b9428d' keg_only 'Conflicts with Qwt in main repository.' depends_on 'qt' def install inreplace 'qwtconfig.pri' do |s| # change_make_var won't work because there are leading spaces s.gsub! /^\s*QWT_INSTALL_PREFIX\s*=(.*)$/, "QWT_INSTALL_PREFIX=#{prefix}" # ensure frameworks aren't built, or qwtmathml linking fails to find -lqwt s << "\n" << 'QWT_CONFIG -= QwtFramework' end # see https://github.com/mxcl/homebrew/commit/e4df2f545a037c250f723981d65d59b08a37af44 args = %w[-config release -spec] # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag if ENV.compiler == :clang and MacOS.version >= :mavericks args << 'unsupported/macx-clang-libc++' else args << 'macx-g++' end system 'qmake', *args system 'make' system 'make install' end def caveats; <<~EOS The qwtmathml library contains code of the MML Widget from the Qt solutions package. Beside the Qwt license you also have to take care of its license. EOS end end ================================================ FILE: boneyard/qwtpolar-qt4.rb ================================================ class QwtpolarQt4 < Formula desc "Library for displaying values on a polar coordinate system" homepage "https://qwtpolar.sourceforge.io/" url "https://downloads.sf.net/project/qwtpolar/qwtpolar/1.1.0/qwtpolar-1.1.0.tar.bz2" sha256 "e45a1019b481f52a63483c536c5ef3225f1cced04abf45d7d0ff8e06d30e2355" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" sha256 "1e98ef9094e4e88737ebee0b1ab1c1a2c2a569f84b432c5bf9242ef9a0866b20" => :sierra sha256 "1e98ef9094e4e88737ebee0b1ab1c1a2c2a569f84b432c5bf9242ef9a0866b20" => :high_sierra end keg_only "newer Qt5-only version in homebrew-core" option "with-examples", "Install source code for example apps" option "without-plugin", "Skip building the Qt Designer plugin" depends_on "qt-4" depends_on "qwt-qt4" # Update designer plugin linking back to qwtpolar framework/lib after install # See: https://sourceforge.net/p/qwtpolar/patches/2/ patch :DATA def install cd "doc" do doc.install "html" man3.install Dir["man/man3/{q,Q}wt*"] end # Remove leftover doxygen files, so they don't get installed rm_r "doc" libexec.install Dir["examples/*"] if build.with? "examples" inreplace "qwtpolarconfig.pri" do |s| s.gsub! /^(\s*)QWT_POLAR_INSTALL_PREFIX\s*=\s*(.*)$/, "\\1QWT_POLAR_INSTALL_PREFIX=#{prefix}" s.sub! /\+(=\s*QwtPolarDesigner)/, "-\\1" if build.without? "plugin" # Don't build examples now, since linking flawed until qwtpolar installed s.sub! /\+(=\s*QwtPolarExamples)/, "-\\1" # Install Qt plugin in `lib/qt-4/plugins/designer`, not `plugins/designer`. s.sub! %r{(= \$\$\{QWT_POLAR_INSTALL_PREFIX\})/(plugins/designer)$}, "\\1/lib/qt-4/\\2" end args = %w[-config release -spec] # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag if ENV.compiler == :clang && MacOS.version >= :mavericks args << "unsupported/macx-clang-libc++" else args << "macx-g++" end ENV["QMAKEFEATURES"] = "#{Formula["qwt-qt4"].opt_prefix}/features" system "qmake", *args system "make" system "make", "install" end def caveats s = "" if build.with? "plugin" s += <<~EOS Qt Designer plugin is not installed, but available at: #{opt_lib}/qt-4/plugins/designer/libqwt_polar_designer_plugin.dylib EOS end s end test do (testpath/"test.cpp").write <<~EOS #include int main() { QwtPolarRenderer *curve1 = new QwtPolarRenderer(); return (curve1 == NULL); } EOS system ENV.cxx, "test.cpp", "-o", "out", "-framework", "qwtpolar", "-framework", "qwt", "-framework", "QtCore", "-F#{Formula["qt-4"].opt_lib}", "-F#{Formula["qwt-qt4"].opt_lib}", "-F#{lib}", "-I#{lib}/qwtpolar.framework/Headers", "-I#{Formula["qwt-qt4"].opt_lib}/qwt.framework/Headers", "-I#{Formula["qt-4"].opt_lib}/QtCore.framework/Headers", "-I#{Formula["qt-4"].opt_lib}/QtGui.framework/Headers" system "./out" end end __END__ diff --git a/designer/designer.pro b/designer/designer.pro index 24770fd..3ff0761 100644 --- a/designer/designer.pro +++ b/designer/designer.pro @@ -75,6 +75,16 @@ contains(QWT_POLAR_CONFIG, QwtPolarDesigner) { target.path = $${QWT_POLAR_INSTALL_PLUGINS} INSTALLS += target + + macx { + contains(QWT_POLAR_CONFIG, QwtPolarFramework) { + QWTP_LIB = qwtpolar.framework/Versions/$${QWT_POLAR_VER_MAJ}/qwtpolar + } + else { + QWTP_LIB = libqwtpolar.$${QWT_POLAR_VER_MAJ}.dylib + } + QMAKE_POST_LINK = install_name_tool -change $${QWTP_LIB} $${QWT_POLAR_INSTALL_LIBS}/$${QWTP_LIB} $(DESTDIR)$(TARGET) + } } else { TEMPLATE = subdirs # do nothing ================================================ FILE: boneyard/qwtpolar.rb ================================================ require "formula" class Qwtpolar < Formula homepage "http://qwtpolar.sourceforge.net/" url "http://downloads.sf.net/project/qwtpolar/qwtpolar/1.1.0/qwtpolar-1.1.0.tar.bz2" sha1 "94d5f897e75e37f32c910e3bdf2a1ffbaaf76621" option "with-examples", "Install source code for example apps" depends_on "qt" depends_on "qwt" def install cd "doc" do doc.install "html" man3.install Dir["man/man3/{q,Q}wt*"] end rm_r "doc" libexec.install Dir["examples/*"] if build.with? "examples" inreplace "qwtpolarconfig.pri" do |s| # change_make_var won't work because there are leading spaces s.gsub! /^(\s*)QWT_POLAR_INSTALL_PREFIX\s*=\s*(.*)$/, "\\1QWT_POLAR_INSTALL_PREFIX=#{prefix}" # don't build examples now, since linking flawed until qwtpolar installed s.sub! /\+(=\s*QwtPolarExamples)/, "-\\1" end # update designer plugin linking back to qwtpolar framework/lib inreplace "designer/designer.pro" do |s| s.sub! /(INSTALLS \+= target)/, "\\1\n" + <<~EOS macx { contains(QWT_POLAR_CONFIG, QwtPolarFramework) { QWTP_LIB = qwtpolar.framework/Versions/$${QWT_POLAR_VER_MAJ}/qwtpolar } else { QWTP_LIB = libqwtpolar.$${QWT_POLAR_VER_MAJ}.dylib } QMAKE_POST_LINK = install_name_tool -change $${QWTP_LIB} #{opt_prefix}/lib/$${QWTP_LIB} ${DESTDIR}/$(TARGET) } EOS end args = %W[-config release -spec] # On Mavericks we want to target libc++, this requires a unsupported/macx-clang-libc++ flag if ENV.compiler == :clang and MacOS.version >= :mavericks args << "unsupported/macx-clang-libc++" else args << "macx-g++" end ENV["QMAKEFEATURES"] = "#{Formula["qwt"].opt_prefix}/features" system "qmake", *args system "make" system "make", "install" # symlink Qt Designer plugin (note: not removed on qwtpolar formula uninstall) cd Formula["qt"].opt_prefix/"plugins/designer" do ln_sf prefix/"plugins/designer/libqwt_polar_designer_plugin.dylib", "." end end end ================================================ FILE: boneyard/sip-qt4.rb ================================================ class SipQt4 < Formula desc "Tool to create Python bindings for C and C++ libraries" homepage "https://www.riverbankcomputing.com/software/sip/intro" url "https://downloads.sourceforge.net/project/pyqt/sip/sip-4.18.1/sip-4.18.1.tar.gz" sha256 "9bce7a2dbf7f105bf68ad1bab58eebc0ce33087ec40396da756463f086ffa290" bottle do root_url "https://osgeo4mac.s3.amazonaws.com/bottles" cellar :any_skip_relocation sha256 "4c95142a42599fb0b6668e50e49913f19d0462ee05590aa9844cbc41cba6e350" => :high_sierra sha256 "4c95142a42599fb0b6668e50e49913f19d0462ee05590aa9844cbc41cba6e350" => :sierra end depends_on "python@2" => :recommended def install if build.without? "python@2" # this is a flaw in Homebrew, where `depends on :python` alone does not work odie "Must be built with Python2" end Language::Python.each_python(build) do |python, version| # Note the binary `sip` is the same for python 2.x and 3.x system python, "configure.py", "--deployment-target=#{MacOS.version}", "--destdir=#{lib}/qt-4/python#{version}/site-packages", "--bindir=#{libexec}/bin", "--incdir=#{libexec}/include", "--sipdir=#{HOMEBREW_PREFIX}/share/#{name}" system "make" system "make", "install" system "make", "clean" end end def post_install (HOMEBREW_PREFIX/"share/#{name}").mkpath end def caveats s = "sip executable installed in #{opt_libexec}/bin\n\n" s += "sip headers installed in #{opt_libexec}/include\n\n" s += "sip-dir for Python installed at #{HOMEBREW_PREFIX}/share/#{name}\n\n" s += "Python modules installed in:\n" Language::Python.each_python(build) do |_python, version| s += " #{HOMEBREW_PREFIX}/lib/qt-4/python#{version}/site-packages/PyQt4" end s end test do (testpath/"test.h").write <<~EOS #pragma once class Test { public: Test(); void test(); }; EOS (testpath/"test.cpp").write <<~EOS #include "test.h" #include Test::Test() {} void Test::test() { std::cout << "Hello World!" << std::endl; } EOS (testpath/"test.sip").write <<~EOS %Module test class Test { %TypeHeaderCode #include "test.h" %End public: Test(); void test(); }; EOS (testpath/"generate.py").write <<~EOS from sipconfig import SIPModuleMakefile, Configuration m = SIPModuleMakefile(Configuration(), "test.build") m.extra_libs = ["test"] m.extra_lib_dirs = ["."] m.generate() EOS (testpath/"run.py").write <<~EOS from test import Test t = Test() t.test() EOS system ENV.cxx, "-shared", "-Wl,-install_name,#{testpath}/libtest.dylib", "-o", "libtest.dylib", "test.cpp" system libexec/"bin/sip", "-b", "test.build", "-c", ".", "test.sip" Language::Python.each_python(build) do |python, version| ENV["PYTHONPATH"] = lib/"qt-4/python#{version}/site-packages" system python, "generate.py" system "make", "-j1", "clean", "all" system python, "run.py" end end end ================================================ FILE: boneyard/spatialite-gui-17.rb ================================================ require 'formula' class SpatialiteGui17 < Formula homepage 'https://www.gaia-gis.it/fossil/spatialite_gui/index' url 'http://www.gaia-gis.it/gaia-sins/spatialite-gui-sources/spatialite_gui-1.7.1.tar.gz' sha1 '3b9d88e84ffa5a4f913cf74b098532c2cd15398f' conflicts_with 'spatialite-gui', :because => 'spatialite-gui in main tap' depends_on 'pkg-config' => :build depends_on 'libxml2' depends_on 'libspatialite' depends_on 'libgaiagraphics' depends_on 'wxmac-29' depends_on 'geos' depends_on 'proj' depends_on 'freexl' depends_on 'sqlite' patch :p1, :DATA def install system "./configure", "--prefix=#{prefix}" system "make install" end end __END__ For some strange reason, wxWidgets does not take the required steps to register programs as GUI apps like other toolkits do. This necessitates the creation of an app bundle on OS X. This clever hack sidesteps the headache of packing simple programs into app bundles: 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 --- Main.cpp | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/Main.cpp b/Main.cpp index a857e8a..9c90afb 100644 --- a/Main.cpp +++ b/Main.cpp @@ -71,6 +71,12 @@ #define unlink _unlink #endif +#ifdef __WXMAC__ +// Allow the program to run and recieve focus without creating an app bundle. +#include +extern "C" { void CPSEnableForegroundOperation(ProcessSerialNumber* psn); } +#endif + IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { @@ -86,6 +92,21 @@ IMPLEMENT_APP(MyApp) frame->Show(true); SetTopWindow(frame); frame->LoadConfig(path); + +#ifdef __WXMAC__ + // Acquire the necessary resources to run as a GUI app without being inside + // an app bundle. + // + // Credit for this hack goes to: + // + // 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 + ProcessSerialNumber psn; + + GetCurrentProcess( &psn ); + CPSEnableForegroundOperation( &psn ); + SetFrontProcess( &psn ); +#endif + return true; } -- 1.7.9 ================================================ FILE: boneyard/v8318.rb ================================================ require 'formula' # Use the official github mirror, it is easier to find tags there # .even versions are stable, .odd releases are devel. Kind of: # https://code.google.com/p/v8/issues/detail?id=2545 # http://omahaproxy.appspot.com/ class V8318 < Formula homepage 'http://code.google.com/p/v8/' url 'https://github.com/v8/v8/archive/3.18.5.tar.gz' sha1 'd11c925898c5a0480aa947b1ed03b8f039d7e5d2' keg_only 'Conflicts with v8 in main repository.' # gyp currently depends on a full xcode install # https://code.google.com/p/gyp/issues/detail?id=292 depends_on "xcode" def install system 'make dependencies' system 'make', 'native', "-j#{ENV.make_jobs}", "library=shared", "snapshot=on", "console=readline" prefix.install 'include' cd 'out/native' do lib.install Dir['lib*'] bin.install 'd8', 'lineprocessor', 'preparser', 'process', 'shell' => 'v8' bin.install Dir['mksnapshot.*'] end end end ================================================ FILE: boneyard/wxmac-28.rb ================================================ require 'formula' class Wxpython28 < Formula # For 2.8, we use this separate formula for wxPython. For 2.9 we use the combined one. url 'https://downloads.sourceforge.net/wxpython/wxPython-src-2.8.12.1.tar.bz2' sha1 '05688dc03d61631750f5904273122bb40a2115f5' head 'http://svn.wxwidgets.org/svn/wx/wxPython/trunk/', :using => StrictSubversionDownloadStrategy homepage 'http://www.wxpython.org' end class Wxmac28 < Formula url 'https://downloads.sourceforge.net/project/wxwindows/2.8.12/wxMac-2.8.12.tar.bz2' sha1 'cb7b7e76bb88ec4a23346cf0d99e361101b17737' homepage 'http://www.wxwidgets.org' option 'python', 'Build Python bindings' def test_python_arch # wxPython 2.8 does not yet support 64bit. begin system "arch -i386 python --version" rescue onoe "No python on path or default python does not support 32-bit." puts <<~EOS Your default python (if any) does not support 32-bit execution, which is required for the wxmac python bindings. You can install the Homebrew python with 32-bit support by running: brew install python --universal --framework EOS exit 99 end end def install_wx_python opts = %W[ # Reference our wx-config WX_CONFIG=#{bin}/wx-config # At this time Wxmac is installed Unicode only UNICODE=1 # And thus we have no need for multiversion support INSTALL_MULTIVERSION=0 # OpenGL and stuff BUILD_GLCANVAS=1 BUILD_GIZMOS=1 BUILD_STC= ] cd "wxPython" do # for wx 2.8 force 32-bit install with the 10.6 sdk: ENV.append_to_cflags '-arch i386' system "arch", "-i386", "python", "setup.py", "build_ext", *opts system "arch", "-i386", "python", "setup.py", "install", "--prefix=#{prefix}", *opts end end def install test_python_arch if build.include? "python" args = %W[ --disable-debug --prefix=#{prefix} --enable-unicode --enable-std_string --enable-display --with-opengl ] # Force i386 for wx 2.8 ENV.m32 # build will fail on Lion unless we use the 10.6 sdk (note wx 2.9 does fine) ENV.append_to_cflags '-isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6' if MacOS.version == :lion system "./configure", *args system "make install" # erlang needs contrib/stc during configure phase. %w{ gizmos stc ogl }.each do |c| system "make", "-C", "contrib/src/#{c}", "install" end if build.include? "python" ENV['WXWIN'] = Dir.getwd # We need to download wxPython separately (see formula at top) Wxpython28.new.brew { install_wx_python } end end def caveats s = '' s += <<~EOS wxWidgets 2.8.x builds 32-bit only, so you probably won't be able to use it for other Homebrew-installed software. You can try to build with --devel to get the wxWidgets 2.9.x (unstable) for 64-bit and cocoa support. EOS if build.include? 'python' s += <<~EOS You will also need run python in 32-bit mode for wx. If you are on a 64-bit platform, you will need to run Python in 32-bit mode: arch -i386 python [args] Homebrew Python does not support this by default. So, homebrew Python must be built with --universal --framework. Alternative, you can try brew wxmac --python --devel for wx 2.9 in 64-bit. EOS end if build.include? 'python' s += <<~EOS Python bindings require that Python be built as a Framework; this is the default for Mac OS provided Python but not (yet) for Homebrew Python. Build python with `--framework`. EOS end return s end end ================================================ FILE: boneyard/wxmac-29.rb ================================================ require 'formula' class FrameworkPython < Requirement fatal true satisfy do q = `python -c "import distutils.sysconfig as c; print(c.get_config_var('PYTHONFRAMEWORK'))"` not q.chomp.empty? end def message "Python needs to be built as a framework." end end class Wxmac29 < Formula homepage 'http://www.wxwidgets.org' url 'https://downloads.sourceforge.net/project/wxpython/wxPython/2.9.5.0/wxPython-src-2.9.5.0.tar.bz2' sha1 '9183b2ffc6631cb2551c51b655a9d08904aa7b52' keg_only "Conflicts with `wxmac` in main tap" option 'disable-monolithic', "Build a non-monolithic library (split into multiple files)" depends_on :python => :recommended depends_on FrameworkPython if build.with? "python" def install_wx_python args = [ # Reference our wx-config "WX_CONFIG=#{bin}/wx-config", # At this time Wxmac is installed Unicode only "UNICODE=1", # Some scripts (e.g. matplotlib) expect to `import wxversion`, which is # only available on a multiversion build. Besides that `import wx` still works. "INSTALL_MULTIVERSION=1", # OpenGL and stuff "BUILD_GLCANVAS=1", "BUILD_GIZMOS=1", "BUILD_STC=1" ] cd "wxPython" do ENV.append_to_cflags "-arch #{MacOS.preferred_arch}" system "python", "setup.py", "build_ext", "WXPORT=osx_cocoa", *args system "python", "setup.py", "install", "--prefix=#{prefix}", "WXPORT=osx_cocoa", *args end end def install # need to set with-macosx-version-min to avoid configure defaulting to 10.5 # need to enable universal binary build in order to build all x86_64 headers # need to specify x86_64 and i386 or will try to build for ppc arch and fail on newer OSes # https://trac.macports.org/browser/trunk/dports/graphics/wxWidgets30/Portfile#L80 ENV.universal_binary args = [ "--disable-debug", "--prefix=#{prefix}", "--enable-shared", "--enable-unicode", "--enable-std_string", "--enable-display", "--with-opengl", "--with-osx_cocoa", "--with-libjpeg", "--with-libtiff", # Otherwise, even in superenv, the internal libtiff can pick # up on a nonuniversal xz and fail # https://github.com/Homebrew/homebrew/issues/22732 "--without-liblzma", "--with-libpng", "--with-zlib", "--enable-dnd", "--enable-clipboard", "--enable-webkit", "--enable-svg", "--with-expat", "--with-macosx-version-min=#{MacOS.version}", "--with-macosx-sdk=#{MacOS.sdk_path}", "--enable-universal_binary=#{Hardware::CPU.universal_archs.join(',')}", "--disable-precomp-headers" ] args << "--enable-monolithic" unless build.include? 'disable-monolithic' system "./configure", *args system "make install" if build.with? "python" ENV['WXWIN'] = Dir.getwd # We have already downloaded wxPython in a bundle with wxWidgets install_wx_python end end def caveats s = '' fp = FrameworkPython.new unless build.without? 'python' or fp.satisfied? s += fp.message end return s end end ================================================ FILE: boneyard/wxmac-mono.rb ================================================ class WxmacMono < Formula homepage "http://www.wxwidgets.org" url "https://downloads.sourceforge.net/project/wxwindows/3.0.2/wxWidgets-3.0.2.tar.bz2" sha256 "346879dc554f3ab8d6da2704f651ecb504a22e9d31c17ef5449b129ed711585d" bottle do root_url "http://qgis.dakotacarto.com/osgeo4mac/bottles" sha256 "5631995d76eedb6ebc6d6aa00d546415faf03aad8a6aa74b37aff9f9a097a0b7" => :mavericks sha256 "ebb6a36167ab21cc957ee1cbb79fe7844b6eab52730f06fbb2dbc499a5fa0a7d" => :yosemite end keg_only "because wxmac (non-monolithic) is in main tap" depends_on "jpeg" depends_on "libpng" depends_on "libtiff" # Various fixes related to Yosemite. Revisit in next stable release. # Please keep an eye on http://trac.wxwidgets.org/ticket/16329 as well # Theoretically the above linked patch should still be needed, but it isn't. Try to find out why. patch :DATA def install # need to set with-macosx-version-min to avoid configure defaulting to 10.5 # need to enable universal binary build in order to build all x86_64 # Jack - I don't believe this is the whole story, surely this can be fixed # without building universal for users who don't need it. # headers need to specify x86_64 and i386 or will try to build for ppc arch # and fail on newer OSes # DomT4 - MacPorts seems to have stopped building universal by default? Can we do the same? # https://trac.macports.org/browser/trunk/dports/graphics/wxWidgets-3.0/Portfile#L210 ENV.universal_binary args = [ "--disable-debug", "--prefix=#{prefix}", "--enable-shared", "--enable-unicode", "--enable-std_string", "--enable-display", "--with-opengl", "--with-osx_cocoa", "--with-libjpeg", "--with-libtiff", # Otherwise, even in superenv, the internal libtiff can pick # up on a nonuniversal xz and fail # https://github.com/Homebrew/homebrew/issues/22732 "--without-liblzma", "--with-libpng", "--with-zlib", "--enable-dnd", "--enable-clipboard", "--enable-webkit", "--enable-svg", "--enable-mediactrl", "--enable-graphics_ctx", "--enable-controls", "--enable-dataviewctrl", "--with-expat", "--with-macosx-version-min=#{MacOS.version}", "--enable-universal_binary=#{Hardware::CPU.universal_archs.join(',')}", "--disable-precomp-headers", "--enable-monolithic" ] system "./configure", *args system "make", "install" end end __END__ diff --git a/include/wx/defs.h b/include/wx/defs.h index 397ddd7..d128083 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -3169,12 +3169,20 @@ DECLARE_WXCOCOA_OBJC_CLASS(UIImage); DECLARE_WXCOCOA_OBJC_CLASS(UIEvent); DECLARE_WXCOCOA_OBJC_CLASS(NSSet); DECLARE_WXCOCOA_OBJC_CLASS(EAGLContext); +DECLARE_WXCOCOA_OBJC_CLASS(UIWebView); typedef WX_UIWindow WXWindow; typedef WX_UIView WXWidget; typedef WX_EAGLContext WXGLContext; typedef WX_NSString* WXGLPixelFormat; +typedef WX_UIWebView OSXWebViewPtr; + +#endif + +#if wxOSX_USE_COCOA_OR_CARBON +DECLARE_WXCOCOA_OBJC_CLASS(WebView); +typedef WX_WebView OSXWebViewPtr; #endif #endif /* __WXMAC__ */ diff --git a/include/wx/html/webkit.h b/include/wx/html/webkit.h index 8700367..f805099 100644 --- a/include/wx/html/webkit.h +++ b/include/wx/html/webkit.h @@ -18,7 +18,6 @@ #endif #include "wx/control.h" -DECLARE_WXCOCOA_OBJC_CLASS(WebView); // ---------------------------------------------------------------------------- // Web Kit Control @@ -107,7 +106,7 @@ private: wxString m_currentURL; wxString m_pageTitle; - WX_WebView m_webView; + OSXWebViewPtr m_webView; // we may use this later to setup our own mouse events, // so leave it in for now. diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h index 803f8b0..438e532 100644 --- a/include/wx/osx/webview_webkit.h +++ b/include/wx/osx/webview_webkit.h @@ -158,7 +158,7 @@ private: wxWindowID m_windowID; wxString m_pageTitle; - wxObjCID m_webView; + OSXWebViewPtr m_webView; // we may use this later to setup our own mouse events, // so leave it in for now. ================================================ FILE: commit-msg.sh ================================================ #!/usr/bin/env bash if [[ ! -a .ciignore ]]; then exit # If .ciignore doesn't exists, just quit this Git hook fi # Load in every file that will be changed via this commit into an array changes=( `git diff --name-only --cached` ) # Load the patterns we want to skip into an array mapfile -t blacklist < .ciignore for i in "${blacklist[@]}" do # Remove the current pattern from the list of changes changes=( ${changes[@]/$i/} ) if [[ ${#changes[@]} -eq 0 ]]; then # If we've exhausted the list of changes before we've finished going # through patterns, that's okay, just quit the loop break fi done if [[ ${#changes[@]} -gt 0 ]]; then # If there's still changes left, then we have stuff to build, leave the commit alone. exit fi # Prefix the commit message with "[skip ci]" sed -i '1s/^/[skip ci] /' "$1" ================================================ FILE: docs/404.html ================================================ --- layout: default title: Page not found permalink: /404 nav_exclude: true search_exclude: true ---

Page not found

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 site's home page.

================================================ FILE: docs/Gemfile ================================================ source "https://rubygems.org" gemspec gem "jemoji" gem "jekyll-include-cache" ================================================ FILE: docs/Rakefile ================================================ Dir.glob('lib/tasks/*.rake').each {|r| import r} ================================================ FILE: docs/_config.yml ================================================ # Welcome to Jekyll! # # This config file is meant for settings that affect your whole site, values # which you are expected to set up once and rarely edit after that. If you find # yourself editing these this file very often, consider using Jekyll's data files # feature for the data you need to update frequently. # # For technical reasons, this file is *NOT* reloaded automatically when you use # 'jekyll serve'. If you change this file, please restart the server process. # Site settings # These are used to personalize your new site. If you look in the HTML files, # you will see them accessed via {{ site.title }}, {{ site.github_repo }}, and so on. # You can create any custom variable you would like, and they will be accessible # in the templates via {{ site.myvariable }}. title: Homebrew OSGeo4mac Docs description: This is the doc's page for the Homebrew's OSGeo4mac tap baseurl: "/homebrew-osgeo4mac/" # the subpath of your site, e.g. /blog url: "https://osgeo.github.io" # the base hostname & protocol for your site, e.g. http://example.com permalink: pretty exclude: - node_modules/ - "*.gemspec" - "*.gem" - Gemfile - Gemfile.lock - package.json - package-lock.json - script/ - LICENSE.txt - lib/ - bin/ - README.md - Rakefile plugins: - jemoji - jekyll-include-cache # Enable or disable the site search search_enabled: true # Aux links for the upper right navigation aux_links: "Homebrew's OSGeo4mac on GitHub": - "//github.com/OSGeo/homebrew-osgeo4mac/" footer_text: "If you have any question or problem please open an [issue](https://github.com/OSGeo/homebrew-osgeo4mac/issues/new/choose) to contact the maintainers." # Color scheme currently only supports "dark" or nil (default) color_scheme: nil # Google Analytics Tracking (optional) # e.g, UA-1234567-89 # ga_tracking: UA-2709176-10 ================================================ FILE: docs/_includes/head.html ================================================ {% if page.description %} {% endif %} {{ page.title }} - {{ site.title }} {% if site.ga_tracking != nil %} {% endif %} {% if site.search_enabled != nil %} {% endif %} ================================================ FILE: docs/_includes/nav.html ================================================ ================================================ FILE: docs/_includes/new-window-fix.html ================================================ ================================================ FILE: docs/_includes/open-embed.html ================================================ ================================================ FILE: docs/_includes/scripts.html ================================================ ================================================ FILE: docs/_layouts/about.html ================================================ --- layout: default --- {{ content }} ================================================ FILE: docs/_layouts/default.html ================================================ {% include head.html %}
{% unless page.url == "/" %} {% if page.parent %} {% endif %} {% endunless %}
{{ content }} {% if page.has_children == true and page.has_toc != false %}

Table of contents

{% assign children_list = site.pages | sort:"nav_order" %}
    {% for child in children_list %} {% if child.parent == page.title and child.title != page.title %}
  • {{ child.title }}
  • {% endif %} {% endfor %}
{% endif %}
{% include scripts.html %} {% include_cached new-window-fix.html %} {% include_cached open-embed.html %} ================================================ FILE: docs/_layouts/home.html ================================================ --- layout: default --- {{ content }} ================================================ FILE: docs/_layouts/page.html ================================================ --- layout: default --- {{ content }} ================================================ FILE: docs/_layouts/post.html ================================================ --- layout: default --- {{ content }} ================================================ FILE: docs/_sass/base.scss ================================================ // // Base element style overrides // // stylelint-disable selector-no-type, selector-max-type * { box-sizing: border-box; } ::selection { color: $white; background: $link-color; } html { @include fs-4; } body { font-family: $body-font-family; font-size: inherit; line-height: $body-line-height; color: $body-text-color; background-color: $body-background-color; } p, h1, h2, h3, h4, h5, h6, ol, ul, pre, address, blockquote, dl, div, fieldset, form, hr, noscript, table { margin-top: 0; } h1, h2, h3, h4, h5, h6 { margin-top: 1.2em; margin-bottom: 0.8em; font-weight: 500; line-height: $body-heading-line-height; color: $body-heading-color; } p { margin-bottom: 1em; } a { color: $link-color; text-decoration: none; } a:not([class]) { text-decoration: none; background-image: linear-gradient($border-color 0%, $border-color 100%); background-repeat: repeat-x; background-position: 0 100%; background-size: 1px 1px; &:hover { background-image: linear-gradient(rgba($link-color, 0.45) 0%, rgba($link-color, 0.45) 100%); background-size: 1px 1px; } } code { font-family: $mono-font-family; font-size: 12px; line-height: $body-line-height; } figure { margin: 0; } li { margin: 0.25em 0; } img { max-width: 100%; height: auto; } hr { height: 1px; padding: 0; margin: $sp-6 0; background-color: $border-color; border: 0; } ================================================ FILE: docs/_sass/buttons.scss ================================================ // // Buttons and things that look like buttons // // stylelint-disable color-named .btn { display: inline-block; box-sizing: border-box; padding-top: 0.3em; padding-right: 1em; padding-bottom: 0.3em; padding-left: 1em; margin: 0; font-family: inherit; font-size: inherit; font-weight: 500; line-height: 1.5; color: $link-color; text-decoration: none; vertical-align: baseline; cursor: pointer; background-color: $base-button-color; border-width: 0; border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 3px 10px rgba(0, 0, 0, 0.08); appearance: none; &:focus { text-decoration: none; outline: none; box-shadow: 0 0 0 3px rgba(blue, 0.25); } &:focus:hover, &.selected:focus { box-shadow: 0 0 0 3px rgba(blue, 0.25); } &:hover, &.zeroclipboard-is-hover { color: darken($link-color, 2%); } &:hover, &:active, &.zeroclipboard-is-hover, &.zeroclipboard-is-active { text-decoration: none; background-color: darken($base-button-color, 1%); } &:active, &.selected, &.zeroclipboard-is-active { background-color: darken($base-button-color, 3%); background-image: none; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15); } &.selected:hover { background-color: darken(#dcdcdc, 5%); } &:disabled, &.disabled { &, &:hover { color: rgba(102, 102, 102, 0.5); cursor: default; background-color: rgba(229, 229, 229, 0.5); background-image: none; box-shadow: none; } } } .btn-outline { color: $link-color; background: transparent; box-shadow: inset 0 0 0 2px $grey-lt-300; &:hover, &:active, &.zeroclipboard-is-hover, &.zeroclipboard-is-active { color: darken($link-color, 4%); text-decoration: none; background-color: transparent; box-shadow: inset 0 0 0 3px $grey-lt-300; } &:focus { text-decoration: none; outline: none; box-shadow: inset 0 0 0 2px $grey-dk-100, 0 0 0 3px rgba(blue, 0.25); } &:focus:hover, &.selected:focus { box-shadow: inset 0 0 0 2px $grey-dk-100; } } .btn-primary { @include btn-color($white, $btn-primary-color); } .btn-purple { @include btn-color($white, $purple-100); } .btn-blue { @include btn-color($white, $blue-000); } .btn-green { @include btn-color($white, $green-100); } ================================================ FILE: docs/_sass/code.scss ================================================ // // Code and syntax highlighting // // stylelint-disable selector-no-qualifying-type, declaration-block-semicolon-newline-after,declaration-block-single-line-max-declarations, selector-no-type, selector-max-type code { padding: 0.2em 0.15em; font-weight: 400; background-color: $code-background-color; border: $border $border-color; border-radius: $border-radius; } pre.highlight { padding: $sp-3; margin-bottom: 0; -webkit-overflow-scrolling: touch; background-color: $code-background-color; code { padding: 0; border: 0; } } .highlighter-rouge { margin-bottom: $sp-3; overflow: hidden; border-radius: $border-radius; } .highlight .c { color: #586e75; } // comment // .highlight .err { color: #93a1a1; } // error // .highlight .g { color: #93a1a1; } // generic // .highlight .k { color: #859900; } // keyword // .highlight .l { color: #93a1a1; } // literal // .highlight .n { color: #93a1a1; } // name // .highlight .o { color: #859900; } // operator // .highlight .x { color: #cb4b16; } // other // .highlight .p { color: #93a1a1; } // punctuation // .highlight .cm { color: #586e75; } // comment.multiline // .highlight .cp { color: #859900; } // comment.preproc // .highlight .c1 { color: #586e75; } // comment.single // .highlight .cs { color: #859900; } // comment.special // .highlight .gd { color: #2aa198; } // generic.deleted // .highlight .ge { font-style: italic; color: #93a1a1; } // generic.emph // .highlight .gr { color: #dc322f; } // generic.error // .highlight .gh { color: #cb4b16; } // generic.heading // .highlight .gi { color: #859900; } // generic.inserted // .highlight .go { color: #93a1a1; } // generic.output // .highlight .gp { color: #93a1a1; } // generic.prompt // .highlight .gs { font-weight: bold; color: #93a1a1; } // generic.strong // .highlight .gu { color: #cb4b16; } // generic.subheading // .highlight .gt { color: #93a1a1; } // generic.traceback // .highlight .kc { color: #cb4b16; } // keyword.constant // .highlight .kd { color: #268bd2; } // keyword.declaration // .highlight .kn { color: #859900; } // keyword.namespace // .highlight .kp { color: #859900; } // keyword.pseudo // .highlight .kr { color: #268bd2; } // keyword.reserved // .highlight .kt { color: #dc322f; } // keyword.type // .highlight .ld { color: #93a1a1; } // literal.date // .highlight .m { color: #2aa198; } // literal.number // .highlight .s { color: #2aa198; } // literal.string // .highlight .na { color: #93a1a1; } // name.attribute // .highlight .nb { color: #b58900; } // name.builtin // .highlight .nc { color: #268bd2; } // name.class // .highlight .no { color: #cb4b16; } // name.constant // .highlight .nd { color: #268bd2; } // name.decorator // .highlight .ni { color: #cb4b16; } // name.entity // .highlight .ne { color: #cb4b16; } // name.exception // .highlight .nf { color: #268bd2; } // name.function // .highlight .nl { color: #93a1a1; } // name.label // .highlight .nn { color: #93a1a1; } // name.namespace // .highlight .nx { color: #555; } // name.other // .highlight .py { color: #93a1a1; } // name.property // .highlight .nt { color: #268bd2; } // name.tag // .highlight .nv { color: #268bd2; } // name.variable // .highlight .ow { color: #859900; } // operator.word // .highlight .w { color: #93a1a1; } // text.whitespace // .highlight .mf { color: #2aa198; } // literal.number.float // .highlight .mh { color: #2aa198; } // literal.number.hex // .highlight .mi { color: #2aa198; } // literal.number.integer // .highlight .mo { color: #2aa198; } // literal.number.oct // .highlight .sb { color: #586e75; } // literal.string.backtick // .highlight .sc { color: #2aa198; } // literal.string.char // .highlight .sd { color: #93a1a1; } // literal.string.doc // .highlight .s2 { color: #2aa198; } // literal.string.double // .highlight .se { color: #cb4b16; } // literal.string.escape // .highlight .sh { color: #93a1a1; } // literal.string.heredoc // .highlight .si { color: #2aa198; } // literal.string.interpol // .highlight .sx { color: #2aa198; } // literal.string.other // .highlight .sr { color: #dc322f; } // literal.string.regex // .highlight .s1 { color: #2aa198; } // literal.string.single // .highlight .ss { color: #2aa198; } // literal.string.symbol // .highlight .bp { color: #268bd2; } // name.builtin.pseudo // .highlight .vc { color: #268bd2; } // name.variable.class // .highlight .vg { color: #268bd2; } // name.variable.global // .highlight .vi { color: #268bd2; } // name.variable.instance // .highlight .il { color: #2aa198; } // literal.number.integer.long // // // Code examples (rendered) // .code-example { padding: $sp-3; margin-bottom: $sp-3; overflow: auto; border: 1px solid $border-color; border-radius: $border-radius; + .highlighter-rouge, + figure.highlight { position: relative; margin-top: -$sp-4; border-right: 1px solid $border-color; border-bottom: 1px solid $border-color; border-left: 1px solid $border-color; border-top-left-radius: 0; border-top-right-radius: 0; } } ================================================ FILE: docs/_sass/color_schemes/dark.scss ================================================ $body-background-color: $grey-dk-300; $sidebar-color: $grey-dk-300; $border-color: $grey-dk-200; $body-text-color: $grey-lt-300; $body-heading-color: $grey-lt-000; $nav-child-link-color: $grey-dk-000; $link-color: $blue-000; $btn-primary-color: $blue-200; $base-button-color: $grey-dk-250; $code-background-color: $grey-dk-250; ================================================ FILE: docs/_sass/content.scss ================================================ @charset "UTF-8"; // // Styles for rendered markdown in the .main-content container // // stylelint-disable selector-no-type, max-nesting-depth, selector-max-compound-selectors, selector-max-type .page-content { a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } ul, ol { padding-left: 1.5em; } ol { list-style-type: none; counter-reset: step-counter; > li { position: relative; &::before { position: absolute; top: 0.2em; left: -1.6em; color: $grey-dk-000; content: counter(step-counter); counter-increment: step-counter; @include fs-3; @include mq(sm) { top: 0.11em; } } ol { counter-reset: sub-counter; li { &::before { content: counter(sub-counter, lower-alpha); counter-increment: sub-counter; } } } } } ul { list-style: none; > li { &::before { position: absolute; margin-left: -1.4em; color: $grey-dk-000; content: "•"; } } } .task-list { padding-left: 0; } .task-list-item { display: flex; align-items: center; &::before { content: ""; } } .task-list-item-checkbox { margin-right: 0.6em; } hr + * { margin-top: 0; } h1:first-of-type { margin-top: 0.5em; } dl { display: grid; grid-template-columns: max-content 1fr; } dt, dd { margin: 0.25em 0; } dt { text-align: right; &::after { content: ":"; } } dd { margin-left: 1em; font-weight: 500; } } ================================================ FILE: docs/_sass/custom/custom.scss ================================================ // // // // Typography // // // // $body-font-family: -apple-system, BlinkMacSystemFont, "helvetica neue", helvetica, roboto, noto, "segoe ui", arial, sans-serif; // $mono-font-family: "SFMono-Regular", Menlo, Consolas, Monospace; // $root-font-size: 16px; // Base font-size for rems // $body-line-height: 1.4; // $body-heading-line-height: 1.15; // // // // // Colors // // // // $white: #fff; // // $grey-dk-000: #959396; // $grey-dk-100: #5c5962; // $grey-dk-200: #44434d; // $grey-dk-250: #302d36 !default; // $grey-dk-300: #27262b; // // $grey-lt-000: #f5f6fa; // $grey-lt-100: #eeebee; // $grey-lt-200: #ecebed; // $grey-lt-300: #e6e1e8; // // $purple-000: #7253ed; // $purple-100: #5e41d0; // $purple-200: #4e26af; // $purple-300: #381885; // // $blue-000: #2c84fa; // $blue-100: #2869e6; // $blue-200: #264caf; // $blue-300: #183385; // // $green-000: #41d693; // $green-100: #11b584; // $green-200: #009c7b; // $green-300: #026e57; // // $body-background-color: $white !default; // $sidebar-color: $grey-lt-000 !default; // $code-background-color: $grey-lt-000 !default; // $body-text-color: $grey-dk-100 !default; // $body-heading-color: $grey-dk-300 !default; // $nav-child-link-color: $grey-dk-100 !default; // $link-color: $purple-000 !default; // $btn-primary-color: $purple-100 !default; // $base-button-color: #f7f7f7 !default; // // // // // Media queries in pixels // // // // $media-queries: ( // xs: 320px, // sm: 500px, // md: 740px, // lg: 1120px, // xl: 1400px // ); // // // // // Spacing // // // // $spacing-unit: 1rem; // 1rem == 16px // // $spacers: ( // sp-0: 0, // sp-1: $spacing-unit * 0.25, // sp-2: $spacing-unit * 0.5, // sp-3: $spacing-unit * 0.75, // sp-4: $spacing-unit, // sp-5: $spacing-unit * 1.5, // sp-6: $spacing-unit * 2, // sp-7: $spacing-unit * 2.5, // sp-8: $spacing-unit * 3, // sp-9: $spacing-unit * 3.5, // sp-10: $spacing-unit * 4 // ); // // $sp-1: map-get($spacers, sp-1); // 0.25 rem == 4px // $sp-2: map-get($spacers, sp-2); // 0.5 rem == 8px // $sp-3: map-get($spacers, sp-3); // 0.75 rem == 12px // $sp-4: map-get($spacers, sp-4); // 1 rem == 16px // $sp-5: map-get($spacers, sp-5); // 1.5 rem == 24px // $sp-6: map-get($spacers, sp-6); // 2 rem == 32px // $sp-7: map-get($spacers, sp-7); // 2.5 rem == 40px // $sp-8: map-get($spacers, sp-8); // 3 rem == 48px // $sp-9: map-get($spacers, sp-9); // 4 rem == 48px // $sp-10: map-get($spacers, sp-10); // 4.5 rem == 48px // // // // // Borders // // // // $border: 1px solid; // $border-radius: 4px; // $border-color: $grey-lt-100; // // // // // Grid system // // // // $gutter-spacing: $sp-6; // $gutter-spacing-sm: $sp-4; // $nav-width: 232px; // $content-width: 800px; // // $media-queries: ( // xs: 320px, // sm: 500px, // md: 740px, // lg: 800px, // xl: 1316px // ); ================================================ FILE: docs/_sass/labels.scss ================================================ // // Labels (not the form kind) // .label, .label-blue { display: inline-block; padding-top: 0.16em; padding-right: 0.42em; padding-bottom: 0.16em; padding-left: 0.42em; margin-right: $sp-1; margin-left: $sp-1; color: $white; text-transform: uppercase; vertical-align: middle; background-color: $blue-100; @include fs-2; } .label-green { background-color: $green-200; } .label-purple { background-color: $purple-100; } .label-red { background-color: $red-200; } .label-yellow { color: $grey-dk-200; background-color: $yellow-200; } ================================================ FILE: docs/_sass/layout.scss ================================================ // // The basic two column layout // .page-wrap { @include mq(md) { position: absolute; top: 0; left: 0; display: flex; width: 100%; height: 100%; overflow-x: hidden; overflow-y: hidden; } } .side-bar { z-index: 100; display: flex; flex-wrap: wrap; padding-top: $gutter-spacing-sm; padding-bottom: $gutter-spacing-sm; background-color: $sidebar-color; @include mq(md) { flex-wrap: nowrap; position: absolute; width: $nav-width + 16px; height: 100%; padding-top: $gutter-spacing * 2; padding-bottom: 0; flex-direction: column; border-right: $border $border-color; align-items: flex-end; } @include mq(lg) { width: calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width}); min-width: $nav-width; } } .main-content-wrap { @include mq(md) { position: absolute; top: 0; left: 0; width: 100%; height: 100%; min-height: 600px; -webkit-overflow-scrolling: touch; overflow-x: hidden; overflow-y: scroll; } } .main-content { padding-top: $gutter-spacing-sm; @include container; @include mq(md) { position: relative; max-width: $content-width; padding-top: $gutter-spacing; padding-bottom: $gutter-spacing; padding-left: $gutter-spacing * 1.5; margin-left: $nav-width; } @include mq(lg) { padding-left: $gutter-spacing; margin-left: calc((100% - #{$nav-width + $content-width}) / 2 + #{$nav-width}); } } .js-main-content:focus { outline: none; } .page-header { background-color: $sidebar-color; @include mq(md) { background-color: $body-background-color; } .main-content { padding-top: 0; @include mq(md) { display: flex; justify-content: flex-end; height: 60px; padding-top: $sp-4; padding-bottom: $sp-4; border-bottom: $border $border-color; } } } .navigation, .site-title, .site-footer { @include container; width: 100%; @include mq(lg) { width: $nav-width + 32px; } } .navigation { @include mq(md) { padding-top: $sp-8; overflow-y: auto; flex: 1 1 auto; } } // stylelint-disable selector-no-type body { position: relative; padding-bottom: $sp-10; @include mq(md) { position: static; padding-bottom: 0; } } // stylelint-enable selector-no-type .site-footer { position: absolute; bottom: 0; padding-top: $sp-4; padding-bottom: $sp-4; @include mq(md) { position: static; align-self: flex-end; justify-self: end; background-color: $sidebar-color; } } ================================================ FILE: docs/_sass/navigation.scss ================================================ // // Main nav, breadcrumb, etc... // .site-title { display: block; flex: 1 1 auto; color: $body-heading-color; background-color: $sidebar-color; @include mq(md) { position: absolute; top: 0; right: 0; z-index: 101; height: 60px; padding-top: $sp-4; // border-bottom: $border $border-color; } } .navigation-list { padding: 0; margin-top: $sp-4; margin-bottom: 0; list-style: none; @include mq(md) { margin-top: 0; } } .navigation-list-child-list { padding-left: $sp-3; list-style: none; .navigation-list-link { color: $nav-child-link-color; } .navigation-list-item { position: relative; &::before { position: absolute; margin-top: 0.3em; margin-left: -0.8em; color: rgba($body-text-color, 0.3); content: "- "; } &.active { &::before { color: $body-text-color; } } } } .navigation-list-item { @include fs-4; margin: 0; @include mq(md) { @include fs-3; } .navigation-list-child-list { display: none; } &.active { .navigation-list-child-list { display: block; } } } .navigation-list-link { display: block; padding-top: $sp-1; padding-bottom: $sp-1; &.active { font-weight: 600; color: $body-heading-color; text-decoration: none; } } // Small screen nav .main-nav, .aux-nav { display: none; &.nav-open { display: block; } @include mq(md) { display: block; } } .navigation-list-toggle { position: absolute; right: $sp-4; @include mq(md) { display: none !important; } } // Breadcrumb nav .breadcrumb-nav { @include mq(md) { margin-top: -$sp-4; } } .breadcrumb-nav-list { padding-left: 0; margin-bottom: $sp-3; list-style: none; } .breadcrumb-nav-list-item { display: table-cell; @include fs-2; &::before { display: none; } &::after { display: inline-block; margin-right: $sp-2; margin-left: $sp-2; color: $grey-dk-000; content: "/"; } &:last-child { &::after { content: ""; } } } ================================================ FILE: docs/_sass/search.scss ================================================ // // Search input and autocomplete // .search { position: relative; z-index: 99; display: none; flex-grow: 1; padding: $sp-2; margin-bottom: $sp-3; background-color: $white; border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07), 0 3px 10px rgba(0, 0, 0, 0.05); @include mq(md) { display: block; padding-top: $sp-1; padding-right: 0; padding-bottom: 0; padding-left: 0; margin-bottom: 0; background-color: transparent; box-shadow: none; } &.nav-open { display: block; } } .search-results-wrap { display: none; &.active { position: absolute; top: $sp-1; z-index: 100; display: block; width: 300px; margin-top: $gutter-spacing; background: lighten($body-background-color, 1%); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 14px rgba(0, 0, 0, 0.05); } } .search-input-wrap { display: flex; background-color: $body-background-color; } .search-input { width: 100%; padding-top: $sp-1; padding-bottom: $sp-1; background-color: $body-background-color; border-top: 0; border-right: 0; border-bottom: 0; border-left: 0; order: 2; &:focus { outline: 0; box-shadow: none; + .search-icon { fill: $link-color; } } @include fs-5; @include mq(sm) { @include fs-3; } @include mq(md) { @include fs-2; } } .search-icon { align-self: center; margin-right: $sp-2; fill: $grey-dk-000; order: 1; } .search-results-list { padding-left: 0; margin-top: $sp-1; margin-bottom: $sp-1; list-style: none; @include fs-3; } .search-results-list-item { padding: 0; margin: 0; } .search-results-link { display: block; padding-top: $sp-1; padding-right: $sp-3; padding-bottom: $sp-1; padding-left: $sp-3; &:hover { color: $body-heading-color; background-color: darken($body-background-color, 2%); } } ================================================ FILE: docs/_sass/support/_functions.scss ================================================ @function rem($size, $unit:"") { $remSize: $size / $root-font-size; @if ($unit == false) { @return #{$remSize}; } @else { @return #{$remSize}rem; } } ================================================ FILE: docs/_sass/support/_variables.scss ================================================ // // Typography // $body-font-family: -apple-system, BlinkMacSystemFont, "helvetica neue", helvetica, roboto, noto, "segoe ui", arial, sans-serif !default; $mono-font-family: "SFMono-Regular", Menlo, Consolas, Monospace !default; $root-font-size: 16px !default; // Base font-size for rems $body-line-height: 1.4 !default; $body-heading-line-height: 1.15 !default !default; // // Colors // $white: #fff !default; $grey-dk-000: #959396 !default; $grey-dk-100: #5c5962 !default; $grey-dk-200: #44434d !default; $grey-dk-250: #302d36 !default; $grey-dk-300: #27262b !default; $grey-lt-000: #f5f6fa !default; $grey-lt-100: #eeebee !default; $grey-lt-200: #ecebed !default; $grey-lt-300: #e6e1e8 !default; $purple-000: #7253ed !default; $purple-100: #5e41d0 !default; $purple-200: #4e26af !default; $purple-300: #381885 !default; $blue-000: #2c84fa !default; $blue-100: #2869e6 !default; $blue-200: #264caf !default; $blue-300: #183385 !default; $green-000: #41d693 !default; $green-100: #11b584 !default; $green-200: #009c7b !default; $green-300: #026e57 !default; $yellow-000: #ffeb82 !default; $yellow-100: #fadf50 !default; $yellow-200: #f7d12e !default; $yellow-300: #e7af06 !default; $red-000: #f77e7e !default; $red-100: #f96e65 !default; $red-200: #e94c4c !default; $red-300: #dd2e2e !default; $osgeo: #66AA64 !default; $body-background-color: $white !default; $sidebar-color: $grey-lt-000 !default; $code-background-color: $grey-lt-000 !default; $body-text-color: $grey-dk-100 !default; $body-heading-color: $grey-dk-300 !default; $nav-child-link-color: $grey-dk-100 !default; $link-color: $osgeo !default; $btn-primary-color: $purple-100 !default; $base-button-color: #f7f7f7 !default; // // Media queries in pixels // $media-queries: ( xs: 320px, sm: 500px, md: 740px, lg: 1120px, xl: 1400px ) !default; // // Spacing // $spacing-unit: 1rem; // 1rem == 16px $spacers: ( sp-0: 0, sp-1: $spacing-unit * 0.25, sp-2: $spacing-unit * 0.5, sp-3: $spacing-unit * 0.75, sp-4: $spacing-unit, sp-5: $spacing-unit * 1.5, sp-6: $spacing-unit * 2, sp-7: $spacing-unit * 2.5, sp-8: $spacing-unit * 3, sp-9: $spacing-unit * 3.5, sp-10: $spacing-unit * 4 ) !default; $sp-1: map-get($spacers, sp-1) !default; // 0.25 rem == 4px $sp-2: map-get($spacers, sp-2) !default; // 0.5 rem == 8px $sp-3: map-get($spacers, sp-3) !default; // 0.75 rem == 12px $sp-4: map-get($spacers, sp-4) !default; // 1 rem == 16px $sp-5: map-get($spacers, sp-5) !default; // 1.5 rem == 24px $sp-6: map-get($spacers, sp-6) !default; // 2 rem == 32px $sp-7: map-get($spacers, sp-7) !default; // 2.5 rem == 40px $sp-8: map-get($spacers, sp-8) !default; // 3 rem == 48px $sp-9: map-get($spacers, sp-9) !default; // 4 rem == 48px $sp-10: map-get($spacers, sp-10) !default; // 4.5 rem == 48px // // Borders // $border: 1px solid !default; $border-radius: 4px !default; $border-color: $grey-lt-100 !default; // // Grid system // $gutter-spacing: $sp-6 !default; $gutter-spacing-sm: $sp-4 !default; $nav-width: 232px !default; $content-width: 800px !default; $media-queries: ( xs: 320px, sm: 500px, md: 740px, lg: 800px, xl: 1316px ) !default; ================================================ FILE: docs/_sass/support/mixins/_buttons.scss ================================================ // Colored button @mixin btn-color($fg, $bg) { color: $fg; background-color: darken($bg, 2%); background-image: linear-gradient(lighten($bg, 5%), darken($bg, 2%)); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 4px 10px rgba(0, 0, 0, 0.12); &:hover, &.zeroclipboard-is-hover { color: $fg; background-color: darken($bg, 4%); background-image: linear-gradient((lighten($bg, 2%), darken($bg, 4%))); } &:active, &.selected, &.zeroclipboard-is-active { background-color: darken($bg, 5%); background-image: none; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15); } &.selected:hover { background-color: darken($bg, 10%); } } ================================================ FILE: docs/_sass/support/mixins/_layout.scss ================================================ // Media query // Media query mixin // Usage: // @include mq(md) { // ..medium and up styles // } @mixin mq($name) { // Retrieves the value from the key $value: map-get($media-queries, $name); // If the key exists in the map @if $value != null { // Prints a media query based on the value @media (min-width: rem($value)) { @content; } } @else { @warn "No value could be retrieved from `#{$media-query}`. " + "Please make sure it is defined in `$media-queries` map."; } } // Responsive container @mixin container { padding-right: $gutter-spacing-sm; padding-left: $gutter-spacing-sm; @include mq(md) { padding-right: $gutter-spacing; padding-left: $gutter-spacing; } } ================================================ FILE: docs/_sass/support/mixins/_typography.scss ================================================ // Font size @mixin fs-1 { font-size: 9px !important; @include mq(sm) { font-size: 10px !important; } } @mixin fs-2 { font-size: 11px !important; @include mq(sm) { font-size: 12px !important; } } @mixin fs-3 { font-size: 12px !important; @include mq(sm) { font-size: 14px !important; } } @mixin fs-4 { font-size: 14px !important; @include mq(sm) { font-size: 16px !important; } } @mixin fs-5 { font-size: 16px !important; @include mq(sm) { font-size: 18px !important; } } @mixin fs-6 { font-size: 18px !important; @include mq(sm) { font-size: 24px !important; } } @mixin fs-7 { font-size: 24px !important; @include mq(sm) { font-size: 32px !important; } } @mixin fs-8 { font-size: 32px !important; @include mq(sm) { font-size: 36px !important; } } @mixin fs-9 { font-size: 36px !important; @include mq(sm) { font-size: 42px !important; } } @mixin fs-10 { font-size: 42px !important; @include mq(sm) { font-size: 48px !important; } } ================================================ FILE: docs/_sass/support/mixins/mixins.scss ================================================ @import "./layout"; @import "./buttons"; @import "./typography"; ================================================ FILE: docs/_sass/support/support.scss ================================================ @import "./variables"; @import "./functions"; @import "./mixins/mixins"; ================================================ FILE: docs/_sass/tables.scss ================================================ // // Tables // // stylelint-disable max-nesting-depth, selector-no-type, selector-max-type table { display: block; width: 100%; max-width: 100%; margin-bottom: $sp-5; overflow-x: auto; border-collapse: separate; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 14px rgba(0, 0, 0, 0.05); @include mq(sm) { display: table; } } th, td { @include fs-3; min-width: 120px; padding-top: $sp-2; padding-right: $sp-3; padding-bottom: $sp-2; padding-left: $sp-3; background-color: lighten($body-background-color, 2%); border-bottom: $border rgba($border-color, 0.5); border-left: $border $border-color; &:first-of-type { border-left: 0; } } thead, tbody:first-child { tr { &:first-of-type { th, td { &:first-of-type { border-top-left-radius: $border-radius; } &:last-of-type { border-top-right-radius: $border-radius; } } } } } tbody { tr { &:last-of-type { th, td { border-bottom: 0; &:first-of-type { border-bottom-left-radius: $border-radius; } &:last-of-type { border-bottom-right-radius: $border-radius; } } } } } thead { th { border-bottom: 1px solid $border-color; } } ================================================ FILE: docs/_sass/typography.scss ================================================ // // Typography // // stylelint-disable primer/selector-no-utility, selector-no-type, selector-max-type h1, .text-alpha { @include fs-8; font-weight: 300; } h2, .text-beta { @include fs-6; } h3, .text-gamma { @include fs-5; } h4, .text-delta { @include fs-2; font-weight: 300; text-transform: uppercase; letter-spacing: 0.1em; } h5, .text-epsilon { @include fs-3; color: $grey-dk-200; } h6, .text-zeta { @include fs-2; color: $grey-dk-200; } li { .highlight { margin-top: $sp-2; } } .text-small { @include fs-2; } .text-mono { font-family: $mono-font-family !important; } .text-center { text-align: center !important; } ================================================ FILE: docs/_sass/utilities/_colors.scss ================================================ // // Utility classes for colors // // Text colors .text-grey-dk-000 { color: $grey-dk-000 !important; } .text-grey-dk-100 { color: $grey-dk-100 !important; } .text-grey-dk-200 { color: $grey-dk-200 !important; } .text-grey-dk-250 { color: $grey-dk-250 !important; } .text-grey-dk-300 { color: $grey-dk-300 !important; } .text-grey-lt-000 { color: $grey-lt-000 !important; } .text-grey-lt-100 { color: $grey-lt-100 !important; } .text-grey-lt-200 { color: $grey-lt-200 !important; } .text-grey-lt-300 { color: $grey-lt-300 !important; } .text-blue-000 { color: $blue-000 !important; } .text-blue-100 { color: $blue-100 !important; } .text-blue-200 { color: $blue-200 !important; } .text-blue-300 { color: $blue-300 !important; } .text-green-000 { color: $green-000 !important; } .text-green-100 { color: $green-100 !important; } .text-green-200 { color: $green-200 !important; } .text-green-300 { color: $green-300 !important; } .text-purple-000 { color: $purple-000 !important; } .text-purple-100 { color: $purple-100 !important; } .text-purple-200 { color: $purple-200 !important; } .text-purple-300 { color: $purple-300 !important; } .text-yellow-000 { color: $yellow-000 !important; } .text-yellow-100 { color: $yellow-100 !important; } .text-yellow-200 { color: $yellow-200 !important; } .text-yellow-300 { color: $yellow-300 !important; } .text-red-000 { color: $red-000 !important; } .text-red-100 { color: $red-100 !important; } .text-red-200 { color: $red-200 !important; } .text-red-300 { color: $red-300 !important; } // Background colors .bg-grey-dk-000 { background-color: $grey-dk-000 !important; } .bg-grey-dk-100 { background-color: $grey-dk-100 !important; } .bg-grey-dk-200 { background-color: $grey-dk-200 !important; } .bg-grey-dk-250 { background-color: $grey-dk-250 !important; } .bg-grey-dk-300 { background-color: $grey-dk-300 !important; } .bg-grey-lt-000 { background-color: $grey-lt-000 !important; } .bg-grey-lt-100 { background-color: $grey-lt-100 !important; } .bg-grey-lt-200 { background-color: $grey-lt-200 !important; } .bg-grey-lt-300 { background-color: $grey-lt-300 !important; } .bg-blue-000 { background-color: $blue-000 !important; } .bg-blue-100 { background-color: $blue-100 !important; } .bg-blue-200 { background-color: $blue-200 !important; } .bg-blue-300 { background-color: $blue-300 !important; } .bg-green-000 { background-color: $green-000 !important; } .bg-green-100 { background-color: $green-100 !important; } .bg-green-200 { background-color: $green-200 !important; } .bg-green-300 { background-color: $green-300 !important; } .bg-purple-000 { background-color: $purple-000 !important; } .bg-purple-100 { background-color: $purple-100 !important; } .bg-purple-200 { background-color: $purple-200 !important; } .bg-purple-300 { background-color: $purple-300 !important; } .bg-yellow-000 { background-color: $yellow-000 !important; } .bg-yellow-100 { background-color: $yellow-100 !important; } .bg-yellow-200 { background-color: $yellow-200 !important; } .bg-yellow-300 { background-color: $yellow-300 !important; } .bg-red-000 { background-color: $red-000 !important; } .bg-red-100 { background-color: $red-100 !important; } .bg-red-200 { background-color: $red-200 !important; } .bg-red-300 { background-color: $red-300 !important; } ================================================ FILE: docs/_sass/utilities/_layout.scss ================================================ // stylelint-disable primer/selector-no-utility // // Utility classes for layout // // Display .d-block { display: block !important; } .d-flex { display: flex !important; } .d-inline { display: inline !important; } .d-inline-block { display: inline-block !important; } .d-none { display: none !important; } @each $media-query in map-keys($media-queries) { @for $i from 1 through length($spacers) { @include mq($media-query) { $size: #{map-get($spacers, sp-#{$i - 1})}; $scale: #{$i - 1}; // .d-sm-block, .d-md-none, .d-lg-inline .d-#{$media-query}-block { display: block !important; } .d-#{$media-query}-flex { display: flex !important; } .d-#{$media-query}-inline { display: inline !important; } .d-#{$media-query}-inline-block { display: inline-block !important; } .d-#{$media-query}-none { display: none !important; } } } } // Vertical alignment .v-align-baseline { vertical-align: baseline !important; } .v-align-bottom { vertical-align: bottom !important; } .v-align-middle { vertical-align: middle !important; } .v-align-text-bottom { vertical-align: text-bottom !important; } .v-align-text-top { vertical-align: text-top !important; } .v-align-top { vertical-align: top !important; } ================================================ FILE: docs/_sass/utilities/_lists.scss ================================================ // // Utility classes for lists // // stylelint-disable primer/selector-no-utility .list-style-none { padding: 0 !important; margin: 0 !important; list-style: none !important; } ================================================ FILE: docs/_sass/utilities/_spacing.scss ================================================ // // Utility classes for margins and padding // // scss-lint:disable SpaceAfterPropertyName // stylelint-disable block-opening-brace-space-after, block-opening-brace-space-before, primer/selector-no-utility // Margin spacer utilities @for $i from 1 through length($spacers) { $size: #{map-get($spacers, sp-#{$i - 1})}; $scale: #{$i - 1}; // .m-0, .m-1, .m-2... .m-#{$scale} { margin: #{$size} !important; } .mt-#{$scale} { margin-top: #{$size} !important; } .mr-#{$scale} { margin-right: #{$size} !important; } .mb-#{$scale} { margin-bottom: #{$size} !important; } .ml-#{$scale} { margin-left: #{$size} !important; } .mx-#{$scale} { margin-right: #{$size} !important; margin-left: #{$size} !important; } .my-#{$scale} { margin-top: #{$size} !important; margin-bottom: #{$size} !important; } .mxn-#{$scale} { margin-right: -#{$size} !important; margin-left: -#{$size} !important; } } .mx-auto { margin-right: auto !important; margin-left: auto !important; } @each $media-query in map-keys($media-queries) { @for $i from 1 through length($spacers) { @include mq($media-query) { $size: #{map-get($spacers, sp-#{$i - 1})}; $scale: #{$i - 1}; // .m-sm-0, .m-md-1, .m-lg-2... .m-#{$media-query}-#{$scale} { margin: #{$size} !important; } .mt-#{$media-query}-#{$scale} { margin-top: #{$size} !important; } .mr-#{$media-query}-#{$scale} { margin-right: #{$size} !important; } .mb-#{$media-query}-#{$scale} { margin-bottom: #{$size} !important; } .ml-#{$media-query}-#{$scale} { margin-left: #{$size} !important; } .mx-#{$media-query}-#{$scale} { margin-right: #{$size} !important; margin-left: #{$size} !important; } .my-#{$media-query}-#{$scale} { margin-top: #{$size} !important; margin-bottom: #{$size} !important; } .mxn-#{$media-query}-#{$scale} { margin-right: -#{$size} !important; margin-left: -#{$size} !important; } } } } // Padding spacer utilities @for $i from 1 through length($spacers) { $size: #{map-get($spacers, sp-#{$i - 1})}; $scale: #{$i - 1}; // .p-0, .p-1, .p-2... .p-#{$scale} { padding: #{$size} !important; } .pt-#{$scale} { padding-top: #{$size} !important; } .pr-#{$scale} { padding-right: #{$size} !important; } .pb-#{$scale} { padding-bottom: #{$size} !important; } .pl-#{$scale} { padding-left: #{$size} !important; } .px-#{$scale} { padding-right: #{$size} !important; padding-left: #{$size} !important; } .py-#{$scale} { padding-top: #{$size} !important; padding-bottom: #{$size} !important; } } @each $media-query in map-keys($media-queries) { @include mq($media-query) { @for $i from 1 through length($spacers) { $size: #{map-get($spacers, sp-#{$i - 1})}; $scale: #{$i - 1}; // .p-sm-0, .p-md-1, .p-lg-2... .p-#{$media-query}-#{$scale} { padding: #{$size} !important; } .pt-#{$media-query}-#{$scale} { padding-top: #{$size} !important; } .pr-#{$media-query}-#{$scale} { padding-right: #{$size} !important; } .pb-#{$media-query}-#{$scale} { padding-bottom: #{$size} !important; } .pl-#{$media-query}-#{$scale} { padding-left: #{$size} !important; } .px-#{$media-query}-#{$scale} { padding-right: #{$size} !important; padding-left: #{$size} !important; } .py-#{$media-query}-#{$scale} { padding-top: #{$size} !important; padding-bottom: #{$size} !important; } } } } ================================================ FILE: docs/_sass/utilities/_typography.scss ================================================ // // Utility classes for typography // // stylelint-disable primer/selector-no-utility .fs-1 { @include fs-1; } .fs-2 { @include fs-2; } .fs-3 { @include fs-3; } .fs-4 { @include fs-4; } .fs-5 { @include fs-5; } .fs-6 { @include fs-6; } .fs-7 { @include fs-7; } .fs-8 { @include fs-8; } .fs-9 { @include fs-9; } .fs-10 { @include fs-10; } .fw-300 { font-weight: 300 !important; } .fw-400 { font-weight: 400 !important; } .fw-500 { font-weight: 500 !important; } .fw-700 { font-weight: 700 !important; } .lh-0 { line-height: 0 !important; } .lh-default { line-height: $body-line-height; } .lh-tight { line-height: $body-heading-line-height; } .ls-5 { letter-spacing: 0.05em !important; } .ls-10 { letter-spacing: 0.1em !important; } .ls-0 { letter-spacing: 0 !important; } .text-uppercase { text-transform: uppercase !important; } // stylelint-enable primer/selector-no-utility ================================================ FILE: docs/_sass/utilities/utilities.scss ================================================ @import "./colors"; @import "./layout"; @import "./typography"; @import "./lists"; @import "./spacing"; ================================================ FILE: docs/_sass/vendor/normalize.scss/README.md ================================================ # normalize.scss v0.1.0 Normalize.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. [View the normalize.css test file](http://necolas.github.io/normalize.css/latest/test.html) ## Install * [npm](http://npmjs.org/): `npm install --save normalize.scss` * [Component(1)](https://github.com/component/component/): `component install guerrero/normalize.scss` * [Bower](http://bower.io/): `bower install --save normalize.scss` * 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..." No other styles should come before Normalize.scss. It's recommendable to modify `normalize.scss` to suit it to your project ## What does it do? * Preserves useful defaults, unlike many CSS resets. * Normalizes styles for a wide range of elements. * Corrects bugs and common browser inconsistencies. * Improves usability with subtle improvements. * Explains what code does using detailed comments. ## Browser support * Google Chrome (latest) * Mozilla Firefox (latest) * Mozilla Firefox 4 * Opera (latest) * Apple Safari 6+ * Internet Explorer 8+ [Normalize.css v1 provides legacy browser support](https://github.com/necolas/normalize.css/tree/v1) (IE 6+, Safari 4+), but is no longer actively developed. ## Extended details Additional detail and explanation of the esoteric parts of normalize.css. #### `pre, code, kbd, samp` The `font-family: monospace, monospace` hack fixes the inheritance and scaling of font-size for preformated text. The duplication of `monospace` is intentional. [Source](http://en.wikipedia.org/wiki/User:Davidgothberg/Test59). #### `sub, sup` Normally, using `sub` or `sup` affects the line-box height of text in all browsers. [Source](http://gist.github.com/413930). #### `svg:not(:root)` Adding `overflow: hidden` fixes IE9's SVG rendering. Earlier versions of IE don't support SVG, so we can safely use the `:not()` and `:root` selectors that modern browsers use in the default UA stylesheets to apply this style. [SVG Mailing List discussion](http://lists.w3.org/Archives/Public/public-svg-wg/2008JulSep/0339.html) #### `input[type="search"]` The search input is not fully stylable by default. In Chrome and Safari on OSX/iOS you can't control `font`, `padding`, `border`, or `background`. In Chrome and Safari on Windows you can't control `border` properly. It will apply `border-width` but will only show a border color (which cannot be controlled) for the outer 1px of that border. Applying `-webkit-appearance: textfield` addresses these issues without removing the benefits of search inputs (e.g. showing past searches). #### `legend` Adding `border: 0` corrects an IE 8–11 bug where `color` (yes, `color`) is not inherited by `legend`. ## Acknowledgements Normalize.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). ================================================ FILE: docs/_sass/vendor/normalize.scss/normalize.scss ================================================ /*! normalize.scss v0.1.0 | MIT License | based on git.io/normalize */ /** * 1. Set default font family to sans-serif. * 2. Prevent iOS text size adjust after orientation change, without disabling * user zoom. */ html { font-family: sans-serif; /* 1 */ -ms-text-size-adjust: 100%; /* 2 */ -webkit-text-size-adjust: 100%; /* 2 */ } /** * Remove default margin. */ body { margin: 0; } /* HTML5 display definitions ========================================================================== */ /** * Correct `block` display not defined for any HTML5 element in IE 8/9. * Correct `block` display not defined for `details` or `summary` in IE 10/11 * and Firefox. * Correct `block` display not defined for `main` in IE 11. */ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; } /** * 1. Correct `inline-block` display not defined in IE 8/9. * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. */ audio, canvas, progress, video { display: inline-block; /* 1 */ vertical-align: baseline; /* 2 */ } /** * Prevent modern browsers from displaying `audio` without controls. * Remove excess height in iOS 5 devices. */ audio:not([controls]) { display: none; height: 0; } /** * Address `[hidden]` styling not present in IE 8/9/10. * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. */ [hidden], template { display: none; } /* Links ========================================================================== */ /** * Remove the gray background color from active links in IE 10. */ a { background-color: transparent; } /** * Improve readability when focused and also mouse hovered in all browsers. */ a:active, a:hover { outline: 0; } /* Text-level semantics ========================================================================== */ /** * Address styling not present in IE 8/9/10/11, Safari, and Chrome. */ abbr[title] { border-bottom: 1px dotted; } /** * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. */ b, strong { font-weight: bold; } /** * Address styling not present in Safari and Chrome. */ dfn { font-style: italic; } /** * Address variable `h1` font-size and margin within `section` and `article` * contexts in Firefox 4+, Safari, and Chrome. */ h1 { font-size: 2em; margin: 0.67em 0; } /** * Address styling not present in IE 8/9. */ mark { background: #ff0; color: #000; } /** * Address inconsistent and variable font size in all browsers. */ small { font-size: 80%; } /** * Prevent `sub` and `sup` affecting `line-height` in all browsers. */ sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sup { top: -0.5em; } sub { bottom: -0.25em; } /* Embedded content ========================================================================== */ /** * Remove border when inside `a` element in IE 8/9/10. */ img { border: 0; } /** * Correct overflow not hidden in IE 9/10/11. */ svg:not(:root) { overflow: hidden; } /* Grouping content ========================================================================== */ /** * Address margin not present in IE 8/9 and Safari. */ figure { margin: 1em 40px; } /** * Address differences between Firefox and other browsers. */ hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; } /** * Contain overflow in all browsers. */ pre { overflow: auto; } /** * Address odd `em`-unit font size rendering in all browsers. */ code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } /* Forms ========================================================================== */ /** * Known limitation: by default, Chrome and Safari on OS X allow very limited * styling of `select`, unless a `border` property is set. */ /** * 1. Correct color not being inherited. * Known issue: affects color of disabled elements. * 2. Correct font properties not being inherited. * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. */ button, input, optgroup, select, textarea { color: inherit; /* 1 */ font: inherit; /* 2 */ margin: 0; /* 3 */ } /** * Address `overflow` set to `hidden` in IE 8/9/10/11. */ button { overflow: visible; } /** * Address inconsistent `text-transform` inheritance for `button` and `select`. * All other form control elements do not inherit `text-transform` values. * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. * Correct `select` style inheritance in Firefox. */ button, select { text-transform: none; } /** * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` * and `video` controls. * 2. Correct inability to style clickable `input` types in iOS. * 3. Improve usability and consistency of cursor style between image-type * `input` and others. */ button, html input[type="button"], /* 1 */ input[type="reset"], input[type="submit"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ } /** * Re-set default cursor for disabled elements. */ button[disabled], html input[disabled] { cursor: default; } /** * Remove inner padding and border in Firefox 4+. */ button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } /** * Address Firefox 4+ setting `line-height` on `input` using `!important` in * the UA stylesheet. */ input { line-height: normal; } /** * It's recommended that you don't attempt to style these elements. * Firefox's implementation doesn't respect box-sizing, padding, or width. * * 1. Address box sizing set to `content-box` in IE 8/9/10. * 2. Remove excess padding in IE 8/9/10. */ input[type="checkbox"], input[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ } /** * Fix the cursor style for Chrome's increment/decrement buttons. For certain * `font-size` values of the `input`, it causes the cursor style of the * decrement button to change from `default` to `text`. */ input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } /** * 1. Address `appearance` set to `searchfield` in Safari and Chrome. * 2. Address `box-sizing` set to `border-box` in Safari and Chrome * (include `-moz` to future-proof). */ input[type="search"] { -webkit-appearance: textfield; /* 1 */ -moz-box-sizing: content-box; -webkit-box-sizing: content-box; /* 2 */ box-sizing: content-box; } /** * Remove inner padding and search cancel button in Safari and Chrome on OS X. * Safari (but not Chrome) clips the cancel button when the search input has * padding (and `textfield` appearance). */ input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } /** * Define consistent border, margin, and padding. */ fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } /** * 1. Correct `color` not being inherited in IE 8/9/10/11. * 2. Remove padding so people aren't caught out if they zero out fieldsets. */ legend { border: 0; /* 1 */ padding: 0; /* 2 */ } /** * Remove default vertical scrollbar in IE 8/9/10/11. */ textarea { overflow: auto; } /** * Don't inherit the `font-weight` (applied by a rule above). * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. */ optgroup { font-weight: bold; } /* Tables ========================================================================== */ /** * Remove most spacing between table cells. */ table { border-collapse: collapse; border-spacing: 0; } td, th { padding: 0; } ================================================ FILE: docs/_sass/vendor/normalize.scss/package.json ================================================ { "_args": [ [ "normalize.scss", "/Users/pmarsceill/_projects/just-the-docs" ] ], "_from": "normalize.scss@*", "_id": "normalize.scss@0.1.0", "_inCache": true, "_installable": true, "_location": "/normalize.scss", "_nodeVersion": "0.10.32", "_npmUser": { "email": "alexguerrero1092@gmail.com", "name": "alexguerrero" }, "_npmVersion": "2.0.2", "_phantomChildren": {}, "_requested": { "name": "normalize.scss", "raw": "normalize.scss", "rawSpec": "", "scope": null, "spec": "*", "type": "range" }, "_requiredBy": [ "#DEV:/" ], "_resolved": "https://registry.npmjs.org/normalize.scss/-/normalize.scss-0.1.0.tgz", "_shasum": "4a21dc25bd4c019c857785f829b658aba2a8f9ab", "_shrinkwrap": null, "_spec": "normalize.scss", "_where": "/Users/pmarsceill/_projects/just-the-docs", "author": "", "bugs": { "url": "https://github.com/guerrero/normalize.scss/issues" }, "dependencies": {}, "description": "Normalize.scss as a node packaged module", "devDependencies": {}, "directories": {}, "dist": { "shasum": "4a21dc25bd4c019c857785f829b658aba2a8f9ab", "tarball": "https://registry.npmjs.org/normalize.scss/-/normalize.scss-0.1.0.tgz" }, "files": [ "normalize.scss" ], "gitHead": "d67d517e28615a873066438af1d4845c157c9baf", "homepage": "https://github.com/guerrero/normalize.scss", "license": "MIT", "maintainers": [ { "name": "alexguerrero", "email": "alexguerrero1092@gmail.com" } ], "name": "normalize.scss", "optionalDependencies": {}, "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/guerrero/normalize.scss.git" }, "scripts": {}, "style": "normalize.scss", "version": "0.1.0" } ================================================ FILE: docs/assets/css/dark-mode-preview.scss ================================================ --- # this ensures Jekyll reads the file to be transformed into CSS later # only Main files contain this front matter, not partials. --- // // Import external dependencies // @import "./vendor/normalize.scss/normalize.scss"; // // Import Just the Docs scss // // Support @import "./support/support"; // // Import custom color scheme scss // @import "./color_schemes/dark.scss"; // Modules @import "./base"; @import "./layout"; @import "./content"; @import "./navigation"; @import "./typography"; @import "./labels"; @import "./buttons"; @import "./search"; @import "./tables"; @import "./code"; @import "./utilities/utilities"; // // Import custom overrides // @import "./custom/custom"; ================================================ FILE: docs/assets/css/just-the-docs.scss ================================================ --- # this ensures Jekyll reads the file to be transformed into CSS later # only Main files contain this front matter, not partials. --- // // Import external dependencies // @import "./vendor/normalize.scss/normalize.scss"; // // Import Just the Docs scss // // Support @import "./support/support"; // // Import custom color scheme scss // {% if site.color_scheme == "dark" %} @import "./color_schemes/dark.scss"; {% endif %} // Modules @import "./base"; @import "./layout"; @import "./content"; @import "./navigation"; @import "./typography"; @import "./labels"; @import "./buttons"; @import "./search"; @import "./tables"; @import "./code"; @import "./utilities/utilities"; // // Import custom overrides // @import "./custom/custom"; ================================================ FILE: docs/assets/js/just-the-docs.js ================================================ // Event handling function addEvent(el, type, handler) { if (el.attachEvent) el.attachEvent('on'+type, handler); else el.addEventListener(type, handler); } function removeEvent(el, type, handler) { if (el.detachEvent) el.detachEvent('on'+type, handler); else el.removeEventListener(type, handler); } // Show/hide mobile menu function toggleNav(){ const nav = document.querySelector('.js-main-nav'); const auxNav = document.querySelector('.js-aux-nav'); const navTrigger = document.querySelector('.js-main-nav-trigger'); const search = document.querySelector('.js-search'); addEvent(navTrigger, 'click', function(){ var text = navTrigger.innerText; var textToggle = navTrigger.getAttribute('data-text-toggle'); nav.classList.toggle('nav-open'); auxNav.classList.toggle('nav-open'); navTrigger.classList.toggle('nav-open'); search.classList.toggle('nav-open'); navTrigger.innerText = textToggle; navTrigger.setAttribute('data-text-toggle', text); textToggle = text; }) } // Site search function initSearch() { var index = lunr(function () { this.ref('id'); this.field('title', { boost: 20 }); this.field('content', { boost: 10 }); this.field('url'); }); // Get the generated search_data.json file so lunr.js can search it locally. sc = document.getElementsByTagName("script"); source = ''; for(idx = 0; idx < sc.length; idx++) { s = sc.item(idx); if(s.src && s.src.match(/just-the-docs\.js$/)) { source = s.src; } } jsPath = source.replace('just-the-docs.js', ''); jsonPath = jsPath + 'search-data.json'; var request = new XMLHttpRequest(); request.open('GET', jsonPath, true); request.onload = function() { if (request.status >= 200 && request.status < 400) { // Success! var data = JSON.parse(request.responseText); var keys = Object.keys(data); for(var i in data) { index.add({ id: data[i].id, title: data[i].title, content: data[i].content, url: data[i].url }); } searchResults(data); } else { // We reached our target server, but it returned an error console.log('Error loading ajax request. Request status:' + request.status); } }; request.onerror = function() { // There was a connection error of some sort console.log('There was a connection error'); }; request.send(); function searchResults(dataStore) { var searchInput = document.querySelector('.js-search-input'); var searchResults = document.querySelector('.js-search-results'); var store = dataStore; function hideResults() { searchResults.innerHTML = ''; searchResults.classList.remove('active'); } addEvent(searchInput, 'keyup', function(e){ var query = this.value; searchResults.innerHTML = ''; searchResults.classList.remove('active'); if (query === '') { hideResults(); } else { var results = index.search(query); if (results.length > 0) { searchResults.classList.add('active'); var resultsList = document.createElement('ul'); searchResults.appendChild(resultsList); for (var i in results) { var resultsListItem = document.createElement('li'); var resultsLink = document.createElement('a'); var resultsUrlDesc = document.createElement('span'); var resultsUrl = store[results[i].ref].url; var resultsRelUrl = store[results[i].ref].relUrl; var resultsTitle = store[results[i].ref].title; resultsLink.setAttribute('href', resultsUrl); resultsLink.innerText = resultsTitle; resultsUrlDesc.innerText = resultsRelUrl; resultsList.classList.add('search-results-list'); resultsListItem.classList.add('search-results-list-item'); resultsLink.classList.add('search-results-link'); resultsUrlDesc.classList.add('fs-2','text-grey-dk-000','d-block'); resultsList.appendChild(resultsListItem); resultsListItem.appendChild(resultsLink); resultsLink.appendChild(resultsUrlDesc); } } // When esc key is pressed, hide the results and clear the field if (e.keyCode == 27) { hideResults(); searchInput.value = ''; } } }); addEvent(searchInput, 'blur', function(){ setTimeout(function(){ hideResults() }, 300); }); } } function pageFocus() { var mainContent = document.querySelector('.js-main-content'); mainContent.focus(); console.log(mainContent) } // Document ready function ready(){ toggleNav(); pageFocus(); if (typeof lunr !== 'undefined') { initSearch(); } } // in case the document is already rendered if (document.readyState!='loading') ready(); // modern browsers else if (document.addEventListener) document.addEventListener('DOMContentLoaded', ready); // IE <= 8 else document.attachEvent('onreadystatechange', function(){ if (document.readyState=='complete') ready(); }); ================================================ FILE: docs/assets/js/search-data.json ================================================ --- --- { {% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": { "id": "{{ forloop.index0 }}", "title": "{{ page.title | replace: '&', '&' }}", "content": "{{ page.content | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\', ' ' | normalize_whitespace }}", "url": "{{ page.url | absolute_url }}", "relUrl": "{{ page.url }}" }{% unless forloop.last %},{% endunless %} {% endif %}{% endfor %} } ================================================ FILE: docs/bin/just-the-docs ================================================ #!/usr/bin/env ruby gem_dir = File.expand_path("..",File.dirname(__FILE__)) $LOAD_PATH.unshift gem_dir # Look in gem directory for resources first. exec_type = ARGV[0] if exec_type == 'rake' then require 'rake' require 'pp' pwd=Dir.pwd Dir.chdir(gem_dir) # We'll load rakefile from the gem's dir. Rake.application.init Rake.application.load_rakefile Dir.chdir(pwd) # Revert to original pwd for any path args passed to task. Rake.application.invoke_task(ARGV[1]) end ================================================ FILE: docs/docs/developing-on-QGIS-using-OSGeo4Mac.md ================================================ --- layout: default title: Developing on QGIS using OSGeo4Mac nav_order: 4 --- # Developing on QGIS using OSGeo4Mac In 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. > 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. ## Development Tools This tutorial is based upon using the following open source software: * [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)) * [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)). Mac 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. ## Install Homebrew See http://brew.sh and [homebrew/wiki/Installation](https://github.com/Homebrew/homebrew/wiki/Installation) Default install method: ```sh ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" brew update brew doctor # <-- and fix everything that it mentions, if you can ``` ### Homebrew Prefix While 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. If 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)). ### Install Some Basic Formulae ``` brew install bash-completion brew install git ``` ## Install Python Dependencies The 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. > **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. If using Homebrew Python 2.7, install with: ```sh brew info python # review options brew install python # [--with-option ...] ``` Install required Python modules: * [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) Use [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. _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. Other Python modules installed automatically by Homebrew in next step: * [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) ## Install Build and Linked Library Dependencies > 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`. ```sh brew tap homebrew/science brew tap osgeo/osgeo4mac brew info qgis-xx # review options brew deps --tree qgis-xx --with-grass --with-globe [--with-some-option ...] # to see what dependencies will be included brew install qgis-xx --only-dependencies --with-grass --with-globe [--with-some-option ...] ``` You 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.: ```sh brew unlink qgis-xx ``` This 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. The `--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. ### Optional External Dependencies The [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: * [`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) * [`orfeo-40`](https://github.com/OSGeo/homebrew-osgeo4mac/blob/master/Formula/orfeo-40.rb) (`--with-orfeo` option) - [Orfeo Toolbox](http://orfeo-toolbox.org/otb/) * [`r`](http://www.r-project.org/) (`--with-r` option) - [R Project](http://www.r-project.org/) * [`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) * [`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). The `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). ## Clone QGIS Source See the QGIS [INSTALL](https://github.com/qgis/QGIS/blob/master/INSTALL) document for information on using git to clone the source tree. QGIS'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. ## Customize Build Scripts This tap offers several convenience scripts for use in Qt Creator, or wrapper build scripts, to aid in building/installing QGIS, located at: ``` HOMEBREW_PREFIX/Library/Taps/osgeo/homebrew-osgeo4mac/scripts ``` > 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. The scripts will be used when configuring the QGIS project in Qt Creator. ### Open and review scripts: > Note: scripts expect the HOMEBREW_PREFIX environment variable to be set, e.g. in your .bash_profile: ```bash export HOMEBREW_PREFIX=/usr/local ``` * [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. * [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._ * [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. * [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. ### Other Scripts * [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. * [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. ## Configure "Build and Run" Preferences in Qt Creator * Define Homebrew's Qt as an available version: * Define a new Kit that uses Homebrew's Qt 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. 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`. * If you installed to a non-standard HOMEBREW_PREFIX, you may have to browse and set the path to the `cmake` executable. ## Open QGIS Source Code as Project in Qt Creator * Select `File -> Open File or Project...` and browse/open `/path/to/source/of/QGIS/CMakeLists.txt` which opens the CMake Wizard: * Run `qgis-cmake-options.py` (ensure HOMEBREW_PREFIX environment variable is set) and paste the result in the **Arguments:** field. * Generate the Unix Makefiles. If there are errors, they will have to be resolved, or the project can not be initialized and opened. ## Configure Project in Qt Creator Once 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. * Configure project with environment variables and to use the build and install scripts: 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. * Environment variables * **`HOMEBREW_PREFIX`** is referenced and required by the build scripts. * **`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`. * **`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`. ## Build QGIS Select the `all` target and click **Build Project "qgis-x.x.x"**. (Showing the **Compile Output** tab allows log output of the build.) Unless 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. ## Run Unit Tests Open a Terminal.app session and issue the following to run all tests: ```bash export QGIS_BUILD="/path/to/QGIS/build/dir" export DYLD_LIBRARY_PATH=${QGIS_BUILD}/output/lib:${QGIS_BUILD}/PlugIns/qgis export PATH=${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin::/usr/X11/bin export PYTHONHOME=${HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/2.7 export PYTHONPATH=${HOMEBREW_PREFIX}/lib/python2.7/site-packages export PYQGIS_STARTUP=${HOMEBREW_PREFIX}/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/python_startup.py export GDAL_DRIVER_PATH=${HOMEBREW_PREFIX}/lib/gdalplugins echo "Homebrew: $HOMEBREW_PREFIX" echo "DYLD_LIBRARY_PATH: $DYLD_LIBRARY_PATH" echo "PATH: $PATH" echo "PYTHONHOME: $PYTHONHOME" echo "PYTHONPATH: $PYTHONPATH" echo "PYQGIS_STARTUP: $PYQGIS_STARTUP" echo "GDAL_DRIVER_PATH: $GDAL_DRIVER_PATH" cd ${QGIS_BUILD} make test ``` The 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. ## External Qt Creator Tools * Consider adding `qgis-cmake-options.py` as an external tool in Qt Creator: * Consider adding `prepare-commit.sh` as an external tool in Qt Creator: 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. ## PyCharm Configuration You 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): You will need to add the following `/path/to/QGIS/build/dir/output/python` to access the `qgis` modules. > 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. ================================================ FILE: docs/docs/installing-QGIS-3.md ================================================ --- layout: default title: Installing QGIS 3 nav_order: 1 --- # Installing QGIS 3 To 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. - `--with-3d`: Build with 3D Map View panel - `--with-gpsbabel`: Build with GPSBabel. Read, write and manipulate GPS waypoints in a variety of formats - `--with-grass`: Build with GRASS 7 integration plugin and Processing plugin support (or install grass-7x first) - `--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. - `--with-orfeo`: Build extra Orfeo Toolbox for Processing plugin - `--with-qspatialite`: Build QSpatialite Qt database driver - `--with-r`: Build extra R for Processing plugin - `--with-saga`: Build extra Saga GIS (LTS) for Processing plugin - `--with-server`: Build with QGIS Server (qgis_mapserv.fcgi) - `--with-taudem`: Build with TauDEM, Terrain Analysis Using Digital Elevation Models for hydrology - `--with-whitebox`: Build with Whitebox Tools, an advanced geospatial data analysis platform The options `--with-mssql` and `--with-oracle` aren'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. Anyhow, 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). ## qgis-res We 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. When `qgis-res` formula is installed or updated, and since QGIS is build now by default `--with-r`, it will install R from Homebrew-core. ## R from core vs R from other taps If 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. 1. 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. 2. 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. ```shell # Before you install or update QGIS $ brew unlink R $ mv /usr/local/cellar/r /usr/local/cellar/r-backup # After the QGIS install finish $ rm -r /usr/local/cellar/r $ mv /usr/local/cellar/r-backup /usr/local/cellar/r $ brew link r ``` Please 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. ## Recommendations, issues, caveats and headaches :face_with_head_bandage: You can come across the following problems. ### Formulae renaming & tap pinning We 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 `. Formulae from pinned taps only take precedence when you install those formulae from terminal. Anyhow we recommend you to pin this tap, while we try to figure out this conundrum. We encourage you to give your opinion. ```shell $ brew tap-pin osgeo/osgeo4mac ``` ### The maximum number of open file descriptors Since 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. ### Post-install could not finish It seems that there was a small change in OTB, I will correct it in the next release of QGIS. You can solve this by temporarily renaming `OtbUtils` file. ``` $ 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 ``` ### Fixing dependencies Sometimes 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: Remove the cache ```shell $ rm -rf $(brew --cache) ``` and the temporary files in `/tmp` related to the build if any. A failed installation perhaps has build `qgis_customwidgets.py` you need to delete it. ```shell $ rm /usr/local/lib/python3.7/site-packages/PyQt5/uic/widget-plugins/qgis_customwidgets.py ``` Reinstall a relink some dependencies: ```shell $ brew reinstall ninja gsl python qt sip-qt5 pyqt-qt5 pyqt5-webkit qscintilla2-qt5 six bison flex pkg-config $ brew link --overwrite pyqt-qt5 $ brew unlink gettext python && brew link --force gettext python ``` ## Mind the CI **Build status**: [![CircleCI](https://circleci.com/gh/OSGeo/homebrew-osgeo4mac.svg?style=svg)](https://circleci.com/gh/OSGeo/homebrew-osgeo4mac) You 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. ================================================ FILE: docs/docs/reporting-issues.md ================================================ --- layout: default title: Reporting issues nav_order: 2 --- # Reporting Issues **Run `brew update` twice and `brew doctor` *before* creating an issue!** This document will help you check for common issues and make sure your issue has not already been reported. ## Check for common issues Follow these steps to fix common problems: * Run `brew update` twice. * Run `brew doctor` and fix all the warnings (**outdated Xcode/CLT and unbrewed dylibs are very likely to cause problems**). * Check that **Command Line Tools for Xcode (CLT)** and **Xcode** are up to date. * If commands fail with permissions errors, check the permissions of `/usr/local`'s subdirectories. If you’re unsure what to do, you can run: ```shell $ cd /usr/local $ sudo chown -R $(whoami) bin etc include lib sbin share var opt Cellar Caskroom Frameworks ``` * Read through the [[Troubleshooting]]. ## Check to see if the issue has been reported * Search the [issue tracker](https://github.com/OSGeo/homebrew-osgeo4mac/issues) to see if someone else has already reported the same issue. * 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. ## Create an issue If your problem hasn't been solved or reported, then create an issue: 1. Upload debugging information to a [Gist](https://gist.github.com): * If you had a formula-related problem: run `brew gist-logs ` (where `` is the name of the formula). * If you encountered a non-formula problem: upload the output of `brew config` and `brew doctor` to a new [Gist](https://gist.github.com). 2. [Create a new issue](https://github.com/Homebrew/homebrew-core/issues/new/choose). * 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 "\ failed to build on \<10.x>", where "\" is the name of the formula that failed to build, and "\<10.x>" is the version of macOS you are using. * Include the URL output by `brew gist-logs ` (if applicable). Please check [how to get the building logs](#how-to-get-the-building-logs) for more info. * 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). * Please make, one problem one error. Don't mix up things because it isn't going to have any sense. * Don't dumb in the description of the issue a incredible amount of code, use a [Gist](https://gist.github.com) instead. **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. * 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). ## How to get the building logs? One 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. In 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. Homebrew 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`. Unfortunately, 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//` or `~/Library/Logs/Homebrew//0#.make` (for Make builds) and search in those logs for **`error:`** or maybe **`fatal error:`** (note case and colon). When 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). ================================================ FILE: docs/docs/troubleshooting.md ================================================ --- layout: default title: Troubleshooting nav_order: 3 --- # Troubleshooting * Run `brew update` twice. * Run `brew doctor` and fix all the warnings (**outdated Xcode/CLT and unbrewed dylibs are very likely to cause problems**). * Check that **Command Line Tools for Xcode (CLT)** and **Xcode** are up to date. * If commands fail with permissions errors, check the permissions of `/usr/local`'s subdirectories. If you’re unsure what to do, you can run: ```shell $ cd /usr/local $ sudo chown -R $(whoami) bin etc include lib sbin share var opt Cellar Caskroom Frameworks ``` ## QGIS 3 Specific Problems ### The maximum number of open file descriptors Since 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. ### Post-install could not finish It seems that there was a small change in OTB, I will correct it in the next release of QGIS. You can solve this by temporarily renaming `OtbUtils` file. ```shell $ 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 ``` ### Fixing dependencies Sometimes 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: Remove the cache ```shell $ rm -rf $(brew --cache) ``` and the temporary files in `/tmp` related to the build if any. A failed installation perhaps has build `qgis_customwidgets.py` you need to delete it. ```shell $ rm /usr/local/lib/python3.7/site-packages/PyQt5/uic/widget-plugins/qgis_customwidgets.py ``` Reinstall a relink some dependencies: ```shell $ brew reinstall ninja gsl python qt sip-qt5 pyqt-qt5 pyqt5-webkit qscintilla2-qt5 six bison flex pkg-config $ brew link --overwrite pyqt-qt5 $ brew unlink gettext python && brew link --force gettext python ``` ================================================ FILE: docs/index.md ================================================ --- layout: default title: Home description: "This is the homebrew's tap for the stable versions of the OSGeo geospatial toolset." permalink: / ---

Homebrew OSGeo documentation page

important {: .label .label-red } notice {: .label .label-yellow } We 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. Not 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.
------ ## :sos: Help wanted If 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. In 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. **Thanks!** 🙏 ================================================ FILE: docs/just-the-docs.gemspec ================================================ # coding: utf-8 Gem::Specification.new do |spec| spec.name = "just-the-docs" spec.version = "0.2.3" spec.authors = ["Patrick Marsceill"] spec.email = ["patrick.marsceill@gmail.com"] spec.summary = %q{A modern, high customizable, responsive Jekyll theme for documention with built-in search.} spec.homepage = "https://github.com/pmarsceill/just-the-docs" spec.license = "MIT" spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r{^(assets|bin|_layouts|_includes|lib|Rakefile|_sass|LICENSE|README)}i) } spec.executables << 'just-the-docs' spec.add_runtime_dependency "jekyll", "~> 3.8.5" spec.add_runtime_dependency "rake", "~> 12.3.1" spec.add_development_dependency "bundler", "~> 2.0.1" end ================================================ FILE: docs/lib/tasks/search.rake ================================================ namespace :search do desc 'Generate the files needed for search functionality' task :init do puts 'Creating search data json file...' mkdir_p '/assets/js' touch '/assets/js/search-data.json' content = %Q[{{ page.content | markdownify | strip_html | escape_once | remove: 'Table of contents' | remove: '```' | remove: '---' | replace: '\\', ' ' | normalize_whitespace }}] puts 'Done.' puts 'Generating content...' File.open('/assets/js/search-data.json', 'w') do |f| f.puts '--- --- { {% for page in site.html_pages %}{% if page.search_exclude != true %}"{{ forloop.index0 }}": { "id": "{{ forloop.index0 }}", "title": "{{ page.title | replace: \'&\', \'&\' }}", "content": "'+content+'", "url": "{{ page.url | absolute_url }}", "relUrl": "{{ page.url }}" }{% unless forloop.last %},{% endunless %} {% endif %}{% endfor %} }' end puts 'Done.' end end ================================================ FILE: docs/package.json ================================================ { "name": "just-the-docs", "version": "0.2.3", "description": "A modern Jekyll theme for documentation", "repository": "pmarsceill/just-the-docs", "license": "MIT", "bugs": "https://github.com/pmarsceill/just-the-docs/issues", "devDependencies": { "stylelint": "^9.10.1", "stylelint-config-primer": "^3.0.1" }, "dependencies": {}, "scripts": { "test": "stylelint '**/*.scss'" } } ================================================ FILE: docs/script/build ================================================ #!/bin/sh echo "Packaging gem... \n" gem build just-the-docs.gemspec echo "Cleaning up... \n" git add *.gem git commit -m 'Bump just-the-docs gem package' ================================================ FILE: enviro/osgeo4mac-qt4.env ================================================ # Example usage, in .bash_profile, etc.: # # non-standard homebrew prefix # alias osgeo4mac-env='source /usr/local/osgeo4mac/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/osgeo4mac.env' # OR, standard homebrew /usr/local prefix # alias osgeo4mac-env="source $(brew --prefix)/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/osgeo4mac.env" # Use this variable to differentiate between custom and normal prefix in downstream environs. # For example, in your .bash_profile, which gets sourced when doing `brew sh` you can: # if [ ${HOMEBREW_BREW_FILE+x} ] && [ ${OSGEO4MAC+x} ] ; then # # HOMEBREW_BREW_FILE is set, and using osgeo4mac setup: fix bloated PATH # export PATH=/new/prepended/paths:/usr/X11/bin:/usr/bin:/bin:/usr/sbin # fi export OSGEO4MAC=1 # Alternative method for finding 'sourced' file path # CMD="import os, sys; print os.path.realpath(\"${BASH_SOURCE[0]}\")" # SCRIPT_PATH="$(/usr/bin/python -c "$CMD" )" # Starting from within homebrew tapped directory ENVIRO_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd -P) BREW_TAP=$(dirname $ENVIRO_DIR) if ! [ -d "$BREW_TAP" ]; then echo "Homebrew tap not found: $BREW_TAP" exit 1 fi BREW_PREFIX=$(dirname $(dirname $(dirname $(dirname $(dirname $BREW_TAP ) ) ) ) ) if ! [ -d "$BREW_PREFIX" ]; then echo "Homebrew prefix not found: $BREW_PREFIX" exit 1 fi echo "Homebrew prefix: $BREW_PREFIX" echo "Homebrew tap is: $BREW_TAP" echo "osgeo4mac enviro: $ENVIRO_DIR" export MANPATH=$BREW_PREFIX/share/man:$MANPATH export PATH=$BREW_PREFIX/bin:$BREW_PREFIX/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11/bin # Setting PYTHONHOME tends to break some builds when using `brew sh` # export PYTHONHOME=$BREW_PREFIX/Frameworks/Python.framework/Versions/2.7 export PYTHONPATH=$BREW_PREFIX/lib/qt-4/python2.7/site-packages:$BREW_PREFIX/lib/python2.7/site-packages export PYTHONSTARTUP=$ENVIRO_DIR/python_startup.py export GDAL_DRIVER_PATH=$BREW_PREFIX/lib/gdalplugins export OSG_LIBRARY_PATH=$BREW_PREFIX/lib/osgPlugins-3.4.0 # Doesn't work very well for GDAL PGeo driver, use Java-based Access MDB driver instead # export ODBCSYSINI=$BREW_PREFIX/etc/ # export MDBDRIVER_PATH=$BREW_PREFIX/lib if [ -d $BREW_PREFIX/etc/bash_completion ]; then source $BREW_PREFIX/etc/bash_completion fi # Append any user env settings if [ -f $HOME/.osgeo4mac.env ]; then source $HOME/.osgeo4mac.env fi cd $BREW_PREFIX ================================================ FILE: enviro/osgeo4mac.env ================================================ # Example usage, in .bash_profile, etc.: # # non-standard homebrew prefix # alias osgeo4mac-env='source /usr/local/osgeo4mac/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/osgeo4mac.env' # OR, standard homebrew /usr/local prefix # alias osgeo4mac-env="source $(brew --prefix)/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/osgeo4mac.env" # Use this variable to differentiate between custom and normal prefix in downstream environs. # For example, in your .bash_profile, which gets sourced when doing `brew sh` you can: # if [ ${HOMEBREW_BREW_FILE+x} ] && [ ${OSGEO4MAC+x} ] ; then # # HOMEBREW_BREW_FILE is set, and using osgeo4mac setup: fix bloated PATH # export PATH=/new/prepended/paths:/usr/X11/bin:/usr/bin:/bin:/usr/sbin # fi export OSGEO4MAC=1 # Alternative method for finding 'sourced' file path # CMD="import os, sys; print os.path.realpath(\"${BASH_SOURCE[0]}\")" # SCRIPT_PATH="$(/usr/bin/python -c "$CMD" )" # Starting from within homebrew tapped directory ENVIRO_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd -P) BREW_TAP=$(dirname $ENVIRO_DIR) if ! [ -d "$BREW_TAP" ]; then echo "Homebrew tap not found: $BREW_TAP" exit 1 fi BREW_PREFIX=$(dirname $(dirname $(dirname $(dirname $(dirname $BREW_TAP ) ) ) ) ) if ! [ -d "$BREW_PREFIX" ]; then echo "Homebrew prefix not found: $BREW_PREFIX" exit 1 fi echo "Homebrew prefix: $BREW_PREFIX" echo "Homebrew tap is: $BREW_TAP" echo "osgeo4mac enviro: $ENVIRO_DIR" export MANPATH=$BREW_PREFIX/share/man:$MANPATH export PATH=$BREW_PREFIX/bin:$BREW_PREFIX/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11/bin # Setting PYTHONHOME tends to break some builds when using `brew sh` # export PYTHONHOME=$BREW_PREFIX/Frameworks/Python.framework/Versions/2.7 export PYTHONPATH=$BREW_PREFIX/lib/python2.7/site-packages export PYTHONSTARTUP=$ENVIRO_DIR/python_startup.py export GDAL_DRIVER_PATH=$BREW_PREFIX/lib/gdalplugins export OSG_LIBRARY_PATH=$BREW_PREFIX/lib/osgPlugins-3.4.0 # Doesn't work very well for GDAL PGeo driver, use Java-based Access MDB driver instead # export ODBCSYSINI=$BREW_PREFIX/etc/ # export MDBDRIVER_PATH=$BREW_PREFIX/lib if [ -d $BREW_PREFIX/etc/bash_completion ]; then source $BREW_PREFIX/etc/bash_completion fi # Append any user env settings if [ -f $HOME/.osgeo4mac.env ]; then source $HOME/.osgeo4mac.env fi cd $BREW_PREFIX ================================================ FILE: enviro/python_startup.py ================================================ # -*- coding: utf-8 -*- """ /*************************************************************************** OSGeo4Mac Python startup script to strip /Library/Frameworks and /Library/Python site-packages ------------------- begin : 2013-09-20 copyright: (C) 2013 Larry Shaffer email : larrys@dakotacarto.com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ """ import sys sys.path[:] = (pth for pth in sys.path if not pth.startswith('/Library')) ================================================ FILE: enviro/qgis-osgeo4mac-ctest-env.sh ================================================ export DYLD_LIBRARY_PATH=${QGIS_BUILD}/output/lib:${QGIS_BUILD}/PlugIns/qgis export PATH=${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin export PYTHONHOME=${HOMEBREW_PREFIX}/Frameworks/Python.framework/Versions/2.7 export PYTHONPATH=${HOMEBREW_PREFIX}/lib/python2.7/site-packages export PYQGIS_STARTUP=${HOMEBREW_PREFIX}/Homebrew/Library/Taps/osgeo/homebrew-osgeo4mac/enviro/python_startup.py export GDAL_DRIVER_PATH=${HOMEBREW_PREFIX}/lib/gdalplugins cd ${QGIS_BUILD} echo "Homebrew: $HOMEBREW_PREFIX" echo "DYLD_LIBRARY_PATH: $DYLD_LIBRARY_PATH" echo "PATH: $PATH" echo "PYTHONHOME: $PYTHONHOME" echo "PYTHONPATH: $PYTHONPATH" echo "PYQGIS_STARTUP: $PYQGIS_STARTUP" echo "GDAL_DRIVER_PATH: $GDAL_DRIVER_PATH" ================================================ FILE: formula_renames.json ================================================ { "qgis3": "osgeo-qgis", "qgis2": "qgis-ltr@2", "libkml-dev": "osgeo-libkml", "hdf4": "osgeo-hdf4", "fyba": "osgeo-fyba", "ogdi": "osgeo-ogdi", "filegdb-api": "osgeo-filegdb-api", "oracle-client-sdk": "osgeo-oracle-client-sdk", "pdfium-gdal2": "osgeo-pdfium", "ecwjp2-sdk": "osgeo-ecwjp2-sdk", "mrsid-sdk": "osgeo-mrsid-sdk", "gdal2": "osgeo-gdal", "gdal2-sosi": "osgeo-gdal-sosi", "gdal2-ecwjp2": "osgeo-gdal-ecwjp2", "gdal2-filegdb": "osgeo-gdal-filegdb", "gdal2-mdb": "osgeo-gdal-mdb", "gdal2-mrsid": "osgeo-gdal-mrsid", "gdal2-mysql": "osgeo-gdal-mysql", "gdal2-ogdi": "osgeo-gdal-ogdi", "gdal2-oracle": "osgeo-gdal-oracle", "gdal2-pdf": "osgeo-gdal-pdf", "gdal2-python": "osgeo-gdal-python", "gdal2-grass7": "osgeo-gdal-grass", "gdal2-mongodb": "osgeo-gdal-mongodb", "laszip@2.2": "osgeo-laszip@2", "liblas-gdal2": "osgeo-liblas", "grass7": "osgeo-grass", "mongo-cxx-driver-legacy": "osgeo-mongo-cxx-driver-legacy", "vigra": "osgeo-vigra", "saga-gis-lts": "osgeo-saga-lts", "saga-gis": "osgeo-saga", "sip-qt5": "osgeo-sip", "pyqt-qt5": "osgeo-pyqt", "qscintilla2-qt5": "osgeo-qscintilla2", "qt5-webkit": "osgeo-qt-webkit", "pyqt5-webkit": "osgeo-pyqt-webkit", "qpsql": "osgeo-qt-psql", "qmysql": "osgeo-qt-mysql", "qodbc": "osgeo-qt-odbc", "qtkeychain": "osgeo-qtkeychain", "pyspatialite": "osgeo-pyspatialite", "six": "osgeo-six", "taudem": "osgeo-taudem", "shark": "osgeo-shark", "whitebox-tools": "osgeo-whitebox-tools", "whitebox": "osgeo-whitebox", "insighttoolkit": "osgeo-insighttoolkit", "hexer": "osgeo-hexer", "opencollada": "osgeo-opencollada", "lastools": "osgeo-lastools", "nitro": "osgeo-nitro", "libnoise": "osgeo-libnoise", "libght": "osgeo-libght", "marble": "osgeo-marble", "fcgi-debug": "osgeo-fcgi-debug", "gpkgtools": "osgeo-gpkgtools", "pointcloud": "osgeo-pointcloud", "postgis2": "osgeo-postgis", "openscenegraph-qt5": "osgeo-openscenegraph", "osgqt": "osgeo-osgqt", "ossim": "osgeo-ossim", "orfeo6": "osgeo-orfeo", "qgis-res": "osgeo-qgis-res", "qgis": "osgeo-qgis", "qgis-ltr": "osgeo-qgis-ltr", "pgsql-ogr-fdw": "osgeo-pgsql-ogr-fdw", "iipsrv": "osgeo-iipsrv", "osm2po": "osgeo-osm2po" } ================================================ FILE: scripts/Mac/find_all-installed_w-options.sh ================================================ #!/bin/bash # assign env var, if set HB="${HOMEBREW_PREFIX:=/usr/local}" find -L "${HB}/opt" -name 'INSTALL_RECEIPT.json' -maxdepth 2 -print > /tmp/homebrew-installed.txt printf '' > /tmp/homebrew-installed-w-options.txt NAME='' OPTIONS='' NAMES='' NAME_OPTS='' while IFS= read -r file do # get the formula name NAME=$(printf "$file" | sed -E "s|^${HB}/opt/([^/]+)/INSTALL_RECEIPT.json$|\1|") # get, cleanup and append used options OPTIONS=$(grep -l -v "\"used_options\":\[\]" "$file") if [ -z "$OPTIONS" ]; then NAMES+="${NAME} " else OPTIONS=$(sed -E -e 's/^.+"used_options":\[([^]]+)\].*$/\1/' -e 's/"//g' -e "s/,/ /g" "$file") NAME_OPTS+="${NAME} ${OPTIONS} " fi done < /tmp/homebrew-installed.txt printf "${NAME_OPTS}" >> /tmp/homebrew-installed-w-options.txt printf "${NAMES}" >> /tmp/homebrew-installed-w-options.txt echo "Opening /tmp/homebrew-installed-w-options.txt" nano /tmp/homebrew-installed-w-options.txt ================================================ FILE: scripts/Mac/find_non-bottle-builds_w-options.sh ================================================ #!/bin/bash # assign env var, if set HB="${HOMEBREW_PREFIX:=/usr/local}" find -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 # cat /tmp/not-built-bottles.txt.bkup | xargs -n 200 grep -l -v "\"used_options\":\[\]" > /tmp/not-built-bottles_w-options.txt.bkup [ -f /tmp/not-built-bottles_w-options.txt ] && rm /tmp/not-built-bottles_w-options.txt touch /tmp/not-built-bottles_w-options.txt NAME='' OPTIONS='' while IFS= read -r file do # get the formula name NAME=$(echo -n "$file" | sed -E "s|^${HB}/opt/([^/]+)/INSTALL_RECEIPT.json$|\1|") # get, cleanup and append used options OPTIONS=$(grep -l -v "\"used_options\":\[\]" "$file") if [ -z "$OPTIONS" ]; then NAME_OPTS="${NAME}" else OPTIONS=$(sed -E -e 's/^.+"used_options":\[([^]]+)\].*$/\1/' -e 's/"//g' -e "s/,/ /g" "$file") NAME_OPTS="${NAME} ${OPTIONS}" fi echo "${NAME_OPTS}" >> /tmp/not-built-bottles_w-options.txt done < /tmp/not-built-bottles.txt.bkup echo "Opening /tmp/not-built-bottles_w-options.txt" nano /tmp/not-built-bottles_w-options.txt ================================================ FILE: scripts/qgis2-cmake-options.py ================================================ #!/usr/bin/env python # -*- coding: utf-8 -*- """ /*************************************************************************** OSGeo4Mac Python script for generating CMake option string for use in Qt Creator with dev builds and installs of QGIS when built off dependencies from homebrew-osgeo4mac tap ------------------- begin : January 2014 copyright: (C) 2014 Larry Shaffer email : larrys at dakotacarto dot com ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ """ import os import re import sys from collections import OrderedDict import argparse OSG_VERSION = '3.4.0' HOMEBREW_PREFIX = '/usr/local' # default for Homebrew def cmake_opts(qi, hb, ver): # define versions of CMake option changes lt27 = int(ver[0]) <= 2 and int(ver[1]) < 7 w_server = 'WITH_MAPSERVER' if lt27 else 'WITH_SERVER' # ensure libintl.h can be found in gettext for grass cxx_flags = "-I{hb}/opt/gettext/include" if 'CXXFLAGS' in os.environ: cxx_flags += " " + os.environ['CXXFLAGS'] # search Homebrew's Frameworks directory before those in /Library or /System ld_flags = "-F{hb}/Frameworks" if 'LDFLAGS' in os.environ: ld_flags += " " + os.environ['LDFLAGS'] # IMPORTANT: mulit-path options need the CMake list semicolon (;) delimiter, # NOT the environment variable path list colon (:) separator # set CMAKE_PREFIX_PATH for keg-only installs, and HOMEBREW_PREFIX cm_opts = OrderedDict([ ('CMAKE_INSTALL_PREFIX', qi), ('CMAKE_PREFIX_PATH', '"{hb}/opt/libxml2;{hb}/opt/expat;' '{hb}/opt/gettext;{hb}/opt/sqlite;' '{hb}/opt/gdal2;' '{hb}/opt/sip-qt4;' '{hb}/opt/pyqt-qt4;' '{hb}/opt/qwt-qt4;' '{hb}/opt/qwtpolar-qt4;' '{hb}/opt/qscintilla2-qt4;' '{hb}"'), ('CMAKE_FRAMEWORK_PATH', '"{hb}/opt/qwt-qt4/lib;{hb}/opt/qwtpolar-qt4/lib"'), ('CMAKE_BUILD_TYPE', 'RelWithDebInfo'), ('CMAKE_FIND_FRAMEWORK', 'LAST'), ('CMAKE_CXX_FLAGS', '"' + cxx_flags + '"'), ('CMAKE_EXE_LINKER_FLAGS', '"' + ld_flags + '"'), ('CMAKE_MODULE_LINKER_FLAGS', '"' + ld_flags + '"'), ('CMAKE_SHARED_LINKER_FLAGS', '"' + ld_flags + '"'), ('CXX_EXTRA_FLAGS', '"-Wno-inconsistent-missing-override ' '-Wno-unused-private-field ' '-Wno-deprecated-register"'), ('BISON_EXECUTABLE', '{hb}/opt/bison/bin/bison'), ('FLEX_EXECUTABLE', '{hb}/opt/flex/bin/flex'), ('QT_QMAKE_EXECUTABLE', '{hb}/opt/qt-4/bin/qmake'), ('SUPPRESS_QT_WARNINGS', 'TRUE'), ('GITCOMMAND', '{hb}/bin/git'), ('ENABLE_TESTS', 'TRUE'), ('ENABLE_MODELTEST', 'TRUE'), ('WITH_ASTYLE', 'TRUE'), ('WITH_PYSPATIALITE', 'FALSE'), ('WITH_QWTPOLAR', 'TRUE'), ('WITH_INTERNAL_QWTPOLAR', 'FALSE'), (w_server, 'TRUE'), ('WITH_STAGED_PLUGINS', 'FALSE'), ('WITH_PY_COMPILE', 'TRUE'), ('WITH_APIDOC', 'FALSE'), ('WITH_QSCIAPI', 'FALSE'), ('QSCI_SIP_DIR', '{hb}/opt/qscintilla2-qt4/share/sip'), ('GDAL_CONFIG', '{hb}/opt/gdal2/bin/gdal-config'), ('POSTGRES_CONFIG', '{hb}/bin/pg_config'), ('WITH_QSPATIALITE', 'TRUE'), ('WITH_GRASS', 'FALSE'), ('WITH_GRASS7', 'TRUE'), ('GRASS_PREFIX7', '{hb}/opt/grass7/grass-base'), ('WITH_GLOBE', 'FALSE'), ('WITH_ORACLE', 'FALSE'), ('FCGI_INCLUDE_DIR', '{hb}/opt/fcgi/include'), ('GEOS_INCLUDE_DIR', '{hb}/opt/geos/include'), ('GSL_INCLUDE_DIR', '{hb}/opt/gsl/include'), ('PROJ_INCLUDE_DIR', '{hb}/opt/proj/include'), ('QCA_INCLUDE_DIR', '{hb}/opt/qca-qt4/lib/qca.framework/Headers'), ('QSCINTILLA_INCLUDE_DIR', '{hb}/opt/qscintilla2-qt4/include'), ('QWT_INCLUDE_DIR', '{hb}/opt/qwt-qt4/lib/qwt.framework/Headers'), ('QWTPOLAR_LIBRARY', '{hb}/opt/qwtpolar/lib/qwtpolar-qt4.framework/qwt'), ('QWTPOLAR_INCLUDE_DIR', '{hb}/opt/qwtpolar/lib/qwtpolar-qt4.framework/Headers'), ('SPATIALINDEX_INCLUDE_DIR', '{hb}/opt/spatialindex/include/spatialindex'), ('SPATIALITE_INCLUDE_DIR', '{hb}/opt/libspatialite/include'), ('SQLITE3_INCLUDE_DIR', '{hb}/opt/sqlite/include'), ('QGIS_MACAPP_BUNDLE', '0') ]) # ('CMAKE_FRAMEWORK_PATH', '""') # Supplemental # ('OSG_DIR', '{hb}'), # ('OSGEARTH_DIR', '{hb}'), # ('OSG_PLUGINS_PATH', '{hb}/lib/osgPlugins-' + OSG_VERSION), # ('GRASS_PREFIX', '{hb}/opt/grass6/grass-base'), # ('OCI_INCLUDE_DIR', '{hb}/opt/oracle-client-sdk/sdk/include'), # ('OCI_LIBRARY', '{hb}/lib/libclntsh.dylib'), # These should be found automatically now... # ('SQLITE3_INCLUDE_DIR', '{hb}/opt/sqlite/include'), # ('SQLITE3_LIBRARY', '{hb}/opt/sqlite/lib/libsqlite3.dylib'), # ('QSCINTILLA_INCLUDE_DIR', '{hb}/opt/qscintilla2-qt4/include/Qsci'), # ('QSCINTILLA_LIBRARY', '{hb}/opt/qscintilla2-qt4/lib/libqscintilla2.dylib'), # ('QWT_LIBRARY', '{hb}/opt/qwt-qt4/lib/qwt.framework/qwt'), # ('QWT_INCLUDE_DIR', '{hb}/opt/qwt-qt4/lib/qwt.framework/Headers'), # ('QWTPOLAR_LIBRARY', # '{hb}/opt/qwtpolar/lib/qwtpolar-qt4.framework/qwt'), # ('QWTPOLAR_INCLUDE_DIR', # '{hb}/opt/qwtpolar/lib/qwtpolar-qt4.framework/Headers'), # ('WITH_INTERNAL_SPATIALITE', 'FALSE'), if os.path.exists(hb + '/Frameworks/Python.framework/Versions/2.7'): cm_opts['PYTHON_EXECUTABLE'] = '{hb}/bin/python' cm_opts['PYTHON_CUSTOM_FRAMEWORK'] = \ '{hb}/Frameworks/Python.framework/Versions/2.7' return cm_opts def arg_parser(): parser = argparse.ArgumentParser( description="""\ Script for generating CMake option string for use in Qt Creator with dev builds and installs of QGIS when built off dependencies from homebrew-osgeo4mac tap. """ ) parser.add_argument( '-p', '--homebrew-prefix', dest='hb', metavar='homebrew_prefix', help='homebrew prefix path, or set HOMEBREW_PREFIX (/usr/local default)' ) parser.add_argument( 'qs', metavar='qgis-src-dir', help='QGIS source directory' ) parser.add_argument( 'qi', metavar='qgis-install-dir', help='QGIS install directory' ) return parser def main(): # get defined args args = arg_parser().parse_args() qs = os.path.realpath(args.qs) if not os.path.isabs(qs) or not os.path.exists(qs): print 'QGIS source directory not resolved to existing absolute path.' sys.exit(1) # get QGIS version s = '' with file(os.path.join(qs, 'CMakeLists.txt')) as f: for _ in range(5): s += f.readline() # print s p = re.compile(r'CPACK_PACKAGE_VERSION_..... "(..?)"') ver = p.findall(s) print ver if not ver: print 'QGIS version could not be resolved.' sys.exit(1) if len(ver) != 3: print 'QGIS version\'s major.minor.patch could not be resolved.' sys.exit(1) qi = os.path.realpath(args.qi) if not os.path.isabs(qi) or not os.path.exists(qi): print 'QGIS install directory not resolved to existing absolute path.' sys.exit(1) # generate list of environment variables hb_prefix = HOMEBREW_PREFIX if 'HOMEBREW_PREFIX' in os.environ: hb_prefix = os.environ['HOMEBREW_PREFIX'] hb = os.path.realpath(args.hb) if args.hb else hb_prefix if not os.path.isabs(hb) or not os.path.exists(hb): print 'HOMEBREW_PREFIX not resolved to existing absolute path.' sys.exit(1) # generate cmake options cm_opts = cmake_opts(qi, hb, ver) cm_opts_s = args.qs for k, v in cm_opts.iteritems(): cm_opts_s += ' -D{0}={1}'.format(k, v.format(hb=hb)) os.system("echo '{0}' | pbcopy".format(cm_opts_s)) print "\nThe following has been copied to the clipboard:\n" print cm_opts_s if __name__ == '__main__': main() sys.exit(0) ================================================ FILE: scripts/qgis2-creator-build.sh ================================================ #!/bin/bash BUILD_DIR="$1" if ! [[ "$BUILD_DIR" = /* ]] || ! [ -d "$BUILD_DIR" ]; then echo "usage: