New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unixODBCDrivers.msodbcsql17: init at 17.2.0.1 #44140
Conversation
ln -s ${lib.makeLibraryPath [openssl]}/libcrypto.so.1.0.0 $out/libshim/libcrypto.so.1.0.2 | ||
cp -r opt/microsoft/msodbcsql${versionMajor}/lib64 opt/microsoft/msodbcsql${versionMajor}/share $out/ | ||
patchelf --set-rpath ${lib.makeLibraryPath [ openssl unixODBC kerberos curl libuuid stdenv.cc.cc]}:$out/libshim \ | ||
$out/lib64/libmsodbcsql-${versionMajor}.${versionMinor}.so.${versionAdditional} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried autoPatchelfHook
? It might simplify future maintenance of this package: ea5787a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically it tries to match libraries from buildInputs
with required libraries in the package. It automatically handle transitive dependencies which means that the buildInputs
list get smaller as only direct dependencies needs to be specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The openssl
symlink could be added to $out/lib
so it will be found by the hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip! autoPatchelfHook
works quite nicely.
@GrahamcOfBorg build unixODBCDrivers.msodbcsql17 |
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: unixODBCDrivers.msodbcsql17 Partial log (click to expand)
|
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: unixODBCDrivers.msodbcsql17 Partial log (click to expand)
|
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: unixODBCDrivers.msodbcsql17 Partial log (click to expand)
|
installPhase = '' | ||
mkdir -p $out | ||
mkdir -p $out/lib | ||
ln -s ${lib.makeLibraryPath [openssl]}/libssl.so.1.0.0 $out/lib/libssl.so.1.0.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably not what you want. I think you want to do:
ln -s ${lib.getLib openssl}/lib/libssl.so.1.0.0 $out/lib/libssl.so.1.0.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. That makes sense.
Motivation for this change
This patch adds Microsoft's ODBC driver for SQL Server. I have tested it on NixOS against SQL Server 2008 and it has worked quite reliably in that scenario.
I'm new to packaging binaries with Nix and would appreciate feedback. The 'libshim' symlinks in particular I'm not sure about -- the driver is linked against specific names of libssl and libcrypto and I couldn't find another way to provide or fake those names.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)