summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.nix1
-rw-r--r--gjs/index.ts7
-rw-r--r--gjs/tsconfig.json8
-rw-r--r--meson.build8
-rw-r--r--meson_options.txt6
-rw-r--r--src/meson.build9
6 files changed, 32 insertions, 7 deletions
diff --git a/flake.nix b/flake.nix
index 91b1ebe..ffc8c70 100644
--- a/flake.nix
+++ b/flake.nix
@@ -40,7 +40,6 @@
buildInputs
++ [
(lua.withPackages (ps: [ps.lgi]))
- (python3.withPackages (ps: [ps.pygobject3]))
gjs
];
in {
diff --git a/gjs/index.ts b/gjs/index.ts
index 901b264..f5c35a6 100644
--- a/gjs/index.ts
+++ b/gjs/index.ts
@@ -1,5 +1,12 @@
import { Gtk } from "./src/imports.js"
+declare global {
+ const console: {
+ error(...args: any[]): void
+ log(...args: any[]): void
+ }
+}
+
export * from "./src/imports.js"
export * from "./src/process.js"
export * from "./src/time.js"
diff --git a/gjs/tsconfig.json b/gjs/tsconfig.json
index a259dd9..25c0fdb 100644
--- a/gjs/tsconfig.json
+++ b/gjs/tsconfig.json
@@ -13,11 +13,13 @@
"checkJs": true,
"allowJs": true,
"jsx": "react-jsx",
- "jsxImportSource": "./src/jsx"
+ "jsxImportSource": "./src/jsx",
+ "typeRoots": [
+ "./node_modules/@girs"
+ ]
},
"include": [
- "./src",
+ "./src/**/*",
"./index.ts",
- "./node_modules/@girs"
]
}
diff --git a/meson.build b/meson.build
index e5be5e2..4020a81 100644
--- a/meson.build
+++ b/meson.build
@@ -11,6 +11,10 @@ project(
],
)
+prefix = get_option('prefix')
+libdir = get_option('prefix') / get_option('libdir')
+pkgdatadir = prefix / get_option('datadir') / 'astal'
+
# math
add_project_arguments(['-X', '-lm'], language: 'vala')
@@ -19,4 +23,8 @@ assert(
'Either lib or cli option must be set to true.',
)
+if get_option('gjs')
+ install_subdir('gjs', install_dir: pkgdatadir)
+endif
+
subdir('src')
diff --git a/meson_options.txt b/meson_options.txt
index f110242..a60ff42 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -9,3 +9,9 @@ option(
type: 'boolean',
value: true,
)
+
+option(
+ 'gjs',
+ type: 'boolean',
+ value: true,
+)
diff --git a/src/meson.build b/src/meson.build
index ff5b02e..0bc73a1 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -66,7 +66,10 @@ if get_option('lib')
version: meson.project_version(),
subdirs: meson.project_name(),
requires: deps,
- install_dir: get_option('libdir') / 'pkgconfig',
+ install_dir: libdir / 'pkgconfig',
+ variables: {
+ 'gjs': pkgdatadir / 'gjs',
+ },
)
custom_target(
@@ -74,14 +77,14 @@ if get_option('lib')
command: [
find_program('g-ir-compiler'),
'--output', '@OUTPUT@',
- '--shared-library', get_option('prefix') / get_option('libdir') / '@PLAINNAME@',
+ '--shared-library', libdir / '@PLAINNAME@',
meson.current_build_dir() / gir,
],
input: lib,
output: typelib,
depends: lib,
install: true,
- install_dir: get_option('libdir') / 'girepository-1.0',
+ install_dir: libdir / 'girepository-1.0',
)
endif