tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

build-dmg-hfsplus.sh (1265B)


      1 #!/bin/bash
      2 set -x -e -v
      3 
      4 # This script is for building libdmg-hfsplus to get the `dmg` and `hfsplus`
      5 # tools for producing DMG archives on Linux.
      6 
      7 WORKSPACE=$HOME/workspace
      8 STAGE=$WORKSPACE/dmg
      9 
     10 mkdir -p $UPLOAD_DIR $STAGE
     11 
     12 cd $MOZ_FETCHES_DIR/libdmg-hfsplus
     13 
     14 # The openssl libraries in the sysroot cannot be linked in a PIE executable so we use -no-pie
     15 cmake \
     16  -DCMAKE_C_COMPILER=$MOZ_FETCHES_DIR/clang/bin/clang \
     17  -DCMAKE_CXX_COMPILER=$MOZ_FETCHES_DIR/clang/bin/clang++ \
     18  -DCMAKE_SYSROOT=$MOZ_FETCHES_DIR/sysroot \
     19  -DOPENSSL_USE_STATIC_LIBS=1 \
     20  -DCMAKE_EXE_LINKER_FLAGS=-no-pie \
     21  -DCMAKE_BUILD_TYPE=Release \
     22  .
     23 
     24 make VERBOSE=1 -j$(nproc)
     25 
     26 # Assert that lzma compression was built
     27 ./dmg/dmg | grep -q lzma
     28 
     29 # We only need the dmg and hfsplus tools.
     30 strip dmg/dmg hfs/hfsplus
     31 cp dmg/dmg hfs/hfsplus $STAGE
     32 
     33 # duplicate the functionality of taskcluster-lib-urls, but in bash..
     34 queue_base="$TASKCLUSTER_ROOT_URL/api/queue/v1"
     35 
     36 cat >$STAGE/README<<EOF
     37 Source is available as a taskcluster artifact:
     38 $queue_base/task/$(python3 -c 'import json, os; print("{task}/artifacts/{artifact}".format(**next(f for f in json.loads(os.environ["MOZ_FETCHES"]) if "dmg-hfsplus" in f["artifact"])))')
     39 EOF
     40 tar caf $UPLOAD_DIR/dmg.tar.zst -C $WORKSPACE `basename $STAGE`