Skip to content

Commit 0561d3f

Browse files
committed
extension(macOS): Include 'nalgeon/sqlean' extension to the app bundle
Related: #3357
1 parent e39ea5d commit 0561d3f

File tree

4 files changed

+43
-24
lines changed

4 files changed

+43
-24
lines changed

.github/actions/notarize-macos/action.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ inputs:
77
required: true
88
DEV_ID:
99
required: true
10+
GH_TOKEN:
11+
required: true
1012
KEYCHAIN_PATH:
1113
required: true
1214
KEYCHAIN_PW:
@@ -32,32 +34,26 @@ runs:
3234
shell: bash
3335
run: find build -name "DB Browser for SQL*.app" -exec /opt/homebrew/opt/db4subqt@5/bin/macdeployqt {} -sign-for-notarization="${{ inputs.DEV_ID }}" \;
3436

35-
- name: Add the extension to the app bundle
37+
- name: Add the 'nalgeon/sqlean' extension to the app bundle
3638
shell: bash
3739
run: |
40+
gh auth login --with-token <<< "${{ inputs.GH_TOKEN }}"
41+
gh release download --pattern "sqlean-macos-arm64.zip" --repo "nalgeon/sqlean"
42+
unzip sqlean-macos-arm64.zip
3843
for TARGET in $(find build -name "DB Browser for SQL*.app" | sed -e 's/ /_/g'); do
3944
TARGET=$(echo $TARGET | sed -e 's/_/ /g')
4045
mkdir "$TARGET/Contents/Extensions"
41-
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"
42-
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"
4346
47+
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"
4448
if [ -f "$TARGET/Contents/Extensions/formats.dylib" ]; then
4549
install_name_tool -id "@executable_path/../Extensions/formats.dylib" "$TARGET/Contents/Extensions/formats.dylib"
4650
ln -s formats.dylib "$TARGET/Contents/Extensions/formats.dylib.dylib"
4751
fi
48-
if [ -f "$TARGET/Contents/Extensions/math.dylib" ]; then
49-
install_name_tool -id "@executable_path/../Extensions/math.dylib" "$TARGET/Contents/Extensions/math.dylib"
50-
ln -s math.dylib "$TARGET/Contents/Extensions/math.dylib.dylib"
51-
fi
52-
53-
curl -L -o src/extensions/fileio.c 'https://sqlite.org/src/raw?filename=ext/misc/fileio.c&ci=trunk'
54-
curl -L -o src/extensions/test_windirect.c 'https://sqlite.org/src/raw?filename=src/test_windirent.c&ci=trunk'
55-
curl -L -o src/extensions/test_windirect.h 'https://sqlite.org/src/raw?filename=src/test_windirent.h&ci=trunk'
56-
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"
5752
58-
if [ -f "$TARGET/Contents/Extensions/fileio.dylib" ]; then
59-
install_name_tool -id "@executable_path/../Extensions/fileio.dylib" "$TARGET/Contents/Extensions/fileio.dylib"
60-
ln -s fileio.dylib "$TARGET/Contents/Extensions/fileio.dylib.dylib"
53+
cp sqlean.dylib "$TARGET/Contents/Extensions/"
54+
if [ -f "$TARGET/Contents/Extensions/sqlean.dylib" ]; then
55+
install_name_tool -id "@executable_path/../Extensions/sqlean.dylib" "$TARGET/Contents/Extensions/sqlean.dylib"
56+
ln -s sqlean.dylib "$TARGET/Contents/Extensions/sqlean.dylib.dylib"
6157
fi
6258
done
6359
@@ -67,6 +63,7 @@ runs:
6763
for TARGET in $(find build -name "DB Browser for SQL*.app" | sed -e 's/ /_/g'); do
6864
TARGET=$(echo $TARGET | sed -e 's/_/ /g')
6965
cp LICENSE "$TARGET/Contents/Resources/"
66+
cp LICENSE-EXTENSIONS "$TARGET/Contents/Resources/"
7067
cp LICENSE-PLUGINS "$TARGET/Contents/Resources/"
7168
done
7269
@@ -104,9 +101,8 @@ runs:
104101
run: |
105102
for TARGET in $(find build -name "DB Browser for SQL*.app" | sed -e 's/ /_/g'); do
106103
TARGET=$(echo $TARGET | sed -e 's/_/ /g')
107-
codesign --sign "${{ inputs.DEV_ID }}" --deep --force --options=runtime --strict --timestamp "$TARGET/Contents/Extensions/fileio.dylib"
108104
codesign --sign "${{ inputs.DEV_ID }}" --deep --force --options=runtime --strict --timestamp "$TARGET/Contents/Extensions/formats.dylib"
109-
codesign --sign "${{ inputs.DEV_ID }}" --deep --force --options=runtime --strict --timestamp "$TARGET/Contents/Extensions/math.dylib"
105+
codesign --sign "${{ inputs.DEV_ID }}" --deep --force --options=runtime --strict --timestamp "$TARGET/Contents/Extensions/sqlean.dylib"
110106
codesign --sign "${{ inputs.DEV_ID }}" --deep --force --options=runtime --strict --timestamp "$TARGET"
111107
done
112108

