glib (and friends!) linux build fixes (#204)

* glib linux build fixes
* gobj-intr
* include symlink step when testing, in case a subsequent test requires it
* fix harfbuzz build

Co-authored-by: Max Howell <mxcl@me.com>
This commit is contained in:
Jacob Heider 2022-10-24 15:29:00 -04:00 committed by GitHub
parent 09dcb113f3
commit fbad316611
6 changed files with 39 additions and 8 deletions

View file

@ -29,6 +29,7 @@ build:
meson \ meson \
--buildtype=release \ --buildtype=release \
--prefix={{prefix}} \ --prefix={{prefix}} \
--libdir={{prefix}}/lib \
-Dman=false \ -Dman=false \
.. ..
ninja ninja

View file

@ -31,12 +31,14 @@ build:
GT='${prefix}/../../../gnu.org/gettext/v{{ deps.gnu.org/gettext.version.major }}' GT='${prefix}/../../../gnu.org/gettext/v{{ deps.gnu.org/gettext.version.major }}'
cd {{prefix}}/lib/pkgconfig cd {{prefix}}/lib/pkgconfig
sed -i.bak -e \ sed -i.bak -e \
's|Libs: -L${libdir} -lglib-2.0 -lintl|Libs: -L${libdir} -lglib-2.0'\ -L$GT/lib\ -lintl\| \ 's|Libs: -L${libdir} -lglib-2.0 -lintl|Libs: -L${libdir} -lglib-2.0'\ -L$GT/lib\ -lintl\| \
./glib-2.0.pc ./glib-2.0.pc
sed -i.bak -e \ sed -i.bak -e \
's|Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include|Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include'\ -I$GT/include\| \ 's|Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include|Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include'\ -I$GT/include\| \
./glib-2.0.pc ./glib-2.0.pc
rm *.bak rm *.bak
#REF https://github.com/Homebrew/homebrew-core/blob/d0e65698ccd502335bea68ce879ae02e1735db0d/Formula/glib.rb#L66-L67 #REF https://github.com/Homebrew/homebrew-core/blob/d0e65698ccd502335bea68ce879ae02e1735db0d/Formula/glib.rb#L66-L67
@ -44,6 +46,7 @@ build:
env: env:
ARGS: ARGS:
- --prefix={{prefix}} - --prefix={{prefix}}
- --libdir={{prefix}}/lib
- --wrap-mode=nofallback - --wrap-mode=nofallback
- --buildtype=release - --buildtype=release
# tests fail to build with `error: target emulation unknown: -m or at least one .o file required` # tests fail to build with `error: target emulation unknown: -m or at least one .o file required`
@ -54,15 +57,17 @@ test:
tea.xyz/gx/cc: c99 tea.xyz/gx/cc: c99
freedesktop.org/pkg-config: ^0.29 freedesktop.org/pkg-config: ^0.29
script: | script: |
sh - <<EOSTDIN
# unset these since we only want to test via pkg-config
unset LIBRARY_PATH
unset CPATH
unset LD_LIBRARY_PATH
unset DYLD_FALLBACK_LIBRARY_PATH
cc $CFLAGS $LDFLAGS test.c cc $CFLAGS $LDFLAGS test.c
EOSTDIN
./a.out ./a.out
env: env:
# using pkg-config as pixman puts its headers in `include/pixman-1` # using pkg-config as pixman puts its headers in `include/pixman-1`
LDFLAGS: $(pkg-config --libs glib-2.0) LDFLAGS: $(pkg-config --libs glib-2.0)
CFLAGS: $(pkg-config --cflags glib-2.0) CFLAGS: $(pkg-config --cflags glib-2.0)
# unset these since we only want to test via pkg-config
LIBRARY_PATH: /
CPATH: /
LD_LIBRARY_PATH: /
darwin:
DYLD_LIBRARY_PATH: /

View file

@ -21,7 +21,7 @@ build:
working-directory: working-directory:
build build
script: | script: |
meson .. --prefix={{prefix}} --buildtype=release meson .. --prefix={{prefix}} --libdir={{prefix}}/lib --buildtype=release
ninja -v ninja -v
ninja install ninja install
env: env:
@ -39,8 +39,12 @@ test:
tea.xyz/gx/make: '*' tea.xyz/gx/make: '*'
freedesktop.org/pkg-config: ^0.29 freedesktop.org/pkg-config: ^0.29
script: | script: |
git clone $FIXTURE . git clone $FIXTURE test
cd test
git apply ../test_make.diff
make make
test -f Tut-0.1.typelib test -f Tut-0.1.typelib
env: env:
FIXTURE: https://gist.github.com/7a0023656ccfe309337a.git FIXTURE: https://gist.github.com/7a0023656ccfe309337a.git
PKG_CONFIG_PATH: $PKG_CONFIG_PATH:{{prefix}}/lib/pkgconfig

View file

@ -0,0 +1,15 @@
diff -u a/Makefile b/Makefile
--- a/Makefile 2022-10-21 16:31:23.000000000 -0400
+++ b/Makefile 2022-10-21 17:59:47.000000000 -0400
@@ -11,9 +11,9 @@
# CC0 Public Domain Dedication:
# http://creativecommons.org/publicdomain/zero/1.0/
-C_INCLUDES:=$(shell pkg-config --cflags gobject-introspection-1.0)
+C_INCLUDES:=$(shell pkg-config --cflags gobject-introspection-1.0 glib-2.0)
CFLAGS=$(C_INCLUDES) -g
-LIBS:=$(shell pkg-config --libs gobject-introspection-1.0 gmodule-2.0)
+LIBS:=$(shell pkg-config --libs gobject-introspection-1.0 gmodule-2.0 glib-2.0)
OBJECTS=tut-greeter.o main.o
SOURCES=tut-greeter.c tut-greeter.h main.c

View file

@ -36,6 +36,7 @@ build:
- -Dfreetype=enabled - -Dfreetype=enabled
- --buildtype=release - --buildtype=release
- --prefix={{prefix}} - --prefix={{prefix}}
- --libdir={{prefix}}/lib
#TODO more #TODO more
test: pango-view --version test: pango-view --version

View file

@ -32,6 +32,11 @@ async function test(self: Installation) {
const yml = await pantry.getYAML(self.pkg).parse() const yml = await pantry.getYAML(self.pkg).parse()
const deps = await deps4(self.pkg) const deps = await deps4(self.pkg)
const installations = await prepare(deps) const installations = await prepare(deps)
// if we are testing multiple packages, they might not
// get linked when they're tested.
await link(self)
const env = useShellEnv({ installations: [self, ...installations] }) const env = useShellEnv({ installations: [self, ...installations] })
let text = undent` let text = undent`