tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
shipwright: 8.0.6 -> 9.0.2
qubitnano
10 months ago
09db531e
13681c0f
+147
-56
3 changed files
expand all
collapse all
unified
split
pkgs
by-name
sh
shipwright
darwin-fixes.patch
disable-downloading-stb_image.patch
package.nix
+20
-20
pkgs/by-name/sh/shipwright/darwin-fixes.patch
···
1
diff --git a/CMakeLists.txt b/CMakeLists.txt
2
-
index 2c8644af..157758c9 100644
3
--- a/CMakeLists.txt
4
+++ b/CMakeLists.txt
5
-
@@ -166,17 +166,13 @@ endif()
6
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
7
add_custom_target(CreateOSXIcons
8
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/macosx/soh.iconset
9
-
- COMMAND sips -z 16 16 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16.png
10
-
- COMMAND sips -z 32 32 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16@2x.png
11
-
- COMMAND sips -z 32 32 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32.png
12
-
- COMMAND sips -z 64 64 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32@2x.png
13
-
- COMMAND sips -z 128 128 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128.png
14
-
- COMMAND sips -z 256 256 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128@2x.png
15
-
- COMMAND sips -z 256 256 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256.png
16
-
- COMMAND sips -z 512 512 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256@2x.png
17
-
- COMMAND sips -z 512 512 soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512.png
18
-
- COMMAND cp soh/macosx/sohIcon.png ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512@2x.png
19
- COMMAND iconutil -c icns -o ${CMAKE_BINARY_DIR}/macosx/soh.icns ${CMAKE_BINARY_DIR}/macosx/soh.iconset
20
-
+ COMMAND convert soh/macosx/sohIcon.png -resize 16x16 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16.png
21
-
+ COMMAND convert soh/macosx/sohIcon.png -resize 32x32 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32.png
22
-
+ COMMAND convert soh/macosx/sohIcon.png -resize 64x64 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_64.png
23
-
+ COMMAND convert soh/macosx/sohIcon.png -resize 128x128 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128.png
24
-
+ COMMAND convert soh/macosx/sohIcon.png -resize 256x256 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256.png
25
-
+ COMMAND convert soh/macosx/sohIcon.png -resize 512x512 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512.png
26
+ COMMAND png2icns ${CMAKE_BINARY_DIR}/macosx/soh.icns ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_{16,32,64,128,256,512}.png
27
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
28
COMMENT "Creating OSX icons ..."
29
)
30
-
@@ -201,7 +197,6 @@ install(DIRECTORY ${CMAKE_BINARY_DIR}/assets
31
32
install(CODE "
33
include(BundleUtilities)
34
-
- fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/soh-macos\" \"\" \"${dirs}\")
35
")
36
37
endif()
···
1
diff --git a/CMakeLists.txt b/CMakeLists.txt
2
+
index 2771ee8c..0702adad 100644
3
--- a/CMakeLists.txt
4
+++ b/CMakeLists.txt
5
+
@@ -250,17 +250,13 @@ endif()
6
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
7
add_custom_target(CreateOSXIcons
8
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/macosx/soh.iconset
9
+
- COMMAND sips -z 16 16 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16.png
10
+
- COMMAND sips -z 32 32 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16x16@2x.png
11
+
- COMMAND sips -z 32 32 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32.png
12
+
- COMMAND sips -z 64 64 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32x32@2x.png
13
+
- COMMAND sips -z 128 128 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128.png
14
+
- COMMAND sips -z 256 256 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128x128@2x.png
15
+
- COMMAND sips -z 256 256 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256.png
16
+
- COMMAND sips -z 512 512 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256x256@2x.png
17
+
- COMMAND sips -z 512 512 ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png --out ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512.png
18
+
- COMMAND cp ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512x512@2x.png
19
- COMMAND iconutil -c icns -o ${CMAKE_BINARY_DIR}/macosx/soh.icns ${CMAKE_BINARY_DIR}/macosx/soh.iconset
20
+
+ COMMAND convert ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png -resize 16x16 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_16.png
21
+
+ COMMAND convert ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png -resize 32x32 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_32.png
22
+
+ COMMAND convert ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png -resize 64x64 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_64.png
23
+
+ COMMAND convert ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png -resize 128x128 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_128.png
24
+
+ COMMAND convert ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png -resize 256x256 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_256.png
25
+
+ COMMAND convert ${CMAKE_SOURCE_DIR}/soh/macosx/sohIcon.png -resize 512x512 ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_512.png
26
+ COMMAND png2icns ${CMAKE_BINARY_DIR}/macosx/soh.icns ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_{16,32,64,128,256,512}.png
27
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
28
COMMENT "Creating OSX icons ..."
29
)
30
+
@@ -288,7 +284,6 @@ INSTALL(CODE "FILE(RENAME \${CMAKE_INSTALL_PREFIX}/../MacOS/soh-macos \${CMAKE_I
31
32
install(CODE "
33
include(BundleUtilities)
34
+
- fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/../MacOS/soh\" \"\" \"${dirs}\")
35
")
36
37
endif()
+16
pkgs/by-name/sh/shipwright/disable-downloading-stb_image.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
Submodule libultraship contains modified content
2
+
diff --git a/libultraship/cmake/dependencies/common.cmake b/libultraship/cmake/dependencies/common.cmake
3
+
index 596158c..c62d7b2 100644
4
+
--- a/libultraship/cmake/dependencies/common.cmake
5
+
+++ b/libultraship/cmake/dependencies/common.cmake
6
+
@@ -47,10 +47,6 @@ set(stormlib_optimizations_patch git apply ${CMAKE_CURRENT_SOURCE_DIR}/cmake/dep
7
+
endif()
8
+
9
+
#=================== STB ===================
10
+
-set(STB_DIR ${CMAKE_BINARY_DIR}/_deps/stb)
11
+
-file(DOWNLOAD "https://github.com/nothings/stb/raw/0bc88af4de5fb022db643c2d8e549a0927749354/stb_image.h" "${STB_DIR}/stb_image.h")
12
+
-file(WRITE "${STB_DIR}/stb_impl.c" "#define STB_IMAGE_IMPLEMENTATION\n#include \"stb_image.h\"")
13
+
-
14
+
add_library(stb STATIC)
15
+
16
+
target_sources(stb PRIVATE
+111
-36
pkgs/by-name/sh/shipwright/package.nix
···
10
copyDesktopItems,
11
makeDesktopItem,
12
python3,
13
-
libX11,
14
-
libXrandr,
15
-
libXinerama,
16
-
libXcursor,
17
-
libXi,
18
-
libXext,
19
glew,
20
boost,
21
SDL2,
···
28
makeWrapper,
29
darwin,
30
libicns,
0
0
0
0
0
0
31
}:
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
32
stdenv.mkDerivation (finalAttrs: {
33
pname = "shipwright";
34
-
version = "8.0.6";
35
36
src = fetchFromGitHub {
37
owner = "harbourmasters";
38
repo = "shipwright";
39
tag = finalAttrs.version;
40
-
hash = "sha256-bA+Bm7M6udeZLpFhGa8fCtagfYBeRxWWqFuAj62XwGQ=";
41
fetchSubmodules = true;
42
};
43
44
patches = [
45
./darwin-fixes.patch
46
-
(fetchpatch {
47
-
name = "gcc14.patch";
48
-
url = "https://github.com/HarbourMasters/Shipwright/commit/1bc15d5bf3042d4fd64e1952eb68c47a7d5d8061.patch";
49
-
hash = "sha256-OpjP+rGqx56DB4W8yzLkxuxSAQa6oXQqtbQ2cNcFjYQ=";
50
-
})
51
];
52
-
53
-
# This would get fetched at build time otherwise, see:
54
-
# https://github.com/HarbourMasters/Shipwright/blob/e46c60a7a1396374e23f7a1f7122ddf9efcadff7/soh/CMakeLists.txt#L736
55
-
gamecontrollerdb = fetchurl {
56
-
name = "gamecontrollerdb.txt";
57
-
url = "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/075c1549075ef89a397fd7e0663d21e53a2485fd/gamecontrollerdb.txt";
58
-
hash = "sha256-atjc0t921l6JSUAd/Yk7uup2R7mCp5ivAh6Dr7HBY7I=";
59
-
};
60
61
nativeBuildInputs =
62
[
···
85
libpng
86
]
87
++ lib.optionals stdenv.hostPlatform.isLinux [
88
-
libX11
89
-
libXrandr
90
-
libXinerama
91
-
libXcursor
92
-
libXi
93
-
libXext
94
libpulseaudio
95
zenity
0
0
0
0
96
];
97
98
cmakeFlags = [
0
99
(lib.cmakeBool "NON_PORTABLE" true)
100
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/lib")
0
0
0
0
0
101
];
102
103
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-int-conversion -Wno-implicit-int";
···
107
# Linking fails without this
108
hardeningDisable = [ "format" ];
109
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
110
postBuild = ''
111
-
cp ${finalAttrs.gamecontrollerdb} ${finalAttrs.gamecontrollerdb.name}
0
112
pushd ../OTRExporter
113
python3 ./extract_assets.py -z ../build/ZAPD/ZAPD.out --norom --xml-root ../soh/assets/xml --custom-assets-path ../soh/assets/custom --custom-otr-file soh.otr --port-ver ${finalAttrs.version}
114
popd
115
'';
116
117
-
preInstall =
118
-
lib.optionalString stdenv.hostPlatform.isLinux ''
119
-
# Cmake likes it here for its install paths
120
-
cp ../OTRExporter/soh.otr ..
121
-
''
122
-
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
123
-
cp ../OTRExporter/soh.otr soh/soh.otr
124
-
'';
125
126
postInstall =
127
lib.optionalString stdenv.hostPlatform.isLinux ''
···
10
copyDesktopItems,
11
makeDesktopItem,
12
python3,
0
0
0
0
0
0
13
glew,
14
boost,
15
SDL2,
···
22
makeWrapper,
23
darwin,
24
libicns,
25
+
libzip,
26
+
nlohmann_json,
27
+
tinyxml-2,
28
+
spdlog,
29
+
writeTextFile,
30
+
shipwright,
31
}:
32
+
33
+
let
34
+
35
+
# The following would normally get fetched at build time, or a specific version is required
36
+
37
+
gamecontrollerdb = fetchFromGitHub {
38
+
owner = "mdqinc";
39
+
repo = "SDL_GameControllerDB";
40
+
rev = "a74711e1e87733ccdf02d7020d8fa9e4fa67176e";
41
+
hash = "sha256-rXC4akz9BaKzr/C2CryZC6RGk6+fGVG7RsQryUFUUk0=";
42
+
};
43
+
44
+
imgui' = fetchFromGitHub {
45
+
owner = "ocornut";
46
+
repo = "imgui";
47
+
tag = "v1.91.6-docking";
48
+
hash = "sha256-28wyzzwXE02W5vbEdRCw2iOF8ONkb3M3Al8XlYBvz1A=";
49
+
};
50
+
51
+
libgfxd = fetchFromGitHub {
52
+
owner = "glankk";
53
+
repo = "libgfxd";
54
+
rev = "008f73dca8ebc9151b205959b17773a19c5bd0da";
55
+
hash = "sha256-AmHAa3/cQdh7KAMFOtz5TQpcM6FqO9SppmDpKPTjTt8=";
56
+
};
57
+
58
+
prism = fetchFromGitHub {
59
+
owner = "KiritoDv";
60
+
repo = "prism-processor";
61
+
rev = "fb3f8b4a2d14dfcbae654d0f0e59a73b6f6ca850";
62
+
hash = "sha256-gGdQSpX/TgCNZ0uyIDdnazgVHpAQhl30e+V0aVvTFMM=";
63
+
};
64
+
65
+
stb_impl = writeTextFile {
66
+
name = "stb_impl.c";
67
+
text = ''
68
+
#define STB_IMAGE_IMPLEMENTATION
69
+
#include "stb_image.h"
70
+
'';
71
+
};
72
+
73
+
stb' = fetchurl {
74
+
name = "stb_image.h";
75
+
url = "https://raw.githubusercontent.com/nothings/stb/0bc88af4de5fb022db643c2d8e549a0927749354/stb_image.h";
76
+
hash = "sha256-xUsVponmofMsdeLsI6+kQuPg436JS3PBl00IZ5sg3Vw=";
77
+
};
78
+
79
+
stormlib' = fetchFromGitHub {
80
+
owner = "ladislav-zezula";
81
+
repo = "StormLib";
82
+
tag = "v9.25";
83
+
hash = "sha256-HTi2FKzKCbRaP13XERUmHkJgw8IfKaRJvsK3+YxFFdc=";
84
+
};
85
+
86
+
thread_pool = fetchFromGitHub {
87
+
owner = "bshoshany";
88
+
repo = "thread-pool";
89
+
rev = "v4.1.0";
90
+
hash = "sha256-zhRFEmPYNFLqQCfvdAaG5VBNle9Qm8FepIIIrT9sh88=";
91
+
};
92
+
in
93
stdenv.mkDerivation (finalAttrs: {
94
pname = "shipwright";
95
+
version = "9.0.2";
96
97
src = fetchFromGitHub {
98
owner = "harbourmasters";
99
repo = "shipwright";
100
tag = finalAttrs.version;
101
+
hash = "sha256-xmRUUMjQt3CFJ0GxlUsUqmp//XTRWik3jSD4auql7Nk=";
102
fetchSubmodules = true;
103
};
104
105
patches = [
106
./darwin-fixes.patch
107
+
./disable-downloading-stb_image.patch
0
0
0
0
108
];
0
0
0
0
0
0
0
0
109
110
nativeBuildInputs =
111
[
···
134
libpng
135
]
136
++ lib.optionals stdenv.hostPlatform.isLinux [
0
0
0
0
0
0
137
libpulseaudio
138
zenity
139
+
libzip
140
+
nlohmann_json
141
+
tinyxml-2
142
+
spdlog
143
];
144
145
cmakeFlags = [
146
+
(lib.cmakeBool "BUILD_REMOTE_CONTROL" true)
147
(lib.cmakeBool "NON_PORTABLE" true)
148
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/lib")
149
+
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_IMGUI" "/build/source/build/_deps/imgui-src")
150
+
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_LIBGFXD" "${libgfxd}")
151
+
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_PRISM" "${prism}")
152
+
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_STORMLIB" "/build/source/build/_deps/stormlib-src")
153
+
(lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_THREADPOOL" "${thread_pool}")
154
];
155
156
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-int-conversion -Wno-implicit-int";
···
160
# Linking fails without this
161
hardeningDisable = [ "format" ];
162
163
+
preConfigure = ''
164
+
mkdir stb
165
+
cp ${stb'} ./stb/${stb'.name}
166
+
cp ${stb_impl} ./stb/${stb_impl.name}
167
+
substituteInPlace libultraship/cmake/dependencies/common.cmake \
168
+
--replace-fail "\''${STB_DIR}" "/build/source/stb"
169
+
'';
170
+
171
+
postPatch = ''
172
+
# use the soh patched deps when building
173
+
174
+
mkdir -p ./build/_deps/imgui-src
175
+
cp -R --no-preserve=mode,ownership ${imgui'}/* ./build/_deps/imgui-src
176
+
pushd ./build/_deps/imgui-src
177
+
patch -p1 < ${shipwright.src}/libultraship/cmake/dependencies/patches/imgui-fixes-and-config.patch
178
+
popd
179
+
180
+
mkdir -p ./build/_deps/stormlib-src
181
+
cp -R --no-preserve=mode,ownership ${stormlib'}/* ./build/_deps/stormlib-src
182
+
pushd ./build/_deps/stormlib-src
183
+
patch -p1 < ${shipwright.src}/libultraship/cmake/dependencies/patches/stormlib-optimizations.patch
184
+
popd
185
+
186
+
'';
187
+
188
postBuild = ''
189
+
cp ${gamecontrollerdb}/gamecontrollerdb.txt gamecontrollerdb.txt
190
+
mv ../libultraship/src/graphic/Fast3D/shaders ../soh/assets/custom
191
pushd ../OTRExporter
192
python3 ./extract_assets.py -z ../build/ZAPD/ZAPD.out --norom --xml-root ../soh/assets/xml --custom-assets-path ../soh/assets/custom --custom-otr-file soh.otr --port-ver ${finalAttrs.version}
193
popd
194
'';
195
196
+
preInstall = ''
197
+
# Cmake likes it here for its install paths
198
+
cp ../OTRExporter/soh.otr soh/soh.otr
199
+
'';
0
0
0
0
200
201
postInstall =
202
lib.optionalString stdenv.hostPlatform.isLinux ''