16 src = fetchFromGitHub {
20 hash = "sha256-K3kaujAhWsRQuTMW3SZOnE7Rmu8+tDXaxpLrb45OI4A=";
26 # https://github.com/ma1uta/ma1sd/pull/122
28 name = "java-16-compatibility.patch";
29 url = "https://github.com/ma1uta/ma1sd/commit/be2e2e97ce21741ca6a2e29a06f5748f45dd414e.patch";
30 hash = "sha256-dvCeK/0InNJtUG9CWrsg7BE0FGWtXuHo3TU0iFFUmIk=";
34 deps = stdenv.mkDerivation {
35 pname = "${pname}-deps";
36 inherit src version patches;
37 nativeBuildInputs = [ gradle perl git ];
40 export MA1SD_BUILD_VERSION=${version}
41 export GRADLE_USER_HOME=$(mktemp -d);
42 gradle --no-daemon build -x test
45 # 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)
47 find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
48 | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
54 outputHashAlgo = "sha256";
55 outputHashMode = "recursive";
56 outputHash = "sha256-Px8FLnREBC6pADcEPn/GfhrtGnmZqjXIX7l1xPjiCvQ=";
61 inherit pname src version patches;
62 nativeBuildInputs = [ gradle perl makeWrapper ];
63 buildInputs = [ jre ];
66 substituteInPlace build.gradle \
67 --replace 'gradlePluginPortal()' "" \
68 --replace 'mavenCentral()' "mavenLocal(); maven { url '${deps}' }"
73 export MA1SD_BUILD_VERSION=${version}
74 export GRADLE_USER_HOME=$(mktemp -d)
76 gradle --offline --no-daemon build -x test
82 install -D build/libs/source.jar $out/lib/ma1sd.jar
83 makeWrapper ${jre}/bin/java $out/bin/ma1sd --add-flags "-jar $out/lib/ma1sd.jar"
88 description = "a federated matrix identity server; fork of mxisd";
89 homepage = "https://github.com/ma1uta/ma1sd";
90 changelog = "https://github.com/ma1uta/ma1sd/releases/tag/${version}";
91 sourceProvenance = with sourceTypes; [
95 license = licenses.agpl3Only;
96 maintainers = with maintainers; [ mguentner ];
97 platforms = platforms.all;
98 mainProgram = "ma1sd";