detached 2180974

GIR: Remove aliases since `shared-library` is passed along correctly now

Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
commit
21809748623b0c9e543b01d43767aad5df201934
author
Felicitas Pojtinger · · 2025-10-17 06:10 UTC
committer
Jeroen Wijenbergh · · 2025-10-22 07:42 UTC
parent
2fa804a
signature
unsigned
2 files · +13 -29
M internal/core/core.go +0 -16
@@ -53,13 +53,6 @@ var names = map[string][]string{
5353 "PANGOCAIRO": {"libpangocairo-1.0.so"},
5454 }
5555
56-// aliases are lib aliases
57-// for example when we load the GSK lib, we should get the functions from the GTK shared library
58-var aliases = map[string]string{
59- "GSK": "GTK",
60- "GDK": "GTK",
61-}
62-
6356 // pkgConfNames is a lookup from library names to pkg-config library names
6457 // This is populated dynamically via SetPackageName and has defaults for common libraries
6558 var pkgConfNames = map[string]string{
@@ -147,10 +140,6 @@ func findPkgConf(name string) string {
147140 // TODO: Hardcore a library shared object with linker -X flag
148141 // This is useful for packaging
149142 func GetPath(name string) string {
150- // resolve alias
151- if v, ok := aliases[name]; ok {
152- name = v
153- }
154143 // try to get from env var
155144 ev := fmt.Sprintf("PUREGOTK_%s_PATH", name)
156145 if v := os.Getenv(ev); v != "" {
@@ -210,11 +199,6 @@ func GoString(c uintptr) string {
210199 // This is used when a package needs to load multiple shared libraries (e.g., GLIB needs both libgobject and libglib).
211200 // Returns a slice of full paths to all libraries for this package.
212201 func GetPaths(name string) []string {
213- // resolve alias
214- if v, ok := aliases[name]; ok {
215- name = v
216- }
217-
218202 libNames, ok := names[name]
219203 if !ok || len(libNames) == 0 {
220204 // Fallback to single GetPath for backward compatibility
@@ -53,13 +53,6 @@ var names = map[string][]string{
53 "PANGOCAIRO": {"libpangocairo-1.0.so"},53 "PANGOCAIRO": {"libpangocairo-1.0.so"},
54 }54 }
55 55
56-// aliases are lib aliases
57-// for example when we load the GSK lib, we should get the functions from the GTK shared library
58-var aliases = map[string]string{
59- "GSK": "GTK",
60- "GDK": "GTK",
61-}
62-
63 // pkgConfNames is a lookup from library names to pkg-config library names56 // pkgConfNames is a lookup from library names to pkg-config library names
64 // This is populated dynamically via SetPackageName and has defaults for common libraries57 // This is populated dynamically via SetPackageName and has defaults for common libraries
65 var pkgConfNames = map[string]string{58 var pkgConfNames = map[string]string{
@@ -147,10 +140,6 @@ func findPkgConf(name string) string {
147 // TODO: Hardcore a library shared object with linker -X flag140 // TODO: Hardcore a library shared object with linker -X flag
148 // This is useful for packaging141 // This is useful for packaging
149 func GetPath(name string) string {142 func GetPath(name string) string {
150- // resolve alias
151- if v, ok := aliases[name]; ok {
152- name = v
153- }
154 // try to get from env var143 // try to get from env var
155 ev := fmt.Sprintf("PUREGOTK_%s_PATH", name)144 ev := fmt.Sprintf("PUREGOTK_%s_PATH", name)
156 if v := os.Getenv(ev); v != "" {145 if v := os.Getenv(ev); v != "" {
@@ -210,11 +199,6 @@ func GoString(c uintptr) string {
210 // This is used when a package needs to load multiple shared libraries (e.g., GLIB needs both libgobject and libglib).199 // This is used when a package needs to load multiple shared libraries (e.g., GLIB needs both libgobject and libglib).
211 // Returns a slice of full paths to all libraries for this package.200 // Returns a slice of full paths to all libraries for this package.
212 func GetPaths(name string) []string {201 func GetPaths(name string) []string {
213- // resolve alias
214- if v, ok := aliases[name]; ok {
215- name = v
216- }
217-
218 libNames, ok := names[name]202 libNames, ok := names[name]
219 if !ok || len(libNames) == 0 {203 if !ok || len(libNames) == 0 {
220 // Fallback to single GetPath for backward compatibility204 // Fallback to single GetPath for backward compatibility
M internal/gir/pass/pass.go +13 -13
@@ -387,7 +387,7 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string
387387
388388 var sharedLibraries []string
389389 if ns.SharedLibrary != "" {
390- for _, lib := range libs := strings.Split(ns.SharedLibrary, ",") {
390+ for _, lib := range strings.Split(ns.SharedLibrary, ",") {
391391 if trimmed := strings.TrimSpace(lib); trimmed != "" {
392392 sharedLibraries = append(sharedLibraries, trimmed)
393393 }
@@ -413,19 +413,19 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string
413413 needsInit := (len(functions[fn]) + methods) > 0
414414
415415 args := types.TemplateArg{
416- PkgName: pkgName,
417- PkgEnv: strings.ToUpper(pkgName),
418- PkgConfigName: pkgConfigName,
416+ PkgName: pkgName,
417+ PkgEnv: strings.ToUpper(pkgName),
418+ PkgConfigName: pkgConfigName,
419419 SharedLibraries: sharedLibraries,
420- NeedsInit: needsInit,
421- Aliases: aliases[fn],
422- Callbacks: callbacks[fn],
423- Records: records[fn],
424- Enums: enums[fn],
425- Constants: constants[fn],
426- Functions: functions[fn],
427- Interfaces: interfaces[fn],
428- Classes: classes[fn],
420+ NeedsInit: needsInit,
421+ Aliases: aliases[fn],
422+ Callbacks: callbacks[fn],
423+ Records: records[fn],
424+ Enums: enums[fn],
425+ Constants: constants[fn],
426+ Functions: functions[fn],
427+ Interfaces: interfaces[fn],
428+ Classes: classes[fn],
429429 }
430430
431431 os.MkdirAll(fmt.Sprintf(dir+"/%s", pkgName), 0o755)
@@ -387,7 +387,7 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string
387 387
388 var sharedLibraries []string388 var sharedLibraries []string
389 if ns.SharedLibrary != "" {389 if ns.SharedLibrary != "" {
390- for _, lib := range libs := strings.Split(ns.SharedLibrary, ",") {390+ for _, lib := range strings.Split(ns.SharedLibrary, ",") {
391 if trimmed := strings.TrimSpace(lib); trimmed != "" {391 if trimmed := strings.TrimSpace(lib); trimmed != "" {
392 sharedLibraries = append(sharedLibraries, trimmed)392 sharedLibraries = append(sharedLibraries, trimmed)
393 }393 }
@@ -413,19 +413,19 @@ func (p *Pass) writeGo(r types.Repository, gotemp *template.Template, dir string
413 needsInit := (len(functions[fn]) + methods) > 0413 needsInit := (len(functions[fn]) + methods) > 0
414 414
415 args := types.TemplateArg{415 args := types.TemplateArg{
416- PkgName: pkgName,416+ PkgName: pkgName,
417- PkgEnv: strings.ToUpper(pkgName),417+ PkgEnv: strings.ToUpper(pkgName),
418- PkgConfigName: pkgConfigName,418+ PkgConfigName: pkgConfigName,
419 SharedLibraries: sharedLibraries,419 SharedLibraries: sharedLibraries,
420- NeedsInit: needsInit,420+ NeedsInit: needsInit,
421- Aliases: aliases[fn],421+ Aliases: aliases[fn],
422- Callbacks: callbacks[fn],422+ Callbacks: callbacks[fn],
423- Records: records[fn],423+ Records: records[fn],
424- Enums: enums[fn],424+ Enums: enums[fn],
425- Constants: constants[fn],425+ Constants: constants[fn],
426- Functions: functions[fn],426+ Functions: functions[fn],
427- Interfaces: interfaces[fn],427+ Interfaces: interfaces[fn],
428- Classes: classes[fn],428+ Classes: classes[fn],
429 }429 }
430 430
431 os.MkdirAll(fmt.Sprintf(dir+"/%s", pkgName), 0o755)431 os.MkdirAll(fmt.Sprintf(dir+"/%s", pkgName), 0o755)

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