uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,102 @@
{ stdenv
, lib
, fetchurl
# Only used for x86/x86_64
, uasm
, useUasm ? stdenv.hostPlatform.isx86
# RAR code is under non-free unRAR license
# see the meta.license section below for more details
, enableUnfree ? false
# For tests
, _7zz
, testers
}:
let
inherit (stdenv.hostPlatform) system;
platformSuffix = {
aarch64-linux = "_arm64";
i686-linux = "_x86";
x86_64-linux = "_x64";
}.${system} or
(builtins.trace "`platformSuffix` not available for `${system}.` Making a generic `7zz` build." "");
in
stdenv.mkDerivation rec {
pname = "7zz";
version = "21.07";
src = fetchurl {
url = "https://7-zip.org/a/7z${lib.replaceStrings [ "." ] [ "" ] version}-src.tar.xz";
sha256 = {
free = "sha256-SMM6kQ6AZ05s4miJjMoE4NnsXQ0tlkdWx0q2HKjhaM8=";
unfree = "sha256-IT1ZRAfLjvy6NmELFSykkh7aFBYzELQ5A9E+aDE+Hjk=";
}.${if enableUnfree then "unfree" else "free"};
downloadToTemp = (!enableUnfree);
# remove the unRAR related code from the src drv
# > the license requires that you agree to these use restrictions,
# > or you must remove the software (source and binary) from your hard disks
# https://fedoraproject.org/wiki/Licensing:Unrar
postFetch = lib.optionalString (!enableUnfree) ''
mkdir tmp
tar xf $downloadedFile -C ./tmp
rm -r ./tmp/CPP/7zip/Compress/Rar*
tar cfJ $out -C ./tmp . \
--sort=name \
--mtime="@$SOURCE_DATE_EPOCH" \
--owner=0 --group=0 --numeric-owner \
--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime
'';
};
sourceRoot = "CPP/7zip/Bundles/Alone2";
makeFlags =
[
"CC=${stdenv.cc.targetPrefix}cc"
"CXX=${stdenv.cc.targetPrefix}c++"
] ++
lib.optionals useUasm [ "MY_ASM=uasm" ] ++
# it's the compression code with the restriction, see DOC/License.txt
lib.optionals (!enableUnfree) [ "DISABLE_RAR_COMPRESS=true" ];
makefile = "../../cmpl_gcc${platformSuffix}.mak";
nativeBuildInputs = lib.optionals useUasm [ uasm ];
enableParallelBuilding = true;
installPhase = ''
runHook preInstall
install -Dm555 -t $out/bin b/g${platformSuffix}/7zz
install -Dm444 -t $out/share/doc/${pname} ../../../../DOC/*.txt
runHook postInstall
'';
passthru = {
updateScript = ./update.sh;
tests.version = testers.testVersion {
package = _7zz;
command = "7zz --help";
};
};
meta = with lib; {
description = "Command line archiver utility";
homepage = "https://7-zip.org";
license = with licenses;
# 7zip code is largely lgpl2Plus
# CPP/7zip/Compress/LzfseDecoder.cpp is bsd3
[ lgpl2Plus /* and */ bsd3 ] ++
# and CPP/7zip/Compress/Rar* are unfree with the unRAR license restriction
# the unRAR compression code is disabled by default
lib.optionals enableUnfree [ unfree ];
maintainers = with maintainers; [ anna328p peterhoeg jk ];
platforms = platforms.linux;
mainProgram = "7zz";
};
}

View file

@ -0,0 +1,50 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p coreutils gnused curl jq
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
DRV_DIR="$PWD"
OLD_VERSION="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./default.nix)"
NEW_VERSION="$(curl "https://sourceforge.net/projects/sevenzip/best_release.json" | jq '.platform_releases.linux.filename' -r | cut -d/ -f3)"
echo "comparing versions $OLD_VERSION => $NEW_VERSION"
if [[ "$OLD_VERSION" == "$NEW_VERSION" ]]; then
echo "Already up to date! Doing nothing"
exit 0
fi
NIXPKGS_ROOT="$(realpath "$DRV_DIR/../../../..")"
echo "getting free source hash"
OLD_FREE_HASH="$(nix-instantiate --eval --strict -E "with import $NIXPKGS_ROOT {}; _7zz.src.drvAttrs.outputHash" | tr -d '"')"
echo "getting unfree source hash"
OLD_UNFREE_HASH="$(nix-instantiate --eval --strict -E "with import $NIXPKGS_ROOT {}; (_7zz.override { enableUnfree = true; }).src.drvAttrs.outputHash" | tr -d '"')"
NEW_VERSION_FORMATTED="$(echo "$NEW_VERSION" | tr -d '.')"
URL="https://7-zip.org/a/7z${NEW_VERSION_FORMATTED}-src.tar.xz"
NEW_FREE_HASH=$(nix-prefetch -f "$NIXPKGS_ROOT" -E "_7zz.src" --url "$URL")
NEW_UNFREE_OUT=$(nix-prefetch -f "$NIXPKGS_ROOT" -E "(_7zz.override { enableUnfree = true; }).src" --url "$URL" --output raw --print-path)
# first line of raw output is the hash
NEW_UNFREE_HASH="$(echo "$NEW_UNFREE_OUT" | sed -n 1p)"
# second line of raw output is the src path
NEW_UNFREE_SRC="$(echo "$NEW_UNFREE_OUT" | sed -n 2p)"
# make sure to nuke the unfree src from the updater's machine
# > the license requires that you agree to these use restrictions, or you must remove the software (source and binary) from your hard disks
# https://fedoraproject.org/wiki/Licensing:Unrar
nix-store --delete "$NEW_UNFREE_SRC"
echo "updating version"
sed -i "s/version = \"$OLD_VERSION\";/version = \"$NEW_VERSION\";/" "$DRV_DIR/default.nix"
echo "updating free hash"
sed -i "s@free = \"$OLD_FREE_HASH\";@free = \"$NEW_FREE_HASH\";@" "$DRV_DIR/default.nix"
echo "updating unfree hash"
sed -i "s@unfree = \"$OLD_UNFREE_HASH\";@unfree = \"$NEW_UNFREE_HASH\";@" "$DRV_DIR/default.nix"
echo "done"

View file

@ -0,0 +1,45 @@
From 428c6e0eb604b63a67fda6af445c10c8ae3c1826 Mon Sep 17 00:00:00 2001
From: Philipp Gesang <phg@phi-gamma.net>
Date: Sun, 27 Jan 2019 21:37:13 +0100
Subject: [PATCH] makefile: fix installation
- comment hard-coded $(CC)
- avoid full paths during install
- set proper permissions
---
Makefile | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 9268c6f..0797579 100644
--- a/Makefile
+++ b/Makefile
@@ -76,7 +76,7 @@ MW=-Wformat -Werror=format-security -Wall
CFLAGS1 = -Wall -Wstrict-prototypes -s -O2 -fomit-frame-pointer -Wno-unused-result $(LARGEFILEFLAGS) $(MW)
-CC=gcc
+#CC=gcc
# also using contents of usin CPPFLAGS, CFLAGS, LDFLAGS out of environment
# variables, if they exist
@@ -94,9 +94,14 @@ clean:
rm -f regtest/statsize regtest/statsize64
cd regtest; /bin/sh regtest.clean
+ifndef DESTDIR
+install:
+ $(error Please specify install prefix as $$DESTDIR)
+else
install: afio
- cp afio /usr/local/bin
- cp afio.1 /usr/share/man/man1
+ install -Dm755 afio $(DESTDIR)/bin/afio
+ install -Dm644 afio.1 $(DESTDIR)/share/man/man1/afio.1
+endif
# generate default list of -E extensions from manpage
# note: on sun, I had to change awk command below to nawk or gawk
--
2.18.1

View file

@ -0,0 +1,33 @@
{ lib, stdenv, fetchFromGitHub } :
stdenv.mkDerivation rec {
version = "2.5.2";
pname = "afio";
src = fetchFromGitHub {
owner = "kholtman";
repo = "afio";
rev = "v${version}";
sha256 = "1vbxl66r5rp5a1qssjrkfsjqjjgld1cq57c871gd0m4qiq9rmcfy";
};
/*
* A patch to simplify the installation and for removing the
* hard coded dependency on GCC.
*/
patches = [ ./0001-makefile-fix-installation.patch ];
installFlags = [ "DESTDIR=$(out)" ];
meta = {
homepage = "https://github.com/kholtman/afio";
description = "Fault tolerant cpio archiver targeting backups";
platforms = lib.platforms.all;
/*
* Licensing is complicated due to the age of the code base, but
* generally free. See the file ``afio_license_issues_v5.txt`` for
* a comprehensive discussion.
*/
license = lib.licenses.free;
};
}

View file

@ -0,0 +1,55 @@
{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, boost, libpng, libiconv
, libjpeg, zlib, openssl, libwebp, catch2 }:
stdenv.mkDerivation rec {
pname = "arc_unpacker";
version = "unstable-2021-08-06";
src = fetchFromGitHub {
owner = "vn-tools";
repo = "arc_unpacker";
rev = "456834ecf2e5686813802c37efd829310485c57d";
hash = "sha256-STbdWH7Mr3gpOrZvujblYrIIKEWBHzy1/BaNuh4teI8=";
};
nativeBuildInputs = [ cmake makeWrapper catch2 ];
buildInputs = [ boost libpng libjpeg zlib openssl libwebp ]
++ lib.optionals stdenv.isDarwin [ libiconv ];
postPatch = ''
cp ${catch2}/include/catch2/catch.hpp tests/test_support/catch.h
'';
checkPhase = ''
runHook preCheck
pushd ..
./build/run_tests
popd
runHook postCheck
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/doc/arc_unpacker $out/libexec/arc_unpacker
cp arc_unpacker $out/libexec/arc_unpacker/arc_unpacker
cp ../GAMELIST.{htm,js} $out/share/doc/arc_unpacker
cp -r ../etc $out/libexec/arc_unpacker
makeWrapper $out/libexec/arc_unpacker/arc_unpacker $out/bin/arc_unpacker
runHook postInstall
'';
# A few tests fail on aarch64-linux
doCheck = !(stdenv.isLinux && stdenv.isAarch64);
meta = with lib; {
description = "A tool to extract files from visual novel archives";
homepage = "https://github.com/vn-tools/arc_unpacker";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ midchildan ];
platforms = platforms.all;
};
}

View file

