push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
{ callPackage }:
{
file_picker = callPackage ./file_picker { };
flutter_discord_rpc = callPackage ./flutter_discord_rpc { };
flutter_secure_storage_linux = callPackage ./flutter-secure-storage-linux { };
flutter_vodozemac = callPackage ./flutter_vodozemac { };
flutter_volume_controller = callPackage ./flutter_volume_controller { };
handy_window = callPackage ./handy-window { };
matrix = callPackage ./matrix { };
media_kit_libs_linux = callPackage ./media_kit_libs_linux { };
olm = callPackage ./olm { };
objectbox_flutter_libs = callPackage ./objectbox_flutter_libs { };
pdfrx = callPackage ./pdfrx { };
printing = callPackage ./printing { };
rhttp = callPackage ./rhttp { };
sentry_flutter = callPackage ./sentry_flutter { };
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 { };
volume_controller = callPackage ./volume_controller { };
xdg_directories = callPackage ./xdg_directories { };
}

View File

@@ -0,0 +1,26 @@
{
lib,
stdenv,
zenity,
}:
{ version, src, ... }:
stdenv.mkDerivation {
pname = "file_picker";
inherit version src;
inherit (src) passthru;
postPatch = lib.optionalString (lib.versionOlder version "10.3.0") ''
substituteInPlace lib/src/linux/file_picker_linux.dart \
--replace-fail "isExecutableOnPath('zenity')" "'${lib.getExe zenity}'"
'';
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
}

View File

