Comments (5)
You are building with -tags extlib,pkgconfig,extlib,pkgconfig
, so it expects you to install mupdf libraries and all dependencies and will not use bundled static libraries.
from go-fitz.
But then again, it wants mupdf_linux_amd64, which is a static library bundled, it would need only -lmudpf
in that case. No idea, can you build with go build? Does bazel uses go build
or some of their implementation?
Btw. also check #31
from go-fitz.
The tags
was a test that I did before. I updated the error file to the version without it, and the error is the same...
The project builds normally with go build
, the problem only occurs with bazel build
.
And I think yes, the bazel just wraps the go compiler. I'm looking in the go_rules repository to check for some "default tags" that could be the cause.
The "-lmupdf" is being used, but it's in go-fitz BUILD.bazel. This error is caused by it: I tell to bazel use the mupdf lib, but it's doesn't find it.
from go-fitz.
No idea, as you can see from the previous bazel issue it seemed like it does not respect build tags at all, it enabled them all by default and that is not how it should work.
Anyway, nothing that I can fix here, this library is specific in that it includes static libraries, so vendoring will not work then (it will not copy libraries), etc. unless you use your external libraries and extlib
tag.
from go-fitz.
To follow up, we found a way to build it in bazel, here is a manual diff on top of what can be generated automatically by gazelle, which essentially does two things
- include the header files directly into
go_library
- put .a files into a cc_library target and add to the
go_library
ascdeps
, inspired by bazelbuild/bazel-gazelle#1120 (comment)
diff --git a/BUILD.bazel b/BUILD.bazel
index e8ba74f..2dc361d 100755
--- a/BUILD.bazel
+++ b/BUILD.bazel
+cc_library(
+ name = "clib",
+ srcs = select({
+ "@io_bazel_rules_go//go/platform:darwin_amd64": [
+ "libs/libmupdf_darwin_amd64.a",
+ "libs/libmupdfthird_darwin_amd64.a",
+ ],
+ "@io_bazel_rules_go//go/platform:darwin_arm64": [
+ "libs/libmupdf_darwin_arm64.a",
+ "libs/libmupdfthird_darwin_arm64.a",
+ ],
+ "@io_bazel_rules_go//go/platform:linux_amd64": [
+ "libs/libmupdf_linux_amd64.a",
+ "libs/libmupdfthird_linux_amd64.a",
+ ],
+ "@io_bazel_rules_go//go/platform:linux_arm64": [
+ "libs/libmupdf_linux_arm64.a",
+ "libs/libmupdfthird_linux_arm64.a",
+ ],
+ "//conditions:default": ["UNSUPPORTED_PLATFORM"],
+ }),
+)
+
go_library(
name = "fitz",
srcs = [
"fitz.go",
"fitz_cgo.go",
"fitz_content_types.go",
- ],
+ ] + glob(["include/**/*.h"]),
+ cdeps = [":clib"],
cgo = True,
from go-fitz.
Related Issues (20)
- getting crash for some pdf format HOT 1
- start program HOT 2
- undefined: fitz.New HOT 3
- fitz is not importing correctly HOT 2
- centos alpine build faild HOT 5
- Linux platform, when PDF is invalid
- Error when convert PDF to Image HOT 3
- Out of Memory issues with frequent requests HOT 6
- build for linux HOT 2
- Creating new PDF file with loaded pages HOT 1
- Vendoring the include files HOT 2
- feat: support windows/arm64 HOT 2
- Getting error when building HOT 6
- linux compilation error HOT 3
- linux ubuntu build fail HOT 5
- Makes discord/lilliput segfault HOT 2
- fitz is empty HOT 2
- How to build docker with this package?
- GCC 12.2 Support HOT 10
- Is it possible to add PDF splitting and merging functions? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-fitz.