sqlitebrowser: add .app bundle for darwin (#495064)

This commit is contained in:
Sandro
2026-03-09 23:39:46 +00:00
committed by GitHub
2 changed files with 16 additions and 35 deletions
-35
View File
@@ -1,17 +1,6 @@
diff -ru source/CMakeLists.txt source-patched/CMakeLists.txt
--- source/CMakeLists.txt 1970-01-01 01:00:01.000000000 +0100
+++ source-patched/CMakeLists.txt 2024-09-03 11:09:48.289053141 +0200
@@ -39,9 +39,7 @@
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-if(APPLE)
- add_executable(${PROJECT_NAME} MACOSX_BUNDLE)
-elseif(WIN32)
+if(WIN32)
add_executable(${PROJECT_NAME} WIN32)
else()
add_executable(${PROJECT_NAME})
@@ -106,33 +104,6 @@
list(PREPEND CMAKE_PREFIX_PATH ${QT5_PATH} ${SQLITE3_PATH})
endif()
@@ -60,27 +49,3 @@ diff -ru source/CMakeLists.txt source-patched/CMakeLists.txt
find_package(${LIBSQLITE_NAME})
if (sqlcipher)
target_link_libraries(${PROJECT_NAME} SQLCipher::SQLCipher)
@@ -510,7 +474,7 @@
endif()
endif()
-if((NOT WIN32 AND NOT APPLE) OR MINGW)
+if(NOT WIN32 OR MINGW)
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -630,14 +594,6 @@
)
endif()
-if(APPLE)
- set_target_properties(${PROJECT_NAME} PROPERTIES
- BUNDLE True
- OUTPUT_NAME "DB Browser for SQLite"
- MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/src/app.plist
- )
-endif()
-
# CPack configuration
set(CPACK_STRIP_FILES ON)
set(CPACK_DEBIAN_PACKAGE_PRIORITY optional)
+16
View File
@@ -6,6 +6,7 @@
pkg-config,
libsForQt5,
sqlcipher,
nix-update-script,
}:
let
@@ -28,6 +29,9 @@ stdenv.mkDerivation (finalAttrs: {
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace-fail '"Unknown"' '"${finalAttrs.src.rev}"'
substituteInPlace src/app.plist \
--replace-fail '@ICON@' 'icon.icns'
''
# Fix build with CMake 4
# Will be part of the Qt6 port
@@ -62,10 +66,22 @@ stdenv.mkDerivation (finalAttrs: {
(lib.cmakeFeature "QSCINTILLA_INCLUDE_DIR" "${lib.getDev qt'.qscintilla}/include")
];
postInstall = lib.optional stdenv.hostPlatform.isDarwin ''
# Copy the icon file to the app bundle
target="$(find . -name "*.app")"
mkdir -p "$target/Contents/Resources/"
cp $src/installer/macos/macapp.icns "$target/Contents/Resources/icon.icns"
mkdir -p $out/Applications
cp -r *.app $out/Applications
'';
env.LANG = "C.UTF-8";
doCheck = true;
passthru.updateScript = nix-update-script { };
meta = {
description = "DB Browser for SQLite";
mainProgram = "sqlitebrowser";