diff --git a/pkgs/games/qqwing/default.nix b/pkgs/games/qqwing/default.nix index 39f1d43fb46e..8fa696de889f 100644 --- a/pkgs/games/qqwing/default.nix +++ b/pkgs/games/qqwing/default.nix @@ -1,4 +1,12 @@ -{ lib, stdenv, fetchFromGitHub, perl, autoconf, automake, libtool }: +{ + lib, + stdenv, + fetchFromGitHub, + perl, + autoconf, + automake, + libtool, +}: stdenv.mkDerivation rec { pname = "qqwing"; @@ -7,31 +15,42 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { owner = "stephenostermiller"; repo = "qqwing"; - rev = "v${version}"; - sha256 = "1qq0vi4ch4y3a5fb1ncr0yzkj3mbvdiwa3d51qpabq94sh0cz09i"; + rev = "refs/tags/v${version}"; + hash = "sha256-MYHPANQk4aUuDqUNxWPbqw45vweZ2bBcUcMTyEjcAOM="; }; + strictDeps = true; + + nativeBuildInputs = [ + autoconf + automake + libtool + perl + ]; + + configureFlags = [ + "--prefix=${placeholder "out"}" + ]; + + buildFlags = [ + "cppcompile" + ]; + postPatch = '' - for file in "src-first-comment.pl" "src_neaten.pl"; do - substituteInPlace "build/$file" \ - --replace "#!/usr/bin/perl" "#!${perl}/bin/perl" - done + patchShebangs --build build/src-first-comment.pl build/src_neaten.pl - substituteInPlace "build/cpp_install.sh" \ - --replace "sudo " "" + substituteInPlace build/cpp_configure.sh \ + --replace-fail "./configure" "./configure $configureFlags" + substituteInPlace build/cpp_install.sh \ + --replace-fail "sudo " "" ''; - nativeBuildInputs = [ autoconf automake ]; - buildInputs = [ perl libtool ]; - - makeFlags = [ "prefix=$(out)" "tgz" ]; - - meta = with lib; { + meta = { homepage = "https://qqwing.com"; description = "Sudoku generating and solving software"; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ nickcao ]; mainProgram = "qqwing"; - license = licenses.gpl2Plus; - platforms = platforms.unix; - maintainers = [ ]; }; }