Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
796
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. { stdenv, jdk11, fetchFromGitHub, gradle, libXtst, libX11, cairo, pango, freetype, gtk3, gtk2, perl, protobuf3_5, writeText }:
  2.  
  3. let
  4. version = "v0.8.0";
  5. name = "bisq-${version}";
  6.  
  7. src = fetchFromGitHub {
  8. owner = "bisq-network";
  9. repo = "bisq";
  10. rev = version;
  11. sha256 = "0kq0f8wxjvvjfn1layvfhc0zf899k7qsph8m0x7wzm31gk1npbfz";
  12. };
  13.  
  14. postPatch = ''
  15. # disable grade native code
  16. # substituteInPlace build.gradle \
  17. # --replace 'artifact = "com.google.protobuf:protoc:$protobufVersion"' "path = '${protobuf3_5}/bin/protoc'"
  18. '';
  19.  
  20. # fake build to pre-download deps into fixed-output derivation
  21. deps = stdenv.mkDerivation {
  22. name = "${name}-deps";
  23. inherit src postPatch;
  24. nativeBuildInputs = [ perl (gradle.override { jdk = jdk11; }) ];
  25. buildPhase = ''
  26. export GRADLE_USER_HOME=$(mktemp -d)
  27. gradle -version
  28. gradle --no-daemon build
  29. '';
  30.  
  31. # Mavenize dependency paths
  32. # e.g. org.codehaus.groovy/groovy/2.4.0/{hash}/groovy-2.4.0.jar -> org/codehaus/groovy/groovy/2.4.0/groovy-2.4.0.jar
  33. installPhase = ''
  34. find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
  35. | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
  36. | sh
  37. '';
  38.  
  39. outputHashAlgo = "sha256";
  40. outputHashMode = "recursive";
  41. outputHash = "10qfw4gqw4gbjwxg7ywf1hd4dv8kg0v75crb2f1p72ss0lra0iw2";
  42. };
  43.  
  44. # Point to our local deps repo
  45. gradleInit = writeText "init.gradle" ''
  46. logger.lifecycle 'Replacing Maven repositories with ${deps}...'
  47.  
  48. gradle.projectsLoaded {
  49. rootProject.allprojects {
  50. buildscript {
  51. repositories {
  52. clear()
  53. maven { url '${deps}' }
  54. }
  55. }
  56. repositories {
  57. clear()
  58. maven { url '${deps}' }
  59. }
  60. }
  61. }
  62. '';
  63.  
  64. in stdenv.mkDerivation {
  65. inherit name src postPatch;
  66.  
  67. buildInputs = [ gradle libXtst cairo pango freetype libX11 gtk3 gtk2];
  68.  
  69. buildPhase = ''
  70. export GRADLE_USER_HOME=$(mktemp -d)
  71. gradle --offline --no-daemon --init-script ${gradleInit} build
  72. '';
  73.  
  74. installPhase = ''
  75. '';
  76.  
  77. meta = with stdenv.lib; {
  78. homepage = https://bisq.network/;
  79. description = "Bisq is an open-source desktop application that allows you to buy and sell bitcoins in exchange for national currencies, or alternative crypto currencies.";
  80. license = licenses.gpl2;
  81. maintainers = with maintainers; [ gavin ];
  82. platforms = [ "x86_64-darwin" "x86_64-linux" "i686-linux" ];
  83. };
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement