diff options
| author | Michael Forney <mforney@mforney.org> | 2017-09-17 00:03:34 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2017-09-25 19:23:06 -0700 |
| commit | ba94a8513d9a0aadb3f2c834c74b64aa644c61e8 (patch) | |
| tree | 48ac6c85baa7b9d960b9e1e726a906e61ca60967 /pkg/wld | |
| parent | cb362b531d79708a259bbf070dee5104fd63df08 (diff) | |
Rewrite ninja generation scripts in Lua
Diffstat (limited to 'pkg/wld')
| -rw-r--r-- | pkg/wld/gen.lua | 68 | ||||
| -rw-r--r-- | pkg/wld/gen.rc | 68 |
2 files changed, 68 insertions, 68 deletions
diff --git a/pkg/wld/gen.lua b/pkg/wld/gen.lua new file mode 100644 index 00000000..b79ba516 --- /dev/null +++ b/pkg/wld/gen.lua @@ -0,0 +1,68 @@ +cflags{ + '-D WITH_WAYLAND_SHM', + '-D WITH_WAYLAND_DRM', + '-I $outdir', + '-I pkg/fontconfig/src', + '-I pkg/freetype/src/include', + '-I pkg/libdrm/src', + '-I pkg/libdrm/src/include/drm', + '-I $builddir/pkg/pixman/include', + '-I $builddir/pkg/wayland/include', +} + +pkg.hdrs = copy('$outdir/include/wld', '$srcdir', {'drm.h', 'pixman.h', 'wayland.h', 'wld.h'}) +pkg.hdrs.install = true + +local srcs = { + 'buffer.c', + 'buffered_surface.c', + 'color.c', + 'context.c', + 'drm.c', + 'dumb.c', + 'font.c', + 'renderer.c', + 'surface.c', + 'pixman.c', + 'wayland.c', + 'wayland-shm.c', + 'wayland-drm.c', + 'wayland-drm-protocol.c.o', +} +local libs = { + 'fontconfig/libfontconfig.a.d', + 'freetype/libfreetype.a.d', + 'libdrm/libdrm.a', + 'pixman/libpixman.a', + 'wayland/libwayland-client.a.d', +} + +if config.video_drivers and config.video_drivers['intel'] then + cflags{'-D WITH_DRM_INTEL', '-I pkg/libdrm/src/intel'} + table.insert(srcs, {'intel.c', 'intel/batch.c'}) + table.insert(libs, 'libdrm/libdrm_intel.a.d') +end +if config.video_drivers and config.video_drivers['nouveau'] then + cflags{'-D WITH_DRM_NOUVEAU', '-I pkg/libdrm/src/nouveau'} + table.insert(srcs, 'nouveau.c') + table.insert(libs, 'libdrm/libdrm_nouveau.a') +end + +waylandproto('protocol/wayland-drm.xml', + 'protocol/wayland-drm-client-protocol.h', + 'protocol/wayland-drm-server-protocol.h', + 'wayland-drm-protocol.c' +) + +pkg.deps = { + '$builddir/pkg/fontconfig/fetch.stamp', + '$builddir/pkg/freetype/fetch.stamp', + '$builddir/pkg/libdrm/fetch.stamp', + '$outdir/protocol/wayland-drm-client-protocol.h', + 'pkg/pixman/headers', + 'pkg/wayland/headers', +} + +lib('libwld.a', {srcs, expand{'$builddir/pkg/', libs}}) + +fetch 'git' diff --git a/pkg/wld/gen.rc b/pkg/wld/gen.rc deleted file mode 100644 index e166a21a..00000000 --- a/pkg/wld/gen.rc +++ /dev/null @@ -1,68 +0,0 @@ -cflags=(\ - -D WITH_WAYLAND_SHM\ - -D WITH_WAYLAND_DRM\ - -I '$outdir' \ - -I pkg/fontconfig/src\ - -I pkg/freetype/src/include\ - -I pkg/libdrm/src\ - -I pkg/libdrm/src/include/drm\ - -I '$builddir'/pkg/pixman/include\ - -I '$builddir'/pkg/wayland/include\ -) - -hdrs=(drm.h pixman.h wayland.h wld.h) -for(hdr in $hdrs) { - build '$outdir'/include/wld/$hdr copy '$srcdir'/$hdr - file include/wld/$hdr '$srcdir'/$hdr 644 -} -phony headers '$outdir'/include/wld/$hdrs - -srcs=(\ - buffer.c\ - buffered_surface.c\ - color.c\ - context.c\ - drm.c\ - dumb.c\ - font.c\ - renderer.c\ - surface.c\ - pixman.c\ - wayland.c\ - wayland-shm.c\ - wayland-drm.c\ - wayland-drm-protocol.c.o\ -) -libs=(\ - fontconfig/libfontconfig.a.d\ - freetype/libfreetype.a.d\ - libdrm/libdrm.a\ - pixman/libpixman.a\ - wayland/libwayland-client.a.d\ -) - -if(~ intel $config_video_drivers) { - cflags=($cflags -D WITH_DRM_INTEL -I pkg/libdrm/src/intel) - srcs=($srcs intel.c intel/batch.c) - libs=($libs libdrm/libdrm_intel.a.d) -} -if(~ nouveau $config_video_drivers) { - cflags=($cflags -D WITH_DRM_NOUVEAU -I pkg/libdrm/src/nouveau) - srcs=($srcs nouveau.c) - libs=($libs libdrm/libdrm_nouveau.a) -} - -cflags $cflags - -waylandproto protocol/wayland-drm.xml\ - protocol/wayland-drm-^(client server)^-protocol.h\ - wayland-drm-protocol.c - -phony deps\ - '$outdir'/protocol/wayland-drm-client-protocol.h\ - '$builddir'/pkg/^(fontconfig freetype libdrm)^/fetch.stamp\ - pkg/^(pixman wayland)^/headers - -lib libwld.a -d '$dir'/deps $srcs '$builddir'/pkg/$libs - -fetch git |
