Skip to content

Commit

Permalink
Fix packaging (amit9838#58)
Browse files Browse the repository at this point in the history
* Fix snap packaging

- Fixed missing artifacts in snap version
- Use meson version >=0.61 for compatibility
  in ubuntu 22.04 (current version 0.61.2)
- Update project version to 1.0.1

* fixes as needed

* remove the conditions based on packaging format

---------

Co-authored-by: সৌম্যদীপ ঘোষ <[email protected]>
  • Loading branch information
hsbasu and soumyaDghosh authored Feb 2, 2024
1 parent 0b106f1 commit 80b4485
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 48 deletions.
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('weather',
version: '0.1.0',
meson_version: '>= 0.62.0',
version: '1.0.1',
meson_version: '>= 0.61.0',
default_options: [ 'warning_level=2', 'werror=false', ],
)

Expand Down
35 changes: 0 additions & 35 deletions snap/mousam.patch

This file was deleted.

12 changes: 7 additions & 5 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: mousam
base: core22
adopt-info: mousam

grade: stable
confinement: strict

base: core22
architectures:
- build-on: amd64
- build-on: arm64
- build-on: armhf

parts:
mousam:
plugin: meson
source: https://github.com/amit9838/weather.git
#source-tag: 'v1.0.0'
source-depth: 1
#source-tag: used when there will be a new release with these fixes
plugin: meson
meson-parameters: [ --prefix=/snap/mousam/current/usr ]
override-pull: |
craftctl default
Expand Down Expand Up @@ -45,5 +49,3 @@ apps:
PYTHONPATH: $SNAP/usr/lib/python3.10/dist-packages:$PYTHONPATH
plugs:
- network
- network-status
- network-bind
4 changes: 1 addition & 3 deletions src/constants.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import os

icon_loc = "/app/share/icons/hicolor/scalable/weather_icons/"

if os.getenv('SNAP'):
icon_loc = f"{os.getenv('SNAP')}/usr/share/icons/hicolor/scalable/weather_icons/"
icon_loc = "@icon_location@/share/icons/hicolor/scalable/weather_icons/"

icons = {
"0": icon_loc + "clear-day.svg",
Expand Down
14 changes: 11 additions & 3 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gnome.compile_resources('weather',
python = import('python')

conf = configuration_data()
conf.set('PYTHON', python.find_installation('python3').path())
conf.set('PYTHON', python.find_installation('python3').full_path())
conf.set('VERSION', meson.project_version())
conf.set('localedir', join_paths(get_option('prefix'), get_option('localedir')))
conf.set('pkgdatadir', pkgdatadir)
Expand All @@ -26,7 +26,6 @@ configure_file(
install_mode: 'r-xr--r--'
)


weather_sources = [
'main.py',
'weather.py',
Expand Down Expand Up @@ -60,6 +59,15 @@ weather_sources = [
'windowLocations.py'
]

install_data(weather_sources, install_dir: moduledir)

icon_conf = configuration_data()
icon_conf.set('icon_location', get_option('prefix'))

install_data(weather_sources, install_dir: moduledir)
configure_file(
input: 'constants.py',
output: 'constants.py',
configuration: icon_conf,
install: true,
install_dir: moduledir
)

0 comments on commit 80b4485

Please sign in to comment.