@ -0,0 +1,155 @@
{stdenv, lib, fetchurl, fetchpatch, autoreconfHook}:
stdenv.mkDerivation rec {
pname = "arj";
version = "3.10.22";
src = fetchurl {
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
sha256 = "1nx7jqxwqkihhdmdbahhzqhjqshzw1jcsvwddmxrwrn8rjdlr7jq";
};
patches = [
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/001_arches_align.patch";
sha256 = "0i3qclm2mh98c04rqpx1r4qagd3wpxlkj7lvq0ddpkmr8bm0fh0m";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/002_no_remove_static_const.patch";
sha256 = "0zfjqmjsj0y1kfzxbp29v6nxq5qwgazhb9clqc544sm5zn0bdp8n";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/003_64_bit_clean.patch";
sha256 = "0mda9fkaqf2s1xl6vlbkbq20362h3is9dpml9kfmacpbifl4dx3n";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/004_parallel_build.patch";
sha256 = "0gam6k7jknzmbjlf1r6c9kjh5s5h76pd31v59cnaqiycwiy8z6q9";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/005_use_system_strnlen.patch";
sha256 = "0q0ypm8mdsxd0rl1k0id6fdx5m7mvqgwcla4r250cmc6zqzpib6d";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/006_use_safe_strcpy.patch";
sha256 = "1garad95s34cix3kd77lz37andrcnz19glzkfdnkjaq7ldvzwikc";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/hurd_no_fcntl_getlk.patch";
sha256 = "0b3hpn4qypimrw9ar2n4h24886sl6pmim4lb4ly1wqcq0f73arva";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/security_format.patch";
sha256 = "0q67cvln55p38bm0xwd2cgppqmkp2nfar2pg1zj78f7ncn35lbvf";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/doc_refer_robert_k_jung.patch";
sha256 = "1wxdx0m6a9vdvjlaycwsissn75l1ni7grg8n6qmkynz2vrcvgzb1";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/gnu_build_fix.patch";
sha256 = "19ycp1rak7l6ql28m50v95ls621w3sl8agw5r5va73svkgh8hc3g";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/gnu_build_flags.patch";
sha256 = "1jw1y9i9lw1idgi4l9cycwsql1hcz1m4f3k2iybwsgx0acaw695q";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/gnu_build_strip.patch";
sha256 = "1b18khj6cxnjyqk2ycygwqlcs20hrsbf4h6bckl99dxnpbq5blxi";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/gnu_build_pie.patch";
sha256 = "1jqswxgc1plipblf055n9175fbanfi6fb67lnzk8dcvxjn227fs3";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/self_integrity_64bit.patch";
sha256 = "0s5zdq81a0f83hdg9hy6lqn3xvckx9y9r20awczm9mbf11vi01cb";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/security-afl.patch";
sha256 = "0yajcwpghij8wg21a0kkp3f9x7anz5m121jx2vnkyn04bvi9541a";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/security-traversal-dir.patch";
sha256 = "10lv3867k0wm2s0cyf40hkxfqbjaxm4aph5ivk2q2rjkracrn2y4";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/security-traversal-symlink.patch";
sha256 = "095pdfskxwh0jnyy31dpz10s2ppv8n7lvvn4q722y3g71d0c79qq";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/out-of-bounds-read.patch";
sha256 = "0ps9lqkbqzlhzr2bnr47sir431z1nywr7nagkmk42iki4d96v0jq";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/remove_build_date.patch";
sha256 = "1vjlfq6firxpj068l9acyqs77mfydn1rwgr2jmxgsy9mq0fw1dsc";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/reproducible_help_archive.patch";
sha256 = "0l3qi9f140pwc6fk8qdbxx4g9d8zlf45asimmr8wfpbi4pf59n8i";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/gnu_build_cross.patch";
sha256 = "1vb0vbh3jbxj192q47vg3f41l343ghcz2ypbrrm2bkbpwm5cl8qr";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/fix-time_t-usage.patch";
sha256 = "012c6pnf5y4jwn715kxn3vjy088rm905959j6yh8bslyx84qaijv";
})
(fetchpatch {
url = "https://sources.debian.org/data/main/a/arj/3.10.22-24/debian/patches/gnu_build_fix_autoreconf.patch";
sha256 = "0yhxbdasnbqcg1nyx2379fpbr7fmdlv4n2nlxrv1z1vbc7rlvw9d";
})
];
nativeBuildInputs = [ autoreconfHook ];
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace environ.c \
--replace " #include <sys/statfs.h>" " #include <sys/mount.h>"
'';
preAutoreconf = ''
cd gnu
'';
postConfigure = ''
cd ..
'';
meta = with lib; {
description = "Open-source implementation of the world-famous ARJ archiver";
longDescription = ''
This version of ARJ has been created with an intent to preserve maximum
compatibility and retain the feature set of the original ARJ archiver as
provided by ARJ Software, Inc.
'';
license = licenses.gpl2Plus;
maintainers = [ maintainers.sander ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,21 @@
{lib, stdenv, fetchurl, perl, bash}:
stdenv.mkDerivation rec {
pname = "atool";
version = "0.39.0";
src = fetchurl {
url = "mirror://savannah/atool/atool-${version}.tar.gz";
sha256 = "aaf60095884abb872e25f8e919a8a63d0dabaeca46faeba87d12812d6efc703b";
};
buildInputs = [ perl ];
configureScript = "${bash}/bin/bash configure";
meta = {
homepage = "https://www.nongnu.org/atool";
description = "Archive command line helper";
platforms = lib.platforms.unix;
license = lib.licenses.gpl3;
};
}

View file

@ -0,0 +1,33 @@
{ lib, stdenv
, fetchFromGitHub
}:
stdenv.mkDerivation rec {
pname = "bomutils";
version = "0.2";
src = fetchFromGitHub {
owner = "hogliux";
repo = pname;
rev = version;
sha256 = "1i7nhbq1fcbrjwfg64znz8p4l7662f7qz2l6xcvwd5z93dnmgmdr";
};
makeFlags = [
"PREFIX=$(out)"
"CXX=${stdenv.cc.targetPrefix}c++"
];
# fix
# src/lsbom.cpp:70:10: error: reference to 'data' is ambiguous
# which refers to std::data from C++17
NIX_CFLAGS_COMPILE = [ "-std=c++14" ];
meta = with lib; {
homepage = "https://github.com/hogliux/bomutils";
description = "Open source tools to create bill-of-materials files used in macOS installers";
platforms = platforms.all;
license = licenses.gpl2Plus;
maintainers = with maintainers; [ prusnak ];
};
}

View file

@ -0,0 +1,25 @@
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "cabextract";
version = "1.9.1";
src = fetchurl {
url = "https://www.cabextract.org.uk/cabextract-${version}.tar.gz";
sha256 = "19qwhl2r8ip95q4vxzxg2kp4p125hjmc9762sns1dwwf7ikm7hmg";
};
# Let's assume that fnmatch works for cross-compilation, otherwise it gives an error:
# undefined reference to `rpl_fnmatch'.
configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"ac_cv_func_fnmatch_works=yes"
];
meta = with lib; {
homepage = "https://www.cabextract.org.uk/";
description = "Free Software for extracting Microsoft cabinet files";
platforms = platforms.all;
license = licenses.gpl3;
maintainers = with maintainers; [ pSub ];
};
}

View file

@ -0,0 +1,48 @@
{ lib, stdenv, fetchurl, fetchpatch }:
stdenv.mkDerivation rec {
pname = "cpio";
version = "2.13";
src = fetchurl {
url = "mirror://gnu/cpio/cpio-${version}.tar.bz2";
sha256 = "0vbgnhkawdllgnkdn6zn1f56fczwk0518krakz2qbwhxmv2vvdga";
};
patches = let
fp = suffix: rev: sha256: fetchpatch {
name = "CVE-2021-38185-${suffix}.patch";
url = "https://git.savannah.gnu.org/cgit/cpio.git/patch/?id=${rev}";
inherit sha256;
};
in [
(fp "1" "dd96882877721703e19272fe25034560b794061b"
"0vmr0qjwj2ldnzsvccl105ckwgx3ssvn9mp3f27ss0kiyigrzz32")
(fp "2" "dfc801c44a93bed7b3951905b188823d6a0432c8"
"1qkrhi3lbxk6hflp6w3h4sgssc0wblv8r0qgxqzbjrm36pqwxiwh")
(fp "3" "236684f6deb3178043fe72a8e2faca538fa2aae1"
"0pidkbxalpj5yz4fr95x8h0rizgjij0xgvjgirfkjk460giawwg6")
(fetchpatch {
# upstream build fix against -fno-common compilers like >=gcc-10
name = "fno-common-fix.patch";
url = "https://git.savannah.gnu.org/cgit/cpio.git/patch/?id=641d3f489cf6238bb916368d4ba0d9325a235afb";
sha256 = "1ffawzxjw72kzpdwffi2y7pvibrmwf4jzrxdq9f4a75q6crl66iq";
})
];
separateDebugInfo = true;
preConfigure = lib.optionalString stdenv.isCygwin ''
sed -i gnu/fpending.h -e 's,include <stdio_ext.h>,,'
'';
enableParallelBuilding = true;
meta = with lib; {
homepage = "https://www.gnu.org/software/cpio/";
description = "A program to create or extract from cpio archives";
license = licenses.gpl3;
platforms = platforms.all;
priority = 6; # resolves collision with gnutar's "libexec/rmt"
};
}

View file

