Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add source built serial monitor rust #5

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0238245
Add source-built conda-froge compliant serial-monitor-rust
MementoRC Dec 7, 2024
975d489
(dev) OSX clan 18 conflicts with apple-sys
MementoRC Dec 7, 2024
d5bdc9c
(ref) updates from passing conda-staged recipes
MementoRC Dec 7, 2024
6d64f5f
(ref) variant_config.yaml
MementoRC Dec 8, 2024
0c13b2c
use global variant config
wolfv Dec 8, 2024
cc4f3ef
add missing file
wolfv Dec 8, 2024
1f93ebc
update patch
wolfv Dec 8, 2024
185b6a7
..
wolfv Dec 8, 2024
15aab1f
..
wolfv Dec 8, 2024
82daf68
(ref) v0.3.1. removed extra rust-src-pkgs. unsolved osx SDK issues
MementoRC Dec 8, 2024
0b4e679
(ref) more v0.3.1 cleanup
MementoRC Dec 8, 2024
d0cf47c
(ref) v0.3.2
MementoRC Dec 11, 2024
e0e0ed7
(ref) v0.3.2 win: CARGO_HOME?
MementoRC Dec 11, 2024
cf9fa3e
(ref) osx: MACOS_DEPLOY + time
MementoRC Dec 11, 2024
be1d56a
(ref) osx: one change at a time
MementoRC Dec 11, 2024
bf4daae
(ref) osx: typo in variant-config.yaml
MementoRC Dec 11, 2024
49025ce
(ref) osx: typo in variant_config.yaml?
MementoRC Dec 11, 2024
d1f483d
(ref) osx: try conda_build_config. add libclang
MementoRC Dec 11, 2024
3216e98
(ref) osx: try conda_build_config. add libclang
MementoRC Dec 11, 2024
0ffd895
(ref) osx: libclang osx only
MementoRC Dec 11, 2024
a73c30c
(ref) osx: libclang osx only
MementoRC Dec 11, 2024
455c597
(ref) osx: should it be variants.yaml?
MementoRC Dec 11, 2024
156d954
(ref) osx: variants.yaml
MementoRC Dec 11, 2024
e979956
(ref) osx: variants.yaml
MementoRC Dec 11, 2024
32cad4b
(ref) osx: serail same as keepawake
MementoRC Dec 12, 2024
c3c779f
(ref) osx: serial same as keepawake
MementoRC Dec 12, 2024
c04333f
(ref) osx: variant not working?
MementoRC Dec 12, 2024
afb7c00
(ref) win: add early fails. add recipe tests
MementoRC Dec 12, 2024
af8499c
(ref) win: compiles but can't install? Let's not test a GUI ... lol
MementoRC Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ jobs:

- name: Run code in changed subdirectories
shell: bash
run: |
rattler-build build --recipe-dir ./recipes \
--skip-existing=all --target-platform=${{ matrix.target }} \
-c https://prefix.dev/prefix-package-incubator -c conda-forge
run: pixi run build-all

- name: Upload all packages
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ platforms = ["osx-arm64", "linux-64", "win-64", "osx-64"]
rattler-build = ">=0.31.1,<0.32"

[tasks]
build-all = "rattler-build build --recipe-dir ./recipes --skip-existing=all -c https://prefix.dev/prefix-package-incubator -c conda-forge"
build = "rattler-build build -c https://prefix.dev/prefix-package-incubator -c conda-forge --recipe"
build-all = "rattler-build build -m ./variants.yaml --recipe-dir ./recipes --skip-existing=all -c https://prefix.dev/prefix-package-incubator -c conda-forge"
build = "rattler-build build -m ./variants.yaml -c https://prefix.dev/prefix-package-incubator -c conda-forge --recipe"

[feature.update-versions.dependencies]
python = "3.12.*"
Expand Down
17 changes: 17 additions & 0 deletions recipes/keepawake-rs/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@echo off

set CARGO_HOME=%BUILD_PREFIX%\cargo
mkdir %CARGO_HOME%
icacls %CARGO_HOME% /grant Users:F

