Now building with meson.

This commit is contained in:
Jordan Petridis 2017-11-11 13:29:11 +02:00
parent bc6da31178
commit 1199c9aa81
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
5 changed files with 6 additions and 62 deletions

2
.gitignore vendored
View File

@ -4,3 +4,5 @@ Cargo.lock
.vscode
*.ui~
*.gresource
_build
vendor/

View File

@ -1,16 +0,0 @@
# Generated by configure; do not edit
all:
/usr/bin/ninja -C /home/alatiera/projects/rust/hammond/_build
install:
DESTDIR="$(DESTDIR)" /usr/bin/ninja -C /home/alatiera/projects/rust/hammond/_build install
uninstall:
/usr/bin/ninja -C /home/alatiera/projects/rust/hammond/_build uninstall
release:
/usr/bin/ninja -C /home/alatiera/projects/rust/hammond/_build release
check:
/usr/bin/mesontest -C /home/alatiera/projects/rust/hammond/_build

3
configure vendored
View File

@ -141,9 +141,6 @@ install:
uninstall:
${NINJA} ${NINJA_OPT} uninstall
release:
${NINJA} ${NINJA_OPT} release
check:
${MESONTEST} ${NINJA_OPT}
END

View File

@ -11,22 +11,19 @@ hammond_minor_version = version_array[1].to_int()
hammond_version_micro = version_array[2].to_int()
hammond_prefix = get_option('prefix')
hammond_datadir = join_paths(hammond_prefix, get_option('datadir'), 'hammond')
hammond_bindir = join_paths(hammond_prefix, get_option('bindir'))
install_data('assets/org.gnome.Hammond.desktop', install_dir : get_option('datadir') + '/applications')
cargo = find_program('cargo', required: false)
gresource = find_program('glib-compile-resources', required: false)
cargo_vendor = find_program('cargo-vendor', required: false)
cargo_script = find_program('scripts/cargo.sh')
cargo_release = custom_target('cargo-build',
build_by_default: true,
build_always: true,
output: ['hammond'],
install: true,
install_dir: hammond_bindir,
command: ['HAMMOND_RES=' + hammond_datadir, cargo_script, '@CURRENT_SOURCE_DIR@', '@OUTPUT@'])
command: [cargo_script, '@CURRENT_SOURCE_DIR@', '@OUTPUT@'])
cargo = find_program('cargo-vendor', required: false)
run_target('release', command: ['scripts/release.sh',
meson.project_name() + '-' + hammond_version
])

View File

@ -1,36 +0,0 @@
#!/bin/sh
VERSION=$1
DEST=${MESON_BUILD_ROOT}
DIST=$DEST/dist/$VERSION
cd "${MESON_SOURCE_ROOT}"
mkdir -p $DIST
# copying files
cp -rf src $DIST
cp build.rs $DIST
cp Cargo.toml $DIST
cp configure $DIST
cp meson.build $DIST
cp LICENSE.txt $DIST
cp README.md $DIST
cp -rf res $DIST
cp -rf scripts $DIST
# cargo vendor
cargo vendor
mkdir $DIST/.cargo
cat <<EOF > $DIST/.cargo/config
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
EOF
cp -rf vendor $DIST/
# packaging
cd $DEST/dist
tar -czvf $VERSION.tar.gz $VERSION