{"id":17154285,"url":"https://github.com/fanquake/libdmg","last_synced_at":"2025-07-26T05:31:57.907Z","repository":{"id":70272358,"uuid":"195717736","full_name":"fanquake/libdmg","owner":"fanquake","description":"Rust port of the libdmg-hfsplus library","archived":false,"fork":false,"pushed_at":"2019-08-07T00:46:09.000Z","size":81,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-15T21:48:47.043Z","etag":null,"topics":["dmg","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fanquake.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-08T01:47:25.000Z","updated_at":"2023-03-28T03:17:06.000Z","dependencies_parsed_at":"2023-02-22T03:45:50.843Z","dependency_job_id":null,"html_url":"https://github.com/fanquake/libdmg","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fanquake%2Flibdmg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fanquake%2Flibdmg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fanquake%2Flibdmg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fanquake%2Flibdmg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fanquake","download_url":"https://codeload.github.com/fanquake/libdmg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227652550,"owners_count":17799235,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dmg","rust"],"created_at":"2024-10-14T21:48:48.563Z","updated_at":"2024-12-02T00:45:17.980Z","avatar_url":"https://github.com/fanquake.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libdmg\n\n[![Build Status](https://travis-ci.org/fanquake/libdmg.svg?branch=master)](https://travis-ci.org/fanquake/libdmg)\n\nThis is a port of some of the functionality of [planetbeing/libdmg-hfsplus](https://github.com/planetbeing/libdmg-hfsplus).\n\nThe goal is to replace the usage of [`genisoimage`](https://manpages.debian.org/stretch/genisoimage/genisoimage.1.en.html) and `libdmg-hfsplus` in the Bitcoin Core [gitian build process](https://github.com/bitcoin/bitcoin/blob/master/contrib/gitian-descriptors/gitian-osx.yml#L141). \n\nThe reason for the port is that `libdmg-hfsplus` is seemingly unmaintained and contains various bugs; some of which have been patched in a [fork](https://github.com/theuni/libdmg-hfsplus) used by Bitcoin Core. For our usage, `genisoimage` does not create deterministic files by default, so it has also been [patched](https://github.com/bitcoin/bitcoin/blob/master/depends/patches/native_cdrkit/cdrkit-deterministic.patch). It cannot compress DMGs, hence the need for `libdmg-hfsplus`.\n\nIdeally we could have a single, well-documented tool, that can not only create and compress DMGs from scratch, but also take care of inserting `.DS_Store` related metadata (which would remove the need for [another script](https://github.com/bitcoin/bitcoin/blob/master/contrib/macdeploy/custom_dsstore.py)).\n\nThe `DMG` format is proprietary and not well documented. As a result it has been reverse engineered by multiple parties. The following resources are useful when trying to understand it:\n\n* [ApplePartitions.ppt](http://www.cse.scu.edu/~tschwarz/COEN252_09/PPtPre/ApplePartitions.ppt)\n* http://newosxbook.com/DMG.html\n* [hdiutil](https://ss64.com/osx/hdiutil.html)\n* [Deterministic macOS DMG Notes](https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md#deterministic-macos-dmg-notes)\n* [Secrets of the GPT](https://developer.apple.com/library/archive/technotes/tn2166/_index.html)\n\n## Usage\n\n```bash\nmkdir my_dmg\necho \"Hello World\" \u003e my_dmg/hello.txt\n\n# create a basic dmg containing hello.txt\nhdiutil create -ov -volname \"Test DMG\" -srcfolder my_dmg my.dmg\n\u003e created: ..../my.dmg\n\n# open DMG and inspect contents\nhdiutil attach my.dmg\n\n# Build binary\ncarog build\n\n# Inspect dmg\ncargo run inspect my.dmg\n...\nInspecting: \"my.dmg\"\n\nudif: KolyBlock {\n    magic: 1802464377,\n    version: 4,\n    header_size: 512,\n    flags: 1,\n    running_data_fork_offset: 0,\n    data_fork_offset: 0,\n    data_fork_length: 8162,\n    ....\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffanquake%2Flibdmg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffanquake%2Flibdmg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffanquake%2Flibdmg/lists"}