Unverified Commit 6c33e896 authored by dotlambda's avatar dotlambda Committed by GitHub
Browse files

exiftool: add missing dependencies (#368911)

parents b970f461 ab003840
Loading
Loading
Loading
Loading
+53 −0
Original line number Diff line number Diff line
{
  lib,
  brotli,
  buildPerlPackage,
  fetchurl,
  perlPackages,
  pkg-config,
}:

buildPerlPackage {
  pname = "IO-Compress-Brotli";
  version = "0.019";

  src = fetchurl {
    url = "mirror://cpan/authors/id/T/TI/TIMLEGGE/IO-Compress-Brotli-0.019.tar.gz";
    hash = "sha256-N/QN187kSs6iby92Onc+YdTsIjMF3e7KRhJEPL8oj78=";
  };

  patches = [
    # Use system brotli in Makefile.PL
    ./use-system-brotli.patch
  ];

  postPatch = ''
    substituteInPlace Makefile.PL \
      --replace-fail "@LIBS@" "-L${lib.getLib brotli}/lib -lbrotlienc -lbrotlidec -lbrotlicommon"
  '';

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [
    brotli
    perlPackages.FileSlurper
  ];

  propagatedBuildInputs = with perlPackages; [
    FileSlurper
    GetoptLong
  ];

  env.NIX_CFLAGS_COMPILE = "-I${lib.getDev brotli}/include";

  meta = {
    description = "Write Brotli buffers/streams";
    homepage = "https://github.com/timlegge/perl-IO-Compress-Brotli";
    changelog = "https://github.com/timlegge/perl-IO-Compress-Brotli/blob/main/Changes";
    license = with lib.licenses; [
      artistic1
      gpl1Plus
    ];
    maintainers = [ lib.maintainers.anthonyroussel ];
  };
}
+40 −0
Original line number Diff line number Diff line
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,6 +1,5 @@
 use 5.014000;
 use ExtUtils::MakeMaker;
-use Alien::cmake3;
 use File::Spec::Functions qw/catfile/;

 WriteMakefile(
@@ -17,16 +16,7 @@
 		'Getopt::Long'  => '0',
 		'Time::HiRes'   => '0',
 	},
-	CONFIGURE_REQUIRES   => {
-		'Alien::cmake3' => '0',
-	},
-	BUILD_REQUIRES   => {
-		'Alien::cmake3' => '0',
-	},
-	INC              => '-Ibrotli/c/include',
-	MYEXTLIB         => $myextlib,
-	EXTRALIBS        => ' brotli/libbrotlienc$(LIB_EXT) brotli/libbrotlidec$(LIB_EXT) brotli/libbrotlicommon$(LIB_EXT) ',
-	clean            => { FILES => "brotli/Makefile $myextlib brotli/CMakeCache.txt brotli/CMakeFiles/* brotli/CTestTestfile.cmake brotli/DartConfiguration.tcl brotli/brotli* brotli/cmake_install.cmake brotli/libbrotlicommon.pc brotli/libbrotlidec.pc brotli/libbrotlienc.pc" },
+	LIBS             => "@LIBS@",
 	META_ADD         => {
 		dynamic_config => 0,
 		resources      => {
@@ -33,12 +24,3 @@
 		},
 	}
 );
-
-sub MY::postamble {
-    my @dirs = Alien::cmake3->bin_dir;
-    my $cmake = defined $dirs[0] ? catfile($dirs[0] , Alien::cmake3->exe) : Alien::cmake3->exe;
-'
-$(MYEXTLIB): brotli/CMakeLists.txt
-	cd brotli && "' . $cmake . '"' . $cmake_options . ' -DCMAKE_MAKE_PROGRAM=$(MAKE) -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./installed . && $(MAKE)
-'
-}
+13 −2
Original line number Diff line number Diff line
@@ -6,6 +6,10 @@
  shortenPerlShebang,
  stdenv,
  versionCheckHook,
  ArchiveZip,
  CompressRawLzma,
  IOCompress,
  IOCompressBrotli,
}:

buildPerlPackage rec {
@@ -19,12 +23,19 @@ buildPerlPackage rec {
    hash = "sha256-GPm3HOt7fNMbXRrV5V+ykJAfhww1O6NrD0l/7hA2i28=";
  };

  nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang;

  postPatch = ''
    patchShebangs exiftool
  '';

  nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin shortenPerlShebang;

  propagatedBuildInputs = [
    ArchiveZip
    CompressRawLzma
    IOCompress
    IOCompressBrotli
  ];

  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
    shortenPerlShebang $out/bin/exiftool
  '';
+2 −0
Original line number Diff line number Diff line
@@ -17446,6 +17446,8 @@ with self;
    };
  };
  IOCompressBrotli = callPackage ../development/perl-modules/IOCompressBrotli { };
  IODigest = buildPerlPackage {
    pname = "IO-Digest";
    version = "0.11";