mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2025-12-20 11:00:43 -06:00
6
.github/workflows/build-macos.yml
vendored
6
.github/workflows/build-macos.yml
vendored
@@ -34,7 +34,9 @@ jobs:
|
||||
run: |
|
||||
brew update
|
||||
brew tap sqlitebrowser/tap
|
||||
brew install db4subqt@5 db4subsqlcipher db4subsqlitefts@5 ninja
|
||||
brew unlink openssl@3
|
||||
brew install sqlb-openssl@3
|
||||
brew install sqlb-qt@5 sqlb-sqlcipher sqlb-sqlite ninja
|
||||
npm install -g appdmg
|
||||
|
||||
- name: Configure build
|
||||
@@ -65,7 +67,7 @@ jobs:
|
||||
run: ninja test
|
||||
|
||||
- name: Build Extension
|
||||
run: clang -I /opt/homebrew/opt/db4subsqlitefts@5/include -L /opt/homebrew/opt/db4subsqlitefts@5/lib -fno-common -dynamiclib src/extensions/extension-formats.c
|
||||
run: clang -I /opt/homebrew/opt/sqlb-sqlite/include -L /opt/homebrew/opt/sqlb-sqlite/lib -fno-common -dynamiclib src/extensions/extension-formats.c
|
||||
|
||||
- if: github.event_name != 'pull_request'
|
||||
name: Notarization
|
||||
|
||||
38
BUILDING.md
38
BUILDING.md
@@ -27,7 +27,6 @@ The wiki has information that is a bit more detailed or less common, but may be
|
||||
- [OpenSUSE](#opensuse)
|
||||
- [macOS](#macos)
|
||||
- [Build an `.app` bundle](#build-an-app-bundle)
|
||||
- [Add the extension to the app bundle (Optional)](#add-the-extension-to-the-app-bundle-optional)
|
||||
- [Windows](#windows)
|
||||
- [Compiling on Windows with MSVC](#compiling-on-windows-with-msvc)
|
||||
- [Cross compiling for Windows](#cross-compiling-for-windows)
|
||||
@@ -138,11 +137,9 @@ It requires SQLite and at least Qt 5.15.9 to be installed first. These are the
|
||||
```bash
|
||||
brew tap sqlitebrowser/tap
|
||||
# If you are using Apple Silicon Mac
|
||||
brew install db4subqt@5 db4subsqlcipher db4subsqlitefts@5
|
||||
# If you are using Intel Mac
|
||||
brew install db4sqt@5 db4ssqlcipher db4ssqlitefts@5
|
||||
brew install sqlb-qt@5 sqlb-sqlcipher sqlb-sqlite
|
||||
```
|
||||
> You can don't need SQLCipher support, you can skip `db4ssqlcipher` and `db4ssqlitefts@5`.
|
||||
> You can don't need SQLCipher support, you can skip `sqlb-sqlcipher`.
|
||||
|
||||
Then it's just a matter of getting the source:
|
||||
|
||||
@@ -163,39 +160,10 @@ mv DB\ Browser\ for\ SQLite.app /Applications
|
||||
|
||||
> If you want to build universal binary, change the `cmake` command to<br>
|
||||
> `cmake -DcustomTap=1 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" ..`<br>
|
||||
> Of course, this requires you to have an Apple Silicon Mac and an installation of formula starting with `db4sub`.
|
||||
> Of course, this requires you to have an Apple Silicon Mac.
|
||||
|
||||
An icon for "DB Browser for SQLite" should now be in your main macOS Applications list, ready to launch.
|
||||
|
||||
#### Add the extension to the app bundle (Optional)
|
||||
|
||||
> **Note**: The following lines look a bit complicated, but are all commands that you need to run.
|
||||
|
||||
```bash
|
||||
/opt/homebrew/opt/db4sqtub@5/bin/macdeployqt DB\ Browser\ for\ SQLite.app
|
||||
mkdir build/DB\ Browser\ for\ SQLite.app/Contents/Extensions
|
||||
clang -I /opt/homebrew/opt/db4ssqliteftsub@5/include -L /opt/homebrew/opt/db4ssqliteftsub@5/lib -fno-common -dynamiclib src/extensions/extension-formats.c -o formats-arm64.dylib
|
||||
arch -x86_64 clang -I /opt/homebrew/opt/db4ssqliteftsub@5/include -L /opt/homebrew/opt/db4ssqliteftsub@5/lib -fno-common -dynamiclib src/extensions/extension-formats.c -o formats-x86_64.dylib
|
||||
lipo -create -output build/DB\ Browser\ for\ SQLite.app/Contents/Extensions/formats.dylib formats-arm64.dylib formats-x86_64.dylib
|
||||
install_name_tool -id "@executable_path/../Extensions/formats.dylib" build/DB\ Browser\ for\ SQLite.app/Contents/Extensions/formats.dylib
|
||||
ln -s formats.dylib build/DB\ Browser\ for\ SQLite.app/Contents/Extensions/formats.dylib.dylib
|
||||
|
||||
clang -I /opt/homebrew/opt/db4ssqliteftsub@5/include -L /opt/homebrew/opt/db4ssqliteftsub@5/lib -fno-common -dynamiclib src/extensions/extension-functions.c -o math-arm64.dylib
|
||||
arch -x86_64 clang -I /opt/homebrew/opt/db4ssqliteftsub@5/include -L /opt/homebrew/opt/db4ssqliteftsub@5/lib -fno-common -dynamiclib src/extensions/extension-functions.c -o math-x86_64.dylib
|
||||
lipo -create -output build/DB\ Browser\ for\ SQLite.app/Contents/Extensions/math.dylib math-arm64.dylib math-x86_64.dylib
|
||||
install_name_tool -id "@executable_path/../Extensions/math.dylib" build/DB\ Browser\ for\ SQLite.app/Contents/Extensions/math.dylib
|
||||
ln -s math.dylib build/DB\ Browser\ for\ SQLite.app/Contents/Extensions/math.dylib.dylib
|
||||
|
||||
curl -L -o src/extensions/fileio.c 'https://sqlite.org/src/raw?filename=ext/misc/fileio.c&ci=trunk'
|
||||
curl -L -o src/extensions/test_windirent.c 'https://sqlite.org/src/raw?filename=src/test_windirent.c&ci=trunk'
|
||||
curl -L -o src/extensions/test_windirent.h 'https://sqlite.org/src/raw?filename=src/test_windirent.h&ci=trunk'
|
||||
clang -I /opt/homebrew/opt/db4ssqliteftsub@5/include -L /opt/homebrew/opt/db4ssqliteftsub@5/lib -fno-common -dynamiclib src/extensions/fileio.c src/extensions/test_windirent.c -o fileio-arm64.dylib
|
||||
arch -x86_64 clang -I /opt/homebrew/opt/db4ssqliteftsub@5/include -L /opt/homebrew/opt/db4ssqliteftsub@5/lib -fno-common -dynamiclib src/extensions/fileio.c src/extensions/test_windirent.c -o fileio-x86_64.dylib
|
||||
lipo -create -output build/DB\ Browser\ for\ SQLite.app/Contents/Extensions/fileio.dylib fileio-arm64.dylib fileio-x86_64.dylib
|
||||
install_name_tool -id "@executable_path/../Extensions/fileio.dylib" build/DB\ Browser\ for\ SQLite.app/Contents/Extensions/fileio.dylib
|
||||
ln -s fileio.dylib build/DB\ Browser\ for\ SQLite.app/Contents/Extensions/fileio.dylib.dylib
|
||||
```
|
||||
|
||||
> Also, we have a CI workflow for macOS, you can check it out [here](https://github.com/sqlitebrowser/sqlitebrowser/blob/master/.github/workflows/build-macos.yml)
|
||||
|
||||
### Windows
|
||||
|
||||
@@ -123,12 +123,12 @@ if(APPLE)
|
||||
|
||||
# For Apple Silicon Mac's and install dependencies via our Homebrew tap(sqlitebrowser/homebrew-tap)
|
||||
if(customTap AND EXISTS /opt/homebrew/opt/)
|
||||
list(PREPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/db4subqt@5")
|
||||
list(PREPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/db4subsqlitefts@5")
|
||||
list(PREPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/sqlb-qt@5")
|
||||
list(PREPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/sqlb-sqlite")
|
||||
|
||||
if(sqlcipher)
|
||||
list(APPEND SQLCIPHER_INCLUDE_DIR "/opt/homebrew/include")
|
||||
list(APPEND SQLCIPHER_LIBRARY "/opt/homebrew/opt/db4subsqlcipher/lib/libsqlcipher.0.dylib")
|
||||
list(APPEND SQLCIPHER_LIBRARY "/opt/homebrew/opt/sqlb-sqlcipher/lib/libsqlcipher.0.dylib")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -10,7 +10,7 @@ security import $CERTIFICATE_PATH -P "$P12_PW" -A -t cert -f pkcs12 -k $KEYCHAIN
|
||||
security list-keychain -d user -s $KEYCHAIN_PATH
|
||||
|
||||
# Run macdeployqt
|
||||
find build -name "DB Browser for SQL*.app" -exec $(brew --prefix db4subqt@5)/bin/macdeployqt {} -sign-for-notarization=$DEV_ID \;
|
||||
find build -name "DB Browser for SQL*.app" -exec $(brew --prefix sqlb-qt@5)/bin/macdeployqt {} -sign-for-notarization=$DEV_ID \;
|
||||
|
||||
# Add the 'formats' and 'nalgeon/sqlean' extensions to the app bundle
|
||||
gh auth login --with-token <<< "$GH_TOKEN"
|
||||
@@ -23,7 +23,7 @@ for TARGET in $(find build -name "DB Browser for SQL*.app" | sed -e 's/ /_/g');
|
||||
TARGET=$(echo $TARGET | sed -e 's/_/ /g')
|
||||
mkdir "$TARGET/Contents/Extensions"
|
||||
|
||||
clang -I /opt/homebrew/opt/db4subsqlitefts@5/include -L /opt/homebrew/opt/db4subsqlitefts@5/lib -fno-common -dynamiclib src/extensions/extension-formats.c -o "$TARGET/Contents/Extensions/formats.dylib"
|
||||
clang -I /opt/homebrew/opt/sqlb-sqlite/include -L /opt/homebrew/opt/sqlb-sqlite/lib -fno-common -dynamiclib src/extensions/extension-formats.c -o "$TARGET/Contents/Extensions/formats.dylib"
|
||||
if [ -f "$TARGET/Contents/Extensions/formats.dylib" ]; then
|
||||
install_name_tool -id "@executable_path/../Extensions/formats.dylib" "$TARGET/Contents/Extensions/formats.dylib"
|
||||
ln -s formats.dylib "$TARGET/Contents/Extensions/formats.dylib.dylib"
|
||||
@@ -47,11 +47,11 @@ for TARGET in $(find build -name "DB Browser for SQL*.app" | sed -e 's/ /_/g');
|
||||
TARGET=$(echo $TARGET | sed -e 's/_/ /g')
|
||||
mkdir "$TARGET/Contents/translations"
|
||||
for i in ar cs de en es fr it ko pl pt pt_BR ru uk zh_CN zh_TW; do
|
||||
find $(brew --prefix db4subqt@5)/translations -name "qt_${i}.qm" 2> /dev/null -exec cp {} "$TARGET/Contents/translations/" \;
|
||||
find $(brew --prefix db4subqt@5)/translations -name "qtbase_${i}.qm" 2> /dev/null -exec cp {} "$TARGET/Contents/translations/" \;
|
||||
find $(brew --prefix db4subqt@5)/translations -name "qtmultimedia_${i}.qm" 2> /dev/null -exec cp {} "$TARGET/Contents/translations/" \;
|
||||
find $(brew --prefix db4subqt@5)/translations -name "qtscript_${i}.qm" 2> /dev/null -exec cp {} "$TARGET/Contents/translations/" \;
|
||||
find $(brew --prefix db4subqt@5)/translations -name "qtxmlpatterns_${i}.qm" 2> /dev/null -exec cp {} "$TARGET/Contents/translations/" \;
|
||||
find $(brew --prefix sqlb-qt@5)/translations -name "qt_${i}.qm" 2> /dev/null -exec cp {} "$TARGET/Contents/translations/" \;
|
||||
find $(brew --prefix sqlb-qt@5)/translations -name "qtbase_${i}.qm" 2> /dev/null -exec cp {} "$TARGET/Contents/translations/" \;
|
||||
find $(brew --prefix sqlb-qt@5)/translations -name "qtmultimedia_${i}.qm" 2> /dev/null -exec cp {} "$TARGET/Contents/translations/" \;
|
||||
find $(brew --prefix sqlb-qt@5)/translations -name "qtscript_${i}.qm" 2> /dev/null -exec cp {} "$TARGET/Contents/translations/" \;
|
||||
find $(brew --prefix sqlb-qt@5)/translations -name "qtxmlpatterns_${i}.qm" 2> /dev/null -exec cp {} "$TARGET/Contents/translations/" \;
|
||||
done
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user