diff --git a/default.nix b/default.nix index ec800b1..b70c952 100644 --- a/default.nix +++ b/default.nix @@ -52,6 +52,7 @@ rec { wii-u-gc-adapter = pkgs.callPackage ./pkgs/wii-u-gc-adapter { }; # minecraft-server-fabric = pkgs.callPackage ./pkgs/minecraft-server-fabric { }; + mcaselector = pkgs.callPackage ./pkgs/mcaselector { }; dowlords-faf-client = pkgs.callPackage ./pkgs/downlords { jdk16 = pkgs.jdk; }; diff --git a/pkgs/mcaselector/0001-java-version.patch b/pkgs/mcaselector/0001-java-version.patch new file mode 100644 index 0000000..828009c --- /dev/null +++ b/pkgs/mcaselector/0001-java-version.patch @@ -0,0 +1,20 @@ +diff --git a/build.gradle b/build.gradle +index 52e08db..f9d3d9d 100644 +--- a/build.gradle ++++ b/build.gradle +@@ -14,7 +14,7 @@ def appName = 'MCA Selector' + def appUrl = 'https://github.com/Querz/mcaselector' + def appAuthor = 'Querz' + +-sourceCompatibility = 16 ++sourceCompatibility = 17 + + idea { + module.downloadSources = true +@@ -289,4 +289,4 @@ static String appendLicense(File f, String l) { + content + } + return l +-} +\ No newline at end of file ++} diff --git a/pkgs/mcaselector/default.nix b/pkgs/mcaselector/default.nix new file mode 100644 index 0000000..6bf20e8 --- /dev/null +++ b/pkgs/mcaselector/default.nix @@ -0,0 +1,37 @@ +{lib, stdenv, fetchurl, jre, gsettings-desktop-schemas, wrapGAppsHook, glib }: + +stdenv.mkDerivation rec { + pname = "mcaselector"; + version = "1.17.1"; + + src = fetchurl { + url = "https://github.com/Querz/mcaselector/releases/download/${version}/mcaselector-${version}.jar"; + sha256 = "0nrr21hj05ng1w02aygkh8a2s85gypxyjmc1bikp3farlgcjc5l3"; + }; + + dontUnpack = true; + + nativeBuildInputs = [ wrapGAppsHook glib ]; +# buildInputs = [ gsettings-desktop-schemas ]; + + dontWrapGApps = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/java $out/bin + cp $src $out/share/java/mcaselector-${version}.jar + + echo "''${gappsWrapperArgs[@]}" + + makeWrapper ${jre}/bin/java $out/bin/mcaselector \ + --add-flags "-jar $out/share/java/mcaselector-${version}.jar" \ + --set _JAVA_OPTIONS '-Dawt.useSystemAAFontSettings=on' \ + --set _JAVA_AWT_WM_NONREPARENTING 1 \ + --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \ + "''${gappsWrapperArgs[@]}" + + runHook postInstall + ''; + +} diff --git a/pkgs/mcaselector/gradle-env.json b/pkgs/mcaselector/gradle-env.json new file mode 100644 index 0000000..960b49c --- /dev/null +++ b/pkgs/mcaselector/gradle-env.json @@ -0,0 +1,952 @@ +{ + "": { + "name": "mcaselector", + "version": "1.17", + "path": "", + "gradle": { + "version": "7.0.2", + "type": "bin", + "url": "https://services.gradle.org/distributions/gradle-7.0.2-bin.zip", + "sha256": "0e46229820205440b48a5501122002842b82886e76af35f0f3a069243dca4b3c", + "nativeVersion": "0.22-milestone-16" + }, + "dependencies": { + "settings": [], + "plugin": [ + { + "id": { + "group": "com.github.johnrengelman.shadow", + "name": "com.github.johnrengelman.shadow.gradle.plugin", + "version": "7.0.0", + "type": "pom", + "extension": "pom" + }, + "name": "com.github.johnrengelman.shadow.gradle.plugin-7.0.0.pom", + "path": "com/github/johnrengelman/shadow/com.github.johnrengelman.shadow.gradle.plugin/7.0.0", + "urls": [ + "https://plugins.gradle.org/m2/com/github/johnrengelman/shadow/com.github.johnrengelman.shadow.gradle.plugin/7.0.0/com.github.johnrengelman.shadow.gradle.plugin-7.0.0.pom" + ], + "sha256": "424b7d1343be0e521eec422c1e16b6be6b28042512673e4aa8499c5038e1a509" + }, + { + "id": { + "group": "com.gradle.publish", + "name": "plugin-publish-plugin", + "version": "0.14.0", + "type": "jar", + "extension": "jar" + }, + "name": "plugin-publish-plugin-0.14.0.jar", + "path": "com/gradle/publish/plugin-publish-plugin/0.14.0", + "urls": [ + "https://plugins.gradle.org/m2/com/gradle/publish/plugin-publish-plugin/0.14.0/plugin-publish-plugin-0.14.0.jar" + ], + "sha256": "e5f60ab215d43f2614872bac5fdf9aaae3fd734bd67e93bf11a40007ec78d3f2" + }, + { + "id": { + "group": "com.gradle.publish", + "name": "plugin-publish-plugin", + "version": "0.14.0", + "type": "pom", + "extension": "pom" + }, + "name": "plugin-publish-plugin-0.14.0.pom", + "path": "com/gradle/publish/plugin-publish-plugin/0.14.0", + "urls": [ + "https://plugins.gradle.org/m2/com/gradle/publish/plugin-publish-plugin/0.14.0/plugin-publish-plugin-0.14.0.pom" + ], + "sha256": "1075de06063cf6f37c20f42ff03a056bada82f4c87b03de16e40059b25d9001b" + }, + { + "id": { + "group": "commons-io", + "name": "commons-io", + "version": "2.8.0", + "type": "jar", + "extension": "jar" + }, + "name": "commons-io-2.8.0.jar", + "path": "commons-io/commons-io/2.8.0", + "urls": [ + "https://plugins.gradle.org/m2/commons-io/commons-io/2.8.0/commons-io-2.8.0.jar" + ], + "sha256": "02f291e5d1243dc143496e3cbbb40a1ced47aa58f2d633d3e38780cd068d5074" + }, + { + "id": { + "group": "commons-io", + "name": "commons-io", + "version": "2.8.0", + "type": "pom", + "extension": "pom" + }, + "name": "commons-io-2.8.0.pom", + "path": "commons-io/commons-io/2.8.0", + "urls": [ + "https://plugins.gradle.org/m2/commons-io/commons-io/2.8.0/commons-io-2.8.0.pom" + ], + "sha256": "d7c8641a37d6e76f36fb9e81fc1420e26a09d63fa32f00f74764de067ca8347d" + }, + { + "id": { + "group": "gradle.plugin.com.github.jengelman.gradle.plugins", + "name": "shadow", + "version": "7.0.0", + "type": "jar", + "extension": "jar" + }, + "name": "shadow-7.0.0.jar", + "path": "gradle/plugin/com/github/jengelman/gradle/plugins/shadow/7.0.0", + "urls": [ + "https://plugins.gradle.org/m2/gradle/plugin/com/github/jengelman/gradle/plugins/shadow/7.0.0/shadow-7.0.0.jar" + ], + "sha256": "8e7b12a0a2c2d170884a860679a019bab60b63bc99ebfa0db0897d249d86f345" + }, + { + "id": { + "group": "gradle.plugin.com.github.jengelman.gradle.plugins", + "name": "shadow", + "version": "7.0.0", + "type": "pom", + "extension": "pom" + }, + "name": "shadow-7.0.0.pom", + "path": "gradle/plugin/com/github/jengelman/gradle/plugins/shadow/7.0.0", + "urls": [ + "https://plugins.gradle.org/m2/gradle/plugin/com/github/jengelman/gradle/plugins/shadow/7.0.0/shadow-7.0.0.pom" + ], + "sha256": "6812f26f6d81eccced5411603475cb3a92594fa48077c75eb08d05165ebbf475" + }, + { + "id": { + "group": "org.apache", + "name": "apache", + "version": "10", + "type": "pom", + "extension": "pom" + }, + "name": "apache-10.pom", + "path": "org/apache/apache/10", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/apache/10/apache-10.pom" + ], + "sha256": "802feece72852dafcbd0a425a60367c72c5cb9b6ea5aae59481128569189daf9" + }, + { + "id": { + "group": "org.apache", + "name": "apache", + "version": "23", + "type": "pom", + "extension": "pom" + }, + "name": "apache-23.pom", + "path": "org/apache/apache/23", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/apache/23/apache-23.pom" + ], + "sha256": "bc10624e0623f36577fac5639ca2936d3240ed152fb6d8d533ab4d270543491c" + }, + { + "id": { + "group": "org.apache.ant", + "name": "ant", + "version": "1.10.9", + "type": "jar", + "extension": "jar" + }, + "name": "ant-1.10.9.jar", + "path": "org/apache/ant/ant/1.10.9", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/ant/ant/1.10.9/ant-1.10.9.jar" + ], + "sha256": "0715478af585ea80a18985613ebecdc7922122d45b2c3c970ff9b352cddb75fc" + }, + { + "id": { + "group": "org.apache.ant", + "name": "ant", + "version": "1.10.9", + "type": "pom", + "extension": "pom" + }, + "name": "ant-1.10.9.pom", + "path": "org/apache/ant/ant/1.10.9", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/ant/ant/1.10.9/ant-1.10.9.pom" + ], + "sha256": "b6276017cf6f2a07b7b7b62778333237ca73405fcc3af1ca9d95f52f97fb79e1" + }, + { + "id": { + "group": "org.apache.ant", + "name": "ant-launcher", + "version": "1.10.9", + "type": "jar", + "extension": "jar" + }, + "name": "ant-launcher-1.10.9.jar", + "path": "org/apache/ant/ant-launcher/1.10.9", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/ant/ant-launcher/1.10.9/ant-launcher-1.10.9.jar" + ], + "sha256": "fcce891f57f3be72149ff96ac2a80574165b3e0839866b95d24528f3027d50c1" + }, + { + "id": { + "group": "org.apache.ant", + "name": "ant-launcher", + "version": "1.10.9", + "type": "pom", + "extension": "pom" + }, + "name": "ant-launcher-1.10.9.pom", + "path": "org/apache/ant/ant-launcher/1.10.9", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/ant/ant-launcher/1.10.9/ant-launcher-1.10.9.pom" + ], + "sha256": "124de56fea61db6c0db49c079d1eb65d4896c1ac4d11ff26557be369e3dbea5b" + }, + { + "id": { + "group": "org.apache.ant", + "name": "ant-parent", + "version": "1.10.9", + "type": "pom", + "extension": "pom" + }, + "name": "ant-parent-1.10.9.pom", + "path": "org/apache/ant/ant-parent/1.10.9", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/ant/ant-parent/1.10.9/ant-parent-1.10.9.pom" + ], + "sha256": "cad4640e094434e97041ae11172d10980ec04299844560bf67e4637be8450b96" + }, + { + "id": { + "group": "org.apache.commons", + "name": "commons-parent", + "version": "52", + "type": "pom", + "extension": "pom" + }, + "name": "commons-parent-52.pom", + "path": "org/apache/commons/commons-parent/52", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/commons/commons-parent/52/commons-parent-52.pom" + ], + "sha256": "75dbe8f34e98e4c3ff42daae4a2f9eb4cbcd3b5f1047d54460ace906dbb4502e" + }, + { + "id": { + "group": "org.apache.logging", + "name": "logging-parent", + "version": "3", + "type": "pom", + "extension": "pom" + }, + "name": "logging-parent-3.pom", + "path": "org/apache/logging/logging-parent/3", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/logging/logging-parent/3/logging-parent-3.pom" + ], + "sha256": "763a2ec2b8094d4161deb6c264b1262085b9be30bf3a31c2ce137242e57722a7" + }, + { + "id": { + "group": "org.apache.logging.log4j", + "name": "log4j", + "version": "2.14.1", + "type": "pom", + "extension": "pom" + }, + "name": "log4j-2.14.1.pom", + "path": "org/apache/logging/log4j/log4j/2.14.1", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/logging/log4j/log4j/2.14.1/log4j-2.14.1.pom" + ], + "sha256": "972d7e467fd0f36f05e8ff72730d363cb04d56add01681d19e243f5341eff0b2" + }, + { + "id": { + "group": "org.apache.logging.log4j", + "name": "log4j-api", + "version": "2.14.1", + "type": "jar", + "extension": "jar" + }, + "name": "log4j-api-2.14.1.jar", + "path": "org/apache/logging/log4j/log4j-api/2.14.1", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/logging/log4j/log4j-api/2.14.1/log4j-api-2.14.1.jar" + ], + "sha256": "8caf58db006c609949a0068110395a33067a2bad707c3da35e959c0473f9a916" + }, + { + "id": { + "group": "org.apache.logging.log4j", + "name": "log4j-api", + "version": "2.14.1", + "type": "pom", + "extension": "pom" + }, + "name": "log4j-api-2.14.1.pom", + "path": "org/apache/logging/log4j/log4j-api/2.14.1", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/logging/log4j/log4j-api/2.14.1/log4j-api-2.14.1.pom" + ], + "sha256": "909fa83ac088e70c8ba0dfb0fbd5b3027d03262edaafcca1250cc6aec46f0ad4" + }, + { + "id": { + "group": "org.apache.logging.log4j", + "name": "log4j-core", + "version": "2.14.1", + "type": "jar", + "extension": "jar" + }, + "name": "log4j-core-2.14.1.jar", + "path": "org/apache/logging/log4j/log4j-core/2.14.1", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/logging/log4j/log4j-core/2.14.1/log4j-core-2.14.1.jar" + ], + "sha256": "ade7402a70667a727635d5c4c29495f4ff96f061f12539763f6f123973b465b0" + }, + { + "id": { + "group": "org.apache.logging.log4j", + "name": "log4j-core", + "version": "2.14.1", + "type": "pom", + "extension": "pom" + }, + "name": "log4j-core-2.14.1.pom", + "path": "org/apache/logging/log4j/log4j-core/2.14.1", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/logging/log4j/log4j-core/2.14.1/log4j-core-2.14.1.pom" + ], + "sha256": "8a598b05bfa324efc2f45e825b3aa9813d291054eca3808a8013c6cf7b06fd6a" + }, + { + "id": { + "group": "org.apache.maven", + "name": "maven", + "version": "3.0.4", + "type": "pom", + "extension": "pom" + }, + "name": "maven-3.0.4.pom", + "path": "org/apache/maven/maven/3.0.4", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/maven/maven/3.0.4/maven-3.0.4.pom" + ], + "sha256": "4d223e01a6569d6655c1f4fce84969d45142cdbabdb118ea08c5c8c33ec632f6" + }, + { + "id": { + "group": "org.apache.maven", + "name": "maven-model", + "version": "3.0.4", + "type": "jar", + "extension": "jar" + }, + "name": "maven-model-3.0.4.jar", + "path": "org/apache/maven/maven-model/3.0.4", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/maven/maven-model/3.0.4/maven-model-3.0.4.jar" + ], + "sha256": "26b6825ea73ac4d7b1a6f5e62ac1c11b0fc272504da6dde9ba8f894cd847e1c1" + }, + { + "id": { + "group": "org.apache.maven", + "name": "maven-model", + "version": "3.0.4", + "type": "pom", + "extension": "pom" + }, + "name": "maven-model-3.0.4.pom", + "path": "org/apache/maven/maven-model/3.0.4", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/maven/maven-model/3.0.4/maven-model-3.0.4.pom" + ], + "sha256": "264be3f212d59f9103d3b997c9d0197ff89489d06b7d195d80ee56356b6c662e" + }, + { + "id": { + "group": "org.apache.maven", + "name": "maven-parent", + "version": "21", + "type": "pom", + "extension": "pom" + }, + "name": "maven-parent-21.pom", + "path": "org/apache/maven/maven-parent/21", + "urls": [ + "https://plugins.gradle.org/m2/org/apache/maven/maven-parent/21/maven-parent-21.pom" + ], + "sha256": "fc45af8911ea307d1b57564eef1f78b69801e9c11a5619e7eb58d5d00ae9db8e" + }, + { + "id": { + "group": "org.codehaus.plexus", + "name": "plexus", + "version": "5.1", + "type": "pom", + "extension": "pom" + }, + "name": "plexus-5.1.pom", + "path": "org/codehaus/plexus/plexus/5.1", + "urls": [ + "https://plugins.gradle.org/m2/org/codehaus/plexus/plexus/5.1/plexus-5.1.pom" + ], + "sha256": "a343e44ff5796aed0ea60be11454c935ce20ab1c5f164acc8da574482dcbc7e9" + }, + { + "id": { + "group": "org.codehaus.plexus", + "name": "plexus-utils", + "version": "3.3.0", + "type": "jar", + "extension": "jar" + }, + "name": "plexus-utils-3.3.0.jar", + "path": "org/codehaus/plexus/plexus-utils/3.3.0", + "urls": [ + "https://plugins.gradle.org/m2/org/codehaus/plexus/plexus-utils/3.3.0/plexus-utils-3.3.0.jar" + ], + "sha256": "76d174792540e2775af94d03d10fb2d3c776e2cd0ac0ebf427d3e570072bb9ce" + }, + { + "id": { + "group": "org.codehaus.plexus", + "name": "plexus-utils", + "version": "3.3.0", + "type": "pom", + "extension": "pom" + }, + "name": "plexus-utils-3.3.0.pom", + "path": "org/codehaus/plexus/plexus-utils/3.3.0", + "urls": [ + "https://plugins.gradle.org/m2/org/codehaus/plexus/plexus-utils/3.3.0/plexus-utils-3.3.0.pom" + ], + "sha256": "79c9792073fdee3cdbebd61a76ba8c2dd11624a9f85d128bae56bda19e20475c" + }, + { + "id": { + "group": "org.jdom", + "name": "jdom2", + "version": "2.0.6", + "type": "jar", + "extension": "jar" + }, + "name": "jdom2-2.0.6.jar", + "path": "org/jdom/jdom2/2.0.6", + "urls": [ + "https://plugins.gradle.org/m2/org/jdom/jdom2/2.0.6/jdom2-2.0.6.jar" + ], + "sha256": "1345f11ba606d15603d6740551a8c21947c0215640770ec67271fe78bea97cf5" + }, + { + "id": { + "group": "org.jdom", + "name": "jdom2", + "version": "2.0.6", + "type": "pom", + "extension": "pom" + }, + "name": "jdom2-2.0.6.pom", + "path": "org/jdom/jdom2/2.0.6", + "urls": [ + "https://plugins.gradle.org/m2/org/jdom/jdom2/2.0.6/jdom2-2.0.6.pom" + ], + "sha256": "47b23a79fe336b741b82434c6e049d68165256e405e75c10921fd72fa8a65d8d" + }, + { + "id": { + "group": "org.ow2", + "name": "ow2", + "version": "1.5", + "type": "pom", + "extension": "pom" + }, + "name": "ow2-1.5.pom", + "path": "org/ow2/ow2/1.5", + "urls": [ + "https://plugins.gradle.org/m2/org/ow2/ow2/1.5/ow2-1.5.pom" + ], + "sha256": "0f8a1b116e760b8fe6389c51b84e4b07a70fc11082d4f936e453b583dd50b43b" + }, + { + "id": { + "group": "org.ow2.asm", + "name": "asm", + "version": "9.1", + "type": "jar", + "extension": "jar" + }, + "name": "asm-9.1.jar", + "path": "org/ow2/asm/asm/9.1", + "urls": [ + "https://plugins.gradle.org/m2/org/ow2/asm/asm/9.1/asm-9.1.jar" + ], + "sha256": "cda4de455fab48ff0bcb7c48b4639447d4de859a7afc30a094a986f0936beba2" + }, + { + "id": { + "group": "org.ow2.asm", + "name": "asm", + "version": "9.1", + "type": "pom", + "extension": "pom" + }, + "name": "asm-9.1.pom", + "path": "org/ow2/asm/asm/9.1", + "urls": [ + "https://plugins.gradle.org/m2/org/ow2/asm/asm/9.1/asm-9.1.pom" + ], + "sha256": "c683a90dd68f2b1788cbdfc4647ea9405ef5925b371c199f8fd39d44d3cede8d" + }, + { + "id": { + "group": "org.ow2.asm", + "name": "asm-analysis", + "version": "9.1", + "type": "jar", + "extension": "jar" + }, + "name": "asm-analysis-9.1.jar", + "path": "org/ow2/asm/asm-analysis/9.1", + "urls": [ + "https://plugins.gradle.org/m2/org/ow2/asm/asm-analysis/9.1/asm-analysis-9.1.jar" + ], + "sha256": "81a88041b1b8beda5a8a99646098046c48709538270c49def68abff25ac3be34" + }, + { + "id": { + "group": "org.ow2.asm", + "name": "asm-analysis", + "version": "9.1", + "type": "pom", + "extension": "pom" + }, + "name": "asm-analysis-9.1.pom", + "path": "org/ow2/asm/asm-analysis/9.1", + "urls": [ + "https://plugins.gradle.org/m2/org/ow2/asm/asm-analysis/9.1/asm-analysis-9.1.pom" + ], + "sha256": "ac5454c11b03431ca951df71fb4e86c8c4c80df6979f95b757caed3ab0f47156" + }, + { + "id": { + "group": "org.ow2.asm", + "name": "asm-commons", + "version": "9.1", + "type": "jar", + "extension": "jar" + }, + "name": "asm-commons-9.1.jar", + "path": "org/ow2/asm/asm-commons/9.1", + "urls": [ + "https://plugins.gradle.org/m2/org/ow2/asm/asm-commons/9.1/asm-commons-9.1.jar" + ], + "sha256": "afcb26dc1fc12c0c4a99ada670908dd82e18dfc488caf5ee92546996b470c00c" + }, + { + "id": { + "group": "org.ow2.asm", + "name": "asm-commons", + "version": "9.1", + "type": "pom", + "extension": "pom" + }, + "name": "asm-commons-9.1.pom", + "path": "org/ow2/asm/asm-commons/9.1", + "urls": [ + "https://plugins.gradle.org/m2/org/ow2/asm/asm-commons/9.1/asm-commons-9.1.pom" + ], + "sha256": "a0f651b27b8afe9c0e612d7a0266eacb5f7b1c787bc4b5ac8245f3d7a1181b7f" + }, + { + "id": { + "group": "org.ow2.asm", + "name": "asm-tree", + "version": "9.1", + "type": "jar", + "extension": "jar" + }, + "name": "asm-tree-9.1.jar", + "path": "org/ow2/asm/asm-tree/9.1", + "urls": [ + "https://plugins.gradle.org/m2/org/ow2/asm/asm-tree/9.1/asm-tree-9.1.jar" + ], + "sha256": "fd00afa49e9595d7646205b09cecb4a776a8ff0ba06f2d59b8f7bf9c704b4a73" + }, + { + "id": { + "group": "org.ow2.asm", + "name": "asm-tree", + "version": "9.1", + "type": "pom", + "extension": "pom" + }, + "name": "asm-tree-9.1.pom", + "path": "org/ow2/asm/asm-tree/9.1", + "urls": [ + "https://plugins.gradle.org/m2/org/ow2/asm/asm-tree/9.1/asm-tree-9.1.pom" + ], + "sha256": "b6a00d9207c035460f81c7d70ed41253f0d216652bed45fa1a3052ffcd50b94c" + }, + { + "id": { + "group": "org.vafer", + "name": "jdependency", + "version": "2.6.0", + "type": "jar", + "extension": "jar" + }, + "name": "jdependency-2.6.0.jar", + "path": "org/vafer/jdependency/2.6.0", + "urls": [ + "https://plugins.gradle.org/m2/org/vafer/jdependency/2.6.0/jdependency-2.6.0.jar" + ], + "sha256": "bed1860da230a1132ba52897c085de88f51e17ec7a20d2597e85661b2e7a9c11" + }, + { + "id": { + "group": "org.vafer", + "name": "jdependency", + "version": "2.6.0", + "type": "pom", + "extension": "pom" + }, + "name": "jdependency-2.6.0.pom", + "path": "org/vafer/jdependency/2.6.0", + "urls": [ + "https://plugins.gradle.org/m2/org/vafer/jdependency/2.6.0/jdependency-2.6.0.pom" + ], + "sha256": "5d00a81a6cadf8e60394bc1829fea023849261196f76ed4099dfeca3d5d92180" + } + ], + "buildscript": [], + "project": [ + { + "id": { + "group": "ar.com.hjg", + "name": "pngj", + "version": "2.1.0", + "type": "jar", + "extension": "jar" + }, + "name": "pngj-2.1.0.jar", + "path": "ar/com/hjg/pngj/2.1.0", + "urls": [ + "https://repo.maven.apache.org/maven2/ar/com/hjg/pngj/2.1.0/pngj-2.1.0.jar" + ], + "sha256": "e6b762f15e4891178dddd74e4d57318f518ce278000129efa41f85410b132ccc" + }, + { + "id": { + "group": "ar.com.hjg", + "name": "pngj", + "version": "2.1.0", + "type": "pom", + "extension": "pom" + }, + "name": "pngj-2.1.0.pom", + "path": "ar/com/hjg/pngj/2.1.0", + "urls": [ + "https://repo.maven.apache.org/maven2/ar/com/hjg/pngj/2.1.0/pngj-2.1.0.pom" + ], + "sha256": "80717d62484256843ba1221b6f2ef867acd1c515a08311dad487b7272685bb45" + }, + { + "id": { + "group": "com.github.Querz", + "name": "NBT", + "version": "4192a95c9d", + "type": "jar", + "extension": "jar" + }, + "name": "NBT-4192a95c9d.jar", + "path": "com/github/Querz/NBT/4192a95c9d", + "urls": [ + "https://jitpack.io/com/github/Querz/NBT/4192a95c9d/NBT-4192a95c9d.jar" + ], + "sha256": "2d0550a2bcbb320c330e3101a46491c24bcdc9262dd45a8a1db5acc01fe19b04" + }, + { + "id": { + "group": "com.github.Querz", + "name": "NBT", + "version": "4192a95c9d", + "type": "pom", + "extension": "pom" + }, + "name": "NBT-4192a95c9d.pom", + "path": "com/github/Querz/NBT/4192a95c9d", + "urls": [ + "https://jitpack.io/com/github/Querz/NBT/4192a95c9d/NBT-4192a95c9d.pom" + ], + "sha256": "5c72516ef1fc501a48c725e5e6da84a5a26b77e087d46f62f69dc34b3576e09c" + }, + { + "id": { + "group": "commons-io", + "name": "commons-io", + "version": "2.6", + "type": "jar", + "extension": "jar" + }, + "name": "commons-io-2.6.jar", + "path": "commons-io/commons-io/2.6", + "urls": [ + "https://repo.maven.apache.org/maven2/commons-io/commons-io/2.6/commons-io-2.6.jar" + ], + "sha256": "f877d304660ac2a142f3865badfc971dec7ed73c747c7f8d5d2f5139ca736513" + }, + { + "id": { + "group": "commons-io", + "name": "commons-io", + "version": "2.6", + "type": "pom", + "extension": "pom" + }, + "name": "commons-io-2.6.pom", + "path": "commons-io/commons-io/2.6", + "urls": [ + "https://repo.maven.apache.org/maven2/commons-io/commons-io/2.6/commons-io-2.6.pom" + ], + "sha256": "0c23863893a2291f5a7afdbd8d15923b3948afd87e563fa341cdcf6eae338a60" + }, + { + "id": { + "group": "it.unimi.dsi", + "name": "fastutil", + "version": "8.5.6", + "type": "jar", + "extension": "jar" + }, + "name": "fastutil-8.5.6.jar", + "path": "it/unimi/dsi/fastutil/8.5.6", + "urls": [ + "https://repo.maven.apache.org/maven2/it/unimi/dsi/fastutil/8.5.6/fastutil-8.5.6.jar" + ], + "sha256": "5021369bdc72e2ca24222d036c9b35c9733dc9c082a0891c4dba5a583663f30b" + }, + { + "id": { + "group": "it.unimi.dsi", + "name": "fastutil", + "version": "8.5.6", + "type": "pom", + "extension": "pom" + }, + "name": "fastutil-8.5.6.pom", + "path": "it/unimi/dsi/fastutil/8.5.6", + "urls": [ + "https://repo.maven.apache.org/maven2/it/unimi/dsi/fastutil/8.5.6/fastutil-8.5.6.pom" + ], + "sha256": "5632476925b0c55ffd54f9984ca71dfb6ff9ec77e5b2096496de53f1059a37d7" + }, + { + "id": { + "group": "junit", + "name": "junit", + "version": "4.12", + "type": "jar", + "extension": "jar" + }, + "name": "junit-4.12.jar", + "path": "junit/junit/4.12", + "urls": [ + "https://repo.maven.apache.org/maven2/junit/junit/4.12/junit-4.12.jar" + ], + "sha256": "59721f0805e223d84b90677887d9ff567dc534d7c502ca903c0c2b17f05c116a" + }, + { + "id": { + "group": "junit", + "name": "junit", + "version": "4.12", + "type": "pom", + "extension": "pom" + }, + "name": "junit-4.12.pom", + "path": "junit/junit/4.12", + "urls": [ + "https://repo.maven.apache.org/maven2/junit/junit/4.12/junit-4.12.pom" + ], + "sha256": "90f163f78e3ffb6f1c7ad97de9e7eba4eea25807141b85d6d12be67ca25449c4" + }, + { + "id": { + "group": "org.apache", + "name": "apache", + "version": "18", + "type": "pom", + "extension": "pom" + }, + "name": "apache-18.pom", + "path": "org/apache/apache/18", + "urls": [ + "https://repo.maven.apache.org/maven2/org/apache/apache/18/apache-18.pom" + ], + "sha256": "7831307285fd475bbc36b20ae38e7882f11c3153b1d5930f852d44eda8f33c17" + }, + { + "id": { + "group": "org.apache.commons", + "name": "commons-parent", + "version": "42", + "type": "pom", + "extension": "pom" + }, + "name": "commons-parent-42.pom", + "path": "org/apache/commons/commons-parent/42", + "urls": [ + "https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/42/commons-parent-42.pom" + ], + "sha256": "cd313494c670b483ec256972af1698b330e598f807002354eb765479f604b09c" + }, + { + "id": { + "group": "org.hamcrest", + "name": "hamcrest-core", + "version": "1.3", + "type": "jar", + "extension": "jar" + }, + "name": "hamcrest-core-1.3.jar", + "path": "org/hamcrest/hamcrest-core/1.3", + "urls": [ + "https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar" + ], + "sha256": "66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9" + }, + { + "id": { + "group": "org.hamcrest", + "name": "hamcrest-core", + "version": "1.3", + "type": "pom", + "extension": "pom" + }, + "name": "hamcrest-core-1.3.pom", + "path": "org/hamcrest/hamcrest-core/1.3", + "urls": [ + "https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.pom" + ], + "sha256": "fde386a7905173a1b103de6ab820727584b50d0e32282e2797787c20a64ffa93" + }, + { + "id": { + "group": "org.hamcrest", + "name": "hamcrest-parent", + "version": "1.3", + "type": "pom", + "extension": "pom" + }, + "name": "hamcrest-parent-1.3.pom", + "path": "org/hamcrest/hamcrest-parent/1.3", + "urls": [ + "https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom" + ], + "sha256": "6d535f94efb663bdb682c9f27a50335394688009642ba7a9677504bc1be4129b" + }, + { + "id": { + "group": "org.json", + "name": "json", + "version": "20201115", + "type": "jar", + "extension": "jar" + }, + "name": "json-20201115.jar", + "path": "org/json/json/20201115", + "urls": [ + "https://repo.maven.apache.org/maven2/org/json/json/20201115/json-20201115.jar" + ], + "sha256": "bd2322a4ddf46e2612104f091aa14d4406393ef3a46f270f69c2abb5ce1d147c" + }, + { + "id": { + "group": "org.json", + "name": "json", + "version": "20201115", + "type": "pom", + "extension": "pom" + }, + "name": "json-20201115.pom", + "path": "org/json/json/20201115", + "urls": [ + "https://repo.maven.apache.org/maven2/org/json/json/20201115/json-20201115.pom" + ], + "sha256": "eb6d15aaba8fe4acdc4be8fe823c2f536a0c085cae42196a37e1d065bb00174d" + }, + { + "id": { + "group": "org.sonatype.oss", + "name": "oss-parent", + "version": "7", + "type": "pom", + "extension": "pom" + }, + "name": "oss-parent-7.pom", + "path": "org/sonatype/oss/oss-parent/7", + "urls": [ + "https://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/7/oss-parent-7.pom" + ], + "sha256": "b51f8867c92b6a722499557fc3a1fdea77bdf9ef574722fe90ce436a29559454" + }, + { + "id": { + "group": "org.sonatype.oss", + "name": "oss-parent", + "version": "9", + "type": "pom", + "extension": "pom" + }, + "name": "oss-parent-9.pom", + "path": "org/sonatype/oss/oss-parent/9", + "urls": [ + "https://repo.maven.apache.org/maven2/org/sonatype/oss/oss-parent/9/oss-parent-9.pom" + ], + "sha256": "fb40265f982548212ff82e362e59732b2187ec6f0d80182885c14ef1f982827a" + }, + { + "id": { + "group": "org.xerial", + "name": "sqlite-jdbc", + "version": "3.34.0", + "type": "jar", + "extension": "jar" + }, + "name": "sqlite-jdbc-3.34.0.jar", + "path": "org/xerial/sqlite-jdbc/3.34.0", + "urls": [ + "https://repo.maven.apache.org/maven2/org/xerial/sqlite-jdbc/3.34.0/sqlite-jdbc-3.34.0.jar" + ], + "sha256": "605979c94e7fe00437f1e10dcfa657a23f125c8eb4d2f0ec17e3f84613894cc3" + }, + { + "id": { + "group": "org.xerial", + "name": "sqlite-jdbc", + "version": "3.34.0", + "type": "pom", + "extension": "pom" + }, + "name": "sqlite-jdbc-3.34.0.pom", + "path": "org/xerial/sqlite-jdbc/3.34.0", + "urls": [ + "https://repo.maven.apache.org/maven2/org/xerial/sqlite-jdbc/3.34.0/sqlite-jdbc-3.34.0.pom" + ], + "sha256": "fdbe92119ef3852d5d4c59ab5fdb10560c378fd395dfbf24e2ebc0b94a5b3f81" + } + ] + } + } +} \ No newline at end of file diff --git a/pkgs/mcaselector/gradle-env.nix b/pkgs/mcaselector/gradle-env.nix new file mode 100644 index 0000000..b512f90 --- /dev/null +++ b/pkgs/mcaselector/gradle-env.nix @@ -0,0 +1,399 @@ +# This file is generated by gradle2nix. +# +# Example usage (e.g. in default.nix): +# +# with (import {}); +# let +# buildGradle = callPackage ./gradle-env.nix {}; +# in +# buildGradle { +# envSpec = ./gradle-env.json; +# +# src = ./.; +# +# gradleFlags = [ "installDist" ]; +# +# installPhase = '' +# mkdir -p $out +# cp -r app/build/install/myproject $out +# ''; +# } + +{ lib +, stdenv +, buildEnv +, fetchs3 +, fetchurl +, gradleGen +, writeText +, writeTextDir +}: + +{ +# Path to the environment spec generated by gradle2nix (e.g. gradle-env.json). + envSpec +, pname ? null +, version ? null +, enableParallelBuilding ? true +# Arguments to Gradle used to build the project in buildPhase. +, gradleFlags ? [ "build" ] +# Gradle package to use instead of the one generated by gradle2nix. +, gradlePackage ? null +# Enable debugging for the Gradle build; this will cause Gradle to run a debug server +# and wait for a JVM debugging client to attach. +, enableDebug ? false +# Additional code to run in the Gradle init script (init.gradle). +, extraInit ? "" +# Override the default JDK used to run Gradle itself. +, buildJdk ? null +# Override functions which fetch dependency artifacts. +# Keys in this set are URL schemes such as "https" or "s3". +# Values are functions which take a dependency in the form +# `{ urls, sha256 }` and fetch into the Nix store. For example: +# +# { +# s3 = { urls, sha256 }: fetchs3 { +# s3url = builtins.head urls; +# inherit sha256; +# region = "us-west-2"; +# credentials = { +# access_key_id = "foo"; +# secret_access_key = "bar"; +# }; +# }; +# } +, fetchers ? { } +, ... } @ args: + +let + inherit (builtins) + attrValues concatStringsSep filter fromJSON getAttr head match + replaceStrings sort; + + inherit (lib) + assertMsg concatMapStringsSep groupBy' hasSuffix hasPrefix last mapAttrs + mapAttrsToList optionalString readFile removeSuffix unique versionAtLeast + versionOlder; + + fetchers' = { + http = fetchurl; + https = fetchurl; + s3 = { urls, sha256 }: fetchs3 { + s3url = head urls; + inherit sha256; + }; + } // fetchers; + + # Fetch urls using the scheme for the first entry only; there isn't a + # straightforward way to tell Nix to try multiple fetchers in turn + # and short-circuit on the first successful fetch. + fetch = { urls, sha256 }: + let + first = head urls; + scheme = head (builtins.match "([a-z0-9+.-]+)://.*" first); + fetch' = getAttr scheme fetchers'; + urls' = filter (hasPrefix scheme) urls; + in + fetch' { urls = urls'; inherit sha256; }; + + mkDep = { name, path, urls, sha256, ... }: stdenv.mkDerivation { + inherit name; + + src = fetch { + inherit urls sha256; + }; + + phases = "installPhase"; + + installPhase = '' + mkdir -p $out/${path} + ln -s $src $out/${path}/${name} + ''; + }; + + mkModuleMetadata = deps: + let + ids = filter + (id: id.type == "pom") + (map (dep: dep.id) deps); + + modules = groupBy' + (meta: id: + let + isNewer = versionOlder meta.latest id.version; + isNewerRelease = + !(hasSuffix "-SNAPSHOT" id.version) && + versionOlder meta.release id.version; + in { + groupId = id.group; + artifactId = id.name; + latest = if isNewer then id.version else meta.latest; + release = if isNewerRelease then id.version else meta.release; + versions = meta.versions ++ [id.version]; + } + ) + { + latest = ""; + release = ""; + versions = []; + } + (id: "${replaceStrings ["."] ["/"] id.group}/${id.name}/maven-metadata.xml") + ids; + + in + attrValues (mapAttrs (path: meta: + let + versions' = sort versionOlder (unique meta.versions); + in + with meta; writeTextDir path '' + + + ${groupId} + ${artifactId} + + ${optionalString (latest != "") "${latest}"} + ${optionalString (release != "") "${release}"} + + ${concatMapStringsSep "\n " (v: "${v}") versions'} + + + + '' + ) modules); + + mkSnapshotMetadata = deps: + let + snapshotDeps = filter (dep: dep ? build && dep ? timestamp) deps; + + modules = groupBy' + (meta: dep: + let + id = dep.id; + isNewer = dep.build > meta.buildNumber; + # Timestamp values can be bogus, e.g. jitpack.io + updated = if (match "[0-9]{8}\.[0-9]{6}" dep.timestamp) != null + then replaceStrings ["."] [""] dep.timestamp + else ""; + in { + groupId = id.group; + artifactId = id.name; + version = id.version; + timestamp = if isNewer then dep.timestamp else meta.timestamp; + buildNumber = if isNewer then dep.build else meta.buildNumber; + lastUpdated = if isNewer then updated else meta.lastUpdated; + versions = meta.versions or [] ++ [{ + classifier = id.classifier or ""; + extension = id.extension; + value = "${removeSuffix "-SNAPSHOT" id.version}-${dep.timestamp}-${toString dep.build}"; + updated = updated; + }]; + } + ) + { + timestamp = ""; + buildNumber = -1; + lastUpdated = ""; + } + (dep: "${replaceStrings ["."] ["/"] dep.id.group}/${dep.id.name}/${dep.id.version}/maven-metadata.xml") + snapshotDeps; + + mkSnapshotVersion = version: '' + + ${optionalString (version.classifier != "") "${version.classifier}"} + ${version.extension} + ${version.value} + ${optionalString (version.updated != "") "${version.updated}"} + + ''; + + in + attrValues (mapAttrs (path: meta: + with meta; writeTextDir path '' + + + ${groupId} + ${artifactId} + ${version} + + + ${optionalString (timestamp != "") "${timestamp}"} + ${optionalString (buildNumber != -1) "${toString buildNumber}"} + + ${optionalString (lastUpdated != "") "${lastUpdated}"} + + ${concatMapStringsSep "\n " mkSnapshotVersion versions} + + + + '' + ) modules); + + mkRepo = project: type: deps: buildEnv { + name = "${project}-gradle-${type}-env"; + paths = map mkDep deps ++ mkModuleMetadata deps ++ mkSnapshotMetadata deps; + }; + + mkInitScript = projectSpec: gradle: + let + repos = mapAttrs (mkRepo projectSpec.name) projectSpec.dependencies; + hasDependencies = mapAttrs (type: deps: deps != []) projectSpec.dependencies; + + inSettings = pred: script: + optionalString pred ( + if versionAtLeast gradle.version "6.0" then '' + gradle.beforeSettings { + ${script} + } + '' else '' + gradle.settingsEvaluated { + ${script} + } + '' + ); + in + assert (assertMsg (hasDependencies.settings -> versionAtLeast gradle.version "6.0") '' + Project `${projectSpec.name}' has settings script dependencies, such as settings + plugins, which are not supported by gradle2nix for Gradle versions prior to 6.0. + + Potential remedies: + - Pass `--gradle-version=' to the gradle2nix command. + - Patch the `settings.gradle[.kts]' file to remove script dependencies. + ''); + + writeText "init.gradle" '' + static def offlineRepo(RepositoryHandler repositories, String env, String path) { + repositories.clear() + repositories.maven { + name "Nix''${env.capitalize()}MavenOffline" + url path + metadataSources { + it.gradleMetadata() + it.mavenPom() + it.artifact() + } + } + repositories.ivy { + name "Nix''${env.capitalize()}IvyOffline" + url path + layout "maven" + metadataSources { + it.gradleMetadata() + it.ivyDescriptor() + it.artifact() + } + } + } + + ${inSettings (hasDependencies.settings && (versionAtLeast gradle.version "6.0")) '' + offlineRepo(it.buildscript.repositories, "settings", "${repos.settings}") + ''} + + ${inSettings (hasDependencies.plugin) '' + offlineRepo(it.pluginManagement.repositories, "plugin", "${repos.plugin}") + ''} + + ${optionalString (hasDependencies.buildscript) '' + gradle.projectsLoaded { + allprojects { + buildscript { + offlineRepo(repositories, "buildscript", "${repos.buildscript}") + } + } + } + ''} + + ${optionalString (hasDependencies.project) ( + if versionAtLeast gradle.version "6.8" + then '' + gradle.beforeSettings { + it.dependencyResolutionManagement { + offlineRepo(repositories, "project", "${repos.project}") + repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) + } + } + '' + else '' + gradle.projectsLoaded { + allprojects { + offlineRepo(repositories, "project", "${repos.project}") + } + } + '' + )} + + ${extraInit} + ''; + + mkGradle = gradleSpec: + gradleGen.gradleGen { + inherit (gradleSpec) nativeVersion; + + name = "gradle-${gradleSpec.version}-${gradleSpec.type}"; + + src = fetchurl { + inherit (gradleSpec) url sha256; + }; + } // { + inherit (gradleSpec) version; + }; + + mkProjectEnv = projectSpec: rec { + inherit (projectSpec) name path version; + gradle = args.gradlePackage or mkGradle projectSpec.gradle; + initScript = mkInitScript projectSpec gradle; + }; + + gradleEnv = mapAttrs + (_: p: mkProjectEnv p) + (fromJSON (readFile envSpec)); + + projectEnv = gradleEnv.""; + pname = args.pname or projectEnv.name; + version = args.version or projectEnv.version; + + buildProject = env: flags: '' + cp ${env.initScript} "$GRADLE_USER_HOME/init.d" + + gradle --offline --no-daemon --no-build-cache \ + --info --full-stacktrace --warning-mode=all \ + ${optionalString enableParallelBuilding "--parallel"} \ + ${optionalString enableDebug "-Dorg.gradle.debug=true"} \ + ${optionalString (buildJdk != null) "-Dorg.gradle.java.home=${buildJdk.home}"} \ + --init-script ${env.initScript} \ + ${optionalString (env.path != "") ''-p "${env.path}"''} \ + ${concatStringsSep " " flags} + ''; + + buildIncludedProjects = + concatStringsSep "\n" (mapAttrsToList + (_: env: buildProject env [ "build" ]) + (removeAttrs gradleEnv [ "" ])); + + buildRootProject = buildProject projectEnv gradleFlags; + +in stdenv.mkDerivation (args // { + + inherit pname version; + + nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ projectEnv.gradle ]; + + buildPhase = args.buildPhase or '' + runHook preBuild + + ( + set -eux + + # Work around https://github.com/gradle/gradle/issues/1055 + TMPHOME="$(mktemp -d)" + mkdir -p "$TMPHOME/init.d" + export GRADLE_USER_HOME="$TMPHOME" + + ${buildIncludedProjects} + ${buildRootProject} + ) + + runHook postBuild + ''; + + dontStrip = true; +})