lol

Merge pull request #180172 from PedroHLC/unzip-no-lchmod

unzip: no-lchmod build flag

authored by

Sandro and committed by
GitHub
9b45da9a 629b931d

+5 -12
+1 -11
pkgs/applications/networking/instant-messengers/discord/openasar.nix
··· 1 1 { lib, stdenv, fetchFromGitHub, nodejs, bash, nodePackages, unzip }: 2 2 3 - let 4 - # OpenAsar fails with default unzip, throwing "lchmod (file attributes) error: Operation not supported" 5 - unzipFix = 6 - if stdenv.isLinux then 7 - unzip.overrideAttrs (oldAttrs: { 8 - buildFlags = oldAttrs.buildFlags ++ [ "LOCAL_UNZIP=-DNO_LCHMOD" ]; 9 - }) 10 - else 11 - unzip; 12 - in 13 3 stdenv.mkDerivation rec { 14 4 pname = "openasar"; 15 5 version = "unstable-2022-06-27"; ··· 24 14 postPatch = '' 25 15 # Hardcode unzip path 26 16 substituteInPlace ./src/updater/moduleUpdater.js \ 27 - --replace \'unzip\' \'${unzipFix}/bin/unzip\' 17 + --replace \'unzip\' \'${unzip}/bin/unzip\' 28 18 # Remove auto-update feature 29 19 echo "module.exports = async () => log('AsarUpdate', 'Removed');" > ./src/asarUpdate.js 30 20 '';
+4 -1
pkgs/tools/archivers/unzip/default.nix
··· 60 60 "generic" 61 61 "D_USE_BZ2=-DUSE_BZIP2" 62 62 "L_BZ2=-lbz2" 63 - ]; 63 + ] 64 + # `lchmod` is not available on Linux, so we remove it to fix "not supported" errors (when the zip file contains symlinks). 65 + # Alpine (musl) and Debian (glibc) also add this flag. 66 + ++ lib.optionals stdenv.isLinux [ "LOCAL_UNZIP=-DNO_LCHMOD" ]; 64 67 65 68 preConfigure = '' 66 69 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