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
Showing
2 changed files
with
113 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- .cargo/config | ||
+++ .cargo/config | ||
@@ -1,6 +1,3 @@ | ||
-[source.crates-io] | ||
-replace-with = "vendored-sources" | ||
- | ||
[source."https://gitlab.gnome.org/haecker-felix/libhandy-rs.git"] | ||
git = "https://gitlab.gnome.org/haecker-felix/libhandy-rs.git" | ||
branch = "update_cargo_version" | ||
--- build-aux/cargo.sh | ||
+++ build-aux/cargo.sh | ||
@@ -5,9 +5,15 @@ export MESON_SOURCE_ROOT="$2" | ||
export APP_OUTPUT="$3" | ||
export APP_LOCALEDIR="$4" | ||
export APP_PROFILE="$5" | ||
+export XBPS_RUST_TARGET="$6" | ||
|
||
export CARGO_TARGET_DIR="$MESON_BUILD_ROOT"/target | ||
-export CARGO_HOME="$CARGO_TARGET_DIR"/cargo-home | ||
+ | ||
+export CARGO_OUTPUT_DIR="$CARGO_TARGET_DIR" | ||
+if ! test -z "$XBPS_RUST_TARGET" | ||
+then | ||
+ export CARGO_OUTPUT_DIR="${CARGO_OUTPUT_DIR}/${XBPS_RUST_TARGET}" | ||
+fi | ||
|
||
echo "** RUST VERSION **" | ||
rustc --version | ||
@@ -17,10 +23,10 @@ then | ||
echo "** DEBUG MODE **" | ||
cargo build --manifest-path \ | ||
"$MESON_SOURCE_ROOT"/Cargo.toml --message-format=short && \ | ||
- cp "$CARGO_TARGET_DIR"/debug/shortwave $APP_OUTPUT | ||
+ cp "$CARGO_OUTPUT_DIR"/debug/shortwave $APP_OUTPUT | ||
else | ||
echo "** RELEASE MODE **" | ||
cargo build --manifest-path \ | ||
"$MESON_SOURCE_ROOT"/Cargo.toml --message-format=short --release && \ | ||
- cp "$CARGO_TARGET_DIR"/release/shortwave $APP_OUTPUT | ||
+ cp "$CARGO_OUTPUT_DIR"/release/shortwave $APP_OUTPUT | ||
fi | ||
--- meson.build | ||
+++ meson.build | ||
@@ -26,10 +26,11 @@ dependency('gstreamer-bad-audio-1.0', version: '>= 1.16') | ||
name = 'Shortwave' | ||
app_id = 'de.haeckerfelix.Shortwave' | ||
profile = get_option('profile') | ||
-vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip() | ||
+vcs_tag = get_option('tag') | ||
localedir = join_paths(get_option('prefix'), get_option('localedir')) | ||
datadir = get_option('datadir') | ||
pkgdatadir = join_paths(get_option('prefix'), datadir, meson.project_name()) | ||
+xbps_rust_target = get_option('xbps_rust_target') | ||
|
||
# Change app id for development builds | ||
if profile == 'development' | ||
--- meson_options.txt | ||
+++ meson_options.txt | ||
@@ -8,3 +8,13 @@ option ( | ||
], | ||
value: 'default' | ||
) | ||
+option ( | ||
+ 'tag', | ||
+ type: 'string', | ||
+ value: 'none' | ||
+) | ||
+option ( | ||
+ 'xbps_rust_target', | ||
+ type: 'string', | ||
+ value: '' | ||
+) | ||
--- src/meson.build | ||
+++ src/meson.build | ||
@@ -106,6 +106,7 @@ cargo_release = custom_target( | ||
meson.source_root(), | ||
'@OUTPUT@', | ||
localedir, | ||
- profile | ||
+ profile, | ||
+ xbps_rust_target | ||
] | ||
) |
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,30 @@ | ||
# Template file for 'shortwave' | ||
pkgname=shortwave | ||
version=1.1.1 | ||
revision=1 | ||
_short_rev="f67468a" | ||
build_style=meson | ||
build_helper=rust | ||
configure_args=" -Dtag=${_short_rev}" | ||
hostmakedepends="cargo gettext glib-devel pkg-config rust sqlite-devel" | ||
makedepends="gstreamer1-devel gst-plugins-bad1-devel libhandy-devel libressl-devel rust-std sqlite-devel" | ||
depends="gst-plugins-good1" | ||
short_desc="GTK internet radio player, written in Rust" | ||
maintainer="Philipp David <pd@3b.pm>" | ||
license="GPL-3.0-or-later" | ||
homepage="https://gitlab.gnome.org/World/Shortwave" | ||
distfiles="https://gitlab.gnome.org/World/Shortwave/uploads/df12909bb42afbff933e45da0f220eb4/shortwave-${version}.tar.xz" | ||
checksum=dfac0dbc5f0026ec94a83bf3af3f44a02a234c93eedb5943963290536f22be47 | ||
|
||
case $XBPS_TARGET_MACHINE in | ||
x86_64-musl) broken="compiling diesel_migrations fails with: /usr/lib/libc.so: invalid ELF header" ;; | ||
esac | ||
|
||
if ! [ -z "$CROSS_BUILD" ]; then | ||
configure_args+=" -Dxbps_rust_target=${XBPS_CROSS_RUST_TARGET}" | ||
fi | ||
|
||
pre_build() { | ||
cargo update --package openssl-sys --precise 0.9.60 | ||
cargo update --package openssl --precise 0.10.32 | ||
} |