PortSystem 1.0 name msodbcsql17 version 17.10.2.1 revision 2 categories databases platforms {darwin any} supported_archs arm64 x86_64 maintainers {jann @roederja} openmaintainer license Restrictive description ODBC Driver for Microsoft(R) SQL Server(R). long_description ODBC Driver for Microsoft(R) SQL Server(R). homepage https://docs.microsoft.com/en-us/sql/connect/odbc/microsoft-odbc-driver-for-sql-server master_sites https://download.microsoft.com/download/1/9/A/19AF548A-6DD3-4B48-88DC-724E9ABCEB9A/ if {${os.arch} eq "i386"} { distname ${name}-${version}-amd64 checksums rmd160 57399db0ecb5b308f555c17d6389b09263f82721 \ sha256 83dc6f02ceb2191e91aab0b547b41364d3961730e5c52566fe75e7351e566918 \ size 839474 set oldprefix /usr/local } else { distname ${name}-${version}-arm64 checksums rmd160 6acec6f2e623f3161758a2da927b1dda0f748c97 \ sha256 bf06df596ef5ed30c6d34f2e0969e964df32fa5dca81955c991d02d8ef600e7a \ size 754996 set oldprefix /opt/homebrew } worksrcdir msodbcsql-${version} depends_run port:unixODBC \ port:openssl use_configure no patch { reinplace "s|${oldprefix}|${prefix}|g" ${worksrcpath}/odbcinst.ini } build { system "install_name_tool -change ${oldprefix}/lib/libodbcinst.2.dylib ${prefix}/lib/libodbcinst.2.dylib ${worksrcpath}/lib/libmsodbcsql.17.dylib" system "install_name_tool -id ${prefix}/lib/libmsodbcsql.17.dylib ${worksrcpath}/lib/libmsodbcsql.17.dylib" } destroot { xinstall -m 444 ${worksrcpath}/lib/libmsodbcsql.17.dylib ${destroot}${prefix}/lib/libmsodbcsql.17.dylib xinstall -d ${destroot}${prefix}/share/msodbcsql17/resources/en_US xinstall -m 444 ${worksrcpath}/share/msodbcsql17/resources/en_US/msodbcsqlr17.rll ${destroot}${prefix}/share/msodbcsql17/resources/en_US/msodbcsqlr17.rll xinstall -m 644 ${worksrcpath}/odbcinst.ini ${destroot}${prefix}/share/msodbcsql17/resources/odbcinst.ini xinstall -d ${destroot}${prefix}/include/msodbcsql17 xinstall -m 644 ${worksrcpath}/include/msodbcsql17/msodbcsql.h ${destroot}${prefix}/include/msodbcsql17/msodbcsql.h xinstall -d ${destroot}${prefix}/share/doc/msodbcsql17 xinstall -m 644 -W ${worksrcpath}/share/doc/msodbcsql17 LICENSE.txt RELEASE_NOTES ${destroot}${prefix}/share/doc/msodbcsql17 } post-activate { system "odbcinst -u -d -n \"ODBC Driver 17 for SQL Server\"" system "odbcinst -i -d -f ${prefix}/share/msodbcsql17/resources/odbcinst.ini" } pre-deactivate { system "odbcinst -u -d -n \"ODBC Driver 17 for SQL Server\"" }