mya: init at 1.0.0

Co-authored-by: Emily <vcs@emily.moe>
This commit is contained in:
Peder Bergebakken Sundt 2023-06-28 21:54:24 +02:00
parent a2a7650c47
commit 9672b13a43
3 changed files with 95 additions and 0 deletions

View File

@ -0,0 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 273968c..236e5fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,10 +3,6 @@ project(mya)
set(CMAKE_C_STANDARD 11 )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall")
-if(UNIX)
- set(LINUX TRUE)
-endif()
-
set(SRC_DIR src)
set(INC_DIR include)
@@ -17,7 +13,8 @@ set_target_properties(mya PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DI
target_include_directories(mya PRIVATE ${INC_DIR})
set(LIBS curl json-c bsd)
-if(LINUX)
- list(APPEND LIBS)
+find_library(ARGP argp)
+if(ARGP)
+ list(APPEND LIBS argp)
endif()
target_link_libraries(mya ${LIBS})

View File

@ -0,0 +1,67 @@
{ 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;
};
})

View File

@ -951,6 +951,8 @@ with pkgs;
mongosh = callPackage ../development/tools/mongosh { };
mya = callPackage ../applications/misc/mya { };
mysql-shell = callPackage ../development/tools/mysql-shell {
inherit (darwin) cctools developer_cmds DarwinTools;
inherit (darwin.apple_sdk.frameworks) CoreServices;