Skip to content

Instantly share code, notes, and snippets.

@jmhodges
Created October 22, 2016 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmhodges/772daecb03ebeeba671d255ed27ddb41 to your computer and use it in GitHub Desktop.
Save jmhodges/772daecb03ebeeba671d255ed27ddb41 to your computer and use it in GitHub Desktop.
a new_git_repository for go-sqlite3 at 7204887cf3a42df1cfaa5505dc3a3427f6dded8b
# sqlite3 has CGO deps and the version of rules_go we are using at the time of
# this comment (but maybe this will be fixed in the future!) doesn't have a way
# to get a nice high-level new_go_repository working with cgo code. So, we hack it here.
new_git_repository(
name = "com_github_mattn_go_sqlite3",
remote = "https://github.com/mattn/go-sqlite3.git",
commit = "7204887cf3a42df1cfaa5505dc3a3427f6dded8b",
build_file_content = """
load("@io_bazel_rules_go//go:def.bzl", "cgo_library", "go_library", "go_test", "go_prefix")
go_prefix("github.com/mattn/go-sqlite3")
cgo_library(
name = "cgo_default_library",
srcs = [
"backup.go",
"callback.go",
"error.go",
"sqlite3.go",
"sqlite3_load_extension.go",
"sqlite3_other.go",
] + glob(["*.c","*.h"]),
)
go_library(
name = "go_default_library",
srcs = ["doc.go"],
library = "cgo_default_library",
visibility = ["//visibility:public"],
)
go_library(
name = "sqlite3_test",
srcs = ["sqlite3_test/sqltest.go"],
)
go_test(
name = "go_default_test",
srcs = glob(["*_test.go"]),
deps = [
"sqlite3_test",
],
library = "go_default_library",
)
"""
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment