at 23.11-beta 53 lines 1.6 kB view raw
1{ lib, stdenv, fetchurl, unzip 2# If jdk is null, require JAVA_HOME in runtime environment, else store 3# JAVA_HOME=${jdk.home} into grails. 4, jdk ? null 5, coreutils, ncurses, gnused, gnugrep # for purity 6}: 7 8let 9 binpath = lib.makeBinPath 10 ([ coreutils ncurses gnused gnugrep ] ++ lib.optional (jdk != null) jdk); 11in 12stdenv.mkDerivation rec { 13 pname = "grails"; 14 version = "6.1.0"; 15 16 src = fetchurl { 17 url = "https://github.com/grails/grails-core/releases/download/v${version}/grails-${version}.zip"; 18 sha256 = "sha256-v+AAIDWRAgBXmhX2BecEio4s5dVA77K+YycZY1k9uvg="; 19 }; 20 21 nativeBuildInputs = [ unzip ]; 22 23 dontBuild = true; 24 25 installPhase = '' 26 mkdir -p "$out" 27 cp -vr . "$out" 28 # Remove (for now) uneeded Windows .bat files 29 rm -f "$out"/bin/*.bat 30 # Improve purity 31 sed -i -e '2iPATH=${binpath}:\$PATH' "$out"/bin/grails 32 '' + lib.optionalString (jdk != null) '' 33 # Inject JDK path into grails 34 sed -i -e '2iJAVA_HOME=${jdk.home}' "$out"/bin/grails 35 ''; 36 37 preferLocalBuild = true; 38 39 meta = with lib; { 40 description = "Full stack, web application framework for the JVM"; 41 longDescription = '' 42 Grails is an Open Source, full stack, web application framework for the 43 JVM. It takes advantage of the Groovy programming language and convention 44 over configuration to provide a productive and stream-lined development 45 experience. 46 ''; 47 homepage = "https://grails.org/"; 48 license = licenses.asl20; 49 sourceProvenance = with sourceTypes; [ binaryBytecode ]; 50 platforms = platforms.linux; 51 maintainers = [ maintainers.bjornfor ]; 52 }; 53}