2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
|
2020-12-17 21:53:35 +00:00
|
|
|
, OpenGL
|
2017-06-28 15:48:13 +00:00
|
|
|
}:
|
2010-02-05 22:00:51 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
with lib;
|
2014-02-24 04:46:04 +00:00
|
|
|
|
2012-01-26 18:04:02 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-06-22 13:21:29 +00:00
|
|
|
pname = "glew";
|
|
|
|
version = "2.2.0";
|
2008-01-16 02:20:46 +00:00
|
|
|
|
2008-01-30 17:20:48 +00:00
|
|
|
src = fetchurl {
|
2021-06-22 13:21:29 +00:00
|
|
|
url = "mirror://sourceforge/glew/${pname}-${version}.tgz";
|
2020-04-05 16:16:00 +00:00
|
|
|
sha256 = "1qak8f7g1iswgswrgkzc7idk7jmqgwrs58fhg2ai007v7j4q5z6l";
|
2008-01-16 02:20:46 +00:00
|
|
|
};
|
|
|
|
|
2016-09-01 15:23:31 +00:00
|
|
|
outputs = [ "bin" "out" "dev" "doc" ];
|
|
|
|
|
2020-12-17 21:53:35 +00:00
|
|
|
buildInputs = optionals (!stdenv.isDarwin) [ xlibsWrapper libXmu libXi ];
|
|
|
|
propagatedBuildInputs = if stdenv.isDarwin then [ OpenGL ] else [ libGLU ]; # GL/glew.h includes GL/glu.h
|
2008-01-16 02:20:46 +00:00
|
|
|
|
2013-06-09 00:33:34 +00:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i 's|lib64|lib|' config/Makefile.linux
|
2017-11-27 15:57:50 +00:00
|
|
|
substituteInPlace config/Makefile.darwin --replace /usr/local "$out"
|
2018-08-20 18:43:41 +00:00
|
|
|
${optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
2017-11-27 15:57:50 +00:00
|
|
|
sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
|
2014-03-10 21:22:21 +00:00
|
|
|
''}
|
2013-06-09 00:33:34 +00:00
|
|
|
'';
|
|
|
|
|
2014-02-24 04:46:04 +00:00
|
|
|
buildFlags = [ "all" ];
|
|
|
|
installFlags = [ "install.all" ];
|
|
|
|
|
|
|
|
preInstall = ''
|
2016-09-01 15:23:31 +00:00
|
|
|
makeFlagsArray+=(GLEW_DEST=$out BINDIR=$bin/bin INCDIR=$dev/include/GL)
|
2013-06-09 00:33:34 +00:00
|
|
|
'';
|
|
|
|
|
2014-02-24 04:46:04 +00:00
|
|
|
postInstall = ''
|
2013-05-18 07:31:02 +00:00
|
|
|
mkdir -pv $out/share/doc/glew
|
|
|
|
mkdir -p $out/lib/pkgconfig
|
|
|
|
cp glew*.pc $out/lib/pkgconfig
|
2016-11-25 22:37:15 +00:00
|
|
|
cp -r README.md LICENSE.txt doc $out/share/doc/glew
|
2016-09-01 15:23:31 +00:00
|
|
|
rm $out/lib/*.a
|
2013-05-18 07:31:02 +00:00
|
|
|
'';
|
|
|
|
|
2017-06-23 21:45:27 +00:00
|
|
|
makeFlags = [
|
2018-08-20 18:43:41 +00:00
|
|
|
"SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
|
2021-08-18 20:00:19 +00:00
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"LD=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"AR=${stdenv.cc.targetPrefix}ar"
|
2017-06-28 15:48:13 +00:00
|
|
|
];
|
2014-02-24 04:46:04 +00:00
|
|
|
|
2017-11-27 15:57:50 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2013-05-18 07:31:02 +00:00
|
|
|
description = "An OpenGL extension loading library for C(++)";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://glew.sourceforge.net/";
|
2014-08-21 19:15:32 +00:00
|
|
|
license = licenses.free; # different files under different licenses
|
|
|
|
#["BSD" "GLX" "SGI-B" "GPL2"]
|
|
|
|
platforms = platforms.mesaPlatforms;
|
2008-01-16 02:20:46 +00:00
|
|
|
};
|
|
|
|
}
|