Skip to content

Commit

Permalink
Merge pull request #70 from ppvan/dev
Browse files Browse the repository at this point in the history
Doing some stuff on the build system
  • Loading branch information
ppvan authored Apr 19, 2024
2 parents 132fa0a + a436071 commit 0c3d478
Show file tree
Hide file tree
Showing 58 changed files with 242 additions and 243 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
name: "Flatpak"
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-44
image: bilelmoussaoui/flatpak-github-actions:gnome-46
options: --privileged
steps:
- uses: actions/checkout@v4
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: palette.flatpak
bundle: me.ppvan.psequel.flatpak
manifest-path: me.ppvan.psequel.json
cache-key: flatpak-builder-${{ github.sha }}
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# This is just a file for me to type command faster, not the build file.


debug: clean
ninja -C build/ && G_MESSAGES_DEBUG=Psequel ./build/src/psequel
debug:
ninja -C build/ && G_MESSAGES_DEBUG=Psequel ./build/src/me.ppvan.psequel

clean:
rm -rf build/res
Expand All @@ -11,7 +10,9 @@ test:
ninja -C build/ && ./build/test/psequel-test

flatpak:
flatpak-builder _build/ me.ppvan.psequel.Devel.json --force-clean
flatpak-builder build-aux/ me.ppvan.psequel.json --force-clean
flatpak build-export export build-aux
flatpak build-bundle export me.ppvan.psequel.flatpak --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo

run:
G_MESSAGES_DEBUG=Psequel ./build/src/psequel
G_MESSAGES_DEBUG=Psequel ./build/src/me.ppvan.psequel
25 changes: 6 additions & 19 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,37 +1,24 @@
project(
'psequel',
'me.ppvan.psequel',
['c', 'vala'],
version: '0.2.0',
meson_version: '>= 1.2.0',
default_options: [
'warning_level=2',
'warning_level=1',
'werror=false',
],
)

app_is_development = false
app_id = 'me.ppvan.psequel'

if get_option('buildtype') == 'debug'
add_project_arguments('--debug', language: 'vala')
app_is_development = true
endif



app_id = meson.project_name()
app_resource_prefix = meson.project_name().replace('.', '/')
app_name = meson.project_name().split('.')[-1]

i18n = import('i18n')
gnome = import('gnome')
# cc = meson.get_compiler('c')
valac = meson.get_compiler('vala')


# Pass custom vapi to compiler (for libpq)
vapi_dir = join_paths(meson.project_source_root(), 'src', 'vapi')
add_project_arguments(['--vapidir', vapi_dir], language: 'vala')

subdir('data')
subdir('res')
subdir('resources')
subdir('src')
subdir('po')

Expand Down
60 changes: 0 additions & 60 deletions res/meson.build

This file was deleted.

63 changes: 0 additions & 63 deletions res/psequel.gresource.xml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ template $PsequelViewStructureView: Box {
halign: start;
}

$PsequelTableColInfo columns {
columns: bind template.columns;
}
// $PsequelTableColInfo columns {
// columns: bind template.columns;
// }

Label {
styles [
Expand All @@ -30,7 +30,7 @@ template $PsequelViewStructureView: Box {
halign: start;
}

$PsequelTableIndexInfo indexes {
indexes: bind template.indexes;
}
// $PsequelTableIndexInfo indexes {
// indexes: bind template.indexes;
// }
}
File renamed without changes.
109 changes: 109 additions & 0 deletions resources/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@


blueprint_compiler = find_program('blueprint-compiler')

# CURRENT_SOURCE_DIR relative to BUILDDIR blueprints_output_dir = meson.current_build_dir()
# This is a hack to make sure below target was run. For some reason you can't use example from blueprint docs.

psequel_resources_dir = meson.current_build_dir()

mark_ups = [
'gtk/connection-listitem.blp',
'gtk/connection-row.blp',
'gtk/connection-view.blp',
'gtk/datacell.blp',
'gtk/help-overlay.blp',
'gtk/preferences-window.blp',
'gtk/query-editor.blp',
'gtk/query-listitem.blp',
'gtk/query-results.blp',
'gtk/schema-view.blp',
'gtk/style-switcher.blp',
'gtk/table-cols.blp',
'gtk/table-data-view.blp',
'gtk/table-fk.blp',
'gtk/table-graph.blp',
'gtk/table-index.blp',
'gtk/table-listitem.blp',
'gtk/table-row.blp',
'gtk/table-structure-view.blp',
'gtk/view-data-view.blp',
'gtk/view-listitem.blp',
'gtk/view-structure-view.blp',
'gtk/window.blp',
]

icons = [
'plus-large-symbolic.svg',
'minus-large-symbolic.svg',
'library-symbolic.svg',
'object-rows-symbolic.svg',
'terminal-symbolic.svg',
'loupe-large-symbolic.svg',
'refresh-large-symbolic.svg',
'table-symbolic.svg',
'columns-symbolic.svg',
'step-out-symbolic.svg',
'arrow-into-box-symbolic.svg',
'category-search-symbolic.svg',
'left-large-symbolic.svg',
'right-large-symbolic.svg',
'text-sql-symbolic.svg',
'webview-filler-symbolic.svg',
'settings-symbolic.svg',
'test-pass-symbolic.svg',
'history-undo-symbolic.svg',
'check-plain-symbolic.svg',
'export-symbolic.svg',
'filemanager-app-symbolic.svg',
'application-certificate-symbolic.svg',
]


blueprints = custom_target(
'blueprints',
input: files(mark_ups),
build_by_default: true,
build_always_stale: true,
# This does not run if you use an dot (.)
output: '.',
command: [
blueprint_compiler,
'batch-compile',
'@OUTPUT@',
'@CURRENT_SOURCE_DIR@',
'@INPUT@',
],
)

ui_files = ''
foreach mark_up : mark_ups
filename = mark_up.replace('.blp', '.ui')
ui_files += f'<file preprocess="xml-stripblanks">@filename@</file>'
endforeach

icon_files = ''
foreach icon : icons
icon_files += f'<file preprocess="xml-stripblanks" alias="@icon@">gtk/icons/@icon@</file>'
endforeach

resource_data = configuration_data()
resource_data.set('PREFIX', app_resource_prefix)
resource_data.set('UI_FILES', ui_files)
resource_data.set('ICON_FILES', icon_files)


psequel_resources_xml = configure_file(
input: 'psequel.gresource.xml.in',
output: 'psequel.gresource.xml',
configuration: resource_data,
)


psequel_resources = gnome.compile_resources(
'psequel_resources',
psequel_resources_xml,
c_name: 'psequel_resources',
dependencies: [blueprints],
)

File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions resources/psequel.gresource.xml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/@PREFIX@">
<file alias="style.css">gtk/style.css</file>
<file>migrations/version-0.sql</file>
<file>migrations/version-1.sql</file>
@UI_FILES@
</gresource>

<gresource prefix="/@PREFIX@/icons/scalable/actions/">
@ICON_FILES@
</gresource>
</gresources>
Loading

0 comments on commit 0c3d478

Please sign in to comment.