9 , gsettings-desktop-schemas
15 src = fetchFromGitHub {
16 owner = "mucommander";
19 sha256 = "sha256-rSHHv96L2EHQuKBSAdpfi1XGP2u9o2y4g1+65FHWFMw=";
23 # there is no .git anyway
24 substituteInPlace build.gradle \
25 --replace "git = grgit.open(dir: project.rootDir)" "" \
26 --replace "id 'org.ajoberstar.grgit' version '3.1.1'" "" \
27 --replace "revision = git.head().id" "revision = '${version}'"
30 # fake build to pre-download deps into fixed-output derivation
31 deps = stdenv.mkDerivation {
32 pname = "mucommander-deps";
33 inherit version src postPatch;
34 nativeBuildInputs = [ gradle_7 perl ];
36 export GRADLE_USER_HOME=$(mktemp -d)
37 gradle --no-daemon tgz
39 # perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar)
40 # reproducible by sorting
42 find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
44 | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
46 # copy maven-metadata.xml for commons-codec
47 # thankfully there is only one xml
48 cp $GRADLE_USER_HOME/caches/modules-2/resources-2.1/*/*/maven-metadata.xml $out/commons-codec/commons-codec/maven-metadata.xml
50 outputHashAlgo = "sha256";
51 outputHashMode = "recursive";
52 outputHash = "sha256-9tCcUg7hDNbkZiQEWtVRsUUfms73aU+vt5tQsfknM+E=";
56 stdenv.mkDerivation rec {
57 pname = "mucommander";
58 inherit version src postPatch;
59 nativeBuildInputs = [ gradle_7 perl makeWrapper ];
61 # Point to our local deps repo
62 gradleInit = writeText "init.gradle" ''
63 logger.lifecycle 'Replacing Maven repositories with ${deps}...'
64 gradle.projectsLoaded {
65 rootProject.allprojects {
69 maven { url '${deps}' }
74 maven { url '${deps}' }
78 settingsEvaluated { settings ->
79 settings.pluginManagement {
81 maven { url '${deps}' }
88 export GRADLE_USER_HOME=$(mktemp -d)
90 gradle --offline --init-script ${gradleInit} --no-daemon tgz
94 mkdir -p $out/share/mucommander
95 tar xvf build/distributions/mucommander-*.tgz --directory=$out/share/mucommander
97 makeWrapper $out/share/mucommander/mucommander.sh $out/bin/mucommander \
98 --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name} \
99 --set JAVA_HOME ${jdk}
103 homepage = "https://www.mucommander.com/";
104 description = "Cross-platform file manager";
105 license = licenses.gpl3;
106 maintainers = with maintainers; [ jiegec ];
107 platforms = platforms.all;
108 mainProgram = "mucommander";