bare-gtk 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CMakeLists.txt CHANGED
@@ -7,7 +7,7 @@ find_package(PkgConfig REQUIRED)
7
7
 
8
8
  project(bare_gtk C)
9
9
 
10
- fetch_package("github:holepunchto/bare@1.24.5")
10
+ fetch_package("github:holepunchto/bare@1.25.0")
11
11
  fetch_package("github:holepunchto/libpath")
12
12
 
13
13
  pkg_check_modules(GTK REQUIRED IMPORTED_TARGET GLOBAL gtk4)
@@ -52,13 +52,8 @@ target_link_libraries(
52
52
  PUBLIC
53
53
  $<LINK_LIBRARY:WHOLE_ARCHIVE,bare_static>
54
54
  PRIVATE
55
- log_static
56
55
  rlimit_static
57
56
  path_static
58
- )
59
-
60
- target_link_libraries(
61
- bare_runtime
62
57
  PRIVATE
63
58
  PkgConfig::GTK
64
59
  )
package/lib/runtime.c CHANGED
@@ -1,7 +1,6 @@
1
1
  #include <assert.h>
2
2
  #include <bare.h>
3
3
  #include <js.h>
4
- #include <log.h>
5
4
  #include <path.h>
6
5
  #include <rlimit.h>
7
6
  #include <signal.h>
@@ -25,6 +24,8 @@ static guint bare__timer;
25
24
 
26
25
  GtkApplication *bare_gtk_app;
27
26
 
27
+ extern char __bare_identifier[] __attribute__((weak));
28
+
28
29
  static void
29
30
  bare__on_shutdown(uv_async_t *handle) {
30
31
  uv_close((uv_handle_t *) handle, NULL);
@@ -101,7 +102,10 @@ bare__run(void) {
101
102
  }
102
103
 
103
104
  static void
104
- bare__on_activate(GtkApplication *app, gpointer data) {
105
+ bare__on_activate(GtkApplication *app, gpointer data) {}
106
+
107
+ static void
108
+ bare__on_startup(GtkApplication *app, gpointer data) {
105
109
  int err;
106
110
 
107
111
  size_t len;
@@ -147,12 +151,11 @@ main(int argc, char *argv[]) {
147
151
  signal(SIGPIPE, SIG_IGN);
148
152
  #endif
149
153
 
150
- err = log_open("bare", 0);
151
- assert(err == 0);
152
-
153
154
  err = rlimit_set(rlimit_open_files, rlimit_infer);
154
155
  assert(err == 0);
155
156
 
157
+ uv_disable_stdio_inheritance();
158
+
156
159
  argv = uv_setup_args(argc, argv);
157
160
 
158
161
  err = uv_barrier_init(&bare__platform_ready, 2);
@@ -216,10 +219,12 @@ main(int argc, char *argv[]) {
216
219
  err = bare_setup(bare__loop, bare__platform, NULL, argc, (const char **) argv, NULL, &bare);
217
220
  assert(err == 0);
218
221
 
219
- GtkApplication *app = bare_gtk_app = gtk_application_new(NULL, 0);
222
+ GtkApplication *app = bare_gtk_app = gtk_application_new(__bare_identifier, 0);
220
223
 
221
224
  g_signal_connect(app, "activate", G_CALLBACK(bare__on_activate), NULL);
222
225
 
226
+ g_signal_connect(app, "startup", G_CALLBACK(bare__on_startup), NULL);
227
+
223
228
  g_application_run(G_APPLICATION(app), argc, argv);
224
229
 
225
230
  g_source_remove(bare__poll);
@@ -249,8 +254,5 @@ main(int argc, char *argv[]) {
249
254
 
250
255
  uv_thread_join(&bare__platform_thread);
251
256
 
252
- err = log_close();
253
- assert(err == 0);
254
-
255
257
  return exit_code;
256
258
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-gtk",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "GTK bindings and runtime for Bare",
5
5
  "exports": {
6
6
  "./package": "./package.json",
@@ -18,7 +18,9 @@
18
18
  ],
19
19
  "addon": true,
20
20
  "scripts": {
21
- "test": "prettier . --check"
21
+ "format": "prettier --write . && lunte --fix",
22
+ "lint": "prettier --check . && lunte",
23
+ "test": "brittle-bare --coverage test.js"
22
24
  },
23
25
  "repository": {
24
26
  "type": "git",
@@ -33,10 +35,14 @@
33
35
  "dependencies": {
34
36
  "require-asset": "^1.1.0"
35
37
  },
38
+ "peerDependencies": {
39
+ "bare-build": "^1.0.0"
40
+ },
36
41
  "devDependencies": {
37
42
  "brittle": "^3.18.0",
38
43
  "cmake-bare": "^1.6.5",
39
44
  "cmake-fetch": "^1.4.0",
45
+ "lunte": "^1.8.0",
40
46
  "prettier": "^3.4.1",
41
47
  "prettier-config-holepunch": "^2.0.0"
42
48
  }
Binary file
Binary file
Binary file
Binary file
package/runtime.js CHANGED
@@ -1,3 +1,7 @@
1
+ const { type } = require('bare-build/constants')
2
+
3
+ const { EXECUTABLE } = type
4
+
1
5
  require.asset = require('require-asset')
2
6
 
3
7
  const prebuilds = {}
@@ -5,9 +9,17 @@ const prebuilds = {}
5
9
  exports.prebuilds = prebuilds
6
10
 
7
11
  prebuilds['linux-x64'] = () => {
8
- return require.asset('./prebuilds/linux-x64/bare', __filename)
12
+ return {
13
+ type: EXECUTABLE,
14
+ path: require.asset('./prebuilds/linux-x64/bare', __filename),
15
+ dependencies: []
16
+ }
9
17
  }
10
18
 
11
19
  prebuilds['linux-arm64'] = () => {
12
- return require.asset('./prebuilds/linux-arm64/bare', __filename)
20
+ return {
21
+ type: EXECUTABLE,
22
+ path: require.asset('./prebuilds/linux-arm64/bare', __filename),
23
+ dependencies: []
24
+ }
13
25
  }