qemacs: 0.3.3 -> 5.4.1c (#209418)

* qemacs: fix cross-compilation

Also adds enableX11 parameter.

* qemacs: 0.3.3 -> 5.4.1c

---------

Co-authored-by: Artturi <Artturin@artturin.com>
This commit is contained in:
Adam Joseph 2023-02-22 13:21:54 +00:00 committed by GitHub
parent de9d483a2e
commit fb3a27fade
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,15 +1,46 @@
{ fetchurl, lib, stdenv, libX11, libXext, libXv, libpng }:
{ lib
, stdenv
, fetchFromGitHub
, buildPackages
, which
, texi2html
, enableX11 ? true
, libX11, libXext, libXv, libpng
}:
stdenv.mkDerivation rec {
pname = "qemacs";
version = "0.3.3";
version = "5.4.1c";
src = fetchurl {
url = "https://bellard.org/${pname}/${pname}-${version}.tar.gz";
sha256 = "156z4wpj49i6j388yjird5qvrph7hz0grb4r44l4jf3q8imadyrg";
src = fetchFromGitHub {
owner = "qemacs";
repo = "qemacs";
rev = "216b3ff8b77ff138aec22045522d5601b7390e58";
hash = "sha256-ngVaZZdr/Ym9YswLqzUtDytC0K7L9mKgORopLghGH3k=";
};
buildInputs = [ libpng libX11 libXext libXv ];
postPatch = ''
substituteInPlace Makefile --replace \
'$(INSTALL) -m 755 -s' \
'$(INSTALL) -m 755 -s --strip-program=${stdenv.cc.targetPrefix}strip'
'';
nativeBuildInputs = [ which texi2html ];
buildInputs = lib.optionals enableX11 [ libpng libX11 libXext libXv ];
enableParallelBuilding = true;
configureFlags = [
"--cross-prefix=${stdenv.cc.targetPrefix}"
] ++ lib.optionals (!enableX11) [
"--disable-x11"
];
makeFlags = [
# is actually used as BUILD_CC
"HOST_CC=${buildPackages.stdenv.cc}/bin/cc"
"CC=${stdenv.cc.targetPrefix}cc"
];
preInstall = ''
mkdir -p $out/bin $out/man