linux_xanmod: 5.11.14 -> 5.11.15
[NixPkgs.git] / pkgs / development / python-modules / skein / skeinrepo.nix
blobd7bdef56ebe38eeb3cabe4280cb45e24751530c7
1 { autoPatchelfHook, lib, maven, stdenv, src, version }:
3 stdenv.mkDerivation rec {
4   name = "skein-${version}-maven-repo";
6   inherit src;
8   nativeBuildInputs = [ maven ] ++ lib.optional stdenv.isLinux autoPatchelfHook;
10   installPhase = ''
11     mkdir -p $out
13     archs="${
14       if stdenv.isLinux
15       then "linux-x86_32 linux-x86_64"
16       else "osx-x86_64"
17     }"
19     for arch in $archs
20     do
21       mvn -Dmaven.repo.local=$out dependency:get -Dartifact=com.google.protobuf:protoc:3.0.0:exe:$arch
22       mvn -Dmaven.repo.local=$out dependency:get -Dartifact=io.grpc:protoc-gen-grpc-java:1.16.0:exe:$arch
23     done
25     if ${ lib.boolToString stdenv.isLinux }
26     then
27       autoPatchelf $out
28     fi
30     # We have to use maven package here as dependency:go-offline doesn't
31     # fetch every required jar.
32     mvn -f java/pom.xml -Dmaven.repo.local=$out package
34     rm $(find $out -name _remote.repositories)
35     rm $(find $out -name resolver-status.properties)
36   '';
38   outputHashMode = "recursive";
39   outputHashAlgo = "sha256";
40   outputHash = if stdenv.isLinux
41     then "12f0q3444qw6y4f6qsa9540a0fz4cgi844zzi8z1phqn3k4dnl6v"
42     else "0bjbwiv17cary1isxca0m2hsvgs1i5fh18z247h1hky73lnhbrz8";
44 } // lib.optionalAttrs stdenv.isLinux { dontAutoPatchelf = true; }