Files
haikuports/media-gfx/leocad/leocad-21.06.recipe
2022-04-25 20:16:48 +10:00

98 lines
2.9 KiB
Bash

SUMMARY="A CAD program for creating virtual LEGO models"
DESCRIPTION="LeoCAD has an intuitive interface that is designed to allow new users to start \
creating new models without having to spend too much time learning the application.
At the same time, it has a rich feature set that enables experienced users to \
build models by using techniques that are more advanced.
LeoCAD is fully compatible with the LDraw Standard and related tools, and it reads \
and writes LDR and MPD files so that you can share and download models from the Internet.
It also uses the LDraw parts library, which has over 10,000 different parts \
and continues to receive updates."
HOMEPAGE="https://www.leocad.org/"
COPYRIGHT="LeoCAD Team"
LICENSE="GNU GPL v2"
REVISION="3"
SOURCE_URI="https://github.com/leozide/leocad/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="bd28c47f920fa1bc458b6e5f476b93ccc1aa40e30158a3dd2397368cc3d79099"
libVersion="20.03"
SOURCE_URI_2="https://github.com/leozide/leocad/releases/download/v$portVersion/Library-$libVersion.zip"
CHECKSUM_SHA256_2="88d6d28b3a494a15ae63e984c1e732e28362fabc2e145ffab828fed2eb5e3632"
PATCHES="leocad-$portVersion.patchset"
ADDITIONAL_FILES="
leocad.rdef.in
icons.zip
"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
leocad$secondaryArchSuffix = $portVersion
app:LeoCAD = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5OpenGL$secondaryArchSuffix
lib:libQt5Svg$secondaryArchSuffix
lib:libQt5Widgets$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libGL$secondaryArchSuffix
devel:libQt5Core$secondaryArchSuffix
devel:libQt5Gui$secondaryArchSuffix
devel:libQt5OpenGL$secondaryArchSuffix
devel:libQt5Svg$secondaryArchSuffix
devel:libQt5Widgets$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:find
cmd:g++$secondaryArchSuffix
cmd:lrelease$secondaryArchSuffix >= 5
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:qmake$secondaryArchSuffix >= 5
cmd:which
"
PATCH()
{
unzip -o $sourceDir/../../additional-files/icons.zip -d $sourceDir/resources
}
BUILD()
{
export DISABLE_ASLR=1
qmake DISABLE_UPDATE_CHECK=1
make $jobArgs
}
INSTALL()
{
mkdir -p $appsDir/LeoCAD
cp -f build/release/leocad $appsDir/LeoCAD/LeoCAD
cp -f $sourceDir2/library.bin $appsDir/LeoCAD
local APP_SIGNATURE="application/x-vnd.leocad"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/leocad.rdef.in > leocad.rdef
addResourcesToBinaries leocad.rdef $appsDir/LeoCAD/LeoCAD
addAppDeskbarSymlink $appsDir/LeoCAD/LeoCAD
}