cplex: fix oplide

This commit is contained in:
Marco Rebhan
2024-12-06 18:53:09 +01:00
parent 7c3295abd5
commit 2df4affe41
@@ -1,4 +1,4 @@
{ lib, stdenv, autoPatchelfHook, makeDesktopItem, copyDesktopItems, makeWrapper, alsa-lib, openjdk, sqlite, unixODBC, gtk2, xorg, glibcLocales, releasePath ? null }:
{ lib, stdenv, autoPatchelfHook, makeDesktopItem, copyDesktopItems, makeWrapper, alsa-lib, glib, glib-networking, gsettings-desktop-schemas, gtk3, libsecret, openjdk, sqlite, unixODBC, gtk2, xorg, glibcLocales, releasePath ? null }:
# To use this package, you need to download your own cplex installer from IBM
# and override the releasePath attribute to point to the location of the file.
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
releasePath;
nativeBuildInputs = [ autoPatchelfHook copyDesktopItems makeWrapper openjdk ];
buildInputs = [ alsa-lib gtk2 sqlite unixODBC xorg.libXtst glibcLocales ];
buildInputs = [ alsa-lib gsettings-desktop-schemas gtk2 sqlite unixODBC xorg.libXtst glibcLocales ];
unpackPhase = "cp $src $name";
@@ -44,7 +44,9 @@ stdenv.mkDerivation rec {
runHook postBuild
'';
installPhase = ''
installPhase = let
libraryPath = lib.makeLibraryPath [ stdenv.cc.cc glib gtk2 gtk3 libsecret xorg.libXtst ];
in ''
runHook preInstall
mkdir -p $out/bin
@@ -56,8 +58,19 @@ stdenv.mkDerivation rec {
$out/cplex/bin/x86-64_linux/cplex \
$out/cpoptimizer/bin/x86-64_linux/cpoptimizer
do
makeWrapper "$pgm" "$out/bin/$(basename "$pgm")" \
makeWrapperArgs=(
--set-default LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive
)
if [[ "$pgm" = "$out/opl/oplide/oplide" ]]; then
makeWrapperArgs+=(
--prefix LD_LIBRARY_PATH : ${libraryPath}
--prefix GIO_EXTRA_MODULES : "${glib-networking}/lib/gio/modules"
--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
)
fi
makeWrapper "$pgm" "$out/bin/$(basename "$pgm")" "''${makeWrapperArgs[@]}"
done
mkdir -p $out/share/pixmaps