tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
jffi: clean up and make deterministic
TomaSajt
2 years ago
e48ef08d
0c14ba3f
+47
-21
1 changed file
expand all
collapse all
unified
split
pkgs
development
libraries
java
jffi
default.nix
+47
-21
pkgs/development/libraries/java/jffi/default.nix
···
1
1
-
{ lib, stdenv, fetchFromGitHub, jdk, jre, ant, libffi, texinfo, pkg-config }:
1
1
+
{ lib
2
2
+
, stdenv
3
3
+
, fetchFromGitHub
4
4
+
, ant
5
5
+
, jdk
6
6
+
, libffi
7
7
+
, pkg-config
8
8
+
, texinfo
9
9
+
, stripJavaArchivesHook
10
10
+
}:
2
11
3
3
-
stdenv.mkDerivation rec {
12
12
+
stdenv.mkDerivation (finalAttrs: {
4
13
pname = "jffi";
5
14
version = "1.3.13";
6
15
7
16
src = fetchFromGitHub {
8
17
owner = "jnr";
9
18
repo = "jffi";
10
10
-
rev = "jffi-${version}";
11
11
-
sha256 = "sha256-aBQkkZyXZkaJc4sr/jHnIRaJYP116u4Jqsr9XXzfOBA=";
19
19
+
rev = "jffi-${finalAttrs.version}";
20
20
+
hash = "sha256-aBQkkZyXZkaJc4sr/jHnIRaJYP116u4Jqsr9XXzfOBA=";
12
21
};
13
22
14
14
-
nativeBuildInputs = [ jdk ant texinfo pkg-config ];
15
15
-
buildInputs = [ libffi ] ;
23
23
+
nativeBuildInputs = [
24
24
+
ant
25
25
+
jdk
26
26
+
pkg-config
27
27
+
texinfo
28
28
+
stripJavaArchivesHook
29
29
+
];
16
30
17
17
-
buildPhase = ''
18
18
-
# The pkg-config script in the build.xml doesn't work propery
19
19
-
# set the lib path manually to work around this.
20
20
-
export LIBFFI_LIBS="${libffi}/lib/libffi.so"
31
31
+
buildInputs = [ libffi ];
21
32
22
22
-
ant -Duse.system.libffi=1 jar
23
23
-
ant -Duse.system.libffi=1 archive-platform-jar
24
24
-
'';
33
33
+
# The pkg-config script in the build.xml doesn't work propery
34
34
+
# set the lib path manually to work around this.
35
35
+
env.LIBFFI_LIBS = "${libffi}/lib/libffi${stdenv.hostPlatform.extensions.sharedLibrary}";
36
36
+
env.ANT_ARGS = "-Duse.system.libffi=1";
25
37
26
26
-
installPhase = ''
27
27
-
mkdir -p $out/share/java
28
28
-
cp -r dist/* $out/share/java
38
38
+
buildPhase = ''
39
39
+
runHook preBuild
40
40
+
ant jar
41
41
+
ant archive-platform-jar
42
42
+
runHook postBuild
29
43
'';
30
44
31
45
doCheck = true;
46
46
+
32
47
checkPhase = ''
33
33
-
# The pkg-config script in the build.xml doesn't work propery
34
34
-
# set the lib path manually to work around this.
35
35
-
export LIBFFI_LIBS="${libffi}/lib/libffi.so"
48
48
+
runHook preCheck
49
49
+
ant test
50
50
+
runHook postCheck
51
51
+
'';
52
52
+
53
53
+
installPhase = ''
54
54
+
runHook preInstall
55
55
+
install -Dm644 dist/*.jar -t $out/share/java
56
56
+
runHook postInstall
57
57
+
'';
36
58
37
37
-
ant -Duse.system.libffi=1 test
59
59
+
# nix can't detect libffi as a dependency inside the jar file, so we create
60
60
+
# a dummy file with the path to libffi, to make sure that nix knows about it
61
61
+
postFixup = ''
62
62
+
mkdir -p $out/nix-support
63
63
+
echo ${libffi} > $out/nix-support/depends
38
64
'';
39
65
40
66
meta = with lib; {
···
45
71
license = licenses.asl20;
46
72
maintainers = with maintainers; [ bachp ];
47
73
};
48
48
-
}
74
74
+
})