dart.sqlite3_flutter_libs: init

This commit is contained in:
aucub 2024-12-04 00:52:24 +08:00
parent 4c9ca53890
commit 946dbfcfa4
3 changed files with 48 additions and 0 deletions

View File

@ -13,6 +13,7 @@
rhttp = callPackage ./rhttp { };
sqlcipher_flutter_libs = callPackage ./sqlcipher_flutter_libs { };
sqlite3 = callPackage ./sqlite3 { };
sqlite3_flutter_libs = callPackage ./sqlite3_flutter_libs { };
system_tray = callPackage ./system-tray { };
super_native_extensions = callPackage ./super_native_extensions { };
}

View File

@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.14)
set(PROJECT_NAME "sqlite3_flutter_libs")
project(${PROJECT_NAME} LANGUAGES C CXX)
# This value is used when generating builds using this plugin, so it must
# not be changed
set(PLUGIN_NAME "sqlite3_flutter_libs_plugin")
find_package(PkgConfig REQUIRED)
pkg_check_modules(SQLITE REQUIRED sqlite3)
add_library(${PLUGIN_NAME} SHARED
"sqlite3_flutter_libs_plugin.cc"
)
target_compile_features(${PLUGIN_NAME} PUBLIC cxx_std_14)
target_compile_options(${PLUGIN_NAME} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
set_target_properties(${PLUGIN_NAME} PROPERTIES
CXX_VISIBILITY_PRESET hidden)
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
target_include_directories(${PLUGIN_NAME} INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter)

View File

@ -0,0 +1,23 @@
{
stdenv,
}:
{ version, src, ... }:
stdenv.mkDerivation {
pname = "sqlite3_flutter_libs";
inherit version src;
inherit (src) passthru;
postPatch = ''
cp ${./CMakeLists.txt} linux/CMakeLists.txt
'';
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
}