-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: link sqlite3 statically on windows
- Loading branch information
Showing
6 changed files
with
73 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
/docs/ | ||
/lib/ | ||
/bin/ | ||
/.shards/ | ||
/.crystal/ | ||
*.dwarf | ||
.idea | ||
/dist | ||
.DS_Store | ||
/coverage/ | ||
.coveralls.yml | ||
/.crystal/ | ||
/.shards/ | ||
/.vagrant/ | ||
/bin/ | ||
/coverage/ | ||
/dist | ||
/docs/ | ||
/insecure_private_keys | ||
/lib/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
Vagrant.configure("2") do |config| | ||
config.vm.box = "gusztavvargadr/windows-server-2022-standard-core" | ||
config.vm.communicator = "winssh" | ||
config.vm.guest = :windows | ||
config.ssh.shell = "powershell" | ||
config.vm.synced_folder ".", "c:/vagrant" | ||
config.vm.provision "shell", path: "scripts/provision.ps1" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Set-ExecutionPolicy Bypass -Scope LocalMachine | ||
$ProgressPreference = "SilentlyContinue" | ||
|
||
Write-Host "Installing the Scoop package manager..." | ||
iex "& {$(irm get.scoop.sh)} -RunAsAdmin" | ||
|
||
Write-Host "Installing Crystal & dev tools ..." | ||
scoop install git | ||
scoop bucket add crystal-preview "https://github.com/neatorobito/scoop-crystal" | ||
scoop install vs_2022_cpp_build_tools | ||
scoop install crystal | ||
|
||
& "scripts/sqlite3-static.ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
scoop install vswhere | ||
|
||
Write-Host "Configuring Build Tools..." | ||
$vsbase = vswhere.exe -products * -property installationPath | ||
|
||
Write-Host "Downloading SQLite sources..." | ||
mkdir /sqlite | ||
pushd /sqlite | ||
$sqlite_info = curl 'https://www.sqlite.org/download.html' -UseBasicParsing | ||
$sqlite_info -match 'PRODUCT,(?<version>\d+\.\d+\.\d+),(?<url>(?<year>\d+)/sqlite-amalgamation-(?<rev>\d+).zip)' | ||
$sqlite_sources = "https://www.sqlite.org/" + $Matches.url | ||
$sqlite_dir = "/sqlite/sqlite-amalgamation-" + $Matches.rev | ||
Write-Host "Found URL: $sqlite_sources" | ||
curl $sqlite_sources -OutFile:sqlite.zip -UseBasicParsing | ||
Expand-Archive -Path sqlite.zip -DestinationPath . | ||
popd | ||
|
||
Write-Host "Building SQLite3 static lib..." | ||
pushd $sqlite_dir | ||
$cmdline = '"' + $vsbase + '\VC\Auxiliary\Build\vcvars64.bat" && cl /c /EHsc sqlite3.c && lib sqlite3.obj' | ||
& "cmd" "/C" "$cmdline" | ||
popd | ||
|
||
Write-Host "Copying SQLite3 static lib to $(crystal env CRYSTAL_LIBRARY_PATH)..." | ||
$src = "$sqlite_dir/sqlite3.lib" | ||
$dest = (crystal env CRYSTAL_LIBRARY_PATH) + '/sqlite3-static.lib' | ||
cp "$src" "$dest" | ||
|
||
Write-Host "Cleaninig up SQLite3 sources..." | ||
rm -r /sqlite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters