Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
942 changes: 942 additions & 0 deletions .yarn/releases/yarn-4.10.3.cjs

Large diffs are not rendered by default.

925 changes: 0 additions & 925 deletions .yarn/releases/yarn-4.5.0.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ npmPublishAccess: public

npmRegistryServer: "https://registry.npmjs.org/"

yarnPath: .yarn/releases/yarn-4.5.0.cjs
yarnPath: .yarn/releases/yarn-4.10.3.cjs
2 changes: 1 addition & 1 deletion docs/pages/getting_started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Inside the `greenfield` repository, we'll use `yarn` to install all dependencies
> Greenfield uses [yarn 4 or greater.](https://yarnpkg.com/getting-started/install)

{: .important }
> Greenfield requires the following packages to be installed on your build system: `autoconf libtool automake meson ninja-build bison cmake build-essential gperf`.
> Greenfield requires the following packages to be installed on your build system: `wget pkgconfig python python-packaging autoconf libtool automake meson ninja-build bison cmake build-essential gperf`.

```shell
yarn install
Expand Down
2 changes: 1 addition & 1 deletion examples/compositor/experimental-fullscreen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@gfld/compositor": "workspace:^"
},
"devDependencies": {
"typescript": "^5.5.2",
"typescript": "5.6.x",
"vite": "^5.3.1",
"vite-plugin-glsl": "^1.3.0"
}
Expand Down
4 changes: 3 additions & 1 deletion examples/compositor/experimental-fullscreen/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"dom",
"dom.iterable",
"esnext"
]
],
"strictNullChecks": true,
"removeComments": true
},
"include": ["src"]
}
15 changes: 9 additions & 6 deletions examples/sdk/gtk4/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ fi
DIR=$(dirname "$(readlink -f "$CURRENT_SCRIPT")")


EXTRA_LDFLAGS="-g -sTOTAL_MEMORY=256MB --preload-file $DIR/fonts/inter@/usr/share/fonts/opentype/inter"

meson setup --wipe build/ --cross-file "$_SDK_DIR/toolkit/meson-gf-cross.ini" --cross-file "$_SDK_DIR/toolkit/meson-gf-toolchain.ini" -Dprefix="$_SDK_DIR/sysroot" \
EXTRA_LDFLAGS="-g -sINITIAL_MEMORY=512MB '-fsanitize=undefined' \
--preload-file $DIR/fonts/inter@/usr/share/fonts/opentype/inter \
--preload-file $DIR/build/examples/application9/gschemas.compiled@/usr/share/glib-2.0/schemas/ \
--preload-file $_SDK_DIR/sysroot/share/X11/xkb@/home/web_user/.config/xkb \
--preload-file $_SDK_DIR/sysroot/share/fontconfig@/usr/share/fontconfig \
--preload-file $_SDK_DIR/sysroot/etc/fonts@/etc/fonts \
--pre-js $DIR/set_env.js"

meson setup --wipe build/ --cross-file "$_SDK_DIR/toolkit/meson-gf-cross.ini" --cross-file "$_SDK_DIR/toolkit/meson-gf-toolchain.ini" \
-Dbuild-examples=true -Ddemos=false -Dc_link_args="$EXTRA_LDFLAGS"
ninja -C build/ -j10



4 changes: 2 additions & 2 deletions examples/sdk/gtk4/examples/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ foreach ex : examples
endforeach

#subdir('bp')
subdir('application1')
#subdir('application1')
#subdir('application2')
#subdir('application3')
#subdir('application4')
#subdir('application5')
#subdir('application6')
#subdir('application7')
#subdir('application8')
#subdir('application9')
subdir('application9')
7 changes: 7 additions & 0 deletions examples/sdk/gtk4/set_env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

var setEnv = function() {
ENV.FONTCONFIG_PATH="/etc/fonts"
ENV.GSK_RENDERER="cairo"
}

Module.preRun = Module.preRun ? [...Module.preRun, setEnv] : [setEnv]
3 changes: 1 addition & 2 deletions examples/sdk/weston/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ fi
DIR=$(dirname "$(readlink -f "$CURRENT_SCRIPT")")


EXTRA_LDFLAGS="-s TOTAL_MEMORY=256MB -sEMULATE_FUNCTION_POINTER_CASTS \
--preload-file $DIR/data@/data --preload-file $DIR/fonts/inter@/usr/share/fonts/opentype/inter --pre-js $DIR/set_env.js"
EXTRA_LDFLAGS="-flto -s TOTAL_MEMORY=256MB --preload-file $DIR/data@/data --preload-file $DIR/fonts/inter@/usr/share/fonts/opentype/inter --pre-js $DIR/set_env.js"

meson setup --wipe build/ --cross-file "$_SDK_DIR/toolkit/meson-gf-cross.ini" --cross-file "$_SDK_DIR/toolkit/meson-gf-toolchain.ini" -Dprefix="$_SDK_DIR/sysroot" \
-Dimage-jpeg=false -Dimage-webp=false -Dtools=[] -Ddemo-clients=true -Dsimple-clients=shm \
Expand Down
2 changes: 1 addition & 1 deletion examples/webapps/simple-shm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@gfld/common": "workspace:^"
},
"devDependencies": {
"typescript": "^5.5.2",
"typescript": "5.6.x",
"vite": "^5.3.1",
"vite-plugin-glsl": "^1.3.0"
}
Expand Down
4 changes: 3 additions & 1 deletion examples/webapps/simple-shm/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"dom",
"dom.iterable",
"esnext",
]
],
"strictNullChecks": true,
"removeComments": true
},
"include": ["src"]
}
2 changes: 1 addition & 1 deletion examples/webapps/webgl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"gl-matrix": "^3.4.3"
},
"devDependencies": {
"typescript": "^5.5.2",
"typescript": "5.6.x",
"vite": "^5.3.1",
"vite-plugin-glsl": "^1.3.0"
}
Expand Down
4 changes: 3 additions & 1 deletion examples/webapps/webgl/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"dom",
"dom.iterable",
"esnext",
]
],
"strictNullChecks": true,
"removeComments": true
}
}
8 changes: 4 additions & 4 deletions libs/client-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"url": "https://github.com/udevbe/greenfield/tree/master/libs/web/client/generator"
},
"dependencies": {
"camelcase": "^8.0.0",
"meow": "^13.2.0",
"uppercamelcase": "^3.0.0",
"xml2js": "^0.6.2"
"camelcase": "8.x",
"meow": "14.x",
"uppercamelcase": "3.x",
"xml2js": "0.x"
}
}
16 changes: 8 additions & 8 deletions libs/client-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
},
"devDependencies": {
"@gfld/client-generator": "workspace:^",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"typescript": "^5.5.2"
"@typescript-eslint/eslint-plugin": "8.x",
"@typescript-eslint/parser": "8.x",
"eslint": "9.x",
"eslint-config-prettier": "10.x",
"eslint-plugin-prettier": "5.x",
"prettier": "3.x",
"rimraf": "6.x",
"typescript": "5.6.x"
}
}
6 changes: 3 additions & 3 deletions libs/client-protocol/src/westfield-runtime-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class Proxy extends WlObject {
id: number,
opcode: number,
proxyClass: { new (display: Display, connection: Connection, id: number): T },
argsArray: MessageMarshallingContext<any, any, any>[],
argsArray: MessageMarshallingContext<any, any>[],
): T {
// construct new object
const proxy = new proxyClass(this.display, this.connection, this.display.generateNextId())
Expand All @@ -51,7 +51,7 @@ export class Proxy extends WlObject {
return proxy
}

marshall(id: number, opcode: number, argsArray: MessageMarshallingContext<any, any, any>[]) {
marshall(id: number, opcode: number, argsArray: MessageMarshallingContext<any, any>[]) {
// determine required wire message length
let size = 4 + 2 + 2 // id+size+opcode
argsArray.forEach((arg) => (size += arg.size))
Expand Down Expand Up @@ -260,7 +260,7 @@ export class DisplayImpl implements Display {
if (ArrayBuffer.isView(fd) && !transferables.includes(fd.buffer)) {
if (!(fd.buffer instanceof SharedArrayBuffer)) {
transferables.push(fd.buffer)
} /* else it's a SharedArrayBuffer which is not transferable */
} /* else it's a SharedArrayBuffer that is not transferable */
} else if (fd instanceof ImageBitmap || fd instanceof MessagePort) {
transferables.push(fd)
} else {
Expand Down
3 changes: 2 additions & 1 deletion libs/client-protocol/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declarationDir": "types",
"outDir": "dist"
"outDir": "dist",
"strictNullChecks": true
},
"include": [
"src"
Expand Down
16 changes: 8 additions & 8 deletions libs/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
"build": "yarn run tsc"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"typescript": "^5.5.2"
"@typescript-eslint/eslint-plugin": "8.x",
"@typescript-eslint/parser": "8.x",
"eslint": "9.x",
"eslint-config-prettier": "10.x",
"eslint-plugin-prettier": "5.x",
"prettier": "3.x",
"rimraf": "6.x",
"typescript": "5.6.x"
}
}
29 changes: 13 additions & 16 deletions libs/common/src/Connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export type FD = unknown
export interface MessageMarshallingContext<
V extends number | FD | Fixed | WlObject | 0 | string | ArrayBufferView | undefined,
T extends 'u' | 'h' | 'i' | 'f' | 'o' | 'n' | 's' | 'a',
S extends 0 | 4 | number,
> {
value: V
readonly type: T
Expand All @@ -105,7 +104,7 @@ export interface SendMessage {
fds: Array<FD>
}

export function uint(arg: number): MessageMarshallingContext<number, 'u', 4> {
export function uint(arg: number): MessageMarshallingContext<number, 'u'> {
return {
value: arg,
type: 'u',
Expand All @@ -126,7 +125,7 @@ export function fileDescriptor(
marshallArg: (wireMsg: { buffer: ArrayBuffer; fds: Array<FD>; bufferOffset: number }) => void = function (wireMsg) {
wireMsg.fds.push(arg)
},
): MessageMarshallingContext<FD, 'h', 0> {
): MessageMarshallingContext<FD, 'h'> {
return {
value: arg,
type: 'h',
Expand All @@ -139,7 +138,7 @@ export function fileDescriptor(
}
}

export function int(arg: number): MessageMarshallingContext<number, 'i', 4> {
export function int(arg: number): MessageMarshallingContext<number, 'i'> {
return {
value: arg,
type: 'i',
Expand All @@ -155,7 +154,7 @@ export function int(arg: number): MessageMarshallingContext<number, 'i', 4> {
}
}

export function fixed(arg: Fixed): MessageMarshallingContext<Fixed, 'f', 4> {
export function fixed(arg: Fixed): MessageMarshallingContext<Fixed, 'f'> {
return {
value: arg,
type: 'f',
Expand All @@ -171,7 +170,7 @@ export function fixed(arg: Fixed): MessageMarshallingContext<Fixed, 'f', 4> {
}
}

export function object(arg: WlObject): MessageMarshallingContext<WlObject, 'o', 4> {
export function object(arg: WlObject): MessageMarshallingContext<WlObject, 'o'> {
return {
value: arg,
type: 'o',
Expand All @@ -187,7 +186,7 @@ export function object(arg: WlObject): MessageMarshallingContext<WlObject, 'o',
}
}

export function objectOptional(arg?: WlObject): MessageMarshallingContext<WlObject | undefined, 'o', 4> {
export function objectOptional(arg?: WlObject): MessageMarshallingContext<WlObject | undefined, 'o'> {
return {
value: arg,
type: 'o',
Expand All @@ -203,7 +202,7 @@ export function objectOptional(arg?: WlObject): MessageMarshallingContext<WlObje
}
}

export function newObject(): MessageMarshallingContext<0, 'n', 4> {
export function newObject(): MessageMarshallingContext<0, 'n'> {
return {
value: 0, // id filled in by marshallConstructor
type: 'n',
Expand All @@ -219,7 +218,7 @@ export function newObject(): MessageMarshallingContext<0, 'n', 4> {
}
}

export function string(arg: string): MessageMarshallingContext<string, 's', number> {
export function string(arg: string): MessageMarshallingContext<string, 's'> {
return {
value: `${arg}\0`,
type: 's',
Expand Down Expand Up @@ -247,7 +246,7 @@ export function string(arg: string): MessageMarshallingContext<string, 's', numb
}
}

export function stringOptional(arg?: string): MessageMarshallingContext<string | undefined, 's', number> {
export function stringOptional(arg?: string): MessageMarshallingContext<string | undefined, 's'> {
return {
value: arg ? `${arg}\0` : undefined,
type: 's',
Expand Down Expand Up @@ -283,7 +282,7 @@ export function stringOptional(arg?: string): MessageMarshallingContext<string |
}
}

export function array(arg: ArrayBufferView): MessageMarshallingContext<ArrayBufferView, 'a', number> {
export function array(arg: ArrayBufferView): MessageMarshallingContext<ArrayBufferView, 'a'> {
return {
value: arg,
type: 'a',
Expand All @@ -310,9 +309,7 @@ export function array(arg: ArrayBufferView): MessageMarshallingContext<ArrayBuff
}
}

export function arrayOptional(
arg?: ArrayBufferView,
): MessageMarshallingContext<ArrayBufferView | undefined, 'a', number> {
export function arrayOptional(arg?: ArrayBufferView): MessageMarshallingContext<ArrayBufferView | undefined, 'a'> {
return {
value: arg,
type: 'a',
Expand Down Expand Up @@ -452,7 +449,7 @@ export function s(message: WlMessage): string {
return textDecoder.decode(byteArray)
}

export function aOptional(message: WlMessage, optional: boolean): ArrayBuffer | undefined {
export function aOptional(message: WlMessage, _: boolean): ArrayBuffer | undefined {
checkMessageSize(message, 4)
const arraySize = message.buffer[message.bufferOffset++]
if (arraySize === 0) {
Expand Down Expand Up @@ -507,7 +504,7 @@ export class Connection {
private onCloseResolve: (value: PromiseLike<void> | void) => void
readonly onClose = new Promise<void>((resolve) => (this.onCloseResolve = resolve))

marshallMsg(id: number, opcode: number, size: number, argsArray: MessageMarshallingContext<any, any, any>[]) {
marshallMsg(id: number, opcode: number, size: number, argsArray: MessageMarshallingContext<any, any>[]) {
const wireMsg = {
buffer: new ArrayBuffer(size),
fds: [],
Expand Down
8 changes: 4 additions & 4 deletions libs/compositor-ffmpeg-h264/build_wasm.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env bash
set -e

EMSDK_VERSION="3.1.46"
EMSDK_VERSION="4.0.7"
git -C emsdk pull || git clone https://github.com/emscripten-core/emsdk.git emsdk
pushd 'emsdk'
./emsdk install ${EMSDK_VERSION}
./emsdk activate ${EMSDK_VERSION}
source ./emsdk_env.sh
popd

FFMPEG_VERSION="n5.1.2"
FFMPEG_VERSION="n7.0.2"
ensure_ffmpeg() {
[ -e ffmpeg ] || git clone --depth 1 --branch "$FFMPEG_VERSION" "https://github.com/FFmpeg/FFmpeg.git" ffmpeg
}
Expand Down Expand Up @@ -40,8 +40,8 @@ build() {
echo "Running Emscripten..."
emcc native/decoder.c -I./ffmpeg-build/include -O3 -flto -msimd128 -Wno-deprecated-declarations -Wno-pointer-sign -Wno-implicit-int-float-conversion -Wno-switch -Wno-parentheses -Qunused-arguments -c -o ffmpeg-build/decoder.bc
EXPORTED_FUNCTIONS='["_malloc","_free","_create_codec_context","_destroy_codec_context","_decode","_close_frame"]'
EXPORTED_RUNTIME_METHODS='["getValue"]'
emcc ffmpeg-build/decoder.bc ffmpeg-build/lib/libavcodec.a ffmpeg-build/lib/libavutil.a -O3 -flto -msimd128 -Wno-deprecated-declarations -Wno-pointer-sign -Wno-implicit-int-float-conversion -Wno-switch -Wno-parentheses -Qunused-arguments -L"$(pwd)"/dist/lib -s INITIAL_MEMORY=32MB -s MAXIMUM_MEMORY=128MB -s EVAL_CTORS=2 -fno-rtti -fno-exceptions --memory-init-file 0 -s ENVIRONMENT='worker' -s NO_EXIT_RUNTIME=1 -s NO_FILESYSTEM=1 -s INVOKE_RUN=0 -s DOUBLE_MODE=0 -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s EXPORT_ES6=1 -s SINGLE_FILE=1 -o ./src/libav-h264.js -s EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS" -s EXPORTED_RUNTIME_METHODS="$EXPORTED_RUNTIME_METHODS"
EXPORTED_RUNTIME_METHODS='["getValue","HEAPU8"]'
emcc ffmpeg-build/decoder.bc ffmpeg-build/lib/libavcodec.a ffmpeg-build/lib/libavutil.a -O3 -flto -msimd128 -Wno-deprecated-declarations -Wno-pointer-sign -Wno-implicit-int-float-conversion -Wno-switch -Wno-parentheses -Qunused-arguments -L"$(pwd)"/dist/lib -s INITIAL_MEMORY=32MB -s MAXIMUM_MEMORY=128MB -s EVAL_CTORS=2 -fno-rtti -fno-exceptions -s ENVIRONMENT='worker' -s NO_EXIT_RUNTIME=1 -s NO_FILESYSTEM=1 -s INVOKE_RUN=0 -s DOUBLE_MODE=0 -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s EXPORT_ES6=1 -s SINGLE_FILE=1 -o ./src/libav-h264.js -s EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS" -s EXPORTED_RUNTIME_METHODS="$EXPORTED_RUNTIME_METHODS"

echo "Finished Build"
}
Expand Down
Loading