Updating wings and dependencies to match erlang

I updated the erlang esdl lib, added the erlang cl lib,
added opencl-headers and ocl-icd to make wings build and run.

I have not tested its opencl part; I only added dependencies so
it builds.
This commit is contained in:
Lluís Batlle i Rossell 2016-03-29 12:23:12 +02:00
parent e69306c463
commit f6a44bea9e
6 changed files with 108 additions and 18 deletions

View File

@ -1,29 +1,34 @@
{ fetchurl, stdenv, erlang, esdl }:
{ fetchurl, stdenv, erlang, esdl, cl }:
stdenv.mkDerivation rec {
name = "wings-1.4.1";
name = "wings-1.5.4";
src = fetchurl {
url = "mirror://sourceforge/wings/${name}.tar.bz2";
sha256 = "16kqy92rapmbvkc58mc50cidp1pm8nlwlwx69riyadc9w4qs9bji";
sha256 = "0qz6rmmkqgk3p0d3v2ikkf22n511bq0m7xp3kkradwrp28fcl15x";
};
ERL_LIBS = "${esdl}/lib/erlang/addons";
ERL_LIBS = "${esdl}/lib/erlang/lib:${cl}/lib/erlang/lib";
patchPhase = ''
sed -i 's,include("sdl_keyboard.hrl"),include_lib("esdl/include/sdl_keyboard.hrl"),' \
src/wings_body.erl plugins_src/commands/wpc_constraints.erl
# Fix reference
sed -i 's,wings/e3d/,,' plugins_src/import_export/wpc_lwo.erl
'';
buildInputs = [ erlang esdl ];
buildInputs = [ erlang esdl cl ];
# I did not test the *cl* part. I added the -pa just by imitation.
installPhase = ''
mkdir -p $out/bin $out/lib/${name}/ebin
cp ebin/* $out/lib/${name}/ebin
cp -R fonts textures shaders plugins $out/lib/$name
cat << EOF > $out/bin/wings
#!/bin/sh
export ROOTDIR=$out/lib/erlang/addons/${name}
${erlang}/bin/erl -smp disable -pa ${esdl}/lib/erlang/addons/${esdl.name}/ebin \
${erlang}/bin/erl -smp disable \
-pa ${esdl}/lib/erlang/lib/${cl.name}/ebin \
-pa ${esdl}/lib/erlang/lib/${esdl.name}/ebin \
-pa $out/lib/${name}/ebin -run wings_start start_halt "$@"
EOF
chmod +x $out/bin/wings

View File

@ -0,0 +1,33 @@
{stdenv, fetchurl, SDL, mesa, rebar, erlang, opencl-headers, ocl-icd }:
stdenv.mkDerivation rec {
version = "1.2.1";
name = "cl-${version}";
src = fetchurl {
url = "https://github.com/tonyrog/cl/archive/${name}.tar.gz";
sha256 = "03jv280h9gqqqkm0mmkjr53srd2mzhvyy1biss77wpjrzq2z12c8";
};
buildInputs = [ erlang rebar opencl-headers ocl-icd ];
#propagatedBuildInputs = [ SDL mesa ];
buildPhase = ''
sed 's/git/"${version}"/' -i src/cl.app.src
rebar compile
'';
# 'cp' line taken from Arch recipe
# https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/erlang-sdl
installPhase = ''
DIR=$out/lib/erlang/lib/${name}
mkdir -p $DIR
cp -ruv c_src doc ebin include priv src $DIR
'';
meta = {
homepage = https://github.com/tonyrog/cl;
description = "OpenCL binding for Erlang";
license = stdenv.lib.licences.mit;
};
}

View File

@ -1,18 +1,26 @@
{stdenv, fetchurl, SDL, mesa, erlang}:
{stdenv, fetchurl, SDL, mesa, rebar, erlang}:
stdenv.mkDerivation rec {
name = "esdl-1.0.1";
name = "esdl-1.3.1";
src = fetchurl {
url = "mirror://sourceforge/esdl/${name}.src.tar.gz";
sha256 = "0zc7cmr44v10sb593dismdm5qc2v7sm3z9yh22g4r9g6asbg5z0n";
url = "mirror://sourceforge/esdl/${name}.src.tgz";
sha256 = "0f5ad519600qarsa2anmnaxh6b7djzx1dnwxzi4l36pxsq896y01";
};
buildInputs = [ erlang ];
buildInputs = [ erlang rebar ];
propagatedBuildInputs = [ SDL mesa ];
preBuild = ''
export makeFlags="INSTALLDIR=$out/lib/erlang/addons/${name}";
buildPhase = ''
rebar compile
'';
# 'cp' line taken from Arch recipe
# https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/erlang-sdl
installPhase = ''
DIR=$out/lib/erlang/lib/${name}
mkdir -p $DIR
cp -ruv c_src doc ebin include priv src $DIR
'';
meta = {

View File

@ -0,0 +1,18 @@
{stdenv, fetchurl, ruby }:
stdenv.mkDerivation rec {
name = "ocl-icd-2.2.9";
src = fetchurl {
url = "https://forge.imag.fr/frs/download.php/716/${name}.tar.gz";
sha256 = "1rgaixwnxmrq2aq4kcdvs0yx7i6krakarya9vqs7qwsv5hzc32hc";
};
buildInputs = [ ruby ];
meta = with stdenv.lib; {
description = "OpenCL ICD Loader";
homepage = https://forge.imag.fr/projects/ocl-icd/;
license = licenses.bsd2;
};
}

View File

@ -0,0 +1,23 @@
{ stdenv, fetchFromGitHub, cmake }:
stdenv.mkDerivation rec {
name = "opencl-headers-2.1.0";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "OpenCL-Headers";
rev = "c1770dcc6cf1daadec1905e7393f3691c1dde200";
sha256 = "0m9fkblqja0686i2jjqiszvq3df95gp01a2674xknlmkd6525rck";
};
installPhase = ''
mkdir -p $out/include/CL
cp * $out/include/CL
'';
meta = with stdenv.lib; {
description = "Khronos OpenCL headers";
homepage = https://www.khronos.org/registry/cl/;
license = licenses.mit;
};
}

View File

@ -6432,6 +6432,8 @@ in
stdenv = overrideInStdenv stdenv [gnumake380];
};
cl = callPackage ../development/libraries/cl { };
clanlib = callPackage ../development/libraries/clanlib { };
classads = callPackage ../development/libraries/classads { };
@ -8217,6 +8219,8 @@ in
nvidia-texture-tools = callPackage ../development/libraries/nvidia-texture-tools { };
ocl-icd = callPackage ../development/libraries/ocl-icd { };
ode = callPackage ../development/libraries/ode { };
ogre = callPackage ../development/libraries/ogre {};
@ -8244,6 +8248,8 @@ in
opencascade_oce = callPackage ../development/libraries/opencascade/oce.nix { };
opencl-headers = callPackage ../development/libraries/opencl-headers { };
opencollada = callPackage ../development/libraries/opencollada { };
opencsg = callPackage ../development/libraries/opencsg { };
@ -14133,10 +14139,7 @@ in
winswitch = callPackage ../tools/X11/winswitch { };
wings = callPackage ../applications/graphics/wings {
erlang = erlangR14;
esdl = esdl.override { erlang = erlangR14; };
};
wings = callPackage ../applications/graphics/wings { };
wmname = callPackage ../applications/misc/wmname { };