@@ -0,0 +1,27 @@
{
stdenv,
libsecret,
jsoncpp,
}:
{ version, src, ... }:
stdenv.mkDerivation {
pname = "flutter-secure-storage-linux";
inherit version src;
inherit (src) passthru;
propagatedBuildInputs = [
libsecret
jsoncpp
];
installPhase = ''
runHook preInstall
mkdir -p "$out"
ln -s '${src}'/* "$out"
runHook postInstall
'';
}

View File

@@ -0,0 +1,90 @@
--- old/cargokit/cmake/cargokit.cmake 2024-11-08 13:36:13.345889693 +0800
+++ new/cargokit/cmake/cargokit.cmake 2024-11-08 13:45:26.019632176 +0800
@@ -17,83 +17,22 @@
function(apply_cargokit target manifest_dir lib_name any_symbol_name)
set(CARGOKIT_LIB_NAME "${lib_name}")
- set(CARGOKIT_LIB_FULL_NAME "${CMAKE_SHARED_MODULE_PREFIX}${CARGOKIT_LIB_NAME}${CMAKE_SHARED_MODULE_SUFFIX}")
- if (CMAKE_CONFIGURATION_TYPES)
- set(CARGOKIT_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
- set(OUTPUT_LIB "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${CARGOKIT_LIB_FULL_NAME}")
- else()
- set(CARGOKIT_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
- set(OUTPUT_LIB "${CMAKE_CURRENT_BINARY_DIR}/${CARGOKIT_LIB_FULL_NAME}")
- endif()
- set(CARGOKIT_TEMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/cargokit_build")
-
- if (FLUTTER_TARGET_PLATFORM)
- set(CARGOKIT_TARGET_PLATFORM "${FLUTTER_TARGET_PLATFORM}")
- else()
- set(CARGOKIT_TARGET_PLATFORM "windows-x64")
- endif()
-
- set(CARGOKIT_ENV
- "CARGOKIT_CMAKE=${CMAKE_COMMAND}"
- "CARGOKIT_CONFIGURATION=$<CONFIG>"
- "CARGOKIT_MANIFEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${manifest_dir}"
- "CARGOKIT_TARGET_TEMP_DIR=${CARGOKIT_TEMP_DIR}"
- "CARGOKIT_OUTPUT_DIR=${CARGOKIT_OUTPUT_DIR}"
- "CARGOKIT_TARGET_PLATFORM=${CARGOKIT_TARGET_PLATFORM}"
- "CARGOKIT_TOOL_TEMP_DIR=${CARGOKIT_TEMP_DIR}/tool"
- "CARGOKIT_ROOT_PROJECT_DIR=${CMAKE_SOURCE_DIR}"
- )
-
- if (WIN32)
- set(SCRIPT_EXTENSION ".cmd")
- set(IMPORT_LIB_EXTENSION ".lib")
- else()
- set(SCRIPT_EXTENSION ".sh")
- set(IMPORT_LIB_EXTENSION "")
- execute_process(COMMAND chmod +x "${cargokit_cmake_root}/run_build_tool${SCRIPT_EXTENSION}")
- endif()
-
- # Using generators in custom command is only supported in CMake 3.20+
- if (CMAKE_CONFIGURATION_TYPES AND ${CMAKE_VERSION} VERSION_LESS "3.20.0")
- foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES)
- add_custom_command(
- OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/${CONFIG}/${CARGOKIT_LIB_FULL_NAME}"
- "${CMAKE_CURRENT_BINARY_DIR}/_phony_"
- COMMAND ${CMAKE_COMMAND} -E env ${CARGOKIT_ENV}
- "${cargokit_cmake_root}/run_build_tool${SCRIPT_EXTENSION}" build-cmake
- VERBATIM
- )
- endforeach()
- else()
- add_custom_command(
- OUTPUT
- ${OUTPUT_LIB}
- "${CMAKE_CURRENT_BINARY_DIR}/_phony_"
- COMMAND ${CMAKE_COMMAND} -E env ${CARGOKIT_ENV}
- "${cargokit_cmake_root}/run_build_tool${SCRIPT_EXTENSION}" build-cmake
- VERBATIM
- )
- endif()
-
-
- set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/_phony_" PROPERTIES SYMBOLIC TRUE)
if (TARGET ${target})
# If we have actual cmake target provided create target and make existing
# target depend on it
- add_custom_target("${target}_cargokit" DEPENDS ${OUTPUT_LIB})
+ add_custom_target("${target}_cargokit" DEPENDS @output_lib@)
add_dependencies("${target}" "${target}_cargokit")
- target_link_libraries("${target}" PRIVATE "${OUTPUT_LIB}${IMPORT_LIB_EXTENSION}")
+ target_link_libraries("${target}" PRIVATE @output_lib@)
if(WIN32)
target_link_options(${target} PRIVATE "/INCLUDE:${any_symbol_name}")
endif()
else()
# Otherwise (FFI) just use ALL to force building always
- add_custom_target("${target}_cargokit" ALL DEPENDS ${OUTPUT_LIB})
+ add_custom_target("${target}_cargokit" ALL DEPENDS @output_lib@)
endif()
# Allow adding the output library to plugin bundled libraries
- set("${target}_cargokit_lib" ${OUTPUT_LIB} PARENT_SCOPE)
+ set("${target}_cargokit_lib" @output_lib@ PARENT_SCOPE)
endfunction()

View File

@@ -0,0 +1,48 @@
{
lib,
rustPlatform,
stdenv,
replaceVars,
}:
{ version, src, ... }:
let
rustDep = rustPlatform.buildRustPackage {
pname = "flutter_discord_rpc-rs";
inherit version src;
buildAndTestSubdir = "rust";
cargoHash =
{
_1_0_0 = "sha256-C9WDE9+6V59yNCNVeMUY5lRpMJ+8XWpHpxzdTmz+/Yw=";
}
.${"_" + (lib.replaceStrings [ "." ] [ "_" ] version)} or (throw ''
Unsupported version of pub 'flutter_discord_rpc': '${version}'
Please add cargoHash here. If the cargoHash
is the same with existing versions, add an alias here.
'');
passthru.libraryPath = "lib/libflutter_discord_rpc.so";
};
in
stdenv.mkDerivation {
pname = "flutter_discord_rpc";
inherit version src;
inherit (src) passthru;
patches = [
(replaceVars ./cargokit.patch {
output_lib = "${rustDep}/${rustDep.passthru.libraryPath}";
})
];
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
}

View File

@@ -0,0 +1,72 @@
{
lib,
rustPlatform,
writeText,
stdenv,
}:
{ version, src, ... }:
let
rustDep = rustPlatform.buildRustPackage {
pname = "flutter_vodozemac-rs";
inherit version src;
sourceRoot = "${src.name}/rust";
cargoHash =
{
_0_2_2 = "sha256-Iw0AkHVjR1YmPe+C0YYBTDu5FsRk/ZpaRyBilcvqm6M=";
}
.${"_" + (lib.replaceStrings [ "." ] [ "_" ] version)} or (throw ''
Unsupported version of pub 'flutter_vodozemac': '${version}'
Please add cargoHash here. If the cargoHash
is the same with existing versions, add an alias here.
'');
passthru.libraryPath = "lib/libvodozemac_bindings_dart.so";
};
fakeCargokitCmake = writeText "FakeCargokit.cmake" ''
function(apply_cargokit target manifest_dir lib_name any_symbol_name)
set("''${target}_cargokit_lib" ${rustDep}/${rustDep.passthru.libraryPath} PARENT_SCOPE)
endfunction()
'';
getLibraryPath = ''
String _getLibraryPath() {
if (kIsWeb) {
return './';
}
try {
return Platform.resolvedExecutable + '/../lib/libvodozemac_bindings_dart.so';
} catch (_) {
return './';
}
}
'';
in
stdenv.mkDerivation {
pname = "flutter_vodozemac";
inherit version src;
passthru = src.passthru // {
# vodozemac-wasm in fluffychat will make use of it
inherit (rustDep) cargoDeps;
};
installPhase = ''
runHook preInstall
cp -r "$src" "$out"
pushd $out
chmod +rwx cargokit/cmake/cargokit.cmake
cp ${fakeCargokitCmake} cargokit/cmake/cargokit.cmake
chmod +rw lib/flutter_vodozemac.dart
substituteInPlace lib/flutter_vodozemac.dart \
--replace-warn "libraryPath: './'" "libraryPath: _getLibraryPath()"
echo "${getLibraryPath}" >> lib/flutter_vodozemac.dart
popd
runHook postInstall
'';
}

View File

@@ -0,0 +1,26 @@
{
stdenv,
}:
{ version, src, ... }:
stdenv.mkDerivation {
pname = "flutter_volume_controller";
inherit version src;
inherit (src) passthru;
postPatch = ''
substituteInPlace linux/CMakeLists.txt \
--replace-fail '# Include ALSA' 'find_package(PkgConfig REQUIRED)' \
--replace-fail 'find_package(ALSA REQUIRED)' 'pkg_check_modules(ALSA REQUIRED alsa)'
'';
installPhase = ''
runHook preInstall
mkdir $out
cp -r ./* $out/
runHook postInstall
'';
}

View File

@@ -0,0 +1,32 @@
{
stdenv,
lib,
writeScript,
cairo,
fribidi,
}:
{ version, src, ... }:
stdenv.mkDerivation rec {
pname = "handy-window";
inherit version src;
inherit (src) passthru;
setupHook = writeScript "${pname}-setup-hook" ''
handyWindowConfigureHook() {
export CFLAGS="$CFLAGS -isystem ${lib.getDev fribidi}/include/fribidi -isystem ${lib.getDev cairo}/include"
}
postConfigureHooks+=(handyWindowConfigureHook)
'';
installPhase = ''
runHook preInstall
mkdir -p "$out"
ln -s '${src}'/* "$out"
runHook postInstall
'';
}

View File

@@ -0,0 +1,31 @@
{
stdenv,
lib,
writeScript,
openssl,
}:
{ version, src, ... }:
stdenv.mkDerivation rec {
pname = "matrix";
inherit version src;
inherit (src) passthru;
setupHook = writeScript "${pname}-setup-hook" ''
matrixFixupHook() {
runtimeDependencies+=('${lib.getLib openssl}')
}
preFixupHooks+=(matrixFixupHook)
'';
installPhase = ''
runHook preInstall
mkdir -p "$out"
ln -s '${src}'/* "$out"
runHook postInstall
'';
}

View File

@@ -0,0 +1,38 @@
{
lib,
stdenv,
}:
# Implementation notes
# The patch exploits the fact that the download part is enclosed with "# ---"
# To use this module you will need to pass the CMake variable MIMALLOC_LIB
# example: -DMIMALLOC_LIB=${pkgs.mimalloc}/lib/mimalloc.o
# Direct link for the original CMakeLists.txt: https://raw.githubusercontent.com/media-kit/media-kit/main/libs/linux/media_kit_libs_linux/linux/CMakeLists.txt
{ version, src, ... }:
stdenv.mkDerivation {
pname = "media_kit_libs_linux";
inherit version src;
inherit (src) passthru;
dontBuild = true;
postPatch =
lib.optionalString (lib.versionAtLeast version "1.2.1") ''
sed -i '/if(MIMALLOC_USE_STATIC_LIBS)/,/unset(MIMALLOC_USE_STATIC_LIBS CACHE)/d' linux/CMakeLists.txt
''
+ lib.optionalString (lib.versionOlder version "1.2.1") ''
awk -i inplace 'BEGIN {opened = 0}; /# --*[^$]*/ { print (opened ? "]===]" : "#[===["); opened = !opened }; {print $0}' linux/CMakeLists.txt
'';
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
}

