qqwing: fix cross compilation and pkgconfig generation

This commit is contained in:
Nick Cao 2024-08-25 11:05:11 -04:00
parent fc648a887e
commit 948c196ec7
No known key found for this signature in database

View File

@ -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 = [ ];
};
}