From 357fd7eb6023164647b62ff6d6f884c2aa4a0b10 Mon Sep 17 00:00:00 2001 From: Hamish McIntyre-Bhatty Date: Sat, 27 Aug 2022 13:51:38 +0100 Subject: [PATCH] Remove '$' from commands except where it is made clear that they are running inside Darling. This is done for consistency in the remaining places that still use the '$' sign. --- src/build-instructions.md | 129 ++++++++++++++------------- src/contributing/README.md | 6 +- src/contributing/debugging.md | 23 +++-- src/contributing/generating-stubs.md | 12 +-- src/contributing/packaging.md | 20 +++-- src/darling-prefix.md | 2 +- src/darling-shell.md | 2 +- src/uninstall.md | 4 +- src/what-to-try.md | 2 +- 9 files changed, 109 insertions(+), 91 deletions(-) diff --git a/src/build-instructions.md b/src/build-instructions.md index 2e20753..263989e 100644 --- a/src/build-instructions.md +++ b/src/build-instructions.md @@ -13,80 +13,85 @@ Linux 5.0 or higher is required. **Debian 10/11** - ``` - $ sudo apt install cmake clang-6.0 bison flex xz-utils libfuse-dev libudev-dev pkg-config \ - libc6-dev-i386 libcap2-bin git git-lfs python2 libglu1-mesa-dev libcairo2-dev \ - libgl1-mesa-dev libtiff5-dev libfreetype6-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev \ - libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libpulse-dev libavformat-dev libavcodec-dev \ - libswresample-dev libdbus-1-dev libxkbfile-dev libssl-dev - ```` +``` +sudo apt install cmake clang-6.0 bison flex xz-utils libfuse-dev libudev-dev pkg-config \ +libc6-dev-i386 libcap2-bin git git-lfs python2 libglu1-mesa-dev libcairo2-dev \ +libgl1-mesa-dev libtiff5-dev libfreetype6-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev \ +libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libpulse-dev libavformat-dev libavcodec-dev \ +libswresample-dev libdbus-1-dev libxkbfile-dev libssl-dev +``` **Debian Testing** - ``` - $ sudo apt install cmake clang-9 bison flex xz-utils libfuse-dev libudev-dev pkg-config \ - libc6-dev-i386 libcap2-bin git git-lfs python2 libglu1-mesa-dev libcairo2-dev \ - libgl1-mesa-dev libtiff5-dev libfreetype6-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev \ - libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libpulse-dev libavformat-dev libavcodec-dev \ - libswresample-dev libdbus-1-dev libxkbfile-dev libssl-dev - ``` +``` +sudo apt install cmake clang-9 bison flex xz-utils libfuse-dev libudev-dev pkg-config \ +libc6-dev-i386 libcap2-bin git git-lfs python2 libglu1-mesa-dev libcairo2-dev \ +libgl1-mesa-dev libtiff5-dev libfreetype6-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev \ +libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libpulse-dev libavformat-dev libavcodec-dev \ +libswresample-dev libdbus-1-dev libxkbfile-dev libssl-dev +``` **Ubuntu 18.04/20.04:** - ``` - $ sudo apt install cmake clang bison flex libfuse-dev libudev-dev pkg-config libc6-dev-i386 \ - gcc-multilib libcairo2-dev libgl1-mesa-dev libglu1-mesa-dev libtiff5-dev \ - libfreetype6-dev git git-lfs libelf-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev libbsd-dev \ - libxrandr-dev libxcursor-dev libgif-dev libavutil-dev libpulse-dev libavformat-dev libavcodec-dev \ - libswresample-dev libdbus-1-dev libxkbfile-dev libssl-dev python2 - ``` +``` +sudo apt install cmake clang bison flex libfuse-dev libudev-dev pkg-config libc6-dev-i386 \ +gcc-multilib libcairo2-dev libgl1-mesa-dev libglu1-mesa-dev libtiff5-dev \ +libfreetype6-dev git git-lfs libelf-dev libxml2-dev libegl1-mesa-dev libfontconfig1-dev +libbsd-dev libxrandr-dev libxcursor-dev libgif-dev libavutil-dev libpulse-dev \ +libavformat-dev libavcodec-dev libswresample-dev libdbus-1-dev libxkbfile-dev \ +libssl-dev python2 +``` **Arch Linux & Manjaro:** - ``` - $ sudo pacman -S --needed make cmake clang flex bison icu fuse gcc-multilib \ - lib32-gcc-libs pkg-config fontconfig cairo libtiff python2 mesa llvm libbsd libxkbfile \ - libxcursor libxext libxkbcommon libxrandr ffmpeg git git-lfs - ``` +``` +sudo pacman -S --needed make cmake clang flex bison icu fuse gcc-multilib \ +lib32-gcc-libs pkg-config fontconfig cairo libtiff python2 mesa llvm libbsd libxkbfile \ +libxcursor libxext libxkbcommon libxrandr ffmpeg git git-lfs +``` **Fedora and CentOS** - [RPMFusion](https://rpmfusion.org/RPM%20Fusion) is required for FFmpeg. +[RPMFusion](https://rpmfusion.org/RPM%20Fusion) is required for FFmpeg. - ``` - $ sudo dnf install make cmake clang bison dbus-devel flex python2 glibc-devel.i686 fuse-devel \ - systemd-devel elfutils-libelf-devel cairo-devel freetype-devel.{x86_64,i686} \ - libjpeg-turbo-devel.{x86_64,i686} libtiff-devel.{x86_64,i686} fontconfig-devel.{x86_64,i686} \ - libglvnd-devel.{x86_64,i686} mesa-libGL-devel.{x86_64,i686} mesa-libEGL-devel.{x86_64,i686} \ - mesa-libGLU-devel.{x86_64,i686} libxml2-devel libbsd-devel git git-lfs libXcursor-devel libXrandr-devel giflib-devel \ - ffmpeg-devel pulseaudio-libs-devel libxkbfile-devel openssl-devel llvm libcap-devel - ``` +``` +sudo dnf install make cmake clang bison dbus-devel flex python2 glibc-devel.i686 fuse-devel \ +systemd-devel elfutils-libelf-devel cairo-devel freetype-devel.{x86_64,i686} \ +libjpeg-turbo-devel.{x86_64,i686} libtiff-devel.{x86_64,i686} fontconfig-devel.{x86_64,i686} \ +libglvnd-devel.{x86_64,i686} mesa-libGL-devel.{x86_64,i686} mesa-libEGL-devel.{x86_64,i686} \ +mesa-libGLU-devel.{x86_64,i686} libxml2-devel libbsd-devel git git-lfs libXcursor-devel \ +libXrandr-devel giflib-devel ffmpeg-devel pulseaudio-libs-devel libxkbfile-devel \ +openssl-devel llvm libcap-devel +``` **OpenSUSE Tumbleweed** - You will need to build Darling with only the 64bit components. See **Build Options** for instructions. +You will need to build Darling with only the 64bit components. See **Build Options** for instructions. - ``` - $ sudo zypper install make cmake-full clang10 bison flex python-base glibc fuse-devel libsystemd0 \ - libelf1 cairo-devel libfreetype6 libjpeg-turbo libfontconfig1 libglvnd Mesa-libGL-devel \ - Mesa-libEGL-devel libGLU1 libxml2-tools libbsd-devel git git-lfs libXcursor-devel giflib-devel ffmpeg-4 \ - ffmpeg-4-libavcodec-devel ffmpeg-4-libavformat-devel libpulse-devel pulseaudio-utils libxkbfile-devel \ - openssl llvm libcap-progs libtiff-devel libjpeg8-devel libXrandr-devel dbus-1-devel glu-devel ffmpeg-4-libswresample-devel - ``` +``` +sudo zypper install make cmake-full clang10 bison flex python-base glibc fuse-devel \ +libsystemd0 libelf1 cairo-devel libfreetype6 libjpeg-turbo libfontconfig1 libglvnd \ +Mesa-libGL-devel Mesa-libEGL-devel libGLU1 libxml2-tools libbsd-devel git git-lfs \ +libXcursor-devel giflib-devel ffmpeg-4 ffmpeg-4-libavcodec-devel \ +ffmpeg-4-libavformat-devel libpulse-devel pulseaudio-utils libxkbfile-devel openssl \ +llvm libcap-progs libtiff-devel libjpeg8-devel libXrandr-devel dbus-1-devel glu-devel \ +ffmpeg-4-libswresample-devel +``` **Alpine Linux** - Make sure to [enable the community repository](https://wiki.alpinelinux.org/wiki/Enable_Community_Repository). - Alpine also doesn't support 32-bit builds, so make sure to [disable that](#disabling-32-bit-libraries). +Make sure to [enable the community repository](https://wiki.alpinelinux.org/wiki/Enable_Community_Repository). +Alpine also doesn't support 32-bit builds, so make sure to [disable that](#disabling-32-bit-libraries). - ```sh - $ sudo apk add cmake clang bison flex xz fuse-dev pkgconfig libcap git git-lfs python2 python3 glu-dev \ - cairo-dev mesa-dev tiff-dev freetype-dev libxml2-dev fontconfig-dev libbsd-dev libxrandr-dev libxcursor-dev \ - giflib-dev pulseaudio-dev ffmpeg-dev dbus-dev libxkbfile-dev openssl-dev libexecinfo-dev make gcc g++ xdg-user-dirs - ``` +```sh +sudo apk add cmake clang bison flex xz fuse-dev pkgconfig libcap git git-lfs python2 \ +python3 glu-dev cairo-dev mesa-dev tiff-dev freetype-dev libxml2-dev fontconfig-dev \ +libbsd-dev libxrandr-dev libxcursor-dev giflib-dev pulseaudio-dev ffmpeg-dev dbus-dev \ +libxkbfile-dev openssl-dev libexecinfo-dev make gcc g++ xdg-user-dirs +``` - These are the minimum requirements for building and running Darling on Alpine. Of course, if you want to run GUI applications, - you'll also need a desktop environment. +These are the minimum requirements for building and running Darling on Alpine. +Of course, if you want to run GUI applications, you'll also need a desktop environment. # Fetch the Sources @@ -95,7 +100,7 @@ Darling uses git-lfs. Set this up if needed with [official instructions](https:/ Darling makes extensive use of Git submodules, therefore you cannot use a plain `git clone`. Make a clone like this: ``` -$ git clone --recursive https://github.com/darlinghq/darling.git +git clone --recursive https://github.com/darlinghq/darling.git ``` **Attention:** The source tree requires up to 5 GB of disk space! @@ -105,10 +110,10 @@ $ git clone --recursive https://github.com/darlinghq/darling.git If you have already cloned Darling and would like to get the latest changes, do this in the source root: ``` -$ git lfs install -$ git pull -$ git submodule init -$ git submodule update +git lfs install +git pull +git submodule init +git submodule update ``` # Build @@ -123,17 +128,17 @@ Now let's build Darling: ``` # Move into the cloned sources -$ cd darling +cd darling # Make a build directory -$ mkdir build && cd build +mkdir build && cd build # Configure the build -$ cmake .. +cmake .. # Build and install Darling -$ make -$ sudo make install +make +sudo make install ``` ## Build Options diff --git a/src/contributing/README.md b/src/contributing/README.md index 64d9b39..65d8d72 100644 --- a/src/contributing/README.md +++ b/src/contributing/README.md @@ -7,8 +7,8 @@ If you are familiar with how GitHub Pull Requests work, you should feel right at Locate the repository that you made changes in on GitHub. The following command can help. ``` -$ cd darling/src/external/less -$ git remote get-url origin +cd darling/src/external/less +git remote get-url origin https://github.com/darlinghq/darling-less.git ``` If it is an `https` scheme then you can paste the URL directly into your browser. @@ -24,7 +24,7 @@ Create and check out a branch describing your changes. In this example, we will use `reinvent-wheel`. Next, add your fork as a remote. ``` -$ git remote add my-fork git@github.com:user/darling-less.git +git remote add my-fork git@github.com:user/darling-less.git ``` After this, push your commits to your fork. diff --git a/src/contributing/debugging.md b/src/contributing/debugging.md index 3987ae3..9fb9e66 100644 --- a/src/contributing/debugging.md +++ b/src/contributing/debugging.md @@ -29,13 +29,13 @@ If you're having trouble using LLDB normally, you may get luckier by running the In one terminal, start the `debugserver`: ``` -$ ./debugserver 127.0.0.1:12345 /bin/bash +./debugserver 127.0.0.1:12345 /bin/bash ``` In another terminal, connect to the server in LLDB: ``` -$ ./lldb +./lldb (lldb) platform select remote-macosx Platform: remote-macosx Connected: no @@ -77,7 +77,10 @@ Illegal instruction: 4 (core dumped) After a core dump is generated, you will need to locate the core dump. `coredumpctl list -r` will give you a list of core dumps (where the newest entries are listed first). ``` -$ coredumpctl list -r +coredumpctl list -r +``` + +``` TIME PID UID GID SIG COREFILE EXE Sat 2022-08-13 23:43:20 PDT 812790 1000 1000 SIGILL present /usr/local/libexec/darling/usr/libexec/darling/mldr ``` @@ -119,7 +122,7 @@ When this is not enough, you can use **libgmalloc**, which is (for the most part) a drop-in replacement for libmalloc. This is how you use it: ``` -$ DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib DYLD_FORCE_FLAT_NAMESPACE=1 ./test` +DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib DYLD_FORCE_FLAT_NAMESPACE=1 ./test` ``` libgmalloc catches memory issues such as use-after-free and buffer overflows, @@ -156,7 +159,10 @@ You can use **xtrace** to trace Darwin syscalls a program makes, a lot like using `strace` on Linux: ``` -$ xtrace vm_stat +xtrace vm_stat +``` + +``` [139] fstat64(1, 0x7fffffdfe340) -> 0 [139] host_self_trap() -> port right 2563 [139] mach_msg_trap(0x7fffffdfdfc0, MACH_SEND_MSG|MACH_RCV_MSG, 40, 1072, port 1543, 0, port 0) @@ -212,7 +218,10 @@ In `src/kernel/emulation/linux/mach/lkm.c`, you can add the following print stat This will print out values stored in `applep`. One benefit of this is that you get to see which programs are being executed. ``` -$ darling shell +darling shell +``` + +``` Bootstrapping the container with launchd... applep is not NULL applep[0] = executable_path=/usr/libexec/darling/vchroot @@ -233,4 +242,4 @@ applep is not NULL ... ``` -Just keep in mind that some scripts can break with this change. \ No newline at end of file +Just keep in mind that some scripts can break with this change. diff --git a/src/contributing/generating-stubs.md b/src/contributing/generating-stubs.md index 440971d..b5a0b04 100644 --- a/src/contributing/generating-stubs.md +++ b/src/contributing/generating-stubs.md @@ -13,14 +13,14 @@ following commands into Terminal. Create the `bin` folder if it doesn't exist: ``` -$ mkdir ~/bin +mkdir ~/bin ``` If you `PATH` variable does not include the `bin` folder, you will need to add it. ``` # For bash -$ echo "export PATH=\"~/bin:\$PATH\"" >> ~/.bash_profile && source ~/.bash_profile +echo "export PATH=\"~/bin:\$PATH\"" >> ~/.bash_profile && source ~/.bash_profile # For zsh % echo "export PATH=\"\$HOME/bin:\$PATH\"" >> ~/.zshenv && source ~/.zshenv ``` @@ -31,7 +31,7 @@ Copy/paste the following command into Terminal. It will download both `darling-stub-gen` and `class-dump` and place it in the `bin` folder ``` -$ curl https://raw.githubusercontent.com/darlinghq/darling/master/tools/darling-stub-gen -o ~/bin/darling-stub-gen && chmod +x ~/bin/darling-stub-gen && curl https://github.com/darlinghq/class-dump/releases/download/mojave/class-dump -L -o ~/bin/class-dump && chmod +x ~/bin/class-dump +curl https://raw.githubusercontent.com/darlinghq/darling/master/tools/darling-stub-gen -o ~/bin/darling-stub-gen && chmod +x ~/bin/darling-stub-gen && curl https://github.com/darlinghq/class-dump/releases/download/mojave/class-dump -L -o ~/bin/class-dump && chmod +x ~/bin/class-dump ``` ## Using the stub generator @@ -39,7 +39,7 @@ $ curl https://raw.githubusercontent.com/darlinghq/darling/master/tools/darling- To run the stub generator, structure your arguments like this: ``` -$ darling-stub-gen /System/Library/Frameworks/DVDPlayback.framework/DVDPlayback DVDPlayback +darling-stub-gen /System/Library/Frameworks/DVDPlayback.framework/DVDPlayback DVDPlayback ``` The process is identical for dynamic libraries. @@ -61,8 +61,8 @@ the folder inside the include directory (ex: `MyNewFolder/include/MyNewFolder`). Example: ``` -$ cd src/frameworks/include/ -$ ln -s ../MyNewFolder/include/MyNewFolder MyNewFolder` +cd src/frameworks/include/ +ln -s ../MyNewFolder/include/MyNewFolder MyNewFolder` ``` Finally, you will need to add the folder to the build. In diff --git a/src/contributing/packaging.md b/src/contributing/packaging.md index f64b5f0..96cc8c0 100644 --- a/src/contributing/packaging.md +++ b/src/contributing/packaging.md @@ -7,27 +7,31 @@ To package Darling for Debian-based systems, we provide the `tools/debian/makede All output files are stored in the parent directory of the source root because of a technical limitation of `debuild`. ### Install Dependencies -```bash -$ sudo apt install devscripts equivs dpkg-dev debhelper +``` +bash +sudo apt install devscripts equivs dpkg-dev debhelper ``` ### Building Binary Packages #### Install Build Dependencies -```bash -$ sudo mk-build-deps -ir +``` +bash +sudo mk-build-deps -ir ``` #### Build -```bash -$ tools/debian/make-deb +``` +bash +tools/debian/make-deb ``` ### Build Source Packages Use this if you want to upload to a service like Launchpad. -```bash -$ tools/debian/make-deb --dsc +``` +bash +tools/debian/make-deb --dsc ``` ## RPM diff --git a/src/darling-prefix.md b/src/darling-prefix.md index a36a5ed..4c63f1e 100644 --- a/src/darling-prefix.md +++ b/src/darling-prefix.md @@ -13,7 +13,7 @@ When you run an executable inside the prefix for the first time (after boot), `l Unlike Wine, Darling doesn't need to update the prefix whenever the Darling installation is updated. There is one caveat, though: since overlayfs caches the contents of underlying file system(s), you may need to terminate the container to see Darling's updated files: ``` -$ darling shutdown +darling shutdown ``` Note that this will terminate all processes running in the container. diff --git a/src/darling-shell.md b/src/darling-shell.md index 6ed6a28..bc8e521 100644 --- a/src/darling-shell.md +++ b/src/darling-shell.md @@ -35,7 +35,7 @@ emulation](internals/basics/system-call-emulation.md) and may not see the macOS-like environment: ``` -$ darling shell +darling shell Darling [~]$ uname Darwin Darling [~]$ /Volumes/SystemRoot/bin/uname diff --git a/src/uninstall.md b/src/uninstall.md index 450b750..470fc8f 100644 --- a/src/uninstall.md +++ b/src/uninstall.md @@ -7,6 +7,6 @@ This page is only for if Darling was build and installed manually as instructed The following commands will completely remove Darling. Replace the source root with the path to your local copy of the Darling source code. ``` -$ cd darling -$ tools/uninstall +cd darling +tools/uninstall ``` diff --git a/src/what-to-try.md b/src/what-to-try.md index ab5fa96..871486c 100644 --- a/src/what-to-try.md +++ b/src/what-to-try.md @@ -19,7 +19,7 @@ It works! of the core OS. On Linux distributions, it prints "Linux": ``` -$ uname +uname Linux ```