12 gccStdenv.mkDerivation (finalAttrs: {
14 version = "0-unstable-2024-02-23";
16 src = fetchFromGitHub {
19 rev = "a0bfb468d42be831b126632fd8a0ae6b3614f981";
20 hash = "sha256-Cz4jK2jJMzz57/RcEzjIjD611vCy7l3xQ0pQZjneTFQ=";
24 # Fix compilation on Darwin
25 # Remove when https://github.com/gildor2/UEViewer/pull/319 merged
27 name = "0001-ueviewer-Dont-use-c++2a-standard.patch";
28 url = "https://github.com/gildor2/UEViewer/commit/d44bef038abca99c84d7f418aedcbcb761de58aa.patch";
29 hash = "sha256-v68yoBLz0dUB3evlKApKuajKQiOwbJczVeW5oxYaVyw=";
34 patchShebangs build.sh Unreal/Shaders/make.pl Tools/genmake
36 # Enable more verbose build output
37 # Unify -j arguments on make calls
38 # Show what's being run
39 substituteInPlace build.sh \
40 --replace-fail '# echo ">> Debug: $*"' ' echo ">> Debug: $*"' \
41 --replace-fail 'make -j 4 -f $makefile' 'make -f $makefile' \
42 --replace-fail 'make -f $makefile' "make ''${enableParallelBuilding:+-j''${NIX_BUILD_CORES}} -f \$makefile SHELL='sh -x'"
44 # - Use correct compiler from stdenv
45 # - Use C++ compiler instead of relying on leniency
46 # -pipe breaks GCC on Darwin: clang-16: error: no input files
47 substituteInPlace Tools/genmake \
48 --replace-fail 'my $platf = "gcc";' "my \$platf = \"$CXX\";" \
49 --replace-fail '-pipe' ""
61 ] ++ lib.optionals (!gccStdenv.hostPlatform.isDarwin) [
65 enableParallelBuilding = true;
78 install -Dm755 umodel $out/bin/umodel
83 passthru.updateScript = unstableGitUpdater {
84 # Tags represent various milestones, nothing that can be mapped to a numerical version number
85 hardcodeZeroVersion = true;
89 description = "Viewer and exporter for Unreal Engine 1-4 assets (aka umodel)";
90 homepage = "https://www.gildor.org/en/projects/umodel";
91 license = licenses.mit;
92 mainProgram = "umodel";
93 maintainers = with maintainers; [ OPNA2608 ];
94 # Hardcoded usage of SSE2
95 platforms = platforms.x86;