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

Generic recipes: rework #161

Merged
merged 10 commits into from
Oct 26, 2024
26 changes: 26 additions & 0 deletions generic/additional-files/projectx.rdef.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

resource app_flags B_SINGLE_LAUNCH | B_ARGV_ONLY;

resource app_version {
major = @MAJOR@,
middle = @MIDDLE@,
minor = @MINOR@,

variety = B_APPV_FINAL,
internal = 0,

short_info = "Project X",
long_info = "@LONG_INFO@"
};

resource app_signature "@APP_SIGNATURE@";

resource file_types message {
"types" = "application/x-asf",
"types" = "audio"
};

resource vector_icon {
$"6E636966020300AAFF05010102044030C34530BC3A30304030BC3A30C3454050"
$"BC3A50C34550504050C34550BC3A020A0101001001158400040A00010000"
};
23 changes: 16 additions & 7 deletions generic/generic_cmd-1.2.3.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ DESCRIPTION="Long ProjectX description.
Spanning several paragraphs, maybe
- containing
- bullet points etc.
You can also have really long lines that do not fit in 80 characters and use \
a backslash to wrap the line."
You can also have really long lines that do not fit in 100 characters and use a backslash to \
wrap the line."
HOMEPAGE="https://homepage/of/projectx.org"
COPYRIGHT="2014 Developer name
2016 Another developer's name"
Expand All @@ -15,9 +15,12 @@ SOURCE_URI="https://github.com/HaikuArchives/ProjectX/archive/projectx-$portVers
CHECKSUM_SHA256="000000000000000000000000000000000"
SOURCE_DIR="$portVersionedName"
PATCHES="projectx-$portVersion.patchset"
ADDITIONAL_FILES="projectx.rdef"

ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
ARCHITECTURES="?all"

GLOBAL_WRITABLE_FILES="
settings/projectx.conf keep-old
"

PROVIDES="
projectx = $portVersion
extrowerk marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -31,19 +34,25 @@ BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
cmd:make
cmd:gcc
cmd:make
"

defineDebugInfoPackage projectx \
extrowerk marked this conversation as resolved.
Show resolved Hide resolved
$binDir/projectx

BUILD()
{
runConfigure ./configure
make $jobArgs
}

INSTALL()
{
mkdir -p $binDir
cp -a objects/projectx $binDir
make install
# or
install -d $binDir
install -t $binDir objects/projectx
}

TEST()
Expand Down
72 changes: 72 additions & 0 deletions generic/generic_cmd_secondary_arch-1.2.3.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
SUMMARY="Short description of ProjectX"
DESCRIPTION="Long ProjectX description.
Spanning several paragraphs, maybe
- containing
- bullet points etc.
You can also have really long lines that do not fit in 100 characters and use a backslash to \
wrap the line."
HOMEPAGE="https://homepage/of/projectx.org"
COPYRIGHT="2014 Developer name
2016 Another developer's name"
LICENSE="MIT
GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/HaikuArchives/ProjectX/archive/projectx-$portVersion.tar.gz"
CHECKSUM_SHA256="000000000000000000000000000000000"
SOURCE_DIR="$portVersionedName"
PATCHES="projectx-$portVersion.patchset"

ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"

# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi

GLOBAL_WRITABLE_FILES="
settings/projectx.conf keep-old
"

PROVIDES="
projectx$secondaryArchSuffix = $portVersion
cmd:projectx$commandSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"

BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:make
"

defineDebugInfoPackage projectx \
$commandBinDir/projectx

BUILD()
{
runConfigure --omit-dirs "binDir sbinDir" ./configure \
--bindir=$commandBinDir \
--sbindir=$commandBinDir
make $jobArgs
}

INSTALL()
{
make install
# or
install -d $commandBinDir
install -t $commandBinDir objects/projectx
}

TEST()
{
make check
}
13 changes: 3 additions & 10 deletions generic/generic_font-1.2.3.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ DESCRIPTION="Long FontX description.
Spanning several paragraphs, maybe
- containing
- bullet points etc.
You can also have really long lines that do not fit in 80 characters and use \
a backslash to wrap the line."
You can also have really long lines that do not fit in 100 characters and use a backslash to \
wrap the line."
HOMEPAGE="https://homepage/of/fontx.org"
COPYRIGHT="2015 Haikutype"
LICENSE="SIL Open Font License v1.1"
Expand All @@ -24,16 +24,9 @@ REQUIRES=""
BUILD_REQUIRES=""
BUILD_PREREQUIRES=""

BUILD()
{
true
}

INSTALL()
{
FONTDIR=$fontsDir/ttfonts
mkdir -p ${FONTDIR}
cp generic-font1.ttf ${FONTDIR}
cp generic-font2.ttf ${FONTDIR}
cp generic-font-bold.ttf ${FONTDIR}
cp -a *.ttf ${FONTDIR}
Begasus marked this conversation as resolved.
Show resolved Hide resolved
}
49 changes: 38 additions & 11 deletions generic/generic_haiku_app-1.2.3.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ DESCRIPTION="Long ProjectX description.
Spanning several paragraphs, maybe
- containing
- bullet points etc.
You can also have really long lines that do not fit in 80 characters and use \
a backslash to wrap the line."
You can also have really long lines that do not fit in 100 characters and use a backslash to \
wrap the line."
HOMEPAGE="https://homepage/of/projectx.org"
COPYRIGHT="2014 Developer name
2016 Another developer's name"
Expand All @@ -17,7 +17,11 @@ SOURCE_DIR="$portVersionedName"
PATCHES="projectx-$portVersion.patchset"
ADDITIONAL_FILES="projectx.rdef"

ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
ARCHITECTURES="?all"

GLOBAL_WRITABLE_FILES="
settings/projectx.rc keep-old # If there is any
"

PROVIDES="
projectx = $portVersion
Expand All @@ -32,23 +36,46 @@ BUILD_REQUIRES="
"
BUILD_PREREQUIRES="
makefile_engine
cmd:make
cmd:gcc
cmd:make
"

defineDebugInfoPackage projectx \
$appsDir/ProjectX

BUILD()
{
make $jobArgs OBJ_DIR=objects
}

INSTALL()
{
mkdir -p $appsDir
cp -a objects/ProjectX $appsDir
addAppDeskbarSymlink $appsDir/ProjectX
}
install -d $appsDir
install -t $appsDir objects/ProjectX

TEST()
{
make check
# Create the extra attributes
local APP_SIGNATURE="application/x-vnd.ProjectX"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
local MINOR="0"
local LONG_INFO="$SUMMARY"

# Add them to the rdef file
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/projectx.rdef.in > projectx.rdef

# Add the resources to the application
addResourcesToBinaries projectx.rdef $appsDir/ProjectX

# Set the acceptable mimetypes
mimeset -f $appsDir/ProjectX

# Create a Deskbar icon
addAppDeskbarSymlink $appsDir/ProjectX
}
82 changes: 82 additions & 0 deletions generic/generic_haiku_app_secondary_arch-1.2.3.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
SUMMARY="Short description of ProjectX"
DESCRIPTION="Long ProjectX description.
Spanning several paragraphs, maybe
- containing
- bullet points etc.
You can also have really long lines that do not fit in 100 characters and use a backslash to \
wrap the line."
HOMEPAGE="https://homepage/of/projectx.org"
COPYRIGHT="2014 Developer name
2016 Another developer's name"
LICENSE="MIT
GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/HaikuArchives/ProjectX/archive/projectx-$portVersion.tar.gz"
CHECKSUM_SHA256="000000000000000000000000000000000"
SOURCE_DIR="$portVersionedName"
PATCHES="projectx-$portVersion.patchset"
ADDITIONAL_FILES="projectx.rdef"

ARCHITECTURES="?all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"

GLOBAL_WRITABLE_FILES="
settings/projectx.rc keep-old
"

PROVIDES="
projectx$secondaryArchSuffix = $portVersion
app:projectx = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"

BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
makefile_engine
cmd:gcc$secondaryArchSuffix
cmd:make
"

defineDebugInfoPackage projectx$secondaryArchSuffix \
$appsDir/ProjectX

BUILD()
{
make $jobArgs OBJ_DIR=objects
}

INSTALL()
{
install -d $appsDir
install -t $appsDir objects/ProjectX

# Create the extra attributes
local APP_SIGNATURE="application/x-vnd.ProjectX"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
local MINOR="0"
local LONG_INFO="$SUMMARY"

# Add them to the rdef file
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/projectx.rdef.in > projectx.rdef

# Add the resources to the application
addResourcesToBinaries projectx.rdef $appsDir/ProjectX

# Set the acceptable mimetypes
mimeset -f $appsDir/ProjectX

# Create a Deskbar icon
addAppDeskbarSymlink $appsDir/ProjectX
}
Loading
Loading