shipwright: 8.0.6 -> 9.0.2

qubitnano 09db531e 13681c0f

+147 -56
+20 -20
pkgs/by-name/sh/shipwright/darwin-fixes.patch
··· 1 1 diff --git a/CMakeLists.txt b/CMakeLists.txt 2 - index 2c8644af..157758c9 100644 2 + index 2771ee8c..0702adad 100644 3 3 --- a/CMakeLists.txt 4 4 +++ b/CMakeLists.txt 5 - @@ -166,17 +166,13 @@ endif() 5 + @@ -250,17 +250,13 @@ endif() 6 6 if(CMAKE_SYSTEM_NAME MATCHES "Darwin") 7 7 add_custom_target(CreateOSXIcons 8 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 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 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 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 26 + COMMAND png2icns ${CMAKE_BINARY_DIR}/macosx/soh.icns ${CMAKE_BINARY_DIR}/macosx/soh.iconset/icon_{16,32,64,128,256,512}.png 27 27 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 28 28 COMMENT "Creating OSX icons ..." 29 29 ) 30 - @@ -201,7 +197,6 @@ install(DIRECTORY ${CMAKE_BINARY_DIR}/assets 30 + @@ -288,7 +284,6 @@ INSTALL(CODE "FILE(RENAME \${CMAKE_INSTALL_PREFIX}/../MacOS/soh-macos \${CMAKE_I 31 31 32 32 install(CODE " 33 33 include(BundleUtilities) 34 - - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/soh-macos\" \"\" \"${dirs}\") 34 + - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/../MacOS/soh\" \"\" \"${dirs}\") 35 35 ") 36 36 37 37 endif()
+16
pkgs/by-name/sh/shipwright/disable-downloading-stb_image.patch
··· 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 10 copyDesktopItems, 11 11 makeDesktopItem, 12 12 python3, 13 - libX11, 14 - libXrandr, 15 - libXinerama, 16 - libXcursor, 17 - libXi, 18 - libXext, 19 13 glew, 20 14 boost, 21 15 SDL2, ··· 28 22 makeWrapper, 29 23 darwin, 30 24 libicns, 25 + libzip, 26 + nlohmann_json, 27 + tinyxml-2, 28 + spdlog, 29 + writeTextFile, 30 + shipwright, 31 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 32 93 stdenv.mkDerivation (finalAttrs: { 33 94 pname = "shipwright"; 34 - version = "8.0.6"; 95 + version = "9.0.2"; 35 96 36 97 src = fetchFromGitHub { 37 98 owner = "harbourmasters"; 38 99 repo = "shipwright"; 39 100 tag = finalAttrs.version; 40 - hash = "sha256-bA+Bm7M6udeZLpFhGa8fCtagfYBeRxWWqFuAj62XwGQ="; 101 + hash = "sha256-xmRUUMjQt3CFJ0GxlUsUqmp//XTRWik3jSD4auql7Nk="; 41 102 fetchSubmodules = true; 42 103 }; 43 104 44 105 patches = [ 45 106 ./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 - }) 107 + ./disable-downloading-stb_image.patch 51 108 ]; 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 109 61 110 nativeBuildInputs = 62 111 [ ··· 85 134 libpng 86 135 ] 87 136 ++ lib.optionals stdenv.hostPlatform.isLinux [ 88 - libX11 89 - libXrandr 90 - libXinerama 91 - libXcursor 92 - libXi 93 - libXext 94 137 libpulseaudio 95 138 zenity 139 + libzip 140 + nlohmann_json 141 + tinyxml-2 142 + spdlog 96 143 ]; 97 144 98 145 cmakeFlags = [ 146 + (lib.cmakeBool "BUILD_REMOTE_CONTROL" true) 99 147 (lib.cmakeBool "NON_PORTABLE" true) 100 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}") 101 154 ]; 102 155 103 156 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-int-conversion -Wno-implicit-int"; ··· 107 160 # Linking fails without this 108 161 hardeningDisable = [ "format" ]; 109 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 + 110 188 postBuild = '' 111 - cp ${finalAttrs.gamecontrollerdb} ${finalAttrs.gamecontrollerdb.name} 189 + cp ${gamecontrollerdb}/gamecontrollerdb.txt gamecontrollerdb.txt 190 + mv ../libultraship/src/graphic/Fast3D/shaders ../soh/assets/custom 112 191 pushd ../OTRExporter 113 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} 114 193 popd 115 194 ''; 116 195 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 - ''; 196 + preInstall = '' 197 + # Cmake likes it here for its install paths 198 + cp ../OTRExporter/soh.otr soh/soh.otr 199 + ''; 125 200 126 201 postInstall = 127 202 lib.optionalString stdenv.hostPlatform.isLinux ''