-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd1052f
commit b17bf15
Showing
4 changed files
with
11,651 additions
and
9,053 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
import 'dart:ffi'; | ||
import 'package:flatpak/src/libflatpak.dart'; | ||
|
||
void main() { | ||
// Load the Flatpak library | ||
final DynamicLibrary libFlatpak = DynamicLibrary.open('libflatpak.so'); | ||
class Flatpak { | ||
late NativeLibrary libFlatpak; | ||
|
||
Flatpak() { | ||
DynamicLibrary libFlatpakLib = DynamicLibrary.open('libflatpak.so'); | ||
libFlatpak = NativeLibrary(libFlatpakLib); | ||
} | ||
|
||
NativeLibrary n = NativeLibrary(libFlatpak); | ||
String version() { | ||
int major = FLATPAK_MAJOR_VERSION; | ||
int minor = FLATPAK_MINOR_VERSION; | ||
int micro = FLATPAK_MICRO_VERSION; | ||
return '$major.$minor.$micro'; | ||
} | ||
} | ||
|
||
print(n.glib_major_version); | ||
void main() { | ||
Flatpak flatpak = Flatpak(); | ||
print("Flatpak version: ${flatpak.version()}"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
dart run ffigen --compiler-opts "-isystem /usr/lib/clang/17/include/ -isystem /usr/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include/ -I/usr/include/flatpak/" |
Oops, something went wrong.