Created
April 29, 2025 16:55
-
-
Save fscm/153ab5e85455423e33613ff96f7c25a1 to your computer and use it in GitHub Desktop.
Revisions
-
fscm created this gist
Apr 29, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,81 @@ # [macOS] Install unrar tool from source Instructions on how to install the `unrar` command on macOS from source. ## Prerequisites macOS Command Line Tools need to be installed on your local computer. To install the Command Line Tools run the following command: ```sh xcode-select --install ``` ## Get the source To obtain the GNU Tar tool source code run the following commands: ```sh mkdir -p ~/.src/unrar curl --silent --location --retry 3 "https://www.rarlab.com/rar/unrarsrc-7.1.6.tar.gz" | tar xz --no-same-owner --strip-components=1 -C ~/.src/unrar cd ~/.src/unrar ``` ## Configure No configuration required. ## Build To build the source code run the following command: ```sh make --silent --no-print-directory -f makefile unrar ``` ## Install To install the tool run the following commands: ```sh sudo install -v -m 0755 unrar /usr/local/bin ``` ## Verify Run the following command on a terminal window: ```sh unrar ``` ## Libraries First clean the previous build objects using the following command: ```sh rm -f *.o ``` To build the libraries run the following command: ```sh make --silent --no-print-directory -f makefile lib ``` To install the libraries run the following command: ```sh mv libunrar.so libunrar.dylib sudo install -v libunrar.* /usr/local/lib ``` ## Clean up After installing the tool you can remove the downloaded source code using the following commands: ```sh cd ~ rm -rf ~/.src ```