2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl, ant, jdk, junit }:
|
2014-01-25 01:28:19 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "junixsocket-1.3";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2017-10-27 00:44:19 +01:00
|
|
|
url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/junixsocket/${name}-src.tar.bz2";
|
2014-01-25 01:28:19 +00:00
|
|
|
sha256 = "0c6p8vmiv5nk8i6g1hgivnl3mpb2k3lhjjz0ss9dlirisfrxf1ym";
|
|
|
|
};
|
|
|
|
|
2014-01-28 10:56:14 +00:00
|
|
|
patches = [ ./darwin.patch ];
|
|
|
|
|
2014-01-25 01:28:19 +00:00
|
|
|
buildInputs = [ ant jdk junit ];
|
|
|
|
|
|
|
|
preConfigure =
|
|
|
|
''
|
2014-01-27 12:51:22 +00:00
|
|
|
substituteInPlace src/main/org/newsclub/net/unix/NativeUnixSocketConfig.java \
|
|
|
|
--replace /opt/newsclub/lib-native $out/lib
|
2014-01-25 01:28:19 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = "ant";
|
|
|
|
|
|
|
|
ANT_ARGS =
|
2014-01-28 10:56:14 +00:00
|
|
|
# Note that our OpenJDK on Darwin is currently 32-bit, so we have to build a 32-bit dylib.
|
2014-07-15 10:17:51 +01:00
|
|
|
(if stdenv.is64bit then [ "-Dskip32=true" ] else [ "-Dskip64=true" ])
|
2021-02-16 11:48:46 +00:00
|
|
|
++ [ "-Dgcc=${stdenv.cc.targetPrefix}cc" "-Dant.build.javac.source=1.6" ]
|
2021-01-21 17:00:13 +00:00
|
|
|
++ lib.optional stdenv.isDarwin "-DisMac=true";
|
2014-01-25 01:28:19 +00:00
|
|
|
|
|
|
|
installPhase =
|
|
|
|
''
|
|
|
|
mkdir -p $out/share/java $out/lib
|
|
|
|
cp -v dist/*.jar $out/share/java
|
|
|
|
cp -v lib-native/*.so lib-native/*.dylib $out/lib/
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A Java/JNI library for using Unix Domain Sockets from Java";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/kohlschutter/junixsocket";
|
2021-01-21 17:00:13 +00:00
|
|
|
license = lib.licenses.asl20;
|
2021-01-23 17:15:07 +00:00
|
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
2014-01-25 01:28:19 +00:00
|
|
|
};
|
|
|
|
}
|