diff --git a/pkgs/by-name/ko/kotatsu-dl/package.nix b/pkgs/by-name/ko/kotatsu-dl/package.nix new file mode 100644 index 0000000000000..992f6792ba849 --- /dev/null +++ b/pkgs/by-name/ko/kotatsu-dl/package.nix @@ -0,0 +1,41 @@ +{ pkgs }: + +pkgs.stdenv.mkDerivation rec { + pname = "kotatsu-dl"; + version = "0.5"; + + src = pkgs.fetchurl { + url = "https://github.com/KotatsuApp/kotatsu-dl/releases/download/v${version}/kotatsu-dl.jar"; + sha256 = "sha256-GI/PLt8wbVs2R78PbQg/9/Rea33j6CFQjuqhYIQGimM="; + }; + + # Skip the unpackPhase since it's just a JAR file, not an archive + phases = [ "installPhase" ]; + + # Java Runtime + buildInputs = [ pkgs.openjdk ]; + propagatedBuildInputs = [ pkgs.openjdk ]; + + installPhase = '' + # Create directory for the binary + mkdir -p $out/bin + mkdir -p $out/share/java + + # Copy the JAR file to the bin directory + cp $src $out/share/java/kotatsu-dl.jar + + # Create an executable wrapper to run the JAR file + cat > $out/bin/kotatsu-dl <