Merge pull request #217846 from 06kellyjac/p7zip

This commit is contained in:
Sandro 2023-03-13 22:33:11 +01:00 committed by GitHub
commit 3d27f7f887
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 17 deletions

View File

@ -27,7 +27,7 @@ buildPythonPackage rec {
rm 7z 7z.so
ln -s ${p7zip}/bin/7z 7z
ln -s ${p7zip}/lib/p7zip/7z.so 7z.so
ln -s ${lib.getLib p7zip}/lib/p7zip/7z.so 7z.so
popd
'';

View File

@ -1,16 +1,16 @@
{ stdenv, fetchFromGitHub, fetchpatch, lib, enableUnfree ? false }:
{ lib, stdenv, fetchFromGitHub, enableUnfree ? false }:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "p7zip";
version = "17.04";
version = "17.05";
src = fetchFromGitHub {
owner = "jinfeihan57";
repo = pname;
rev = "v${version}";
owner = "p7zip-project";
repo = "p7zip";
rev = "v${finalAttrs.version}";
sha256 = {
free = "sha256-DrBuf2VPdcprHI6pMSmL7psm2ofOrUf0Oj0qwMjXzkk=";
unfree = "sha256-19F4hPV0nKVuFZNbOcXrcA1uW6Y3HQolaHVIYXGmh18=";
free = "sha256-5r7M9BVcAryZNTkqJ/BfHnSSWov1PwoZhUnLBwEbJoA=";
unfree = "sha256-z3qXgv/TkNRbb85Ew1OcJNxoyssfzHShc0b0/4NZOb0=";
}.${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,
@ -38,8 +38,6 @@ stdenv.mkDerivation rec {
--replace 'CXX=g++' 'CXX=${stdenv.cc.targetPrefix}g++'
'';
makeFlags = [ "DEST_HOME=${placeholder "out"}" ];
preConfigure = ''
buildFlags=all3
'' + lib.optionalString stdenv.isDarwin ''
@ -47,15 +45,22 @@ stdenv.mkDerivation rec {
'';
enableParallelBuilding = true;
setupHook = ./setup-hook.sh;
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
makeFlags = [
"DEST_BIN=${placeholder "out"}/bin"
"DEST_SHARE=${placeholder "lib"}/lib/p7zip"
"DEST_MAN=${placeholder "man"}/share/man"
"DEST_SHARE_DOC=${placeholder "doc"}/share/doc/p7zip"
];
outputs = [ "out" "lib" "doc" "man" ];
setupHook = ./setup-hook.sh;
passthru.updateScript = ./update.sh;
meta = with lib; {
homepage = "https://github.com/jinfeihan57/p7zip";
homepage = "https://github.com/p7zip-project/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
@ -68,4 +73,4 @@ stdenv.mkDerivation rec {
platforms = platforms.unix;
mainProgram = "7z";
};
}
})

View File

@ -7,7 +7,7 @@ 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')"
NEW_VERSION="$(curl https://api.github.com/repos/p7zip-project/p7zip/releases/latest | jq .tag_name -r | tr -d 'v')"
echo "comparing versions $OLD_VERSION => $NEW_VERSION"
if [[ "$OLD_VERSION" == "$NEW_VERSION" ]]; then