Merge pull request #292240 from wegank/nosql-workbench-7zz

nosql-workbench: unpack with 7zz
This commit is contained in:
Nick Cao 2024-02-29 10:11:46 -05:00 committed by GitHub
commit 6031a5dc5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,7 +4,7 @@
fetchurl,
jdk21,
stdenv,
undmg
_7zz
}:
let
pname = "nosql-workbench";
@ -39,30 +39,19 @@ if stdenv.isDarwin then stdenv.mkDerivation {
sourceRoot = ".";
nativeBuildInputs = [ _7zz ];
buildInputs = [ jdk21 ];
# DMG file is using APFS which is unsupported by "undmg".
# Fix found: https://discourse.nixos.org/t/help-with-error-only-hfs-file-systems-are-supported-on-ventura/25873/8
# Instead, use "7zz" to extract the contents.
# "undmg" issue: https://github.com/matthewbauer/undmg/issues/4
unpackCmd = ''
echo "Creating temp directory"
mnt=$(TMPDIR=/tmp mktemp -d -t nix-XXXXXXXXXX)
runHook preUnpack
function finish {
echo "Ejecting temp directory"
/usr/bin/hdiutil detach $mnt -force
rm -rf $mnt
}
# Detach volume when receiving SIG "0"
trap finish EXIT
7zz x $curSrc
# Mount DMG file
echo "Mounting DMG file into \"$mnt\""
/usr/bin/hdiutil attach -nobrowse -mountpoint $mnt $curSrc
# Copy content to local dir for later use
echo 'Copying extracted content into "sourceRoot"'
cp -a $mnt/NoSQL\ Workbench.app $PWD/
runHook postUnpack
'';
installPhase = ''