Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usql: bump to 0.19.4 #22052

Merged
merged 1 commit into from
Nov 10, 2024
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
32 changes: 27 additions & 5 deletions packages/usql/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,42 @@ TERMUX_PKG_HOMEPAGE=https://github.com/xo/usql
TERMUX_PKG_DESCRIPTION="A universal command-line interface for SQL databases"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@flipee"
TERMUX_PKG_VERSION="0.19.3"
TERMUX_PKG_VERSION="0.19.4"
TERMUX_PKG_SRCURL=https://github.com/xo/usql/archive/v$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=3955e13c7108cb4a3ebb968dafa501db72d4f4fa0ddf6fb128cceb84e5a3d4c4
TERMUX_PKG_SHA256=61aff0f9448ca9d90894bdf99276186f87b5a91ab196ff45133f34c61475b717
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BUILD_IN_SRC=true

termux_step_post_get_source() {
termux_setup_golang
go mod tidy
go mod vendor
}

termux_step_make() {
termux_setup_golang
export GOPATH=$TERMUX_PKG_BUILDDIR

cd $TERMUX_PKG_SRCDIR
# Build and replace resvg
local _resvg_go_url="$(cat go.mod | grep resvg | awk '{print $1}')"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bash does have built-in syntax for grabbing the contents of a file in the form of $(</path/to/file)

Quote:1

The command substitution $(cat file) can be replaced by the
equivalent but faster $(< file).

Though I don't think this would make any practical difference in this instance or the one below.

Footnotes

  1. https://www.man7.org/linux/man-pages/man1/bash.1.html#EXPANSION:~:text=%24(%3C

local _resvg_go_srcdir="$TERMUX_PKG_SRCDIR"/vendor/$_resvg_go_url/
(
local _resvg_version="$(cat "$_resvg_go_srcdir"/version.txt)"
git clone https://github.com/RazrFalcon/resvg.git -b $_resvg_version --depth=1
cd resvg/crates/c-api
termux_setup_rust
cargo build --release \
--jobs "$TERMUX_PKG_MAKE_PROCESSES" \
--target "$CARGO_TARGET_NAME" \
--locked
patch -p1 -d "$_resvg_go_srcdir"/ < "$TERMUX_PKG_BUILDER_DIR"/resvg-i686.diff
mkdir -p "$_resvg_go_srcdir"/libresvg/linux_$GOARCH
cp ../../crates/c-api/resvg.h \
"$_resvg_go_srcdir"/libresvg/resvg.h
cp ../../target/$CARGO_TARGET_NAME/release/libresvg.a \
"$_resvg_go_srcdir"/libresvg/linux_$GOARCH/libresvg.a
)

local tags="most no_adodb no_duckdb"

if [ "${TERMUX_ARCH}" = "arm" ] || [ "${TERMUX_ARCH}" = "i686" ]; then
tags="$tags no_netezza no_chai"
fi
Expand Down
10 changes: 10 additions & 0 deletions packages/usql/resvg-i686.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/resvg.go
+++ b/resvg.go
@@ -10,6 +10,7 @@
#cgo linux,amd64 LDFLAGS: -L${SRCDIR}/libresvg/linux_amd64 -lresvg -lm
#cgo linux,arm64 LDFLAGS: -L${SRCDIR}/libresvg/linux_arm64 -lresvg -lm
#cgo linux,arm LDFLAGS: -L${SRCDIR}/libresvg/linux_arm -lresvg -lm
+#cgo linux,386 LDFLAGS: -L${SRCDIR}/libresvg/linux_386 -lresvg -lm
#cgo windows,amd64 LDFLAGS: -L${SRCDIR}/libresvg/windows_amd64 -lresvg -lm -lkernel32 -ladvapi32 -lbcrypt -lntdll -luserenv -lws2_32

#include <stdlib.h>