diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-03-13 18:35:03 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-03-13 18:35:03 +0100 |
commit | 1e7de7c2823a9beea7103249b732f14b1b1e8f78 (patch) | |
tree | ec073e219d67c52a163ae7ce2ca00737c21d2a31 /overlays/ma1sd.nix | |
parent | 49375b980197db7b4e0d17327b52d37d6ce33f35 (diff) | |
download | nixos-1e7de7c2823a9beea7103249b732f14b1b1e8f78.tar nixos-1e7de7c2823a9beea7103249b732f14b1b1e8f78.tar.gz nixos-1e7de7c2823a9beea7103249b732f14b1b1e8f78.tar.bz2 nixos-1e7de7c2823a9beea7103249b732f14b1b1e8f78.tar.xz nixos-1e7de7c2823a9beea7103249b732f14b1b1e8f78.zip |
nvfetcher
Diffstat (limited to 'overlays/ma1sd.nix')
-rw-r--r-- | overlays/ma1sd.nix | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/overlays/ma1sd.nix b/overlays/ma1sd.nix deleted file mode 100644 index 3218879b..00000000 --- a/overlays/ma1sd.nix +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | final: prev: { | ||
2 | ma1sd = let | ||
3 | pname = "ma1sd"; | ||
4 | version = "2.5.0"; | ||
5 | rev = version; | ||
6 | |||
7 | src = prev.fetchFromGitHub { | ||
8 | inherit rev; | ||
9 | owner = "ma1uta"; | ||
10 | repo = "ma1sd"; | ||
11 | hash = "sha256-K3kaujAhWsRQuTMW3SZOnE7Rmu8+tDXaxpLrb45OI4A="; | ||
12 | }; | ||
13 | |||
14 | |||
15 | deps = prev.stdenv.mkDerivation { | ||
16 | pname = "${pname}-deps"; | ||
17 | inherit src version; | ||
18 | nativeBuildInputs = with final; [ gradle_6 perl git ]; | ||
19 | |||
20 | buildPhase = '' | ||
21 | export MA1SD_BUILD_VERSION=${rev} | ||
22 | export GRADLE_USER_HOME=$(mktemp -d); | ||
23 | gradle --no-daemon build -x test | ||
24 | ''; | ||
25 | |||
26 | # 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) | ||
27 | installPhase = '' | ||
28 | find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \ | ||
29 | | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \ | ||
30 | | sh | ||
31 | ''; | ||
32 | |||
33 | dontStrip = true; | ||
34 | |||
35 | outputHashAlgo = "sha256"; | ||
36 | outputHashMode = "recursive"; | ||
37 | outputHash = "sha256-P81aY1rOnZdb2UskPIrBe8dfWAicJ3TivBv/NEns5ro="; | ||
38 | }; | ||
39 | in prev.stdenv.mkDerivation { | ||
40 | inherit pname src version; | ||
41 | nativeBuildInputs = with final; [ gradle_6 perl makeWrapper ]; | ||
42 | buildInputs = with final; [ jre ]; | ||
43 | |||
44 | buildPhase = '' | ||
45 | runHook preBuild | ||
46 | export MA1SD_BUILD_VERSION=${rev} | ||
47 | export GRADLE_USER_HOME=$(mktemp -d) | ||
48 | sed -ie "s#mavenCentral()#mavenLocal(); maven { url '${deps}' }#g; s#mavenCentral()##g" build.gradle | ||
49 | gradle --offline --no-daemon build -x test | ||
50 | runHook postBuild | ||
51 | ''; | ||
52 | |||
53 | installPhase = '' | ||
54 | runHook preInstall | ||
55 | install -D build/libs/source.jar $out/lib/ma1sd.jar | ||
56 | makeWrapper ${final.jre}/bin/java $out/bin/ma1sd --add-flags "-jar $out/lib/ma1sd.jar" | ||
57 | runHook postInstall | ||
58 | ''; | ||
59 | }; | ||
60 | } | ||