View File

@@ -0,0 +1,46 @@
--- old/linux/CMakeLists.txt
+++ new/linux/CMakeLists.txt
@@ -41,35 +41,6 @@
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter)
target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK)
-# ----------------------------------------------------------------------
-# Download and add objectbox-c prebuilt library.
-
-set(OBJECTBOX_VERSION 4.0.2)
-
-set(OBJECTBOX_ARCH ${CMAKE_SYSTEM_PROCESSOR})
-if (${OBJECTBOX_ARCH} MATCHES "x86_64")
- set(OBJECTBOX_ARCH x64)
-elseif (${OBJECTBOX_ARCH} MATCHES "^arm64" OR ${OBJECTBOX_ARCH} MATCHES "^armv8")
- set(OBJECTBOX_ARCH aarch64)
-elseif (${OBJECTBOX_ARCH} MATCHES "^armv7")
- set(OBJECTBOX_ARCH armv7hf)
-elseif (${OBJECTBOX_ARCH} MATCHES "^arm")
- set(OBJECTBOX_ARCH armv6hf)
-endif ()
-
-include(FetchContent)
-FetchContent_Declare(
- objectbox-download
- URL https://github.com/objectbox/objectbox-c/releases/download/v${OBJECTBOX_VERSION}/objectbox-linux-${OBJECTBOX_ARCH}.tar.gz
-)
-
-FetchContent_GetProperties(objectbox-download)
-if(NOT objectbox-download_POPULATED)
- FetchContent_Populate(objectbox-download)
-endif()
-
-# ----------------------------------------------------------------------
-
# List of absolute paths to libraries that should be bundled with the plugin.
# This list could contain prebuilt libraries, or libraries created by an
# external build triggered from this build file.
@@ -77,6 +48,6 @@
# Note: do not link the ObjectBox C library; the Dart library looks for it in a lib subfolder
# where flutter build puts it when added below.
set(objectbox_flutter_libs_bundled_libraries
- "${objectbox-download_SOURCE_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}objectbox${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ "@OBJECTBOX_SHARED_LIBRARY@"
PARENT_SCOPE
)

