packages/missgram: rename

This commit is contained in:
2025-12-27 11:40:10 +08:00
parent 4d1f6eb6b5
commit 0c80dde1d1
13 changed files with 43 additions and 43 deletions

View File

@@ -144,7 +144,7 @@ inputs: rec
buildProxy = inputs.pkgs.lib.mkBuildproxy ./pybinding/proxy.nix;
};
brokenaxes = inputs.pkgs.python3Packages.callPackage ./brokenaxes.nix { src = inputs.topInputs.brokenaxes; };
misskey-forwarder = inputs.pkgs.callPackage ./misskey-forwarder { inherit biu; stdenv = inputs.pkgs.clang18Stdenv; };
missgram = inputs.pkgs.callPackage ./missgram { inherit biu; stdenv = inputs.pkgs.clang18Stdenv; };
fromYaml = content: builtins.fromJSON (builtins.readFile
(inputs.pkgs.runCommand "toJSON" {}

1
packages/missgram/.envrc Normal file
View File

@@ -0,0 +1 @@
use flake .#missgram

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(misskey-forwarder VERSION 0.0.0 LANGUAGES CXX)
project(missgram VERSION 0.0.0 LANGUAGES CXX)
enable_testing()
include(GNUInstallDirs)
@@ -12,13 +12,13 @@ endif()
find_package(biu REQUIRED)
find_package(httplib REQUIRED)
add_executable(misskey-forwarder src/main.cpp)
target_link_libraries(misskey-forwarder PRIVATE biu::biu httplib::httplib)
target_compile_features(misskey-forwarder PRIVATE cxx_std_23)
if(DEFINED FORWARDER_CONFIG_FILE)
target_compile_definitions(misskey-forwarder PRIVATE FORWARDER_CONFIG_FILE="${FORWARDER_CONFIG_FILE}")
add_executable(missgram src/main.cpp)
target_link_libraries(missgram PRIVATE biu::biu httplib::httplib)
target_compile_features(missgram PRIVATE cxx_std_23)
if(DEFINED MISSGRAM_CONFIG_FILE)
target_compile_definitions(missgram PRIVATE MISSGRAM_CONFIG_FILE="${MISSGRAM_CONFIG_FILE}")
endif()
install(TARGETS misskey-forwarder RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(TARGETS missgram RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
get_property(ImportedTargets DIRECTORY "${CMAKE_SOURCE_DIR}" PROPERTY IMPORTED_TARGETS)
message("Imported targets: ${ImportedTargets}")

View File

@@ -1,8 +1,8 @@
{ lib, stdenv, cmake, pkg-config, biu, configFile ? null, httplib }: stdenv.mkDerivation
{
name = "misskey-forwarder";
name = "missgram";
src = ./.;
buildInputs = [ biu httplib ];
nativeBuildInputs = [ cmake pkg-config ];
cmakeFlags = lib.optional (configFile != null) [ "-DFORWARDER_CONFIG_FILE=${configFile}" ];
cmakeFlags = lib.optional (configFile != null) [ "-DMISSGRAM_CONFIG_FILE=${configFile}" ];
}

View File

@@ -1,8 +1,8 @@
# include <biu.hpp>
# include <httplib.h>
# include <tgbot/tgbot.h>
# ifndef FORWARDER_CONFIG_FILE
# define FORWARDER_CONFIG_FILE "./config.yaml"
# ifndef MISSGRAM_CONFIG_FILE
# define MISSGRAM_CONFIG_FILE "./config.yaml"
# endif
int main()
@@ -16,7 +16,7 @@ int main()
std::string TelegramBotToken;
std::string TelegramChatId;
int ServerPort;
} config = YAML::LoadFile(FORWARDER_CONFIG_FILE).as<Config>();
} config = YAML::LoadFile(MISSGRAM_CONFIG_FILE).as<Config>();
biu::Logger::try_exec([&]
{

View File

@@ -1 +0,0 @@
use flake .#misskey-forwarder