cargo build --release --all-targets
if %errorlevel% NEQ 0 exit /b %errorlevel%

cargo test --release --all-targets
if %errorlevel% NEQ 0 exit /b %errorlevel%

cargo install --path . --root "%PREFIX%" --features="bin"
if %errorlevel% NEQ 0 exit /b %errorlevel%

cargo-bundle-licenses --format yaml --output "%RECIPE_DIR%\THIRDPARTY.yml"
if %errorlevel% NEQ 0 exit /b %errorlevel%
22 changes: 22 additions & 0 deletions recipes/keepawake-rs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -euxo pipefail

export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=$CC
export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=$CC

BINDGEN_EXTRA_CLANG_ARGS="-v ${CPPFLAGS} ${CFLAGS}"
if [[ "${target_platform}" == osx-* ]]; then
if [[ "${target_platform}" == osx-arm64 ]]; then
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=aarch64-apple-darwin"
else
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=x86_64-apple-darwin13.4.0"
fi
export LIBCLANG_PATH=${BUILD_PREFIX}/lib
fi

cargo build --release --all-targets
# Skip doc-test which fails to find cc as a linker (odd, since it can build just fine)
cargo test --release --all-targets
CARGO_TARGET_DIR=target cargo install --features="bin" --path . --root "${PREFIX}"
cargo-bundle-licenses --format yaml --output "${RECIPE_DIR}"/THIRDPARTY.yml
6 changes: 6 additions & 0 deletions recipes/keepawake-rs/patches/osx-update-time.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--- a/Cargo.toml.orig 2021-09-23 14:00:00.000000000 +0000
+++ b/Cargo.toml 2021-09-23 14:00:00.000000000 +0000
@@ -42,2 +42,3 @@
sysinfo = { version = "0.30.5", optional = true }
+time = "0.3.35"
thiserror = "1.0.56"
64 changes: 64 additions & 0 deletions recipes/keepawake-rs/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
context:
name: keepawake-rs
version: "0.5.1"
c_compiler_version: 19

package:
name: ${{ name|lower }}
version: ${{ version }}

source:
url: https://github.com/segevfiner/keepawake-rs/archive/refs/tags/v${{ version }}.tar.gz
sha256: 06bfc2ce38a6d06e54fc156bd20afa08ae687b6075d9a4ceb123ec935e8c235a
patches:
- if: osx
then:
- patches/osx-update-time.patch

build:
number: 0

requirements:
build:
- ${{ compiler('c') }}
- ${{ stdlib("c") }}
- ${{ compiler('rust') }}
- cargo-bundle-licenses
- if: osx
then:
- libclang ${{ c_compiler_version }}.*
host:
- setuptools-rust

tests:
- package_contents:
files:
- if: linux or osx
then:
- bin/keepawake
else:
- bin/keepawake.exe
- script:
- if: linux or osx
then:
- keepawake --help
else:
- keepawake.exe --help

about:
homepage: https://github.com/segevfiner/keepawake-rs
summary: 'Keep your computer awake.'
description: |
Keep your computer awake. Like caffeinate,
systemd-inhibit/gnome-session-inhibit, or PowerToys Awake,
but cross-platform and written in Rust.
license: MIT
license_file:
- LICENSE
- THIRDPARTY.yml
documentation: https://crates.io/crates/keepawake
repository: https://github.com/segevfiner/keepawake-rs

extra:
recipe-maintainers:
- MementoRC
18 changes: 18 additions & 0 deletions recipes/keepawake-rs/variants.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
c_stdlib_version:
- if: osx and x86_64
then:
- 10.13
- if: osx and aarch64
then:
- 11.0
MACOSX_DEPLOYEMENT_TARGET:
- if: osx and x86_64
then:
- 10.13
- if: osx and aarch64
then:
- 11.0
c_compiler_version:
- if: osx
then:
- 19
13 changes: 13 additions & 0 deletions recipes/serial-monitor-rust/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@echo off