View File

@@ -0,0 +1,50 @@
{
lib,
stdenv,
fetchzip,
replaceVars,
}:
{ version, src, ... }:
let
selectSystem =
attrs:
attrs.${stdenv.hostPlatform.system}
or (throw "objectbox_flutter_libs: ${stdenv.hostPlatform.system} is not supported");
arch = selectSystem {
x86_64-linux = "x64";
aarch64-linux = "aarch64";
};
objectbox-sync = fetchzip {
url = "https://github.com/objectbox/objectbox-c/releases/download/v4.0.2/objectbox-sync-linux-${arch}.tar.gz";
hash = selectSystem {
x86_64-linux = "sha256-VXTuCYg0ZItK+lAs7xkNlxO0rUPnbRZOP5RAXbcRyjM=";
aarch64-linux = "sha256-kNlrBRR/qDEhdU34f4eDQLgYkYAIfFC8/of4rgL+m6k=";
};
stripRoot = false;
};
in
stdenv.mkDerivation {
pname = "objectbox_flutter_libs";
inherit version src;
inherit (src) passthru;
patches = [
(replaceVars ./CMakeLists.patch {
OBJECTBOX_SHARED_LIBRARY = "${objectbox-sync}/lib/libobjectbox.so";
})
];
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
meta.sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
}

View File

