Skip to content

Commit b6d1466

Browse files
committed
Fixing build issues with libwebp in Flathub manifest.
1 parent 1d4382f commit b6d1466

File tree

7 files changed

+22
-42
lines changed

7 files changed

+22
-42
lines changed

com.github.phase1geo.minder.flathub.yml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ app-id: com.github.phase1geo.minder
55
# we can use a convenient pre-made runtime and SDK. For this example, we'll be
66
# using the runtime and SDK provided by elementary.
77
runtime: org.gnome.Platform
8-
runtime-version: '46'
8+
runtime-version: '49'
99
sdk: org.gnome.Sdk
1010

1111
# This should match the exec line in your .desktop file and usually is the same
@@ -80,23 +80,6 @@ modules:
8080
url: https://github.com/elementary/granite/archive/refs/tags/7.6.0.tar.gz
8181
sha256: 4b4e4f7f86eb3f55116faec42ebd87e04c3e424d82715ecd967ed39540dca5ef
8282

83-
# - name: libwebp
84-
# buildsystem: cmake-ninja
85-
# config-opts:
86-
# - -DBUILD_SHARED_LIBS=ON
87-
# - -DWEBP_BUILD_ANIM_UTILS=OFF
88-
# - -DWEBP_BUILD_CWEBP=OFF
89-
# - -DWEBP_BUILD_DWEBP=OFF
90-
# - -DWEBP_BUILD_GIF2WEBP=OFF
91-
# - -DWEBP_BUILD_IMG2WEBP=OFF
92-
# - -DWEBP_BUILD_VWEBP=OFF
93-
# - -DWEBP_BUILD_WEBPMUX=OFF
94-
# - -DWEBP_BUILD_EXTRAS=OFF
95-
# sources:
96-
# - type: archive
97-
# url: https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.2.tar.gz
98-
# sha256: 2a499607df669e40258e53d0ade8035ba4ec0175244869d1025d460562aa09b4
99-
10083
- name: minder
10184
buildsystem: meson
10285
sources:

data/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ install_data(
66
i18n.merge_file(
77
input: meson.project_name() + '.desktop.in',
88
output: meson.project_name() + '.desktop',
9-
po_dir: join_paths(meson.source_root(), 'po', 'extra'),
9+
po_dir: join_paths(meson.project_source_root(), 'po', 'extra'),
1010
type: 'desktop',
1111
install: true,
1212
install_dir: join_paths(get_option('datadir'), 'applications')
@@ -15,7 +15,7 @@ i18n.merge_file(
1515
i18n.merge_file(
1616
input: meson.project_name() + '.appdata.xml.in',
1717
output: meson.project_name() + '.appdata.xml',
18-
po_dir: join_paths(meson.source_root(), 'po', 'extra'),
18+
po_dir: join_paths(meson.project_source_root(), 'po', 'extra'),
1919
install: true,
2020
install_dir: join_paths(get_option('datadir'), 'metainfo')
2121
)

meson.build

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ if libmarkdown.version().version_compare('>=3.0')
4646
endif
4747

4848
add_project_arguments([
49-
'--vapidir', join_paths(meson.current_source_dir(), 'vapi'),
49+
'--vapidir=' + join_paths(meson.project_source_root(), 'vapi'),
5050
'--disable-warnings'
5151
],
5252
language: 'vala',
5353
)
5454

55+
add_project_arguments(['-w'], language: 'c')
56+
5557
dependencies = [
5658
dependency('gobject-2.0'),
5759
dependency('glib-2.0'),
@@ -76,7 +78,8 @@ e = executable('com.github.phase1geo.minder',
7678
gresource,
7779
dependencies: dependencies,
7880
vala_args: [
79-
meson.source_root() + markdown_vapi
81+
join_paths(meson.project_source_root(), 'vapi', 'libmarkdown.vapi'),
82+
join_paths(meson.project_source_root(), 'vapi', 'libwebp.vapi'),
8083
],
8184
install : true
8285
)

po/extra/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
i18n.gettext('extra',
22
args: [
3-
'--directory=' + meson.source_root(),
3+
'--directory=' + meson.project_source_root(),
44
'--from-code=UTF-8'
55
],
66
install: false
7-
)
7+
)

po/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
i18n.gettext(meson.project_name(),
22
args: [
3-
'--directory='+meson.source_root(),
3+
'--directory='+meson.project_source_root(),
44
'--from-code=UTF-8'
55
]
66
)

src/exports/ExportWebP.vala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
* Authored by: Trevor Williams <[email protected]>
2020
*/
2121

22-
using WebP;
2322
using Cairo;
2423
using Gdk;
2524
using Gtk;
@@ -54,7 +53,7 @@ public class ExportWebP : Export {
5453
uint8* output_buffer = null;
5554
size_t buffer_size = 0;
5655

57-
buffer_size = WebP.encode_lossless_rgba( pixbuf.get_pixels(), pixbuf.get_width(), pixbuf.get_height(), pixbuf.get_rowstride(), out output_buffer );
56+
buffer_size = WebPEncodeLosslessRGBA( pixbuf.get_pixels(), pixbuf.get_width(), pixbuf.get_height(), pixbuf.get_rowstride(), out output_buffer );
5857

5958
if( buffer_size == 0 ) {
6059
stdout.printf( "Failed to encode WebP image.\n" );
@@ -66,7 +65,7 @@ public class ExportWebP : Export {
6665
for( int i=0; i<buffer_size; i++ ) {
6766
obuf += output_buffer[i];
6867
}
69-
WebP.free( output_buffer );
68+
WebPFree( output_buffer );
7069
var file = File.new_for_path( fname );
7170
var output_stream = file.replace( null, false, FileCreateFlags.NONE, null );
7271
output_stream.write( obuf );

vapi/libwebp.vapi

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
[CCode (cheader_filename = "webp/encode.h")]
2-
namespace WebP {
2+
public extern size_t WebPEncodeLosslessRGBA(
3+
uint8* rgb,
4+
int width,
5+
int height,
6+
int stride,
7+
out uint8* output_buffer
8+
);
39

4-
[CCode (cname = "WebPEncodeLosslessRGBA")]
5-
public extern size_t encode_lossless_rgba(
6-
uint8* rgb,
7-
int width,
8-
int height,
9-
int stride,
10-
out uint8* output_buffer
11-
);
12-
13-
[CCode (cname = "WebPFree", cheader_filename = "webp/decode.h")]
14-
public extern void free(void* ptr);
15-
16-
}
10+
[CCode (cheader_filename = "webp/decode.h")]
11+
public extern void WebPFree(void* ptr);

0 commit comments

Comments
 (0)