cargo build --release --all-targets --verbose
if %errorlevel% NEQ 0 exit /b %errorlevel%

cargo test --release --all-targets --verbose
if %errorlevel% NEQ 0 exit /b %errorlevel%

set CARGO_TARGET_DIR=target
cargo install --path . --root "%PREFIX%" --verbose
if %errorlevel% NEQ 0 exit /b %errorlevel%

cargo-bundle-licenses --format yaml --output "%RECIPE_DIR%\THIRDPARTY.yml"
21 changes: 21 additions & 0 deletions recipes/serial-monitor-rust/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -euxo pipefail

export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=$CC
export CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER=$CC

BINDGEN_EXTRA_CLANG_ARGS="-v ${CPPFLAGS} ${CFLAGS}"
if [[ "${target_platform}" == osx-* ]]; then
if [[ "${target_platform}" == osx-arm64 ]]; then
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=aarch64-apple-darwin"
else
BINDGEN_EXTRA_CLANG_ARGS="${BINDGEN_EXTRA_CLANG_ARGS} --target=x86_64-apple-darwin13.4.0"
fi
export LIBCLANG_PATH=${BUILD_PREFIX}/lib
fi

cargo build --release --all-targets
cargo test --release --all-targets
CARGO_TARGET_DIR=target cargo install --path . --root "${PREFIX}"
cargo-bundle-licenses --format yaml --output "${RECIPE_DIR}"/THIRDPARTY.yml
69 changes: 69 additions & 0 deletions recipes/serial-monitor-rust/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
context:
name: serial-monitor-rust
version: "0.3.2"
c_compiler_version: 19

package:
name: ${{ name|lower }}
version: ${{ version }}

source:
url: https://github.com/hacknus/serial-monitor-rust/archive/refs/tags/v${{ version }}.tar.gz
sha256: 7d9e7f19f3dc86f74852dd0129dcb31feb08a3411269d337dba3463a4f479f01

build:
number: 0

requirements:
build:
- ${{ compiler('c') }}
- ${{ stdlib("c") }}
- ${{ compiler('rust') }}
- cargo-bundle-licenses
- pkg-config
- if: osx
then:
- libclang ${{ c_compiler_version }}.*
host:
- keepawake-rs
- setuptools-rust
- if: linux
then:
- libudev

tests:
- package_contents:
files:
- if: linux or osx
then:
- bin/serial-monitor-rust
- if: win
then:
- bin/serial-monitor-rust.exe
- script:
- echo "No tests for GUI applications"
# Better not test the GUI as it fails on linux (no DISPLAY) and hangs on osx
#- if: linux or osx
# then:
# - serial-monitor-rust --help
# else:
# - serial-monitor-rust.exe --help


about:
homepage: https://github.com/hacknus/serial-monitor-rust
summary: 'A cross-plattform serial monitor/plotter written entirely in rust.'
description: |
A cross-platform serial monitor and plotter written
entirely in rust, the GUI is written using egui.
Inspired by the serial monitor/plotter from the Arduino IDE,
but both plotting and reading the traffic can be done simultaneously.
license: GPL-3.0-only
license_file:
- LICENSE
- THIRDPARTY.yml
repository: https://github.com/hacknus/serial-monitor-rust

extra:
recipe-maintainers:
- MementoRC
18 changes: 18 additions & 0 deletions recipes/serial-monitor-rust/variants.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
c_stdlib_version:
- if: osx and x86_64
then:
- 10.13
- if: osx and aarch64
then:
- 11.0
MACOSX_DEPLOYEMENT_TARGET:
- if: osx and x86_64
then:
- 10.13
- if: osx and aarch64
then:
- 11.0
c_compiler_version:
- if: osx
then:
- 19
21 changes: 21 additions & 0 deletions variants.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
c_stdlib:
- if: linux
then:
- sysroot
- if: osx
then:
- macosx_deployment_target
- if: win
then:
- vs

c_compiler:
- if: linux
then:
- gcc
- if: osx
then:
- clang
- if: win
then:
- vs