Set to use the new Homebrew formulae

Fix #3654, #3659
This commit is contained in:
SeongTae Jeong
2024-06-16 18:43:07 +09:00
parent d54933c4cd
commit 25f7ef37b1
4 changed files with 17 additions and 47 deletions

View File

@@ -34,7 +34,9 @@ jobs:
run: | run: |
brew update brew update
brew tap sqlitebrowser/tap 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 npm install -g appdmg
- name: Configure build - name: Configure build
@@ -65,7 +67,7 @@ jobs:
run: ninja test run: ninja test
- name: Build Extension - 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' - if: github.event_name != 'pull_request'
name: Notarization name: Notarization

View File

@@ -27,7 +27,6 @@ The wiki has information that is a bit more detailed or less common, but may be
- [OpenSUSE](#opensuse) - [OpenSUSE](#opensuse)
- [macOS](#macos) - [macOS](#macos)
- [Build an `.app` bundle](#build-an-app-bundle) - [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) - [Windows](#windows)
- [Compiling on Windows with MSVC](#compiling-on-windows-with-msvc) - [Compiling on Windows with MSVC](#compiling-on-windows-with-msvc)
- [Cross compiling for Windows](#cross-compiling-for-windows) - [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 ```bash
brew tap sqlitebrowser/tap brew tap sqlitebrowser/tap
# If you are using Apple Silicon Mac # If you are using Apple Silicon Mac
brew install db4subqt@5 db4subsqlcipher db4subsqlitefts@5 brew install sqlb-qt@5 sqlb-sqlcipher sqlb-sqlite
# If you are using Intel Mac
brew install db4sqt@5 db4ssqlcipher db4ssqlitefts@5
``` ```
> 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: 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> > If you want to build universal binary, change the `cmake` command to<br>
> `cmake -DcustomTap=1 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" ..`<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. 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) > 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 ### Windows

View File

@@ -123,12 +123,12 @@ if(APPLE)
# For Apple Silicon Mac's and install dependencies via our Homebrew tap(sqlitebrowser/homebrew-tap) # For Apple Silicon Mac's and install dependencies via our Homebrew tap(sqlitebrowser/homebrew-tap)
if(customTap AND EXISTS /opt/homebrew/opt/) 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/sqlb-qt@5")
list(PREPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/db4subsqlitefts@5") list(PREPEND CMAKE_PREFIX_PATH "/opt/homebrew/opt/sqlb-sqlite")
if(sqlcipher) if(sqlcipher)
list(APPEND SQLCIPHER_INCLUDE_DIR "/opt/homebrew/include") 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() endif()
endif() endif()

View File

@@ -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 security list-keychain -d user -s $KEYCHAIN_PATH
# Run macdeployqt # 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 # Add the 'formats' and 'nalgeon/sqlean' extensions to the app bundle
gh auth login --with-token <<< "$GH_TOKEN" 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') TARGET=$(echo $TARGET | sed -e 's/_/ /g')
mkdir "$TARGET/Contents/Extensions" 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 if [ -f "$TARGET/Contents/Extensions/formats.dylib" ]; then
install_name_tool -id "@executable_path/../Extensions/formats.dylib" "$TARGET/Contents/Extensions/formats.dylib" install_name_tool -id "@executable_path/../Extensions/formats.dylib" "$TARGET/Contents/Extensions/formats.dylib"
ln -s formats.dylib "$TARGET/Contents/Extensions/formats.dylib.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') TARGET=$(echo $TARGET | sed -e 's/_/ /g')
mkdir "$TARGET/Contents/translations" 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 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 sqlb-qt@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 sqlb-qt@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 sqlb-qt@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 sqlb-qt@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 "qtxmlpatterns_${i}.qm" 2> /dev/null -exec cp {} "$TARGET/Contents/translations/" \;
done done
done done