Nifskope package (#11144)

This commit is contained in:
DigitalBox98
2024-10-01 14:42:54 +00:00
committed by GitHub
parent 1ced138409
commit f75fbc66b0
4 changed files with 302 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
resource app_flags B_SINGLE_LAUNCH;
resource app_version {
major = @MAJOR@,
middle = @MIDDLE@,
minor = @MINOR@,
variety = B_APPV_FINAL,
internal = 0,
short_info = "@APP_NAME@",
long_info = "@LONG_INFO@"
};
resource app_signature "@APP_SIGNATURE@";
resource vector_icon {
$"6E6369660A020006023C38143FECCCC04E313C9B594BC82CC84A797A7984A1D8"
$"FFFFFF02000402666D6D8BFFFFFFFF020004026BFFFFFFFF7B8FC8038982A602"
$"0106023FFFFF2E6060AE60603FFFFF386115B85FABCBAC2323FFFFFFFF030805"
$"05034E4C73036A628C0325BD0505000B0805262A322F582B4E26262A0805272A"
$"322F335A2650262A080539355331534239483935080A3A4D3D4E3E503E523C54"
$"3A54385338503A4D3B4D080A3A4D3D4E3E503E523C543A54385338503A4D3B4D"
$"080B284D3054304F2C4B304B3047294228452D492849284D0805283F3043303F"
$"283B283F080B2838313D31392D372D322B312B362A352A2F282E283808053B38"
$"3E34434048334B360807262A322F592B594E34592650262A080B25284E25592B"
$"322F25292551325C5A4F5A2C322F3259110A05010A1001178300040A02010900"
$"0A000100000A010101000A050102000A05010310031581000417810004164000"
$"000000000000000000004000000000000000000000004000000A040104000A04"
$"0104202C1D0A050103302C1D0215810004178100040A04010420361A0A050103"
$"30361A0215810004178100040A060105000A060106000A060107023FFFF63222"
$"59B222593FFFF63ADFEFB94F8D0A03010212404BDA000000000000405496C4D0"
$"97C45B2D01178100040A080108123F81A1B8C13A382A803EEEB644CA0147390F"
$"01178200040A010000"
};

View File

@@ -0,0 +1,20 @@
NIFSKOPE LICENSE
Copyright (c) 2005-2014, NIF File Format Library and Tools. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
The name of the NIF File Format Library and Tools project may not be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
CREDITS
The Windows build of NifSkope uses Havok(R) for the generation of MOPP code. Copyright (c) 1999-2014 Havok.com Inc. (and its Licensors). All Rights Reserved. See www.havok.com for details.
NifSkope uses Qhull for the generation of convex hulls, from http://www.qhull.org. Copyright (c) 1993-2012 C.B. Barber and The Geometry Center. See Qhull_COPYING.txt for details and http://gitorious.org/qhull/ for the source.
NOTICE
Parts of NifSkope (i.e. included libraries) might be subject to other licenses. This license only applies to original NifSkope sources.

View File

@@ -0,0 +1,104 @@
SUMMARY="Tool for opening and editing NIF files"
DESCRIPTION="NifSkope is a tool for opening and editing the NetImmerse file format (NIF). \
NIF is used by video games such as Morrowind, Oblivion, Skyrim, Fallout 3/NV/4/76, Starfield, \
Civilization IV, and more."
HOMEPAGE="http://www.niftools.org/"
COPYRIGHT="2005-2014 NIF File Format Library and Tools"
LICENSE="NIFSKOPE"
REVISION="1"
SOURCE_URI="https://github.com/hexabits/nifskope/archive/refs/tags/v2.0.dev9.tar.gz"
CHECKSUM_SHA256="b40baca5fc3b11292cd284b5ef0d07dbe40c3bab8067c05b7f25bdb6141fe26c"
SOURCE_URI_2="https://github.com/g-truc/gli/archive/refs/tags/0.8.2.0.tar.gz"
CHECKSUM_SHA256_2="9e7024c2df77c011eff4f66667c1834620c70b7902cd50f32ab48edd49fe0139"
SOURCE_URI_3="https://github.com/qhull/qhull/archive/refs/tags/v8.1-alpha1.tar.gz"
CHECKSUM_SHA256_3="09e5e4c5b2b8a9e617a46876fef5a3d33e70aa1d08a163ff05d37701327c3be7"
SOURCE_URI_4="https://github.com/niftools/nifxml/archive/refs/tags/v0.9.0.tar.gz"
CHECKSUM_SHA256_4="984c247115bc49f90ded69b4c8feb9a62a0365ad53f5890312302b6a05bb4ed7"
SOURCE_URI_5="https://raw.githubusercontent.com/niftools/kfmxml/develop/kfm.xml#noarchive"
CHECKSUM_SHA256_5="3af5634dfef643494bb7646924b1b18ab22bc0d9b5ea4758d4e6b693c78a2f3e"
PATCHES="nifskope-2.0.dev9.patchset"
ADDITIONAL_FILES="nifskope.rdef.in"
ARCHITECTURES="?all !x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="!x86"
GLOBAL_WRITABLE_FILES="
settings/nifskope/kfm.xml keep-old
settings/nifskope/nif.xml keep-old
"
PROVIDES="
nifskope = $portVersion
app:NifSkope = $portVersion
"
REQUIRES="
haiku
lib:libGL
lib:libGLU
lib:libQt5Core
lib:libQt5Gui
lib:libQt5Network
lib:libQt5OpenGL
lib:libQt5Xml
lib:libQt5Widgets
lib:libz
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:glm
devel:libGLU
devel:libqhull_r
devel:libz
"
BUILD_PREREQUIRES="
cmd:clang++ >= 18
cmd:g++
cmd:make
cmd:pkg_config
cmd:qmake
cmd:which
"
BUILD()
{
cp -r $sourceDir2/gli-0.8.2.0/gli/* $sourceDir/src/
cp -r $sourceDir2/gli-0.8.2.0/external/glm/* $sourceDir/src/
cp -r $sourceDir3/qhull-8.1-alpha1/src/libqhull $sourceDir/src/
mkdir -p $sourceDir/build/docsys/nifxml/
cp $sourceDir4/nifxml-0.9.0/nif.xml $sourceDir/build/docsys/nifxml/
mkdir -p $sourceDir/build/docsys/kfmxml/
cp $sourceDir5/kfm.xml $sourceDir/build/docsys/kfmxml/
qmake
make $jobArgs
}
INSTALL()
{
make install
mkdir -p $appsDir
mkdir -p $settingsDir/nifskope/
cp $sourceDir/release/NifSkope $appsDir/
cp $sourceDir/release/nif.xml $settingsDir/nifskope/
cp $sourceDir/release/kfm.xml $settingsDir/nifskope/
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
local APP_NAME="NifSkope"
local LONG_INFO="$SUMMARY"
local APP_SIGNATURE="application/x-vnd.nifskope"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|9|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
-e "s|@APP_NAME@|$APP_NAME|" \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
$portDir/additional-files/nifskope.rdef.in > nifskope.rdef
addResourcesToBinaries nifskope.rdef $appsDir/NifSkope
addAppDeskbarSymlink $appsDir/NifSkope
}

View File

@@ -0,0 +1,143 @@
From a3ae106ae4f9479af66ba8b61c0a1b048254b21f Mon Sep 17 00:00:00 2001
From: DigitalBox98 <digitalbox98@gmail.com>
Date: Tue, 17 Sep 2024 19:07:19 +0000
Subject: Add Nifskope.pro
diff --git a/NifSkope.pro b/NifSkope.pro
index bf5e93d..9e88da2 100644
--- a/NifSkope.pro
+++ b/NifSkope.pro
@@ -2,7 +2,7 @@
## BUILD OPTIONS
###############################
-TEMPLATE = vcapp
+TEMPLATE = app
TARGET = NifSkope
QT += xml opengl network widgets
@@ -144,7 +144,7 @@ HEADERS += \
src/data/nifvalue.h \
src/gl/marker/constraints.h \
src/gl/marker/furniture.h \
- srg/gl/BSMesh.h \
+ src/gl/BSMesh.h \
src/gl/bsshape.h \
src/gl/controllers.h \
src/gl/glcontroller.h \
@@ -218,7 +218,7 @@ SOURCES += \
src/data/nifitem.cpp \
src/data/niftypes.cpp \
src/data/nifvalue.cpp \
- srg/gl/BSMesh.cpp \
+ src/gl/BSMesh.cpp \
src/gl/bsshape.cpp \
src/gl/controllers.cpp \
src/gl/glcontroller.cpp \
@@ -454,6 +454,8 @@ win32 {
QMAKE_CXXFLAGS_RELEASE *= -msse2 -msse
}
+LIBS += -lz
+
win32 {
# GL libs for Qt 5.5+
LIBS += -lopengl32 -lglu32
--
2.45.2
From 75252c9f6498804351cb0b7f59a9ef95c3ce6249 Mon Sep 17 00:00:00 2001
From: DigitalBox98 <digitalbox98@gmail.com>
Date: Tue, 17 Sep 2024 19:15:28 +0000
Subject: Add additional fixes
diff --git a/lib/fsengine/bsa.cpp b/lib/fsengine/bsa.cpp
index 5969599..694c5d0 100644
--- a/lib/fsengine/bsa.cpp
+++ b/lib/fsengine/bsa.cpp
@@ -32,7 +32,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "bsa.h"
#include "dds.h"
-#include "zlib/zlib.h"
+#include "zlib.h"
#include "lz4frame.h"
#include <QByteArray>
diff --git a/src/nifskope.cpp b/src/nifskope.cpp
index 6f2e849..c4d9128 100644
--- a/src/nifskope.cpp
+++ b/src/nifskope.cpp
@@ -293,7 +293,6 @@ NifSkope::NifSkope()
graphicsView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
//graphicsView->setOptimizationFlags( QGraphicsView::DontSavePainterState | QGraphicsView::DontAdjustForAntialiasing );
- graphicsView->setViewport( ogl );
graphicsView->setViewportUpdateMode( QGraphicsView::FullViewportUpdate );
// Set central widget and viewport
@@ -319,6 +318,8 @@ NifSkope::NifSkope()
// Menus
initMenu();
+ graphicsView->setViewport( ogl );
+
// Connections (that are required to load after all other inits)
initConnections();
diff --git a/src/xml/kfmxml.cpp b/src/xml/kfmxml.cpp
index 5e0d597..fafaca1 100644
--- a/src/xml/kfmxml.cpp
+++ b/src/xml/kfmxml.cpp
@@ -266,7 +266,7 @@ bool KfmModel::loadXML()
QDir dir( QCoreApplication::applicationDirPath() );
QString fname;
QStringList xmlList( QStringList()
- << "kfm.xml"
+ << "/boot/system/settings/nifskope/kfm.xml"
#ifdef Q_OS_LINUX
<< "/usr/share/nifskope/kfm.xml"
#endif
diff --git a/src/xml/nifxml.cpp b/src/xml/nifxml.cpp
index a0051b0..8457272 100644
--- a/src/xml/nifxml.cpp
+++ b/src/xml/nifxml.cpp
@@ -721,7 +721,7 @@ bool NifModel::loadXML()
QDir dir( QCoreApplication::applicationDirPath() );
QString fname;
QStringList xmlList( QStringList()
- << "nif.xml"
+ << "/boot/system/settings/nifskope/nif.xml"
#ifdef Q_OS_LINUX
<< "/usr/share/nifskope/nif.xml"
#endif
--
2.45.2
From 363fc20fa45c80f1f5c729d9c51c78d3e0f114f0 Mon Sep 17 00:00:00 2001
From: DigitalBox98 <digitalbox98@gmail.com>
Date: Wed, 18 Sep 2024 18:30:36 +0000
Subject: clang compilation
diff --git a/NifSkope.pro b/NifSkope.pro
index 9e88da2..5cabbb7 100644
--- a/NifSkope.pro
+++ b/NifSkope.pro
@@ -5,6 +5,9 @@
TEMPLATE = app
TARGET = NifSkope
+QMAKE_CC = clang
+QMAKE_CXX = clang++
+
QT += xml opengl network widgets
# Require Qt 5.7 or higher
--
2.45.2