diff --git a/pkgs/tools/archivers/undmg/default.nix b/pkgs/tools/archivers/undmg/default.nix new file mode 100644 index 000000000000..5cb7bf2c62fc --- /dev/null +++ b/pkgs/tools/archivers/undmg/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchFromGitHub, zlib, bzip2 }: + +stdenv.mkDerivation rec { + version = "1.0.2"; + name = "undmg-${version}"; + + src = fetchFromGitHub { + owner = "matthewbauer"; + repo = "undmg"; + rev = "refs/tags/v${version}"; + sha256 = "0w9vwvj9zbpsjkg251bwv9y10wjyjmh54q2piklz74w64rlbqblr"; + name = "undmg-${version}"; + }; + + buildInputs = [ zlib bzip2 ]; + + setupHook = ./setup-hook.sh; + + installFlags = "PREFIX=\${out}"; + + meta = { + homepage = https://github.com/matthewbauer/undmg; + description = "Extract a DMG file"; + license = stdenv.lib.licenses.gpl3; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/tools/archivers/undmg/setup-hook.sh b/pkgs/tools/archivers/undmg/setup-hook.sh new file mode 100644 index 000000000000..e5c8dda23b6a --- /dev/null +++ b/pkgs/tools/archivers/undmg/setup-hook.sh @@ -0,0 +1,5 @@ +unpackCmdHooks+=(_tryUnpackDmg) +_tryUnpackDmg() { + if ! [[ "$curSrc" =~ \.dmg$ ]]; then return 1; fi + undmg < "$curSrc" +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 59da78dacf24..5746562b759e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3728,6 +3728,8 @@ let unzipNLS = lowPrio (unzip.override { enableNLS = true; }); + undmg = callPackage ../tools/archivers/undmg { }; + uptimed = callPackage ../tools/system/uptimed { }; urjtag = callPackage ../tools/misc/urjtag {