factor-lang: fix libGL when the OS uses non-mesa

I was careful to keep libGLU in LD_LIBRARY_PATH,
in the unlikely case that it's actually used.
Reported in https://github.com/NixOS/nixpkgs/issues/30749#issuecomment-341987725
This commit is contained in:
Vladimír Čunát 2017-11-05 18:42:20 +01:00
parent 4f8b980355
commit 0610584998
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA

View file

@ -1,7 +1,7 @@
{ stdenv, fetchurl, fetchFromGitHub, glib, glibc, git, { stdenv, fetchurl, fetchFromGitHub, glib, glibc, git,
rlwrap, curl, pkgconfig, perl, makeWrapper, tzdata, ncurses, rlwrap, curl, pkgconfig, perl, makeWrapper, tzdata, ncurses,
libX11, pango, cairo, gtk2, gdk_pixbuf, gtkglext, libX11, pango, cairo, gtk2, gdk_pixbuf, gtkglext,
mesa, libXmu, libXt, libICE, libSM }: mesa_glu, libXmu, libXt, libICE, libSM }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "factor-lang-${version}"; name = "factor-lang-${version}";
@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig ];
buildInputs = [ git rlwrap curl perl makeWrapper buildInputs = [ git rlwrap curl perl makeWrapper
libX11 pango cairo gtk2 gdk_pixbuf gtkglext libX11 pango cairo gtk2 gdk_pixbuf gtkglext
mesa libXmu libXt libICE libSM ]; mesa_glu libXmu libXt libICE libSM ];
buildPhase = '' buildPhase = ''
make $(bash ./build-support/factor.sh make-target) GIT_LABEL=heads/master-${rev} make $(bash ./build-support/factor.sh make-target) GIT_LABEL=heads/master-${rev}
@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
# to be a generic solution here. # to be a generic solution here.
find $(echo ${stdenv.lib.makeLibraryPath [ find $(echo ${stdenv.lib.makeLibraryPath [
glib libX11 pango cairo gtk2 gdk_pixbuf gtkglext glib libX11 pango cairo gtk2 gdk_pixbuf gtkglext
mesa libXmu libXt libICE libSM ]} | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst mesa_glu libXmu libXt libICE libSM ]} | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst
(echo $(cat $TMPDIR/so.lst | wc -l) "libs found in cache \`/etc/ld.so.cache'"; (echo $(cat $TMPDIR/so.lst | wc -l) "libs found in cache \`/etc/ld.so.cache'";
for l in $(<$TMPDIR/so.lst); for l in $(<$TMPDIR/so.lst);
@ -72,7 +72,7 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/factor --prefix LD_LIBRARY_PATH : \ wrapProgram $out/bin/factor --prefix LD_LIBRARY_PATH : \
"${stdenv.lib.makeLibraryPath [ glib "${stdenv.lib.makeLibraryPath [ glib
libX11 pango cairo gtk2 gdk_pixbuf gtkglext libX11 pango cairo gtk2 gdk_pixbuf gtkglext
mesa libXmu libXt libICE libSM ]}" mesa_glu libXmu libXt libICE libSM ]}"
sed -ie 's#/bin/.factor-wrapped#/lib/factor/factor#g' $out/bin/factor sed -ie 's#/bin/.factor-wrapped#/lib/factor/factor#g' $out/bin/factor
mv $out/bin/.factor-wrapped $out/lib/factor/factor mv $out/bin/.factor-wrapped $out/lib/factor/factor