diff options
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r-- | pkgs/applications/science/electronics/digital/default.nix | 43 | ||||
-rw-r--r-- | pkgs/applications/science/misc/gephi/default.nix | 38 | ||||
-rw-r--r-- | pkgs/applications/science/physics/crystfel/default.nix | 2 |
3 files changed, 19 insertions, 64 deletions
diff --git a/pkgs/applications/science/electronics/digital/default.nix b/pkgs/applications/science/electronics/digital/default.nix index 5f4df4f7cfecf..147e27a835308 100644 --- a/pkgs/applications/science/electronics/digital/default.nix +++ b/pkgs/applications/science/electronics/digital/default.nix @@ -1,5 +1,5 @@ -{ lib, stdenv, fetchFromGitHub, makeDesktopItem, copyDesktopItems, makeWrapper -, jre, maven, git +{ lib, fetchFromGitHub, makeDesktopItem, copyDesktopItems, makeWrapper +, jre, maven }: let @@ -25,54 +25,29 @@ let # provide that version number manually as a property. # (see https://github.com/hneemann/Digital/issues/289#issuecomment-513721481) # Also use the commit date as a build and output timestamp. - mvnOptions = "-Pno-git-rev -Dgit.commit.id.describe=${version} -Dproject.build.outputTimestamp=${buildDate} -DbuildTimestamp=${buildDate}"; + mvnParameters = "-Pno-git-rev -Dgit.commit.id.describe=${version} -Dproject.build.outputTimestamp=${buildDate} -DbuildTimestamp=${buildDate}"; in -stdenv.mkDerivation rec { +maven.buildMavenPackage rec { pname = "digital"; inherit version jre; src = fetchFromGitHub { owner = "hneemann"; repo = "Digital"; - rev = "932791eb6486d04f2ea938d83bcdb71b56d3a3f6"; - sha256 = "cDykYlcFvDLFBy9UnX07iCR2LCq28SNU+h9vRT/AoJM="; + rev = "v${version}"; + hash = "sha256-cDykYlcFvDLFBy9UnX07iCR2LCq28SNU+h9vRT/AoJM="; }; - # Fetching maven dependencies from "central" needs the network at build phase, - # we do that in this extra derivation that explicitly specifies its - # outputHash to ensure determinism. - mavenDeps = stdenv.mkDerivation { - name = "${pname}-${version}-maven-deps"; - inherit src nativeBuildInputs version; - dontFixup = true; - buildPhase = '' - mvn package ${mvnOptions} -Dmaven.repo.local=$out - ''; - # keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with - # lastModified timestamps inside - installPhase = '' - find $out -type f \ - -name \*.lastUpdated -or \ - -name resolver-status.properties -or \ - -name _remote.repositories \ - -delete - ''; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "1Cgw+5V2E/RENMRMm368+2yvY7y6v9gTlo+LRgrCXcE="; - }; + inherit mvnParameters; + mvnHash = "sha256-Ej/JePvd9Ieni8FqSaXBDc2T6Cwr8WP54iko8wYiT68="; nativeBuildInputs = [ copyDesktopItems maven makeWrapper ]; - buildPhase = '' - mvn package --offline ${mvnOptions} -Dmaven.repo.local=${mavenDeps} - ''; - installPhase = '' mkdir -p $out/bin mkdir -p $out/share/java - classpath=$(find ${mavenDeps} -name "*.jar" -printf ':%h/%f'); + classpath=$(find $mvnDeps/.m2 -name "*.jar" -printf ':%h/%f'); install -Dm644 target/Digital.jar $out/share/java makeWrapper ${jre}/bin/java $out/bin/${pname} \ diff --git a/pkgs/applications/science/misc/gephi/default.nix b/pkgs/applications/science/misc/gephi/default.nix index a5bf1a2da2b66..3013f08c69826 100644 --- a/pkgs/applications/science/misc/gephi/default.nix +++ b/pkgs/applications/science/misc/gephi/default.nix @@ -1,6 +1,12 @@ -{ lib, stdenv, fetchFromGitHub, jdk11, maven, javaPackages }: +{ lib, fetchFromGitHub, jdk11, maven, javaPackages }: let + mavenJdk11 = maven.override { + jdk = jdk11; + }; +in +mavenJdk11.buildMavenPackage rec { + pname = "gephi"; version = "0.10.1"; src = fetchFromGitHub { @@ -10,35 +16,9 @@ let hash = "sha256-ZNSEaiD32zFfF2ISKa1CmcT9Nq6r5i2rNHooQAcVbn4="; }; - # perform fake build to make a fixed-output derivation out of the files downloaded from maven central (120MB) - deps = stdenv.mkDerivation { - name = "gephi-${version}-deps"; - inherit src; - buildInputs = [ jdk11 maven ]; - buildPhase = '' - while mvn package -Dmaven.repo.local=$out/.m2 -Dmaven.wagon.rto=5000; [ $? = 1 ]; do - echo "timeout, restart maven to continue downloading" - done - ''; - # keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside - installPhase = ''find $out/.m2 -type f -regex '.+\(\.lastUpdated\|resolver-status\.properties\|_remote\.repositories\)' -delete''; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = "sha256-OdW4M5nGEkYkmHpRLM4cBQtk4SJII2uqM8TXb6y4eXk="; - }; -in -stdenv.mkDerivation { - pname = "gephi"; - inherit version; - - inherit src; + mvnHash = "sha256-/2/Yb26Ry0NHQQ3j0LXnjwC0wQqJiztvTgWixyMJqvg="; - buildInputs = [ jdk11 maven ]; - - buildPhase = '' - # 'maven.repo.local' must be writable so copy it out of nix store - mvn package --offline -Dmaven.repo.local=$(cp -dpR ${deps}/.m2 ./ && chmod +w -R .m2 && pwd)/.m2 - ''; + nativeBuildInputs = [ jdk11 mavenJdk11 ]; installPhase = '' cp -r modules/application/target/gephi $out diff --git a/pkgs/applications/science/physics/crystfel/default.nix b/pkgs/applications/science/physics/crystfel/default.nix index aac1e8c424cec..92b48ec863091 100644 --- a/pkgs/applications/science/physics/crystfel/default.nix +++ b/pkgs/applications/science/physics/crystfel/default.nix @@ -83,7 +83,7 @@ let else fetchurl { url = "https://www.mrc-lmb.cam.ac.uk/mosflm/mosflm/ver${builtins.replaceStrings [ "." ] [ "" ] version}/pre-built/mosflm-linux-64-noX11.zip"; - sha256 = "1rqh3nprxfmnyihllw31nb8i3wfhybmsic6y7z6wn4rafyv3w4fk"; + hash = "sha256:1f2qins5kaz5v6mkaclncqpirx3mlz177ywm13py9p6s9mk99g32"; }; mosflmBinary = if stdenv.isDarwin then "bin/mosflm" else "mosflm-linux-64-noX11"; in |