Not a traditional job, but a small bounty.
A friend gave me access to his database(Progress OpenEdge) through odbc.
But I’m unable to package it in nix.
I looked at the other archive, it ships a 11MB binary script that tries to figure out your entire system to install its requirement. That looks really difficult to package for nixos …
** (MatchError) no match of right hand side value: {:error, ~c"[unixODBC][Driver Manager]Can't open lib '/persist/progress/d/odbc/lib/libodbc.so' : file not found SQLSTATE IS: 01000 Connection to database failed."}
I guess it needs to be packaged and added to unixodbc?
** (MatchError) no match of right hand side value: {:error, ~c"[unixODBC][Driver Manager]Can't open lib '/nix/store/7pw0fjsayfi4m53nf069b17knq8kbm3c-progress-openedge-odbc-driver-12.2/lib/pgoe27.so' : file not found SQLSTATE IS: 01000 Connection to database failed."}
{
stdenv,
lib,
unixODBC,
openssl,
}:
stdenv.mkDerivation rec {
pname = "progress-openedge-odbc-driver";
version = "12.2";
src = ./progress-odbc.tar.gz;
# Work around the "unpacker appears to have produced no directories"
# case that happens when the archive doesn't have a subdirectory.
sourceRoot = ".";
installPhase = ''
runHook preInstall
mkdir -p $out/lib
cp -r lib/* $out/lib
runHook postInstall
'';
postFixup = ''
echo "---postFixup---"
patchelf --set-rpath ${
lib.makeLibraryPath [
unixODBC
openssl
stdenv.cc.cc
]
} \
$out/lib/pgoe27.so
'';
passthru = {
fancyName = "ProgressOpenedgeDriver";
driver = "lib/pgoe27.so";
};
meta = with lib; {
description = "ODBC driver for Progress OpenEdge";
homepage = "http://progress.com";
license = licenses.unfree;
platforms = platforms.linux;
};
}
{
config,
lib,
pkgs,
...
}:
with lib;
{
config = {
environment.systemPackages = with pkgs; [
unixODBC
pkgs.lun.progress-openedge-odbc-driver
];
environment.unixODBCDrivers = with pkgs; [
unixODBCDrivers.psql
pkgs.lun.progress-openedge-odbc-driver
];
};
}
Assuming the file path named in the ‘file not found’ message does actually exist, it probably needs to be patchelf’d. That’s a frequent cause of mysterious ‘file not found’ messages. I see you’re only patching pgoe27.so; you should probably instead add autoPatchelfHook to the nativeBuildInputs of your derivation, which should seek out and patch all of the libraries in your derivation.
Thank you, I added autoPatchelfhook.
Could add most inputs except for 1.
I think libXm is not in nixpkgs.
> auto-patchelf: 2 dependencies could not be satisfied
> error: auto-patchelf could not satisfy dependency libXm.so.3 wanted by /nix/store/4ygggry27pwq9sl7nz9hyi9zdg5a0df6-progress-openedge-odbc-driver-12.2/lib/vscnctdlg.so
> error: auto-patchelf could not satisfy dependency libXm.so.3 wanted by /nix/store/4ygggry27pwq9sl7nz9hyi9zdg5a0df6-progress-openedge-odbc-driver-12.2/lib/libpgmback.so
I hope this error is because my connection string isn’t according to their standard. I’ll have a look
** (MatchError) no match of right hand side value: {:error, ~c"[DataDirect][ODBC 20101 driver]6015[DataDirect][ODBC 20101 driver]6013 SQLSTATE IS: 60 Connection to database failed."}
(stdlib 6.1.2) erl_eval.erl:652: :erl_eval.expr/6
iex:6: (file)