├── .github └── workflows │ └── build-qemu.yml ├── README.md ├── build-qemu.sh └── build.sh /.github/workflows/build-qemu.yml: -------------------------------------------------------------------------------- 1 | name: Build Qemu 2 | on: 3 | push: 4 | branches: 5 | - "main" 6 | pull_request: {} 7 | jobs: 8 | build: 9 | runs-on: ${{ matrix.os }} 10 | strategy: 11 | fail-fast: false 12 | matrix: 13 | os: 14 | - macOS-13 15 | steps: 16 | - name: Check out repository code 17 | uses: actions/checkout@v4 18 | - name: install build dependencies for Qemu 19 | run: brew install automake autoconf libtool cmake meson ninja wget pkg-config 20 | - name: mkdir prefix /opt/podman/qemu 21 | run: sudo mkdir -p /opt/podman/qemu && sudo chown -R $USER:admin /opt/podman 22 | - name: install setuptools pythong module needed by ninja 23 | run: python3 -m pip install -U setuptools 24 | - name: check distutils can be imported 25 | run: python3 -c 'import distutils; help(distutils)' 26 | - name: Build Qemu 27 | run: ./build-qemu.sh 28 | - name: Upload qemu artifact 29 | uses: actions/upload-artifact@v4 30 | with: 31 | name: qemu-test-build 32 | path: "./qemu-macos-amd64.tar.xz" 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Qemu build for macOS 2 | 3 | ### How to use the scripts 4 | - install some dependencies, these should already exist if brew is used 5 | ``` 6 | $ brew install ronn gengetopt automake autoconf libtool cmake meson ninja 7 | ``` 8 | - run the `build-qemu.sh` script 9 | ``` 10 | $ chmod +x build-qemu.sh 11 | ``` 12 | ``` 13 | # create the prefix/installation directory 14 | $ mkdir -p /opt/podman/qemu 15 | $ chwon -R /opt/podman 16 | 17 | $ PREFIX=/opt/podman/qemu ./build-qemu.sh 18 | ``` 19 | - finally add the `$PREFIX/bin` to `PATH` 20 | ``` 21 | $ export PATH=$PATH:$PREFIX/bin 22 | ``` 23 | - test the build using an alpine image (download **virtual** image: https://www.alpinelinux.org/downloads/) 24 | ``` 25 | $ qemu-system-x86_64 -m 512 -nic user -boot d -cdrom alpine-virt-3.15.4-x86.iso -display cocoa 26 | ``` 27 | -------------------------------------------------------------------------------- /build-qemu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | PREFIX=${PREFIX:-/opt/podman/qemu} 6 | 7 | ! [ -d "${PREFIX}" ] && mkdir -p "${PREFIX}" 8 | 9 | export LIBRARY_PATH="${PREFIX}"/lib 10 | export CPATH="${PREFIX}"/include 11 | export PKG_CONFIG_PATH="${LIBRARY_PATH}"/pkgconfig 12 | export CPPFLAGS=-I"${PREFIX}"/include 13 | export LDFLAGS=-L"${PREFIX}"/lib 14 | 15 | QEMU_SOURCE_URL="https://download.qemu.org/qemu-8.2.1.tar.xz" 16 | 17 | 18 | ## Install following build time dependencies from brew: 19 | ## automake, autoconf, libtool, cmake, meson, ninja, curl, pkg-config 20 | 21 | source build.sh 22 | 23 | function build_qemu_deps() { 24 | build_lib_gettext "$1" 25 | build_lib_libffi "$1" 26 | build_lib_pcre2 "$1" 27 | # glib should always follow the above dependencies (order matters) 28 | build_lib_glib "$1" 29 | 30 | build_lib_gmp "$1" 31 | build_lib_gpgerror "$1" 32 | build_lib_gcrypt "$1" 33 | build_lib_nettle "$1" 34 | build_lib_libpng "$1" 35 | build_lib_jpeg "$1" 36 | build_lib_pixman "$1" 37 | build_lib_libslirp "$1" 38 | build_lib_libusb "$1" 39 | build_lib_lzo "$1" 40 | build_lib_snappy "$1" 41 | build_lib_vde2 "$1" 42 | } 43 | 44 | function build_qemu() { 45 | # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/qemu.rb 46 | build_qemu_deps "${PREFIX}" || exit 1 47 | 48 | export LIBTOOL=glibtool 49 | local source_dir 50 | source_dir=$(download_and_extract "${QEMU_SOURCE_URL}") 51 | 52 | local qemu_target 53 | local macos_version_min_flags 54 | case "$(uname -m)" in 55 | "x86_64") 56 | qemu_target="x86_64-softmmu" 57 | macos_version_min_flags="-mmacosx-version-min=10.15" 58 | export MACOSX_DEPLOYMENT_TARGET=10.15 59 | ;; 60 | "arm64") 61 | qemu_target="aarch64-softmmu" 62 | macos_version_min_flags="-mmacosx-version-min=11.0" 63 | export MACOSX_DEPLOYMENT_TARGET=11.0 64 | ;; 65 | *) 66 | echo "Unknown arch, exiting" 67 | exit 1 68 | ;; 69 | esac 70 | 71 | pushd "${source_dir}" 72 | export PATH=${PREFIX}/bin:${PATH} 73 | export CPPFLAGS="${CPPFLAGS} ${macos_version_min_flags}" 74 | export CFLAGS="${macos_version_min_flags}" 75 | ./configure --disable-bsd-user --disable-guest-agent --disable-curses --disable-libssh --disable-gnutls --enable-vde \ 76 | --enable-virtfs --disable-sdl --enable-cocoa --disable-curses --disable-gtk --disable-zstd --enable-gcrypt \ 77 | --disable-capstone --prefix="${PREFIX}" --target-list="${qemu_target}" 78 | 79 | make V=1 install || exit 1 80 | popd 81 | } 82 | 83 | build_qemu && tar -C "${PREFIX}" -cJf qemu-macos-"${CPU}".tar.xz . 84 | 85 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | LIBGETTEXT_URL="https://ftpmirror.gnu.org/gettext/gettext-0.22.4.tar.gz" 6 | LIBFFI_URL="https://github.com/libffi/libffi/releases/download/v3.4.4/libffi-3.4.4.tar.gz" 7 | LIBPCRE2_URL="https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.bz2" 8 | LIBGLIB_URL="https://download.gnome.org/sources/glib/2.78/glib-2.78.3.tar.xz" 9 | #CA_CERTIFICATE_URL="https://curl.se/ca/cacert-2022-04-26.pem" 10 | LIBGMP_URL="https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz" 11 | LIBNETTLE_URL="https://ftpmirror.gnu.org/nettle/nettle-3.9.1.tar.gz" 12 | #LIBGNUTLS_URL="https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.7/gnutls-3.7.4.tar.xz" 13 | # LIBIDN2_URL="https://ftpmirror.gnu.org/libidn/libidn2-2.3.2.tar.gz" 14 | # LIBUNISTRING_URL="https://ftpmirror.gnu.org/libunistring/libunistring-1.0.tar.gz" 15 | # LIBZSTD_URL="http://fresh-center.net/linux/misc/zstd-1.5.2.tar.gz" 16 | LIBJPEG_URL="https://www.ijg.org/files/jpegsrc.v9f.tar.gz" 17 | LIBPNG_URL="https://downloads.sourceforge.net/project/libpng/libpng16/1.6.40/libpng-1.6.40.tar.xz" 18 | LIBSLIRP_URL="https://gitlab.freedesktop.org/slirp/libslirp/-/archive/v4.7.0/libslirp-v4.7.0.tar.gz" 19 | LIBUSB_URL="https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2" 20 | LIBLZO_URL="https://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz" 21 | LIBPIXMAN_URL="https://cairographics.org/releases/pixman-0.42.2.tar.gz" 22 | LIBSNAPPY_URL="https://github.com/google/snappy/archive/refs/tags/1.1.10.tar.gz" 23 | LIBVDE2_URL="https://github.com/virtualsquare/vde-2/archive/refs/tags/v2.3.3.tar.gz" 24 | #LIBOPENSSL11_URL="http://www.mirrorservice.org/sites/ftp.openssl.org/source/openssl-1.1.1o.tar.gz" 25 | LIBGPGERROR_URL="https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.47.tar.bz2" 26 | LIBGCRYPT_URL="https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.10.3.tar.bz2" 27 | 28 | function download_and_extract() { 29 | local tarball ext_dir 30 | 31 | tarball=$(basename "$1") 32 | if ! [ -f "${tarball}" ]; then 33 | curl -LO "$1" 34 | fi 35 | 36 | ext_dir="$(tar -tf "${tarball}" | head -1 | tr -d '/')" 37 | if ! [ -d "${ext_dir}" ]; then 38 | tar -xf "${tarball}" 39 | fi 40 | 41 | echo "${ext_dir}" 42 | } 43 | 44 | NCORES=$(sysctl -n hw.ncpu) 45 | 46 | case "$(uname -m)" in 47 | "x86_64") 48 | CPU="amd64" 49 | macos_version_min_flags="-mmacosx-version-min=10.15" 50 | export MACOSX_DEPLOYMENT_TARGET=10.15 51 | ;; 52 | "arm64") 53 | CPU="aarch64" 54 | macos_version_min_flags="-mmacosx-version-min=11.0" 55 | export MACOSX_DEPLOYMENT_TARGET=11.0 56 | ;; 57 | *) 58 | echo "Unknown arch, exiting" 59 | exit 1 60 | ;; 61 | esac 62 | 63 | KERNEL_VERSION=$(uname -r) 64 | KERNEL_BUILD_FLAG="${CPU}-apple-darwin${KERNEL_VERSION%%.*}" # aarch64-apple-darwin21 65 | MACOS_MAJOR_VERSION=$(sw_vers | sed -n '2p' | awk '{print $2}' | cut -d. -f1) 66 | 67 | 68 | export CFLAGS="${macos_version_min_flags}" 69 | export CPPFLAGS="${macos_version_min_flags}" 70 | 71 | # the following are depenedencies of glib 72 | function build_lib_gettext() { 73 | # https://github.com/Homebrew/homebrew-core/blob/master/Formula/gettext.rb 74 | local source_dir 75 | source_dir=$(download_and_extract "${LIBGETTEXT_URL}") 76 | pushd "${source_dir}" || exit 77 | ./configure --disable-dependency-tracking \ 78 | --disable-silent-rules --disable-debug \ 79 | --prefix="$1" --with-included-glib \ 80 | --with-included-libcroco --with-included-libunistring \ 81 | --with-included-libxml --with-emacs \ 82 | --with-lispdir="$1/share/emacs/site-lisp/gettext" \ 83 | --disable-java --disable-csharp --without-git --without-cvs \ 84 | --without-xz --with-included-gettext 85 | make -j "${NCORES}" 86 | make install 87 | popd || exit 88 | } 89 | 90 | function build_lib_libffi() { 91 | # https://github.com/Homebrew/homebrew-core/blob/master/Formula/lib/libffi.rb 92 | local source_dir 93 | source_dir=$(download_and_extract "${LIBFFI_URL}") 94 | pushd "${source_dir}" || exit 95 | ./configure --disable-debug --disable-dependency-tracking --prefix="$1" --libdir="$1/lib" 96 | make install 97 | popd || exit 98 | } 99 | 100 | function build_lib_pcre2() { 101 | # https://github.com/Homebrew/homebrew-core/blob/master/Formula/pcre2.rb 102 | local source_dir 103 | source_dir=$(download_and_extract "${LIBPCRE2_URL}") 104 | pushd "${source_dir}" || exit 105 | ./configure --disable-dependency-tracking --prefix="$1" --enable-pcre2-16 \ 106 | --enable-pcre2-32 --enable-pcre2grep-libz --enable-pcre2grep-libbz2 --enable-jit \ 107 | --enable-pcre2test-libedit 108 | make -j "${NCORES}" 109 | make install 110 | popd || exit 111 | } 112 | 113 | function build_lib_glib() { 114 | # https://github.com/Homebrew/homebrew-core/blob/master/Formula/glib.rb 115 | local source_dir 116 | source_dir=$(download_and_extract "${LIBGLIB_URL}") 117 | pushd "${source_dir}" || exit 118 | mkdir build 119 | meson setup build --prefix="$1" --libdir="$1"/lib --buildtype=release \ 120 | --wrap-mode=nofallback --default-library=both --localstatedir=/var \ 121 | -Dgio_module_dir="$1"/lib/gio/modules -Dbsymbolic_functions=false -Ddtrace=false -Druntime_dir=/var/run 122 | meson compile -C build --verbose 123 | meson install -C build 124 | popd || exit 125 | } 126 | 127 | # # the following are dependencies of gnutls 128 | # function build_ca-certificates() { 129 | # # https://github.com/Homebrew/homebrew-core/blob/master/Formula/ca-certificates.rb 130 | # wget -q -c "${CA_CERTIFICATE_URL}" 131 | # CACERT_PATH=$(readlink -f "$(basename "${CA_CERTIFICATE_URL}")") 132 | # readonly CACERT_PATH 133 | # } 134 | 135 | # gmp is also directly used by qemu 136 | function build_lib_gmp() { 137 | # https://github.com/Homebrew/homebrew-core/blob/master/Formula/gmp.rb 138 | local source_dir 139 | source_dir=$(download_and_extract "${LIBGMP_URL}") 140 | pushd "${source_dir}" || exit 141 | # Regenerate configure to avoid flat namespace linking 142 | # Reported by email: https://gmplib.org/list-archives/gmp-bugs/2023-July/thread.html 143 | # Remove 'autoreconf' command below in next version 144 | autoreconf -i -s 145 | ./configure --prefix="$1" --libdir="$1"/lib --enable-cxx --with-pic --build="${KERNEL_BUILD_FLAG}" 146 | make -j "${NCORES}" 147 | make check -j "${NCORES}" 148 | make install 149 | popd || exit 150 | } 151 | 152 | # function build_lib_unistring() { 153 | # # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libunistring.rb 154 | # local source_dir 155 | # source_dir=$(download_and_extract "${LIBUNISTRING_URL}") 156 | # pushd "${source_dir}" || exit 157 | # ./configure --disable-dependency-tracking --disable-silent-rules --prefix="$1" 158 | # make -j "${NCORES}" 159 | # make check -j "${NCORES}" 160 | # make install 161 | # popd || exit 162 | # } 163 | 164 | # function build_lib_libidn2() { 165 | # # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libidn2.rb 166 | # local source_dir 167 | # source_dir=$(download_and_extract "${LIBIDN2_URL}") 168 | # pushd "${source_dir}" || exit 169 | # ./configure --disable-dependency-tracking --disable-silent-rules --prefix="$1" # --with-libintl-prefix="$1" 170 | # make install 171 | # popd || exit 172 | # } 173 | 174 | # function build_lib_zstd() { 175 | # # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/zstd.rb 176 | # local source_dir 177 | # source_dir=$(download_and_extract "${LIBZSTD_URL}") 178 | # pushd "${source_dir}" || exit 179 | # cmake -S build/cmake -B builddir -DZSTD_PROGRAMS_LINK_SHARED=ON -DZSTD_BUILD_CONTRIB=ON \ 180 | # -DCMAKE_INSTALL_RPATH="$1" -DZSTD_LEGACY_SUPPORT=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="$1" \ 181 | # -DCMAKE_INSTALL_LIBDIR="$1"/lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DBUILD_TESTING=OFF 182 | 183 | # cmake --build builddir 184 | # cmake --install builddir 185 | # popd || exit 186 | # } 187 | 188 | # function build_lib_libtasn1() { 189 | 190 | # } 191 | 192 | # function build_lib_brotli() { 193 | 194 | # } 195 | 196 | function build_lib_gpgerror() { 197 | # https://github.com/Homebrew/homebrew-core/blob/master/Formula/libgpg-error.rb 198 | local source_dir 199 | source_dir=$(download_and_extract "${LIBGPGERROR_URL}") 200 | pushd "${source_dir}" || exit 201 | ./configure --disable-dependency-tracking --disable-silent-rules --prefix="$1" --enable-static 202 | make install 203 | popd || exit 204 | } 205 | 206 | function build_lib_gcrypt() { 207 | # https://github.com/Homebrew/homebrew-core/blob/master/Formula/libgcrypt.rb 208 | local source_dir 209 | source_dir=$(download_and_extract "${LIBGCRYPT_URL}") 210 | pushd "${source_dir}" || exit 211 | ./configure --disable-dependency-tracking --disable-silent-rules --enable-static --prefix="$1" \ 212 | --disable-asm --with-libgpg-error-prefix="$1" 213 | make -C random rndjent.o rndjent.lo 214 | make -j "${NCORES}" 215 | make -j "${NCORES}" check 216 | make install 217 | popd || exit 218 | } 219 | 220 | # nettle is also directly used by qemu 221 | function build_lib_nettle() { 222 | # https://github.com/Homebrew/homebrew-core/blob/master/Formula/nettle.rb 223 | local source_dir 224 | source_dir=$(download_and_extract "${LIBNETTLE_URL}") 225 | pushd "${source_dir}" || exit 226 | ./configure --disable-debug --disable-dependency-tracking --prefix="$1" --libdir="$1/lib" --enable-shared 227 | make -j "${NCORES}" 228 | make install 229 | # some checks are failing 230 | # make check -j "${NCORES}" 231 | popd || exit 232 | } 233 | 234 | # function build_p11-kit() { 235 | 236 | # } 237 | 238 | # function build_unbound() { 239 | 240 | # } 241 | 242 | # function build_lib_gnutls() { 243 | # # https://github.com/Homebrew/homebrew-core/blob/master/Formula/gnutls.rb 244 | # local source_dir 245 | # source_dir=$(download_and_extract "${LIBGNUTLS_URL}") 246 | # pushd "${source_dir}" || exit 247 | # # bug in upstream look at the brew formulae for details 248 | # sed -i '' 's/AM_CCASFLAGS = -Wa,-march=all//1' lib/accelerated/aarch64/Makefile.in 249 | # CC=clang ./configure --disable-dependency-tracking --disable-silent-rules --prefix="$1" \ 250 | # --sysconfdir="$1"/etc --with-default-trust-store-file="${CACERT_PATH}" --disable-heartbeat-support \ 251 | # --without-p11-kit --with-included-unistring --with-included-libtasn1 252 | # make install 253 | # popd || exit 254 | # } 255 | 256 | # following are exclusive direct dependencies of qemu 257 | function build_lib_jpeg() { 258 | # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/jpeg.rb 259 | local source_dir 260 | source_dir=$(download_and_extract "${LIBJPEG_URL}") 261 | pushd "${source_dir}" || exit 262 | ./configure --disable-dependency-tracking --disable-silent-rules --prefix="$1" 263 | make install 264 | popd || exit 265 | } 266 | 267 | function build_lib_libpng() { 268 | # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libpng.rb 269 | local source_dir 270 | source_dir=$(download_and_extract "${LIBPNG_URL}") 271 | pushd "${source_dir}" 272 | ./configure --disable-dependency-tracking --disable-silent-rules --prefix="$1" 273 | make -j "${NCORES}" 274 | make test -j "${NCORES}" 275 | make install 276 | popd 277 | } 278 | 279 | function build_lib_libslirp() { 280 | # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libslirp.rb 281 | local source_dir 282 | source_dir=$(download_and_extract "${LIBSLIRP_URL}") 283 | pushd "${source_dir}" 284 | meson build -Ddefault_library=both --prefix="$1" --libdir="$1"/lib --buildtype=release --wrap-mode=nofallback 285 | ninja -C build install all 286 | popd 287 | } 288 | 289 | # function build_lib_openssl() { 290 | # # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openssl@1.1.rb 291 | # local source_dir 292 | # source_dir=$(download_and_extract "${LIBOPENSSL11_URL}") 293 | # pushd "${source_dir}" 294 | # local cpu_arch 295 | # cpu_arch=$(uname -m) 296 | # perl ./Configure --prefix="$1" --openssldir="$1"/etc/openssl@1.1 no-ssl3 no-ssl3-method no-zlib \ 297 | # darwin64-"${cpu_arch}"-cc enable-ec_nistp_64_gcc_128 298 | 299 | # make -j "${NCORES}" 300 | # make install MANDIR="$1"/man MANSUFFIX=ssl 301 | # } 302 | 303 | # function build_lib_libssh() { 304 | 305 | # } 306 | 307 | function build_lib_libusb() { 308 | # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libusb.rb 309 | local source_dir 310 | source_dir=$(download_and_extract "${LIBUSB_URL}") 311 | pushd "${source_dir}" 312 | ./configure --disable-dependency-tracking --prefix="$1" 313 | make install 314 | popd 315 | } 316 | 317 | function build_lib_lzo() { 318 | # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/lzo.rb 319 | local source_dir 320 | source_dir=$(download_and_extract "${LIBLZO_URL}") 321 | pushd "${source_dir}" 322 | ./configure --disable-dependency-tracking --prefix="$1" --enable-shared 323 | make -j "${NCORES}" 324 | make check -j "${NCORES}" 325 | make install 326 | popd 327 | } 328 | 329 | # function build_lib_ncurses() { 330 | 331 | # } 332 | 333 | function build_lib_pixman() { 334 | # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/pixman.rb 335 | local source_dir 336 | source_dir=$(download_and_extract "${LIBPIXMAN_URL}") 337 | pushd "${source_dir}" 338 | ./configure --disable-dependency-tracking --disable-gtk --disable-silent-rules --disable-arm-a64-neon --prefix="$1" 339 | make install 340 | popd 341 | } 342 | 343 | function build_lib_snappy() { 344 | # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/snappy.rb 345 | # uses different name for the archive then the name of resource in the URL 346 | local tarball source_dir 347 | tarball=snappy-$(basename "${LIBSNAPPY_URL}") 348 | if ! [ -f "${tarball}" ]; then 349 | curl -L "${LIBSNAPPY_URL}" -o ${tarball} 350 | fi 351 | source_dir="$(tar -tf "${tarball}" | head -1 | tr -d '/')" 352 | if ! [ -d "${source_dir}" ]; then 353 | tar -xf "${tarball}" 354 | fi 355 | 356 | pushd "${source_dir}" 357 | CXXFLAGS="-Werror,-Wsign-compare" cmake . -DCMAKE_INSTALL_NAME_DIR="$1"/lib -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF \ 358 | -DCMAKE_INSTALL_PREFIX="$1" -DCMAKE_INSTALL_LIBDIR="$1"/lib -DCMAKE_BUILD_TYPE=Release \ 359 | -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/"MacOSX${MACOS_MAJOR_VERSION}".sdk 360 | 361 | make install 362 | make clean 363 | CXXFLAGS="-Werror,-Wsign-compare" cmake . -DCMAKE_INSTALL_NAME_DIR="$1"/lib -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF \ 364 | -DCMAKE_INSTALL_PREFIX="$1" -DCMAKE_INSTALL_LIBDIR="$1"/lib -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON \ 365 | -Wno-dev -DBUILD_SHARED_LIBS=ON -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/"MacOSX${MACOS_MAJOR_VERSION}".sdk 366 | make install 367 | popd 368 | } 369 | 370 | function build_lib_vde2() { 371 | # https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/vde.rb 372 | local source_dir 373 | source_dir=$(download_and_extract "${LIBVDE2_URL}") 374 | pushd "${source_dir}" 375 | autoreconf --install 376 | ./configure --prefix="$1" --disable-python 377 | make install 378 | popd 379 | } 380 | --------------------------------------------------------------------------------