2022-05-25 17:11:42 -04:00
|
|
|
rootdir := ''
|
|
|
|
|
prefix := '/usr'
|
|
|
|
|
clean := '0'
|
|
|
|
|
debug := '0'
|
|
|
|
|
vendor := '0'
|
|
|
|
|
target := if debug == '1' { 'debug' } else { 'release' }
|
|
|
|
|
vendor_args := if vendor == '1' { '--frozen --offline' } else { '' }
|
|
|
|
|
debug_args := if debug == '1' { '' } else { '--release' }
|
|
|
|
|
cargo_args := vendor_args + ' ' + debug_args
|
|
|
|
|
|
2024-02-06 14:10:27 +01:00
|
|
|
targetdir := env('CARGO_TARGET_DIR', 'target')
|
2022-05-25 17:11:42 -04:00
|
|
|
sharedir := rootdir + prefix + '/share'
|
2023-08-08 16:18:12 -04:00
|
|
|
iconsdir := sharedir + '/icons/hicolor'
|
2022-05-25 17:11:42 -04:00
|
|
|
bindir := rootdir + prefix + '/bin'
|
|
|
|
|
|
2022-11-29 16:52:31 -05:00
|
|
|
build: _extract_vendor
|
2022-11-17 16:38:48 +01:00
|
|
|
#!/usr/bin/env bash
|
2022-12-12 19:48:31 -05:00
|
|
|
cargo build {{cargo_args}}
|
2022-12-23 15:14:15 -05:00
|
|
|
|
2023-06-26 17:36:23 -04:00
|
|
|
# Compiles with debug profile
|
|
|
|
|
build-debug *args:
|
|
|
|
|
cargo build {{args}}
|
|
|
|
|
|
|
|
|
|
# Compiles with release profile
|
|
|
|
|
build-release *args: (build-debug '--release' args)
|
|
|
|
|
|
2023-08-08 16:18:12 -04:00
|
|
|
_install_icons name:
|
|
|
|
|
find {{name}}/'data'/'icons' -type f -exec echo {} \; | rev | cut -d'/' -f-3 | rev | xargs -d '\n' -I {} install -Dm0644 {{name}}/'data'/'icons'/{} {{iconsdir}}/{}
|
2022-05-25 17:11:42 -04:00
|
|
|
|
2023-02-16 14:45:13 -08:00
|
|
|
_install_desktop path:
|
|
|
|
|
install -Dm0644 {{path}} {{sharedir}}/applications/{{file_name(path)}}
|
2022-06-10 15:29:45 -07:00
|
|
|
|
2023-02-16 14:45:13 -08:00
|
|
|
_install_bin name:
|
2024-02-06 14:10:27 +01:00
|
|
|
install -Dm0755 {{targetdir}}/{{target}}/{{name}} {{bindir}}/{{name}}
|
2022-06-03 19:36:05 -07:00
|
|
|
|
2023-08-08 16:18:12 -04:00
|
|
|
_install id name: (_install_icons name) (_install_desktop name + '/data/' + id + '.desktop') (_install_bin name)
|
2022-06-10 16:20:46 -07:00
|
|
|
|
2023-02-16 14:45:13 -08:00
|
|
|
_install_app_list: (_install 'com.system76.CosmicAppList' 'cosmic-app-list')
|
|
|
|
|
_install_audio: (_install 'com.system76.CosmicAppletAudio' 'cosmic-applet-audio')
|
|
|
|
|
_install_battery: (_install 'com.system76.CosmicAppletBattery' 'cosmic-applet-battery')
|
|
|
|
|
_install_bluetooth: (_install 'com.system76.CosmicAppletBluetooth' 'cosmic-applet-bluetooth')
|
2024-03-04 13:08:52 -05:00
|
|
|
_install_minimize: (_install 'com.system76.CosmicAppletMinimize' 'cosmic-applet-minimize')
|
2023-02-16 14:45:13 -08:00
|
|
|
_install_network: (_install 'com.system76.CosmicAppletNetwork' 'cosmic-applet-network')
|
|
|
|
|
_install_notifications: (_install 'com.system76.CosmicAppletNotifications' 'cosmic-applet-notifications')
|
|
|
|
|
_install_power: (_install 'com.system76.CosmicAppletPower' 'cosmic-applet-power')
|
|
|
|
|
_install_workspace: (_install 'com.system76.CosmicAppletWorkspaces' 'cosmic-applet-workspaces')
|
|
|
|
|
_install_time: (_install 'com.system76.CosmicAppletTime' 'cosmic-applet-time')
|
2023-09-17 02:30:40 -07:00
|
|
|
_install_tiling: (_install 'com.system76.CosmicAppletTiling' 'cosmic-applet-tiling')
|
2023-01-03 14:36:56 -08:00
|
|
|
_install_status_area: (_install 'com.system76.CosmicAppletStatusArea' 'cosmic-applet-status-area')
|
2022-06-06 11:52:45 -04:00
|
|
|
|
2023-02-17 20:05:42 -08:00
|
|
|
# TODO: Turn this into one configurable applet?
|
|
|
|
|
_install_panel_button: (_install_bin 'cosmic-panel-button')
|
2023-08-08 16:18:12 -04:00
|
|
|
_install_button id name: (_install_icons name) (_install_desktop name + '/data/' + id + '.desktop')
|
2023-02-17 20:05:42 -08:00
|
|
|
_install_app_button: (_install_button 'com.system76.CosmicPanelAppButton' 'cosmic-panel-app-button')
|
|
|
|
|
_install_workspaces_button: (_install_button 'com.system76.CosmicPanelWorkspacesButton' 'cosmic-panel-workspaces-button')
|
2023-02-09 20:09:31 -05:00
|
|
|
|
2023-02-16 14:45:13 -08:00
|
|
|
# Installs files into the system
|
2024-03-04 13:08:52 -05:00
|
|
|
install: _install_app_list _install_audio _install_battery _install_bluetooth _install_minimize _install_network _install_notifications _install_power _install_workspace _install_time _install_tiling _install_panel_button _install_app_button _install_workspaces_button _install_status_area
|
2023-02-09 20:09:31 -05:00
|
|
|
|
2022-05-25 17:11:42 -04:00
|
|
|
# Extracts vendored dependencies if vendor=1
|
|
|
|
|
_extract_vendor:
|
|
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
if test {{vendor}} = 1; then
|
|
|
|
|
rm -rf vendor; tar pxf vendor.tar
|
|
|
|
|
fi
|