Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
build: add app noctis-iv-lr
Browse files Browse the repository at this point in the history
Modern source port of Noctis IV

log: add app
  • Loading branch information
Van020530 authored and kamiyadm committed May 30, 2024
1 parent 8f4ee19 commit 8dd8898
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
22 changes: 22 additions & 0 deletions io.github.noctis-iv-lr/linglong.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package:
id: io.github.noctis-iv-lr
name: noctis-iv-lr
version: 0.0.1.2
kind: app
description: |
Modern source port of Noctis IV
runtime:
id: org.deepin.Runtime
version: 23.0.0

source:
kind: git
url: https://github.com/dgcole/noctis-iv-lr.git
commit: e1d26557d42fad4d94b5e9d78457b87277512ae5
patch: patches/0001-fix.patch
depends:
- id: raylib/4.0.0
- id: glm/0.9.9.8
build:
kind: cmake
63 changes: 63 additions & 0 deletions io.github.noctis-iv-lr/patches/0001-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
From 74ee0f0bf30bf98181f6d1d00aa54e4936c95fb6 Mon Sep 17 00:00:00 2001
From: van <[email protected]>
Date: Wed, 8 May 2024 20:40:12 +0800
Subject: [PATCH] fix

---
CMakeLists.txt | 18 +++++++++++++++++-
src/noctis-0.cpp | 4 ++--
2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c8ddf2a..b9711d8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,4 +25,20 @@ if (EMSCRIPTEN)
target_link_libraries(${PROJECT_NAME} /home/dcole/Projects/raylib/src/libraylib.a)
else()
target_link_libraries(${PROJECT_NAME} raylib)
-endif()
\ No newline at end of file
+endif()
+
+set(DATADIR1 "${CMAKE_INSTALL_PREFIX}/share/res/supports.nct")
+add_definitions(-DMY_DATADIR="${DATADIR1}")
+set(DESKTOP_FILE_CONTENT "
+[Desktop Entry]
+Type=Application
+Name=nivlr
+Exec=nivlr
+Icon=rings
+Categories=game;
+")
+file(WRITE ${CMAKE_BINARY_DIR}/nivlr.desktop "${DESKTOP_FILE_CONTENT}")
+install(PROGRAMS ${CMAKE_BINARY_DIR}/nivlr.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
+install(PROGRAMS ${CMAKE_BINARY_DIR}/../doc/img/rings.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/512x512/apps/)
+install(DIRECTORY ${CMAKE_BINARY_DIR}/../res/ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/res)
+install(TARGETS nivlr DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
\ No newline at end of file
diff --git a/src/noctis-0.cpp b/src/noctis-0.cpp
index f8683f7..c6fd66b 100644
--- a/src/noctis-0.cpp
+++ b/src/noctis-0.cpp
@@ -39,7 +39,7 @@

#include "brtl.h"
#include "noctis-d.h"
-
+#define DATA_DIR MY_DATADIR
// Date and specific functions imported from ASSEMBLY.H

uint16_t QUADWORDS = 16000;
@@ -858,7 +858,7 @@ float fast_flandom() { return ((float) fast_random(32767) * 0.000030518); }

// Loads virtual file handles from supports.nct
FILE *sa_open(int32_t offset_of_virtual_file) {
- FILE *fh = fopen("res/supports.nct", "rb");
+ FILE *fh = fopen(MY_DATADIR, "rb");

if (fh == nullptr) {
return nullptr;
--
2.33.1

0 comments on commit 8dd8898

Please sign in to comment.