@ -0,0 +1,32 @@
{ lib, stdenv, fetchurl, pkg-config, fuse, perl }:
stdenv.mkDerivation rec {
pname = "cromfs";
version = "1.5.10.2";
src = fetchurl {
url = "https://bisqwit.iki.fi/src/arch/cromfs-${version}.tar.bz2";
sha256 = "0xy2x1ws1qqfp7hfj6yzm80zhrxzmhn0w2yns77im1lmd2h18817";
};
postPatch = "patchShebangs configure";
installPhase = ''
install -d $out/bin
install cromfs-driver $out/bin
install util/cvcromfs $out/bin
install util/mkcromfs $out/bin
install util/unmkcromfs $out/bin
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [ fuse perl ];
meta = with lib; {
description = "FUSE Compressed ROM filesystem with lzma";
homepage = "https://bisqwit.iki.fi/source/cromfs.html";
license = licenses.gpl3;
maintainers = [ maintainers.viric ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,31 @@
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "ctrtool";
version = "0.7";
src = fetchFromGitHub {
owner = "jakcron";
repo = "Project_CTR";
rev = "ctrtool-v${version}";
sha256 = "07aayck82w5xcp3si35d7ghybmrbqw91fqqvmbpjrjcixc6m42z7";
};
sourceRoot = "source/ctrtool";
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "CXX=${stdenv.cc.targetPrefix}c++"];
enableParallelBuilding = true;
installPhase = "
mkdir $out/bin -p
cp ctrtool${stdenv.hostPlatform.extensions.executable} $out/bin/
";
meta = with lib; {
license = licenses.mit;
description = "A tool to extract data from a 3ds rom";
platforms = platforms.linux;
maintainers = [ maintainers.marius851000 ];
};
}

View file

@ -0,0 +1,44 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
, zlib, bzip2, lzo, lz4, zstd, xz
, libgcrypt, e2fsprogs, util-linux, libgpg-error }:
let
version = "0.8.6";
in stdenv.mkDerivation {
pname = "fsarchiver";
inherit version;
src = fetchFromGitHub {
owner = "fdupoux";
repo = "fsarchiver";
rev = version;
sha256 = "sha256-7AfCI4abcUijobEl6FO+5A/FRwxPkNko44u85WbTwuc=";
};
nativeBuildInputs = [
autoreconfHook pkg-config
];
buildInputs = [
zlib bzip2 xz lzo lz4 zstd xz
libgcrypt e2fsprogs util-linux libgpg-error
];
meta = with lib; {
description = "File system archiver for linux";
longDescription = ''
FSArchiver is a system tool that allows you to save the contents of a
file-system to a compressed archive file. The file-system can be restored
on a partition which has a different size and it can be restored on a
different file-system. Unlike tar/dar, FSArchiver also creates the
file-system when it extracts the data to partitions. Everything is
checksummed in the archive in order to protect the data. If the archive is
corrupt, you just loose the current file, not the whole archive.
'';
homepage = "https://www.fsarchiver.org/";
license = licenses.lgpl2;
maintainers = [ maintainers.etu ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,51 @@
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, fetchpatch
, pkg-config
, openssl
, testers
, gbl
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "gbl";
version = "0.3.1";
src = fetchFromGitHub {
owner = "dac-gmbh";
repo = pname;
rev = "v${version}";
sha256 = "sha256-Xzx14fvYWTZYM9Pnowf1M3D0PTPRLwsXHUj/PJskRWw=";
};
cargoPatches = [
# Upstream does not include Cargo.lock, even though this is recommended for applications.
# This patch adds it. https://github.com/dac-gmbh/gbl/pull/62
(fetchpatch {
url = "https://github.com/raboof/gbl/commit/99078da334c6e1ffd8189c691bbc711281fae5cc.patch";
sha256 = "sha256-sAKkn4//8P87ZJ6NTHm2NUJH1sAFFwfrybv2QtQ3nnM=";
})
];
cargoSha256 = "sha256-RUZ6wswRtV8chq3+bY9LTRf6IYMbZ9/GPl2X5UcF7d8=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
passthru.tests.version =
testers.testVersion { package = gbl; };
meta = with lib; {
description = "GBL Firmware file manipulation";
longDescription = ''
Utility to read, create and manipulate `.gbl` firmware update
files targeting the Silicon Labs Gecko Bootloader.
'';
homepage = "https://github.com/dac-gmbh/gbl";
license = licenses.mit;
maintainers = [ maintainers.raboof ];
};
}

View file

@ -0,0 +1,73 @@
{ lib, stdenv, fetchurl, autoreconfHook, acl }:
# Note: this package is used for bootstrapping fetchurl, and thus
# cannot use fetchpatch! All mutable patches (generated by GitHub or
# cgit) that are needed here should be included directly in Nixpkgs as
# files.
stdenv.mkDerivation rec {
pname = "gnutar";
version = "1.34";
src = fetchurl {
url = "mirror://gnu/tar/tar-${version}.tar.xz";
sha256 = "sha256-Y769JoecXh7qQ1Lw0DyZH5Zq6z3es8dEXJAlaNVBHSg=";
};
# avoid retaining reference to CF during stdenv bootstrap
configureFlags = lib.optionals stdenv.isDarwin [
"gt_cv_func_CFPreferencesCopyAppValue=no"
"gt_cv_func_CFLocaleCopyCurrent=no"
"gt_cv_func_CFLocaleCopyPreferredLanguages=no"
];
# gnutar tries to call into gettext between `fork` and `exec`,
# which is not safe on darwin.
# see http://article.gmane.org/gmane.os.macosx.fink.devel/21882
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace src/system.c --replace '_(' 'N_('
'';
outputs = [ "out" "info" ];
nativeBuildInputs = lib.optional stdenv.isDarwin autoreconfHook;
buildInputs = lib.optional stdenv.isLinux acl;
# May have some issues with root compilation because the bootstrap tool
# cannot be used as a login shell for now.
FORCE_UNSAFE_CONFIGURE = lib.optionalString (stdenv.hostPlatform.system == "armv7l-linux" || stdenv.isSunOS) "1";
preConfigure = if stdenv.isCygwin then ''
sed -i gnu/fpending.h -e 's,include <stdio_ext.h>,,'
'' else null;
doCheck = false; # fails
doInstallCheck = false; # fails
meta = {
description = "GNU implementation of the `tar' archiver";
longDescription = ''
The Tar program provides the ability to create tar archives, as
well as various other kinds of manipulation. For example, you
can use Tar on previously created archives to extract files, to
store additional files, or to update or list files which were
already stored.
Initially, tar archives were used to store files conveniently on
magnetic tape. The name "Tar" comes from this use; it stands
for tape archiver. Despite the utility's name, Tar can direct
its output to available devices, files, or other programs (using
pipes), it can even access remote devices or files (as
archives).
'';
homepage = "https://www.gnu.org/software/tar/";
license = lib.licenses.gpl3Plus;
maintainers = [ ];
mainProgram = "tar";
platforms = lib.platforms.all;
priority = 10;
};
}

View file

@ -0,0 +1,36 @@
{ lib, stdenv, fetchurl, cmake, makeWrapper
, boost, xz
, withGog ? false, unar ? null }:
stdenv.mkDerivation rec {
pname = "innoextract";
version = "1.9";
src = fetchurl {
url = "https://constexpr.org/innoextract/files/innoextract-${version}.tar.gz";
sha256 = "09l1z1nbl6ijqqwszdwch9mqr54qb7df0wp2sd77v17dq6gsci33";
};
buildInputs = [ xz boost ];
# Python is reported as missing during the build, however
# including Python does not change the output.
nativeBuildInputs = [ cmake makeWrapper ];
strictDeps = true;
# we need unar to for multi-archive extraction
postFixup = lib.optionalString withGog ''
wrapProgram $out/bin/innoextract \
--prefix PATH : ${lib.makeBinPath [ unar ]}
'';
meta = with lib; {
description = "A tool to unpack installers created by Inno Setup";
homepage = "https://constexpr.org/innoextract/";
license = licenses.zlib;
maintainers = with maintainers; [ abbradar ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,27 @@
{stdenv, lib, fetchFromGitHub, autoreconfHook}:
stdenv.mkDerivation {
pname = "lha";
version = "unstable-2021-01-07";
src = fetchFromGitHub {
owner = "jca02266";
repo = "lha";
rev = "03475355bc6311f7f816ea9a88fb34a0029d975b";
sha256 = "18w2x0g5yq89yxkxh1fmb05lz4hw7a3b4jmkk95gvh11mwbbr5lm";
};
nativeBuildInputs = [ autoreconfHook ];
meta = with lib; {
description = "LHa is an archiver and compressor using the LZSS and Huffman encoding compression algorithms";
platforms = platforms.unix;
maintainers = [ maintainers.sander ];
# Some of the original LhA code has been rewritten and the current author
# considers adopting a "true" free and open source license for it.
# However, old code is still covered by the original LHa license, which is
# not a free software license (it has additional requirements on commercial
# use).
license = licenses.unfree;
};
}

View file

@ -0,0 +1,26 @@
{ lib, stdenv, fetchFromGitHub, libuv, lz4, zlib }:
stdenv.mkDerivation rec {
pname = "maxcso";
version = "1.13.0";
src = fetchFromGitHub {
owner = "unknownbrackets";
repo = "maxcso";
rev = "v${version}";
sha256 = "sha256-6LjR1ZMZsi6toz9swPzNmSAlrUykwvVdYi1mR8Ctq5U=";
};
buildInputs = [ libuv lz4 zlib ];
makeFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
homepage = "https://github.com/unknownbrackets/maxcso";
description =
"A fast ISO to CSO compression program for use with PSP and PS2 emulators, which uses multiple algorithms for best compression ratio";
maintainers = with maintainers; [ david-sawatzke ];
platforms = platforms.linux ++ platforms.darwin;
license = licenses.isc;
};
}

View file

@ -0,0 +1,24 @@
{ lib, stdenv, fetchFromGitHub, autoconf, automake }:
stdenv.mkDerivation rec {
pname = "ndstool";
version = "2.1.2";
src = fetchFromGitHub {
owner = "devkitPro";
repo = "ndstool";
rev = "v${version}";
sha256 = "0isnm0is5k6dgi2n2c3mysyr5hpwikp5g0s3ix7ms928z04l8ccm";
};
nativeBuildInputs = [ autoconf automake ];
preConfigure = "./autogen.sh";
meta = {
homepage = "https://github.com/devkitPro/ndstool";
description = "A tool to unpack and repack nds rom";
maintainers = [ lib.maintainers.marius851000 ];
license = lib.licenses.gpl3;
};
}

View file

@ -0,0 +1,71 @@
{ stdenv, fetchFromGitHub, fetchpatch, lib, enableUnfree ? false }:
stdenv.mkDerivation rec {
pname = "p7zip";
version = "17.04";
src = fetchFromGitHub {
owner = "jinfeihan57";
repo = pname;
rev = "v${version}";
sha256 = {
free = "sha256-DrBuf2VPdcprHI6pMSmL7psm2ofOrUf0Oj0qwMjXzkk=";
unfree = "sha256-19F4hPV0nKVuFZNbOcXrcA1uW6Y3HQolaHVIYXGmh18=";
}.${if enableUnfree then "unfree" else "free"};
# remove the unRAR related code from the src drv
# > the license requires that you agree to these use restrictions,
# > or you must remove the software (source and binary) from your hard disks
# https://fedoraproject.org/wiki/Licensing:Unrar
postFetch = lib.optionalString (!enableUnfree) ''
rm -r $out/CPP/7zip/Compress/Rar*
find $out -name makefile'*' -exec sed -i '/Rar/d' {} +
'';
};
# Default makefile is full of impurities on Darwin. The patch doesn't hurt Linux so I'm leaving it unconditional
postPatch = ''
sed -i '/CC=\/usr/d' makefile.macosx_llvm_64bits
# Avoid writing timestamps into compressed manpages
# to maintain determinism.
substituteInPlace install.sh --replace 'gzip' 'gzip -n'
chmod +x install.sh
# I think this is a typo and should be CXX? Either way let's kill it
sed -i '/XX=\/usr/d' makefile.macosx_llvm_64bits
'' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
substituteInPlace makefile.machine \
--replace 'CC=gcc' 'CC=${stdenv.cc.targetPrefix}gcc' \
--replace 'CXX=g++' 'CXX=${stdenv.cc.targetPrefix}g++'
'';
makeFlags = [ "DEST_HOME=${placeholder "out"}" ];
preConfigure = ''
buildFlags=all3
'' + lib.optionalString stdenv.isDarwin ''
cp makefile.macosx_llvm_64bits makefile.machine
'';
enableParallelBuilding = true;
setupHook = ./setup-hook.sh;
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
passthru.updateScript = ./update.sh;
meta = with lib; {
homepage = "https://github.com/jinfeihan57/p7zip";
description = "A new p7zip fork with additional codecs and improvements (forked from https://sourceforge.net/projects/p7zip/)";
license = with licenses;
# p7zip code is largely lgpl2Plus
# CPP/7zip/Compress/LzfseDecoder.cpp is bsd3
[ lgpl2Plus /* and */ bsd3 ] ++
# and CPP/7zip/Compress/Rar* are unfree with the unRAR license restriction
# the unRAR compression code is disabled by default
lib.optionals enableUnfree [ unfree ];
maintainers = with maintainers; [ raskin jk ];
platforms = platforms.unix;
mainProgram = "7z";
};
}

View file

@ -0,0 +1,5 @@
unpackCmdHooks+=(_try7zip)
_try7zip() {
if ! [[ "$curSrc" =~ \.7z$ ]]; then return 1; fi
7z x "$curSrc"
}

View file

@ -0,0 +1,47 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p coreutils gnused curl jq
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
DRV_DIR="$PWD"
OLD_VERSION="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./default.nix)"
NEW_VERSION="$(curl https://api.github.com/repos/jinfeihan57/p7zip/releases/latest | jq .tag_name -r | tr -d 'v')"
echo "comparing versions $OLD_VERSION => $NEW_VERSION"
if [[ "$OLD_VERSION" == "$NEW_VERSION" ]]; then
echo "Already up to date! Doing nothing"
exit 0
fi
NIXPKGS_ROOT="$(realpath "$DRV_DIR/../../../..")"
echo "getting free source hash"
OLD_FREE_HASH="$(nix-instantiate --eval --strict -E "with import $NIXPKGS_ROOT {}; p7zip.src.drvAttrs.outputHash" | tr -d '"')"
echo "getting unfree source hash"
OLD_UNFREE_HASH="$(nix-instantiate --eval --strict -E "with import $NIXPKGS_ROOT {}; (p7zip.override { enableUnfree = true; }).src.drvAttrs.outputHash" | tr -d '"')"
NEW_FREE_HASH=$(nix-prefetch -f "$NIXPKGS_ROOT" -E "p7zip.src" --rev "v$NEW_VERSION")
NEW_UNFREE_OUT=$(nix-prefetch -f "$NIXPKGS_ROOT" -E "(p7zip.override { enableUnfree = true; }).src" --rev "v$NEW_VERSION" --output raw --print-path)
# first line of raw output is the hash
NEW_UNFREE_HASH="$(echo "$NEW_UNFREE_OUT" | sed -n 1p)"
# second line of raw output is the src path
NEW_UNFREE_SRC="$(echo "$NEW_UNFREE_OUT" | sed -n 2p)"
# make sure to nuke the unfree src from the updater's machine
# > the license requires that you agree to these use restrictions, or you must remove the software (source and binary) from your hard disks
# https://fedoraproject.org/wiki/Licensing:Unrar
nix-store --delete "$NEW_UNFREE_SRC"
echo "updating version"
sed -i "s/version = \"$OLD_VERSION\";/version = \"$NEW_VERSION\";/" "$DRV_DIR/default.nix"
echo "updating free hash"
sed -i "s@free = \"$OLD_FREE_HASH\";@free = \"$NEW_FREE_HASH\";@" "$DRV_DIR/default.nix"
echo "updating unfree hash"
sed -i "s@unfree = \"$OLD_UNFREE_HASH\";@unfree = \"$NEW_UNFREE_HASH\";@" "$DRV_DIR/default.nix"
echo "done"

View file

@ -0,0 +1,32 @@
{ lib, stdenv, fetchurl, utmp }:
stdenv.mkDerivation rec {
pname = "pax";
version = "20201030";
src = fetchurl {
url = "http://www.mirbsd.org/MirOS/dist/mir/cpio/paxmirabilis-${version}.tgz";
sha256 = "1p18nxijh323f4i1s2pg7pcr0557xljl5avv8ll5s9nfr34r5j0w";
};
buildInputs = lib.optional stdenv.isDarwin utmp;
buildPhase = ''
sh Build.sh -r -tpax
'';
installPhase = ''
install -Dm555 pax $out/bin/pax
ln -s $out/bin/pax $out/bin/paxcpio
ln -s $out/bin/pax $out/bin/paxtar
install -Dm444 mans/pax{,cpio,tar}.1 -t $out/share/man/man1/
'';
meta = with lib; {
description = "POSIX standard archive tool from MirBSD";
homepage = "https://www.mirbsd.org/pax.htm";
license = licenses.bsd3;
maintainers = with maintainers; [ gebner ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,26 @@
{ lib, stdenv, fetchurl, gcc }:
stdenv.mkDerivation rec {
pname = "pxattr";
version = "2.1.0";
src = fetchurl {
url = "https://www.lesbonscomptes.com/pxattr/pxattr-${version}.tar.gz";
sha256 = "1dwcqc5z7gzma1zhis2md49bj2nq7m6jimh4zlx9szw6svisz56z";
};
buildInputs = [ gcc ];
installPhase = ''
mkdir -p $out/bin
cp pxattr $out/bin
'';
meta = {
homepage = "https://www.lesbonscomptes.com/pxattr/index.html";
description = "Provides a single interface to extended file attributes";
maintainers = [ lib.maintainers.vrthra ];
license = [ lib.licenses.mit ];
platforms = lib.platforms.unix;
};
}

View file

@ -0,0 +1,23 @@
{ stdenv, lib, fetchzip, bzip2, lzo, openssl, zlib }:
stdenv.mkDerivation rec {
version = "0.11.0";
pname = "quickbms";
src = fetchzip {
url = "https://aluigi.altervista.org/papers/quickbms-src-${version}.zip";
hash = "sha256-uQKTE36pLO8uhrX794utqaDGUeyqRz6zLCQFA7DYkNc=";
};
buildInputs = [ bzip2 lzo openssl zlib ];
makeFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
description = "Universal script based file extractor and reimporter";
homepage = "https://aluigi.altervista.org/quickbms.htm";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,65 @@
{ lib, stdenv, fetchurl, autoPatchelfHook, installShellFiles }:
let
version = "6.11";
downloadVersion = lib.replaceStrings [ "." ] [ "" ] version;
srcUrl = {
i686-linux = {
url = "https://www.rarlab.com/rar/rarlinux-x32-${downloadVersion}.tar.gz";
sha256 = "sha256-7mpKkOEspGskt9yfSDrdK7CieJ0AectJKTi8TxLnbtk=";
};
x86_64-linux = {
url = "https://www.rarlab.com/rar/rarlinux-x64-${downloadVersion}.tar.gz";
sha256 = "sha256-pb3QdLqdxIf3ybLfPao3MdilTHYjCB1BujYsTQuEMtE=";
};
aarch64-darwin = {
url = "https://www.rarlab.com/rar/rarmacos-arm-${downloadVersion}.tar.gz";
sha256 = "sha256-q2fC4w2/tJ+GaD3ETPP+V3SAApdlLDgr3eE2YcERQXA=";
};
x86_64-darwin = {
url = "https://www.rarlab.com/rar/rarmacos-x64-${downloadVersion}.tar.gz";
sha256 = "sha256-yHWxAscqnLKrG9Clsaiy6wSbyVz4gpvN6AjyirCmIKQ=";
};
}.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
manSrc = fetchurl {
url = "https://aur.archlinux.org/cgit/aur.git/plain/rar.1?h=rar&id=8e39a12e88d8a3b168c496c44c18d443c876dd10";
name = "rar.1";
sha256 = "sha256-93cSr9oAsi+xHUtMsUvICyHJe66vAImS2tLie7nt8Uw=";
};
in
stdenv.mkDerivation rec {
pname = "rar";
inherit version;
src = fetchurl srcUrl;
dontBuild = true;
buildInputs = lib.optionals stdenv.isLinux [ stdenv.cc.cc.lib ];
nativeBuildInputs = [ installShellFiles ]
++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];
installPhase = ''
runHook preInstall
install -Dm755 {rar,unrar} -t "$out/bin"
install -Dm755 default.sfx -t "$out/lib"
install -Dm644 {acknow.txt,license.txt} -t "$out/share/doc/rar"
install -Dm644 rarfiles.lst -t "$out/etc"
runHook postInstall
'';
postInstall = ''
installManPage ${manSrc}
'';
meta = with lib; {
description = "Utility for RAR archives";
homepage = "https://www.rarlab.com/";
license = licenses.unfree;
maintainers = with maintainers; [ thiagokokada ];
platforms = with platforms; linux ++ darwin;
};
}

View file

@ -0,0 +1,50 @@
{ bzip2
, coreutils
, cpio
, fetchurl
, gnutar
, gzip
, lib
, stdenv
, xz
, zstd
}:
stdenv.mkDerivation rec {
pname = "rpm2targz";
version = "2021.03.16";
# git repo: https://gitweb.gentoo.org/proj/rpm2targz.git/
src = fetchurl {
url = "https://dev.gentoo.org/~vapier/dist/${pname}-${version}.tar.xz";
hash = "sha256-rcV+o9V2wWKznqSW2rA8xgnpQ02kpK4te6mYvLRC5vQ=";
};
postPatch = let
shdeps = [
bzip2
coreutils
cpio
gnutar
gzip
xz
zstd
];
in ''
substituteInPlace rpm2targz --replace "=\"rpmoffset\"" "=\"$out/bin/rpmoffset\""
# rpm2targz relies on the executable name
# to guess what compressor it should use
# this is more reliable than wrapProgram
sed -i -e '2iexport PATH="${lib.makeBinPath shdeps}"' rpm2targz
'';
installFlags = [ "prefix=$(out)" ];
meta = with lib; {
description = "Convert a .rpm file to a .tar.gz archive";
homepage = "http://slackware.com/config/packages.php";
license = licenses.bsd1;
maintainers = with maintainers; [ zseri ];
platforms = platforms.all;
};
}

View file

@ -0,0 +1,23 @@
{ lib, stdenv, rpm, cpio, substituteAll }:
stdenv.mkDerivation {
name = "rpmextract";
buildCommand = ''
install -Dm755 $script $out/bin/rpmextract
'';
script = substituteAll {
src = ./rpmextract.sh;
isExecutable = true;
inherit rpm cpio;
inherit (stdenv) shell;
};
meta = with lib; {
description = "Script to extract RPM archives";
platforms = platforms.all;
license = licenses.gpl2;
maintainers = with maintainers; [ abbradar ];
};
}

View file

@ -0,0 +1,10 @@
#!@shell@ -e
if [ "$1" = "" ]; then
echo "usage: rpmextract package_name..." 1>&2
exit 1
fi
for i in "$@"; do
@rpm@/bin/rpm2cpio "$i" | @cpio@/bin/cpio -idv
done

View file

@ -0,0 +1,23 @@
{ lib, stdenv, fetchFromGitHub, libzip, autoreconfHook }:
stdenv.mkDerivation rec {
version = "1.4";
pname = "runzip";
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ libzip ];
src = fetchFromGitHub {
owner = "vlm";
repo = "zip-fix-filename-encoding";
rev = "v${version}";
sha256 = "0l5zbb5hswxczigvyal877j0aiq3fc01j3gv88bvy7ikyvw3lc07";
};
meta = {
description = "A tool to convert filename encoding inside a ZIP archive";
license = lib.licenses.bsd2 ;
maintainers = [lib.maintainers.raskin];
platforms = lib.platforms.linux;
};
}

View file

@ -0,0 +1,35 @@
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "s-tar";
version = "1.6";
src = fetchurl {
url = "mirror://sourceforge/s-tar/star-${version}.tar.bz2";
sha256 = "0xpp8gf0ghwdgncdwx17fpadxislwrj48gcm42851hz6p8p6c60v";
};
preConfigure = "rm configure";
preBuild = "sed 's_/bin/__g' -i RULES/*";
makeFlags = [ "GMAKE_NOWARN=true" ];
installFlags = [ "DESTDIR=$(out)" "INS_BASE=/" ];
postInstall = ''
find $out/bin -type l -delete
rm -r $out/etc $out/include $out/sbin
'';
meta = {
description = "A very fast tar like tape archiver with improved functionality";
longDescription = ''
Star archives and extracts multiple files to and from a single file called a tarfile.
A tarfile is usually a magnetic tape, but it can be any file.
In all cases, appearance of a directory name refers to the files and (recursively) sub-directories of that directory.
Star's actions are controlled by the mandatory command flags from the list below.
The way star acts may be modified by additional options.
Note that unpacking tar archives may be a security risk because star may overwrite existing files.
'';
homepage = "http://cdrtools.sourceforge.net/private/star.html";
license = lib.licenses.cddl;
maintainers = [ lib.maintainers.wucke13 ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -0,0 +1,86 @@
{ lib, stdenv, fetchurl, fetchpatch, gettext, coreutils }:
stdenv.mkDerivation rec {
pname = "sharutils";
version = "4.15.2";
src = fetchurl {
url = "mirror://gnu/sharutils/sharutils-${version}.tar.xz";
sha256 = "16isapn8f39lnffc3dp4dan05b7x6mnc76v6q5nn8ysxvvvwy19b";
};
hardeningDisable = [ "format" ];
# GNU Gettext is needed on non-GNU platforms.
buildInputs = [ coreutils gettext ];
# These tests try to hit /etc/passwd to find out your username if pass in a submitter
# name on the command line. Since we block access to /etc/passwd on the Darwin sandbox
# that cause shar to just segfault. It isn't a problem on Linux because their sandbox
# remaps /etc/passwd to a trivial file, but we can't do that on Darwin so I do this
# instead. In this case, I pass in the very imaginative "submitter" as the submitter name
patches = [
# CVE-2018-1000097
(fetchurl {
url = "https://sources.debian.org/data/main/s/sharutils/1:4.15.2-2+deb9u1/debian/patches/01-fix-heap-buffer-overflow-cve-2018-1000097.patch";
sha256 = "19g0sxc8g79aj5gd5idz5409311253jf2q8wqkasf0handdvsbxx";
})
(fetchurl {
url = "https://sources.debian.org/data/main/s/sharutils/1:4.15.2-4/debian/patches/02-fix-ftbfs-with-glibc-2.28.patch";
sha256 = "15kpjqnfs98n6irmkh8pw7masr08xala7gx024agv7zv14722vkc";
})
# pending upstream build fix against -fno-common compilers like >=gcc-10
# Taken from https://lists.gnu.org/archive/html/bug-gnu-utils/2020-01/msg00002.html
(fetchpatch {
name = "sharutils-4.15.2-Fix-building-with-GCC-10.patch";
url = "https://lists.gnu.org/archive/html/bug-gnu-utils/2020-01/txtDL8i6V6mUU.txt";
sha256 = "0kfch1vm45lg237hr6fdv4b2lh5b1933k0fn8yj91gqm58svskvl";
})
(fetchpatch {
name = "sharutils-4.15.2-Do-not-include-lib-md5.c-into-src-shar.c.patch";
url = "https://lists.gnu.org/archive/html/bug-gnu-utils/2020-01/txt5Z_KZup0yN.txt";
sha256 = "0an8vfy3qj6sss9w0i4j8ilf7g5mbc7y13l644jy5bcm9przcjbd";
})
];
postPatch = let
# This evaluates to a string containing:
#
# substituteInPlace tests/shar-2 --replace '${SHAR}' '${SHAR} -s submitter'
# substituteInPlace tests/shar-2 --replace '${SHAR}' '${SHAR} -s submitter'
shar_sub = "\${SHAR}";
in ''
substituteInPlace tests/shar-1 --replace '${shar_sub}' '${shar_sub} -s submitter'
substituteInPlace tests/shar-2 --replace '${shar_sub}' '${shar_sub} -s submitter'
substituteInPlace intl/Makefile.in --replace "AR = ar" ""
'';
doCheck = true;
meta = with lib; {
description = "Tools for remote synchronization and `shell archives'";
longDescription =
'' GNU shar makes so-called shell archives out of many files, preparing
them for transmission by electronic mail services. A shell archive
is a collection of files that can be unpacked by /bin/sh. A wide
range of features provide extensive flexibility in manufacturing
shars and in specifying shar smartness. For example, shar may
compress files, uuencode binary files, split long files and
construct multi-part mailings, ensure correct unsharing order, and
provide simplistic checksums.
GNU unshar scans a set of mail messages looking for the start of
shell archives. It will automatically strip off the mail headers
and other introductory text. The archive bodies are then unpacked
by a copy of the shell. unshar may also process files containing
concatenated shell archives.
'';
homepage = "https://www.gnu.org/software/sharutils/";
license = licenses.gpl3Plus;
maintainers = [];
platforms = platforms.all;
};
}

View file

@ -0,0 +1,31 @@
{ lib, stdenv, fetchFromGitHub
, autoreconfHook
, pkg-config
, snappy
}:
stdenv.mkDerivation rec {
pname = "snzip";
version = "1.0.4";
src = fetchFromGitHub {
owner = "kubo";
repo = "snzip";
rev = version;
sha256 = "1v8li1zv9f2g31iyi9y9zx42rjvwkaw221g60pmkbv53y667i325";
};
buildInputs = [ snappy ];
# We don't use a release tarball so we don't have a `./configure` script to
# run. That's why we generate it.
nativeBuildInputs = [ autoreconfHook pkg-config ];
meta = with lib; {
description = "A compression/decompression tool based on snappy";
homepage = "https://github.com/kubo/snzip";
maintainers = with maintainers; [ doronbehar ];
license = licenses.bsd2;
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,28 @@
{ lib, stdenv, fetchurl, lzip, lzlib, texinfo }:
stdenv.mkDerivation rec {
pname = "tarlz";
version = "0.22";
outputs = [ "out" "man" "info" ];
nativeBuildInputs = [ lzip texinfo ];
buildInputs = [ lzlib ];
src = fetchurl {
url = "mirror://savannah/lzip/${pname}/${pname}-${version}.tar.lz";
sha256 = "sha256-/M9yJvoktV0ybKsT926jSb7ERsWo33GkbTQwmaBQkdw=";
};
enableParallelBuilding = true;
makeFlags = [ "CXX:=$(CXX)" ];
doCheck = !stdenv.isDarwin;
meta = with lib; {
homepage = "https://www.nongnu.org/lzip/${pname}.html";
description =
"Massively parallel combined implementation of the tar archiver and the lzip compressor";
license = licenses.gpl2Plus;
platforms = platforms.all;
maintainers = with maintainers; [ ehmry ];
};
}

View file

@ -0,0 +1,53 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch, ncurses }:
stdenv.mkDerivation rec {
pname = "torrent7z";
version = "1.3";
src = fetchFromGitHub {
owner = "BubblesInTheTub";
repo = pname;
rev = version;
sha256 = "Y2tr0+z9uij4Ifi6FfWRN24BwcDXUZKVLkLtKUiVjU4=";
};
patches = [
(fetchpatch {
name = "fix-gcc10-compilation.patch"; # Fix compilation on GCC 10. This patch is included on the latest commit
url =
"https://github.com/paulyc/torrent7z/commit/5958f42a364c430b3ed4ac68911bbbea1f967fc4.patch";
sha256 = "vJOv1sG9XwTvvxQiWew0H5ALoUb9wIAouzTsTvKHuPI=";
})
];
buildInputs = [ ncurses ];
hardeningDisable = [ "format" ];
postPatch = ''
# Remove non-free RAR source code
# (see DOC/License.txt, https://fedoraproject.org/wiki/Licensing:Unrar)
rm -r linux_src/p7zip_4.65/CPP/7zip/Compress/Rar*
find . -name makefile'*' -exec sed -i '/Rar/d' {} +
'';
preConfigure = ''
mkdir linux_src/p7zip_4.65/bin
cd linux_src/p7zip_4.65/CPP/7zip/Bundles/Alone
'';
installPhase = ''
mkdir -p $out/bin
cp ../../../../bin/t7z $out/bin
'';
meta = with lib; {
homepage = "https://github.com/BubblesInTheTub/torrent7z";
description = "A fork of torrent7z, viz a derivative of 7zip that produces invariant .7z archives for torrenting";
platforms = platforms.linux;
maintainers = with maintainers; [ cirno-999 ];
mainProgram = "t7z";
# RAR code is under non-free UnRAR license, but we remove it
license = licenses.gpl3Only;
};
}

View file

@ -0,0 +1,98 @@
{ lib
, stdenv
, fetchFromGitHub
, installShellFiles
, gnustep
, bzip2
, zlib
, icu
, openssl
, wavpack
, xcbuildHook
, Foundation
, AppKit
}:
stdenv.mkDerivation rec {
pname = "unar";
version = "1.10.7";
src = fetchFromGitHub {
owner = "MacPaw";
# the unar repo contains a shallow clone of both XADMaster and universal-detector
repo = "unar";
rev = "v${version}";
sha256 = "0p846q1l66k3rnd512sncp26zpv411b8ahi145sghfcsz9w8abc4";
};
postPatch =
if stdenv.isDarwin then ''
substituteInPlace "./XADMaster.xcodeproj/project.pbxproj" \
--replace "libstdc++.6.dylib" "libc++.1.dylib"
'' else ''
for f in Makefile.linux ../UniversalDetector/Makefile.linux ; do
substituteInPlace $f \
--replace "= gcc" "=${stdenv.cc.targetPrefix}cc" \
--replace "= g++" "=${stdenv.cc.targetPrefix}c++" \
--replace "-DGNU_RUNTIME=1" "" \
--replace "-fgnu-runtime" "-fobjc-nonfragile-abi"
done
# we need to build inside this directory as well, so we have to make it writeable
chmod +w ../UniversalDetector -R
'';
buildInputs = [ bzip2 icu openssl wavpack zlib ] ++
lib.optionals stdenv.isLinux [ gnustep.base ] ++
lib.optionals stdenv.isDarwin [ Foundation AppKit ];
nativeBuildInputs = [ installShellFiles ] ++
lib.optionals stdenv.isLinux [ gnustep.make ] ++
lib.optionals stdenv.isDarwin [ xcbuildHook ];
xcbuildFlags = lib.optionals stdenv.isDarwin [
"-target unar"
"-target lsar"
"-configuration Release"
"MACOSX_DEPLOYMENT_TARGET=10.12"
# Fix "ld: file not found: /nix/store/*-clang-7.1.0/lib/arc/libarclite_macosx." error
# Disabling ARC may leak memory, however since this program is generally not used for
# long periods of time, it shouldn't be an issue
"CLANG_LINK_OBJC_RUNTIME=NO"
];
makefile = lib.optionalString (!stdenv.isDarwin) "Makefile.linux";
enableParallelBuilding = true;
dontConfigure = true;
sourceRoot = "./source/XADMaster";
installPhase = ''
runHook preInstall
install -Dm555 -t $out/bin ${lib.optionalString stdenv.isDarwin "Products/Release/"}{lsar,unar}
for f in lsar unar; do
installManPage ./Extra/$f.?
installShellCompletion --bash --name $f ./Extra/$f.bash_completion
done
runHook postInstall
'';
meta = with lib; {
homepage = "https://theunarchiver.com";
description = "An archive unpacker program";
longDescription = ''
The Unarchiver is an archive unpacker program with support for the popular
zip, RAR, 7z, tar, gzip, bzip2, LZMA, XZ, CAB, MSI, NSIS, EXE, ISO, BIN,
and split file formats, as well as the old Stuffit, Stuffit X, DiskDouble,
Compact Pro, Packit, cpio, compress (.Z), ARJ, ARC, PAK, ACE, ZOO, LZH,
ADF, DMS, LZX, PowerPacker, LBR, Squeeze, Crunch, and other old formats.
'';
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ peterhoeg thiagokokada ];
platforms = platforms.unix;
};
}

View file

@ -0,0 +1,29 @@
{ lib, stdenv, fetchFromGitHub, zlib, bzip2, lzfse, pkg-config }:
stdenv.mkDerivation rec {
version = "1.1.0";
pname = "undmg";
src = fetchFromGitHub {
owner = "matthewbauer";
repo = "undmg";
rev = "v${version}";
sha256 = "0rb4h89jrl04vwf6p679ipa4mp95hzmc1ca11wqbanv3xd1kcpxm";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ zlib bzip2 lzfse ];
setupHook = ./setup-hook.sh;
makeFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
homepage = "https://github.com/matthewbauer/undmg";
description = "Extract a DMG file";
license = licenses.gpl3;
platforms = platforms.all;
maintainers = with maintainers; [ matthewbauer lnl7 ];
};
}

View file

@ -0,0 +1,5 @@
unpackCmdHooks+=(_tryUnpackDmg)
_tryUnpackDmg() {
if ! [[ "$curSrc" =~ \.dmg$ ]]; then return 1; fi
undmg "$curSrc"
}

View file

@ -0,0 +1,44 @@
{ stdenv, lib, fetchurl, makeWrapper, perl
, unzip, gzip, file
# extractors which are added to unps PATH
, extraBackends ? []
}:
let
runtime_bins = [ file unzip gzip ] ++ extraBackends;
in stdenv.mkDerivation {
pname = "unp";
version = "2.0-pre9";
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perl ];
src = fetchurl {
url = "mirror://debian/pool/main/u/unp/unp_2.0~pre9.tar.xz";
sha256 = "1lp5vi9x1qi3b21nzv0yqqacj6p74qkl5zryzwq30rjkyvahjya1";
name = "unp_2.0_pre9.tar.xz";
};
dontConfigure = true;
buildPhase = "true";
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/man/man1
install ./unp $out/bin/unp
install ./ucat $out/bin/ucat
cp debian/unp.1 $out/share/man/man1
wrapProgram $out/bin/unp \
--prefix PATH : ${lib.makeBinPath runtime_bins}
wrapProgram $out/bin/ucat \
--prefix PATH : ${lib.makeBinPath runtime_bins}
'';
meta = with lib; {
description = "Command line tool for unpacking archives easily";
homepage = "https://packages.qa.debian.org/u/unp.html";
license = with licenses; [ gpl2 ];
maintainers = [ maintainers.timor ];
platforms = platforms.all;
};
}

View file

@ -0,0 +1,36 @@
{ lib, buildPythonApplication, fetchFromGitHub, unar }:
buildPythonApplication rec {
pname = "unrar-wrapper";
version = "1.0.0";
src = fetchFromGitHub {
owner = "openSUSE";
repo = "unrar_wrapper";
rev = "unrar_wrapper-${version}";
sha256 = "sha256-HjrUif8MrbtLjRQMAPZ/Y2o43rGSDj0HHY4fZQfKz5w=";
};
makeWrapperArgs = [
"--prefix" "PATH" ":" "${lib.makeBinPath [ unar ]}"
];
postFixup = ''
ln -s $out/bin/unrar_wrapper $out/bin/unrar
rm -rf $out/nix-support/propagated-build-inputs
'';
setupHook = ./setup-hook.sh;
meta = with lib; {
homepage = "https://github.com/openSUSE/unrar_wrapper";
description = "Backwards compatibility between unar and unrar";
longDescription = ''
unrar_wrapper is a wrapper python script that transforms the basic UnRAR commands
to unar and lsar calls in order to provide a backwards compatibility.
'';
license = licenses.gpl3Only;
platforms = platforms.unix;
maintainers = with maintainers; [ artturin ];
};
}

View file

@ -0,0 +1,5 @@
unpackCmdHooks+=(_tryUnrar)
_tryUnrar() {
if ! [[ "$curSrc" =~ \.rar$ ]]; then return 1; fi
unrar x "$curSrc" >/dev/null
}

View file

@ -0,0 +1,54 @@
{lib, stdenv, fetchurl}:
stdenv.mkDerivation rec {
pname = "unrar";
version = "6.1.6";
src = fetchurl {
url = "https://www.rarlab.com/rar/unrarsrc-${version}.tar.gz";
sha256 = "sha256-Z/SriRwGIhjCut+qycjKtci/1eltq/ylbI+qPSCagB0=";
};
postPatch = ''
substituteInPlace makefile \
--replace "CXX=" "#CXX=" \
--replace "STRIP=" "#STRIP=" \
--replace "AR=" "#AR="
'';
buildPhase = ''
# `make {unrar,lib}` call `make clean` implicitly
# move build results to another dir to avoid deleting them
mkdir -p bin
make unrar
mv unrar bin
make lib
mv libunrar.so bin
'';
outputs = [ "out" "dev" ];
installPhase = ''
install -Dt "$out/bin" bin/unrar
mkdir -p $out/share/doc/unrar
cp acknow.txt license.txt \
$out/share/doc/unrar
install -Dm755 bin/libunrar.so $out/lib/libunrar.so
install -Dt $dev/include/unrar/ *.hpp
'';
setupHook = ./setup-hook.sh;
meta = with lib; {
description = "Utility for RAR archives";
homepage = "https://www.rarlab.com/";
license = licenses.unfreeRedistributable;
maintainers = [ maintainers.ehmry ];
platforms = platforms.all;
};
}

View file

@ -0,0 +1,5 @@
unpackCmdHooks+=(_tryUnrar)
_tryUnrar() {
if ! [[ "$curSrc" =~ \.rar$ ]]; then return 1; fi
unrar x "$curSrc" >/dev/null
}

View file

@ -0,0 +1,23 @@
{ lib, stdenv, fetchFromGitHub, cmake, zlib, openssl }:
stdenv.mkDerivation rec {
pname = "unshield";
version = "1.5.1";
src = fetchFromGitHub {
owner = "twogood";
repo = "unshield";
rev = version;
sha256 = "1p2inn93svm83kr5p0j1al0rx47f1zykmagxsblgy04gi942iza3";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ zlib openssl ];
meta = with lib; {
description = "Tool and library to extract CAB files from InstallShield installers";
homepage = "https://github.com/twogood/unshield";
license = licenses.mit;
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,47 @@
From RedHat: https://bugzilla.redhat.com/attachment.cgi?id=971984&action=diff&context=patch&collapsed=&headers=1&format=raw
--- unzip60/extract.c 2010-04-03 14:41:55 -0500
+++ unzip60/extract.c 2014-12-03 15:33:35 -0600
@@ -1,5 +1,5 @@
/*
- Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
+ Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2009-Jan-02 or later
(the contents of which are also included in unzip.h) for terms of use.
@@ -298,6 +298,8 @@
#ifndef SFX
static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \
EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n";
+ static ZCONST char Far TooSmallEFlength[] = "bad extra-field entry:\n \
+ EF block length (%u bytes) invalid (< %d)\n";
static ZCONST char Far InvalidComprDataEAs[] =
" invalid compressed data for EAs\n";
# if (defined(WIN32) && defined(NTSD_EAS))
@@ -2023,7 +2025,8 @@
ebID = makeword(ef);
ebLen = (unsigned)makeword(ef+EB_LEN);
- if (ebLen > (ef_len - EB_HEADSIZE)) {
+ if (ebLen > (ef_len - EB_HEADSIZE))
+ {
/* Discovered some extra field inconsistency! */
if (uO.qflag)
Info(slide, 1, ((char *)slide, "%-22s ",
@@ -2032,6 +2035,16 @@
ebLen, (ef_len - EB_HEADSIZE)));
return PK_ERR;
}
+ else if (ebLen < EB_HEADSIZE)
+ {
+ /* Extra block length smaller than header length. */
+ if (uO.qflag)
+ Info(slide, 1, ((char *)slide, "%-22s ",
+ FnFilter1(G.filename)));
+ Info(slide, 1, ((char *)slide, LoadFarString(TooSmallEFlength),
+ ebLen, EB_HEADSIZE));
+ return PK_ERR;
+ }
switch (ebID) {
case EF_OS2:

View file

@ -0,0 +1,26 @@
From RedHat: https://bugzilla.redhat.com/attachment.cgi?id=969621&action=diff
(unzip60/ path prefix added)
--- unzip60/extract.c 2009-03-14 02:32:52.000000000 +0100
+++ unzip60/extract.c 2014-12-05 22:43:13.000000000 +0100
@@ -2221,10 +2234,17 @@ static int test_compr_eb(__G__ eb, eb_si
if (compr_offset < 4) /* field is not compressed: */
return PK_OK; /* do nothing and signal OK */
+ /* Return no/bad-data error status if any problem is found:
+ * 1. eb_size is too small to hold the uncompressed size
+ * (eb_ucsize). (Else extract eb_ucsize.)
+ * 2. eb_ucsize is zero (invalid). 2014-12-04 SMS.
+ * 3. eb_ucsize is positive, but eb_size is too small to hold
+ * the compressed data header.
+ */
if ((eb_size < (EB_UCSIZE_P + 4)) ||
- ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L &&
- eb_size <= (compr_offset + EB_CMPRHEADLEN)))
- return IZ_EF_TRUNC; /* no compressed data! */
+ ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) ||
+ ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
+ return IZ_EF_TRUNC; /* no/bad compressed data! */
if (
#ifdef INT_16BIT

View file

@ -0,0 +1,136 @@
From RedHat: https://bugzilla.redhat.com/attachment.cgi?id=969625&action=diff
(unzip60/ path prefix added)
--- unzip60/process.c 2009-03-06 02:25:10.000000000 +0100
+++ unzip60/process.c 2014-12-05 22:42:39.000000000 +0100
@@ -1,5 +1,5 @@
/*
- Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
+ Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2009-Jan-02 or later
(the contents of which are also included in unzip.h) for terms of use.
@@ -1888,48 +1888,82 @@ int getZip64Data(__G__ ef_buf, ef_len)
and a 4-byte version of disk start number.
Sets both local header and central header fields. Not terribly clever,
but it means that this procedure is only called in one place.
+
+ 2014-12-05 SMS.
+ Added checks to ensure that enough data are available before calling
+ makeint64() or makelong(). Replaced various sizeof() values with
+ simple ("4" or "8") constants. (The Zip64 structures do not depend
+ on our variable sizes.) Error handling is crude, but we should now
+ stay within the buffer.
---------------------------------------------------------------------------*/
+#define Z64FLGS 0xffff
+#define Z64FLGL 0xffffffff
+
if (ef_len == 0 || ef_buf == NULL)
return PK_COOL;
Trace((stderr,"\ngetZip64Data: scanning extra field of length %u\n",
ef_len));
- while (ef_len >= EB_HEADSIZE) {
+ while (ef_len >= EB_HEADSIZE)
+ {
eb_id = makeword(EB_ID + ef_buf);
eb_len = makeword(EB_LEN + ef_buf);
- if (eb_len > (ef_len - EB_HEADSIZE)) {
- /* discovered some extra field inconsistency! */
+ if (eb_len > (ef_len - EB_HEADSIZE))
+ {
+ /* Extra block length exceeds remaining extra field length. */
Trace((stderr,
"getZip64Data: block length %u > rest ef_size %u\n", eb_len,
ef_len - EB_HEADSIZE));
break;
}
- if (eb_id == EF_PKSZ64) {
-
+ if (eb_id == EF_PKSZ64)
+ {
int offset = EB_HEADSIZE;
- if (G.crec.ucsize == 0xffffffff || G.lrec.ucsize == 0xffffffff){
- G.lrec.ucsize = G.crec.ucsize = makeint64(offset + ef_buf);
- offset += sizeof(G.crec.ucsize);
+ if ((G.crec.ucsize == Z64FLGL) || (G.lrec.ucsize == Z64FLGL))
+ {
+ if (offset+ 8 > ef_len)
+ return PK_ERR;
+
+ G.crec.ucsize = G.lrec.ucsize = makeint64(offset + ef_buf);
+ offset += 8;
}
- if (G.crec.csize == 0xffffffff || G.lrec.csize == 0xffffffff){
- G.csize = G.lrec.csize = G.crec.csize = makeint64(offset + ef_buf);
- offset += sizeof(G.crec.csize);
+
+ if ((G.crec.csize == Z64FLGL) || (G.lrec.csize == Z64FLGL))
+ {
+ if (offset+ 8 > ef_len)
+ return PK_ERR;
+
+ G.csize = G.crec.csize = G.lrec.csize = makeint64(offset + ef_buf);
+ offset += 8;
}
- if (G.crec.relative_offset_local_header == 0xffffffff){
+
+ if (G.crec.relative_offset_local_header == Z64FLGL)
+ {
+ if (offset+ 8 > ef_len)
+ return PK_ERR;
+
G.crec.relative_offset_local_header = makeint64(offset + ef_buf);
- offset += sizeof(G.crec.relative_offset_local_header);
+ offset += 8;
}
- if (G.crec.disk_number_start == 0xffff){
+
+ if (G.crec.disk_number_start == Z64FLGS)
+ {
+ if (offset+ 4 > ef_len)
+ return PK_ERR;
+
G.crec.disk_number_start = (zuvl_t)makelong(offset + ef_buf);
- offset += sizeof(G.crec.disk_number_start);
+ offset += 4;
}
+#if 0
+ break; /* Expect only one EF_PKSZ64 block. */
+#endif /* 0 */
}
- /* Skip this extra field block */
+ /* Skip this extra field block. */
ef_buf += (eb_len + EB_HEADSIZE);
ef_len -= (eb_len + EB_HEADSIZE);
}
--- unzip60/fileio.c 2009-04-20 02:03:44.000000000 +0200
+++ unzip60/fileio.c 2014-12-05 22:44:16.000000000 +0100
@@ -176,6 +176,8 @@ static ZCONST char Far FilenameTooLongTr
#endif
static ZCONST char Far ExtraFieldTooLong[] =
"warning: extra field too long (%d). Ignoring...\n";
+static ZCONST char Far ExtraFieldCorrupt[] =
+ "warning: extra field (type: 0x%04x) corrupt. Continuing...\n";
#ifdef WINDLL
static ZCONST char Far DiskFullQuery[] =
@@ -2295,7 +2297,12 @@ int do_string(__G__ length, option) /*
if (readbuf(__G__ (char *)G.extra_field, length) == 0)
return PK_EOF;
/* Looks like here is where extra fields are read */
- getZip64Data(__G__ G.extra_field, length);
+ if (getZip64Data(__G__ G.extra_field, length) != PK_COOL)
+ {
+ Info(slide, 0x401, ((char *)slide,
+ LoadFarString( ExtraFieldCorrupt), EF_PKSZ64));
+ error = PK_WARN;
+ }
#ifdef UNICODE_SUPPORT
G.unipath_filename = NULL;
if (G.UzO.U_flag < 2) {

View file

@ -0,0 +1,42 @@
From 190040ebfcf5395a6ccedede2cc9343d34f0a108 Mon Sep 17 00:00:00 2001
From: mancha <mancha1 AT zoho DOT com>
Date: Wed, 11 Feb 2015
Subject: Info-ZIP UnZip buffer overflow
By carefully crafting a corrupt ZIP archive with "extra fields" that
purport to have compressed blocks larger than the corresponding
uncompressed blocks in STORED no-compression mode, an attacker can
trigger a heap overflow that can result in application crash or
possibly have other unspecified impact.
This patch ensures that when extra fields use STORED mode, the
"compressed" and uncompressed block sizes match.
---
extract.c | 8 ++++++++
1 file changed, 8 insertions(+)
--- a/extract.c
+++ b/extract.c
@@ -2217,6 +2217,7 @@ static int test_compr_eb(__G__ eb, eb_si
ulg eb_ucsize;
uch *eb_ucptr;
int r;
+ ush method;
if (compr_offset < 4) /* field is not compressed: */
return PK_OK; /* do nothing and signal OK */
@@ -2226,6 +2227,13 @@ static int test_compr_eb(__G__ eb, eb_si
eb_size <= (compr_offset + EB_CMPRHEADLEN)))
return IZ_EF_TRUNC; /* no compressed data! */
+ method = makeword(eb + (EB_HEADSIZE + compr_offset));
+ if ((method == STORED) &&
+ (eb_size - compr_offset - EB_CMPRHEADLEN != eb_ucsize))
+ return PK_ERR; /* compressed & uncompressed
+ * should match in STORED
+ * method */
+
if (
#ifdef INT_16BIT
(((ulg)(extent)eb_ucsize) != eb_ucsize) ||

View file

@ -0,0 +1,29 @@
From: "Steven M. Schweda" <sms@antinode.info>
Subject: Fix CVE-2014-9913, buffer overflow in unzip
Bug: https://sourceforge.net/p/infozip/bugs/27/
Bug-Debian: https://bugs.debian.org/847485
Bug-Ubuntu: https://launchpad.net/bugs/387350
X-Debian-version: 6.0-21
--- a/list.c
+++ b/list.c
@@ -339,7 +339,18 @@
G.crec.compression_method == ENHDEFLATED) {
methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3];
} else if (methnum >= NUM_METHODS) {
- sprintf(&methbuf[4], "%03u", G.crec.compression_method);
+ /* 2013-02-26 SMS.
+ * http://sourceforge.net/p/infozip/bugs/27/ CVE-2014-9913.
+ * Unexpectedly large compression methods overflow
+ * &methbuf[]. Use the old, three-digit decimal format
+ * for values which fit. Otherwise, sacrifice the
+ * colon, and use four-digit hexadecimal.
+ */
+ if (G.crec.compression_method <= 999) {
+ sprintf( &methbuf[ 4], "%03u", G.crec.compression_method);
+ } else {
+ sprintf( &methbuf[ 3], "%04X", G.crec.compression_method);
+ }
}
#if 0 /* GRR/Euro: add this? */

View file

@ -0,0 +1,66 @@
From 68efed87fabddd450c08f3112f62a73f61d493c9 Mon Sep 17 00:00:00 2001
From: Petr Stodulka <pstodulk@redhat.com>
Date: Mon, 14 Sep 2015 18:23:17 +0200
Subject: [PATCH 1/2] upstream fix for heap overflow
https://bugzilla.redhat.com/attachment.cgi?id=1073002
---
crypt.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/crypt.c b/crypt.c
index 784e411..a8975f2 100644
--- a/crypt.c
+++ b/crypt.c
@@ -465,7 +465,17 @@ int decrypt(__G__ passwrd)
GLOBAL(pInfo->encrypted) = FALSE;
defer_leftover_input(__G);
for (n = 0; n < RAND_HEAD_LEN; n++) {
- b = NEXTBYTE;
+ /* 2012-11-23 SMS. (OUSPG report.)
+ * Quit early if compressed size < HEAD_LEN. The resulting
+ * error message ("unable to get password") could be improved,
+ * but it's better than trying to read nonexistent data, and
+ * then continuing with a negative G.csize. (See
+ * fileio.c:readbyte()).
+ */
+ if ((b = NEXTBYTE) == (ush)EOF)
+ {
+ return PK_ERR;
+ }
h[n] = (uch)b;
Trace((stdout, " (%02x)", h[n]));
}
--
2.4.6
From bd8a743ee0a77e65ad07ef4196c4cd366add3f26 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Mon, 14 Sep 2015 18:24:56 +0200
Subject: [PATCH 2/2] fix infinite loop when extracting empty bzip2 data
---
extract.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/extract.c b/extract.c
index 7134bfe..29db027 100644
--- a/extract.c
+++ b/extract.c
@@ -2733,6 +2733,12 @@ __GDEF
int repeated_buf_err;
bz_stream bstrm;
+ if (G.incnt <= 0 && G.csize <= 0L) {
+ /* avoid an infinite loop */
+ Trace((stderr, "UZbunzip2() got empty input\n"));
+ return 2;
+ }
+
#if (defined(DLL) && !defined(NO_SLIDE_REDIR))
if (G.redirect_slide)
wsize = G.redirect_size, redirSlide = G.redirect_buffer;
--
2.4.6

View file

@ -0,0 +1,36 @@
From bd150334fb4084f5555a6be26b015a0671cb5b74 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Tue, 22 Sep 2015 18:52:23 +0200
Subject: [PATCH] extract: prevent unsigned overflow on invalid input
Suggested-by: Stefan Cornelius
---
extract.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/extract.c b/extract.c
index 29db027..b9ae667 100644
--- a/extract.c
+++ b/extract.c
@@ -1257,8 +1257,17 @@ static int extract_or_test_entrylist(__G__ numchunk,
if (G.lrec.compression_method == STORED) {
zusz_t csiz_decrypted = G.lrec.csize;
- if (G.pInfo->encrypted)
+ if (G.pInfo->encrypted) {
+ if (csiz_decrypted <= 12) {
+ /* handle the error now to prevent unsigned overflow */
+ Info(slide, 0x401, ((char *)slide,
+ LoadFarStringSmall(ErrUnzipNoFile),
+ LoadFarString(InvalidComprData),
+ LoadFarStringSmall2(Inflate)));
+ return PK_ERR;
+ }
csiz_decrypted -= 12;
+ }
if (G.lrec.ucsize != csiz_decrypted) {
Info(slide, 0x401, ((char *)slide,
LoadFarStringSmall2(WrnStorUCSizCSizDiff),
--
2.5.2

View file

@ -0,0 +1,28 @@
From: "Steven M. Schweda" <sms@antinode.info>
Subject: Fix CVE-2016-9844, buffer overflow in zipinfo
Bug-Debian: https://bugs.debian.org/847486
Bug-Ubuntu: https://launchpad.net/bugs/1643750
X-Debian-version: 6.0-21
--- a/zipinfo.c
+++ b/zipinfo.c
@@ -1921,7 +1921,18 @@
ush dnum=(ush)((G.crec.general_purpose_bit_flag>>1) & 3);
methbuf[3] = dtype[dnum];
} else if (methnum >= NUM_METHODS) { /* unknown */
- sprintf(&methbuf[1], "%03u", G.crec.compression_method);
+ /* 2016-12-05 SMS.
+ * https://launchpad.net/bugs/1643750
+ * Unexpectedly large compression methods overflow
+ * &methbuf[]. Use the old, three-digit decimal format
+ * for values which fit. Otherwise, sacrifice the "u",
+ * and use four-digit hexadecimal.
+ */
+ if (G.crec.compression_method <= 999) {
+ sprintf( &methbuf[ 1], "%03u", G.crec.compression_method);
+ } else {
+ sprintf( &methbuf[ 0], "%04X", G.crec.compression_method);
+ }
}
for (k = 0; k < 15; ++k)

View file

@ -0,0 +1,35 @@
--- unzip60/list.c
+++ unzip60/list.c
@@ -97,7 +97,7 @@ int list_files(__G) /* return PK-type
{
int do_this_file=FALSE, cfactor, error, error_in_archive=PK_COOL;
#ifndef WINDLL
- char sgn, cfactorstr[10];
+ char sgn, cfactorstr[1+10+1+1]; /* <sgn><int>%NUL */
int longhdr=(uO.vflag>1);
#endif
int date_format;
@@ -389,9 +389,9 @@ int list_files(__G) /* return PK-type
}
#else /* !WINDLL */
if (cfactor == 100)
- sprintf(cfactorstr, LoadFarString(CompFactor100));
+ snprintf(cfactorstr, sizeof(cfactorstr), LoadFarString(CompFactor100));
else
- sprintf(cfactorstr, LoadFarString(CompFactorStr), sgn, cfactor);
+ snprintf(cfactorstr, sizeof(cfactorstr), LoadFarString(CompFactorStr), sgn, cfactor);
if (longhdr)
Info(slide, 0, ((char *)slide, LoadFarString(LongHdrStats),
FmZofft(G.crec.ucsize, "8", "u"), methbuf,
@@ -471,9 +471,9 @@ int list_files(__G) /* return PK-type
#else /* !WINDLL */
if (cfactor == 100)
- sprintf(cfactorstr, LoadFarString(CompFactor100));
+ snprintf(cfactorstr, sizeof(cfactorstr), LoadFarString(CompFactor100));
else
- sprintf(cfactorstr, LoadFarString(CompFactorStr), sgn, cfactor);
+ snprintf(cfactorstr, sizeof(cfactorstr), LoadFarString(CompFactorStr), sgn, cfactor);
if (longhdr) {
Info(slide, 0, ((char *)slide, LoadFarString(LongFileTrailer),
FmZofft(tot_ucsize, "8", "u"), FmZofft(tot_csize, "8", "u"),

View file

@ -0,0 +1,81 @@
{ lib, stdenv, fetchurl
, bzip2
, enableNLS ? false, libnatspec
}:
stdenv.mkDerivation rec {
pname = "unzip";
version = "6.0";
src = fetchurl {
url = "mirror://sourceforge/infozip/unzip${lib.replaceStrings ["."] [""] version}.tar.gz";
sha256 = "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83";
};
hardeningDisable = [ "format" ];
patchFlags = [ "-p1" "-F3" ];
patches = [
./CVE-2014-8139.diff
./CVE-2014-8140.diff
./CVE-2014-8141.diff
./CVE-2014-9636.diff
./CVE-2015-7696.diff
./CVE-2015-7697.diff
./CVE-2014-9913.patch
./CVE-2016-9844.patch
./CVE-2018-18384.patch
./dont-hardcode-cc.patch
(fetchurl {
url = "https://github.com/madler/unzip/commit/41beb477c5744bc396fa1162ee0c14218ec12213.patch";
name = "CVE-2019-13232-1.patch";
sha256 = "04jzd6chg9fw4l5zadkfsrfm5llrd7vhd1dgdjjd29nrvkrjyn14";
})
(fetchurl {
url = "https://github.com/madler/unzip/commit/47b3ceae397d21bf822bc2ac73052a4b1daf8e1c.patch";
name = "CVE-2019-13232-2.patch";
sha256 = "0iy2wcjyvzwrjk02iszwcpg85fkjxs1bvb9isvdiywszav4yjs32";
})
(fetchurl {
url = "https://github.com/madler/unzip/commit/6d351831be705cc26d897db44f878a978f4138fc.patch";
name = "CVE-2019-13232-3.patch";
sha256 = "1jvs7dkdqs97qnsqc6hk088alhv8j4c638k65dbib9chh40jd7pf";
})
] ++ lib.optional enableNLS
(fetchurl {
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-arch/unzip/files/unzip-6.0-natspec.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d";
name = "unzip-6.0-natspec.patch";
sha256 = "67ab260ae6adf8e7c5eda2d1d7846929b43562943ec4aff629bd7018954058b1";
});
nativeBuildInputs = [ bzip2 ];
buildInputs = [ bzip2 ] ++ lib.optional enableNLS libnatspec;
makefile = "unix/Makefile";
NIX_LDFLAGS = "-lbz2" + lib.optionalString enableNLS " -lnatspec";
buildFlags = [
"generic"
"D_USE_BZ2=-DUSE_BZIP2"
"L_BZ2=-lbz2"
];
preConfigure = ''
sed -i -e 's@CF="-O3 -Wall -I. -DASM_CRC $(LOC)"@CF="-O3 -Wall -I. -DASM_CRC -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(LOC)"@' unix/Makefile
'';
installFlags = [
"prefix=${placeholder "out"}"
];
setupHook = ./setup-hook.sh;
meta = {
homepage = "http://www.info-zip.org";
description = "An extraction utility for archives compressed in .zip format";
license = lib.licenses.free; # http://www.info-zip.org/license.html
platforms = lib.platforms.all;
};
}

View file

@ -0,0 +1,14 @@
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -42,9 +42,9 @@
# such as -DDOSWILD).
# UnZip flags
-CC = cc# try using "gcc" target rather than changing this (CC and LD
+CC ?= cc# try using "gcc" target rather than changing this (CC and LD
LD = $(CC)# must match, else "unresolved symbol: ___main" is possible)
-AS = as
+AS ?= as
LOC = $(D_USE_BZ2) $(LOCAL_UNZIP)
AF = $(LOC)
CFLAGS = -O

View file

@ -0,0 +1,5 @@
unpackCmdHooks+=(_tryUnzip)
_tryUnzip() {
if ! [[ "$curSrc" =~ \.zip$ ]]; then return 1; fi
unzip -qq "$curSrc"
}

View file

@ -0,0 +1,44 @@
{ lib
, stdenv
, fetchFromGitHub
}:
stdenv.mkDerivation rec {
pname = "unzoo";
version = "4.4";
src = fetchFromGitHub {
owner = "museoa";
repo = pname;
rev = version;
hash = "sha256-oPq1I7EsvHaJ7anHbm/KWrYrxJkM79rLhgRfSAdoLtk=";
};
outputs = [ "out" "doc" ];
buildPhase = ''
runHook preBuild
${stdenv.cc.targetPrefix}cc -o unzoo -DSYS_IS_UNIX src/unzoo.c
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $doc/share/doc/${pname}
cp unzoo $out/bin
cp README.TXT $doc/share/doc/${pname}
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/museoa/unzoo/";
description = "Manipulate archives of files in Zoo compressed form";
license = licenses.publicDomain;
maintainers = with maintainers; [ AndersonTorres ];
platforms = platforms.all;
};
}

View file

@ -0,0 +1,48 @@
{ lib, stdenv, fetchurl, makeWrapper
, pkg-config, openssl, fuse, libxml2
, cabextract ? null
, cdrkit ? null
, mtools ? null
, ntfs3g ? null
, syslinux ? null
}:
stdenv.mkDerivation rec {
version = "1.13.5";
pname = "wimlib";
nativeBuildInputs = [ pkg-config makeWrapper ];
buildInputs = [ openssl fuse libxml2 ntfs3g ];
src = fetchurl {
url = "https://wimlib.net/downloads/${pname}-${version}.tar.gz";
sha256 = "sha256-MvzJ6bFEt8sdtMhuEEyngoPNwiXhP+grJzZgWGrv4yM=";
};
preBuild = lib.optionalString (!stdenv.isDarwin) ''
substituteInPlace programs/mkwinpeimg.in \
--replace '/usr/lib/syslinux' "${syslinux}/share/syslinux"
'';
postInstall = let
path = lib.makeBinPath ([ cabextract mtools ntfs3g ] ++ lib.optionals (!stdenv.isDarwin) [ cdrkit syslinux ]);
in ''
for prog in $out/bin/*; do
wrapProgram $prog --prefix PATH : ${path}
done
'';
doCheck = (!stdenv.isDarwin);
preCheck = ''
patchShebangs tests
'';
meta = with lib; {
homepage = "https://wimlib.net";
description = "A library and program to extract, create, and modify WIM files";
platforms = platforms.unix;
maintainers = with maintainers; [ ];
license = with licenses; [ gpl3 lgpl3 cc0 ];
};
}

View file

@ -0,0 +1,23 @@
{ lib, stdenv, fetchurl, gtk2, pkg-config }:
stdenv.mkDerivation rec {
version = "0.2.8-6";
pname = "xarchive";
src = fetchurl {
url = "mirror://sourceforge/xarchive/${pname}-${version}.tar.gz";
sha256 = "0chfim7z27s00naf43a61zsngwhvim14mg1p3csbv5i3f6m50xx4";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ gtk2 ];
hardeningDisable = [ "format" ];
meta = {
description = "A GTK front-end for command line archiving tools";
maintainers = [ lib.maintainers.domenkozar ];
license = lib.licenses.gpl2;
platforms = lib.platforms.all;
};
}

View file

@ -0,0 +1,31 @@
{ lib, stdenv, fetchFromGitHub, gtk3, pkg-config, intltool, libxslt, makeWrapper,
coreutils, zip, unzip, p7zip, unar, gnutar, bzip2, gzip, lhasa, wrapGAppsHook }:
stdenv.mkDerivation rec {
version = "0.5.4.17";
pname = "xarchiver";
src = fetchFromGitHub {
owner = "ib";
repo = "xarchiver";
rev = version;
sha256 = "00adrjpxqlaccrwjf65w3vhxfswdj0as8aj263c6f9b85llypc5v";
};
nativeBuildInputs = [ intltool pkg-config makeWrapper wrapGAppsHook ];
buildInputs = [ gtk3 libxslt ];
postFixup = ''
wrapProgram $out/bin/xarchiver \
--prefix PATH : ${lib.makeBinPath [ zip unzip p7zip unar gnutar bzip2 gzip lhasa coreutils ]}
'';
meta = {
broken = stdenv.isDarwin;
description = "GTK frontend to 7z,zip,rar,tar,bzip2, gzip,arj, lha, rpm and deb (open and extract only)";
homepage = "https://github.com/ib/xarchiver";
maintainers = [ lib.maintainers.domenkozar ];
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.all;
};
}

View file

@ -0,0 +1,37 @@
{ bzip2, fetchFromGitHub, gzip, gnutar, lib, stdenv, unzip, xz }:
stdenv.mkDerivation rec {
pname = "xtrt";
version = "unstable-2021-02-17";
src = fetchFromGitHub {
owner = "figsoda";
repo = pname;
rev = "61884fb7c48c7e1e2194afd82b85f415a6dc7c20";
sha256 = "073l4q6mx5if791p5a6w8m8bz2aypmjmycaijq4spql8bh6h12vf";
};
postPatch = ''
substituteInPlace xtrt \
--replace "bzip2 " "${bzip2}/bin/bzip2 " \
--replace "gzip " "${gzip}/bin/gzip " \
--replace "tar " "${gnutar}/bin/tar " \
--replace "unzip " "${unzip}/bin/unzip " \
--replace "xz " "${xz}/bin/xz "
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp xtrt $out/bin
runHook postInstall
'';
meta = with lib; {
description = "Tiny script to extract archives by their extensions";
homepage = "https://github.com/figsoda/xtrt";
license = licenses.unlicense;
maintainers = with maintainers; [ figsoda ];
mainProgram = "xtrt";
};
}

View file

@ -0,0 +1,41 @@
{ lib, stdenv, fetchurl, enableNLS ? false, libnatspec ? null, libiconv }:
assert enableNLS -> libnatspec != null;
stdenv.mkDerivation rec {
pname = "zip";
version = "3.0";
src = fetchurl {
urls = [
"ftp://ftp.info-zip.org/pub/infozip/src/zip${lib.replaceStrings ["."] [""] version}.tgz"
"https://src.fedoraproject.org/repo/pkgs/zip/zip30.tar.gz/7b74551e63f8ee6aab6fbc86676c0d37/zip30.tar.gz"
];
sha256 = "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h";
};
patchPhase = ''
substituteInPlace unix/Makefile --replace 'CC = cc' ""
'';
hardeningDisable = [ "format" ];
makefile = "unix/Makefile";
buildFlags = if stdenv.isCygwin then [ "cygwin" ] else [ "generic" ];
installFlags = [
"prefix=${placeholder "out"}"
"INSTALL=cp"
];
patches = if (enableNLS && !stdenv.isCygwin) then [ ./natspec-gentoo.patch.bz2 ] else [];
buildInputs = lib.optional enableNLS libnatspec
++ lib.optional stdenv.isCygwin libiconv;
meta = with lib; {
description = "Compressor/archiver for creating and modifying zipfiles";
homepage = "http://www.info-zip.org";
license = licenses.bsdOriginal;
platforms = platforms.all;
maintainers = [ ];
};
}

Binary file not shown.

View file

@ -0,0 +1,32 @@
{ lib, stdenv, fetchFromGitHub, perl }:
stdenv.mkDerivation rec {
pname = "zpaq";
version = "7.15";
src = fetchFromGitHub {
owner = "zpaq";
repo = "zpaq";
rev = version;
sha256 = "0v44rlg9gvwc4ggr2lhcqll8ppal3dk7zsg5bqwcc5lg3ynk2pz4";
};
nativeBuildInputs = [ perl /* for pod2man */ ];
CPPFLAGS = [ "-Dunix" ] ++
lib.optional (!stdenv.isi686 && !stdenv.isx86_64) "-DNOJIT";
CXXFLAGS = [ "-O3" "-DNDEBUG" ];
enableParallelBuilding = true;
makeFlags = [ "CXX=${stdenv.cc.targetPrefix}c++" ];
installFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
description = "Incremental journaling backup utility and archiver";
homepage = "http://mattmahoney.net/dc/zpaq.html";
license = licenses.gpl3Plus ;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,40 @@
{ lib, stdenv, fetchurl, unzip }:
let
compileFlags = lib.concatStringsSep " " ([ "-O3" "-DNDEBUG" ]
++ lib.optional (stdenv.hostPlatform.isUnix) "-Dunix -pthread"
++ lib.optional (!stdenv.hostPlatform.isx86) "-DNOJIT");
in
stdenv.mkDerivation rec {
pname = "zpaqd";
version = "715";
src = fetchurl {
url = "http://mattmahoney.net/dc/zpaqd${version}.zip";
sha256 = "sha256-Mx87Zt0AASk0ZZCjyTzYbhlYJAXBlb59OpUWsqynyCA=";
};
sourceRoot = ".";
nativeBuildInputs = [ unzip ];
buildPhase = ''
$CXX ${compileFlags} -fPIC --shared libzpaq.cpp -o libzpaq.so
$CXX ${compileFlags} -L. -L"$out/lib" -lzpaq zpaqd.cpp -o zpaqd
'';
installPhase = ''
mkdir -p "$out"/{bin,include,lib,share/doc/zpaq}
cp libzpaq.so "$out/lib"
cp zpaqd "$out/bin"
cp libzpaq.h "$out/include"
cp readme_zpaqd.txt "$out/share/doc/zpaq"
'';
meta = with lib; {
description = "ZPAQ archive (de)compressor and algorithm development tool";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
};
}