@@ -0,0 +1,31 @@
{
stdenv,
lib,
writeScript,
olm,
}:
{ version, src, ... }:
stdenv.mkDerivation rec {
pname = "olm";
inherit version src;
inherit (src) passthru;
setupHook = writeScript "${pname}-setup-hook" ''
olmFixupHook() {
runtimeDependencies+=('${lib.getLib olm}')
}
preFixupHooks+=(olmFixupHook)
'';
installPhase = ''
runHook preInstall
mkdir -p "$out"
ln -s '${src}'/* "$out"
runHook postInstall
'';
}

View File

@@ -0,0 +1,26 @@
{
stdenv,
pdfium-binaries,
}:
{ version, src, ... }:
stdenv.mkDerivation rec {
pname = "pdfrx";
inherit version src;
inherit (src) passthru;
postPatch = ''
substituteInPlace linux/CMakeLists.txt \
--replace-fail "\''${PDFIUM_DIR}/\''${PDFIUM_RELEASE}" "${pdfium-binaries}"
'';
installPhase = ''
runHook preInstall
mkdir $out
cp -a ./* $out/
runHook postInstall
'';
}

View File

@@ -0,0 +1,37 @@
{
stdenv,
pdfium-binaries,
replaceVars,
}:
{ version, src, ... }:
stdenv.mkDerivation rec {
pname = "printing";
inherit version src;
inherit (src) passthru;
prePatch = ''
if [ -d printing ]; then pushd printing; fi
'';
patches = [
(replaceVars ./printing.patch {
inherit pdfium-binaries;
})
];
postPatch = ''
popd || true
'';
dontBuild = true;
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
}

View File

@@ -0,0 +1,45 @@
--- old/linux/CMakeLists.txt 2024-07-16 18:45:19.000000000 +0800
+++ new/linux/CMakeLists.txt 2024-10-01 01:49:05.544910894 +0800
@@ -16,6 +16,7 @@
set(PROJECT_NAME "printing")
project(${PROJECT_NAME} LANGUAGES CXX)
+set(PDFIUM_DIR @pdfium-binaries@)
set(PDFIUM_VERSION "5200" CACHE STRING "Version of pdfium used")
string(REPLACE "linux-" "" TARGET_ARCH ${FLUTTER_TARGET_PLATFORM})
set(PDFIUM_ARCH ${TARGET_ARCH} CACHE STRING "Architecture of pdfium used")
@@ -32,18 +33,11 @@
)
endif()
-# Download pdfium
-include(../windows/DownloadProject.cmake)
-download_project(PROJ
- pdfium
- URL
- ${PDFIUM_URL})
-
# This value is used when generating builds using this plugin, so it must not be
# changed
set(PLUGIN_NAME "printing_plugin")
-include(${pdfium_SOURCE_DIR}/PDFiumConfig.cmake)
+include(${PDFIUM_DIR}/PDFiumConfig.cmake)
# System-level dependencies.
find_package(PkgConfig REQUIRED)
@@ -67,7 +61,7 @@
target_link_libraries(${PLUGIN_NAME}
PRIVATE PkgConfig::GTK PkgConfig::GTKUnixPrint)
target_link_libraries(${PLUGIN_NAME} PRIVATE pdfium)
-get_filename_component(PDFium_lib_path "${PDFium_LIBRARY}" DIRECTORY)
+set(PDFium_lib_path "${PDFIUM_DIR}/lib")
set_target_properties(${PLUGIN_NAME}
PROPERTIES SKIP_BUILD_RPATH
FALSE
@@ -77,4 +71,4 @@
"$ORIGIN:${PDFium_lib_path}")
# List of absolute paths to libraries that should be bundled with the plugin
-set(printing_bundled_libraries "${PDFium_LIBRARY}" PARENT_SCOPE)
+set(printing_bundled_libraries "${PDFIUM_DIR}/lib/libpdfium.so" PARENT_SCOPE)

View File

@@ -0,0 +1,90 @@
--- old/cargokit/cmake/cargokit.cmake 2024-11-08 13:36:13.345889693 +0800
+++ new/cargokit/cmake/cargokit.cmake 2024-11-08 13:45:26.019632176 +0800
@@ -17,83 +17,22 @@
function(apply_cargokit target manifest_dir lib_name any_symbol_name)
set(CARGOKIT_LIB_NAME "${lib_name}")
- set(CARGOKIT_LIB_FULL_NAME "${CMAKE_SHARED_MODULE_PREFIX}${CARGOKIT_LIB_NAME}${CMAKE_SHARED_MODULE_SUFFIX}")
- if (CMAKE_CONFIGURATION_TYPES)
- set(CARGOKIT_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
- set(OUTPUT_LIB "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${CARGOKIT_LIB_FULL_NAME}")
- else()
- set(CARGOKIT_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
- set(OUTPUT_LIB "${CMAKE_CURRENT_BINARY_DIR}/${CARGOKIT_LIB_FULL_NAME}")
- endif()
- set(CARGOKIT_TEMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/cargokit_build")
-
- if (FLUTTER_TARGET_PLATFORM)
- set(CARGOKIT_TARGET_PLATFORM "${FLUTTER_TARGET_PLATFORM}")
- else()
- set(CARGOKIT_TARGET_PLATFORM "windows-x64")
- endif()
-
- set(CARGOKIT_ENV
- "CARGOKIT_CMAKE=${CMAKE_COMMAND}"
- "CARGOKIT_CONFIGURATION=$<CONFIG>"
- "CARGOKIT_MANIFEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${manifest_dir}"
- "CARGOKIT_TARGET_TEMP_DIR=${CARGOKIT_TEMP_DIR}"
- "CARGOKIT_OUTPUT_DIR=${CARGOKIT_OUTPUT_DIR}"
- "CARGOKIT_TARGET_PLATFORM=${CARGOKIT_TARGET_PLATFORM}"
- "CARGOKIT_TOOL_TEMP_DIR=${CARGOKIT_TEMP_DIR}/tool"
- "CARGOKIT_ROOT_PROJECT_DIR=${CMAKE_SOURCE_DIR}"
- )
-
- if (WIN32)
- set(SCRIPT_EXTENSION ".cmd")
- set(IMPORT_LIB_EXTENSION ".lib")
- else()
- set(SCRIPT_EXTENSION ".sh")
- set(IMPORT_LIB_EXTENSION "")
- execute_process(COMMAND chmod +x "${cargokit_cmake_root}/run_build_tool${SCRIPT_EXTENSION}")
- endif()
-
- # Using generators in custom command is only supported in CMake 3.20+
- if (CMAKE_CONFIGURATION_TYPES AND ${CMAKE_VERSION} VERSION_LESS "3.20.0")
- foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES)
- add_custom_command(
- OUTPUT
- "${CMAKE_CURRENT_BINARY_DIR}/${CONFIG}/${CARGOKIT_LIB_FULL_NAME}"
- "${CMAKE_CURRENT_BINARY_DIR}/_phony_"
- COMMAND ${CMAKE_COMMAND} -E env ${CARGOKIT_ENV}
- "${cargokit_cmake_root}/run_build_tool${SCRIPT_EXTENSION}" build-cmake
- VERBATIM
- )
- endforeach()
- else()
- add_custom_command(
- OUTPUT
- ${OUTPUT_LIB}
- "${CMAKE_CURRENT_BINARY_DIR}/_phony_"
- COMMAND ${CMAKE_COMMAND} -E env ${CARGOKIT_ENV}
- "${cargokit_cmake_root}/run_build_tool${SCRIPT_EXTENSION}" build-cmake
- VERBATIM
- )
- endif()
-
-
- set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/_phony_" PROPERTIES SYMBOLIC TRUE)
if (TARGET ${target})
# If we have actual cmake target provided create target and make existing
# target depend on it
- add_custom_target("${target}_cargokit" DEPENDS ${OUTPUT_LIB})
+ add_custom_target("${target}_cargokit" DEPENDS @output_lib@)
add_dependencies("${target}" "${target}_cargokit")
- target_link_libraries("${target}" PRIVATE "${OUTPUT_LIB}${IMPORT_LIB_EXTENSION}")
+ target_link_libraries("${target}" PRIVATE @output_lib@)
if(WIN32)
target_link_options(${target} PRIVATE "/INCLUDE:${any_symbol_name}")
endif()
else()
# Otherwise (FFI) just use ALL to force building always
- add_custom_target("${target}_cargokit" ALL DEPENDS ${OUTPUT_LIB})
+ add_custom_target("${target}_cargokit" ALL DEPENDS @output_lib@)
endif()
# Allow adding the output library to plugin bundled libraries
- set("${target}_cargokit_lib" ${OUTPUT_LIB} PARENT_SCOPE)
+ set("${target}_cargokit_lib" @output_lib@ PARENT_SCOPE)
endfunction()

View File

@@ -0,0 +1,77 @@
{
lib,
rustPlatform,
stdenv,
replaceVars,
}:
{ version, src, ... }:
let
rustDep = rustPlatform.buildRustPackage {
pname = "rhttp-rs";
inherit version src;
sourceRoot = "${src.name}/rust";
unpackPhase = ''
runHook preUnpack
if [ -d $src/rhttp ]; then
cp -r $src/rhttp ${src.name}
else
cp -r $src ${src.name}
fi
chmod -R u+w -- "$sourceRoot"
runHook postUnpack
'';
cargoHash =
{
_0_9_1 = "sha256-ZVl1nesepZnmOWeJPOgE6IDCokQm5FedbA5MBvr5S8c=";
_0_9_6 = "sha256-vvzb+jNN5lmRrKJ3zqvORvdduqEHRmbp85L/9Zegh/E=";
_0_9_8 = "sha256-cwb1wYVXOE5YABlMxUDt+OMlDpIlipqeNI7ZFAGHCqo=";
_0_10_0 = "sha256-2SpAj53XvZXKRpMzFXJGcx7E2TlMUD+ooHkFwg/9fe4=";
_0_11_0 = "sha256-sngh5k9GoCZhnIFTpnAVHZjxTcOv+Ui6pJ2cFyriL84=";
_0_12_0 = "sha256-W2DcBy1n73nR2oZIQcFt6A+NElQWtfEtKB1YIweQUVo=";
}
.${"_" + (lib.replaceStrings [ "." ] [ "_" ] version)} or (throw ''
Unsupported version of pub 'rhttp': '${version}'
Please add cargoHash here. If the cargoHash
is the same with existing versions, add an alias here.
'');
env.RUSTFLAGS = "--cfg reqwest_unstable";
passthru.libraryPath = "lib/librhttp.so";
};
in
stdenv.mkDerivation {
pname = "rhttp";
inherit version src;
inherit (src) passthru;
prePatch = ''
if [ -d rhttp ]; then pushd rhttp; fi
'';
patches = [
(replaceVars ./cargokit.patch {
output_lib = "${rustDep}/${rustDep.passthru.libraryPath}";
})
];
postPatch = ''
popd || true
'';
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
}

View File

@@ -0,0 +1,35 @@
{
lib,
stdenv,
fetchFromGitHub,
}:
{ version, src, ... }:
let
sentry-native = fetchFromGitHub {
owner = "getsentry";
repo = "sentry-native";
tag = "0.9.1";
fetchSubmodules = true;
hash = "sha256-1jyJGiIrX0TsRDzAeg3IuE1Vf5STAaG8JVxdbmPMXGQ=";
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "sentry_flutter";
inherit version src;
inherit (src) passthru;
postPatch = lib.optionalString (lib.versionAtLeast version "8.10.0") ''
sed -i "s|GIT_REPOSITORY.*|SOURCE_DIR "${sentry-native}"|" sentry-native/sentry-native.cmake
sed -i '/GIT_TAG/d' sentry-native/sentry-native.cmake
'';
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
})

View File

@@ -0,0 +1,56 @@
{
stdenv,
fetchurl,
lib,
}:
{ version, src, ... }:
let
artifacts =
lib.mapAttrs
(version: hash: rec {
file = fetchurl {
inherit url hash;
};
url =
if lib.versionOlder version "v4_6_1" then
"https://storage.googleapis.com/simon-public-euw3/assets/sqlcipher/${version}.c"
else
"https://fsn1.your-objectstorage.com/simon-public/assets/sqlcipher/${version}.c";
})
{
v4_10_0 = "sha256-3njvCHy8Juj+WE3gXxeQ8+NIl9uHMegVTcZ00/LfKMs=";
v4_9_0 = "sha256-uqvW5BgMjCS0GzeEDeGskb4It0NkWjNUpyXpGlBSIlc=";
v4_8_0 = "sha256-nfYmi9PJlMbLqiFRksOIUXYHgD8LL2AVey9GCUc03Jw=";
v4_6_1 = "sha256-8kBJiy8g1odpBQQUF5A7f9g3+WStbJTARyfvAi84YVE=";
v4_5_7 = "sha256-lDgSEVGZcoruF7nAp0C2kr6TN7XllpMzMVi/R1XfGP4=";
v4_5_6 = "sha256-evZl3JUeyAfW0fGJ0EfFQs64Z/yRCZGeOeDGgXrFHFU=";
};
in
stdenv.mkDerivation rec {
pname = "sqlcipher_flutter_libs";
inherit version src;
inherit (src) passthru;
installPhase = ''
runHook preInstall
cp -r "$src" "$out"
_replace() {
# --replace-fail messes with the file if it fails (is empty afterwards) so we do this instead
if cat "$out/linux/CMakeLists.txt" | grep "$1" >/dev/null 2>/dev/null; then
substituteInPlace "$out/linux/CMakeLists.txt" --replace "$1" "file://$2"
else
return 2
fi
}
${lib.concatMapAttrsStringSep " || " (_: v: ''_replace "${v.url}" "${v.file}"'') artifacts} || \
(echo "unknown version of sqlcipher, please add to pkgs/development/compilers/dart/package-source-builders/sqlcipher_flutter_libs" && cat linux/CMakeLists.txt | grep "https://storage.*" -o && exit 2)
runHook postInstall
'';
meta.sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
}

View File

@@ -0,0 +1,31 @@
{
stdenv,
lib,
writeScript,
sqlite,
}:
{ version, src, ... }:
stdenv.mkDerivation rec {
pname = "sqlite3";
inherit version src;
inherit (src) passthru;
setupHook = writeScript "${pname}-setup-hook" ''
sqliteFixupHook() {
runtimeDependencies+=('${lib.getLib sqlite}')
}
preFixupHooks+=(sqliteFixupHook)
'';
installPhase = ''
runHook preInstall
mkdir -p "$out"
ln -s '${src}'/* "$out"
runHook postInstall
'';
}

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
'';
}

View File

@@ -0,0 +1,95 @@
{
lib,
rustPlatform,
pkg-config,
at-spi2-atk,
gdk-pixbuf,
cairo,
gtk3,
writeText,
stdenv,
}:
{ version, src, ... }:
let
rustDep = rustPlatform.buildRustPackage {
pname = "super_native_extensions-rs";
inherit version src;
unpackPhase = ''
runHook preUnpack
if [ -d $src/super_native_extensions ]; then
cp -r $src/super_native_extensions ${src.name}
else
cp -r $src ${src.name}
fi
chmod -R u+w -- "$sourceRoot"
runHook postUnpack
'';
sourceRoot = "${src.name}/rust";
cargoHash =
rec {
_0_9_1 = _0_9_0-dev_6;
_0_9_0-dev_6 = "sha256-1yJIbBxScmkCwy/e+/z2cYA8qQBfT0yoIBmOSPVd4h4=";
_0_9_0-dev_5 = _0_8_22;
_0_9_0-dev_3 = _0_8_22;
_0_8_22 = "sha256-gYYoC3bGJrYY1uUHfqMv6pp4SK+P9fRoBsLtf34rsCg=";
_0_8_24 = _0_8_22;
_0_8_21 = _0_8_22;
_0_8_20 = _0_8_22;
_0_8_19 = _0_8_22;
_0_8_18 = _0_8_22;
_0_8_17 = _0_8_22;
}
.${"_" + (lib.replaceStrings [ "." ] [ "_" ] version)} or (throw ''
Unsupported version of pub 'super_native_extensions': '${version}'
Please add cargoHash to here. If the cargoHash
is the same with existing versions, add an alias here.
'');
nativeBuildInputs = [ pkg-config ];
buildInputs = [
at-spi2-atk
gdk-pixbuf
cairo
gtk3
];
passthru.libraryPath = "lib/libsuper_native_extensions.so";
};
fakeCargokitCmake = writeText "FakeCargokit.cmake" ''
function(apply_cargokit target manifest_dir lib_name any_symbol_name)
target_link_libraries("''${target}" PRIVATE ${rustDep}/${rustDep.passthru.libraryPath})
set("''${target}_cargokit_lib" ${rustDep}/${rustDep.passthru.libraryPath} PARENT_SCOPE)
endfunction()
'';
in
stdenv.mkDerivation {
pname = "super_native_extensions";
inherit version src;
inherit (src) passthru;
installPhase = ''
runHook preInstall
cp -r "$src" "$out"
if [ -d $out/super_native_extensions ]; then
pushd $out/super_native_extensions
else
pushd $out
fi
chmod +rwx cargokit/cmake/cargokit.cmake
cp ${fakeCargokitCmake} cargokit/cmake/cargokit.cmake
popd
runHook postInstall
'';
}

View File

@@ -0,0 +1,23 @@
{
stdenv,
libayatana-appindicator,
}:
{ version, src, ... }:
stdenv.mkDerivation rec {
pname = "system-tray";
inherit version src;
inherit (src) passthru;
installPhase = ''
runHook preInstall
mkdir -p "$out"
cp -r '${src}'/* "$out"
substituteInPlace "$out/linux/tray.cc" \
--replace "libappindicator3.so.1" "${libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
runHook postInstall
'';
}

View File

@@ -0,0 +1,26 @@
{
lib,
stdenv,
}:
{ version, src, ... }:
stdenv.mkDerivation {
pname = "volume_controller";
inherit version src;
inherit (src) passthru;
postPatch = lib.optionalString (lib.versionAtLeast version "3.4.0") ''
substituteInPlace linux/CMakeLists.txt \
--replace-fail "# ALSA dependency for volume control" "find_package(PkgConfig REQUIRED)" \
--replace-fail "find_package(ALSA REQUIRED)" "pkg_check_modules(ALSA REQUIRED alsa)"
'';
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
}

View File

@@ -0,0 +1,25 @@
{
stdenv,
xdg-user-dirs,
}:
{ version, src, ... }:
stdenv.mkDerivation rec {
pname = "xdg_directories";
inherit version src;
inherit (src) passthru;
postPatch = ''
substituteInPlace ./lib/xdg_directories.dart \
--replace-fail "'xdg-user-dir'," "'${xdg-user-dirs}/bin/xdg-user-dir',"
'';
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
}