lasermagic, enable recipe

This commit is contained in:
Luc Schrijvers
2025-12-01 08:06:34 +01:00
committed by Adrien Destugues
parent 8f498ec412
commit 4ec6c3fbd9
3 changed files with 112 additions and 53 deletions

View File

@@ -0,0 +1,90 @@
SUMMARY="Open-source tool designed for laser cutting and engraving"
DESCRIPTION="LaserMagic is a powerful, open-source tool designed for laser cutting and engraving, \
written entirely in Rust. Compatible with both Windows and Linux operating systems, \
LaserMagic provides a seamless experience for users seeking to generate GRBL files \
interpretable by laser machines.
Features:
- GRBL File Generation: The tool facilitates the creation of GRBL files, ensuring compatibility \
with a wide range of laser machines.
- SVG File Support: One of LaserMagic's standout features is its ability to save all project \
data within SVG files. This not only enhances portability but also ensures that designs are \
easily shareable and editable across different platforms and software.
- Cross-Platform Compatibility: Whether you're running Windows or Linux, LaserCut delivers \
consistent performance and reliability.
- User-Friendly Interface: With a clean and intuitive interface, LaserCut caters to users of all \
skill levels, making the laser cutting and engraving process accessible to everyone."
HOMEPAGE="https://lasermagic.ci-yow.com/"
COPYRIGHT="2025 Benoît Forgette alias MadSquirrel"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://gitlab.com/MadSquirrels/lasermagic/laser_tool/-/archive/v$portVersion/laser_tool-v$portVersion.tar.bz2"
SOURCE_DIR="lasermagic-v$portVersion-056c2a5cfaab55220a547b3e69f950a3d006d41a"
CHECKSUM_SHA256="fab22cd5c4d7a129bc83377e5cea834eae73549db685546b5c62345f7b1c5170"
PATCHES="lasermagic-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
lasermagic$secondaryArchSuffix = $portVersion
cmd:laser_magic_cli = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
# tinycss2_python310 # Incscape dependency?
# appdirs_python310 # Inkscape dependency? use pip3 install for this
cmd:python3.10
lib:libcrypto$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libssl$secondaryArchSuffix >= 3
"
BUILD_PREREQUIRES="
cmd:cargo$secondaryArchSuffix
cmd:cc$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cargo fetch --locked
cargo build --release --verbose
}
INSTALL()
{
# Install binary
install -Dm755 "target/release/laser-magic-cli" "$prefix/bin/laser-magic-cli"
# Install documentation
install -Dm644 README.md "$documentationDir/$portBaseName/README.md"
install -Dm644 CHANGELOG.md "$documentationDir/$portBaseName/CHANGELOG.md"
# Install Inkscape plugins (following the Makefile logic)
# Create directories
install -d "$dataDir/inkscape/extensions/lasermagic"
install -d "$dataDir/inkscape/palettes"
# Update version in the inx files
VERSION=$(grep -m 1 '^version' lib/Cargo.toml | cut -d '=' -f2 | sed -E 's/.*"(.*).*"/\1/g')
for inx in plugins/src/*.inx; do
sed "s/#VERSION#/$VERSION/g" "$inx" > "${inx}.tmp"
install -Dm644 "${inx}.tmp" "$dataDir/inkscape/extensions/lasermagic/$(basename $inx)"
rm "${inx}.tmp"
done
# Copy Python scripts
for py in plugins/src/*.py; do
install -Dm755 "$py" "$dataDir/inkscape/extensions/lasermagic/$(basename $py)"
done
# Copy shared libraries
install -Dm644 target/release/libliblasermagic.so "$dataDir/inkscape/extensions/lasermagic/"
# Copy palette
install -Dm644 plugins/src/*.gpl "$dataDir/inkscape/palettes/"
}

View File

@@ -1,53 +0,0 @@
SUMMARY="Open-source tool designed for laser cutting and engraving"
DESCRIPTION="LaserMagic is a powerful, open-source tool designed for laser cutting and engraving, \
written entirely in Rust. Compatible with both Windows and Linux operating systems, \
LaserMagic provides a seamless experience for users seeking to generate GRBL files \
interpretable by laser machines.
Features:
- GRBL File Generation: The tool facilitates the creation of GRBL files, ensuring compatibility \
with a wide range of laser machines.
- SVG File Support: One of LaserMagic's standout features is its ability to save all project \
data within SVG files. This not only enhances portability but also ensures that designs are \
easily shareable and editable across different platforms and software.
- Cross-Platform Compatibility: Whether you're running Windows or Linux, LaserCut delivers \
consistent performance and reliability.
- User-Friendly Interface: With a clean and intuitive interface, LaserCut caters to users of all \
skill levels, making the laser cutting and engraving process accessible to everyone."
HOMEPAGE="https://lasermagic.ci-yow.com/"
COPYRIGHT="2025 Benoît Forgette alias MadSquirrel"
LICENSE="AGPL-3.0"
SOURCE_URI="https://gitlab.com/MadSquirrels/lasermagic/laser_tool/-/archive/v0.1.36/laser_tool-v0.1.36.tar.bz2"
SOURCE_DIR="laser_tool-$portVersion"
CHECKSUM_SHA256="790a619c3c2b83442c7e25e72878a99e721d0997c1d03d63781b907be0402289"
REVISION="1"
ARCHITECTURES="!all !x86_gcc2"
SECONDARY_ARCHITECTURES="!x86"
PROVIDES="
lasermagic$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libssl$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cargo$secondaryArchSuffix
cmd:cc$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
cargo build --release --verbose
}
INSTALL()
{
cargo install
}

View File

@@ -0,0 +1,22 @@
From a485b3ce4229e78e6953522bdb3092511658cf56 Mon Sep 17 00:00:00 2001
From: Luc Schrijvers <begasus@gmail.com>
Date: Mon, 1 Dec 2025 08:25:03 +0100
Subject: Fix data path for palettes/Laser.gpl
diff --git a/lib/src/lib.rs b/lib/src/lib.rs
index 1b58c4d..4bd0091 100644
--- a/lib/src/lib.rs
+++ b/lib/src/lib.rs
@@ -244,6 +244,8 @@ pub fn get_share_path_inkscape() -> String {
String::from("C:\\Program Files\\Inkscape\\share\\inkscape\\")
} else if cfg!(target_os = "linux") {
String::from("/usr/share/inkscape/")
+ } else if cfg!(target_os = "haiku") {
+ String::from("/boot/system/data/inkscape/")
} else if cfg!(target_os = "macos") {
format!("/Applications/Inkscape.app/Contents/Resources/share/inkscape/")
} else {
--
2.51.0