.github/workflows/build-macos.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,7 @@ jobs:
4848
run: ninja test
4949

5050
- name: Build Extension
51-
run: |
52-
clang -I /opt/homebrew/opt/db4subsqlitefts@5/include -L /opt/homebrew/opt/db4subsqlitefts@5/lib -fno-common -dynamiclib src/extensions/extension-formats.c
53-
clang -I /opt/homebrew/opt/db4subsqlitefts@5/include -L /opt/homebrew/opt/db4subsqlitefts@5/lib -fno-common -dynamiclib src/extensions/extension-functions.c
54-
curl -L -o src/extensions/fileio.c 'https://sqlite.org/src/raw?filename=ext/misc/fileio.c&ci=trunk'
55-
curl -L -o src/extensions/test_windirect.c 'https://sqlite.org/src/raw?filename=src/test_windirent.c&ci=trunk'
56-
curl -L -o src/extensions/test_windirect.h 'https://sqlite.org/src/raw?filename=src/test_windirent.h&ci=trunk'
57-
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
51+
run: clang -I /opt/homebrew/opt/db4subsqlitefts@5/include -L /opt/homebrew/opt/db4subsqlitefts@5/lib -fno-common -dynamiclib src/extensions/extension-formats.c
5852

5953
- if: github.event_name != 'pull_request'
6054
name: Notarize the app
@@ -63,6 +57,7 @@ jobs:
6357
APPLE_ID: ${{ secrets.MACOS_CODESIGN_APPLE_ID }}
6458
APPLE_PW: ${{ secrets.MACOS_CODESIGN_APPLE_PW }}
6559
DEV_ID: ${{ secrets.MACOS_CODESIGN_DEV_ID }}
60+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6661
KEYCHAIN_PATH: ${{ secrets.MACOS_CODESIGN_KEYCHAIN_PATH }}
6762
KEYCHAIN_PW: ${{ secrets.MACOS_CODESIGN_KEYCHAIN_PW }}
6863
NIGHTLY: ${{ inputs.NIGHTLY }}

LICENSE-EXTENSIONS

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
DB Browser for SQLite includes support for SQLite extensions. The support for
2+
for these comes from the nalgeon/sqlean projects, which have their own (Open
3+
Source) licenses, different to ours.
4+
5+
nalgeon/sqlean - https://github.com/nalgeon/sqlean/
6+
7+
MIT License
8+
9+
Copyright (c) 2021+ Anton Zhiyanov <https://github.com/nalgeon/sqlean>
10+
11+
Permission is hereby granted, free of charge, to any person obtaining a copy
12+
of this software and associated documentation files (the "Software"), to deal
13+
in the Software without restriction, including without limitation the rights
14+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15+
copies of the Software, and to permit persons to whom the Software is
16+
furnished to do so, subject to the following conditions:
17+
18+
The above copyright notice and this permission notice shall be included in all
19+
copies or substantial portions of the Software.
20+
21+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27+
SOFTWARE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ Version 2, as well as the GNU General Public License Version 3 or later.
363363

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

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

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

0 commit comments

Comments
 (0)