Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions .github/actions/notarize-macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ inputs:
required: true
DEV_ID:
required: true
GH_TOKEN:
required: true
KEYCHAIN_PATH:
required: true
KEYCHAIN_PW:
Expand All @@ -32,32 +34,26 @@ runs:
shell: bash
run: find build -name "DB Browser for SQL*.app" -exec /opt/homebrew/opt/db4subqt@5/bin/macdeployqt {} -sign-for-notarization="${{ inputs.DEV_ID }}" \;

- name: Add the extension to the app bundle
- name: Add the 'nalgeon/sqlean' extension to the app bundle
shell: bash
run: |
gh auth login --with-token <<< "${{ inputs.GH_TOKEN }}"
gh release download --pattern "sqlean-macos-arm64.zip" --repo "nalgeon/sqlean"
unzip sqlean-macos-arm64.zip
for TARGET in $(find build -name "DB Browser for SQL*.app" | sed -e 's/ /_/g'); do
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/db4subsqlitefts@5/include -L /opt/homebrew/opt/db4subsqlitefts@5/lib -fno-common -dynamiclib src/extensions/extension-functions.c -o "$TARGET/Contents/Extensions/math.dylib"

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"
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"
fi
if [ -f "$TARGET/Contents/Extensions/math.dylib" ]; then
install_name_tool -id "@executable_path/../Extensions/math.dylib" "$TARGET/Contents/Extensions/math.dylib"
ln -s math.dylib "$TARGET/Contents/Extensions/math.dylib.dylib"
fi

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_windirect.c 'https://sqlite.org/src/raw?filename=src/test_windirent.c&ci=trunk'
curl -L -o src/extensions/test_windirect.h 'https://sqlite.org/src/raw?filename=src/test_windirent.h&ci=trunk'
clang -I /opt/homebrew/opt/db4subsqlitefts@5/include -L /opt/homebrew/opt/db4subsqlitefts@5/lib -fno-common -dynamiclib src/extensions/fileio.c src/extensions/test_windirect.c -o "$TARGET/Contents/Extensions/fileio.dylib"

if [ -f "$TARGET/Contents/Extensions/fileio.dylib" ]; then
install_name_tool -id "@executable_path/../Extensions/fileio.dylib" "$TARGET/Contents/Extensions/fileio.dylib"
ln -s fileio.dylib "$TARGET/Contents/Extensions/fileio.dylib.dylib"
cp sqlean.dylib "$TARGET/Contents/Extensions/"
if [ -f "$TARGET/Contents/Extensions/sqlean.dylib" ]; then
install_name_tool -id "@executable_path/../Extensions/sqlean.dylib" "$TARGET/Contents/Extensions/sqlean.dylib"
ln -s sqlean.dylib "$TARGET/Contents/Extensions/sqlean.dylib.dylib"
fi
done

Expand All @@ -67,6 +63,7 @@ runs:
for TARGET in $(find build -name "DB Browser for SQL*.app" | sed -e 's/ /_/g'); do
TARGET=$(echo $TARGET | sed -e 's/_/ /g')
cp LICENSE "$TARGET/Contents/Resources/"
cp LICENSE-EXTENSIONS "$TARGET/Contents/Resources/"
cp LICENSE-PLUGINS "$TARGET/Contents/Resources/"
done

Expand Down Expand Up @@ -104,9 +101,8 @@ runs:
run: |
for TARGET in $(find build -name "DB Browser for SQL*.app" | sed -e 's/ /_/g'); do
TARGET=$(echo $TARGET | sed -e 's/_/ /g')
codesign --sign "${{ inputs.DEV_ID }}" --deep --force --options=runtime --strict --timestamp "$TARGET/Contents/Extensions/fileio.dylib"
codesign --sign "${{ inputs.DEV_ID }}" --deep --force --options=runtime --strict --timestamp "$TARGET/Contents/Extensions/formats.dylib"
codesign --sign "${{ inputs.DEV_ID }}" --deep --force --options=runtime --strict --timestamp "$TARGET/Contents/Extensions/math.dylib"
codesign --sign "${{ inputs.DEV_ID }}" --deep --force --options=runtime --strict --timestamp "$TARGET/Contents/Extensions/sqlean.dylib"
codesign --sign "${{ inputs.DEV_ID }}" --deep --force --options=runtime --strict --timestamp "$TARGET"
done

Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,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
clang -I /opt/homebrew/opt/db4subsqlitefts@5/include -L /opt/homebrew/opt/db4subsqlitefts@5/lib -fno-common -dynamiclib src/extensions/extension-functions.c
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_windirect.c 'https://sqlite.org/src/raw?filename=src/test_windirent.c&ci=trunk'
curl -L -o src/extensions/test_windirect.h 'https://sqlite.org/src/raw?filename=src/test_windirent.h&ci=trunk'
clang -I /opt/homebrew/opt/db4subsqlitefts@5/include -L /opt/homebrew/opt/db4subsqlitefts@5/lib -fno-common -dynamiclib src/extensions/fileio.c src/extensions/test_windirect.c
run: clang -I /opt/homebrew/opt/db4subsqlitefts@5/include -L /opt/homebrew/opt/db4subsqlitefts@5/lib -fno-common -dynamiclib src/extensions/extension-formats.c

- if: github.event_name != 'pull_request'
name: Notarize the app
Expand All @@ -63,6 +57,7 @@ jobs:
APPLE_ID: ${{ secrets.MACOS_CODESIGN_APPLE_ID }}
APPLE_PW: ${{ secrets.MACOS_CODESIGN_APPLE_PW }}
DEV_ID: ${{ secrets.MACOS_CODESIGN_DEV_ID }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KEYCHAIN_PATH: ${{ secrets.MACOS_CODESIGN_KEYCHAIN_PATH }}
KEYCHAIN_PW: ${{ secrets.MACOS_CODESIGN_KEYCHAIN_PW }}
NIGHTLY: ${{ inputs.NIGHTLY }}
Expand Down
27 changes: 27 additions & 0 deletions LICENSE-EXTENSIONS
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
DB Browser for SQLite includes support for SQLite extensions. The support for
for these comes from the nalgeon/sqlean projects, which have their own (Open
Source) licenses, different to ours.

nalgeon/sqlean - https://github.com/nalgeon/sqlean/

MIT License

Copyright (c) 2021+ Anton Zhiyanov <https://github.com/nalgeon/sqlean>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ Version 2, as well as the GNU General Public License Version 3 or later.

Modification or redistribution is permitted under the conditions of these licenses.

Check `LICENSE-EXTENSIONS` for other rights regarding included SQLite extensions in macOS builds.
Check `LICENSE-PLUGINS` for other rights regarding included third-party resources.

[gitter-img]: https://badges.gitter.im/sqlitebrowser/sqlitebrowser.svg
Expand Down