detached 52f4db2

README: Remove arm64 limitation and add lib loading

commit
52f4db2603024bb67b4ca7d350ca0f5390e7978d
author
Jeroen Wijenbergh · · 2023-09-28 15:01 UTC
committer
GitHub · · 2023-09-28 15:01 UTC
parent
982a22b
signature
GPG Unverified4AEE18F83AFDEB23 The key is unknown
1 file · +17 -4
M README.md +17 -4
@@ -21,14 +21,13 @@ No Cgo needed, thus:
2121
2222 Limitations of this library as compared to the alternatives using cgo:
2323 * Some APIs are not possible due to purego not currently supporting struct arguments (that are not pointers)
24-* Currently only support for AMD64+Linux, for ARM I need to figure out how to get callbacks working in purego and contribute to purego
2524
2625 # Planned features
2726 In order of priority:
2827 * General code cleanup
29-* ARM support
3028 * Support for OS other than Linux (I only test on Linux currently)
3129 * GTK 3 support
30+* Architectures other than AMD64/ARM64
3231
3332 # Basic example
3433
@@ -66,10 +65,24 @@ func activate(app *gtk.Application) {
6665 Save this to a main.go and then build & run with
6766
6867 ```bash
69-CGO_ENABLED=0 go run main.go
68+go run main.go
7069 ```
7170
72-> **_NOTE:_** Passing CGO_ENABLED=0 is currently required
71+> **_NOTE:_** You can also use `CGO_ENABLED=0` to build without cgo!
72+
73+# Library loading
74+Because the GTK libs are loading at runtime (in `init`), we have to know where your libs are located.
75+The default configuration is a "just works" configuration, we hardcode some paths that are common.
76+
77+However, for systems such as NixOS or distros that use other paths the following environment variables might help:
78+
79+- `PUREGOTK_LIB_FOLRER`, set this to the root folder where all libs are stored e.g. `/some/path/`
80+- `PUREGOTK_LIBNAME_PATH`, e.g. `PUREGOTK_GTK_PATH` for the file path to GTK e.g. `/some/path/libgtk-4.so`. You have to do this for all deps, e.g. cairo, pango, etc
81+
82+See https://github.com/jwijenbergh/puregotk/blob/main/internal/core/core.go for exact implementation details.
83+
84+Additionally we also have a fallback to `pkg-config`, but I would say only rely on this as a last effort due to the increased startup time.
85+When packaging code, always make sure that correct paths are used by e.g. using the aforementioned environment variables.
7386
7487 # Generating the library
7588 This library is automatically generated by reading GIR files.
@@ -21,14 +21,13 @@ No Cgo needed, thus:
21 21
22 Limitations of this library as compared to the alternatives using cgo:22 Limitations of this library as compared to the alternatives using cgo:
23 * Some APIs are not possible due to purego not currently supporting struct arguments (that are not pointers)23 * Some APIs are not possible due to purego not currently supporting struct arguments (that are not pointers)
24-* Currently only support for AMD64+Linux, for ARM I need to figure out how to get callbacks working in purego and contribute to purego
25 24
26 # Planned features25 # Planned features
27 In order of priority:26 In order of priority:
28 * General code cleanup27 * General code cleanup
29-* ARM support
30 * Support for OS other than Linux (I only test on Linux currently)28 * Support for OS other than Linux (I only test on Linux currently)
31 * GTK 3 support29 * GTK 3 support
30+* Architectures other than AMD64/ARM64
32 31
33 # Basic example32 # Basic example
34 33
@@ -66,10 +65,24 @@ func activate(app *gtk.Application) {
66 Save this to a main.go and then build & run with65 Save this to a main.go and then build & run with
67 66
68 ```bash67 ```bash
69-CGO_ENABLED=0 go run main.go68+go run main.go
70 ```69 ```
71 70
72-> **_NOTE:_** Passing CGO_ENABLED=0 is currently required71+> **_NOTE:_** You can also use `CGO_ENABLED=0` to build without cgo!
72+
73+# Library loading
74+Because the GTK libs are loading at runtime (in `init`), we have to know where your libs are located.
75+The default configuration is a "just works" configuration, we hardcode some paths that are common.
76+
77+However, for systems such as NixOS or distros that use other paths the following environment variables might help:
78+
79+- `PUREGOTK_LIB_FOLRER`, set this to the root folder where all libs are stored e.g. `/some/path/`
80+- `PUREGOTK_LIBNAME_PATH`, e.g. `PUREGOTK_GTK_PATH` for the file path to GTK e.g. `/some/path/libgtk-4.so`. You have to do this for all deps, e.g. cairo, pango, etc
81+
82+See https://github.com/jwijenbergh/puregotk/blob/main/internal/core/core.go for exact implementation details.
83+
84+Additionally we also have a fallback to `pkg-config`, but I would say only rely on this as a last effort due to the increased startup time.
85+When packaging code, always make sure that correct paths are used by e.g. using the aforementioned environment variables.
73 86
74 # Generating the library87 # Generating the library
75 This library is automatically generated by reading GIR files.88 This library is automatically generated by reading GIR files.

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close