Jagged Alliance 2: new port (#1400)

This commit is contained in:
miqlas
2017-06-17 17:37:00 +02:00
committed by waddlesplash
parent 60298f8ade
commit af0b0d73ec
5 changed files with 330 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
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 = "Jagged Alliance 2 Stracciatella",
long_info = "A port of Jagged Alliance 2 to SDL"
};
resource app_signature "application/x-vnd.ja2-stracciatella";
resource vector_icon {
$"6E63696606039D1E1C03E6940005FF050003E1E0DE0358312528060CBEEFFB24"
$"2430202820BD3D205020482058205C246030602860BE48605060C13C60585C5C"
$"506058605060306030602860245C2050205820C01B203020302028061DAA4A4A"
$"844444BA02C540BF19C41F4B45C53FC1C0C6A744C71BC157C67BC0FCC718C0BE"
$"C71AC0BDC67AC05EC718C01FC65BBFB4BFB1C718BF62C67ABF04C718BEA9C689"
$"BE59C718BDEAC6ABBDE8C541BB7FC41EBB7FC41EBB67C37FBA7ABF2DC540BF19"
$"0204B0FCB6F7B0FCB6F7B1E4B5C1AF6CB4DBB056B4BAAEBFB4F413B5FEAE3CB5"
$"45AE2FB714B0FCB6F7B039B7FBB0FCB6F706043BB004B52FB004B52FB0B3B4AF"
$"AFA4B298AF4EB52FAE76B4CCAF4EB52FB0040204AF3CB0D0AF3CB0D0AFF8B1CA"
$"B201AFAEB22FB0F4B1E5AEE9B04DAEB41A14AF3FAED7AF3CB0D0AE97AFF3AF3C"
$"B0D00623FAAAEAA66C7C74A626C39CC4E2C27CC7FEC0A9C93EC0A9C93EC01BC9"
$"3EBEFEC93EBF8CC93EBEFEC93EBCD7C7F4BC28C4E9BDA5C58EBDA8C62ABD5EC5"
$"BBBD93C6ADBE59C75EBE59C7C5BE59C7C5BE61C7C5BEA8C7C6C764BF02C763BF"
$"05C7FCBF61BF61C766BF61C766BF60C766BFB4C765C7FDC01CC01CC764C01CC7"
$"64C044C764C05EC765C036C765C05EC765C7FBC0BEC765C100C764C0F8C764C1"
$"00C764C7C444C7C5C761C217C6ADC25DC5BBC1FDC62AC591C39CC4E2020BB917"
$"BDA9B917BDA9B93FBD6BB9BABD18B979BD4BBA17B9B2BF35B72EBC1CB78DC0FC"
$"B6D2C251B888C16AB812C307B8E6C4EDB9CFC478B954C5BDBAAAC61FBC32C5E9"
$"BABBC626BC65C5FBBD1AC5E9BCEBC60FBD50C698BE06C668BDCDC70DBFB4C3B6"
$"BFEBC5E7BF9EC25FC019BEDEBFC3C173BEF9BAB8C106B917BDA9B8A9BEE0B917"
$"BDA9020BB917BDA9B917BDA9B93FBD6BB9BABD18B979BD4BBA17B9B2BF35B72E"
$"BC1CB78DC0FCB6D2C251B888C16AB812C307B8E6C4EDB9CFC478B954C5BDBAAA"
$"C61FBC32C5E9BABBC626BC65C5FBBD1AC5E9BCEBC60FBD50C698BE06C668BDCD"
$"C70DBFB4C3B6BFEBC5E7BF9EC25FC019BEDEBFC3C173BEF9BAB8C106B917BDA9"
$"B8A9BEE0B917BDA90010C3B2B989C3B2B989C3B2B989C42CBC06C480BB17C3D8"
$"BCF5C2D1BD1AC329BD20C27ABD14C060BD5BC118BCE1BFCABD8CBF0ABDC1BF0A"
$"BDD7BF0ABDC1BF9BBDCCBF65BDC7BFD2BDD2C2D1BDB0C199BD1AC334BDC6C3D4"
$"BD7FC392BD68C5F8BE47C3C4BEB9C3A8BEC2C345BEE3BFE4BF3043BFACBF6EBE"
$"EFBC623EBD34BFCEBC29BECBB9093EB956BE68BA9DC225BF75C029BF4ABFE9BF"
$"9FC06AC6B2BEEEC6B2C064C6C4BE25C558BA3AC602BAF6C4ADB97EC39CB92CC3"
$"FCB902C39CB92C0A04BC78B934BD16B951BD16B8F6BCEEB89C06063A0ABBF7BA"
$"5CBBADBA7EBBADBACDBB89BACDBBD2BACDBC0DBC35BAABBBF7BA5C0A03BDB2B9"
$"D5BD7ABA0DBDB2BA4B06048BBFE4B842BFE4B842BFF5B848C03FB89CC0DCBFE4"
$"B8420A04C0DCB9F4C0AFBA4EC136BA1CC114B9B90A04C25BB9B9C2B5B9B9C274"
$"B96EC234B9230A04C274BAA3C2A9BAECC2F9BAD0C2DDBA4E0A03C32CBB85C39C"
$"BB85C364BBA10606B602C1D3BBD3BC06C211BC44C1E6BC44C23BBC44C27CBC28"
$"C227BBD3C1D30806C2D4BE3CC30DBE04C3B6BE04C394BE20C345BE3CC2D4BE3C"
$"0A05BF74BE1EBFACBE78BFF5BE78BFF5BE3ABFB4BE3A0405AB02C071BDB7C071"
$"BDB7C071BDC8C02DBE12C071BE4AC093BE2EC071BDD30805BE0BBD11BE0BBD1F"
$"BE0BBD64BED9BD64BF0ABCCF0A04BB37BC2DBB0DBC7DBB55BC8BBB9DBC440605"
$"E202BC62BE2FBCCABCB1BE53BC80BE53BC80BE41BC80BE66BC62BE2F0A04BC7A"
$"BCFBBCE2BD17BCCFBC97BC7ABC5A0A04BE98BBC8BED5BC0CBE59BBEABE2BBBF8"
$"0A03BF61BB08BFC3BAECBFC3BB290A03C4A4BB41C50BBBC8C4EDBC0C0A04BADF"
$"BF99BB16BFB4BB4CBF90BB16BF3E0A05BE16BEADBDC9BF30BD17BF04BD39BEAD"
$"BDA1BEEE0A04BE80B8CEBEB9B8CEBED5B89CBE62B88B0A04C0BDBBA1C106BBA1"
$"C118BB66C0AFBB540604BEC591BDDAC591BE17C591BDFEC591BE2FC5C8BE8AC5"
$"BCBE84C5D4BE90C591BDDA0606BA0ABA94BD68BA69BDC0BA69BE21BA69BE0FBA"
$"69BE34BA94BE48BAB2BDA6BA94BD680A04BF74B9E0BFC3B9E0BFC3B99ABF7AB9"
$"B90A04C1B73EC1F03EC20CBEC2C199BEB10604ABC009B6B8C009B6B8C01BB6C5"
$"C051B784C118B77DC009B6B80A04C455B9C9C4D8B9E0C48DB963C442B8E70A04"
$"BD94B7BABDE9B7BABE13B76CBD68B7510A04B9ECBBC6B9B3BC2EBA13BC40BA72"
$"BBE4270A000100023F7F830000000000003F7F9C4400004400000A0104010203"
$"0420201F0A01010520201F0A02010620201F0A04010820201F0A05010920201F"
$"0A05010A20201F0A05010B20201F0A05010C20201F0A05010D20201F0A05010E"
$"20201F0A05010F20201F0A05011020201F0A05011120201F0A05011220201F0A"
$"05011320201F0A05011420201F0A05011520201F0A05011620201F0A05011720"
$"201F0A05011820201F0A05011920201F0A05011A20201F0A05011B20201F0A05"
$"011C20201F0A05011D20201F0A05011E20201F0A05011F20201F0A0501202020"
$"1F0A05012120201F0A05012220201F0A05012320201F0A05012420201F0A0501"
$"2520201F0A05012620201F0A05012720201F0A0001032049470A000102204F3D"
$"0A00010420414D"
};

