Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-welcome
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-welcome
Commits
7d8f3e46
Commit
7d8f3e46
authored
Dec 31, 2021
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build-aux: replace the bash script with a python one
parent
5c087952
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
24 deletions
+55
-24
cargo.py
build-aux/cargo.py
+52
-0
cargo.sh
build-aux/cargo.sh
+0
-21
meson.build
meson.build
+1
-1
meson.build
src/meson.build
+2
-2
No files found.
build-aux/cargo.py
0 → 100644
View file @
7d8f3e46
#!/usr/bin/env python3
from
os
import
environ
,
path
from
subprocess
import
run
from
argparse
import
ArgumentParser
from
shutil
import
copy
parser
=
ArgumentParser
()
parser
.
add_argument
(
"build_root"
)
parser
.
add_argument
(
"source_root"
)
parser
.
add_argument
(
"output"
)
parser
.
add_argument
(
"profile"
)
parser
.
add_argument
(
"project_name"
)
parser
.
add_argument
(
"features"
)
args
=
parser
.
parse_args
()
environ
[
"CARGO_TARGET_DIR"
]
=
path
.
join
(
args
.
build_root
,
"target"
)
environ
[
"CARGO_HOME"
]
=
path
.
join
(
args
.
build_root
,
"cargo-home"
)
cargo_toml_path
=
path
.
join
(
args
.
source_root
,
"Cargo.toml"
)
if
args
.
profile
==
"Devel"
:
print
(
"DEBUG MODE"
)
run
(
[
"cargo"
,
"build"
,
"--manifest-path"
,
cargo_toml_path
,
"--features"
,
args
.
features
,
],
check
=
True
,
)
build_dir
=
path
.
join
(
environ
[
"CARGO_TARGET_DIR"
],
"debug"
,
args
.
project_name
)
copy
(
build_dir
,
args
.
output
)
else
:
print
(
"RELEASE MODE"
)
run
(
[
"cargo"
,
"build"
,
"--manifest-path"
,
cargo_toml_path
,
"--release"
,
"--features"
,
args
.
features
,
],
check
=
True
,
)
build_dir
=
path
.
join
(
environ
[
"CARGO_TARGET_DIR"
],
"release"
,
args
.
project_name
)
copy
(
build_dir
,
args
.
output
)
build-aux/cargo.sh
deleted
100644 → 0
View file @
5c087952
#!/bin/sh
export
MESON_BUILD_ROOT
=
"
$1
"
export
MESON_SOURCE_ROOT
=
"
$2
"
export
CARGO_TARGET_DIR
=
"
$MESON_BUILD_ROOT
"
/target
export
CARGO_HOME
=
"
$MESON_BUILD_ROOT
"
/cargo-home
FEATURES
=
"
$6
"
if
[
$4
=
"Devel"
]
then
echo
"DEBUG MODE"
cargo build
--manifest-path
\
"
$MESON_SOURCE_ROOT
"
/Cargo.toml
$FEATURES
&&
\
cp
"
$CARGO_TARGET_DIR
"
/debug/
$5
$3
else
echo
"RELEASE MODE"
cargo build
--manifest-path
\
"
$MESON_SOURCE_ROOT
"
/Cargo.toml
$FEATURES
--release
&&
\
cp
"
$CARGO_TARGET_DIR
"
/release/
$5
$3
fi
meson.build
View file @
7d8f3e46
...
...
@@ -24,7 +24,7 @@ glib_compile_resources = find_program('glib-compile-resources', required: true)
desktop_file_validate = find_program('desktop-file-validate', required: false)
appstream_util = find_program('appstream-util', required: false)
cargo = find_program('cargo', required: false)
cargo_script = find_program('build-aux/cargo.
sh
')
cargo_script = find_program('build-aux/cargo.
py
')
version = meson.project_version()
...
...
src/meson.build
View file @
7d8f3e46
...
...
@@ -53,6 +53,7 @@ features = ''
if get_option('video_path') != ''
features = '--features video'
endif
custom_target(
'cargo-build',
build_by_default: true,
...
...
@@ -69,7 +70,6 @@ custom_target(
'@OUTPUT@',
profile,
meson.project_name(),
features
features
,
]
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment