2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchgit, ant, jdk8, git, xorg, udev, libGL, libGLU }:
|
2018-03-19 03:33:13 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
jogl_2_3_2 =
|
|
|
|
let
|
|
|
|
version = "2.3.2";
|
|
|
|
|
|
|
|
gluegen-src = fetchgit {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "git://jogamp.org/srv/scm/gluegen.git";
|
2018-03-19 03:33:13 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "00hybisjwqs88p24dds652bzrwbbmhn2dpx56kp4j6xpadkp33d0";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2019-08-13 21:52:01 +00:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "jogl";
|
|
|
|
inherit version;
|
2018-03-19 03:33:13 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "git://jogamp.org/srv/scm/jogl.git";
|
2018-03-19 03:33:13 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0msi2gxiqm2yqwkmxqbh521xdrimw1fly20g890r357rcgj8fsn3";
|
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2018-06-10 15:09:19 +00:00
|
|
|
postPatch = ''
|
|
|
|
find . -type f -name '*.java' \
|
|
|
|
-exec sed -i 's@"libGL.so"@"${libGL}/lib/libGL.so"@' {} \; \
|
|
|
|
-exec sed -i 's@"libGLU.so"@"${libGLU}/lib/libGLU.so"@' {} \;
|
|
|
|
'';
|
|
|
|
|
2020-09-19 13:36:35 +00:00
|
|
|
# TODO: upgrade to jdk https://github.com/NixOS/nixpkgs/pull/89731
|
|
|
|
nativeBuildInputs = [ jdk8 ant git ];
|
2019-09-15 19:00:15 +00:00
|
|
|
buildInputs = [ udev xorg.libX11 xorg.libXrandr xorg.libXcursor xorg.libXt xorg.libXxf86vm xorg.libXrender ];
|
2018-03-19 03:33:13 +00:00
|
|
|
|
2022-06-03 11:59:15 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains:
|
|
|
|
# ld: ../obj/Bindingtest1p1Impl_JNI.o:(.bss+0x8): multiple definition of
|
|
|
|
# `unsigned_size_t_1'; ../obj/TK_Surface_JNI.o:(.bss+0x8): first defined here
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-06-03 11:59:15 +00:00
|
|
|
|
2018-03-19 03:33:13 +00:00
|
|
|
buildPhase = ''
|
|
|
|
cp -r ${gluegen-src} $NIX_BUILD_TOP/gluegen
|
|
|
|
chmod -R +w $NIX_BUILD_TOP/gluegen
|
|
|
|
( cd ../gluegen/make
|
|
|
|
ant )
|
|
|
|
|
|
|
|
( cd make
|
|
|
|
|
|
|
|
# force way to do disfunctional "ant -Dsetup.addNativeBroadcom=false" and disable dependency on raspberrypi drivers
|
|
|
|
# if arm/aarch64 support will be added, this block might be commented out on those platforms
|
|
|
|
# on x86 compiling with default "setup.addNativeBroadcom=true" leads to unsatisfied import "vc_dispmanx_resource_delete" in libnewt.so
|
|
|
|
cp build-newt.xml build-newt.xml.old
|
|
|
|
fgrep -v 'if="setup.addNativeBroadcom"' build-newt.xml.old > build-newt.xml
|
|
|
|
|
|
|
|
ant )
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/java
|
|
|
|
cp $NIX_BUILD_TOP/gluegen/build/gluegen-rt{,-natives-linux-amd64}.jar $out/share/java/
|
|
|
|
cp $NIX_BUILD_TOP/jogl/build/jar/jogl-all{,-natives-linux-amd64}.jar $out/share/java/
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-03-19 03:33:13 +00:00
|
|
|
description = "Java libraries for 3D Graphics, Multimedia and Processing";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://jogamp.org/";
|
2018-03-19 03:33:13 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|