View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Global variables
PROGRAM_NAME=ja2
DATA_PATH=`/bin/finddir B_USER_NONPACKAGED_DATA_DIRECTORY`/$PROGRAM_NAME
FILE=$DATA_PATH/data/binarydata/ja2bin.dat
CONFIG_FILE_PATH=`/bin/finddir B_USER_SETTINGS_DIRECTORY`/$PROGRAM_NAME
CONFIG_FILE=$CONFIG_FILE_PATH/ja2.ini
# If the file exists...
if [ -f $FILE ];
then
# ...then start the program
open `/bin/finddir B_SYSTEM_APPS_DIRECTORY`/JA2/ja2 $@
else
# but if it isn't exist drop a warning
if [ "$(alert --warning "Please, copy your original JA2 Files to the Data Folder and rename them to lower-case." "Open Data Folder" "Cancel")" == "Open Data Folder" ]; then
# then let's create the data Dir and open it
mkdir -p $CONFIG_FILE_PATH
echo "#Tells ja2-stracciatella where the binary datafiles are located" > $CONFIG_FILE
echo "data_dir = $DATA_PATH" >> $CONFIG_FILE
mkdir -p $DATA_PATH
open $DATA_PATH
fi
fi

View File

@@ -0,0 +1,92 @@
SUMMARY="A port of Jagged Alliance 2 to SDL"
DESCRIPTION="The goal of the project is to make Jagged Alliance 2 available on \
a wide range of platforms, improve its stability, fix bugs and provide a \
stable platform for mod development. Moddability is still in the early stages.
Data files from the original game are still required and will be used by \
JA2-Stracciatella."
HOMEPAGE="https://ja2-stracciatella.github.io/"
COPYRIGHT="2004 Strategy First Inc."
LICENSE="SFI-SCLA"
REVISION="1"
SOURCE_URI="https://github.com/ja2-stracciatella/ja2-stracciatella/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="7e5a06643798fc25b3f86a0563e50ef8a5b77e66627ba1acc88bc7b6d4b499be"
SOURCE_DIR="ja2-stracciatella-$portVersion"
PATCHES="ja2_stracciatella-$portVersion.patchset"
ADDITIONAL_FILES="
ja2_stracciatella.rdef.in
ja2_stracciatella.sh
"
ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
SECONDARY_ARCHITECTURES="?x86"
PROVIDES="
ja2_stracciatella$secondaryArchSuffix = $portVersion
cmd:ja2$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libSDL$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libSDL$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:sed
"
BUILD()
{
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
$portDir/additional-files/ja2_stracciatella.rdef.in \
> ja2_stracciatella.rdef
configure --prefix=$appsDir/JA2
make $jobArgs \
WITH_ZLIB=1 \
WITH_UNITTESTS=0
}
INSTALL()
{
make install
# Installing start-script
cp $portDir/additional-files/ja2_stracciatella.sh \
$appsDir/JA2
chmod +x $appsDir/JA2/ja2_stracciatella.sh
# Installing extra-attribs
rc ja2_stracciatella.rdef
resattr -o $appsDir/JA2/ja2_stracciatella.sh \
ja2_stracciatella.rsrc
addResourcesToBinaries ja2_stracciatella.rdef \
$appsDir/JA2/ja2
# Creating Deskbar-link
addAppDeskbarSymlink $appsDir/JA2/ja2_stracciatella.sh \
"Jagged Alliance 2"
# Cleanup
mkdir -p $manDir
mv $appsDir/JA2/share/man/* $manDir
mv $appsDir/JA2/bin/ja2 $appsDir/JA2
rm -rf $appsDir/JA2/share/{applications,icons,man}
rm -rf $appsDir/JA2/bin
}

View File

@@ -0,0 +1,45 @@
This Strategy First Inc. Source Code License Agreement ("SFI-SCLA") forms a legal agreement between you and Strategy First Inc. ("Strategy First") for the source code, related materials, or related documentation (together, the "Software").
By using this Software you agree to be bound by the terms of this SFI-SCLA. Do not install, copy, or use the Software if you do not agree to the terms of this License Agreement. The Software is protected by copyright and other intellectual property laws and Strategy First is licensing the Software, not selling it.
YOUR RIGHTS:
You may use this Software for any non-commercial purpose, subject to the conditions of this License. Non-commercial purposes include, but are not limited to, teaching, research, public demos and your own experimentation. You may distribute this Software with books or other teaching materials, or publish the Software on websites that are intended to teach the use of the Software for academic or other non-commercial purposes. You may not use or distribute this Software, or any works that derive from it, in any form for commercial purposes. Commercial purposes include, but are not limited to, running a business, licensing, renting, or selling the Software, distributing the Software for use with any commercial products, or any other activity which purpose is to procure a profit or gain to you or others. This Software includes source code or data, and you may modify such portions of the Software and distribute the modified Software for non-commercial purposes, as provided in this Licensing Agreement.
This Licensing Agreement does not grant you a license to any of Strategy First's copyrights or patents for anything you might create using any of the information included in the Software.
In return, you agree:
1. That you will not remove any copyright or other notices from the Software.
2. That if any of the Software is in binary format, you will not attempt to modify such portions of the Software, or to reverse engineer or decompile them, except and only to the extent authorized by law.
3. That if you distribute the Software or any derivative works of the Software, you will distribute them using a verbatim copy of this License, and you will not grant any
rights to the Software or derivative works that are broader than those provided by this Licensing Agreement. For example, you may not distribute any modifications of the Software under terms that would permit commercial use, or under terms that require the Software or such derivative works to be sublicensed to others.
4. That if you have modified the Software or created derivative works, and distribute such modifications or derivative works, you will cause the modified files to carry
prominent notices so that recipients know that they are not receiving the original Software. Such notices must state: (i) that you have changed the Software; and (ii) the date of any changes.
5. That Strategy First is granted, without any limitations, and on a royalty free basis, the rights to reproduce, install, use, modify, distribute and transfer your modifications to the Software source code or data.
6. That any feedback about the Software provided by you to us is voluntarily given, and Strategy First shall be free to use the feedback as it sees fit without obligation or
restriction of any kind, even if the feedback is designated by you as confidential.
7. THAT THE SOFTWARE COMES "AS IS", WITH NO WARRANTIES. THIS MEANS NO EXPRESS, IMPLIED OR STATUTORY WARRANTY, INCLUDING WITHOUT LIMITATION, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ANY WARRANTY AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE SOFTWARE OR ANY WARRANTY OF TITLE OR NON-INFRINGEMENT. THERE IS NO WARRANTY THAT THIS SOFTWARE WILL FULFILL ANY OF YOUR PARTICULAR PURPOSES OR NEEDS. ALSO, YOU MUST PASS THIS DISCLAIMER ON WHENEVER YOU DISTRIBUTE THE SOFTWARE OR DERIVATIVE WORKS.
8. THAT NEITHER STRATEGY FIRST NOR ANY CONTRIBUTOR TO THE SOFTWARE WILL BE LIABLE FOR ANY DAMAGES RELATED TO THE SOFTWARE OR THIS LICENSE, INCLUDING DIRECT, INDIRECT, SPECIAL,
CONSEQUENTIAL OR INCIDENTAL DAMAGES, TO THE MAXIMUM EXTENT THE LAW PERMITS, NO MATTER WHAT LEGAL THEORY IT IS BASED ON. ALSO, YOU MUST PASS THIS LIMITATION OF LIABILITY ON WHENEVER YOU DISTRIBUTE THE SOFTWARE OR DERIVATIVE WORKS.
9. That we have no duty of reasonable care or lack of negligence, and we are not obligated to provide technical support for the Software.
10. That if you breach this SFI-SCLA or if you sue anyone over patents that you think may apply to the Software or anyone's use of the Software, your license to the Software ends automatically and you shall destroy all of your copies of the Software immediately. Section 5 of this SFI-SCLA shall survive any termination of this license.
11. That the patent rights, if any, granted in this Licensing Agreement only apply to the Software, not to any derivative works you make.
12. That the Software is subject to U.S. export jurisdiction at the time it is licensed to you, and it may be subject to additional export or import laws in other places. You agree to comply with all such laws and regulations that may apply to the Software after delivery of the software to you.
13. That your rights under this License end automatically if you breach it in any way.
14. That all rights not expressly granted to you in this License are reserved.
15. That this SFI-SCLA shall be construed and controlled by the laws of the Province of Quebec, Canada, without regard to conflicts of law. If any provision of this SFI-SCLA shall be deemed unenforceable or contrary to law, the rest of this SFI-SCLA shall remain in full effect and interpreted in an enforceable manner that most nearly captures the intent of the original language.

View File

@@ -0,0 +1,87 @@
From 5893be972ebe1896ae3d5ab9c8882e050b7028e7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Wed, 7 Jun 2017 07:54:07 +0200
Subject: [PATCH] PATCH: LC_ALL not defined on Haiku
---
sgp/SGP.cc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sgp/SGP.cc b/sgp/SGP.cc
index 7b9b710..aa1be0a 100644
--- a/sgp/SGP.cc
+++ b/sgp/SGP.cc
@@ -313,6 +313,12 @@ static BOOLEAN ParseParameters(int argc, char* const argv[],
int main(int argc, char* argv[])
try
{
+
+#if defined(__HAIKU__)
+ /*LC_ALL not defined on Haiku, an JA needs to set it to "C" */
+ setenv("LC_ALL","C",1);
+#endif
+
std::string exeFolder = FileMan::getParentPath(argv[0], true);
#if defined BROKEN_SWPRINTF
--
2.12.2
From d612275101c558e8380c57e2029fac9b835f7e47 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Wed, 7 Jun 2017 07:57:36 +0200
Subject: [PATCH] PATCH: dirent dirty fix
---
sgp/FileMan.cc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sgp/FileMan.cc b/sgp/FileMan.cc
index 0b607c2..3260d19 100644
--- a/sgp/FileMan.cc
+++ b/sgp/FileMan.cc
@@ -539,6 +539,8 @@ bool FileMan::findObjectCaseInsensitive(const char *directory, const char *name,
}
}
}
+#ifndef __HAIKU__
+/* FIXME: dirty hack to eliminate dirent stuff*/
else
{
// name contains only file, no directories
@@ -561,6 +563,7 @@ bool FileMan::findObjectCaseInsensitive(const char *directory, const char *name,
closedir(d);
}
}
+#endif /*__HAIKU__*/
// LOG_INFO("XXXXX Looking for %s/[ %s ] : %s\n", directory, name, result ? "success" : "failure");
return result;
--
2.12.2
From 2c6099a9cbea2d6341565bf220e62c5028939a7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Wed, 7 Jun 2017 17:57:57 +0200
Subject: [PATCH] Patch: Haiku config file location
---
sgp/FileMan.cc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sgp/FileMan.cc b/sgp/FileMan.cc
index 3260d19..f21c8c0 100644
--- a/sgp/FileMan.cc
+++ b/sgp/FileMan.cc
@@ -111,6 +111,8 @@ std::string FileMan::findConfigFolderAndSwitchIntoIt()
#ifdef _WIN32
std::string configFolderPath = FileMan::joinPaths(home, "JA2");
+#elif defined(__HAIKU__)
+ std::string configFolderPath = FileMan::joinPaths(home, "config/settings/ja2");
#else
std::string configFolderPath = FileMan::joinPaths(home, ".ja2");
#endif
--
2.12.2