Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpack: fix gcc-14 and add Debian patches #369796

Merged
merged 1 commit into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
mpack: fix gcc-14 and add Debian patches
  • Loading branch information
paparodeo committed Dec 31, 2024
commit 78cc36af16f536b3532f527ed564ad05b6c4a0a6
23 changes: 0 additions & 23 deletions pkgs/by-name/mp/mpack/CVE-2011-4919.patch

This file was deleted.

29 changes: 0 additions & 29 deletions pkgs/by-name/mp/mpack/build-fix.patch

This file was deleted.

69 changes: 56 additions & 13 deletions pkgs/by-name/mp/mpack/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
lib,
stdenv,
fetchurl,
fetchpatch,
autoreconfHook,
testers,
mpack,
}:
Expand All @@ -15,23 +17,64 @@ stdenv.mkDerivation rec {
hash = "sha256-J0EIuzo5mCpO/BT7OmUpjmbI5xNnw9q/STOBYtIHqUw=";
};

patches = [
./build-fix.patch
./sendmail-via-execvp.diff
./CVE-2011-4919.patch
];
patches =
let
# https://salsa.debian.org/debian/mpack/-/tree/7d6514b314a7341614ec8275b03acfcb6a854a6f/debian/patches
fetchDebPatch =
{ name, hash }:
fetchpatch {
inherit name hash;
url = "https://salsa.debian.org/debian/mpack/-/raw/7d6514b314a7341614ec8275b03acfcb6a854a6f/debian/patches/${name}";
};
in
[
./sendmail-via-execvp.diff
]
++ (map fetchDebPatch [
{
name = "01_legacy.patch";
hash = "sha256-v2pZUXecgxJqoHadBhpAAoferQNSeYE+m7qzEiggeO4=";
}
{
name = "02_fix-permissions.patch";
hash = "sha256-sltnIqgv7+pwwSFQRCDeCwnjoo2OrvmGFm+SM9U/HB4=";
}
{
name = "03_specify-filename-replacement-character.patch";
hash = "sha256-vmLIGFSqKK/qSsltzhdLQGoekew3r25EwAu56umeXlU=";
}
{
name = "04_fix-return-error-code.patch";
hash = "sha256-l23D6xhkgtkEsErzUy/q6U3aPf5N7YUw2PEToU1YXKI=";
}
{
name = "06_fix-makefile.patch";
hash = "sha256-69plDqy2sLzO1O4mqjJIlTRCw5ZeVySiqwo93ZkX3Ho=";
}
{
name = "07_fix-decode-base64-attachment.patch";
hash = "sha256-hzSCrEg0j6dJNLbfwRNn+rWGRnyUBLjJUlORJS9aDD4=";
}
{
name = "08_fix-mime-version.patch";
hash = "sha256-l2rBqbyKmnz5tEPeuX6HCqw7rSV8pDb7ijpCHsdh57g=";
}
{
name = "09_remove-debugging-message.patch";
hash = "sha256-dtq6BHgH4ciho0+TNW/rU3KWoeKs/1jwJafnHTr9ebI=";
}
]);

postPatch = ''
for f in *.{c,man,pl,unix} ; do
substituteInPlace $f --replace /usr/tmp /tmp
done

# this just shuts up some warnings
for f in {decode,encode,part,unixos,unixpk,unixunpk,xmalloc}.c ; do
sed -i 'i#include <stdlib.h>' $f
done
substituteInPlace *.{c,man,pl,unix} --replace-quiet /usr/tmp /tmp

# silence a buffer overflow warning
substituteInPlace uudecode.c \
--replace-fail "char buf[1024], buf2[1024];" "char buf[1024], buf2[1066];"
'';

nativeBuildInputs = [ autoreconfHook ];

postInstall = ''
install -Dm644 -t $out/share/doc/mpack INSTALL README.*
'';
Expand Down
Loading