golly: fix build on darwin (#409514)

authored by Ben Siraphob and committed by GitHub f78a20aa 20752397

+33 -12
+33 -12
pkgs/applications/science/misc/golly/default.nix
··· 11 libX11, 12 SDL2, 13 }: 14 - stdenv.mkDerivation rec { 15 pname = "golly"; 16 version = "4.3"; 17 18 src = fetchurl { 19 hash = "sha256-UdJHgGPn7FDN4rYTgfPBAoYE5FGC43TP8OFBmYIqCB0="; 20 - url = "mirror://sourceforge/project/golly/golly/golly-${version}/golly-${version}-src.tar.gz"; 21 }; 22 23 buildInputs = [ ··· 35 wrapGAppsHook3 36 ]; 37 38 setSourceRoot = '' 39 sourceRoot=$(echo */gui-wx) 40 ''; 41 42 - postPatch = '' 43 - sed -e 's@PYTHON_SHLIB@${python3}/lib/libpython3.so@' -i wxprefs.cpp 44 - ! grep _SHLIB *.cpp 45 - 46 - grep /lib/libpython wxprefs.cpp 47 - ''; 48 49 makeFlags = [ 50 "-f" 51 "makefile-gtk" 52 "ENABLE_SOUND=1" 53 "GOLLYDIR=${placeholder "out"}/share/golly" 54 ]; 55 56 installPhase = '' 57 mkdir -p "$out/bin" 58 cp ../golly ../bgolly "$out/bin" 59 ··· 62 63 mkdir -p "$out/share/golly" 64 cp -r ../{Help,Patterns,Scripts,Rules} "$out/share/golly" 65 ''; 66 67 meta = { 68 description = "Cellular automata simulation program"; 69 - license = lib.licenses.gpl2; 70 - maintainers = [ lib.maintainers.raskin ]; 71 - platforms = lib.platforms.linux; 72 downloadPage = "https://sourceforge.net/projects/golly/files/golly"; 73 }; 74 - }
··· 11 libX11, 12 SDL2, 13 }: 14 + stdenv.mkDerivation (finalAttrs: { 15 pname = "golly"; 16 version = "4.3"; 17 18 src = fetchurl { 19 hash = "sha256-UdJHgGPn7FDN4rYTgfPBAoYE5FGC43TP8OFBmYIqCB0="; 20 + url = "mirror://sourceforge/project/golly/golly/golly-${finalAttrs.version}/golly-${finalAttrs.version}-src.tar.gz"; 21 }; 22 23 buildInputs = [ ··· 35 wrapGAppsHook3 36 ]; 37 38 + # fails nondeterministically on darwin 39 + enableParallelBuilding = false; 40 + 41 setSourceRoot = '' 42 sourceRoot=$(echo */gui-wx) 43 ''; 44 45 + postPatch = 46 + '' 47 + substituteInPlace wxprefs.cpp \ 48 + --replace-fail 'PYTHON_SHLIB' '${python3}/lib/libpython3.so' 49 + '' 50 + + lib.optionalString stdenv.hostPlatform.isDarwin '' 51 + substituteInPlace makefile-gtk \ 52 + --replace-fail '-Wl,--as-needed' "" \ 53 + --replace-fail '-lGL ' "" \ 54 + --replace-fail '-lGLU' "" 55 + ''; 56 57 makeFlags = [ 58 "-f" 59 "makefile-gtk" 60 "ENABLE_SOUND=1" 61 "GOLLYDIR=${placeholder "out"}/share/golly" 62 + "CC=${stdenv.cc.targetPrefix}cc" 63 + "CXX=${stdenv.cc.targetPrefix}c++" 64 + "CXXC=${stdenv.cc.targetPrefix}c++" 65 + "LD=${stdenv.cc.targetPrefix}c++" 66 + "WX_CONFIG=${lib.getExe' (lib.getDev wxGTK) "wx-config"}" 67 ]; 68 69 installPhase = '' 70 + runHook preInstall 71 + 72 mkdir -p "$out/bin" 73 cp ../golly ../bgolly "$out/bin" 74 ··· 77 78 mkdir -p "$out/share/golly" 79 cp -r ../{Help,Patterns,Scripts,Rules} "$out/share/golly" 80 + 81 + runHook postInstall 82 ''; 83 84 meta = { 85 description = "Cellular automata simulation program"; 86 + license = lib.licenses.gpl2Plus; 87 + maintainers = with lib.maintainers; [ 88 + raskin 89 + siraben 90 + ]; 91 + platforms = lib.platforms.unix; 92 + homepage = "https://golly.sourceforge.io/"; 93 downloadPage = "https://sourceforge.net/projects/golly/files/golly"; 94 }; 95 + })