diff --git a/pkgs/applications/science/misc/golly/default.nix b/pkgs/applications/science/misc/golly/default.nix index 724a1008c1fb..7d91c76579f9 100644 --- a/pkgs/applications/science/misc/golly/default.nix +++ b/pkgs/applications/science/misc/golly/default.nix @@ -1,31 +1,47 @@ -{lib, stdenv, fetchurl, wxGTK, perl, python2, zlib, libGLU, libGL, libX11}: +{lib, stdenv, fetchurl, wxGTK, perl, python3, zlib, libGLU, libGL, libX11, SDL2}: stdenv.mkDerivation rec { pname = "golly"; - version = "3.3"; + version = "4.1"; src = fetchurl { - sha256 = "1j3ksnar4rdam4xiyspgyrs1pifbvxfxkrn65brkwxpx39mpgzc8"; + sha256 = "1j30dpzy6wh8fv1j2750hzc6wb0nhk83knl9fapccxgxw9n5lrbc"; url="mirror://sourceforge/project/golly/golly/golly-${version}/golly-${version}-src.tar.gz"; }; buildInputs = [ - wxGTK perl python2 zlib libGLU libGL libX11 + wxGTK perl python3 zlib libGLU libGL libX11 SDL2 ]; setSourceRoot = '' - sourceRoot=$(echo */gui-wx/configure) + sourceRoot=$(echo */gui-wx/) + ''; + + postPatch = '' + sed -e '/gollydir =/agollydir += "/../share/golly/";' -i wxgolly.cpp + grep share/golly wxgolly.cpp + + sed -e 's@PYTHON_SHLIB@${python3}/lib/libpython3.so@' -i wxprefs.cpp + sed -e 's@PERL_SHLIB@'"$(find "${perl}/lib/" -name libperl.so)"'@' -i wxprefs.cpp + ! grep _SHLIB *.cpp + + grep /lib/libpython wxprefs.cpp + grep /libperl wxprefs.cpp ''; - # Link against Python explicitly as it is needed for scripts makeFlags=[ - "AM_LDFLAGS=" + "-f" "makefile-gtk" + "ENABLE_SOUND=1" "ENABLE_PERL=1" ]; - NIX_LDFLAGS="-l${python2.libPrefix} -lperl"; - preConfigure='' - export NIX_LDFLAGS="$NIX_LDFLAGS -L$(dirname "$(find ${perl} -name libperl.so)")" - export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE - -DPYTHON_SHLIB=$(basename "$( - readlink -f ${python2}/lib/libpython*.so)")" + + installPhase = '' + mkdir -p "$out/bin" + cp ../golly ../bgolly "$out/bin" + + mkdir -p "$out/share/doc/golly/" + cp ../docs/* "$out/share/doc/golly/" + + mkdir -p "$out/share/golly" + cp -r ../{Help,Patterns,Scripts,Rules} "$out/share/golly" ''; meta = { diff --git a/pkgs/build-support/upstream-updater/update-walker-service-specific.sh b/pkgs/build-support/upstream-updater/update-walker-service-specific.sh index fe439c5d11e3..d92d223845e6 100644 --- a/pkgs/build-support/upstream-updater/update-walker-service-specific.sh +++ b/pkgs/build-support/upstream-updater/update-walker-service-specific.sh @@ -1,5 +1,5 @@ SF_redirect () { - redirect + redirect 99 process 'http://[a-z]+[.]dl[.]sourceforge[.]net/' 'mirror://sourceforge/' process '[?].*' '' } diff --git a/pkgs/build-support/upstream-updater/update-walker.sh b/pkgs/build-support/upstream-updater/update-walker.sh index e60499b60f27..9172a41718c8 100755 --- a/pkgs/build-support/upstream-updater/update-walker.sh +++ b/pkgs/build-support/upstream-updater/update-walker.sh @@ -69,8 +69,8 @@ version_link () { redirect () { CURRENT_URL="$(curl -I -L --max-redirs "${1:-99}" "$CURRENT_URL" | - grep -E '^Location: ' | position_choice "${2:-999999}" "$3" | - sed -e 's/^Location: //; s/\r//')" + grep -E '^[Ll]ocation: ' | position_choice "${2:-999999}" "$3" | + sed -e 's/^[Ll]ocation: //; s/\r//')" echo "Redirected: $*" echo "URL: $CURRENT_URL" >&2 }