nixpkgs/pkgs/applications/misc/mya/default.nix
Peder Bergebakken Sundt 9672b13a43 mya: init at 1.0.0
Co-authored-by: Emily <vcs@emily.moe>
2023-08-04 12:28:32 +02:00

67 lines
1.5 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, cmake
, ninja
, curl
, json_c
, libbsd
, argp-standalone
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mya";
version = "1.0.0";
src = fetchFromGitHub {
owner = "jmakhack";
repo = "myanimelist-cli";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-EmdkPpYEUIk9hr6rbnixjvznKSEnTCSMZz/17BfHGCk=";
};
nativeBuildInputs = [
cmake
ninja
];
buildInputs = [
curl
json_c
libbsd
] ++ lib.optionals (!stdenv.hostPlatform.isGnu) [
argp-standalone
];
patches = [
./argp.patch
];
installPhase = ''
runHook preInstall
# Based on the upstream PKGBUILD
mkdir -p $out/share/doc/${finalAttrs.pname}
cp -a bin $out
cp $cmakeDir/README.md $out/share/doc/${finalAttrs.pname}
runHook postInstall
'';
meta = with lib; {
description = "Minimalistic command line interface for fetching user anime data from MyAnimeList";
longDescription = ''
Minimalistic command line interface for fetching user anime data from MyAnimeList.
You have to run this with the MYANIMELIST_CLIENT_ID environ variable set.
Where to get one: <https://myanimelist.net/apiconfig>.
Select the type `other`.
'';
homepage = "https://github.com/jmakhack/myanimelist-cli";
changelog = "https://github.com/jmakhack/myanimelist-cli/releases/tag/v${finalAttrs.version}";
license = licenses.mit;
maintainers = with maintainers; [ pbsds ];
mainProgram = "mya";
platforms = platforms.all;
};
})